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
|- T e. NN0
numma.2
|- A e. NN0
numma.3
|- B e. NN0
numma.4
|- C e. NN0
numma.5
|- D e. NN0
numma.6
|- M = ( ( T x. A ) + B )
numma.7
|- N = ( ( T x. C ) + D )
numaddc.8
|- F e. NN0
numaddc.9
|- ( ( A + C ) + 1 ) = E
numaddc.10
|- ( B + D ) = ( ( T x. 1 ) + F )
Assertion numaddc
|- ( M + N ) = ( ( T x. E ) + F )

Proof

Step Hyp Ref Expression
1 numma.1
 |-  T e. NN0
2 numma.2
 |-  A e. NN0
3 numma.3
 |-  B e. NN0
4 numma.4
 |-  C e. NN0
5 numma.5
 |-  D e. NN0
6 numma.6
 |-  M = ( ( T x. A ) + B )
7 numma.7
 |-  N = ( ( T x. C ) + D )
8 numaddc.8
 |-  F e. NN0
9 numaddc.9
 |-  ( ( A + C ) + 1 ) = E
10 numaddc.10
 |-  ( B + D ) = ( ( T x. 1 ) + F )
11 1 2 3 numcl
 |-  ( ( T x. A ) + B ) e. NN0
12 6 11 eqeltri
 |-  M e. NN0
13 12 nn0cni
 |-  M e. CC
14 13 mulid1i
 |-  ( M x. 1 ) = M
15 14 oveq1i
 |-  ( ( M x. 1 ) + N ) = ( M + N )
16 1nn0
 |-  1 e. NN0
17 2 nn0cni
 |-  A e. CC
18 17 mulid1i
 |-  ( A x. 1 ) = A
19 18 oveq1i
 |-  ( ( A x. 1 ) + ( C + 1 ) ) = ( A + ( C + 1 ) )
20 4 nn0cni
 |-  C e. CC
21 ax-1cn
 |-  1 e. CC
22 17 20 21 addassi
 |-  ( ( A + C ) + 1 ) = ( A + ( C + 1 ) )
23 19 22 9 3eqtr2i
 |-  ( ( A x. 1 ) + ( C + 1 ) ) = E
24 3 nn0cni
 |-  B e. CC
25 24 mulid1i
 |-  ( B x. 1 ) = B
26 25 oveq1i
 |-  ( ( B x. 1 ) + D ) = ( B + D )
27 26 10 eqtri
 |-  ( ( B x. 1 ) + D ) = ( ( T x. 1 ) + F )
28 1 2 3 4 5 6 7 16 8 16 23 27 nummac
 |-  ( ( M x. 1 ) + N ) = ( ( T x. E ) + F )
29 15 28 eqtr3i
 |-  ( M + N ) = ( ( T x. E ) + F )