Step |
Hyp |
Ref |
Expression |
1 |
|
ballotth.m |
|- M e. NN |
2 |
|
ballotth.n |
|- N e. NN |
3 |
|
ballotth.o |
|- O = { c e. ~P ( 1 ... ( M + N ) ) | ( # ` c ) = M } |
4 |
|
ballotth.p |
|- P = ( x e. ~P O |-> ( ( # ` x ) / ( # ` O ) ) ) |
5 |
|
ballotth.f |
|- F = ( c e. O |-> ( i e. ZZ |-> ( ( # ` ( ( 1 ... i ) i^i c ) ) - ( # ` ( ( 1 ... i ) \ c ) ) ) ) ) |
6 |
|
ballotth.e |
|- E = { c e. O | A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` c ) ` i ) } |
7 |
|
ballotth.mgtn |
|- N < M |
8 |
|
ballotth.i |
|- I = ( c e. ( O \ E ) |-> inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` c ) ` k ) = 0 } , RR , < ) ) |
9 |
|
ballotth.s |
|- S = ( c e. ( O \ E ) |-> ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` c ) , ( ( ( I ` c ) + 1 ) - i ) , i ) ) ) |
10 |
|
ballotth.r |
|- R = ( c e. ( O \ E ) |-> ( ( S ` c ) " c ) ) |
11 |
|
ballotlemg |
|- .^ = ( u e. Fin , v e. Fin |-> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) ) |
12 |
1 2 3 4 5 6 7 8 9
|
ballotlemsel1i |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) ) |
13 |
|
1zzd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> 1 e. ZZ ) |
14 |
1 2 3 4 5 6 7 8
|
ballotlemiex |
|- ( C e. ( O \ E ) -> ( ( I ` C ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( I ` C ) ) = 0 ) ) |
15 |
14
|
adantr |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( I ` C ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( I ` C ) ) = 0 ) ) |
16 |
15
|
simpld |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( I ` C ) e. ( 1 ... ( M + N ) ) ) |
17 |
16
|
elfzelzd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( I ` C ) e. ZZ ) |
18 |
|
elfzuz3 |
|- ( ( I ` C ) e. ( 1 ... ( M + N ) ) -> ( M + N ) e. ( ZZ>= ` ( I ` C ) ) ) |
19 |
|
fzss2 |
|- ( ( M + N ) e. ( ZZ>= ` ( I ` C ) ) -> ( 1 ... ( I ` C ) ) C_ ( 1 ... ( M + N ) ) ) |
20 |
16 18 19
|
3syl |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( 1 ... ( I ` C ) ) C_ ( 1 ... ( M + N ) ) ) |
21 |
|
simpr |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> J e. ( 1 ... ( I ` C ) ) ) |
22 |
20 21
|
sseldd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> J e. ( 1 ... ( M + N ) ) ) |
23 |
1 2 3 4 5 6 7 8 9
|
ballotlemsdom |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) ) -> ( ( S ` C ) ` J ) e. ( 1 ... ( M + N ) ) ) |
24 |
22 23
|
syldan |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( S ` C ) ` J ) e. ( 1 ... ( M + N ) ) ) |
25 |
24
|
elfzelzd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( S ` C ) ` J ) e. ZZ ) |
26 |
|
fzsubel |
|- ( ( ( 1 e. ZZ /\ ( I ` C ) e. ZZ ) /\ ( ( ( S ` C ) ` J ) e. ZZ /\ 1 e. ZZ ) ) -> ( ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) <-> ( ( ( S ` C ) ` J ) - 1 ) e. ( ( 1 - 1 ) ... ( ( I ` C ) - 1 ) ) ) ) |
27 |
13 17 25 13 26
|
syl22anc |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) <-> ( ( ( S ` C ) ` J ) - 1 ) e. ( ( 1 - 1 ) ... ( ( I ` C ) - 1 ) ) ) ) |
28 |
12 27
|
mpbid |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ( ( 1 - 1 ) ... ( ( I ` C ) - 1 ) ) ) |
29 |
|
1m1e0 |
|- ( 1 - 1 ) = 0 |
30 |
29
|
oveq1i |
|- ( ( 1 - 1 ) ... ( ( I ` C ) - 1 ) ) = ( 0 ... ( ( I ` C ) - 1 ) ) |
31 |
28 30
|
eleqtrdi |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ( 0 ... ( ( I ` C ) - 1 ) ) ) |
32 |
14
|
simpld |
|- ( C e. ( O \ E ) -> ( I ` C ) e. ( 1 ... ( M + N ) ) ) |
33 |
32
|
elfzelzd |
|- ( C e. ( O \ E ) -> ( I ` C ) e. ZZ ) |
34 |
|
1zzd |
|- ( C e. ( O \ E ) -> 1 e. ZZ ) |
35 |
33 34
|
zsubcld |
|- ( C e. ( O \ E ) -> ( ( I ` C ) - 1 ) e. ZZ ) |
36 |
|
nnaddcl |
|- ( ( M e. NN /\ N e. NN ) -> ( M + N ) e. NN ) |
37 |
1 2 36
|
mp2an |
|- ( M + N ) e. NN |
38 |
37
|
nnzi |
|- ( M + N ) e. ZZ |
39 |
38
|
a1i |
|- ( C e. ( O \ E ) -> ( M + N ) e. ZZ ) |
40 |
|
elfzle2 |
|- ( ( I ` C ) e. ( 1 ... ( M + N ) ) -> ( I ` C ) <_ ( M + N ) ) |
41 |
32 40
|
syl |
|- ( C e. ( O \ E ) -> ( I ` C ) <_ ( M + N ) ) |
42 |
|
zlem1lt |
|- ( ( ( I ` C ) e. ZZ /\ ( M + N ) e. ZZ ) -> ( ( I ` C ) <_ ( M + N ) <-> ( ( I ` C ) - 1 ) < ( M + N ) ) ) |
43 |
33 39 42
|
syl2anc |
|- ( C e. ( O \ E ) -> ( ( I ` C ) <_ ( M + N ) <-> ( ( I ` C ) - 1 ) < ( M + N ) ) ) |
44 |
35
|
zred |
|- ( C e. ( O \ E ) -> ( ( I ` C ) - 1 ) e. RR ) |
45 |
39
|
zred |
|- ( C e. ( O \ E ) -> ( M + N ) e. RR ) |
46 |
|
ltle |
|- ( ( ( ( I ` C ) - 1 ) e. RR /\ ( M + N ) e. RR ) -> ( ( ( I ` C ) - 1 ) < ( M + N ) -> ( ( I ` C ) - 1 ) <_ ( M + N ) ) ) |
47 |
44 45 46
|
syl2anc |
|- ( C e. ( O \ E ) -> ( ( ( I ` C ) - 1 ) < ( M + N ) -> ( ( I ` C ) - 1 ) <_ ( M + N ) ) ) |
48 |
43 47
|
sylbid |
|- ( C e. ( O \ E ) -> ( ( I ` C ) <_ ( M + N ) -> ( ( I ` C ) - 1 ) <_ ( M + N ) ) ) |
49 |
41 48
|
mpd |
|- ( C e. ( O \ E ) -> ( ( I ` C ) - 1 ) <_ ( M + N ) ) |
50 |
|
eluz2 |
|- ( ( M + N ) e. ( ZZ>= ` ( ( I ` C ) - 1 ) ) <-> ( ( ( I ` C ) - 1 ) e. ZZ /\ ( M + N ) e. ZZ /\ ( ( I ` C ) - 1 ) <_ ( M + N ) ) ) |
51 |
35 39 49 50
|
syl3anbrc |
|- ( C e. ( O \ E ) -> ( M + N ) e. ( ZZ>= ` ( ( I ` C ) - 1 ) ) ) |
52 |
|
fzss2 |
|- ( ( M + N ) e. ( ZZ>= ` ( ( I ` C ) - 1 ) ) -> ( 0 ... ( ( I ` C ) - 1 ) ) C_ ( 0 ... ( M + N ) ) ) |
53 |
51 52
|
syl |
|- ( C e. ( O \ E ) -> ( 0 ... ( ( I ` C ) - 1 ) ) C_ ( 0 ... ( M + N ) ) ) |
54 |
53
|
sselda |
|- ( ( C e. ( O \ E ) /\ ( ( ( S ` C ) ` J ) - 1 ) e. ( 0 ... ( ( I ` C ) - 1 ) ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ( 0 ... ( M + N ) ) ) |
55 |
31 54
|
syldan |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ( 0 ... ( M + N ) ) ) |
56 |
1 2 3 4 5 6 7 8 9 10 11
|
ballotlemfg |
|- ( ( C e. ( O \ E ) /\ ( ( ( S ` C ) ` J ) - 1 ) e. ( 0 ... ( M + N ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = ( C .^ ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) ) ) |
57 |
55 56
|
syldan |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = ( C .^ ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) ) ) |
58 |
1 2 3 4 5 6 7 8 9 10 11
|
ballotlemfrc |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` ( R ` C ) ) ` J ) = ( C .^ ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) |
59 |
57 58
|
oveq12d |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) + ( ( F ` ( R ` C ) ) ` J ) ) = ( ( C .^ ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) ) + ( C .^ ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) ) |
60 |
|
fzsplit3 |
|- ( ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) -> ( 1 ... ( I ` C ) ) = ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) u. ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) |
61 |
12 60
|
syl |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( 1 ... ( I ` C ) ) = ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) u. ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) |
62 |
61
|
oveq2d |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( C .^ ( 1 ... ( I ` C ) ) ) = ( C .^ ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) u. ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) ) |
63 |
|
fz1ssfz0 |
|- ( 1 ... ( M + N ) ) C_ ( 0 ... ( M + N ) ) |
64 |
63
|
sseli |
|- ( ( I ` C ) e. ( 1 ... ( M + N ) ) -> ( I ` C ) e. ( 0 ... ( M + N ) ) ) |
65 |
1 2 3 4 5 6 7 8 9 10 11
|
ballotlemfg |
|- ( ( C e. ( O \ E ) /\ ( I ` C ) e. ( 0 ... ( M + N ) ) ) -> ( ( F ` C ) ` ( I ` C ) ) = ( C .^ ( 1 ... ( I ` C ) ) ) ) |
66 |
64 65
|
sylan2 |
|- ( ( C e. ( O \ E ) /\ ( I ` C ) e. ( 1 ... ( M + N ) ) ) -> ( ( F ` C ) ` ( I ` C ) ) = ( C .^ ( 1 ... ( I ` C ) ) ) ) |
67 |
16 66
|
syldan |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( I ` C ) ) = ( C .^ ( 1 ... ( I ` C ) ) ) ) |
68 |
15
|
simprd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( I ` C ) ) = 0 ) |
69 |
67 68
|
eqtr3d |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( C .^ ( 1 ... ( I ` C ) ) ) = 0 ) |
70 |
|
fzfi |
|- ( 1 ... ( M + N ) ) e. Fin |
71 |
|
eldifi |
|- ( C e. ( O \ E ) -> C e. O ) |
72 |
1 2 3
|
ballotlemelo |
|- ( C e. O <-> ( C C_ ( 1 ... ( M + N ) ) /\ ( # ` C ) = M ) ) |
73 |
72
|
simplbi |
|- ( C e. O -> C C_ ( 1 ... ( M + N ) ) ) |
74 |
71 73
|
syl |
|- ( C e. ( O \ E ) -> C C_ ( 1 ... ( M + N ) ) ) |
75 |
|
ssfi |
|- ( ( ( 1 ... ( M + N ) ) e. Fin /\ C C_ ( 1 ... ( M + N ) ) ) -> C e. Fin ) |
76 |
70 74 75
|
sylancr |
|- ( C e. ( O \ E ) -> C e. Fin ) |
77 |
76
|
adantr |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> C e. Fin ) |
78 |
|
fzfid |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) e. Fin ) |
79 |
|
fzfid |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) ... ( I ` C ) ) e. Fin ) |
80 |
25
|
zred |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( S ` C ) ` J ) e. RR ) |
81 |
|
ltm1 |
|- ( ( ( S ` C ) ` J ) e. RR -> ( ( ( S ` C ) ` J ) - 1 ) < ( ( S ` C ) ` J ) ) |
82 |
|
fzdisj |
|- ( ( ( ( S ` C ) ` J ) - 1 ) < ( ( S ` C ) ` J ) -> ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) i^i ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) = (/) ) |
83 |
80 81 82
|
3syl |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) i^i ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) = (/) ) |
84 |
1 2 3 4 5 6 7 8 9 10 11 77 78 79 83
|
ballotlemgun |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( C .^ ( ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) u. ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) = ( ( C .^ ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) ) + ( C .^ ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) ) |
85 |
62 69 84
|
3eqtr3rd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( C .^ ( 1 ... ( ( ( S ` C ) ` J ) - 1 ) ) ) + ( C .^ ( ( ( S ` C ) ` J ) ... ( I ` C ) ) ) ) = 0 ) |
86 |
59 85
|
eqtrd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) + ( ( F ` ( R ` C ) ) ` J ) ) = 0 ) |
87 |
71
|
adantr |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> C e. O ) |
88 |
25 13
|
zsubcld |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ZZ ) |
89 |
1 2 3 4 5 87 88
|
ballotlemfelz |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) e. ZZ ) |
90 |
89
|
zcnd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) e. CC ) |
91 |
1 2 3 4 5 6 7 8 9 10
|
ballotlemro |
|- ( C e. ( O \ E ) -> ( R ` C ) e. O ) |
92 |
91
|
adantr |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( R ` C ) e. O ) |
93 |
21
|
elfzelzd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> J e. ZZ ) |
94 |
1 2 3 4 5 92 93
|
ballotlemfelz |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` ( R ` C ) ) ` J ) e. ZZ ) |
95 |
94
|
zcnd |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` ( R ` C ) ) ` J ) e. CC ) |
96 |
|
addeq0 |
|- ( ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) e. CC /\ ( ( F ` ( R ` C ) ) ` J ) e. CC ) -> ( ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) + ( ( F ` ( R ` C ) ) ` J ) ) = 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = -u ( ( F ` ( R ` C ) ) ` J ) ) ) |
97 |
90 95 96
|
syl2anc |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) + ( ( F ` ( R ` C ) ) ` J ) ) = 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = -u ( ( F ` ( R ` C ) ) ` J ) ) ) |
98 |
86 97
|
mpbid |
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = -u ( ( F ` ( R ` C ) ) ` J ) ) |