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 31481
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 6269 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝑥))
2 f1oeq3 6270 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝐴1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
31, 2bitrd 268 . . . . 5 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
4 raleq 3286 . . . . 5 (𝑥 = 𝐴 → (∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦 ↔ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦))
53, 4anbi12d 608 . . . 4 (𝑥 = 𝐴 → ((𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦) ↔ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)))
65abbidv 2889 . . 3 (𝑥 = 𝐴 → {𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)} = {𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)})
76fveq2d 6336 . 2 (𝑥 = 𝐴 → (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
8 derang.d . 2 𝐷 = (𝑥 ∈ Fin ↦ (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}))
9 fvex 6342 . 2 (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}) ∈ V
107, 8, 9fvmpt 6424 1 (𝐴 ∈ Fin → (𝐷𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1630  wcel 2144  {cab 2756  wne 2942  wral 3060  cmpt 4861  1-1-ontowf1o 6030  cfv 6031  Fincfn 8108  chash 13320
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1869  ax-4 1884  ax-5 1990  ax-6 2056  ax-7 2092  ax-9 2153  ax-10 2173  ax-11 2189  ax-12 2202  ax-13 2407  ax-ext 2750  ax-sep 4912  ax-nul 4920  ax-pr 5034
This theorem depends on definitions:  df-bi 197  df-an 383  df-or 827  df-3an 1072  df-tru 1633  df-ex 1852  df-nf 1857  df-sb 2049  df-eu 2621  df-mo 2622  df-clab 2757  df-cleq 2763  df-clel 2766  df-nfc 2901  df-ral 3065  df-rex 3066  df-rab 3069  df-v 3351  df-sbc 3586  df-dif 3724  df-un 3726  df-in 3728  df-ss 3735  df-nul 4062  df-if 4224  df-sn 4315  df-pr 4317  df-op 4321  df-uni 4573  df-br 4785  df-opab 4845  df-mpt 4862  df-id 5157  df-xp 5255  df-rel 5256  df-cnv 5257  df-co 5258  df-dm 5259  df-iota 5994  df-fun 6033  df-fn 6034  df-f 6035  df-f1 6036  df-fo 6037  df-f1o 6038  df-fv 6039
This theorem is referenced by:  derang0  31483  derangsn  31484  derangenlem  31485  subfaclefac  31490  subfacp1lem3  31496  subfacp1lem5  31498  subfacp1lem6  31499
  Copyright terms: Public domain W3C validator