Metamath Proof Explorer


Theorem ballotlemgval

Description: Expand the value of .^ . (Contributed by Thierry Arnoux, 21-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 ) ) )
ballotth.r
|- R = ( c e. ( O \ E ) |-> ( ( S ` c ) " c ) )
ballotlemg
|- .^ = ( u e. Fin , v e. Fin |-> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) )
Assertion ballotlemgval
|- ( ( U e. Fin /\ V e. Fin ) -> ( U .^ V ) = ( ( # ` ( V i^i U ) ) - ( # ` ( V \ U ) ) ) )

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 ballotlemg
 |-  .^ = ( u e. Fin , v e. Fin |-> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) )
12 ineq2
 |-  ( u = U -> ( v i^i u ) = ( v i^i U ) )
13 12 fveq2d
 |-  ( u = U -> ( # ` ( v i^i u ) ) = ( # ` ( v i^i U ) ) )
14 difeq2
 |-  ( u = U -> ( v \ u ) = ( v \ U ) )
15 14 fveq2d
 |-  ( u = U -> ( # ` ( v \ u ) ) = ( # ` ( v \ U ) ) )
16 13 15 oveq12d
 |-  ( u = U -> ( ( # ` ( v i^i u ) ) - ( # ` ( v \ u ) ) ) = ( ( # ` ( v i^i U ) ) - ( # ` ( v \ U ) ) ) )
17 ineq1
 |-  ( v = V -> ( v i^i U ) = ( V i^i U ) )
18 17 fveq2d
 |-  ( v = V -> ( # ` ( v i^i U ) ) = ( # ` ( V i^i U ) ) )
19 difeq1
 |-  ( v = V -> ( v \ U ) = ( V \ U ) )
20 19 fveq2d
 |-  ( v = V -> ( # ` ( v \ U ) ) = ( # ` ( V \ U ) ) )
21 18 20 oveq12d
 |-  ( v = V -> ( ( # ` ( v i^i U ) ) - ( # ` ( v \ U ) ) ) = ( ( # ` ( V i^i U ) ) - ( # ` ( V \ U ) ) ) )
22 ovex
 |-  ( ( # ` ( V i^i U ) ) - ( # ` ( V \ U ) ) ) e. _V
23 16 21 11 22 ovmpo
 |-  ( ( U e. Fin /\ V e. Fin ) -> ( U .^ V ) = ( ( # ` ( V i^i U ) ) - ( # ` ( V \ U ) ) ) )