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=x0,y0logyx
lawcos.2 X=BC
lawcos.3 Y=AC
lawcos.4 Z=AB
lawcos.5 O=BCFAC
Assertion pythag ABCACBCOπ2π2Z2=X2+Y2

Proof

Step Hyp Ref Expression
1 lawcos.1 F=x0,y0logyx
2 lawcos.2 X=BC
3 lawcos.3 Y=AC
4 lawcos.4 Z=AB
5 lawcos.5 O=BCFAC
6 1 2 3 4 5 lawcos ABCACBCZ2=X2+Y2-2XYcosO
7 6 3adant3 ABCACBCOπ2π2Z2=X2+Y2-2XYcosO
8 elpri Oπ2π2O=π2O=π2
9 fveq2 O=π2cosO=cosπ2
10 coshalfpi cosπ2=0
11 9 10 eqtrdi O=π2cosO=0
12 fveq2 O=π2cosO=cosπ2
13 cosneghalfpi cosπ2=0
14 12 13 eqtrdi O=π2cosO=0
15 11 14 jaoi O=π2O=π2cosO=0
16 8 15 syl Oπ2π2cosO=0
17 16 3ad2ant3 ABCACBCOπ2π2cosO=0
18 17 oveq2d ABCACBCOπ2π2XYcosO=XY0
19 subcl BCBC
20 19 3adant1 ABCBC
21 20 3ad2ant1 ABCACBCOπ2π2BC
22 21 abscld ABCACBCOπ2π2BC
23 22 recnd ABCACBCOπ2π2BC
24 2 23 eqeltrid ABCACBCOπ2π2X
25 subcl ACAC
26 25 3adant2 ABCAC
27 26 3ad2ant1 ABCACBCOπ2π2AC
28 27 abscld ABCACBCOπ2π2AC
29 28 recnd ABCACBCOπ2π2AC
30 3 29 eqeltrid ABCACBCOπ2π2Y
31 24 30 mulcld ABCACBCOπ2π2XY
32 31 mul01d ABCACBCOπ2π2XY0=0
33 18 32 eqtrd ABCACBCOπ2π2XYcosO=0
34 33 oveq2d ABCACBCOπ2π22XYcosO=20
35 2t0e0 20=0
36 34 35 eqtrdi ABCACBCOπ2π22XYcosO=0
37 36 oveq2d ABCACBCOπ2π2X2+Y2-2XYcosO=X2+Y2-0
38 24 sqcld ABCACBCOπ2π2X2
39 30 sqcld ABCACBCOπ2π2Y2
40 38 39 addcld ABCACBCOπ2π2X2+Y2
41 40 subid1d ABCACBCOπ2π2X2+Y2-0=X2+Y2
42 7 37 41 3eqtrd ABCACBCOπ2π2Z2=X2+Y2