Metamath Proof Explorer


Theorem binom3

Description: The cube of a binomial. (Contributed by Mario Carneiro, 24-Apr-2015)

Ref Expression
Assertion binom3 A B A + B 3 = A 3 + 3 A 2 B + 3 A B 2 + B 3

Proof

Step Hyp Ref Expression
1 df-3 3 = 2 + 1
2 1 oveq2i A + B 3 = A + B 2 + 1
3 addcl A B A + B
4 2nn0 2 0
5 expp1 A + B 2 0 A + B 2 + 1 = A + B 2 A + B
6 3 4 5 sylancl A B A + B 2 + 1 = A + B 2 A + B
7 2 6 eqtrid A B A + B 3 = A + B 2 A + B
8 sqcl A + B A + B 2
9 3 8 syl A B A + B 2
10 simpl A B A
11 simpr A B B
12 9 10 11 adddid A B A + B 2 A + B = A + B 2 A + A + B 2 B
13 binom2 A B A + B 2 = A 2 + 2 A B + B 2
14 13 oveq1d A B A + B 2 A = A 2 + 2 A B + B 2 A
15 sqcl A A 2
16 10 15 syl A B A 2
17 2cn 2
18 mulcl A B A B
19 mulcl 2 A B 2 A B
20 17 18 19 sylancr A B 2 A B
21 16 20 addcld A B A 2 + 2 A B
22 sqcl B B 2
23 11 22 syl A B B 2
24 21 23 10 adddird A B A 2 + 2 A B + B 2 A = A 2 + 2 A B A + B 2 A
25 16 20 10 adddird A B A 2 + 2 A B A = A 2 A + 2 A B A
26 1 oveq2i A 3 = A 2 + 1
27 expp1 A 2 0 A 2 + 1 = A 2 A
28 10 4 27 sylancl A B A 2 + 1 = A 2 A
29 26 28 eqtrid A B A 3 = A 2 A
30 sqval A A 2 = A A
31 10 30 syl A B A 2 = A A
32 31 oveq1d A B A 2 B = A A B
33 10 10 11 mul32d A B A A B = A B A
34 32 33 eqtrd A B A 2 B = A B A
35 34 oveq2d A B 2 A 2 B = 2 A B A
36 2cnd A B 2
37 36 18 10 mulassd A B 2 A B A = 2 A B A
38 35 37 eqtr4d A B 2 A 2 B = 2 A B A
39 29 38 oveq12d A B A 3 + 2 A 2 B = A 2 A + 2 A B A
40 25 39 eqtr4d A B A 2 + 2 A B A = A 3 + 2 A 2 B
41 23 10 mulcomd A B B 2 A = A B 2
42 40 41 oveq12d A B A 2 + 2 A B A + B 2 A = A 3 + 2 A 2 B + A B 2
43 14 24 42 3eqtrd A B A + B 2 A = A 3 + 2 A 2 B + A B 2
44 13 oveq1d A B A + B 2 B = A 2 + 2 A B + B 2 B
45 21 23 11 adddird A B A 2 + 2 A B + B 2 B = A 2 + 2 A B B + B 2 B
46 sqval B B 2 = B B
47 11 46 syl A B B 2 = B B
48 47 oveq2d A B A B 2 = A B B
49 10 11 11 mulassd A B A B B = A B B
50 48 49 eqtr4d A B A B 2 = A B B
51 50 oveq2d A B 2 A B 2 = 2 A B B
52 36 18 11 mulassd A B 2 A B B = 2 A B B
53 51 52 eqtr4d A B 2 A B 2 = 2 A B B
54 53 oveq2d A B A 2 B + 2 A B 2 = A 2 B + 2 A B B
55 16 20 11 adddird A B A 2 + 2 A B B = A 2 B + 2 A B B
56 54 55 eqtr4d A B A 2 B + 2 A B 2 = A 2 + 2 A B B
57 1 oveq2i B 3 = B 2 + 1
58 expp1 B 2 0 B 2 + 1 = B 2 B
59 11 4 58 sylancl A B B 2 + 1 = B 2 B
60 57 59 eqtrid A B B 3 = B 2 B
61 56 60 oveq12d A B A 2 B + 2 A B 2 + B 3 = A 2 + 2 A B B + B 2 B
62 16 11 mulcld A B A 2 B
63 10 23 mulcld A B A B 2
64 mulcl 2 A B 2 2 A B 2
65 17 63 64 sylancr A B 2 A B 2
66 3nn0 3 0
67 expcl B 3 0 B 3
68 11 66 67 sylancl A B B 3
69 62 65 68 addassd A B A 2 B + 2 A B 2 + B 3 = A 2 B + 2 A B 2 + B 3
70 61 69 eqtr3d A B A 2 + 2 A B B + B 2 B = A 2 B + 2 A B 2 + B 3
71 44 45 70 3eqtrd A B A + B 2 B = A 2 B + 2 A B 2 + B 3
72 43 71 oveq12d A B A + B 2 A + A + B 2 B = A 3 + 2 A 2 B + A B 2 + A 2 B + 2 A B 2 + B 3
73 expcl A 3 0 A 3
74 10 66 73 sylancl A B A 3
75 mulcl 2 A 2 B 2 A 2 B
76 17 62 75 sylancr A B 2 A 2 B
77 74 76 addcld A B A 3 + 2 A 2 B
78 65 68 addcld A B 2 A B 2 + B 3
79 77 63 62 78 add4d A B A 3 + 2 A 2 B + A B 2 + A 2 B + 2 A B 2 + B 3 = A 3 + 2 A 2 B + A 2 B + A B 2 + 2 A B 2 + B 3
80 12 72 79 3eqtrd A B A + B 2 A + B = A 3 + 2 A 2 B + A 2 B + A B 2 + 2 A B 2 + B 3
81 74 76 62 addassd A B A 3 + 2 A 2 B + A 2 B = A 3 + 2 A 2 B + A 2 B
82 1 oveq1i 3 A 2 B = 2 + 1 A 2 B
83 1cnd A B 1
84 36 83 62 adddird A B 2 + 1 A 2 B = 2 A 2 B + 1 A 2 B
85 82 84 eqtrid A B 3 A 2 B = 2 A 2 B + 1 A 2 B
86 62 mulid2d A B 1 A 2 B = A 2 B
87 86 oveq2d A B 2 A 2 B + 1 A 2 B = 2 A 2 B + A 2 B
88 85 87 eqtrd A B 3 A 2 B = 2 A 2 B + A 2 B
89 88 oveq2d A B A 3 + 3 A 2 B = A 3 + 2 A 2 B + A 2 B
90 81 89 eqtr4d A B A 3 + 2 A 2 B + A 2 B = A 3 + 3 A 2 B
91 1p2e3 1 + 2 = 3
92 91 oveq1i 1 + 2 A B 2 = 3 A B 2
93 83 36 63 adddird A B 1 + 2 A B 2 = 1 A B 2 + 2 A B 2
94 92 93 eqtr3id A B 3 A B 2 = 1 A B 2 + 2 A B 2
95 63 mulid2d A B 1 A B 2 = A B 2
96 95 oveq1d A B 1 A B 2 + 2 A B 2 = A B 2 + 2 A B 2
97 94 96 eqtrd A B 3 A B 2 = A B 2 + 2 A B 2
98 97 oveq1d A B 3 A B 2 + B 3 = A B 2 + 2 A B 2 + B 3
99 63 65 68 addassd A B A B 2 + 2 A B 2 + B 3 = A B 2 + 2 A B 2 + B 3
100 98 99 eqtr2d A B A B 2 + 2 A B 2 + B 3 = 3 A B 2 + B 3
101 90 100 oveq12d A B A 3 + 2 A 2 B + A 2 B + A B 2 + 2 A B 2 + B 3 = A 3 + 3 A 2 B + 3 A B 2 + B 3
102 7 80 101 3eqtrd A B A + B 3 = A 3 + 3 A 2 B + 3 A B 2 + B 3