Metamath Proof Explorer


Theorem pythag

Description: Pythagorean theorem. Given three distinct points A, B, and C that form a right triangle (with the right angle at C), prove a relationship between their segment lengths. This theorem is expressed using the complex number plane as a plane, where F is the signed angle construct (as used in ang180 ), X is the distance of line segment BC, Y is the distance of line segment AC, Z is the distance of line segment AB (the hypotenuse), and O is the signed right angle m/__ BCA. We use the law of cosines lawcos to prove this, along with simple trigonometry facts like coshalfpi and cosneg . (Contributed by David A. Wheeler, 13-Jun-2015)

Ref Expression
Hypotheses lawcos.1 F = x 0 , y 0 log y x
lawcos.2 X = B C
lawcos.3 Y = A C
lawcos.4 Z = A B
lawcos.5 O = B C F A C
Assertion pythag A B C A C B C O π 2 π 2 Z 2 = X 2 + Y 2

Proof

Step Hyp Ref Expression
1 lawcos.1 F = x 0 , y 0 log y x
2 lawcos.2 X = B C
3 lawcos.3 Y = A C
4 lawcos.4 Z = A B
5 lawcos.5 O = B C F A C
6 1 2 3 4 5 lawcos A B C A C B C Z 2 = X 2 + Y 2 - 2 X Y cos O
7 6 3adant3 A B C A C B C O π 2 π 2 Z 2 = X 2 + Y 2 - 2 X Y cos O
8 elpri O π 2 π 2 O = π 2 O = π 2
9 fveq2 O = π 2 cos O = cos π 2
10 coshalfpi cos π 2 = 0
11 9 10 eqtrdi O = π 2 cos O = 0
12 fveq2 O = π 2 cos O = cos π 2
13 cosneghalfpi cos π 2 = 0
14 12 13 eqtrdi O = π 2 cos O = 0
15 11 14 jaoi O = π 2 O = π 2 cos O = 0
16 8 15 syl O π 2 π 2 cos O = 0
17 16 3ad2ant3 A B C A C B C O π 2 π 2 cos O = 0
18 17 oveq2d A B C A C B C O π 2 π 2 X Y cos O = X Y 0
19 subcl B C B C
20 19 3adant1 A B C B C
21 20 3ad2ant1 A B C A C B C O π 2 π 2 B C
22 21 abscld A B C A C B C O π 2 π 2 B C
23 22 recnd A B C A C B C O π 2 π 2 B C
24 2 23 eqeltrid A B C A C B C O π 2 π 2 X
25 subcl A C A C
26 25 3adant2 A B C A C
27 26 3ad2ant1 A B C A C B C O π 2 π 2 A C
28 27 abscld A B C A C B C O π 2 π 2 A C
29 28 recnd A B C A C B C O π 2 π 2 A C
30 3 29 eqeltrid A B C A C B C O π 2 π 2 Y
31 24 30 mulcld A B C A C B C O π 2 π 2 X Y
32 31 mul01d A B C A C B C O π 2 π 2 X Y 0 = 0
33 18 32 eqtrd A B C A C B C O π 2 π 2 X Y cos O = 0
34 33 oveq2d A B C A C B C O π 2 π 2 2 X Y cos O = 2 0
35 2t0e0 2 0 = 0
36 34 35 eqtrdi A B C A C B C O π 2 π 2 2 X Y cos O = 0
37 36 oveq2d A B C A C B C O π 2 π 2 X 2 + Y 2 - 2 X Y cos O = X 2 + Y 2 - 0
38 24 sqcld A B C A C B C O π 2 π 2 X 2
39 30 sqcld A B C A C B C O π 2 π 2 Y 2
40 38 39 addcld A B C A C B C O π 2 π 2 X 2 + Y 2
41 40 subid1d A B C A C B C O π 2 π 2 X 2 + Y 2 - 0 = X 2 + Y 2
42 7 37 41 3eqtrd A B C A C B C O π 2 π 2 Z 2 = X 2 + Y 2