Metamath Proof Explorer


Theorem ballotlem4

Description: If the first pick is a vote for B, A is not ahead throughout the count. (Contributed by Thierry Arnoux, 25-Nov-2016)

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 ) }
Assertion ballotlem4
|- ( C e. O -> ( -. 1 e. C -> -. C e. E ) )

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 nnaddcl
 |-  ( ( M e. NN /\ N e. NN ) -> ( M + N ) e. NN )
8 1 2 7 mp2an
 |-  ( M + N ) e. NN
9 elnnuz
 |-  ( ( M + N ) e. NN <-> ( M + N ) e. ( ZZ>= ` 1 ) )
10 8 9 mpbi
 |-  ( M + N ) e. ( ZZ>= ` 1 )
11 eluzfz1
 |-  ( ( M + N ) e. ( ZZ>= ` 1 ) -> 1 e. ( 1 ... ( M + N ) ) )
12 10 11 ax-mp
 |-  1 e. ( 1 ... ( M + N ) )
13 0le1
 |-  0 <_ 1
14 0re
 |-  0 e. RR
15 1re
 |-  1 e. RR
16 14 15 lenlti
 |-  ( 0 <_ 1 <-> -. 1 < 0 )
17 13 16 mpbi
 |-  -. 1 < 0
18 ltsub13
 |-  ( ( 0 e. RR /\ 0 e. RR /\ 1 e. RR ) -> ( 0 < ( 0 - 1 ) <-> 1 < ( 0 - 0 ) ) )
19 14 14 15 18 mp3an
 |-  ( 0 < ( 0 - 1 ) <-> 1 < ( 0 - 0 ) )
20 0m0e0
 |-  ( 0 - 0 ) = 0
21 20 breq2i
 |-  ( 1 < ( 0 - 0 ) <-> 1 < 0 )
22 19 21 bitri
 |-  ( 0 < ( 0 - 1 ) <-> 1 < 0 )
23 17 22 mtbir
 |-  -. 0 < ( 0 - 1 )
24 1m1e0
 |-  ( 1 - 1 ) = 0
25 24 fveq2i
 |-  ( ( F ` C ) ` ( 1 - 1 ) ) = ( ( F ` C ) ` 0 )
26 1 2 3 4 5 ballotlemfval0
 |-  ( C e. O -> ( ( F ` C ) ` 0 ) = 0 )
27 25 26 syl5eq
 |-  ( C e. O -> ( ( F ` C ) ` ( 1 - 1 ) ) = 0 )
28 27 oveq1d
 |-  ( C e. O -> ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) = ( 0 - 1 ) )
29 28 breq2d
 |-  ( C e. O -> ( 0 < ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) <-> 0 < ( 0 - 1 ) ) )
30 23 29 mtbiri
 |-  ( C e. O -> -. 0 < ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) )
31 30 adantr
 |-  ( ( C e. O /\ -. 1 e. C ) -> -. 0 < ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) )
32 simpl
 |-  ( ( C e. O /\ 1 e. ( 1 ... ( M + N ) ) ) -> C e. O )
33 1nn
 |-  1 e. NN
34 33 a1i
 |-  ( ( C e. O /\ 1 e. ( 1 ... ( M + N ) ) ) -> 1 e. NN )
35 1 2 3 4 5 32 34 ballotlemfp1
 |-  ( ( C e. O /\ 1 e. ( 1 ... ( M + N ) ) ) -> ( ( -. 1 e. C -> ( ( F ` C ) ` 1 ) = ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) ) /\ ( 1 e. C -> ( ( F ` C ) ` 1 ) = ( ( ( F ` C ) ` ( 1 - 1 ) ) + 1 ) ) ) )
36 35 simpld
 |-  ( ( C e. O /\ 1 e. ( 1 ... ( M + N ) ) ) -> ( -. 1 e. C -> ( ( F ` C ) ` 1 ) = ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) ) )
37 12 36 mpan2
 |-  ( C e. O -> ( -. 1 e. C -> ( ( F ` C ) ` 1 ) = ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) ) )
38 37 imp
 |-  ( ( C e. O /\ -. 1 e. C ) -> ( ( F ` C ) ` 1 ) = ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) )
39 38 breq2d
 |-  ( ( C e. O /\ -. 1 e. C ) -> ( 0 < ( ( F ` C ) ` 1 ) <-> 0 < ( ( ( F ` C ) ` ( 1 - 1 ) ) - 1 ) ) )
40 31 39 mtbird
 |-  ( ( C e. O /\ -. 1 e. C ) -> -. 0 < ( ( F ` C ) ` 1 ) )
41 fveq2
 |-  ( i = 1 -> ( ( F ` C ) ` i ) = ( ( F ` C ) ` 1 ) )
42 41 breq2d
 |-  ( i = 1 -> ( 0 < ( ( F ` C ) ` i ) <-> 0 < ( ( F ` C ) ` 1 ) ) )
43 42 notbid
 |-  ( i = 1 -> ( -. 0 < ( ( F ` C ) ` i ) <-> -. 0 < ( ( F ` C ) ` 1 ) ) )
44 43 rspcev
 |-  ( ( 1 e. ( 1 ... ( M + N ) ) /\ -. 0 < ( ( F ` C ) ` 1 ) ) -> E. i e. ( 1 ... ( M + N ) ) -. 0 < ( ( F ` C ) ` i ) )
45 12 40 44 sylancr
 |-  ( ( C e. O /\ -. 1 e. C ) -> E. i e. ( 1 ... ( M + N ) ) -. 0 < ( ( F ` C ) ` i ) )
46 rexnal
 |-  ( E. i e. ( 1 ... ( M + N ) ) -. 0 < ( ( F ` C ) ` i ) <-> -. A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` C ) ` i ) )
47 45 46 sylib
 |-  ( ( C e. O /\ -. 1 e. C ) -> -. A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` C ) ` i ) )
48 1 2 3 4 5 6 ballotleme
 |-  ( C e. E <-> ( C e. O /\ A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` C ) ` i ) ) )
49 48 simprbi
 |-  ( C e. E -> A. i e. ( 1 ... ( M + N ) ) 0 < ( ( F ` C ) ` i ) )
50 47 49 nsyl
 |-  ( ( C e. O /\ -. 1 e. C ) -> -. C e. E )
51 50 ex
 |-  ( C e. O -> ( -. 1 e. C -> -. C e. E ) )