Metamath Proof Explorer


Theorem ballotlemfrcn0

Description: Value of F for a reversed counting ( RC ) , before the first tie, cannot be zero. (Contributed by Thierry Arnoux, 25-Apr-2017) (Revised by AV, 6-Oct-2020)

Ref Expression
Hypotheses 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 ) ) ) ) )
ballotth.e
|- E = { c e. O | A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` c ) ` i ) }
ballotth.mgtn
|- N < M
ballotth.i
|- I = ( c e. ( O \ E ) |-> inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` c ) ` k ) = 0 } , RR , < ) )
ballotth.s
|- S = ( c e. ( O \ E ) |-> ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` c ) , ( ( ( I ` c ) + 1 ) - i ) , i ) ) )
ballotth.r
|- R = ( c e. ( O \ E ) |-> ( ( S ` c ) " c ) )
Assertion ballotlemfrcn0
|- ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( F ` ( R ` C ) ) ` J ) =/= 0 )

Proof

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 1zzd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> 1 e. ZZ )
12 nnaddcl
 |-  ( ( M e. NN /\ N e. NN ) -> ( M + N ) e. NN )
13 1 2 12 mp2an
 |-  ( M + N ) e. NN
14 13 nnzi
 |-  ( M + N ) e. ZZ
15 14 a1i
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( M + N ) e. ZZ )
16 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 ) ) )
17 16 elfzelzd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) ) -> ( ( S ` C ) ` J ) e. ZZ )
18 17 3adant3
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( S ` C ) ` J ) e. ZZ )
19 18 11 zsubcld
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ZZ )
20 1 2 3 4 5 6 7 8 9 ballotlemsgt1
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> 1 < ( ( S ` C ) ` J ) )
21 zltlem1
 |-  ( ( 1 e. ZZ /\ ( ( S ` C ) ` J ) e. ZZ ) -> ( 1 < ( ( S ` C ) ` J ) <-> 1 <_ ( ( ( S ` C ) ` J ) - 1 ) ) )
22 21 biimpa
 |-  ( ( ( 1 e. ZZ /\ ( ( S ` C ) ` J ) e. ZZ ) /\ 1 < ( ( S ` C ) ` J ) ) -> 1 <_ ( ( ( S ` C ) ` J ) - 1 ) )
23 11 18 20 22 syl21anc
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> 1 <_ ( ( ( S ` C ) ` J ) - 1 ) )
24 18 zred
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( S ` C ) ` J ) e. RR )
25 1red
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> 1 e. RR )
26 24 25 resubcld
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. RR )
27 simp1
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> C e. ( O \ E ) )
28 1 2 3 4 5 6 7 8 ballotlemiex
 |-  ( C e. ( O \ E ) -> ( ( I ` C ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( I ` C ) ) = 0 ) )
29 28 simpld
 |-  ( C e. ( O \ E ) -> ( I ` C ) e. ( 1 ... ( M + N ) ) )
30 elfzelz
 |-  ( ( I ` C ) e. ( 1 ... ( M + N ) ) -> ( I ` C ) e. ZZ )
31 27 29 30 3syl
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( I ` C ) e. ZZ )
32 31 zred
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( I ` C ) e. RR )
33 15 zred
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( M + N ) e. RR )
34 elfzelz
 |-  ( J e. ( 1 ... ( M + N ) ) -> J e. ZZ )
35 34 3ad2ant2
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> J e. ZZ )
36 elfzle1
 |-  ( J e. ( 1 ... ( M + N ) ) -> 1 <_ J )
37 36 3ad2ant2
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> 1 <_ J )
38 35 zred
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> J e. RR )
39 simp3
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> J < ( I ` C ) )
40 38 32 39 ltled
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> J <_ ( I ` C ) )
41 11 31 35 37 40 elfzd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> J e. ( 1 ... ( I ` C ) ) )
42 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 ) ) )
43 27 41 42 syl2anc
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) )
44 elfzle2
 |-  ( ( ( S ` C ) ` J ) e. ( 1 ... ( I ` C ) ) -> ( ( S ` C ) ` J ) <_ ( I ` C ) )
45 43 44 syl
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( S ` C ) ` J ) <_ ( I ` C ) )
46 zlem1lt
 |-  ( ( ( ( S ` C ) ` J ) e. ZZ /\ ( I ` C ) e. ZZ ) -> ( ( ( S ` C ) ` J ) <_ ( I ` C ) <-> ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) ) )
47 18 31 46 syl2anc
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) <_ ( I ` C ) <-> ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) ) )
48 45 47 mpbid
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) )
49 26 32 48 ltled
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) <_ ( I ` C ) )
50 elfzle2
 |-  ( ( I ` C ) e. ( 1 ... ( M + N ) ) -> ( I ` C ) <_ ( M + N ) )
51 27 29 50 3syl
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( I ` C ) <_ ( M + N ) )
52 26 32 33 49 51 letrd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) <_ ( M + N ) )
53 11 15 19 23 52 elfzd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) )
54 biid
 |-  ( ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) <-> ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) )
55 48 54 sylibr
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) )
56 1 2 3 4 5 6 7 8 ballotlemi
 |-  ( C e. ( O \ E ) -> ( I ` C ) = inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) )
57 56 breq2d
 |-  ( C e. ( O \ E ) -> ( ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) <-> ( ( ( S ` C ) ` J ) - 1 ) < inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) ) )
58 57 3ad2ant1
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( ( S ` C ) ` J ) - 1 ) < ( I ` C ) <-> ( ( ( S ` C ) ` J ) - 1 ) < inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) ) )
59 55 58 mpbid
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( S ` C ) ` J ) - 1 ) < inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) )
60 ltso
 |-  < Or RR
61 60 a1i
 |-  ( C e. ( O \ E ) -> < Or RR )
62 1 2 3 4 5 6 7 8 ballotlemsup
 |-  ( C e. ( O \ E ) -> E. z e. RR ( A. w e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } -. w < z /\ A. w e. RR ( z < w -> E. y e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } y < w ) ) )
63 61 62 inflb
 |-  ( C e. ( O \ E ) -> ( ( ( ( S ` C ) ` J ) - 1 ) e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } -> -. ( ( ( S ` C ) ` J ) - 1 ) < inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) ) )
64 63 con2d
 |-  ( C e. ( O \ E ) -> ( ( ( ( S ` C ) ` J ) - 1 ) < inf ( { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } , RR , < ) -> -. ( ( ( S ` C ) ` J ) - 1 ) e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } ) )
65 27 59 64 sylc
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> -. ( ( ( S ` C ) ` J ) - 1 ) e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } )
66 fveqeq2
 |-  ( k = ( ( ( S ` C ) ` J ) - 1 ) -> ( ( ( F ` C ) ` k ) = 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
67 66 elrab
 |-  ( ( ( ( S ` C ) ` J ) - 1 ) e. { k e. ( 1 ... ( M + N ) ) | ( ( F ` C ) ` k ) = 0 } <-> ( ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
68 65 67 sylnib
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> -. ( ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
69 imnan
 |-  ( ( ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) -> -. ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) <-> -. ( ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) /\ ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
70 68 69 sylibr
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( ( S ` C ) ` J ) - 1 ) e. ( 1 ... ( M + N ) ) -> -. ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
71 53 70 mpd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> -. ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 )
72 71 neqned
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) =/= 0 )
73 1 2 3 4 5 6 7 8 9 10 ballotlemro
 |-  ( C e. ( O \ E ) -> ( R ` C ) e. O )
74 73 adantr
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( R ` C ) e. O )
75 elfzelz
 |-  ( J e. ( 1 ... ( I ` C ) ) -> J e. ZZ )
76 75 adantl
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> J e. ZZ )
77 1 2 3 4 5 74 76 ballotlemfelz
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` ( R ` C ) ) ` J ) e. ZZ )
78 77 zcnd
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` ( R ` C ) ) ` J ) e. CC )
79 78 negeq0d
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` ( R ` C ) ) ` J ) = 0 <-> -u ( ( F ` ( R ` C ) ) ` J ) = 0 ) )
80 eqid
 |-  ( u e. Fin , v e. Fin |-> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) ) = ( u e. Fin , v e. Fin |-> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) )
81 1 2 3 4 5 6 7 8 9 10 80 ballotlemfrceq
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = -u ( ( F ` ( R ` C ) ) ` J ) )
82 81 eqeq1d
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 <-> -u ( ( F ` ( R ` C ) ) ` J ) = 0 ) )
83 79 82 bitr4d
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` ( R ` C ) ) ` J ) = 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) = 0 ) )
84 83 necon3bid
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( I ` C ) ) ) -> ( ( ( F ` ( R ` C ) ) ` J ) =/= 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) =/= 0 ) )
85 27 41 84 syl2anc
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( ( F ` ( R ` C ) ) ` J ) =/= 0 <-> ( ( F ` C ) ` ( ( ( S ` C ) ` J ) - 1 ) ) =/= 0 ) )
86 72 85 mpbird
 |-  ( ( C e. ( O \ E ) /\ J e. ( 1 ... ( M + N ) ) /\ J < ( I ` C ) ) -> ( ( F ` ( R ` C ) ) ` J ) =/= 0 )