Metamath Proof Explorer


Theorem ballotlemsf1o

Description: The defined S is a bijection, and an involution. (Contributed by Thierry Arnoux, 14-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 ballotlemsf1o COESC:1M+N1-1 onto1M+NSC-1=SC

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 1 2 3 4 5 6 7 8 9 ballotlemsval COESC=i1M+NifiICIC+1-ii
11 1 2 3 4 5 6 7 8 9 ballotlemsv COEi1M+NSCi=ifiICIC+1-ii
12 1 2 3 4 5 6 7 8 9 ballotlemsdom COEi1M+NSCi1M+N
13 11 12 eqeltrrd COEi1M+NifiICIC+1-ii1M+N
14 1 2 3 4 5 6 7 8 9 ballotlemsv COEj1M+NSCj=ifjICIC+1-jj
15 1 2 3 4 5 6 7 8 9 ballotlemsdom COEj1M+NSCj1M+N
16 14 15 eqeltrrd COEj1M+NifjICIC+1-jj1M+N
17 oveq2 i=IC+1-jIC+1-i=IC+1-IC+1-j
18 id i=ji=j
19 breq1 i=IC+1-jiICIC+1-jIC
20 breq1 i=jiICjIC
21 1 2 3 4 5 6 7 8 ballotlemiex COEIC1M+NFCIC=0
22 21 simpld COEIC1M+N
23 elfzelz IC1M+NIC
24 23 peano2zd IC1M+NIC+1
25 22 24 syl COEIC+1
26 25 zcnd COEIC+1
27 26 adantr COEi1M+Nj1M+NIC+1
28 elfzelz j1M+Nj
29 28 zcnd j1M+Nj
30 29 ad2antll COEi1M+Nj1M+Nj
31 27 30 nncand COEi1M+Nj1M+NIC+1-IC+1-j=j
32 31 eqcomd COEi1M+Nj1M+Nj=IC+1-IC+1-j
33 22 23 syl COEIC
34 33 adantr COEi1M+Nj1M+NIC
35 elfznn j1M+Nj
36 35 ad2antll COEi1M+Nj1M+Nj
37 34 36 ltesubnnd COEi1M+Nj1M+NIC+1-jIC
38 37 adantr COEi1M+Nj1M+NjICIC+1-jIC
39 vex jV
40 39 a1i COEi1M+Nj1M+NjV
41 ovexd COEi1M+Nj1M+NIC+1-jV
42 17 18 19 20 32 38 40 41 ifeqeqx COEi1M+Nj1M+Ni=ifjICIC+1-jjj=ifiICIC+1-ii
43 oveq2 j=IC+1-iIC+1-j=IC+1-IC+1-i
44 id j=ij=i
45 breq1 j=IC+1-ijICIC+1-iIC
46 breq1 j=ijICiIC
47 elfzelz i1M+Ni
48 47 zcnd i1M+Ni
49 48 ad2antrl COEi1M+Nj1M+Ni
50 27 49 nncand COEi1M+Nj1M+NIC+1-IC+1-i=i
51 50 eqcomd COEi1M+Nj1M+Ni=IC+1-IC+1-i
52 34 adantr COEi1M+Nj1M+NiICIC
53 simplrl COEi1M+Nj1M+NiICi1M+N
54 elfznn i1M+Ni
55 53 54 syl COEi1M+Nj1M+NiICi
56 52 55 ltesubnnd COEi1M+Nj1M+NiICIC+1-iIC
57 vex iV
58 57 a1i COEi1M+Nj1M+NiV
59 ovexd COEi1M+Nj1M+NIC+1-iV
60 43 44 45 46 51 56 58 59 ifeqeqx COEi1M+Nj1M+Nj=ifiICIC+1-iii=ifjICIC+1-jj
61 42 60 impbida COEi1M+Nj1M+Ni=ifjICIC+1-jjj=ifiICIC+1-ii
62 10 13 16 61 f1o3d COESC:1M+N1-1 onto1M+NSC-1=j1M+NifjICIC+1-jj
63 62 simpld COESC:1M+N1-1 onto1M+N
64 oveq2 i=jIC+1-i=IC+1-j
65 20 64 18 ifbieq12d i=jifiICIC+1-ii=ifjICIC+1-jj
66 65 cbvmptv i1M+NifiICIC+1-ii=j1M+NifjICIC+1-jj
67 66 a1i COEi1M+NifiICIC+1-ii=j1M+NifjICIC+1-jj
68 62 simprd COESC-1=j1M+NifjICIC+1-jj
69 67 10 68 3eqtr4rd COESC-1=SC
70 63 69 jca COESC:1M+N1-1 onto1M+NSC-1=SC