Metamath Proof Explorer


Theorem subaddmulsub

Description: The difference with a product of a sum and a difference. (Contributed by AV, 5-Mar-2023)

Ref Expression
Assertion subaddmulsub A B C D E E A + B C D = E - A C - B C + A D + B D

Proof

Step Hyp Ref Expression
1 addmulsub A B C D A + B C D = A C + B C - A D + B D
2 1 3adant3 A B C D E A + B C D = A C + B C - A D + B D
3 2 oveq2d A B C D E E A + B C D = E A C + B C - A D + B D
4 simp3 A B C D E E
5 simp1l A B C D E A
6 simp2l A B C D E C
7 5 6 mulcld A B C D E A C
8 simp1r A B C D E B
9 8 6 mulcld A B C D E B C
10 7 9 addcld A B C D E A C + B C
11 simp2r A B C D E D
12 5 11 mulcld A B C D E A D
13 8 11 mulcld A B C D E B D
14 12 13 addcld A B C D E A D + B D
15 4 10 14 subsubd A B C D E E A C + B C - A D + B D = E A C + B C + A D + B D
16 4 7 9 subsub4d A B C D E E - A C - B C = E A C + B C
17 16 eqcomd A B C D E E A C + B C = E - A C - B C
18 17 oveq1d A B C D E E A C + B C + A D + B D = E - A C - B C + A D + B D
19 3 15 18 3eqtrd A B C D E E A + B C D = E - A C - B C + A D + B D