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

Theorem nnacom 7561
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 6534 . . . . 5 (𝑥 = 𝐴 → (𝑥 +𝑜 𝐵) = (𝐴 +𝑜 𝐵))
2 oveq2 6535 . . . . 5 (𝑥 = 𝐴 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝐴))
31, 2eqeq12d 2624 . . . 4 (𝑥 = 𝐴 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
43imbi2d 328 . . 3 (𝑥 = 𝐴 → ((𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)) ↔ (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))))
5 oveq1 6534 . . . . 5 (𝑥 = ∅ → (𝑥 +𝑜 𝐵) = (∅ +𝑜 𝐵))
6 oveq2 6535 . . . . 5 (𝑥 = ∅ → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 ∅))
75, 6eqeq12d 2624 . . . 4 (𝑥 = ∅ → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅)))
8 oveq1 6534 . . . . 5 (𝑥 = 𝑦 → (𝑥 +𝑜 𝐵) = (𝑦 +𝑜 𝐵))
9 oveq2 6535 . . . . 5 (𝑥 = 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝑦))
108, 9eqeq12d 2624 . . . 4 (𝑥 = 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦)))
11 oveq1 6534 . . . . 5 (𝑥 = suc 𝑦 → (𝑥 +𝑜 𝐵) = (suc 𝑦 +𝑜 𝐵))
12 oveq2 6535 . . . . 5 (𝑥 = suc 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 suc 𝑦))
1311, 12eqeq12d 2624 . . . 4 (𝑥 = suc 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
14 nna0r 7553 . . . . 5 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = 𝐵)
15 nna0 7548 . . . . 5 (𝐵 ∈ ω → (𝐵 +𝑜 ∅) = 𝐵)
1614, 15eqtr4d 2646 . . . 4 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅))
17 suceq 5693 . . . . . 6 ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦))
18 oveq2 6535 . . . . . . . . . . 11 (𝑥 = 𝐵 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝐵))
19 oveq2 6535 . . . . . . . . . . . 12 (𝑥 = 𝐵 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵))
20 suceq 5693 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2119, 20syl 17 . . . . . . . . . . 11 (𝑥 = 𝐵 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2218, 21eqeq12d 2624 . . . . . . . . . 10 (𝑥 = 𝐵 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
2322imbi2d 328 . . . . . . . . 9 (𝑥 = 𝐵 → ((𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)) ↔ (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))))
24 oveq2 6535 . . . . . . . . . . 11 (𝑥 = ∅ → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 ∅))
25 oveq2 6535 . . . . . . . . . . . 12 (𝑥 = ∅ → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅))
26 suceq 5693 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2725, 26syl 17 . . . . . . . . . . 11 (𝑥 = ∅ → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2824, 27eqeq12d 2624 . . . . . . . . . 10 (𝑥 = ∅ → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅)))
29 oveq2 6535 . . . . . . . . . . 11 (𝑥 = 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝑧))
30 oveq2 6535 . . . . . . . . . . . 12 (𝑥 = 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧))
31 suceq 5693 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3230, 31syl 17 . . . . . . . . . . 11 (𝑥 = 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3329, 32eqeq12d 2624 . . . . . . . . . 10 (𝑥 = 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧)))
34 oveq2 6535 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 suc 𝑧))
35 oveq2 6535 . . . . . . . . . . . 12 (𝑥 = suc 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧))
36 suceq 5693 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3735, 36syl 17 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3834, 37eqeq12d 2624 . . . . . . . . . 10 (𝑥 = suc 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
39 peano2 6955 . . . . . . . . . . . 12 (𝑦 ∈ ω → suc 𝑦 ∈ ω)
40 nna0 7548 . . . . . . . . . . . 12 (suc 𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
4139, 40syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
42 nna0 7548 . . . . . . . . . . . 12 (𝑦 ∈ ω → (𝑦 +𝑜 ∅) = 𝑦)
43 suceq 5693 . . . . . . . . . . . 12 ((𝑦 +𝑜 ∅) = 𝑦 → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4442, 43syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4541, 44eqtr4d 2646 . . . . . . . . . 10 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅))
46 suceq 5693 . . . . . . . . . . . 12 ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧))
47 nnasuc 7550 . . . . . . . . . . . . . 14 ((suc 𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
4839, 47sylan 486 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
49 nnasuc 7550 . . . . . . . . . . . . . 14 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧))
50 suceq 5693 . . . . . . . . . . . . . 14 ((𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5149, 50syl 17 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5248, 51eqeq12d 2624 . . . . . . . . . . . 12 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧) ↔ suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧)))
5346, 52syl5ibr 234 . . . . . . . . . . 11 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
5453expcom 449 . . . . . . . . . 10 (𝑧 ∈ ω → (𝑦 ∈ ω → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧))))
5528, 33, 38, 45, 54finds2 6963 . . . . . . . . 9 (𝑥 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)))
5623, 55vtoclga 3244 . . . . . . . 8 (𝐵 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
5756imp 443 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))
58 nnasuc 7550 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (𝐵 +𝑜 suc 𝑦) = suc (𝐵 +𝑜 𝑦))
5957, 58eqeq12d 2624 . . . . . 6 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦) ↔ suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦)))
6017, 59syl5ibr 234 . . . . 5 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
6160expcom 449 . . . 4 (𝑦 ∈ ω → (𝐵 ∈ ω → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦))))
627, 10, 13, 16, 61finds2 6963 . . 3 (𝑥 ∈ ω → (𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)))
634, 62vtoclga 3244 . 2 (𝐴 ∈ ω → (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
6463imp 443 1 ((𝐴 ∈ ω ∧ 𝐵 ∈ ω) → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1474  wcel 1976  c0 3873  suc csuc 5628  (class class class)co 6527  ωcom 6934   +𝑜 coa 7421
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-8 1978  ax-9 1985  ax-10 2005  ax-11 2020  ax-12 2033  ax-13 2233  ax-ext 2589  ax-sep 4703  ax-nul 4712  ax-pow 4764  ax-pr 4828  ax-un 6824
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1867  df-eu 2461  df-mo 2462  df-clab 2596  df-cleq 2602  df-clel 2605  df-nfc 2739  df-ne 2781  df-ral 2900  df-rex 2901  df-reu 2902  df-rab 2904  df-v 3174  df-sbc 3402  df-csb 3499  df-dif 3542  df-un 3544  df-in 3546  df-ss 3553  df-pss 3555  df-nul 3874  df-if 4036  df-pw 4109  df-sn 4125  df-pr 4127  df-tp 4129  df-op 4131  df-uni 4367  df-iun 4451  df-br 4578  df-opab 4638  df-mpt 4639  df-tr 4675  df-eprel 4939  df-id 4943  df-po 4949  df-so 4950  df-fr 4987  df-we 4989  df-xp 5034  df-rel 5035  df-cnv 5036  df-co 5037  df-dm 5038  df-rn 5039  df-res 5040  df-ima 5041  df-pred 5583  df-ord 5629  df-on 5630  df-lim 5631  df-suc 5632  df-iota 5754  df-fun 5792  df-fn 5793  df-f 5794  df-f1 5795  df-fo 5796  df-f1o 5797  df-fv 5798  df-ov 6530  df-oprab 6531  df-mpt2 6532  df-om 6935  df-wrecs 7271  df-recs 7332  df-rdg 7370  df-oadd 7428
This theorem is referenced by:  nnaordr  7564  nnmsucr  7569  nnaword2  7574  omopthlem2  7600  omopthi  7601  addcompi  9572  finxpreclem4  32203
  Copyright terms: Public domain W3C validator