Metamath Proof Explorer


Theorem pythagtrip

Description: Parameterize the Pythagorean triples. If A , B , and C are naturals, then they obey the Pythagorean triple formula iff they are parameterized by three naturals. This proof follows the Isabelle proof at http://afp.sourceforge.net/entries/Fermat3_4.shtml . This is Metamath 100 proof #23. (Contributed by Scott Fenton, 19-Apr-2014)

Ref Expression
Assertion pythagtrip A B C A 2 + B 2 = C 2 n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2

Proof

Step Hyp Ref Expression
1 divgcdodd A B ¬ 2 A A gcd B ¬ 2 B A gcd B
2 1 3adant3 A B C ¬ 2 A A gcd B ¬ 2 B A gcd B
3 2 adantr A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B ¬ 2 B A gcd B
4 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
5 4 3expia 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
6 simp12 A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B B
7 simp11 A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B A
8 simp13 A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B C
9 nnsqcl A A 2
10 9 nncnd A A 2
11 10 3ad2ant1 A B C A 2
12 nnsqcl B B 2
13 12 nncnd B B 2
14 13 3ad2ant2 A B C B 2
15 11 14 addcomd A B C A 2 + B 2 = B 2 + A 2
16 15 eqeq1d A B C A 2 + B 2 = C 2 B 2 + A 2 = C 2
17 16 biimpa A B C A 2 + B 2 = C 2 B 2 + A 2 = C 2
18 17 3adant3 A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B B 2 + A 2 = C 2
19 nnz A A
20 19 3ad2ant1 A B C A
21 nnz B B
22 21 3ad2ant2 A B C B
23 22 adantr A B C A 2 + B 2 = C 2 B
24 gcdcom A B A gcd B = B gcd A
25 20 23 24 syl2an2r A B C A 2 + B 2 = C 2 A gcd B = B gcd A
26 25 oveq2d A B C A 2 + B 2 = C 2 B A gcd B = B B gcd A
27 26 breq2d A B C A 2 + B 2 = C 2 2 B A gcd B 2 B B gcd A
28 27 notbid A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B ¬ 2 B B gcd A
29 28 biimp3a A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B ¬ 2 B B gcd A
30 pythagtriplem19 B A C B 2 + A 2 = C 2 ¬ 2 B B gcd A n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
31 6 7 8 18 29 30 syl311anc A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
32 31 3expia A B C A 2 + B 2 = C 2 ¬ 2 B A gcd B n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
33 5 32 orim12d A B C A 2 + B 2 = C 2 ¬ 2 A A gcd B ¬ 2 B A gcd B n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
34 3 33 mpd A B C A 2 + B 2 = C 2 n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
35 ovex k m 2 n 2 V
36 ovex k 2 m n V
37 preq12bg A B k m 2 n 2 V k 2 m n V A B = k m 2 n 2 k 2 m n A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2
38 35 36 37 mpanr12 A B A B = k m 2 n 2 k 2 m n A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2
39 38 anbi1d A B A B = k m 2 n 2 k 2 m n C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
40 39 rexbidv A B k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2 k A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
41 40 2rexbidv A B n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2 n m k A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
42 andir A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
43 df-3an A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2
44 df-3an A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
45 43 44 orbi12i A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2
46 3ancoma A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
47 46 orbi2i A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
48 42 45 47 3bitr2i A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
49 48 rexbii k A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 C = k m 2 + n 2 k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
50 49 2rexbii n m k A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 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 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
51 r19.43 k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2 k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
52 51 2rexbii n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = 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 k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
53 r19.43 m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 k B = k m 2 n 2 A = 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 m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
54 53 rexbii n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 k B = k m 2 n 2 A = 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 m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
55 r19.43 n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 m k B = k m 2 n 2 A = 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
56 54 55 bitri n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 k B = k m 2 n 2 A = 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
57 52 56 bitri n m k A = k m 2 n 2 B = k 2 m n C = k m 2 + n 2 B = k m 2 n 2 A = 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
58 50 57 bitri n m k A = k m 2 n 2 B = k 2 m n A = k 2 m n B = k m 2 n 2 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
59 41 58 bitrdi A B n m k A B = k m 2 n 2 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
60 59 3adant3 A B C n m k A B = k m 2 n 2 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
61 60 adantr A B C A 2 + B 2 = C 2 n m k A B = k m 2 n 2 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 n m k B = k m 2 n 2 A = k 2 m n C = k m 2 + n 2
62 34 61 mpbird A B C A 2 + B 2 = C 2 n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2
63 62 ex A B C A 2 + B 2 = C 2 n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2
64 pythagtriplem2 A B n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2 A 2 + B 2 = C 2
65 64 3adant3 A B C n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2 A 2 + B 2 = C 2
66 63 65 impbid A B C A 2 + B 2 = C 2 n m k A B = k m 2 n 2 k 2 m n C = k m 2 + n 2