Description: Law of cosines (also known as the Al-Kashi theorem or the generalized Pythagorean theorem, or the cosine formula or cosine rule). Given three distinct points A, B, and 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, and O is the signed angle m/__ BCA on the complex plane. We translate triangle ABC to move C to the origin (C-C), B to U=(B-C), and A to V=(A-C), then use lemma lawcoslem1 to prove this algebraically simpler case. The Metamath convention is to use a signed angle; in this case the sign doesn't matter because we use the cosine of the angle (see cosneg ). The Pythagorean theorem pythag is a special case of the law of cosines. The theorem's expression and approach were suggested by Mario Carneiro. This is Metamath 100 proof #94. (Contributed by David A. Wheeler, 12-Jun-2015)
Ref | Expression | ||
---|---|---|---|
Hypotheses | lawcos.1 | |
|
lawcos.2 | |
||
lawcos.3 | |
||
lawcos.4 | |
||
lawcos.5 | |
||
Assertion | lawcos | |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | lawcos.1 | |
|
2 | lawcos.2 | |
|
3 | lawcos.3 | |
|
4 | lawcos.4 | |
|
5 | lawcos.5 | |
|
6 | subcl | |
|
7 | 6 | 3adant2 | |
8 | 7 | adantr | |
9 | subcl | |
|
10 | 9 | 3adant1 | |
11 | 10 | adantr | |
12 | subeq0 | |
|
13 | 12 | necon3bid | |
14 | 13 | bicomd | |
15 | 14 | 3adant2 | |
16 | 15 | biimpa | |
17 | 16 | adantrr | |
18 | subeq0 | |
|
19 | 18 | necon3bid | |
20 | 19 | bicomd | |
21 | 20 | 3adant1 | |
22 | 21 | biimpa | |
23 | 22 | adantrl | |
24 | 8 11 17 23 | lawcoslem1 | |
25 | nnncan2 | |
|
26 | 25 | fveq2d | |
27 | 4 26 | eqtr4id | |
28 | 27 | oveq1d | |
29 | 28 | adantr | |
30 | 2 | oveq1i | |
31 | 3 | oveq1i | |
32 | 30 31 | oveq12i | |
33 | 8 | abscld | |
34 | 33 | recnd | |
35 | 34 | sqcld | |
36 | 11 | abscld | |
37 | 36 | recnd | |
38 | 37 | sqcld | |
39 | 35 38 | addcomd | |
40 | 32 39 | eqtr4id | |
41 | 2 3 | oveq12i | |
42 | 34 37 | mulcomd | |
43 | 41 42 | eqtr4id | |
44 | 5 | fveq2i | |
45 | 1 11 23 8 17 | angvald | |
46 | 45 | fveq2d | |
47 | 44 46 | eqtrid | |
48 | 8 11 23 | divcld | |
49 | 8 11 17 23 | divne0d | |
50 | 48 49 | logcld | |
51 | 50 | imcld | |
52 | recosval | |
|
53 | 51 52 | syl | |
54 | 47 53 | eqtrd | |
55 | efiarg | |
|
56 | 48 49 55 | syl2anc | |
57 | 56 | fveq2d | |
58 | 48 | abscld | |
59 | 48 49 | absne0d | |
60 | 58 48 59 | redivd | |
61 | 54 57 60 | 3eqtrd | |
62 | 43 61 | oveq12d | |
63 | 62 | oveq2d | |
64 | 40 63 | oveq12d | |
65 | 24 29 64 | 3eqtr4d | |