Metamath Proof Explorer


Theorem ballotlemsval

Description: Value of S . (Contributed by Thierry Arnoux, 12-Apr-2017)

Ref Expression
Hypotheses ballotth.m M
ballotth.n N
ballotth.o O=c𝒫1M+N|c=M
ballotth.p P=x𝒫OxO
ballotth.f F=cOi1ic1ic
ballotth.e E=cO|i1M+N0<Fci
ballotth.mgtn N<M
ballotth.i I=cOEsupk1M+N|Fck=0<
ballotth.s S=cOEi1M+NifiIcIc+1-ii
Assertion ballotlemsval COESC=i1M+NifiICIC+1-ii

Proof

Step Hyp Ref Expression
1 ballotth.m M
2 ballotth.n N
3 ballotth.o O=c𝒫1M+N|c=M
4 ballotth.p P=x𝒫OxO
5 ballotth.f F=cOi1ic1ic
6 ballotth.e E=cO|i1M+N0<Fci
7 ballotth.mgtn N<M
8 ballotth.i I=cOEsupk1M+N|Fck=0<
9 ballotth.s S=cOEi1M+NifiIcIc+1-ii
10 simpl d=Ci1M+Nd=C
11 10 fveq2d d=Ci1M+NId=IC
12 11 breq2d d=Ci1M+NiIdiIC
13 11 oveq1d d=Ci1M+NId+1=IC+1
14 13 oveq1d d=Ci1M+NId+1-i=IC+1-i
15 12 14 ifbieq1d d=Ci1M+NifiIdId+1-ii=ifiICIC+1-ii
16 15 mpteq2dva d=Ci1M+NifiIdId+1-ii=i1M+NifiICIC+1-ii
17 simpl c=di1M+Nc=d
18 17 fveq2d c=di1M+NIc=Id
19 18 breq2d c=di1M+NiIciId
20 18 oveq1d c=di1M+NIc+1=Id+1
21 20 oveq1d c=di1M+NIc+1-i=Id+1-i
22 19 21 ifbieq1d c=di1M+NifiIcIc+1-ii=ifiIdId+1-ii
23 22 mpteq2dva c=di1M+NifiIcIc+1-ii=i1M+NifiIdId+1-ii
24 23 cbvmptv cOEi1M+NifiIcIc+1-ii=dOEi1M+NifiIdId+1-ii
25 9 24 eqtri S=dOEi1M+NifiIdId+1-ii
26 ovex 1M+NV
27 26 mptex i1M+NifiICIC+1-iiV
28 16 25 27 fvmpt COESC=i1M+NifiICIC+1-ii