MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  nnacom Structured version   Visualization version   GIF version

Theorem nnacom 7657
Description: Addition of natural numbers is commutative. Theorem 4K(2) of [Enderton] p. 81. (Contributed by NM, 6-May-1995.) (Revised by Mario Carneiro, 15-Nov-2014.)
Assertion
Ref Expression
nnacom ((𝐴 ∈ ω ∧ 𝐵 ∈ ω) → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))

Proof of Theorem nnacom
Dummy variables 𝑥 𝑦 𝑧 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 oveq1 6622 . . . . 5 (𝑥 = 𝐴 → (𝑥 +𝑜 𝐵) = (𝐴 +𝑜 𝐵))
2 oveq2 6623 . . . . 5 (𝑥 = 𝐴 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝐴))
31, 2eqeq12d 2636 . . . 4 (𝑥 = 𝐴 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
43imbi2d 330 . . 3 (𝑥 = 𝐴 → ((𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)) ↔ (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))))
5 oveq1 6622 . . . . 5 (𝑥 = ∅ → (𝑥 +𝑜 𝐵) = (∅ +𝑜 𝐵))
6 oveq2 6623 . . . . 5 (𝑥 = ∅ → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 ∅))
75, 6eqeq12d 2636 . . . 4 (𝑥 = ∅ → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅)))
8 oveq1 6622 . . . . 5 (𝑥 = 𝑦 → (𝑥 +𝑜 𝐵) = (𝑦 +𝑜 𝐵))
9 oveq2 6623 . . . . 5 (𝑥 = 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝑦))
108, 9eqeq12d 2636 . . . 4 (𝑥 = 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦)))
11 oveq1 6622 . . . . 5 (𝑥 = suc 𝑦 → (𝑥 +𝑜 𝐵) = (suc 𝑦 +𝑜 𝐵))
12 oveq2 6623 . . . . 5 (𝑥 = suc 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 suc 𝑦))
1311, 12eqeq12d 2636 . . . 4 (𝑥 = suc 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
14 nna0r 7649 . . . . 5 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = 𝐵)
15 nna0 7644 . . . . 5 (𝐵 ∈ ω → (𝐵 +𝑜 ∅) = 𝐵)
1614, 15eqtr4d 2658 . . . 4 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅))
17 suceq 5759 . . . . . 6 ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦))
18 oveq2 6623 . . . . . . . . . . 11 (𝑥 = 𝐵 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝐵))
19 oveq2 6623 . . . . . . . . . . . 12 (𝑥 = 𝐵 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵))
20 suceq 5759 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2119, 20syl 17 . . . . . . . . . . 11 (𝑥 = 𝐵 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2218, 21eqeq12d 2636 . . . . . . . . . 10 (𝑥 = 𝐵 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
2322imbi2d 330 . . . . . . . . 9 (𝑥 = 𝐵 → ((𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)) ↔ (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))))
24 oveq2 6623 . . . . . . . . . . 11 (𝑥 = ∅ → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 ∅))
25 oveq2 6623 . . . . . . . . . . . 12 (𝑥 = ∅ → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅))
26 suceq 5759 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2725, 26syl 17 . . . . . . . . . . 11 (𝑥 = ∅ → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2824, 27eqeq12d 2636 . . . . . . . . . 10 (𝑥 = ∅ → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅)))
29 oveq2 6623 . . . . . . . . . . 11 (𝑥 = 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝑧))
30 oveq2 6623 . . . . . . . . . . . 12 (𝑥 = 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧))
31 suceq 5759 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3230, 31syl 17 . . . . . . . . . . 11 (𝑥 = 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3329, 32eqeq12d 2636 . . . . . . . . . 10 (𝑥 = 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧)))
34 oveq2 6623 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 suc 𝑧))
35 oveq2 6623 . . . . . . . . . . . 12 (𝑥 = suc 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧))
36 suceq 5759 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3735, 36syl 17 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3834, 37eqeq12d 2636 . . . . . . . . . 10 (𝑥 = suc 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
39 peano2 7048 . . . . . . . . . . . 12 (𝑦 ∈ ω → suc 𝑦 ∈ ω)
40 nna0 7644 . . . . . . . . . . . 12 (suc 𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
4139, 40syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
42 nna0 7644 . . . . . . . . . . . 12 (𝑦 ∈ ω → (𝑦 +𝑜 ∅) = 𝑦)
43 suceq 5759 . . . . . . . . . . . 12 ((𝑦 +𝑜 ∅) = 𝑦 → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4442, 43syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4541, 44eqtr4d 2658 . . . . . . . . . 10 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅))
46 suceq 5759 . . . . . . . . . . . 12 ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧))
47 nnasuc 7646 . . . . . . . . . . . . . 14 ((suc 𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
4839, 47sylan 488 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
49 nnasuc 7646 . . . . . . . . . . . . . 14 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧))
50 suceq 5759 . . . . . . . . . . . . . 14 ((𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5149, 50syl 17 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5248, 51eqeq12d 2636 . . . . . . . . . . . 12 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧) ↔ suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧)))
5346, 52syl5ibr 236 . . . . . . . . . . 11 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
5453expcom 451 . . . . . . . . . 10 (𝑧 ∈ ω → (𝑦 ∈ ω → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧))))
5528, 33, 38, 45, 54finds2 7056 . . . . . . . . 9 (𝑥 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)))
5623, 55vtoclga 3262 . . . . . . . 8 (𝐵 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
5756imp 445 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))
58 nnasuc 7646 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (𝐵 +𝑜 suc 𝑦) = suc (𝐵 +𝑜 𝑦))
5957, 58eqeq12d 2636 . . . . . 6 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦) ↔ suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦)))
6017, 59syl5ibr 236 . . . . 5 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
6160expcom 451 . . . 4 (𝑦 ∈ ω → (𝐵 ∈ ω → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦))))
627, 10, 13, 16, 61finds2 7056 . . 3 (𝑥 ∈ ω → (𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)))
634, 62vtoclga 3262 . 2 (𝐴 ∈ ω → (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
6463imp 445 1 ((𝐴 ∈ ω ∧ 𝐵 ∈ ω) → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 384   = wceq 1480  wcel 1987  c0 3897  suc csuc 5694  (class class class)co 6615  ωcom 7027   +𝑜 coa 7517
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1719  ax-4 1734  ax-5 1836  ax-6 1885  ax-7 1932  ax-8 1989  ax-9 1996  ax-10 2016  ax-11 2031  ax-12 2044  ax-13 2245  ax-ext 2601  ax-sep 4751  ax-nul 4759  ax-pow 4813  ax-pr 4877  ax-un 6914
This theorem depends on definitions:  df-bi 197  df-or 385  df-an 386  df-3or 1037  df-3an 1038  df-tru 1483  df-ex 1702  df-nf 1707  df-sb 1878  df-eu 2473  df-mo 2474  df-clab 2608  df-cleq 2614  df-clel 2617  df-nfc 2750  df-ne 2791  df-ral 2913  df-rex 2914  df-reu 2915  df-rab 2917  df-v 3192  df-sbc 3423  df-csb 3520  df-dif 3563  df-un 3565  df-in 3567  df-ss 3574  df-pss 3576  df-nul 3898  df-if 4065  df-pw 4138  df-sn 4156  df-pr 4158  df-tp 4160  df-op 4162  df-uni 4410  df-iun 4494  df-br 4624  df-opab 4684  df-mpt 4685  df-tr 4723  df-eprel 4995  df-id 4999  df-po 5005  df-so 5006  df-fr 5043  df-we 5045  df-xp 5090  df-rel 5091  df-cnv 5092  df-co 5093  df-dm 5094  df-rn 5095  df-res 5096  df-ima 5097  df-pred 5649  df-ord 5695  df-on 5696  df-lim 5697  df-suc 5698  df-iota 5820  df-fun 5859  df-fn 5860  df-f 5861  df-f1 5862  df-fo 5863  df-f1o 5864  df-fv 5865  df-ov 6618  df-oprab 6619  df-mpt2 6620  df-om 7028  df-wrecs 7367  df-recs 7428  df-rdg 7466  df-oadd 7524
This theorem is referenced by:  nnaordr  7660  nnmsucr  7665  nnaword2  7670  omopthlem2  7696  omopthi  7697  addcompi  9676  finxpreclem4  32902
  Copyright terms: Public domain W3C validator