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 = C A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 C
2 oveq2 x = C B + 𝑜 x = B + 𝑜 C
3 2 oveq2d x = C A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 C
4 1 3 eqeq12d x = C A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 x A + 𝑜 B + 𝑜 C = A + 𝑜 B + 𝑜 C
5 4 imbi2d x = C A ω B ω A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 x A ω 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 + 𝑜 x A + 𝑜 B + 𝑜 = A + 𝑜 B + 𝑜
10 oveq2 x = y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 y
11 oveq2 x = y B + 𝑜 x = B + 𝑜 y
12 11 oveq2d x = y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 y
13 10 12 eqeq12d x = y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 x A + 𝑜 B + 𝑜 y = A + 𝑜 B + 𝑜 y
14 oveq2 x = suc y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 suc y
15 oveq2 x = suc y B + 𝑜 x = B + 𝑜 suc y
16 15 oveq2d x = suc y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 suc y
17 14 16 eqeq12d x = suc y A + 𝑜 B + 𝑜 x = A + 𝑜 B + 𝑜 x A + 𝑜 B + 𝑜 suc y = A + 𝑜 B + 𝑜 suc y
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 + 𝑜 y suc A + 𝑜 B + 𝑜 y = suc A + 𝑜 B + 𝑜 y
26 nnasuc A + 𝑜 B ω y ω A + 𝑜 B + 𝑜 suc y = suc A + 𝑜 B + 𝑜 y
27 18 26 sylan A ω B ω y ω A + 𝑜 B + 𝑜 suc y = suc A + 𝑜 B + 𝑜 y
28 nnasuc B ω y ω B + 𝑜 suc y = suc B + 𝑜 y
29 28 oveq2d B ω y ω A + 𝑜 B + 𝑜 suc y = A + 𝑜 suc B + 𝑜 y
30 29 adantl A ω B ω y ω A + 𝑜 B + 𝑜 suc y = A + 𝑜 suc B + 𝑜 y
31 nnacl B ω y ω B + 𝑜 y ω
32 nnasuc A ω B + 𝑜 y ω A + 𝑜 suc B + 𝑜 y = suc A + 𝑜 B + 𝑜 y
33 31 32 sylan2 A ω B ω y ω A + 𝑜 suc B + 𝑜 y = suc A + 𝑜 B + 𝑜 y
34 30 33 eqtrd A ω B ω y ω A + 𝑜 B + 𝑜 suc y = suc A + 𝑜 B + 𝑜 y
35 34 anassrs A ω B ω y ω A + 𝑜 B + 𝑜 suc y = suc A + 𝑜 B + 𝑜 y
36 27 35 eqeq12d A ω B ω y ω A + 𝑜 B + 𝑜 suc y = A + 𝑜 B + 𝑜 suc y suc A + 𝑜 B + 𝑜 y = suc A + 𝑜 B + 𝑜 y
37 25 36 syl5ibr A ω B ω y ω A + 𝑜 B + 𝑜 y = A + 𝑜 B + 𝑜 y A + 𝑜 B + 𝑜 suc y = A + 𝑜 B + 𝑜 suc y
38 37 expcom y ω A ω B ω A + 𝑜 B + 𝑜 y = A + 𝑜 B + 𝑜 y A + 𝑜 B + 𝑜 suc y = A + 𝑜 B + 𝑜 suc y
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