Metamath Proof Explorer


Theorem numaddc

Description: Add two decimal integers M and N (with carry). (Contributed by Mario Carneiro, 18-Feb-2014)

Ref Expression
Hypotheses numma.1 T0
numma.2 A0
numma.3 B0
numma.4 C0
numma.5 D0
numma.6 M=TA+B
numma.7 N=TC+D
numaddc.8 F0
numaddc.9 A+C+1=E
numaddc.10 B+D=T1+F
Assertion numaddc M+N=TE+F

Proof

Step Hyp Ref Expression
1 numma.1 T0
2 numma.2 A0
3 numma.3 B0
4 numma.4 C0
5 numma.5 D0
6 numma.6 M=TA+B
7 numma.7 N=TC+D
8 numaddc.8 F0
9 numaddc.9 A+C+1=E
10 numaddc.10 B+D=T1+F
11 1 2 3 numcl TA+B0
12 6 11 eqeltri M0
13 12 nn0cni M
14 13 mulridi M1=M
15 14 oveq1i M1+N=M+N
16 1nn0 10
17 2 nn0cni A
18 17 mulridi A1=A
19 18 oveq1i A1+C+1=A+C+1
20 4 nn0cni C
21 ax-1cn 1
22 17 20 21 addassi A+C+1=A+C+1
23 19 22 9 3eqtr2i A1+C+1=E
24 3 nn0cni B
25 24 mulridi B1=B
26 25 oveq1i B1+D=B+D
27 26 10 eqtri B1+D=T1+F
28 1 2 3 4 5 6 7 16 8 16 23 27 nummac M1+N=TE+F
29 15 28 eqtr3i M+N=TE+F