Metamath Proof Explorer


Theorem bj-bary1lem

Description: Lemma for bj-bary1 : expression for a barycenter of two points in one dimension (complex line). (Contributed by BJ, 6-Jun-2019)

Ref Expression
Hypotheses bj-bary1.a φ A
bj-bary1.b φ B
bj-bary1.x φ X
bj-bary1.neq φ A B
Assertion bj-bary1lem φ X = B X B A A + X A B A B

Proof

Step Hyp Ref Expression
1 bj-bary1.a φ A
2 bj-bary1.b φ B
3 bj-bary1.x φ X
4 bj-bary1.neq φ A B
5 2 1 mulcld φ B A
6 3 1 mulcld φ X A
7 5 6 subcld φ B A X A
8 3 2 mulcld φ X B
9 1 2 mulcld φ A B
10 7 8 9 addsub12d φ B A X A + X B - A B = X B + B A X A - A B
11 5 6 9 sub32d φ B A - X A - A B = B A - A B - X A
12 2 1 bj-subcom φ B A A B = 0
13 12 oveq1d φ B A - A B - X A = 0 X A
14 11 13 eqtrd φ B A - X A - A B = 0 X A
15 14 oveq2d φ X B + B A X A - A B = X B + 0 - X A
16 10 15 eqtrd φ B A X A + X B - A B = X B + 0 - X A
17 0cnd φ 0
18 8 17 6 addsubassd φ X B + 0 - X A = X B + 0 - X A
19 8 addid1d φ X B + 0 = X B
20 19 oveq1d φ X B + 0 - X A = X B X A
21 16 18 20 3eqtr2d φ B A X A + X B - A B = X B X A
22 2 3 1 subdird φ B X A = B A X A
23 3 1 2 subdird φ X A B = X B A B
24 22 23 oveq12d φ B X A + X A B = B A X A + X B - A B
25 3 2 1 subdid φ X B A = X B X A
26 21 24 25 3eqtr4rd φ X B A = B X A + X A B
27 26 oveq1d φ X B A B A = B X A + X A B B A
28 2 3 subcld φ B X
29 28 1 mulcld φ B X A
30 3 1 subcld φ X A
31 30 2 mulcld φ X A B
32 2 1 subcld φ B A
33 4 necomd φ B A
34 2 1 33 subne0d φ B A 0
35 29 31 32 34 divdird φ B X A + X A B B A = B X A B A + X A B B A
36 27 35 eqtrd φ X B A B A = B X A B A + X A B B A
37 3 32 34 divcan4d φ X B A B A = X
38 28 1 32 34 div23d φ B X A B A = B X B A A
39 30 2 32 34 div23d φ X A B B A = X A B A B
40 38 39 oveq12d φ B X A B A + X A B B A = B X B A A + X A B A B
41 36 37 40 3eqtr3d φ X = B X B A A + X A B A B