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

Theorem derangval 31149
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 6128 . . . . . 6  |-  ( x  =  A  ->  (
f : x -1-1-onto-> x  <->  f : A
-1-1-onto-> x ) )
2 f1oeq3 6129 . . . . . 6  |-  ( x  =  A  ->  (
f : A -1-1-onto-> x  <->  f : A
-1-1-onto-> A ) )
31, 2bitrd 268 . . . . 5  |-  ( x  =  A  ->  (
f : x -1-1-onto-> x  <->  f : A
-1-1-onto-> A ) )
4 raleq 3138 . . . . 5  |-  ( x  =  A  ->  ( A. y  e.  x  ( f `  y
)  =/=  y  <->  A. y  e.  A  ( f `  y )  =/=  y
) )
53, 4anbi12d 747 . . . 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 2741 . . 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 6195 . 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 6201 . 2  |-  ( # `  { f  |  ( f : A -1-1-onto-> A  /\  A. y  e.  A  ( f `  y )  =/=  y ) } )  e.  _V
107, 8, 9fvmpt 6282 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 384    = wceq 1483    e. wcel 1990   {cab 2608    =/= wne 2794   A.wral 2912    |-> cmpt 4729   -1-1-onto->wf1o 5887   ` cfv 5888   Fincfn 7955   #chash 13117
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1722  ax-4 1737  ax-5 1839  ax-6 1888  ax-7 1935  ax-9 1999  ax-10 2019  ax-11 2034  ax-12 2047  ax-13 2246  ax-ext 2602  ax-sep 4781  ax-nul 4789  ax-pr 4906
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3an 1039  df-tru 1486  df-ex 1705  df-nf 1710  df-sb 1881  df-eu 2474  df-mo 2475  df-clab 2609  df-cleq 2615  df-clel 2618  df-nfc 2753  df-ral 2917  df-rex 2918  df-rab 2921  df-v 3202  df-sbc 3436  df-dif 3577  df-un 3579  df-in 3581  df-ss 3588  df-nul 3916  df-if 4087  df-sn 4178  df-pr 4180  df-op 4184  df-uni 4437  df-br 4654  df-opab 4713  df-mpt 4730  df-id 5024  df-xp 5120  df-rel 5121  df-cnv 5122  df-co 5123  df-dm 5124  df-iota 5851  df-fun 5890  df-fn 5891  df-f 5892  df-f1 5893  df-fo 5894  df-f1o 5895  df-fv 5896
This theorem is referenced by:  derang0  31151  derangsn  31152  derangenlem  31153  subfaclefac  31158  subfacp1lem3  31164  subfacp1lem5  31166  subfacp1lem6  31167
  Copyright terms: Public domain W3C validator