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 32499
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 6598 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝑥))
2 f1oeq3 6599 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝐴1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
31, 2bitrd 282 . . . . 5 (𝑥 = 𝐴 → (𝑓:𝑥1-1-onto𝑥𝑓:𝐴1-1-onto𝐴))
4 raleq 3396 . . . . 5 (𝑥 = 𝐴 → (∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦 ↔ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦))
53, 4anbi12d 633 . . . 4 (𝑥 = 𝐴 → ((𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦) ↔ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)))
65abbidv 2888 . . 3 (𝑥 = 𝐴 → {𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)} = {𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)})
76fveq2d 6667 . 2 (𝑥 = 𝐴 → (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
8 derang.d . 2 𝐷 = (𝑥 ∈ Fin ↦ (♯‘{𝑓 ∣ (𝑓:𝑥1-1-onto𝑥 ∧ ∀𝑦𝑥 (𝑓𝑦) ≠ 𝑦)}))
9 fvex 6676 . 2 (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}) ∈ V
107, 8, 9fvmpt 6761 1 (𝐴 ∈ Fin → (𝐷𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴1-1-onto𝐴 ∧ ∀𝑦𝐴 (𝑓𝑦) ≠ 𝑦)}))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399   = wceq 1538  wcel 2115  {cab 2802  wne 3014  wral 3133  cmpt 5133  1-1-ontowf1o 6344  cfv 6345  Fincfn 8507  chash 13697
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1912  ax-6 1971  ax-7 2016  ax-8 2117  ax-9 2125  ax-10 2146  ax-11 2162  ax-12 2179  ax-ext 2796  ax-sep 5190  ax-nul 5197  ax-pr 5318
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2071  df-mo 2624  df-eu 2655  df-clab 2803  df-cleq 2817  df-clel 2896  df-nfc 2964  df-ral 3138  df-rex 3139  df-v 3482  df-sbc 3759  df-dif 3922  df-un 3924  df-in 3926  df-ss 3936  df-nul 4277  df-if 4451  df-sn 4551  df-pr 4553  df-op 4557  df-uni 4825  df-br 5054  df-opab 5116  df-mpt 5134  df-id 5448  df-xp 5549  df-rel 5550  df-cnv 5551  df-co 5552  df-dm 5553  df-iota 6304  df-fun 6347  df-fn 6348  df-f 6349  df-f1 6350  df-fo 6351  df-f1o 6352  df-fv 6353
This theorem is referenced by:  derang0  32501  derangsn  32502  derangenlem  32503  subfaclefac  32508  subfacp1lem3  32514  subfacp1lem5  32516  subfacp1lem6  32517
  Copyright terms: Public domain W3C validator