Metamath Proof Explorer


Theorem 2sqlem4

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

Ref Expression
Hypotheses 2sq.1 S = ran w i w 2
2sqlem5.1 φ N
2sqlem5.2 φ P
2sqlem4.3 φ A
2sqlem4.4 φ B
2sqlem4.5 φ C
2sqlem4.6 φ D
2sqlem4.7 φ N P = A 2 + B 2
2sqlem4.8 φ P = C 2 + D 2
Assertion 2sqlem4 φ N S

Proof

Step Hyp Ref Expression
1 2sq.1 S = ran w i w 2
2 2sqlem5.1 φ N
3 2sqlem5.2 φ P
4 2sqlem4.3 φ A
5 2sqlem4.4 φ B
6 2sqlem4.5 φ C
7 2sqlem4.6 φ D
8 2sqlem4.7 φ N P = A 2 + B 2
9 2sqlem4.8 φ P = C 2 + D 2
10 2 adantr φ P C B + A D N
11 3 adantr φ P C B + A D P
12 4 adantr φ P C B + A D A
13 5 adantr φ P C B + A D B
14 6 adantr φ P C B + A D C
15 7 adantr φ P C B + A D D
16 8 adantr φ P C B + A D N P = A 2 + B 2
17 9 adantr φ P C B + A D P = C 2 + D 2
18 simpr φ P C B + A D P C B + A D
19 1 10 11 12 13 14 15 16 17 18 2sqlem3 φ P C B + A D N S
20 2 adantr φ P C B A D N
21 3 adantr φ P C B A D P
22 4 znegcld φ A
23 22 adantr φ P C B A D A
24 5 adantr φ P C B A D B
25 6 adantr φ P C B A D C
26 7 adantr φ P C B A D D
27 4 zcnd φ A
28 sqneg A A 2 = A 2
29 27 28 syl φ A 2 = A 2
30 29 oveq1d φ A 2 + B 2 = A 2 + B 2
31 8 30 eqtr4d φ N P = A 2 + B 2
32 31 adantr φ P C B A D N P = A 2 + B 2
33 9 adantr φ P C B A D P = C 2 + D 2
34 7 zcnd φ D
35 27 34 mulneg1d φ A D = A D
36 35 oveq2d φ C B + A D = C B + A D
37 6 5 zmulcld φ C B
38 37 zcnd φ C B
39 4 7 zmulcld φ A D
40 39 zcnd φ A D
41 38 40 negsubd φ C B + A D = C B A D
42 36 41 eqtrd φ C B + A D = C B A D
43 42 breq2d φ P C B + A D P C B A D
44 43 biimpar φ P C B A D P C B + A D
45 1 20 21 23 24 25 26 32 33 44 2sqlem3 φ P C B A D N S
46 prmz P P
47 3 46 syl φ P
48 zsqcl C C 2
49 6 48 syl φ C 2
50 2 nnzd φ N
51 49 50 zmulcld φ C 2 N
52 zsqcl A A 2
53 4 52 syl φ A 2
54 51 53 zsubcld φ C 2 N A 2
55 dvdsmul1 P C 2 N A 2 P P C 2 N A 2
56 47 54 55 syl2anc φ P P C 2 N A 2
57 6 4 zmulcld φ C A
58 57 zcnd φ C A
59 58 sqcld φ C A 2
60 38 sqcld φ C B 2
61 40 sqcld φ A D 2
62 59 60 61 pnpcand φ C A 2 + C B 2 - C A 2 + A D 2 = C B 2 A D 2
63 6 zcnd φ C
64 63 27 sqmuld φ C A 2 = C 2 A 2
65 5 zcnd φ B
66 63 65 sqmuld φ C B 2 = C 2 B 2
67 64 66 oveq12d φ C A 2 + C B 2 = C 2 A 2 + C 2 B 2
68 63 sqcld φ C 2
69 53 zcnd φ A 2
70 65 sqcld φ B 2
71 68 69 70 adddid φ C 2 A 2 + B 2 = C 2 A 2 + C 2 B 2
72 67 71 eqtr4d φ C A 2 + C B 2 = C 2 A 2 + B 2
73 2 nncnd φ N
74 47 zcnd φ P
75 73 74 mulcomd φ N P = P N
76 8 75 eqtr3d φ A 2 + B 2 = P N
77 76 oveq2d φ C 2 A 2 + B 2 = C 2 P N
78 68 74 73 mul12d φ C 2 P N = P C 2 N
79 77 78 eqtrd φ C 2 A 2 + B 2 = P C 2 N
80 72 79 eqtrd φ C A 2 + C B 2 = P C 2 N
81 27 34 sqmuld φ A D 2 = A 2 D 2
82 34 sqcld φ D 2
83 69 82 mulcomd φ A 2 D 2 = D 2 A 2
84 81 83 eqtrd φ A D 2 = D 2 A 2
85 64 84 oveq12d φ C A 2 + A D 2 = C 2 A 2 + D 2 A 2
86 49 zcnd φ C 2
87 86 82 69 adddird φ C 2 + D 2 A 2 = C 2 A 2 + D 2 A 2
88 85 87 eqtr4d φ C A 2 + A D 2 = C 2 + D 2 A 2
89 9 oveq1d φ P A 2 = C 2 + D 2 A 2
90 88 89 eqtr4d φ C A 2 + A D 2 = P A 2
91 80 90 oveq12d φ C A 2 + C B 2 - C A 2 + A D 2 = P C 2 N P A 2
92 51 zcnd φ C 2 N
93 74 92 69 subdid φ P C 2 N A 2 = P C 2 N P A 2
94 91 93 eqtr4d φ C A 2 + C B 2 - C A 2 + A D 2 = P C 2 N A 2
95 62 94 eqtr3d φ C B 2 A D 2 = P C 2 N A 2
96 subsq C B A D C B 2 A D 2 = C B + A D C B A D
97 38 40 96 syl2anc φ C B 2 A D 2 = C B + A D C B A D
98 95 97 eqtr3d φ P C 2 N A 2 = C B + A D C B A D
99 56 98 breqtrd φ P C B + A D C B A D
100 37 39 zaddcld φ C B + A D
101 37 39 zsubcld φ C B A D
102 euclemma P C B + A D C B A D P C B + A D C B A D P C B + A D P C B A D
103 3 100 101 102 syl3anc φ P C B + A D C B A D P C B + A D P C B A D
104 99 103 mpbid φ P C B + A D P C B A D
105 19 45 104 mpjaodan φ N S