Metamath Proof Explorer


Theorem 4sqlem12

Description: Lemma for 4sq . For any odd prime P , there is a k < P such that k P - 1 is a sum of two squares. (Contributed by Mario Carneiro, 15-Jul-2014)

Ref Expression
Hypotheses 4sq.1 S = n | x y z w n = x 2 + y 2 + z 2 + w 2
4sq.2 φ N
4sq.3 φ P = 2 N + 1
4sq.4 φ P
4sqlem11.5 A = u | m 0 N u = m 2 mod P
4sqlem11.6 F = v A P - 1 - v
Assertion 4sqlem12 φ k 1 P 1 u i u 2 + 1 = k P

Proof

Step Hyp Ref Expression
1 4sq.1 S = n | x y z w n = x 2 + y 2 + z 2 + w 2
2 4sq.2 φ N
3 4sq.3 φ P = 2 N + 1
4 4sq.4 φ P
5 4sqlem11.5 A = u | m 0 N u = m 2 mod P
6 4sqlem11.6 F = v A P - 1 - v
7 1 2 3 4 5 6 4sqlem11 φ A ran F
8 n0 A ran F j j A ran F
9 7 8 sylib φ j j A ran F
10 vex j V
11 eqeq1 u = j u = m 2 mod P j = m 2 mod P
12 11 rexbidv u = j m 0 N u = m 2 mod P m 0 N j = m 2 mod P
13 10 12 5 elab2 j A m 0 N j = m 2 mod P
14 abid j j | v A j = P - 1 - v v A j = P - 1 - v
15 5 rexeqi v A j = P - 1 - v v u | m 0 N u = m 2 mod P j = P - 1 - v
16 oveq1 m = n m 2 = n 2
17 16 oveq1d m = n m 2 mod P = n 2 mod P
18 17 eqeq2d m = n u = m 2 mod P u = n 2 mod P
19 18 cbvrexvw m 0 N u = m 2 mod P n 0 N u = n 2 mod P
20 eqeq1 u = v u = n 2 mod P v = n 2 mod P
21 20 rexbidv u = v n 0 N u = n 2 mod P n 0 N v = n 2 mod P
22 19 21 syl5bb u = v m 0 N u = m 2 mod P n 0 N v = n 2 mod P
23 22 rexab v u | m 0 N u = m 2 mod P j = P - 1 - v v n 0 N v = n 2 mod P j = P - 1 - v
24 14 15 23 3bitri j j | v A j = P - 1 - v v n 0 N v = n 2 mod P j = P - 1 - v
25 6 rnmpt ran F = j | v A j = P - 1 - v
26 25 eleq2i j ran F j j | v A j = P - 1 - v
27 rexcom4 n 0 N v v = n 2 mod P j = P - 1 - v v n 0 N v = n 2 mod P j = P - 1 - v
28 r19.41v n 0 N v = n 2 mod P j = P - 1 - v n 0 N v = n 2 mod P j = P - 1 - v
29 28 exbii v n 0 N v = n 2 mod P j = P - 1 - v v n 0 N v = n 2 mod P j = P - 1 - v
30 27 29 bitri n 0 N v v = n 2 mod P j = P - 1 - v v n 0 N v = n 2 mod P j = P - 1 - v
31 24 26 30 3bitr4i j ran F n 0 N v v = n 2 mod P j = P - 1 - v
32 ovex n 2 mod P V
33 oveq2 v = n 2 mod P P - 1 - v = P - 1 - n 2 mod P
34 33 eqeq2d v = n 2 mod P j = P - 1 - v j = P - 1 - n 2 mod P
35 32 34 ceqsexv v v = n 2 mod P j = P - 1 - v j = P - 1 - n 2 mod P
36 35 rexbii n 0 N v v = n 2 mod P j = P - 1 - v n 0 N j = P - 1 - n 2 mod P
37 31 36 bitri j ran F n 0 N j = P - 1 - n 2 mod P
38 13 37 anbi12i j A j ran F m 0 N j = m 2 mod P n 0 N j = P - 1 - n 2 mod P
39 elin j A ran F j A j ran F
40 reeanv m 0 N n 0 N j = m 2 mod P j = P - 1 - n 2 mod P m 0 N j = m 2 mod P n 0 N j = P - 1 - n 2 mod P
41 38 39 40 3bitr4i j A ran F m 0 N n 0 N j = m 2 mod P j = P - 1 - n 2 mod P
42 eqtr2 j = m 2 mod P j = P - 1 - n 2 mod P m 2 mod P = P - 1 - n 2 mod P
43 4 3ad2ant1 φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P
44 prmnn P P
45 43 44 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P
46 nnm1nn0 P P 1 0
47 45 46 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1 0
48 47 nn0red φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1
49 45 nnrpd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P +
50 47 nn0ge0d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 P 1
51 45 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P
52 51 ltm1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1 < P
53 modid P 1 P + 0 P 1 P 1 < P P 1 mod P = P 1
54 48 49 50 52 53 syl22anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1 mod P = P 1
55 54 oveq1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1 mod P n 2 mod P = P - 1 - n 2 mod P
56 simp2r φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 0 N
57 56 elfzelzd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n
58 zsqcl2 n n 2 0
59 57 58 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 0
60 59 nn0red φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2
61 modlt n 2 P + n 2 mod P < P
62 60 49 61 syl2anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P < P
63 zsqcl n n 2
64 57 63 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2
65 64 45 zmodcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P 0
66 65 nn0zd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P
67 prmz P P
68 43 67 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P
69 zltlem1 n 2 mod P P n 2 mod P < P n 2 mod P P 1
70 66 68 69 syl2anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P < P n 2 mod P P 1
71 62 70 mpbid φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P P 1
72 71 54 breqtrrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P P 1 mod P
73 modsubdir P 1 n 2 P + n 2 mod P P 1 mod P P - 1 - n 2 mod P = P 1 mod P n 2 mod P
74 48 60 49 73 syl3anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 mod P P 1 mod P P - 1 - n 2 mod P = P 1 mod P n 2 mod P
75 72 74 mpbid φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P - 1 - n 2 mod P = P 1 mod P n 2 mod P
76 simp3 φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 mod P = P - 1 - n 2 mod P
77 55 75 76 3eqtr4rd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 mod P = P - 1 - n 2 mod P
78 simp2l φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 0 N
79 78 elfzelzd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m
80 zsqcl m m 2
81 79 80 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2
82 47 nn0zd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1
83 82 64 zsubcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P - 1 - n 2
84 moddvds P m 2 P - 1 - n 2 m 2 mod P = P - 1 - n 2 mod P P m 2 P - 1 - n 2
85 45 81 83 84 syl3anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 mod P = P - 1 - n 2 mod P P m 2 P - 1 - n 2
86 77 85 mpbid φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P m 2 P - 1 - n 2
87 zsqcl2 m m 2 0
88 79 87 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 0
89 88 nn0cnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2
90 47 nn0cnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 1
91 59 nn0cnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2
92 89 90 91 subsub3d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 P - 1 - n 2 = m 2 + n 2 - P 1
93 88 59 nn0addcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 0
94 93 nn0cnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2
95 45 nncnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P
96 1cnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 1
97 94 95 96 subsub3d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 - P 1 = m 2 + n 2 + 1 - P
98 92 97 eqtrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 P - 1 - n 2 = m 2 + n 2 + 1 - P
99 86 98 breqtrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P m 2 + n 2 + 1 - P
100 nn0p1nn m 2 + n 2 0 m 2 + n 2 + 1
101 93 100 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1
102 101 nnzd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1
103 dvdssubr P m 2 + n 2 + 1 P m 2 + n 2 + 1 P m 2 + n 2 + 1 - P
104 68 102 103 syl2anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P m 2 + n 2 + 1 P m 2 + n 2 + 1 - P
105 99 104 mpbird φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P m 2 + n 2 + 1
106 45 nnne0d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 0
107 dvdsval2 P P 0 m 2 + n 2 + 1 P m 2 + n 2 + 1 m 2 + n 2 + 1 P
108 68 106 102 107 syl3anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P m 2 + n 2 + 1 m 2 + n 2 + 1 P
109 105 108 mpbid φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P
110 nnrp m 2 + n 2 + 1 m 2 + n 2 + 1 +
111 nnrp P P +
112 rpdivcl m 2 + n 2 + 1 + P + m 2 + n 2 + 1 P +
113 110 111 112 syl2an m 2 + n 2 + 1 P m 2 + n 2 + 1 P +
114 101 45 113 syl2anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P +
115 114 rpgt0d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 < m 2 + n 2 + 1 P
116 elnnz m 2 + n 2 + 1 P m 2 + n 2 + 1 P 0 < m 2 + n 2 + 1 P
117 109 115 116 sylanbrc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P
118 117 nnge1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 1 m 2 + n 2 + 1 P
119 93 nn0red φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2
120 2nn 2
121 2 3ad2ant1 φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N
122 nnmulcl 2 N 2 N
123 120 121 122 sylancr φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N
124 123 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N
125 124 resqcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2
126 nnmulcl 2 2 N 2 2 N
127 120 123 126 sylancr φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 2 N
128 127 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 2 N
129 125 128 readdcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 + 2 2 N
130 1red φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 1
131 121 nnsqcld φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N 2
132 nnmulcl 2 N 2 2 N 2
133 120 131 132 sylancr φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2
134 133 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2
135 88 nn0red φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2
136 131 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N 2
137 79 zred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m
138 elfzle1 m 0 N 0 m
139 78 138 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 m
140 121 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N
141 elfzle2 m 0 N m N
142 78 141 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m N
143 le2sq2 m 0 m N m N m 2 N 2
144 137 139 140 142 143 syl22anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 N 2
145 57 zred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n
146 elfzle1 n 0 N 0 n
147 56 146 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 n
148 elfzle2 n 0 N n N
149 56 148 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n N
150 le2sq2 n 0 n N n N n 2 N 2
151 145 147 140 149 150 syl22anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P n 2 N 2
152 135 60 136 136 144 151 le2addd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 N 2 + N 2
153 131 nncnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N 2
154 153 2timesd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 = N 2 + N 2
155 152 154 breqtrrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 2 N 2
156 2lt4 2 < 4
157 2re 2
158 157 a1i φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2
159 4re 4
160 159 a1i φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 4
161 131 nngt0d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 < N 2
162 ltmul1 2 4 N 2 0 < N 2 2 < 4 2 N 2 < 4 N 2
163 158 160 136 161 162 syl112anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 < 4 2 N 2 < 4 N 2
164 156 163 mpbii φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 < 4 N 2
165 2cn 2
166 121 nncnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P N
167 sqmul 2 N 2 N 2 = 2 2 N 2
168 165 166 167 sylancr φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 = 2 2 N 2
169 sq2 2 2 = 4
170 169 oveq1i 2 2 N 2 = 4 N 2
171 168 170 eqtrdi φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 = 4 N 2
172 164 171 breqtrrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 < 2 N 2
173 119 134 125 155 172 lelttrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 < 2 N 2
174 127 nnrpd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 2 N +
175 125 174 ltaddrpd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N 2 < 2 N 2 + 2 2 N
176 119 125 129 173 175 lttrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 < 2 N 2 + 2 2 N
177 119 129 130 176 ltadd1dd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 < 2 N 2 + 2 2 N + 1
178 3 3ad2ant1 φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P = 2 N + 1
179 178 oveq1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 2 = 2 N + 1 2
180 95 sqvald φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P 2 = P P
181 123 nncnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N
182 binom21 2 N 2 N + 1 2 = 2 N 2 + 2 2 N + 1
183 181 182 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 2 N + 1 2 = 2 N 2 + 2 2 N + 1
184 179 180 183 3eqtr3d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P P P = 2 N 2 + 2 2 N + 1
185 177 184 breqtrrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 < P P
186 101 nnred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1
187 45 nngt0d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P 0 < P
188 ltdivmul m 2 + n 2 + 1 P P 0 < P m 2 + n 2 + 1 P < P m 2 + n 2 + 1 < P P
189 186 51 51 187 188 syl112anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P < P m 2 + n 2 + 1 < P P
190 185 189 mpbird φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P < P
191 1z 1
192 elfzm11 1 P m 2 + n 2 + 1 P 1 P 1 m 2 + n 2 + 1 P 1 m 2 + n 2 + 1 P m 2 + n 2 + 1 P < P
193 191 68 192 sylancr φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P 1 P 1 m 2 + n 2 + 1 P 1 m 2 + n 2 + 1 P m 2 + n 2 + 1 P < P
194 109 118 190 193 mpbir3and φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P 1 P 1
195 gzreim m n m + i n i
196 79 57 195 syl2anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n i
197 gzcn m + i n i m + i n
198 196 197 syl φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n
199 198 absvalsq2d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 = m + i n 2 + m + i n 2
200 137 145 crred φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n = m
201 200 oveq1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 = m 2
202 137 145 crimd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n = n
203 202 oveq1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 = n 2
204 201 203 oveq12d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 + m + i n 2 = m 2 + n 2
205 199 204 eqtrd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 = m 2 + n 2
206 205 oveq1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 + 1 = m 2 + n 2 + 1
207 101 nncnd φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1
208 207 95 106 divcan1d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m 2 + n 2 + 1 P P = m 2 + n 2 + 1
209 206 208 eqtr4d φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P m + i n 2 + 1 = m 2 + n 2 + 1 P P
210 oveq1 k = m 2 + n 2 + 1 P k P = m 2 + n 2 + 1 P P
211 210 eqeq2d k = m 2 + n 2 + 1 P u 2 + 1 = k P u 2 + 1 = m 2 + n 2 + 1 P P
212 fveq2 u = m + i n u = m + i n
213 212 oveq1d u = m + i n u 2 = m + i n 2
214 213 oveq1d u = m + i n u 2 + 1 = m + i n 2 + 1
215 214 eqeq1d u = m + i n u 2 + 1 = m 2 + n 2 + 1 P P m + i n 2 + 1 = m 2 + n 2 + 1 P P
216 211 215 rspc2ev m 2 + n 2 + 1 P 1 P 1 m + i n i m + i n 2 + 1 = m 2 + n 2 + 1 P P k 1 P 1 u i u 2 + 1 = k P
217 194 196 209 216 syl3anc φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P k 1 P 1 u i u 2 + 1 = k P
218 217 3expia φ m 0 N n 0 N m 2 mod P = P - 1 - n 2 mod P k 1 P 1 u i u 2 + 1 = k P
219 42 218 syl5 φ m 0 N n 0 N j = m 2 mod P j = P - 1 - n 2 mod P k 1 P 1 u i u 2 + 1 = k P
220 219 rexlimdvva φ m 0 N n 0 N j = m 2 mod P j = P - 1 - n 2 mod P k 1 P 1 u i u 2 + 1 = k P
221 41 220 syl5bi φ j A ran F k 1 P 1 u i u 2 + 1 = k P
222 221 exlimdv φ j j A ran F k 1 P 1 u i u 2 + 1 = k P
223 9 222 mpd φ k 1 P 1 u i u 2 + 1 = k P