Metamath Proof Explorer


Theorem phimullem

Description: Lemma for phimul . (Contributed by Mario Carneiro, 24-Feb-2014)

Ref Expression
Hypotheses crth.1 S = 0 ..^ M N
crth.2 T = 0 ..^ M × 0 ..^ N
crth.3 F = x S x mod M x mod N
crth.4 φ M N M gcd N = 1
phimul.4 U = y 0 ..^ M | y gcd M = 1
phimul.5 V = y 0 ..^ N | y gcd N = 1
phimul.6 W = y S | y gcd M N = 1
Assertion phimullem φ ϕ M N = ϕ M ϕ N

Proof

Step Hyp Ref Expression
1 crth.1 S = 0 ..^ M N
2 crth.2 T = 0 ..^ M × 0 ..^ N
3 crth.3 F = x S x mod M x mod N
4 crth.4 φ M N M gcd N = 1
5 phimul.4 U = y 0 ..^ M | y gcd M = 1
6 phimul.5 V = y 0 ..^ N | y gcd N = 1
7 phimul.6 W = y S | y gcd M N = 1
8 oveq1 y = w y gcd M N = w gcd M N
9 8 eqeq1d y = w y gcd M N = 1 w gcd M N = 1
10 9 7 elrab2 w W w S w gcd M N = 1
11 10 simplbi w W w S
12 oveq1 x = w x mod M = w mod M
13 oveq1 x = w x mod N = w mod N
14 12 13 opeq12d x = w x mod M x mod N = w mod M w mod N
15 opex w mod M w mod N V
16 14 3 15 fvmpt w S F w = w mod M w mod N
17 11 16 syl w W F w = w mod M w mod N
18 17 adantl φ w W F w = w mod M w mod N
19 11 1 eleqtrdi w W w 0 ..^ M N
20 19 adantl φ w W w 0 ..^ M N
21 elfzoelz w 0 ..^ M N w
22 20 21 syl φ w W w
23 4 simp1d φ M
24 23 adantr φ w W M
25 zmodfzo w M w mod M 0 ..^ M
26 22 24 25 syl2anc φ w W w mod M 0 ..^ M
27 modgcd w M w mod M gcd M = w gcd M
28 22 24 27 syl2anc φ w W w mod M gcd M = w gcd M
29 24 nnzd φ w W M
30 gcddvds w M w gcd M w w gcd M M
31 22 29 30 syl2anc φ w W w gcd M w w gcd M M
32 31 simpld φ w W w gcd M w
33 nnne0 M M 0
34 simpr w = 0 M = 0 M = 0
35 34 necon3ai M 0 ¬ w = 0 M = 0
36 24 33 35 3syl φ w W ¬ w = 0 M = 0
37 gcdn0cl w M ¬ w = 0 M = 0 w gcd M
38 22 29 36 37 syl21anc φ w W w gcd M
39 38 nnzd φ w W w gcd M
40 4 simp2d φ N
41 40 adantr φ w W N
42 41 nnzd φ w W N
43 31 simprd φ w W w gcd M M
44 39 29 42 43 dvdsmultr1d φ w W w gcd M M N
45 24 41 nnmulcld φ w W M N
46 45 nnzd φ w W M N
47 nnne0 M N M N 0
48 simpr w = 0 M N = 0 M N = 0
49 48 necon3ai M N 0 ¬ w = 0 M N = 0
50 45 47 49 3syl φ w W ¬ w = 0 M N = 0
51 dvdslegcd w gcd M w M N ¬ w = 0 M N = 0 w gcd M w w gcd M M N w gcd M w gcd M N
52 39 22 46 50 51 syl31anc φ w W w gcd M w w gcd M M N w gcd M w gcd M N
53 32 44 52 mp2and φ w W w gcd M w gcd M N
54 10 simprbi w W w gcd M N = 1
55 54 adantl φ w W w gcd M N = 1
56 53 55 breqtrd φ w W w gcd M 1
57 nnle1eq1 w gcd M w gcd M 1 w gcd M = 1
58 38 57 syl φ w W w gcd M 1 w gcd M = 1
59 56 58 mpbid φ w W w gcd M = 1
60 28 59 eqtrd φ w W w mod M gcd M = 1
61 oveq1 y = w mod M y gcd M = w mod M gcd M
62 61 eqeq1d y = w mod M y gcd M = 1 w mod M gcd M = 1
63 62 5 elrab2 w mod M U w mod M 0 ..^ M w mod M gcd M = 1
64 26 60 63 sylanbrc φ w W w mod M U
65 zmodfzo w N w mod N 0 ..^ N
66 22 41 65 syl2anc φ w W w mod N 0 ..^ N
67 modgcd w N w mod N gcd N = w gcd N
68 22 41 67 syl2anc φ w W w mod N gcd N = w gcd N
69 gcddvds w N w gcd N w w gcd N N
70 22 42 69 syl2anc φ w W w gcd N w w gcd N N
71 70 simpld φ w W w gcd N w
72 nnne0 N N 0
73 simpr w = 0 N = 0 N = 0
74 73 necon3ai N 0 ¬ w = 0 N = 0
75 41 72 74 3syl φ w W ¬ w = 0 N = 0
76 gcdn0cl w N ¬ w = 0 N = 0 w gcd N
77 22 42 75 76 syl21anc φ w W w gcd N
78 77 nnzd φ w W w gcd N
79 70 simprd φ w W w gcd N N
80 dvdsmul2 M N N M N
81 29 42 80 syl2anc φ w W N M N
82 78 42 46 79 81 dvdstrd φ w W w gcd N M N
83 dvdslegcd w gcd N w M N ¬ w = 0 M N = 0 w gcd N w w gcd N M N w gcd N w gcd M N
84 78 22 46 50 83 syl31anc φ w W w gcd N w w gcd N M N w gcd N w gcd M N
85 71 82 84 mp2and φ w W w gcd N w gcd M N
86 85 55 breqtrd φ w W w gcd N 1
87 nnle1eq1 w gcd N w gcd N 1 w gcd N = 1
88 77 87 syl φ w W w gcd N 1 w gcd N = 1
89 86 88 mpbid φ w W w gcd N = 1
90 68 89 eqtrd φ w W w mod N gcd N = 1
91 oveq1 y = w mod N y gcd N = w mod N gcd N
92 91 eqeq1d y = w mod N y gcd N = 1 w mod N gcd N = 1
93 92 6 elrab2 w mod N V w mod N 0 ..^ N w mod N gcd N = 1
94 66 90 93 sylanbrc φ w W w mod N V
95 64 94 opelxpd φ w W w mod M w mod N U × V
96 18 95 eqeltrd φ w W F w U × V
97 96 ralrimiva φ w W F w U × V
98 1 2 3 4 crth φ F : S 1-1 onto T
99 f1ofn F : S 1-1 onto T F Fn S
100 fnfun F Fn S Fun F
101 98 99 100 3syl φ Fun F
102 7 ssrab3 W S
103 fndm F Fn S dom F = S
104 98 99 103 3syl φ dom F = S
105 102 104 sseqtrrid φ W dom F
106 funimass4 Fun F W dom F F W U × V w W F w U × V
107 101 105 106 syl2anc φ F W U × V w W F w U × V
108 97 107 mpbird φ F W U × V
109 5 ssrab3 U 0 ..^ M
110 6 ssrab3 V 0 ..^ N
111 xpss12 U 0 ..^ M V 0 ..^ N U × V 0 ..^ M × 0 ..^ N
112 109 110 111 mp2an U × V 0 ..^ M × 0 ..^ N
113 112 2 sseqtrri U × V T
114 113 sseli z U × V z T
115 f1ocnvfv2 F : S 1-1 onto T z T F F -1 z = z
116 98 114 115 syl2an φ z U × V F F -1 z = z
117 f1ocnv F : S 1-1 onto T F -1 : T 1-1 onto S
118 f1of F -1 : T 1-1 onto S F -1 : T S
119 98 117 118 3syl φ F -1 : T S
120 ffvelrn F -1 : T S z T F -1 z S
121 119 114 120 syl2an φ z U × V F -1 z S
122 121 1 eleqtrdi φ z U × V F -1 z 0 ..^ M N
123 elfzoelz F -1 z 0 ..^ M N F -1 z
124 122 123 syl φ z U × V F -1 z
125 23 adantr φ z U × V M
126 modgcd F -1 z M F -1 z mod M gcd M = F -1 z gcd M
127 124 125 126 syl2anc φ z U × V F -1 z mod M gcd M = F -1 z gcd M
128 oveq1 w = F -1 z w mod M = F -1 z mod M
129 oveq1 w = F -1 z w mod N = F -1 z mod N
130 128 129 opeq12d w = F -1 z w mod M w mod N = F -1 z mod M F -1 z mod N
131 14 cbvmptv x S x mod M x mod N = w S w mod M w mod N
132 3 131 eqtri F = w S w mod M w mod N
133 opex F -1 z mod M F -1 z mod N V
134 130 132 133 fvmpt F -1 z S F F -1 z = F -1 z mod M F -1 z mod N
135 121 134 syl φ z U × V F F -1 z = F -1 z mod M F -1 z mod N
136 116 135 eqtr3d φ z U × V z = F -1 z mod M F -1 z mod N
137 simpr φ z U × V z U × V
138 136 137 eqeltrrd φ z U × V F -1 z mod M F -1 z mod N U × V
139 opelxp F -1 z mod M F -1 z mod N U × V F -1 z mod M U F -1 z mod N V
140 138 139 sylib φ z U × V F -1 z mod M U F -1 z mod N V
141 140 simpld φ z U × V F -1 z mod M U
142 oveq1 y = F -1 z mod M y gcd M = F -1 z mod M gcd M
143 142 eqeq1d y = F -1 z mod M y gcd M = 1 F -1 z mod M gcd M = 1
144 143 5 elrab2 F -1 z mod M U F -1 z mod M 0 ..^ M F -1 z mod M gcd M = 1
145 141 144 sylib φ z U × V F -1 z mod M 0 ..^ M F -1 z mod M gcd M = 1
146 145 simprd φ z U × V F -1 z mod M gcd M = 1
147 127 146 eqtr3d φ z U × V F -1 z gcd M = 1
148 40 adantr φ z U × V N
149 modgcd F -1 z N F -1 z mod N gcd N = F -1 z gcd N
150 124 148 149 syl2anc φ z U × V F -1 z mod N gcd N = F -1 z gcd N
151 140 simprd φ z U × V F -1 z mod N V
152 oveq1 y = F -1 z mod N y gcd N = F -1 z mod N gcd N
153 152 eqeq1d y = F -1 z mod N y gcd N = 1 F -1 z mod N gcd N = 1
154 153 6 elrab2 F -1 z mod N V F -1 z mod N 0 ..^ N F -1 z mod N gcd N = 1
155 151 154 sylib φ z U × V F -1 z mod N 0 ..^ N F -1 z mod N gcd N = 1
156 155 simprd φ z U × V F -1 z mod N gcd N = 1
157 150 156 eqtr3d φ z U × V F -1 z gcd N = 1
158 23 nnzd φ M
159 158 adantr φ z U × V M
160 40 nnzd φ N
161 160 adantr φ z U × V N
162 rpmul F -1 z M N F -1 z gcd M = 1 F -1 z gcd N = 1 F -1 z gcd M N = 1
163 124 159 161 162 syl3anc φ z U × V F -1 z gcd M = 1 F -1 z gcd N = 1 F -1 z gcd M N = 1
164 147 157 163 mp2and φ z U × V F -1 z gcd M N = 1
165 oveq1 y = F -1 z y gcd M N = F -1 z gcd M N
166 165 eqeq1d y = F -1 z y gcd M N = 1 F -1 z gcd M N = 1
167 166 7 elrab2 F -1 z W F -1 z S F -1 z gcd M N = 1
168 121 164 167 sylanbrc φ z U × V F -1 z W
169 funfvima2 Fun F W dom F F -1 z W F F -1 z F W
170 101 105 169 syl2anc φ F -1 z W F F -1 z F W
171 170 imp φ F -1 z W F F -1 z F W
172 168 171 syldan φ z U × V F F -1 z F W
173 116 172 eqeltrrd φ z U × V z F W
174 108 173 eqelssd φ F W = U × V
175 f1of1 F : S 1-1 onto T F : S 1-1 T
176 98 175 syl φ F : S 1-1 T
177 fzofi 0 ..^ M N Fin
178 1 177 eqeltri S Fin
179 ssfi S Fin W S W Fin
180 178 102 179 mp2an W Fin
181 180 elexi W V
182 181 f1imaen F : S 1-1 T W S F W W
183 176 102 182 sylancl φ F W W
184 174 183 eqbrtrrd φ U × V W
185 fzofi 0 ..^ M Fin
186 ssrab2 y 0 ..^ M | y gcd M = 1 0 ..^ M
187 ssfi 0 ..^ M Fin y 0 ..^ M | y gcd M = 1 0 ..^ M y 0 ..^ M | y gcd M = 1 Fin
188 185 186 187 mp2an y 0 ..^ M | y gcd M = 1 Fin
189 5 188 eqeltri U Fin
190 fzofi 0 ..^ N Fin
191 ssrab2 y 0 ..^ N | y gcd N = 1 0 ..^ N
192 ssfi 0 ..^ N Fin y 0 ..^ N | y gcd N = 1 0 ..^ N y 0 ..^ N | y gcd N = 1 Fin
193 190 191 192 mp2an y 0 ..^ N | y gcd N = 1 Fin
194 6 193 eqeltri V Fin
195 xpfi U Fin V Fin U × V Fin
196 189 194 195 mp2an U × V Fin
197 hashen U × V Fin W Fin U × V = W U × V W
198 196 180 197 mp2an U × V = W U × V W
199 184 198 sylibr φ U × V = W
200 hashxp U Fin V Fin U × V = U V
201 189 194 200 mp2an U × V = U V
202 199 201 eqtr3di φ W = U V
203 23 40 nnmulcld φ M N
204 dfphi2 M N ϕ M N = y 0 ..^ M N | y gcd M N = 1
205 1 rabeqi y S | y gcd M N = 1 = y 0 ..^ M N | y gcd M N = 1
206 7 205 eqtri W = y 0 ..^ M N | y gcd M N = 1
207 206 fveq2i W = y 0 ..^ M N | y gcd M N = 1
208 204 207 eqtr4di M N ϕ M N = W
209 203 208 syl φ ϕ M N = W
210 dfphi2 M ϕ M = y 0 ..^ M | y gcd M = 1
211 5 fveq2i U = y 0 ..^ M | y gcd M = 1
212 210 211 eqtr4di M ϕ M = U
213 23 212 syl φ ϕ M = U
214 dfphi2 N ϕ N = y 0 ..^ N | y gcd N = 1
215 6 fveq2i V = y 0 ..^ N | y gcd N = 1
216 214 215 eqtr4di N ϕ N = V
217 40 216 syl φ ϕ N = V
218 213 217 oveq12d φ ϕ M ϕ N = U V
219 202 209 218 3eqtr4d φ ϕ M N = ϕ M ϕ N