Metamath Proof Explorer


Theorem pythagtriplem19

Description: Lemma for pythagtrip . Introduce k and remove the relative primality requirement. (Contributed by Scott Fenton, 18-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion pythagtriplem19 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2

Proof

Step Hyp Ref Expression
1 gcdnncl A B A gcd B
2 1 3adant3 A B C A gcd B
3 2 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A gcd B
4 nnz A A
5 nnz B B
6 gcddvds A B A gcd B A A gcd B B
7 4 5 6 syl2an A B A gcd B A A gcd B B
8 7 3adant3 A B C A gcd B A A gcd B B
9 8 simpld A B C A gcd B A
10 2 nnzd A B C A gcd B
11 2 nnne0d A B C A gcd B 0
12 4 3ad2ant1 A B C A
13 dvdsval2 A gcd B A gcd B 0 A A gcd B A A A gcd B
14 10 11 12 13 syl3anc A B C A gcd B A A A gcd B
15 9 14 mpbid A B C A A gcd B
16 nnre A A
17 16 3ad2ant1 A B C A
18 2 nnred A B C A gcd B
19 nngt0 A 0 < A
20 19 3ad2ant1 A B C 0 < A
21 2 nngt0d A B C 0 < A gcd B
22 17 18 20 21 divgt0d A B C 0 < A A gcd B
23 elnnz A A gcd B A A gcd B 0 < A A gcd B
24 15 22 23 sylanbrc A B C A A gcd B
25 24 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A A gcd B
26 8 simprd A B C A gcd B B
27 5 3ad2ant2 A B C B
28 dvdsval2 A gcd B A gcd B 0 B A gcd B B B A gcd B
29 10 11 27 28 syl3anc A B C A gcd B B B A gcd B
30 26 29 mpbid A B C B A gcd B
31 nnre B B
32 31 3ad2ant2 A B C B
33 nngt0 B 0 < B
34 33 3ad2ant2 A B C 0 < B
35 32 18 34 21 divgt0d A B C 0 < B A gcd B
36 elnnz B A gcd B B A gcd B 0 < B A gcd B
37 30 35 36 sylanbrc A B C B A gcd B
38 37 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B B A gcd B
39 dvdssq A gcd B A A gcd B A A gcd B 2 A 2
40 10 12 39 syl2anc A B C A gcd B A A gcd B 2 A 2
41 dvdssq A gcd B B A gcd B B A gcd B 2 B 2
42 10 27 41 syl2anc A B C A gcd B B A gcd B 2 B 2
43 40 42 anbi12d A B C A gcd B A A gcd B B A gcd B 2 A 2 A gcd B 2 B 2
44 8 43 mpbid A B C A gcd B 2 A 2 A gcd B 2 B 2
45 2 nnsqcld A B C A gcd B 2
46 45 nnzd A B C A gcd B 2
47 nnsqcl A A 2
48 47 3ad2ant1 A B C A 2
49 48 nnzd A B C A 2
50 nnsqcl B B 2
51 50 3ad2ant2 A B C B 2
52 51 nnzd A B C B 2
53 dvds2add A gcd B 2 A 2 B 2 A gcd B 2 A 2 A gcd B 2 B 2 A gcd B 2 A 2 + B 2
54 46 49 52 53 syl3anc A B C A gcd B 2 A 2 A gcd B 2 B 2 A gcd B 2 A 2 + B 2
55 44 54 mpd A B C A gcd B 2 A 2 + B 2
56 55 adantr A B C A 2 + B 2 = C 2 A gcd B 2 A 2 + B 2
57 simpr A B C A 2 + B 2 = C 2 A 2 + B 2 = C 2
58 56 57 breqtrd A B C A 2 + B 2 = C 2 A gcd B 2 C 2
59 nnz C C
60 59 3ad2ant3 A B C C
61 dvdssq A gcd B C A gcd B C A gcd B 2 C 2
62 10 60 61 syl2anc A B C A gcd B C A gcd B 2 C 2
63 62 adantr A B C A 2 + B 2 = C 2 A gcd B C A gcd B 2 C 2
64 58 63 mpbird A B C A 2 + B 2 = C 2 A gcd B C
65 dvdsval2 A gcd B A gcd B 0 C A gcd B C C A gcd B
66 10 11 60 65 syl3anc A B C A gcd B C C A gcd B
67 66 adantr A B C A 2 + B 2 = C 2 A gcd B C C A gcd B
68 64 67 mpbid A B C A 2 + B 2 = C 2 C A gcd B
69 nnre C C
70 69 3ad2ant3 A B C C
71 nngt0 C 0 < C
72 71 3ad2ant3 A B C 0 < C
73 70 18 72 21 divgt0d A B C 0 < C A gcd B
74 73 adantr A B C A 2 + B 2 = C 2 0 < C A gcd B
75 elnnz C A gcd B C A gcd B 0 < C A gcd B
76 68 74 75 sylanbrc A B C A 2 + B 2 = C 2 C A gcd B
77 76 3adant3 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B C A gcd B
78 48 nncnd A B C A 2
79 51 nncnd A B C B 2
80 45 nncnd A B C A gcd B 2
81 45 nnne0d A B C A gcd B 2 0
82 78 79 80 81 divdird A B C A 2 + B 2 A gcd B 2 = A 2 A gcd B 2 + B 2 A gcd B 2
83 82 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A 2 + B 2 A gcd B 2 = A 2 A gcd B 2 + B 2 A gcd B 2
84 nncn C C
85 84 3ad2ant3 A B C C
86 2 nncnd A B C A gcd B
87 85 86 11 sqdivd A B C C A gcd B 2 = C 2 A gcd B 2
88 87 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B C A gcd B 2 = C 2 A gcd B 2
89 oveq1 A 2 + B 2 = C 2 A 2 + B 2 A gcd B 2 = C 2 A gcd B 2
90 89 3ad2ant2 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A 2 + B 2 A gcd B 2 = C 2 A gcd B 2
91 88 90 eqtr4d A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B C A gcd B 2 = A 2 + B 2 A gcd B 2
92 nncn A A
93 92 3ad2ant1 A B C A
94 93 86 11 sqdivd A B C A A gcd B 2 = A 2 A gcd B 2
95 nncn B B
96 95 3ad2ant2 A B C B
97 96 86 11 sqdivd A B C B A gcd B 2 = B 2 A gcd B 2
98 94 97 oveq12d A B C A A gcd B 2 + B A gcd B 2 = A 2 A gcd B 2 + B 2 A gcd B 2
99 98 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A A gcd B 2 + B A gcd B 2 = A 2 A gcd B 2 + B 2 A gcd B 2
100 83 91 99 3eqtr4rd A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A A gcd B 2 + B A gcd B 2 = C A gcd B 2
101 gcddiv A B A gcd B A gcd B A A gcd B B A gcd B A gcd B = A A gcd B gcd B A gcd B
102 12 27 2 8 101 syl31anc A B C A gcd B A gcd B = A A gcd B gcd B A gcd B
103 86 11 dividd A B C A gcd B A gcd B = 1
104 102 103 eqtr3d A B C A A gcd B gcd B A gcd B = 1
105 104 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A A gcd B gcd B A gcd B = 1
106 simp3 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B ¬ 2 A A gcd B
107 pythagtriplem18 A A gcd B B A gcd B C A gcd B A A gcd B 2 + B A gcd B 2 = C A gcd B 2 A A gcd B gcd B A gcd B = 1 ¬ 2 A A gcd B n m A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2
108 25 38 77 100 105 106 107 syl312anc A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B n m A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2
109 93 86 11 divcan2d A B C A gcd B A A gcd B = A
110 109 eqcomd A B C A = A gcd B A A gcd B
111 96 86 11 divcan2d A B C A gcd B B A gcd B = B
112 111 eqcomd A B C B = A gcd B B A gcd B
113 85 86 11 divcan2d A B C A gcd B C A gcd B = C
114 113 eqcomd A B C C = A gcd B C A gcd B
115 110 112 114 3jca A B C A = A gcd B A A gcd B B = A gcd B B A gcd B C = A gcd B C A gcd B
116 115 3ad2ant1 A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A = A gcd B A A gcd B B = A gcd B B A gcd B C = A gcd B C A gcd B
117 oveq2 A A gcd B = m 2 n 2 A gcd B A A gcd B = A gcd B m 2 n 2
118 117 eqeq2d A A gcd B = m 2 n 2 A = A gcd B A A gcd B A = A gcd B m 2 n 2
119 118 3ad2ant1 A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 A = A gcd B A A gcd B A = A gcd B m 2 n 2
120 oveq2 B A gcd B = 2 m n A gcd B B A gcd B = A gcd B 2 m n
121 120 eqeq2d B A gcd B = 2 m n B = A gcd B B A gcd B B = A gcd B 2 m n
122 121 3ad2ant2 A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 B = A gcd B B A gcd B B = A gcd B 2 m n
123 oveq2 C A gcd B = m 2 + n 2 A gcd B C A gcd B = A gcd B m 2 + n 2
124 123 eqeq2d C A gcd B = m 2 + n 2 C = A gcd B C A gcd B C = A gcd B m 2 + n 2
125 124 3ad2ant3 A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 C = A gcd B C A gcd B C = A gcd B m 2 + n 2
126 119 122 125 3anbi123d A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 A = A gcd B A A gcd B B = A gcd B B A gcd B C = A gcd B C A gcd B A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
127 116 126 syl5ibcom A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
128 127 reximdv A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B m A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 m A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
129 128 reximdv A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B n m A A gcd B = m 2 n 2 B A gcd B = 2 m n C A gcd B = m 2 + n 2 n m A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
130 108 129 mpd A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B n m A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
131 oveq1 k = A gcd B k m 2 n 2 = A gcd B m 2 n 2
132 131 eqeq2d k = A gcd B A = k m 2 n 2 A = A gcd B m 2 n 2
133 oveq1 k = A gcd B k 2 m n = A gcd B 2 m n
134 133 eqeq2d k = A gcd B B = k 2 m n B = A gcd B 2 m n
135 oveq1 k = A gcd B k m 2 + n 2 = A gcd B m 2 + n 2
136 135 eqeq2d k = A gcd B C = k m 2 + n 2 C = A gcd B m 2 + n 2
137 132 134 136 3anbi123d k = A gcd B A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
138 137 2rexbidv k = A gcd B n m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n m A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2
139 138 rspcev A gcd B n m A = A gcd B m 2 n 2 B = A gcd B 2 m n C = A gcd B m 2 + n 2 k n m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
140 3 130 139 syl2anc A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B k n m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
141 rexcom k n m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n k m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
142 rexcom k m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
143 142 rexbii n k m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
144 141 143 bitri k n m A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
145 140 144 sylib A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2