Metamath Proof Explorer


Theorem 4sqlem15

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

Ref Expression
Hypotheses 4sq.1 S=n|xyzwn=x2+y2+z2+w2
4sq.2 φN
4sq.3 φP=2 N+1
4sq.4 φP
4sq.5 φ02 NS
4sq.6 T=i|iPS
4sq.7 M=supT<
4sq.m φM2
4sq.a φA
4sq.b φB
4sq.c φC
4sq.d φD
4sq.e E=A+M2modMM2
4sq.f F=B+M2modMM2
4sq.g G=C+M2modMM2
4sq.h H=D+M2modMM2
4sq.r R=E2+F2+G2+H2M
4sq.p φMP=A2+B2+C2+D2
Assertion 4sqlem15 φR=MM222E2=0M222F2=0M222G2=0M222H2=0

Proof

Step Hyp Ref Expression
1 4sq.1 S=n|xyzwn=x2+y2+z2+w2
2 4sq.2 φN
3 4sq.3 φP=2 N+1
4 4sq.4 φP
5 4sq.5 φ02 NS
6 4sq.6 T=i|iPS
7 4sq.7 M=supT<
8 4sq.m φM2
9 4sq.a φA
10 4sq.b φB
11 4sq.c φC
12 4sq.d φD
13 4sq.e E=A+M2modMM2
14 4sq.f F=B+M2modMM2
15 4sq.g G=C+M2modMM2
16 4sq.h H=D+M2modMM2
17 4sq.r R=E2+F2+G2+H2M
18 4sq.p φMP=A2+B2+C2+D2
19 eluz2nn M2M
20 8 19 syl φM
21 20 nnred φM
22 21 resqcld φM2
23 22 rehalfcld φM22
24 23 rehalfcld φM222
25 24 recnd φM222
26 9 20 13 4sqlem5 φEAEM
27 26 simpld φE
28 zsqcl EE2
29 27 28 syl φE2
30 29 zred φE2
31 30 recnd φE2
32 10 20 14 4sqlem5 φFBFM
33 32 simpld φF
34 zsqcl FF2
35 33 34 syl φF2
36 35 zred φF2
37 36 recnd φF2
38 25 25 31 37 addsub4d φM222+M222-E2+F2=M222E2+M222-F2
39 23 recnd φM22
40 39 2halvesd φM222+M222=M22
41 40 oveq1d φM222+M222-E2+F2=M22E2+F2
42 38 41 eqtr3d φM222E2+M222-F2=M22E2+F2
43 42 adantr φR=MM222E2+M222-F2=M22E2+F2
44 22 recnd φM2
45 44 2halvesd φM22+M22=M2
46 45 adantr φR=MM22+M22=M2
47 21 recnd φM
48 47 sqvald φM2= M M
49 48 adantr φR=MM2= M M
50 simpr φR=MR=M
51 17 50 eqtr3id φR=ME2+F2+G2+H2M=M
52 51 oveq1d φR=ME2+F2+G2+H2M M= M M
53 30 36 readdcld φE2+F2
54 11 20 15 4sqlem5 φGCGM
55 54 simpld φG
56 zsqcl GG2
57 55 56 syl φG2
58 57 zred φG2
59 12 20 16 4sqlem5 φHDHM
60 59 simpld φH
61 zsqcl HH2
62 60 61 syl φH2
63 62 zred φH2
64 58 63 readdcld φG2+H2
65 53 64 readdcld φE2+F2+G2+H2
66 65 recnd φE2+F2+G2+H2
67 20 nnne0d φM0
68 66 47 67 divcan1d φE2+F2+G2+H2M M=E2+F2+G2+H2
69 68 adantr φR=ME2+F2+G2+H2M M=E2+F2+G2+H2
70 49 52 69 3eqtr2rd φR=ME2+F2+G2+H2=M2
71 46 70 oveq12d φR=MM22+M22-E2+F2+G2+H2=M2M2
72 53 recnd φE2+F2
73 64 recnd φG2+H2
74 39 39 72 73 addsub4d φM22+M22-E2+F2+G2+H2=M22E2+F2+M22-G2+H2
75 74 adantr φR=MM22+M22-E2+F2+G2+H2=M22E2+F2+M22-G2+H2
76 44 subidd φM2M2=0
77 76 adantr φR=MM2M2=0
78 71 75 77 3eqtr3d φR=MM22E2+F2+M22-G2+H2=0
79 23 53 resubcld φM22E2+F2
80 9 20 13 4sqlem7 φE2M222
81 10 20 14 4sqlem7 φF2M222
82 30 36 24 24 80 81 le2addd φE2+F2M222+M222
83 82 40 breqtrd φE2+F2M22
84 23 53 subge0d φ0M22E2+F2E2+F2M22
85 83 84 mpbird φ0M22E2+F2
86 23 64 resubcld φM22G2+H2
87 11 20 15 4sqlem7 φG2M222
88 12 20 16 4sqlem7 φH2M222
89 58 63 24 24 87 88 le2addd φG2+H2M222+M222
90 89 40 breqtrd φG2+H2M22
91 23 64 subge0d φ0M22G2+H2G2+H2M22
92 90 91 mpbird φ0M22G2+H2
93 add20 M22E2+F20M22E2+F2M22G2+H20M22G2+H2M22E2+F2+M22-G2+H2=0M22E2+F2=0M22G2+H2=0
94 79 85 86 92 93 syl22anc φM22E2+F2+M22-G2+H2=0M22E2+F2=0M22G2+H2=0
95 94 biimpa φM22E2+F2+M22-G2+H2=0M22E2+F2=0M22G2+H2=0
96 78 95 syldan φR=MM22E2+F2=0M22G2+H2=0
97 96 simpld φR=MM22E2+F2=0
98 43 97 eqtrd φR=MM222E2+M222-F2=0
99 24 30 resubcld φM222E2
100 24 30 subge0d φ0M222E2E2M222
101 80 100 mpbird φ0M222E2
102 24 36 resubcld φM222F2
103 24 36 subge0d φ0M222F2F2M222
104 81 103 mpbird φ0M222F2
105 add20 M222E20M222E2M222F20M222F2M222E2+M222-F2=0M222E2=0M222F2=0
106 99 101 102 104 105 syl22anc φM222E2+M222-F2=0M222E2=0M222F2=0
107 106 biimpa φM222E2+M222-F2=0M222E2=0M222F2=0
108 98 107 syldan φR=MM222E2=0M222F2=0
109 58 recnd φG2
110 63 recnd φH2
111 25 25 109 110 addsub4d φM222+M222-G2+H2=M222G2+M222-H2
112 40 oveq1d φM222+M222-G2+H2=M22G2+H2
113 111 112 eqtr3d φM222G2+M222-H2=M22G2+H2
114 113 adantr φR=MM222G2+M222-H2=M22G2+H2
115 96 simprd φR=MM22G2+H2=0
116 114 115 eqtrd φR=MM222G2+M222-H2=0
117 24 58 resubcld φM222G2
118 24 58 subge0d φ0M222G2G2M222
119 87 118 mpbird φ0M222G2
120 24 63 resubcld φM222H2
121 24 63 subge0d φ0M222H2H2M222
122 88 121 mpbird φ0M222H2
123 add20 M222G20M222G2M222H20M222H2M222G2+M222-H2=0M222G2=0M222H2=0
124 117 119 120 122 123 syl22anc φM222G2+M222-H2=0M222G2=0M222H2=0
125 124 biimpa φM222G2+M222-H2=0M222G2=0M222H2=0
126 116 125 syldan φR=MM222G2=0M222H2=0
127 108 126 jca φR=MM222E2=0M222F2=0M222G2=0M222H2=0