Metamath Proof Explorer


Theorem ballotlemieq

Description: If two countings share the same first tie, they also have the same swap function. (Contributed by Thierry Arnoux, 18-Apr-2017)

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 ) ) )
Assertion ballotlemieq
|- ( ( C e. ( O \ E ) /\ D e. ( O \ E ) /\ ( I ` C ) = ( I ` D ) ) -> ( S ` C ) = ( S ` D ) )

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 simpl
 |-  ( ( ( I ` C ) = ( I ` D ) /\ i e. ( 1 ... ( M + N ) ) ) -> ( I ` C ) = ( I ` D ) )
11 10 breq2d
 |-  ( ( ( I ` C ) = ( I ` D ) /\ i e. ( 1 ... ( M + N ) ) ) -> ( i <_ ( I ` C ) <-> i <_ ( I ` D ) ) )
12 10 oveq1d
 |-  ( ( ( I ` C ) = ( I ` D ) /\ i e. ( 1 ... ( M + N ) ) ) -> ( ( I ` C ) + 1 ) = ( ( I ` D ) + 1 ) )
13 12 oveq1d
 |-  ( ( ( I ` C ) = ( I ` D ) /\ i e. ( 1 ... ( M + N ) ) ) -> ( ( ( I ` C ) + 1 ) - i ) = ( ( ( I ` D ) + 1 ) - i ) )
14 11 13 ifbieq1d
 |-  ( ( ( I ` C ) = ( I ` D ) /\ i e. ( 1 ... ( M + N ) ) ) -> if ( i <_ ( I ` C ) , ( ( ( I ` C ) + 1 ) - i ) , i ) = if ( i <_ ( I ` D ) , ( ( ( I ` D ) + 1 ) - i ) , i ) )
15 14 mpteq2dva
 |-  ( ( I ` C ) = ( I ` D ) -> ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` C ) , ( ( ( I ` C ) + 1 ) - i ) , i ) ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` D ) , ( ( ( I ` D ) + 1 ) - i ) , i ) ) )
16 15 3ad2ant3
 |-  ( ( C e. ( O \ E ) /\ D e. ( O \ E ) /\ ( I ` C ) = ( I ` D ) ) -> ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` C ) , ( ( ( I ` C ) + 1 ) - i ) , i ) ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` D ) , ( ( ( I ` D ) + 1 ) - i ) , i ) ) )
17 1 2 3 4 5 6 7 8 9 ballotlemsval
 |-  ( C e. ( O \ E ) -> ( S ` C ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` C ) , ( ( ( I ` C ) + 1 ) - i ) , i ) ) )
18 17 3ad2ant1
 |-  ( ( C e. ( O \ E ) /\ D e. ( O \ E ) /\ ( I ` C ) = ( I ` D ) ) -> ( S ` C ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` C ) , ( ( ( I ` C ) + 1 ) - i ) , i ) ) )
19 1 2 3 4 5 6 7 8 9 ballotlemsval
 |-  ( D e. ( O \ E ) -> ( S ` D ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` D ) , ( ( ( I ` D ) + 1 ) - i ) , i ) ) )
20 19 3ad2ant2
 |-  ( ( C e. ( O \ E ) /\ D e. ( O \ E ) /\ ( I ` C ) = ( I ` D ) ) -> ( S ` D ) = ( i e. ( 1 ... ( M + N ) ) |-> if ( i <_ ( I ` D ) , ( ( ( I ` D ) + 1 ) - i ) , i ) ) )
21 16 18 20 3eqtr4d
 |-  ( ( C e. ( O \ E ) /\ D e. ( O \ E ) /\ ( I ` C ) = ( I ` D ) ) -> ( S ` C ) = ( S ` D ) )