Metamath Proof Explorer


Theorem sqabssub

Description: Square of absolute value of difference. (Contributed by NM, 21-Jan-2007)

Ref Expression
Assertion sqabssub ABAB2=A2+B2-2AB

Proof

Step Hyp Ref Expression
1 cjsub ABAB=AB
2 1 oveq2d ABABAB=ABAB
3 cjcl AA
4 cjcl BB
5 3 4 anim12i ABAB
6 mulsub ABABABAB=AA+BB-AB+AB
7 5 6 mpdan ABABAB=AA+BB-AB+AB
8 2 7 eqtrd ABABAB=AA+BB-AB+AB
9 subcl ABAB
10 absvalsq ABAB2=ABAB
11 9 10 syl ABAB2=ABAB
12 absvalsq AA2=AA
13 absvalsq BB2=BB
14 mulcom BBBB=BB
15 4 14 mpdan BBB=BB
16 13 15 eqtrd BB2=BB
17 12 16 oveqan12d ABA2+B2=AA+BB
18 mulcl ABAB
19 4 18 sylan2 ABAB
20 19 addcjd ABAB+AB=2AB
21 cjmul ABAB=AB
22 4 21 sylan2 ABAB=AB
23 cjcj BB=B
24 23 adantl ABB=B
25 24 oveq2d ABAB=AB
26 22 25 eqtrd ABAB=AB
27 26 oveq2d ABAB+AB=AB+AB
28 20 27 eqtr3d AB2AB=AB+AB
29 17 28 oveq12d ABA2+B2-2AB=AA+BB-AB+AB
30 8 11 29 3eqtr4d ABAB2=A2+B2-2AB