Metamath Proof Explorer


Theorem fsumcom2

Description: Interchange order of summation. Note that B ( j ) and D ( k ) are not necessarily constant expressions. (Contributed by Mario Carneiro, 28-Apr-2014) (Revised by Mario Carneiro, 8-Apr-2016) (Proof shortened by JJ, 2-Aug-2021)

Ref Expression
Hypotheses fsumcom2.1 φ A Fin
fsumcom2.2 φ C Fin
fsumcom2.3 φ j A B Fin
fsumcom2.4 φ j A k B k C j D
fsumcom2.5 φ j A k B E
Assertion fsumcom2 φ j A k B E = k C j D E

Proof

Step Hyp Ref Expression
1 fsumcom2.1 φ A Fin
2 fsumcom2.2 φ C Fin
3 fsumcom2.3 φ j A B Fin
4 fsumcom2.4 φ j A k B k C j D
5 fsumcom2.5 φ j A k B E
6 relxp Rel j × B
7 6 rgenw j A Rel j × B
8 reliun Rel j A j × B j A Rel j × B
9 7 8 mpbir Rel j A j × B
10 relcnv Rel k C k × D -1
11 ancom x = j y = k y = k x = j
12 vex x V
13 vex y V
14 12 13 opth x y = j k x = j y = k
15 13 12 opth y x = k j y = k x = j
16 11 14 15 3bitr4i x y = j k y x = k j
17 16 a1i φ x y = j k y x = k j
18 17 4 anbi12d φ x y = j k j A k B y x = k j k C j D
19 18 2exbidv φ j k x y = j k j A k B j k y x = k j k C j D
20 eliunxp x y j A j × B j k x y = j k j A k B
21 12 13 opelcnv x y k C k × D -1 y x k C k × D
22 eliunxp y x k C k × D k j y x = k j k C j D
23 excom k j y x = k j k C j D j k y x = k j k C j D
24 21 22 23 3bitri x y k C k × D -1 j k y x = k j k C j D
25 19 20 24 3bitr4g φ x y j A j × B x y k C k × D -1
26 9 10 25 eqrelrdv φ j A j × B = k C k × D -1
27 nfcv _ m j × B
28 nfcv _ j m
29 nfcsb1v _ j m / j B
30 28 29 nfxp _ j m × m / j B
31 sneq j = m j = m
32 csbeq1a j = m B = m / j B
33 31 32 xpeq12d j = m j × B = m × m / j B
34 27 30 33 cbviun j A j × B = m A m × m / j B
35 nfcv _ n k × D
36 nfcv _ k n
37 nfcsb1v _ k n / k D
38 36 37 nfxp _ k n × n / k D
39 sneq k = n k = n
40 csbeq1a k = n D = n / k D
41 39 40 xpeq12d k = n k × D = n × n / k D
42 35 38 41 cbviun k C k × D = n C n × n / k D
43 42 cnveqi k C k × D -1 = n C n × n / k D -1
44 26 34 43 3eqtr3g φ m A m × m / j B = n C n × n / k D -1
45 44 sumeq1d φ z m A m × m / j B 2 nd z / k 1 st z / j E = z n C n × n / k D -1 2 nd z / k 1 st z / j E
46 vex n V
47 vex m V
48 46 47 op1std w = n m 1 st w = n
49 48 csbeq1d w = n m 1 st w / k 2 nd w / j E = n / k 2 nd w / j E
50 46 47 op2ndd w = n m 2 nd w = m
51 50 csbeq1d w = n m 2 nd w / j E = m / j E
52 51 csbeq2dv w = n m n / k 2 nd w / j E = n / k m / j E
53 49 52 eqtrd w = n m 1 st w / k 2 nd w / j E = n / k m / j E
54 47 46 op2ndd z = m n 2 nd z = n
55 54 csbeq1d z = m n 2 nd z / k 1 st z / j E = n / k 1 st z / j E
56 47 46 op1std z = m n 1 st z = m
57 56 csbeq1d z = m n 1 st z / j E = m / j E
58 57 csbeq2dv z = m n n / k 1 st z / j E = n / k m / j E
59 55 58 eqtrd z = m n 2 nd z / k 1 st z / j E = n / k m / j E
60 snfi n Fin
61 1 adantr φ n C A Fin
62 47 46 opelcnv m n k C k × D -1 n m k C k × D
63 37 40 opeliunxp2f n m k C k × D n C m n / k D
64 62 63 sylbbr n C m n / k D m n k C k × D -1
65 64 adantl φ n C m n / k D m n k C k × D -1
66 26 adantr φ n C m n / k D j A j × B = k C k × D -1
67 65 66 eleqtrrd φ n C m n / k D m n j A j × B
68 eliun m n j A j × B j A m n j × B
69 67 68 sylib φ n C m n / k D j A m n j × B
70 simpr j A m n j × B m n j × B
71 opelxp m n j × B m j n B
72 70 71 sylib j A m n j × B m j n B
73 72 simpld j A m n j × B m j
74 elsni m j m = j
75 73 74 syl j A m n j × B m = j
76 simpl j A m n j × B j A
77 75 76 eqeltrd j A m n j × B m A
78 77 rexlimiva j A m n j × B m A
79 69 78 syl φ n C m n / k D m A
80 79 expr φ n C m n / k D m A
81 80 ssrdv φ n C n / k D A
82 61 81 ssfid φ n C n / k D Fin
83 xpfi n Fin n / k D Fin n × n / k D Fin
84 60 82 83 sylancr φ n C n × n / k D Fin
85 84 ralrimiva φ n C n × n / k D Fin
86 iunfi C Fin n C n × n / k D Fin n C n × n / k D Fin
87 2 85 86 syl2anc φ n C n × n / k D Fin
88 reliun Rel n C n × n / k D n C Rel n × n / k D
89 relxp Rel n × n / k D
90 89 a1i n C Rel n × n / k D
91 88 90 mprgbir Rel n C n × n / k D
92 91 a1i φ Rel n C n × n / k D
93 csbeq1 m = 2 nd w m / j E = 2 nd w / j E
94 93 csbeq2dv m = 2 nd w 1 st w / k m / j E = 1 st w / k 2 nd w / j E
95 94 eleq1d m = 2 nd w 1 st w / k m / j E 1 st w / k 2 nd w / j E
96 csbeq1 n = 1 st w n / k D = 1 st w / k D
97 csbeq1 n = 1 st w n / k m / j E = 1 st w / k m / j E
98 97 eleq1d n = 1 st w n / k m / j E 1 st w / k m / j E
99 96 98 raleqbidv n = 1 st w m n / k D n / k m / j E m 1 st w / k D 1 st w / k m / j E
100 simpl φ n C m n / k D φ
101 29 nfcri j n m / j B
102 74 equcomd m j j = m
103 102 32 syl m j B = m / j B
104 103 eleq2d m j n B n m / j B
105 104 biimpa m j n B n m / j B
106 71 105 sylbi m n j × B n m / j B
107 106 a1i j A m n j × B n m / j B
108 101 107 rexlimi j A m n j × B n m / j B
109 69 108 syl φ n C m n / k D n m / j B
110 5 ralrimivva φ j A k B E
111 nfcsb1v _ j m / j E
112 111 nfel1 j m / j E
113 29 112 nfralw j k m / j B m / j E
114 csbeq1a j = m E = m / j E
115 114 eleq1d j = m E m / j E
116 32 115 raleqbidv j = m k B E k m / j B m / j E
117 113 116 rspc m A j A k B E k m / j B m / j E
118 110 117 mpan9 φ m A k m / j B m / j E
119 nfcsb1v _ k n / k m / j E
120 119 nfel1 k n / k m / j E
121 csbeq1a k = n m / j E = n / k m / j E
122 121 eleq1d k = n m / j E n / k m / j E
123 120 122 rspc n m / j B k m / j B m / j E n / k m / j E
124 118 123 syl5com φ m A n m / j B n / k m / j E
125 124 impr φ m A n m / j B n / k m / j E
126 100 79 109 125 syl12anc φ n C m n / k D n / k m / j E
127 126 ralrimivva φ n C m n / k D n / k m / j E
128 127 adantr φ w n C n × n / k D n C m n / k D n / k m / j E
129 simpr φ w n C n × n / k D w n C n × n / k D
130 eliun w n C n × n / k D n C w n × n / k D
131 129 130 sylib φ w n C n × n / k D n C w n × n / k D
132 xp1st w n × n / k D 1 st w n
133 132 adantl n C w n × n / k D 1 st w n
134 elsni 1 st w n 1 st w = n
135 133 134 syl n C w n × n / k D 1 st w = n
136 simpl n C w n × n / k D n C
137 135 136 eqeltrd n C w n × n / k D 1 st w C
138 137 rexlimiva n C w n × n / k D 1 st w C
139 131 138 syl φ w n C n × n / k D 1 st w C
140 99 128 139 rspcdva φ w n C n × n / k D m 1 st w / k D 1 st w / k m / j E
141 xp2nd w n × n / k D 2 nd w n / k D
142 141 adantl n C w n × n / k D 2 nd w n / k D
143 135 csbeq1d n C w n × n / k D 1 st w / k D = n / k D
144 142 143 eleqtrrd n C w n × n / k D 2 nd w 1 st w / k D
145 144 rexlimiva n C w n × n / k D 2 nd w 1 st w / k D
146 131 145 syl φ w n C n × n / k D 2 nd w 1 st w / k D
147 95 140 146 rspcdva φ w n C n × n / k D 1 st w / k 2 nd w / j E
148 53 59 87 92 147 fsumcnv φ w n C n × n / k D 1 st w / k 2 nd w / j E = z n C n × n / k D -1 2 nd z / k 1 st z / j E
149 45 148 eqtr4d φ z m A m × m / j B 2 nd z / k 1 st z / j E = w n C n × n / k D 1 st w / k 2 nd w / j E
150 3 ralrimiva φ j A B Fin
151 29 nfel1 j m / j B Fin
152 32 eleq1d j = m B Fin m / j B Fin
153 151 152 rspc m A j A B Fin m / j B Fin
154 150 153 mpan9 φ m A m / j B Fin
155 59 1 154 125 fsum2d φ m A n m / j B n / k m / j E = z m A m × m / j B 2 nd z / k 1 st z / j E
156 53 2 82 126 fsum2d φ n C m n / k D n / k m / j E = w n C n × n / k D 1 st w / k 2 nd w / j E
157 149 155 156 3eqtr4d φ m A n m / j B n / k m / j E = n C m n / k D n / k m / j E
158 nfcv _ m k B E
159 nfcv _ j n
160 159 111 nfcsbw _ j n / k m / j E
161 29 160 nfsum _ j n m / j B n / k m / j E
162 nfcv _ n E
163 nfcsb1v _ k n / k E
164 csbeq1a k = n E = n / k E
165 162 163 164 cbvsumi k B E = n B n / k E
166 114 csbeq2dv j = m n / k E = n / k m / j E
167 166 adantr j = m n B n / k E = n / k m / j E
168 32 167 sumeq12dv j = m n B n / k E = n m / j B n / k m / j E
169 165 168 eqtrid j = m k B E = n m / j B n / k m / j E
170 158 161 169 cbvsumi j A k B E = m A n m / j B n / k m / j E
171 nfcv _ n j D E
172 37 119 nfsum _ k m n / k D n / k m / j E
173 nfcv _ m E
174 173 111 114 cbvsumi j D E = m D m / j E
175 121 adantr k = n m D m / j E = n / k m / j E
176 40 175 sumeq12dv k = n m D m / j E = m n / k D n / k m / j E
177 174 176 eqtrid k = n j D E = m n / k D n / k m / j E
178 171 172 177 cbvsumi k C j D E = n C m n / k D n / k m / j E
179 157 170 178 3eqtr4g φ j A k B E = k C j D E