Metamath Proof Explorer


Theorem nnaass

Description: Addition of natural numbers is associative. Theorem 4K(1) of Enderton p. 81. (Contributed by NM, 20-Sep-1995) (Revised by Mario Carneiro, 15-Nov-2014)

Ref Expression
Assertion nnaass AωBωCωA+𝑜B+𝑜C=A+𝑜B+𝑜C

Proof

Step Hyp Ref Expression
1 oveq2 x=CA+𝑜B+𝑜x=A+𝑜B+𝑜C
2 oveq2 x=CB+𝑜x=B+𝑜C
3 2 oveq2d x=CA+𝑜B+𝑜x=A+𝑜B+𝑜C
4 1 3 eqeq12d x=CA+𝑜B+𝑜x=A+𝑜B+𝑜xA+𝑜B+𝑜C=A+𝑜B+𝑜C
5 4 imbi2d x=CAωBωA+𝑜B+𝑜x=A+𝑜B+𝑜xAωBωA+𝑜B+𝑜C=A+𝑜B+𝑜C
6 oveq2 x=A+𝑜B+𝑜x=A+𝑜B+𝑜
7 oveq2 x=B+𝑜x=B+𝑜
8 7 oveq2d x=A+𝑜B+𝑜x=A+𝑜B+𝑜
9 6 8 eqeq12d x=A+𝑜B+𝑜x=A+𝑜B+𝑜xA+𝑜B+𝑜=A+𝑜B+𝑜
10 oveq2 x=yA+𝑜B+𝑜x=A+𝑜B+𝑜y
11 oveq2 x=yB+𝑜x=B+𝑜y
12 11 oveq2d x=yA+𝑜B+𝑜x=A+𝑜B+𝑜y
13 10 12 eqeq12d x=yA+𝑜B+𝑜x=A+𝑜B+𝑜xA+𝑜B+𝑜y=A+𝑜B+𝑜y
14 oveq2 x=sucyA+𝑜B+𝑜x=A+𝑜B+𝑜sucy
15 oveq2 x=sucyB+𝑜x=B+𝑜sucy
16 15 oveq2d x=sucyA+𝑜B+𝑜x=A+𝑜B+𝑜sucy
17 14 16 eqeq12d x=sucyA+𝑜B+𝑜x=A+𝑜B+𝑜xA+𝑜B+𝑜sucy=A+𝑜B+𝑜sucy
18 nnacl AωBωA+𝑜Bω
19 nna0 A+𝑜BωA+𝑜B+𝑜=A+𝑜B
20 18 19 syl AωBωA+𝑜B+𝑜=A+𝑜B
21 nna0 BωB+𝑜=B
22 21 oveq2d BωA+𝑜B+𝑜=A+𝑜B
23 22 adantl AωBωA+𝑜B+𝑜=A+𝑜B
24 20 23 eqtr4d AωBωA+𝑜B+𝑜=A+𝑜B+𝑜
25 suceq A+𝑜B+𝑜y=A+𝑜B+𝑜ysucA+𝑜B+𝑜y=sucA+𝑜B+𝑜y
26 nnasuc A+𝑜BωyωA+𝑜B+𝑜sucy=sucA+𝑜B+𝑜y
27 18 26 sylan AωBωyωA+𝑜B+𝑜sucy=sucA+𝑜B+𝑜y
28 nnasuc BωyωB+𝑜sucy=sucB+𝑜y
29 28 oveq2d BωyωA+𝑜B+𝑜sucy=A+𝑜sucB+𝑜y
30 29 adantl AωBωyωA+𝑜B+𝑜sucy=A+𝑜sucB+𝑜y
31 nnacl BωyωB+𝑜yω
32 nnasuc AωB+𝑜yωA+𝑜sucB+𝑜y=sucA+𝑜B+𝑜y
33 31 32 sylan2 AωBωyωA+𝑜sucB+𝑜y=sucA+𝑜B+𝑜y
34 30 33 eqtrd AωBωyωA+𝑜B+𝑜sucy=sucA+𝑜B+𝑜y
35 34 anassrs AωBωyωA+𝑜B+𝑜sucy=sucA+𝑜B+𝑜y
36 27 35 eqeq12d AωBωyωA+𝑜B+𝑜sucy=A+𝑜B+𝑜sucysucA+𝑜B+𝑜y=sucA+𝑜B+𝑜y
37 25 36 imbitrrid AωBωyωA+𝑜B+𝑜y=A+𝑜B+𝑜yA+𝑜B+𝑜sucy=A+𝑜B+𝑜sucy
38 37 expcom yωAωBωA+𝑜B+𝑜y=A+𝑜B+𝑜yA+𝑜B+𝑜sucy=A+𝑜B+𝑜sucy
39 9 13 17 24 38 finds2 xωAωBωA+𝑜B+𝑜x=A+𝑜B+𝑜x
40 5 39 vtoclga CωAωBωA+𝑜B+𝑜C=A+𝑜B+𝑜C
41 40 com12 AωBωCωA+𝑜B+𝑜C=A+𝑜B+𝑜C
42 41 3impia AωBωCωA+𝑜B+𝑜C=A+𝑜B+𝑜C