Metamath Proof Explorer


Theorem ptolemy

Description: Ptolemy's Theorem. This theorem is named after the Greek astronomer and mathematician Ptolemy (Claudius Ptolemaeus). This particular version is expressed using the sine function. It is proved by expanding all the multiplication of sines to a product of cosines of differences using sinmul , then using algebraic simplification to show that both sides are equal. This formalization is based on the proof in "Trigonometry" by Gelfand and Saul. This is Metamath 100 proof #95. (Contributed by David A. Wheeler, 31-May-2015)

Ref Expression
Assertion ptolemy ABCDA+B+C+D=πsinAsinB+sinCsinD=sinB+CsinA+C

Proof

Step Hyp Ref Expression
1 addcl CDC+D
2 1 3ad2ant2 ABCDA+B+C+D=πC+D
3 2 coscld ABCDA+B+C+D=πcosC+D
4 3 negnegd ABCDA+B+C+D=πcosC+D=cosC+D
5 addlid C+D0+C+D=C+D
6 5 oveq1d C+D0+C+D-A+B+C+D=C+D-A+B+C+D
7 2 6 syl ABCDA+B+C+D=π0+C+D-A+B+C+D=C+D-A+B+C+D
8 0cnd ABCDA+B+C+D=π0
9 addcl ABA+B
10 9 adantr ABCDA+B
11 10 3adant3 ABCDA+B+C+D=πA+B
12 8 11 2 pnpcan2d ABCDA+B+C+D=π0+C+D-A+B+C+D=0A+B
13 simp3 ABCDA+B+C+D=πA+B+C+D=π
14 13 oveq2d ABCDA+B+C+D=πC+D-A+B+C+D=C+D-π
15 7 12 14 3eqtr3rd ABCDA+B+C+D=πC+D-π=0A+B
16 df-neg A+B=0A+B
17 15 16 eqtr4di ABCDA+B+C+D=πC+D-π=A+B
18 17 fveq2d ABCDA+B+C+D=πcosC+D-π=cosA+B
19 cosmpi C+DcosC+D-π=cosC+D
20 2 19 syl ABCDA+B+C+D=πcosC+D-π=cosC+D
21 cosneg A+BcosA+B=cosA+B
22 11 21 syl ABCDA+B+C+D=πcosA+B=cosA+B
23 18 20 22 3eqtr3d ABCDA+B+C+D=πcosC+D=cosA+B
24 23 negeqd ABCDA+B+C+D=πcosC+D=cosA+B
25 4 24 eqtr3d ABCDA+B+C+D=πcosC+D=cosA+B
26 25 oveq2d ABCDA+B+C+D=πcosCDcosC+D=cosCDcosA+B
27 subcl CDCD
28 27 adantl ABCDCD
29 28 coscld ABCDcosCD
30 29 3adant3 ABCDA+B+C+D=πcosCD
31 11 coscld ABCDA+B+C+D=πcosA+B
32 30 31 subnegd ABCDA+B+C+D=πcosCDcosA+B=cosCD+cosA+B
33 26 32 eqtrd ABCDA+B+C+D=πcosCDcosC+D=cosCD+cosA+B
34 33 oveq1d ABCDA+B+C+D=πcosCDcosC+D2=cosCD+cosA+B2
35 34 oveq2d ABCDA+B+C+D=πcosABcosA+B2+cosCDcosC+D2=cosABcosA+B2+cosCD+cosA+B2
36 subcl ABAB
37 36 3ad2ant1 ABCDA+B+C+D=πAB
38 37 coscld ABCDA+B+C+D=πcosAB
39 38 31 subcld ABCDA+B+C+D=πcosABcosA+B
40 30 31 addcld ABCDA+B+C+D=πcosCD+cosA+B
41 2cnne0 220
42 41 a1i ABCDA+B+C+D=π220
43 divdir cosABcosA+BcosCD+cosA+B220cosABcosA+B+cosCD+cosA+B2=cosABcosA+B2+cosCD+cosA+B2
44 39 40 42 43 syl3anc ABCDA+B+C+D=πcosABcosA+B+cosCD+cosA+B2=cosABcosA+B2+cosCD+cosA+B2
45 38 31 30 nppcan3d ABCDA+B+C+D=πcosABcosA+B+cosCD+cosA+B=cosAB+cosCD
46 45 oveq1d ABCDA+B+C+D=πcosABcosA+B+cosCD+cosA+B2=cosAB+cosCD2
47 44 46 eqtr3d ABCDA+B+C+D=πcosABcosA+B2+cosCD+cosA+B2=cosAB+cosCD2
48 35 47 eqtrd ABCDA+B+C+D=πcosABcosA+B2+cosCDcosC+D2=cosAB+cosCD2
49 sinmul ABsinAsinB=cosABcosA+B2
50 49 3ad2ant1 ABCDA+B+C+D=πsinAsinB=cosABcosA+B2
51 sinmul CDsinCsinD=cosCDcosC+D2
52 51 3ad2ant2 ABCDA+B+C+D=πsinCsinD=cosCDcosC+D2
53 50 52 oveq12d ABCDA+B+C+D=πsinAsinB+sinCsinD=cosABcosA+B2+cosCDcosC+D2
54 simplr ABCDB
55 simpll ABCDA
56 simprl ABCDC
57 54 55 56 pnpcan2d ABCDB+C-A+C=BA
58 57 fveq2d ABCDcosB+C-A+C=cosBA
59 58 3adant3 ABCDA+B+C+D=πcosB+C-A+C=cosBA
60 1 adantl ABCDC+D
61 10 60 28 3jca ABCDA+BC+DCD
62 61 3adant3 ABCDA+B+C+D=πA+BC+DCD
63 addass A+BC+DCDA+B+C+D+CD=A+B+C+D+CD
64 62 63 syl ABCDA+B+C+D=πA+B+C+D+CD=A+B+C+D+CD
65 oveq1 A+B+C+D=πA+B+C+D+CD=π+C-D
66 65 3ad2ant3 ABCDA+B+C+D=πA+B+C+D+CD=π+C-D
67 simpl CDC
68 simpr CDD
69 67 68 67 3jca CDCDC
70 69 3ad2ant2 ABCDA+B+C+D=πCDC
71 ppncan CDCC+D+CD=C+C
72 71 oveq2d CDCA+B+C+D+CD=A+B+C+C
73 70 72 syl ABCDA+B+C+D=πA+B+C+D+CD=A+B+C+C
74 simp1 ABCDA+B+C+D=πAB
75 67 67 jca CDCC
76 75 3ad2ant2 ABCDA+B+C+D=πCC
77 add4 ABCCA+B+C+C=A+C+B+C
78 74 76 77 syl2anc ABCDA+B+C+D=πA+B+C+C=A+C+B+C
79 addcl ACA+C
80 79 ad2ant2r ABCDA+C
81 addcl BCB+C
82 81 ad2ant2lr ABCDB+C
83 80 82 jca ABCDA+CB+C
84 83 3adant3 ABCDA+B+C+D=πA+CB+C
85 addcom A+CB+CA+C+B+C=B+C+A+C
86 84 85 syl ABCDA+B+C+D=πA+C+B+C=B+C+A+C
87 73 78 86 3eqtrd ABCDA+B+C+D=πA+B+C+D+CD=B+C+A+C
88 64 66 87 3eqtr3rd ABCDA+B+C+D=πB+C+A+C=π+C-D
89 picn π
90 addcom πCDπ+C-D=C-D+π
91 89 28 90 sylancr ABCDπ+C-D=C-D+π
92 91 3adant3 ABCDA+B+C+D=ππ+C-D=C-D+π
93 88 92 eqtrd ABCDA+B+C+D=πB+C+A+C=C-D+π
94 93 fveq2d ABCDA+B+C+D=πcosB+C+A+C=cosC-D+π
95 cosppi CDcosC-D+π=cosCD
96 28 95 syl ABCDcosC-D+π=cosCD
97 96 3adant3 ABCDA+B+C+D=πcosC-D+π=cosCD
98 94 97 eqtrd ABCDA+B+C+D=πcosB+C+A+C=cosCD
99 59 98 oveq12d ABCDA+B+C+D=πcosB+C-A+CcosB+C+A+C=cosBAcosCD
100 subcl BABA
101 100 ancoms ABBA
102 101 adantr ABCDBA
103 102 coscld ABCDcosBA
104 103 29 subnegd ABCDcosBAcosCD=cosBA+cosCD
105 104 3adant3 ABCDA+B+C+D=πcosBAcosCD=cosBA+cosCD
106 99 105 eqtrd ABCDA+B+C+D=πcosB+C-A+CcosB+C+A+C=cosBA+cosCD
107 106 oveq1d ABCDA+B+C+D=πcosB+C-A+CcosB+C+A+C2=cosBA+cosCD2
108 sinmul B+CA+CsinB+CsinA+C=cosB+C-A+CcosB+C+A+C2
109 82 80 108 syl2anc ABCDsinB+CsinA+C=cosB+C-A+CcosB+C+A+C2
110 109 3adant3 ABCDA+B+C+D=πsinB+CsinA+C=cosB+C-A+CcosB+C+A+C2
111 cosneg ABcosAB=cosAB
112 36 111 syl ABcosAB=cosAB
113 negsubdi2 ABAB=BA
114 113 fveq2d ABcosAB=cosBA
115 112 114 eqtr3d ABcosAB=cosBA
116 115 3ad2ant1 ABCDA+B+C+D=πcosAB=cosBA
117 116 oveq1d ABCDA+B+C+D=πcosAB+cosCD=cosBA+cosCD
118 117 oveq1d ABCDA+B+C+D=πcosAB+cosCD2=cosBA+cosCD2
119 107 110 118 3eqtr4d ABCDA+B+C+D=πsinB+CsinA+C=cosAB+cosCD2
120 48 53 119 3eqtr4d ABCDA+B+C+D=πsinAsinB+sinCsinD=sinB+CsinA+C