Metamath Proof Explorer


Theorem 4sqlem13

Description: Lemma for 4sq . (Contributed by Mario Carneiro, 16-Jul-2014) (Revised by AV, 14-Sep-2020)

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
4sq.5 φ 0 2 N S
4sq.6 T = i | i P S
4sq.7 M = sup T <
Assertion 4sqlem13 φ T M < 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 4sq.5 φ 0 2 N S
6 4sq.6 T = i | i P S
7 4sq.7 M = sup T <
8 eqid u | m 0 N u = m 2 mod P = u | m 0 N u = m 2 mod P
9 eqid v u | m 0 N u = m 2 mod P P - 1 - v = v u | m 0 N u = m 2 mod P P - 1 - v
10 1 2 3 4 8 9 4sqlem12 φ k 1 P 1 u i u 2 + 1 = k P
11 simplrl φ k 1 P 1 u i u 2 + 1 = k P k 1 P 1
12 elfznn k 1 P 1 k
13 11 12 syl φ k 1 P 1 u i u 2 + 1 = k P k
14 simpr φ k 1 P 1 u i u 2 + 1 = k P u 2 + 1 = k P
15 abs1 1 = 1
16 15 oveq1i 1 2 = 1 2
17 sq1 1 2 = 1
18 16 17 eqtri 1 2 = 1
19 18 oveq2i u 2 + 1 2 = u 2 + 1
20 simplrr φ k 1 P 1 u i u 2 + 1 = k P u i
21 1z 1
22 zgz 1 1 i
23 21 22 ax-mp 1 i
24 1 4sqlem4a u i 1 i u 2 + 1 2 S
25 20 23 24 sylancl φ k 1 P 1 u i u 2 + 1 = k P u 2 + 1 2 S
26 19 25 eqeltrrid φ k 1 P 1 u i u 2 + 1 = k P u 2 + 1 S
27 14 26 eqeltrrd φ k 1 P 1 u i u 2 + 1 = k P k P S
28 oveq1 i = k i P = k P
29 28 eleq1d i = k i P S k P S
30 29 6 elrab2 k T k k P S
31 13 27 30 sylanbrc φ k 1 P 1 u i u 2 + 1 = k P k T
32 31 ne0d φ k 1 P 1 u i u 2 + 1 = k P T
33 6 ssrab3 T
34 nnuz = 1
35 33 34 sseqtri T 1
36 infssuzcl T 1 T sup T < T
37 35 32 36 sylancr φ k 1 P 1 u i u 2 + 1 = k P sup T < T
38 7 37 eqeltrid φ k 1 P 1 u i u 2 + 1 = k P M T
39 33 38 sselid φ k 1 P 1 u i u 2 + 1 = k P M
40 39 nnred φ k 1 P 1 u i u 2 + 1 = k P M
41 13 nnred φ k 1 P 1 u i u 2 + 1 = k P k
42 4 ad2antrr φ k 1 P 1 u i u 2 + 1 = k P P
43 prmnn P P
44 42 43 syl φ k 1 P 1 u i u 2 + 1 = k P P
45 44 nnred φ k 1 P 1 u i u 2 + 1 = k P P
46 infssuzle T 1 k T sup T < k
47 35 31 46 sylancr φ k 1 P 1 u i u 2 + 1 = k P sup T < k
48 7 47 eqbrtrid φ k 1 P 1 u i u 2 + 1 = k P M k
49 prmz P P
50 42 49 syl φ k 1 P 1 u i u 2 + 1 = k P P
51 elfzm11 1 P k 1 P 1 k 1 k k < P
52 21 50 51 sylancr φ k 1 P 1 u i u 2 + 1 = k P k 1 P 1 k 1 k k < P
53 11 52 mpbid φ k 1 P 1 u i u 2 + 1 = k P k 1 k k < P
54 53 simp3d φ k 1 P 1 u i u 2 + 1 = k P k < P
55 40 41 45 48 54 lelttrd φ k 1 P 1 u i u 2 + 1 = k P M < P
56 32 55 jca φ k 1 P 1 u i u 2 + 1 = k P T M < P
57 56 ex φ k 1 P 1 u i u 2 + 1 = k P T M < P
58 57 rexlimdvva φ k 1 P 1 u i u 2 + 1 = k P T M < P
59 10 58 mpd φ T M < P