Users' Mathboxes Mathbox for Thierry Arnoux < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  ballotlemfmpn Structured version   Unicode version

Theorem ballotlemfmpn 24752
Description:  ( F `  C ) finishes counting at  ( M  -  N ). (Contributed by Thierry Arnoux, 25-Nov-2016.)
Hypotheses
Ref Expression
ballotth.m  |-  M  e.  NN
ballotth.n  |-  N  e.  NN
ballotth.o  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
ballotth.p  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
ballotth.f  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
Assertion
Ref Expression
ballotlemfmpn  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( M  -  N
) )
Distinct variable groups:    M, c    N, c    O, c    i, M   
i, N    i, O, c    F, c, i    C, i
Allowed substitution hints:    C( x, c)    P( x, i, c)    F( x)    M( x)    N( x)    O( x)

Proof of Theorem ballotlemfmpn
Dummy variable  b is distinct from all other variables.
StepHypRef Expression
1 ballotth.m . . 3  |-  M  e.  NN
2 ballotth.n . . 3  |-  N  e.  NN
3 ballotth.o . . 3  |-  O  =  { c  e.  ~P ( 1 ... ( M  +  N )
)  |  ( # `  c )  =  M }
4 ballotth.p . . 3  |-  P  =  ( x  e.  ~P O  |->  ( ( # `  x )  /  ( # `
 O ) ) )
5 ballotth.f . . 3  |-  F  =  ( c  e.  O  |->  ( i  e.  ZZ  |->  ( ( # `  (
( 1 ... i
)  i^i  c )
)  -  ( # `  ( ( 1 ... i )  \  c
) ) ) ) )
6 id 20 . . 3  |-  ( C  e.  O  ->  C  e.  O )
7 nnaddcl 10022 . . . . . 6  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( M  +  N
)  e.  NN )
81, 2, 7mp2an 654 . . . . 5  |-  ( M  +  N )  e.  NN
98nnzi 10305 . . . 4  |-  ( M  +  N )  e.  ZZ
109a1i 11 . . 3  |-  ( C  e.  O  ->  ( M  +  N )  e.  ZZ )
111, 2, 3, 4, 5, 6, 10ballotlemfval 24747 . 2  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( ( # `  (
( 1 ... ( M  +  N )
)  i^i  C )
)  -  ( # `  ( ( 1 ... ( M  +  N
) )  \  C
) ) ) )
12 ssrab2 3428 . . . . . . . . 9  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
~P ( 1 ... ( M  +  N
) )
133, 12eqsstri 3378 . . . . . . . 8  |-  O  C_  ~P ( 1 ... ( M  +  N )
)
1413sseli 3344 . . . . . . 7  |-  ( C  e.  O  ->  C  e.  ~P ( 1 ... ( M  +  N
) ) )
1514elpwid 3808 . . . . . 6  |-  ( C  e.  O  ->  C  C_  ( 1 ... ( M  +  N )
) )
16 dfss1 3545 . . . . . 6  |-  ( C 
C_  ( 1 ... ( M  +  N
) )  <->  ( (
1 ... ( M  +  N ) )  i^i 
C )  =  C )
1715, 16sylib 189 . . . . 5  |-  ( C  e.  O  ->  (
( 1 ... ( M  +  N )
)  i^i  C )  =  C )
1817fveq2d 5732 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  ( # `  C
) )
19 rabssab 3430 . . . . . . 7  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
{ c  |  (
# `  c )  =  M }
2019sseli 3344 . . . . . 6  |-  ( C  e.  { c  e. 
~P ( 1 ... ( M  +  N
) )  |  (
# `  c )  =  M }  ->  C  e.  { c  |  (
# `  c )  =  M } )
2120, 3eleq2s 2528 . . . . 5  |-  ( C  e.  O  ->  C  e.  { c  |  (
# `  c )  =  M } )
22 fveq2 5728 . . . . . . 7  |-  ( b  =  C  ->  ( # `
 b )  =  ( # `  C
) )
2322eqeq1d 2444 . . . . . 6  |-  ( b  =  C  ->  (
( # `  b )  =  M  <->  ( # `  C
)  =  M ) )
24 fveq2 5728 . . . . . . . 8  |-  ( c  =  b  ->  ( # `
 c )  =  ( # `  b
) )
2524eqeq1d 2444 . . . . . . 7  |-  ( c  =  b  ->  (
( # `  c )  =  M  <->  ( # `  b
)  =  M ) )
2625cbvabv 2555 . . . . . 6  |-  { c  |  ( # `  c
)  =  M }  =  { b  |  (
# `  b )  =  M }
2723, 26elab2g 3084 . . . . 5  |-  ( C  e.  O  ->  ( C  e.  { c  |  ( # `  c
)  =  M }  <->  (
# `  C )  =  M ) )
2821, 27mpbid 202 . . . 4  |-  ( C  e.  O  ->  ( # `
 C )  =  M )
2918, 28eqtrd 2468 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  M )
30 fzfi 11311 . . . . 5  |-  ( 1 ... ( M  +  N ) )  e. 
Fin
31 hashssdif 11677 . . . . 5  |-  ( ( ( 1 ... ( M  +  N )
)  e.  Fin  /\  C  C_  ( 1 ... ( M  +  N
) ) )  -> 
( # `  ( ( 1 ... ( M  +  N ) ) 
\  C ) )  =  ( ( # `  ( 1 ... ( M  +  N )
) )  -  ( # `
 C ) ) )
3230, 15, 31sylancr 645 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  ( ( # `  (
1 ... ( M  +  N ) ) )  -  ( # `  C
) ) )
338nnnn0i 10229 . . . . . 6  |-  ( M  +  N )  e. 
NN0
34 hashfz1 11630 . . . . . 6  |-  ( ( M  +  N )  e.  NN0  ->  ( # `  ( 1 ... ( M  +  N )
) )  =  ( M  +  N ) )
3533, 34mp1i 12 . . . . 5  |-  ( C  e.  O  ->  ( # `
 ( 1 ... ( M  +  N
) ) )  =  ( M  +  N
) )
3635, 28oveq12d 6099 . . . 4  |-  ( C  e.  O  ->  (
( # `  ( 1 ... ( M  +  N ) ) )  -  ( # `  C
) )  =  ( ( M  +  N
)  -  M ) )
371nncni 10010 . . . . . 6  |-  M  e.  CC
382nncni 10010 . . . . . 6  |-  N  e.  CC
39 pncan2 9312 . . . . . 6  |-  ( ( M  e.  CC  /\  N  e.  CC )  ->  ( ( M  +  N )  -  M
)  =  N )
4037, 38, 39mp2an 654 . . . . 5  |-  ( ( M  +  N )  -  M )  =  N
4140a1i 11 . . . 4  |-  ( C  e.  O  ->  (
( M  +  N
)  -  M )  =  N )
4232, 36, 413eqtrd 2472 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  N )
4329, 42oveq12d 6099 . 2  |-  ( C  e.  O  ->  (
( # `  ( ( 1 ... ( M  +  N ) )  i^i  C ) )  -  ( # `  (
( 1 ... ( M  +  N )
)  \  C )
) )  =  ( M  -  N ) )
4411, 43eqtrd 2468 1  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( M  -  N
) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    = wceq 1652    e. wcel 1725   {cab 2422   {crab 2709    \ cdif 3317    i^i cin 3319    C_ wss 3320   ~Pcpw 3799    e. cmpt 4266   ` cfv 5454  (class class class)co 6081   Fincfn 7109   CCcc 8988   1c1 8991    + caddc 8993    - cmin 9291    / cdiv 9677   NNcn 10000   NN0cn0 10221   ZZcz 10282   ...cfz 11043   #chash 11618
This theorem is referenced by:  ballotlem5  24757
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2417  ax-rep 4320  ax-sep 4330  ax-nul 4338  ax-pow 4377  ax-pr 4403  ax-un 4701  ax-cnex 9046  ax-resscn 9047  ax-1cn 9048  ax-icn 9049  ax-addcl 9050  ax-addrcl 9051  ax-mulcl 9052  ax-mulrcl 9053  ax-mulcom 9054  ax-addass 9055  ax-mulass 9056  ax-distr 9057  ax-i2m1 9058  ax-1ne0 9059  ax-1rid 9060  ax-rnegex 9061  ax-rrecex 9062  ax-cnre 9063  ax-pre-lttri 9064  ax-pre-lttrn 9065  ax-pre-ltadd 9066  ax-pre-mulgt0 9067
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2285  df-mo 2286  df-clab 2423  df-cleq 2429  df-clel 2432  df-nfc 2561  df-ne 2601  df-nel 2602  df-ral 2710  df-rex 2711  df-reu 2712  df-rmo 2713  df-rab 2714  df-v 2958  df-sbc 3162  df-csb 3252  df-dif 3323  df-un 3325  df-in 3327  df-ss 3334  df-pss 3336  df-nul 3629  df-if 3740  df-pw 3801  df-sn 3820  df-pr 3821  df-tp 3822  df-op 3823  df-uni 4016  df-int 4051  df-iun 4095  df-br 4213  df-opab 4267  df-mpt 4268  df-tr 4303  df-eprel 4494  df-id 4498  df-po 4503  df-so 4504  df-fr 4541  df-we 4543  df-ord 4584  df-on 4585  df-lim 4586  df-suc 4587  df-om 4846  df-xp 4884  df-rel 4885  df-cnv 4886  df-co 4887  df-dm 4888  df-rn 4889  df-res 4890  df-ima 4891  df-iota 5418  df-fun 5456  df-fn 5457  df-f 5458  df-f1 5459  df-fo 5460  df-f1o 5461  df-fv 5462  df-ov 6084  df-oprab 6085  df-mpt2 6086  df-1st 6349  df-2nd 6350  df-riota 6549  df-recs 6633  df-rdg 6668  df-1o 6724  df-oadd 6728  df-er 6905  df-en 7110  df-dom 7111  df-sdom 7112  df-fin 7113  df-card 7826  df-cda 8048  df-pnf 9122  df-mnf 9123  df-xr 9124  df-ltxr 9125  df-le 9126  df-sub 9293  df-neg 9294  df-nn 10001  df-n0 10222  df-z 10283  df-uz 10489  df-fz 11044  df-hash 11619
  Copyright terms: Public domain W3C validator