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

Theorem derangval 29719
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  |-  D  =  ( x  e.  Fin  |->  ( # `  { f  |  ( f : x -1-1-onto-> x  /\  A. y  e.  x  ( f `  y )  =/=  y
) } ) )
Assertion
Ref Expression
derangval  |-  ( A  e.  Fin  ->  ( D `  A )  =  ( # `  {
f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y
) } ) )
Distinct variable group:    x, f, y, A
Allowed substitution hints:    D( x, y, f)

Proof of Theorem derangval
StepHypRef Expression
1 f1oeq2 5814 . . . . . 6  |-  ( x  =  A  ->  (
f : x -1-1-onto-> x  <->  f : A
-1-1-onto-> x ) )
2 f1oeq3 5815 . . . . . 6  |-  ( x  =  A  ->  (
f : A -1-1-onto-> x  <->  f : A
-1-1-onto-> A ) )
31, 2bitrd 256 . . . . 5  |-  ( x  =  A  ->  (
f : x -1-1-onto-> x  <->  f : A
-1-1-onto-> A ) )
4 raleq 3023 . . . . 5  |-  ( x  =  A  ->  ( A. y  e.  x  ( f `  y
)  =/=  y  <->  A. y  e.  A  ( f `  y )  =/=  y
) )
53, 4anbi12d 715 . . . 4  |-  ( x  =  A  ->  (
( f : x -1-1-onto-> x  /\  A. y  e.  x  ( f `  y )  =/=  y
)  <->  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y
) ) )
65abbidv 2556 . . 3  |-  ( x  =  A  ->  { f  |  ( f : x -1-1-onto-> x  /\  A. y  e.  x  ( f `  y )  =/=  y
) }  =  {
f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y
) } )
76fveq2d 5876 . 2  |-  ( x  =  A  ->  ( # `
 { f  |  ( f : x -1-1-onto-> x  /\  A. y  e.  x  ( f `  y )  =/=  y
) } )  =  ( # `  {
f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y
) } ) )
8 derang.d . 2  |-  D  =  ( x  e.  Fin  |->  ( # `  { f  |  ( f : x -1-1-onto-> x  /\  A. y  e.  x  ( f `  y )  =/=  y
) } ) )
9 fvex 5882 . 2  |-  ( # `  { f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y ) } )  e.  _V
107, 8, 9fvmpt 5955 1  |-  ( A  e.  Fin  ->  ( D `  A )  =  ( # `  {
f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y
) } ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 370    = wceq 1437    e. wcel 1867   {cab 2405    =/= wne 2616   A.wral 2773    |-> cmpt 4475   -1-1-onto->wf1o 5591   ` cfv 5592   Fincfn 7568   #chash 12501
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1665  ax-4 1678  ax-5 1748  ax-6 1794  ax-7 1838  ax-9 1871  ax-10 1886  ax-11 1891  ax-12 1904  ax-13 2052  ax-ext 2398  ax-sep 4539  ax-nul 4547  ax-pr 4652
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3an 984  df-tru 1440  df-ex 1660  df-nf 1664  df-sb 1787  df-eu 2267  df-mo 2268  df-clab 2406  df-cleq 2412  df-clel 2415  df-nfc 2570  df-ne 2618  df-ral 2778  df-rex 2779  df-rab 2782  df-v 3080  df-sbc 3297  df-dif 3436  df-un 3438  df-in 3440  df-ss 3447  df-nul 3759  df-if 3907  df-sn 3994  df-pr 3996  df-op 4000  df-uni 4214  df-br 4418  df-opab 4476  df-mpt 4477  df-id 4760  df-xp 4851  df-rel 4852  df-cnv 4853  df-co 4854  df-dm 4855  df-iota 5556  df-fun 5594  df-fn 5595  df-f 5596  df-f1 5597  df-fo 5598  df-f1o 5599  df-fv 5600
This theorem is referenced by:  derang0  29721  derangsn  29722  derangenlem  29723  subfaclefac  29728  subfacp1lem3  29734  subfacp1lem5  29736  subfacp1lem6  29737
  Copyright terms: Public domain W3C validator