Metamath Proof Explorer


Theorem ballotlemfmpn

Description: ( FC ) finishes counting at ( M - N ) . (Contributed by Thierry Arnoux, 25-Nov-2016)

Ref Expression
Hypotheses ballotth.m M
ballotth.n N
ballotth.o O = c 𝒫 1 M + N | c = M
ballotth.p P = x 𝒫 O x O
ballotth.f F = c O i 1 i c 1 i c
Assertion ballotlemfmpn C O F C M + N = M N

Proof

Step Hyp Ref Expression
1 ballotth.m M
2 ballotth.n N
3 ballotth.o O = c 𝒫 1 M + N | c = M
4 ballotth.p P = x 𝒫 O x O
5 ballotth.f F = c O i 1 i c 1 i c
6 id C O C O
7 nnaddcl M N M + N
8 1 2 7 mp2an M + N
9 8 nnzi M + N
10 9 a1i C O M + N
11 1 2 3 4 5 6 10 ballotlemfval C O F C M + N = 1 M + N C 1 M + N C
12 ssrab2 c 𝒫 1 M + N | c = M 𝒫 1 M + N
13 3 12 eqsstri O 𝒫 1 M + N
14 13 sseli C O C 𝒫 1 M + N
15 14 elpwid C O C 1 M + N
16 sseqin2 C 1 M + N 1 M + N C = C
17 15 16 sylib C O 1 M + N C = C
18 17 fveq2d C O 1 M + N C = C
19 rabssab c 𝒫 1 M + N | c = M c | c = M
20 19 sseli C c 𝒫 1 M + N | c = M C c | c = M
21 20 3 eleq2s C O C c | c = M
22 fveqeq2 b = C b = M C = M
23 fveqeq2 c = b c = M b = M
24 23 cbvabv c | c = M = b | b = M
25 22 24 elab2g C O C c | c = M C = M
26 21 25 mpbid C O C = M
27 18 26 eqtrd C O 1 M + N C = M
28 fzfi 1 M + N Fin
29 hashssdif 1 M + N Fin C 1 M + N 1 M + N C = 1 M + N C
30 28 15 29 sylancr C O 1 M + N C = 1 M + N C
31 8 nnnn0i M + N 0
32 hashfz1 M + N 0 1 M + N = M + N
33 31 32 mp1i C O 1 M + N = M + N
34 33 26 oveq12d C O 1 M + N C = M + N - M
35 1 nncni M
36 2 nncni N
37 pncan2 M N M + N - M = N
38 35 36 37 mp2an M + N - M = N
39 38 a1i C O M + N - M = N
40 30 34 39 3eqtrd C O 1 M + N C = N
41 27 40 oveq12d C O 1 M + N C 1 M + N C = M N
42 11 41 eqtrd C O F C M + N = M N