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

Theorem ballotlemfmpn 28939
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 22 . . 3  |-  ( C  e.  O  ->  C  e.  O )
7 nnaddcl 10598 . . . . . 6  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( M  +  N
)  e.  NN )
81, 2, 7mp2an 670 . . . . 5  |-  ( M  +  N )  e.  NN
98nnzi 10929 . . . 4  |-  ( M  +  N )  e.  ZZ
109a1i 11 . . 3  |-  ( C  e.  O  ->  ( M  +  N )  e.  ZZ )
111, 2, 3, 4, 5, 6, 10ballotlemfval 28934 . 2  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( ( # `  (
( 1 ... ( M  +  N )
)  i^i  C )
)  -  ( # `  ( ( 1 ... ( M  +  N
) )  \  C
) ) ) )
12 ssrab2 3524 . . . . . . . . 9  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
~P ( 1 ... ( M  +  N
) )
133, 12eqsstri 3472 . . . . . . . 8  |-  O  C_  ~P ( 1 ... ( M  +  N )
)
1413sseli 3438 . . . . . . 7  |-  ( C  e.  O  ->  C  e.  ~P ( 1 ... ( M  +  N
) ) )
1514elpwid 3965 . . . . . 6  |-  ( C  e.  O  ->  C  C_  ( 1 ... ( M  +  N )
) )
16 dfss1 3644 . . . . . 6  |-  ( C 
C_  ( 1 ... ( M  +  N
) )  <->  ( (
1 ... ( M  +  N ) )  i^i 
C )  =  C )
1715, 16sylib 196 . . . . 5  |-  ( C  e.  O  ->  (
( 1 ... ( M  +  N )
)  i^i  C )  =  C )
1817fveq2d 5853 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  ( # `  C
) )
19 rabssab 3526 . . . . . . 7  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
{ c  |  (
# `  c )  =  M }
2019sseli 3438 . . . . . 6  |-  ( C  e.  { c  e. 
~P ( 1 ... ( M  +  N
) )  |  (
# `  c )  =  M }  ->  C  e.  { c  |  (
# `  c )  =  M } )
2120, 3eleq2s 2510 . . . . 5  |-  ( C  e.  O  ->  C  e.  { c  |  (
# `  c )  =  M } )
22 fveq2 5849 . . . . . . 7  |-  ( b  =  C  ->  ( # `
 b )  =  ( # `  C
) )
2322eqeq1d 2404 . . . . . 6  |-  ( b  =  C  ->  (
( # `  b )  =  M  <->  ( # `  C
)  =  M ) )
24 fveq2 5849 . . . . . . . 8  |-  ( c  =  b  ->  ( # `
 c )  =  ( # `  b
) )
2524eqeq1d 2404 . . . . . . 7  |-  ( c  =  b  ->  (
( # `  c )  =  M  <->  ( # `  b
)  =  M ) )
2625cbvabv 2545 . . . . . 6  |-  { c  |  ( # `  c
)  =  M }  =  { b  |  (
# `  b )  =  M }
2723, 26elab2g 3198 . . . . 5  |-  ( C  e.  O  ->  ( C  e.  { c  |  ( # `  c
)  =  M }  <->  (
# `  C )  =  M ) )
2821, 27mpbid 210 . . . 4  |-  ( C  e.  O  ->  ( # `
 C )  =  M )
2918, 28eqtrd 2443 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  M )
30 fzfi 12123 . . . . 5  |-  ( 1 ... ( M  +  N ) )  e. 
Fin
31 hashssdif 12524 . . . . 5  |-  ( ( ( 1 ... ( M  +  N )
)  e.  Fin  /\  C  C_  ( 1 ... ( M  +  N
) ) )  -> 
( # `  ( ( 1 ... ( M  +  N ) ) 
\  C ) )  =  ( ( # `  ( 1 ... ( M  +  N )
) )  -  ( # `
 C ) ) )
3230, 15, 31sylancr 661 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  ( ( # `  (
1 ... ( M  +  N ) ) )  -  ( # `  C
) ) )
338nnnn0i 10844 . . . . . 6  |-  ( M  +  N )  e. 
NN0
34 hashfz1 12466 . . . . . 6  |-  ( ( M  +  N )  e.  NN0  ->  ( # `  ( 1 ... ( M  +  N )
) )  =  ( M  +  N ) )
3533, 34mp1i 13 . . . . 5  |-  ( C  e.  O  ->  ( # `
 ( 1 ... ( M  +  N
) ) )  =  ( M  +  N
) )
3635, 28oveq12d 6296 . . . 4  |-  ( C  e.  O  ->  (
( # `  ( 1 ... ( M  +  N ) ) )  -  ( # `  C
) )  =  ( ( M  +  N
)  -  M ) )
371nncni 10586 . . . . . 6  |-  M  e.  CC
382nncni 10586 . . . . . 6  |-  N  e.  CC
39 pncan2 9863 . . . . . 6  |-  ( ( M  e.  CC  /\  N  e.  CC )  ->  ( ( M  +  N )  -  M
)  =  N )
4037, 38, 39mp2an 670 . . . . 5  |-  ( ( M  +  N )  -  M )  =  N
4140a1i 11 . . . 4  |-  ( C  e.  O  ->  (
( M  +  N
)  -  M )  =  N )
4232, 36, 413eqtrd 2447 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  N )
4329, 42oveq12d 6296 . 2  |-  ( C  e.  O  ->  (
( # `  ( ( 1 ... ( M  +  N ) )  i^i  C ) )  -  ( # `  (
( 1 ... ( M  +  N )
)  \  C )
) )  =  ( M  -  N ) )
4411, 43eqtrd 2443 1  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( M  -  N
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    = wceq 1405    e. wcel 1842   {cab 2387   {crab 2758    \ cdif 3411    i^i cin 3413    C_ wss 3414   ~Pcpw 3955    |-> cmpt 4453   ` cfv 5569  (class class class)co 6278   Fincfn 7554   CCcc 9520   1c1 9523    + caddc 9525    - cmin 9841    / cdiv 10247   NNcn 10576   NN0cn0 10836   ZZcz 10905   ...cfz 11726   #chash 12452
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1639  ax-4 1652  ax-5 1725  ax-6 1771  ax-7 1814  ax-8 1844  ax-9 1846  ax-10 1861  ax-11 1866  ax-12 1878  ax-13 2026  ax-ext 2380  ax-rep 4507  ax-sep 4517  ax-nul 4525  ax-pow 4572  ax-pr 4630  ax-un 6574  ax-cnex 9578  ax-resscn 9579  ax-1cn 9580  ax-icn 9581  ax-addcl 9582  ax-addrcl 9583  ax-mulcl 9584  ax-mulrcl 9585  ax-mulcom 9586  ax-addass 9587  ax-mulass 9588  ax-distr 9589  ax-i2m1 9590  ax-1ne0 9591  ax-1rid 9592  ax-rnegex 9593  ax-rrecex 9594  ax-cnre 9595  ax-pre-lttri 9596  ax-pre-lttrn 9597  ax-pre-ltadd 9598  ax-pre-mulgt0 9599
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 975  df-3an 976  df-tru 1408  df-ex 1634  df-nf 1638  df-sb 1764  df-eu 2242  df-mo 2243  df-clab 2388  df-cleq 2394  df-clel 2397  df-nfc 2552  df-ne 2600  df-nel 2601  df-ral 2759  df-rex 2760  df-reu 2761  df-rmo 2762  df-rab 2763  df-v 3061  df-sbc 3278  df-csb 3374  df-dif 3417  df-un 3419  df-in 3421  df-ss 3428  df-pss 3430  df-nul 3739  df-if 3886  df-pw 3957  df-sn 3973  df-pr 3975  df-tp 3977  df-op 3979  df-uni 4192  df-int 4228  df-iun 4273  df-br 4396  df-opab 4454  df-mpt 4455  df-tr 4490  df-eprel 4734  df-id 4738  df-po 4744  df-so 4745  df-fr 4782  df-we 4784  df-xp 4829  df-rel 4830  df-cnv 4831  df-co 4832  df-dm 4833  df-rn 4834  df-res 4835  df-ima 4836  df-pred 5367  df-ord 5413  df-on 5414  df-lim 5415  df-suc 5416  df-iota 5533  df-fun 5571  df-fn 5572  df-f 5573  df-f1 5574  df-fo 5575  df-f1o 5576  df-fv 5577  df-riota 6240  df-ov 6281  df-oprab 6282  df-mpt2 6283  df-om 6684  df-1st 6784  df-2nd 6785  df-wrecs 7013  df-recs 7075  df-rdg 7113  df-1o 7167  df-oadd 7171  df-er 7348  df-en 7555  df-dom 7556  df-sdom 7557  df-fin 7558  df-card 8352  df-cda 8580  df-pnf 9660  df-mnf 9661  df-xr 9662  df-ltxr 9663  df-le 9664  df-sub 9843  df-neg 9844  df-nn 10577  df-n0 10837  df-z 10906  df-uz 11128  df-fz 11727  df-hash 12453
This theorem is referenced by:  ballotlem5  28944
  Copyright terms: Public domain W3C validator