Metamath Proof Explorer


Theorem 2sqlem11

Description: Lemma for 2sq . (Contributed by Mario Carneiro, 19-Jun-2015)

Ref Expression
Hypotheses 2sq.1 S=ranwiw2
2sqlem7.2 Y=z|xyxgcdy=1z=x2+y2
Assertion 2sqlem11 PPmod4=1PS

Proof

Step Hyp Ref Expression
1 2sq.1 S=ranwiw2
2 2sqlem7.2 Y=z|xyxgcdy=1z=x2+y2
3 simpr PPmod4=1Pmod4=1
4 simpl PPmod4=1P
5 1ne2 12
6 5 necomi 21
7 oveq1 P=2Pmod4=2mod4
8 2re 2
9 4re 4
10 4pos 0<4
11 9 10 elrpii 4+
12 0le2 02
13 2lt4 2<4
14 modid 24+022<42mod4=2
15 8 11 12 13 14 mp4an 2mod4=2
16 7 15 eqtrdi P=2Pmod4=2
17 16 neeq1d P=2Pmod4121
18 6 17 mpbiri P=2Pmod41
19 18 necon2i Pmod4=1P2
20 3 19 syl PPmod4=1P2
21 eldifsn P2PP2
22 4 20 21 sylanbrc PPmod4=1P2
23 m1lgs P2-1/LP=1Pmod4=1
24 22 23 syl PPmod4=1-1/LP=1Pmod4=1
25 3 24 mpbird PPmod4=1-1/LP=1
26 neg1z 1
27 lgsqr 1P2-1/LP=1¬P-1nPn2-1
28 26 22 27 sylancr PPmod4=1-1/LP=1¬P-1nPn2-1
29 25 28 mpbid PPmod4=1¬P-1nPn2-1
30 29 simprd PPmod4=1nPn2-1
31 simprl PPmod4=1nPn2-1n
32 1zzd PPmod4=1nPn2-11
33 gcd1 nngcd1=1
34 33 ad2antrl PPmod4=1nPn2-1ngcd1=1
35 eqidd PPmod4=1nPn2-1n2+1=n2+1
36 oveq1 x=nxgcdy=ngcdy
37 36 eqeq1d x=nxgcdy=1ngcdy=1
38 oveq1 x=nx2=n2
39 38 oveq1d x=nx2+y2=n2+y2
40 39 eqeq2d x=nn2+1=x2+y2n2+1=n2+y2
41 37 40 anbi12d x=nxgcdy=1n2+1=x2+y2ngcdy=1n2+1=n2+y2
42 oveq2 y=1ngcdy=ngcd1
43 42 eqeq1d y=1ngcdy=1ngcd1=1
44 oveq1 y=1y2=12
45 sq1 12=1
46 44 45 eqtrdi y=1y2=1
47 46 oveq2d y=1n2+y2=n2+1
48 47 eqeq2d y=1n2+1=n2+y2n2+1=n2+1
49 43 48 anbi12d y=1ngcdy=1n2+1=n2+y2ngcd1=1n2+1=n2+1
50 41 49 rspc2ev n1ngcd1=1n2+1=n2+1xyxgcdy=1n2+1=x2+y2
51 31 32 34 35 50 syl112anc PPmod4=1nPn2-1xyxgcdy=1n2+1=x2+y2
52 ovex n2+1V
53 eqeq1 z=n2+1z=x2+y2n2+1=x2+y2
54 53 anbi2d z=n2+1xgcdy=1z=x2+y2xgcdy=1n2+1=x2+y2
55 54 2rexbidv z=n2+1xyxgcdy=1z=x2+y2xyxgcdy=1n2+1=x2+y2
56 52 55 2 elab2 n2+1Yxyxgcdy=1n2+1=x2+y2
57 51 56 sylibr PPmod4=1nPn2-1n2+1Y
58 prmnn PP
59 58 ad2antrr PPmod4=1nPn2-1P
60 simprr PPmod4=1nPn2-1Pn2-1
61 31 zcnd PPmod4=1nPn2-1n
62 61 sqcld PPmod4=1nPn2-1n2
63 ax-1cn 1
64 subneg n21n2-1=n2+1
65 62 63 64 sylancl PPmod4=1nPn2-1n2-1=n2+1
66 60 65 breqtrd PPmod4=1nPn2-1Pn2+1
67 1 2 2sqlem10 n2+1YPPn2+1PS
68 57 59 66 67 syl3anc PPmod4=1nPn2-1PS
69 30 68 rexlimddv PPmod4=1PS