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 36112
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-1onto𝑥 ∧ ∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦)}))
Assertion
Ref Expression
derangval (𝐴 ∈ Fin → (𝐷‘𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)}))
Distinct variable group:   𝑥,𝑓,𝑦,𝐴
Allowed substitution hints:   𝐷(𝑥, 𝑦, 𝑓)

Proof of Theorem derangval
StepHypRef Expression
1 f1oeq2 6838 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝑥⟶1-1onto𝑥 ↔ 𝑓:𝐴⟶1-1onto𝑥))
2 f1oeq3 6839 . . . . . 6 (𝑥 = 𝐴 → (𝑓:𝐴⟶1-1onto𝑥 ↔ 𝑓:𝐴⟶1-1onto𝐴))
31, 2bitrd 282 . . . . 5 (𝑥 = 𝐴 → (𝑓:𝑥⟶1-1onto𝑥 ↔ 𝑓:𝐴⟶1-1onto𝐴))
4 raleq 3320 . . . . 5 (𝑥 = 𝐴 → (∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦 ↔ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦))
53, 4anbi12d 644 . . . 4 (𝑥 = 𝐴 → ((𝑓:𝑥⟶1-1onto𝑥 ∧ ∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦) ↔ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)))
65abbidv 2829 . . 3 (𝑥 = 𝐴 → {𝑓 ∣ (𝑓:𝑥⟶1-1onto𝑥 ∧ ∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦)} = {𝑓 ∣ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)})
76fveq2d 6915 . 2 (𝑥 = 𝐴 → (♯‘{𝑓 ∣ (𝑓:𝑥⟶1-1onto𝑥 ∧ ∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦)}) = (♯‘{𝑓 ∣ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)}))
8 derang.d . 2 𝐷 = (𝑥 ∈ Fin ↦ (♯‘{𝑓 ∣ (𝑓:𝑥⟶1-1onto𝑥 ∧ ∀𝑦 ∈ 𝑥 (𝑓‘𝑦) ≠ 𝑦)}))
9 fvex 6924 . 2 (♯‘{𝑓 ∣ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)}) ∈ V
107, 8, 9fvmpt 7019 1 (𝐴 ∈ Fin → (𝐷‘𝐴) = (♯‘{𝑓 ∣ (𝑓:𝐴⟶1-1onto𝐴 ∧ ∀𝑦 ∈ 𝐴 (𝑓‘𝑦) ≠ 𝑦)}))
Colors of variables:    wff setvar class
This proof depends on syntax axioms:   → wi 4   ∧ wa 401   = wceq 1570   ∈ wcel 2147  {cab 2741   ≠ wne 2959  ∀wral 3080   ↦ cmpt 5190  ⟶1-1ontowf1o 6560  ‘cfv 6561  Fincfn 9004  ♯chash 14504
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1828  ax-4 1842  ax-5 1945  ax-6 2002  ax-7 2043  ax-8 2149  ax-9 2157  ax-10 2180  ax-11 2197  ax-12 2216  ax-ext 2735  ax-sep 5253  ax-nul 5264  ax-pr 5396
This proof depends on definitions:  df-bi 210  df-an 402  df-or 862  df-3an 1105  df-tru 1573  df-fal 1583  df-ex 1813  df-nf 1817  df-sb 2102  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2839  df-nfc 2913  df-ne 2960  df-ral 3081  df-rex 3091  df-rab 3417  df-v 3456  df-ss 3901  df-dif 4050  df-in 4094  df-un 4154  df-nul 4282  df-if 4486  df-sn 4589  df-pr 4591  df-op 4839  df-uni 4871  df-br 5107  df-opab 5172  df-mpt 5191  df-id 5551  df-xp 5662  df-rel 5663  df-cnv 5664  df-co 5665  df-dm 5666  df-iota 6515  df-fun 6563  df-fn 6564  df-f 6565  df-f1 6566  df-fo 6567  df-f1o 6568  df-fv 6569
This theorem is used by:  derang0  36114  derangsn  36115  derangenlem  36116  subfaclefac  36121  subfacp1lem3  36127  subfacp1lem5  36129  subfacp1lem6  36130
  Copyright terms: Public domain W3C validator