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

Theorem ballotlemfmpn 26997
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 10431 . . . . . 6  |-  ( ( M  e.  NN  /\  N  e.  NN )  ->  ( M  +  N
)  e.  NN )
81, 2, 7mp2an 672 . . . . 5  |-  ( M  +  N )  e.  NN
98nnzi 10757 . . . 4  |-  ( M  +  N )  e.  ZZ
109a1i 11 . . 3  |-  ( C  e.  O  ->  ( M  +  N )  e.  ZZ )
111, 2, 3, 4, 5, 6, 10ballotlemfval 26992 . 2  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( ( # `  (
( 1 ... ( M  +  N )
)  i^i  C )
)  -  ( # `  ( ( 1 ... ( M  +  N
) )  \  C
) ) ) )
12 ssrab2 3521 . . . . . . . . 9  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
~P ( 1 ... ( M  +  N
) )
133, 12eqsstri 3470 . . . . . . . 8  |-  O  C_  ~P ( 1 ... ( M  +  N )
)
1413sseli 3436 . . . . . . 7  |-  ( C  e.  O  ->  C  e.  ~P ( 1 ... ( M  +  N
) ) )
1514elpwid 3954 . . . . . 6  |-  ( C  e.  O  ->  C  C_  ( 1 ... ( M  +  N )
) )
16 dfss1 3639 . . . . . 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 5779 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  ( # `  C
) )
19 rabssab 3523 . . . . . . 7  |-  { c  e.  ~P ( 1 ... ( M  +  N ) )  |  ( # `  c
)  =  M }  C_ 
{ c  |  (
# `  c )  =  M }
2019sseli 3436 . . . . . 6  |-  ( C  e.  { c  e. 
~P ( 1 ... ( M  +  N
) )  |  (
# `  c )  =  M }  ->  C  e.  { c  |  (
# `  c )  =  M } )
2120, 3eleq2s 2556 . . . . 5  |-  ( C  e.  O  ->  C  e.  { c  |  (
# `  c )  =  M } )
22 fveq2 5775 . . . . . . 7  |-  ( b  =  C  ->  ( # `
 b )  =  ( # `  C
) )
2322eqeq1d 2452 . . . . . 6  |-  ( b  =  C  ->  (
( # `  b )  =  M  <->  ( # `  C
)  =  M ) )
24 fveq2 5775 . . . . . . . 8  |-  ( c  =  b  ->  ( # `
 c )  =  ( # `  b
) )
2524eqeq1d 2452 . . . . . . 7  |-  ( c  =  b  ->  (
( # `  c )  =  M  <->  ( # `  b
)  =  M ) )
2625cbvabv 2591 . . . . . 6  |-  { c  |  ( # `  c
)  =  M }  =  { b  |  (
# `  b )  =  M }
2723, 26elab2g 3191 . . . . 5  |-  ( C  e.  O  ->  ( C  e.  { c  |  ( # `  c
)  =  M }  <->  (
# `  C )  =  M ) )
2821, 27mpbid 210 . . . 4  |-  ( C  e.  O  ->  ( # `
 C )  =  M )
2918, 28eqtrd 2490 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  i^i 
C ) )  =  M )
30 fzfi 11881 . . . . 5  |-  ( 1 ... ( M  +  N ) )  e. 
Fin
31 hashssdif 12255 . . . . 5  |-  ( ( ( 1 ... ( M  +  N )
)  e.  Fin  /\  C  C_  ( 1 ... ( M  +  N
) ) )  -> 
( # `  ( ( 1 ... ( M  +  N ) ) 
\  C ) )  =  ( ( # `  ( 1 ... ( M  +  N )
) )  -  ( # `
 C ) ) )
3230, 15, 31sylancr 663 . . . 4  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  ( ( # `  (
1 ... ( M  +  N ) ) )  -  ( # `  C
) ) )
338nnnn0i 10674 . . . . . 6  |-  ( M  +  N )  e. 
NN0
34 hashfz1 12204 . . . . . 6  |-  ( ( M  +  N )  e.  NN0  ->  ( # `  ( 1 ... ( M  +  N )
) )  =  ( M  +  N ) )
3533, 34mp1i 12 . . . . 5  |-  ( C  e.  O  ->  ( # `
 ( 1 ... ( M  +  N
) ) )  =  ( M  +  N
) )
3635, 28oveq12d 6194 . . . 4  |-  ( C  e.  O  ->  (
( # `  ( 1 ... ( M  +  N ) ) )  -  ( # `  C
) )  =  ( ( M  +  N
)  -  M ) )
371nncni 10419 . . . . . 6  |-  M  e.  CC
382nncni 10419 . . . . . 6  |-  N  e.  CC
39 pncan2 9704 . . . . . 6  |-  ( ( M  e.  CC  /\  N  e.  CC )  ->  ( ( M  +  N )  -  M
)  =  N )
4037, 38, 39mp2an 672 . . . . 5  |-  ( ( M  +  N )  -  M )  =  N
4140a1i 11 . . . 4  |-  ( C  e.  O  ->  (
( M  +  N
)  -  M )  =  N )
4232, 36, 413eqtrd 2494 . . 3  |-  ( C  e.  O  ->  ( # `
 ( ( 1 ... ( M  +  N ) )  \  C ) )  =  N )
4329, 42oveq12d 6194 . 2  |-  ( C  e.  O  ->  (
( # `  ( ( 1 ... ( M  +  N ) )  i^i  C ) )  -  ( # `  (
( 1 ... ( M  +  N )
)  \  C )
) )  =  ( M  -  N ) )
4411, 43eqtrd 2490 1  |-  ( C  e.  O  ->  (
( F `  C
) `  ( M  +  N ) )  =  ( M  -  N
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    = wceq 1370    e. wcel 1757   {cab 2435   {crab 2796    \ cdif 3409    i^i cin 3411    C_ wss 3412   ~Pcpw 3944    |-> cmpt 4434   ` cfv 5502  (class class class)co 6176   Fincfn 7396   CCcc 9367   1c1 9370    + caddc 9372    - cmin 9682    / cdiv 10080   NNcn 10409   NN0cn0 10666   ZZcz 10733   ...cfz 11524   #chash 12190
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1709  ax-7 1729  ax-8 1759  ax-9 1761  ax-10 1776  ax-11 1781  ax-12 1793  ax-13 1944  ax-ext 2429  ax-rep 4487  ax-sep 4497  ax-nul 4505  ax-pow 4554  ax-pr 4615  ax-un 6458  ax-cnex 9425  ax-resscn 9426  ax-1cn 9427  ax-icn 9428  ax-addcl 9429  ax-addrcl 9430  ax-mulcl 9431  ax-mulrcl 9432  ax-mulcom 9433  ax-addass 9434  ax-mulass 9435  ax-distr 9436  ax-i2m1 9437  ax-1ne0 9438  ax-1rid 9439  ax-rnegex 9440  ax-rrecex 9441  ax-cnre 9442  ax-pre-lttri 9443  ax-pre-lttrn 9444  ax-pre-ltadd 9445  ax-pre-mulgt0 9446
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1702  df-eu 2263  df-mo 2264  df-clab 2436  df-cleq 2442  df-clel 2445  df-nfc 2598  df-ne 2643  df-nel 2644  df-ral 2797  df-rex 2798  df-reu 2799  df-rmo 2800  df-rab 2801  df-v 3056  df-sbc 3271  df-csb 3373  df-dif 3415  df-un 3417  df-in 3419  df-ss 3426  df-pss 3428  df-nul 3722  df-if 3876  df-pw 3946  df-sn 3962  df-pr 3964  df-tp 3966  df-op 3968  df-uni 4176  df-int 4213  df-iun 4257  df-br 4377  df-opab 4435  df-mpt 4436  df-tr 4470  df-eprel 4716  df-id 4720  df-po 4725  df-so 4726  df-fr 4763  df-we 4765  df-ord 4806  df-on 4807  df-lim 4808  df-suc 4809  df-xp 4930  df-rel 4931  df-cnv 4932  df-co 4933  df-dm 4934  df-rn 4935  df-res 4936  df-ima 4937  df-iota 5465  df-fun 5504  df-fn 5505  df-f 5506  df-f1 5507  df-fo 5508  df-f1o 5509  df-fv 5510  df-riota 6137  df-ov 6179  df-oprab 6180  df-mpt2 6181  df-om 6563  df-1st 6663  df-2nd 6664  df-recs 6918  df-rdg 6952  df-1o 7006  df-oadd 7010  df-er 7187  df-en 7397  df-dom 7398  df-sdom 7399  df-fin 7400  df-card 8196  df-cda 8424  df-pnf 9507  df-mnf 9508  df-xr 9509  df-ltxr 9510  df-le 9511  df-sub 9684  df-neg 9685  df-nn 10410  df-n0 10667  df-z 10734  df-uz 10949  df-fz 11525  df-hash 12191
This theorem is referenced by:  ballotlem5  27002
  Copyright terms: Public domain W3C validator