Metamath Proof Explorer


Theorem pythagtriplem4

Description: Lemma for pythagtrip . Show that C - B and C + B are relatively prime. (Contributed by Scott Fenton, 12-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion pythagtriplem4 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 1

Proof

Step Hyp Ref Expression
1 simp3r A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A ¬ 2 A
2 nnz C C
3 nnz B B
4 zsubcl C B C B
5 2 3 4 syl2anr B C C B
6 5 3adant1 A B C C B
7 6 3ad2ant1 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B
8 simp13 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C
9 simp12 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A B
10 8 9 nnaddcld A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C + B
11 10 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C + B
12 gcddvds C B C + B C B gcd C + B C B C B gcd C + B C + B
13 7 11 12 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B C B C B gcd C + B C + B
14 13 simprd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B C + B
15 breq1 C B gcd C + B = 2 C B gcd C + B C + B 2 C + B
16 15 biimpd C B gcd C + B = 2 C B gcd C + B C + B 2 C + B
17 14 16 mpan9 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 C + B
18 2z 2
19 simpl13 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C
20 19 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C
21 simpl12 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 B
22 21 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 B
23 20 22 zaddcld A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C + B
24 20 22 zsubcld A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C B
25 dvdsmultr1 2 C + B C B 2 C + B 2 C + B C B
26 18 23 24 25 mp3an2i A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 C + B 2 C + B C B
27 17 26 mpd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 C + B C B
28 19 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C
29 21 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 B
30 subsq C B C 2 B 2 = C + B C B
31 28 29 30 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C 2 B 2 = C + B C B
32 27 31 breqtrrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 C 2 B 2
33 simpl2 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A 2 + B 2 = C 2
34 33 oveq1d A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A 2 + B 2 - B 2 = C 2 B 2
35 simpl11 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A
36 35 nnsqcld A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A 2
37 36 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A 2
38 21 nnsqcld A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 B 2
39 38 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 B 2
40 37 39 pncand A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A 2 + B 2 - B 2 = A 2
41 34 40 eqtr3d A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C 2 B 2 = A 2
42 32 41 breqtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 A 2
43 nnz A A
44 43 3ad2ant1 A B C A
45 44 3ad2ant1 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A A
46 45 adantr A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 A
47 2prm 2
48 2nn 2
49 prmdvdsexp 2 A 2 2 A 2 2 A
50 47 48 49 mp3an13 A 2 A 2 2 A
51 46 50 syl A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 A 2 2 A
52 42 51 mpbid A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 2 A
53 1 52 mtand A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A ¬ C B gcd C + B = 2
54 neg1z 1
55 gcdaddm 1 C B C + B C B gcd C + B = C B gcd C + B + -1 C B
56 54 7 11 55 mp3an2i A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = C B gcd C + B + -1 C B
57 8 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C
58 9 nncnd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A B
59 pnncan C B B C + B - C B = B + B
60 59 3anidm23 C B C + B - C B = B + B
61 subcl C B C B
62 61 mulm1d C B -1 C B = C B
63 62 oveq2d C B C + B + -1 C B = C + B + C B
64 addcl C B C + B
65 64 61 negsubd C B C + B + C B = C + B - C B
66 63 65 eqtrd C B C + B + -1 C B = C + B - C B
67 2times B 2 B = B + B
68 67 adantl C B 2 B = B + B
69 60 66 68 3eqtr4d C B C + B + -1 C B = 2 B
70 69 oveq2d C B C B gcd C + B + -1 C B = C B gcd 2 B
71 57 58 70 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B + -1 C B = C B gcd 2 B
72 56 71 eqtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = C B gcd 2 B
73 9 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A B
74 zmulcl 2 B 2 B
75 18 73 74 sylancr A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 B
76 gcddvds C B 2 B C B gcd 2 B C B C B gcd 2 B 2 B
77 7 75 76 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd 2 B C B C B gcd 2 B 2 B
78 77 simprd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd 2 B 2 B
79 72 78 eqbrtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2 B
80 1z 1
81 gcdaddm 1 C B C + B C B gcd C + B = C B gcd C + B + 1 C B
82 80 7 11 81 mp3an2i A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = C B gcd C + B + 1 C B
83 ppncan C B C C + B + C B = C + C
84 83 3anidm13 C B C + B + C B = C + C
85 61 mulid2d C B 1 C B = C B
86 85 oveq2d C B C + B + 1 C B = C + B + C B
87 2times C 2 C = C + C
88 87 adantr C B 2 C = C + C
89 84 86 88 3eqtr4d C B C + B + 1 C B = 2 C
90 57 58 89 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C + B + 1 C B = 2 C
91 90 oveq2d A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B + 1 C B = C B gcd 2 C
92 82 91 eqtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = C B gcd 2 C
93 8 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C
94 zmulcl 2 C 2 C
95 18 93 94 sylancr A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 C
96 gcddvds C B 2 C C B gcd 2 C C B C B gcd 2 C 2 C
97 7 95 96 syl2anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd 2 C C B C B gcd 2 C 2 C
98 97 simprd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd 2 C 2 C
99 92 98 eqbrtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2 C
100 nnaddcl C B C + B
101 100 nnne0d C B C + B 0
102 101 ancoms B C C + B 0
103 102 3adant1 A B C C + B 0
104 103 3ad2ant1 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C + B 0
105 104 neneqd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A ¬ C + B = 0
106 105 intnand A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A ¬ C B = 0 C + B = 0
107 gcdn0cl C B C + B ¬ C B = 0 C + B = 0 C B gcd C + B
108 7 11 106 107 syl21anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B
109 108 nnzd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B
110 dvdsgcd C B gcd C + B 2 B 2 C C B gcd C + B 2 B C B gcd C + B 2 C C B gcd C + B 2 B gcd 2 C
111 109 75 95 110 syl3anc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2 B C B gcd C + B 2 C C B gcd C + B 2 B gcd 2 C
112 79 99 111 mp2and A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2 B gcd 2 C
113 2nn0 2 0
114 mulgcd 2 0 B C 2 B gcd 2 C = 2 B gcd C
115 113 73 93 114 mp3an2i A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 B gcd 2 C = 2 B gcd C
116 pythagtriplem3 A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A B gcd C = 1
117 116 oveq2d A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 B gcd C = 2 1
118 2t1e2 2 1 = 2
119 117 118 eqtrdi A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 B gcd C = 2
120 115 119 eqtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A 2 B gcd 2 C = 2
121 112 120 breqtrd A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2
122 dvdsprime 2 C B gcd C + B C B gcd C + B 2 C B gcd C + B = 2 C B gcd C + B = 1
123 47 108 122 sylancr A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B 2 C B gcd C + B = 2 C B gcd C + B = 1
124 121 123 mpbid A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 2 C B gcd C + B = 1
125 orel1 ¬ C B gcd C + B = 2 C B gcd C + B = 2 C B gcd C + B = 1 C B gcd C + B = 1
126 53 124 125 sylc A B C A 2 + B 2 = C 2 A gcd B = 1 ¬ 2 A C B gcd C + B = 1