Metamath Proof Explorer


Theorem numma

Description: Perform a multiply-add of two decimal integers M and N against a fixed multiplicand P (no carry). (Contributed by Mario Carneiro, 18-Feb-2014)

Ref Expression
Hypotheses numma.1 T 0
numma.2 A 0
numma.3 B 0
numma.4 C 0
numma.5 D 0
numma.6 M = T A + B
numma.7 N = T C + D
numma.8 P 0
numma.9 A P + C = E
numma.10 B P + D = F
Assertion numma M P + N = T E + F

Proof

Step Hyp Ref Expression
1 numma.1 T 0
2 numma.2 A 0
3 numma.3 B 0
4 numma.4 C 0
5 numma.5 D 0
6 numma.6 M = T A + B
7 numma.7 N = T C + D
8 numma.8 P 0
9 numma.9 A P + C = E
10 numma.10 B P + D = F
11 6 oveq1i M P = T A + B P
12 11 7 oveq12i M P + N = T A + B P + T C + D
13 1 nn0cni T
14 2 nn0cni A
15 8 nn0cni P
16 14 15 mulcli A P
17 4 nn0cni C
18 13 16 17 adddii T A P + C = T A P + T C
19 13 14 15 mulassi T A P = T A P
20 19 oveq1i T A P + T C = T A P + T C
21 18 20 eqtr4i T A P + C = T A P + T C
22 21 oveq1i T A P + C + B P + D = T A P + T C + B P + D
23 13 14 mulcli T A
24 3 nn0cni B
25 23 24 15 adddiri T A + B P = T A P + B P
26 25 oveq1i T A + B P + T C + D = T A P + B P + T C + D
27 23 15 mulcli T A P
28 13 17 mulcli T C
29 24 15 mulcli B P
30 5 nn0cni D
31 27 28 29 30 add4i T A P + T C + B P + D = T A P + B P + T C + D
32 26 31 eqtr4i T A + B P + T C + D = T A P + T C + B P + D
33 22 32 eqtr4i T A P + C + B P + D = T A + B P + T C + D
34 9 oveq2i T A P + C = T E
35 34 10 oveq12i T A P + C + B P + D = T E + F
36 12 33 35 3eqtr2i M P + N = T E + F