Users' Mathboxes Mathbox for Mario Carneiro < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  derangval Structured version   Visualization version   GIF version

Theorem derangval 31487
Description: Define the derangement function, which counts the number of bijections from a set to itself such that no element is mapped to itself. (Contributed by Mario Carneiro, 19-Jan-2015.)
Hypothesis
Ref Expression
derang.d 𝐷 = (𝑥 ∈ Fin ↦ (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}))
Assertion
Ref Expression
derangval (𝐴 ∈ Fin → (𝐷𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
Distinct variable group:   𝑥,𝑓,𝑦,𝐴
Allowed substitution hints:   𝐷(𝑥,𝑦,𝑓)

Proof of Theorem derangval
StepHypRef Expression
1 f1oeq2 6270 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝑥))
2 f1oeq3 6271 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝐴1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
31, 2bitrd 268 . . . . 5 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
4 raleq 3287 . . . . 5 (𝑥 = 𝐴 → (∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦 ↔ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦))
53, 4anbi12d 616 . . . 4 (𝑥 = 𝐴 → ((𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦) ↔ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)))
65abbidv 2890 . . 3 (𝑥 = 𝐴 → {𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)} = {𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)})
76fveq2d 6337 . 2 (𝑥 = 𝐴 → (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
8 derang.d . 2 𝐷 = (𝑥 ∈ Fin ↦ (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}))
9 fvex 6344 . 2 (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}) ∈ V
107, 8, 9fvmpt 6426 1 (𝐴 ∈ Fin → (𝐷𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1631  wcel 2145  {cab 2757  wne 2943  wral 3061  cmpt 4864  1-1-ontowf1o 6029  cfv 6030  Fincfn 8113  chash 13321
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1870  ax-4 1885  ax-5 1991  ax-6 2057  ax-7 2093  ax-9 2154  ax-10 2174  ax-11 2190  ax-12 2203  ax-13 2408  ax-ext 2751  ax-sep 4916  ax-nul 4924  ax-pr 5035
This theorem depends on definitions:  df-bi 197  df-an 383  df-or 837  df-3an 1073  df-tru 1634  df-ex 1853  df-nf 1858  df-sb 2050  df-eu 2622  df-mo 2623  df-clab 2758  df-cleq 2764  df-clel 2767  df-nfc 2902  df-ral 3066  df-rex 3067  df-rab 3070  df-v 3353  df-sbc 3588  df-dif 3726  df-un 3728  df-in 3730  df-ss 3737  df-nul 4064  df-if 4227  df-sn 4318  df-pr 4320  df-op 4324  df-uni 4576  df-br 4788  df-opab 4848  df-mpt 4865  df-id 5158  df-xp 5256  df-rel 5257  df-cnv 5258  df-co 5259  df-dm 5260  df-iota 5993  df-fun 6032  df-fn 6033  df-f 6034  df-f1 6035  df-fo 6036  df-f1o 6037  df-fv 6038
This theorem is referenced by:  derang0  31489  derangsn  31490  derangenlem  31491  subfaclefac  31496  subfacp1lem3  31502  subfacp1lem5  31504  subfacp1lem6  31505
  Copyright terms: Public domain W3C validator