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

Theorem nnacom 7742
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 6697 . . . . 5 (𝑥 = 𝐴 → (𝑥 +𝑜 𝐵) = (𝐴 +𝑜 𝐵))
2 oveq2 6698 . . . . 5 (𝑥 = 𝐴 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝐴))
31, 2eqeq12d 2666 . . . 4 (𝑥 = 𝐴 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
43imbi2d 329 . . 3 (𝑥 = 𝐴 → ((𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)) ↔ (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))))
5 oveq1 6697 . . . . 5 (𝑥 = ∅ → (𝑥 +𝑜 𝐵) = (∅ +𝑜 𝐵))
6 oveq2 6698 . . . . 5 (𝑥 = ∅ → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 ∅))
75, 6eqeq12d 2666 . . . 4 (𝑥 = ∅ → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅)))
8 oveq1 6697 . . . . 5 (𝑥 = 𝑦 → (𝑥 +𝑜 𝐵) = (𝑦 +𝑜 𝐵))
9 oveq2 6698 . . . . 5 (𝑥 = 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 𝑦))
108, 9eqeq12d 2666 . . . 4 (𝑥 = 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦)))
11 oveq1 6697 . . . . 5 (𝑥 = suc 𝑦 → (𝑥 +𝑜 𝐵) = (suc 𝑦 +𝑜 𝐵))
12 oveq2 6698 . . . . 5 (𝑥 = suc 𝑦 → (𝐵 +𝑜 𝑥) = (𝐵 +𝑜 suc 𝑦))
1311, 12eqeq12d 2666 . . . 4 (𝑥 = suc 𝑦 → ((𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
14 nna0r 7734 . . . . 5 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = 𝐵)
15 nna0 7729 . . . . 5 (𝐵 ∈ ω → (𝐵 +𝑜 ∅) = 𝐵)
1614, 15eqtr4d 2688 . . . 4 (𝐵 ∈ ω → (∅ +𝑜 𝐵) = (𝐵 +𝑜 ∅))
17 suceq 5828 . . . . . 6 ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦))
18 oveq2 6698 . . . . . . . . . . 11 (𝑥 = 𝐵 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝐵))
19 oveq2 6698 . . . . . . . . . . . 12 (𝑥 = 𝐵 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵))
20 suceq 5828 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝐵) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2119, 20syl 17 . . . . . . . . . . 11 (𝑥 = 𝐵 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝐵))
2218, 21eqeq12d 2666 . . . . . . . . . 10 (𝑥 = 𝐵 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
2322imbi2d 329 . . . . . . . . 9 (𝑥 = 𝐵 → ((𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)) ↔ (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))))
24 oveq2 6698 . . . . . . . . . . 11 (𝑥 = ∅ → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 ∅))
25 oveq2 6698 . . . . . . . . . . . 12 (𝑥 = ∅ → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅))
26 suceq 5828 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 ∅) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2725, 26syl 17 . . . . . . . . . . 11 (𝑥 = ∅ → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 ∅))
2824, 27eqeq12d 2666 . . . . . . . . . 10 (𝑥 = ∅ → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅)))
29 oveq2 6698 . . . . . . . . . . 11 (𝑥 = 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 𝑧))
30 oveq2 6698 . . . . . . . . . . . 12 (𝑥 = 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧))
31 suceq 5828 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3230, 31syl 17 . . . . . . . . . . 11 (𝑥 = 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑧))
3329, 32eqeq12d 2666 . . . . . . . . . 10 (𝑥 = 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧)))
34 oveq2 6698 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → (suc 𝑦 +𝑜 𝑥) = (suc 𝑦 +𝑜 suc 𝑧))
35 oveq2 6698 . . . . . . . . . . . 12 (𝑥 = suc 𝑧 → (𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧))
36 suceq 5828 . . . . . . . . . . . 12 ((𝑦 +𝑜 𝑥) = (𝑦 +𝑜 suc 𝑧) → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3735, 36syl 17 . . . . . . . . . . 11 (𝑥 = suc 𝑧 → suc (𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 suc 𝑧))
3834, 37eqeq12d 2666 . . . . . . . . . 10 (𝑥 = suc 𝑧 → ((suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥) ↔ (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
39 peano2 7128 . . . . . . . . . . . 12 (𝑦 ∈ ω → suc 𝑦 ∈ ω)
40 nna0 7729 . . . . . . . . . . . 12 (suc 𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
4139, 40syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc 𝑦)
42 nna0 7729 . . . . . . . . . . . 12 (𝑦 ∈ ω → (𝑦 +𝑜 ∅) = 𝑦)
43 suceq 5828 . . . . . . . . . . . 12 ((𝑦 +𝑜 ∅) = 𝑦 → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4442, 43syl 17 . . . . . . . . . . 11 (𝑦 ∈ ω → suc (𝑦 +𝑜 ∅) = suc 𝑦)
4541, 44eqtr4d 2688 . . . . . . . . . 10 (𝑦 ∈ ω → (suc 𝑦 +𝑜 ∅) = suc (𝑦 +𝑜 ∅))
46 suceq 5828 . . . . . . . . . . . 12 ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧))
47 nnasuc 7731 . . . . . . . . . . . . . 14 ((suc 𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
4839, 47sylan 487 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (suc 𝑦 +𝑜 suc 𝑧) = suc (suc 𝑦 +𝑜 𝑧))
49 nnasuc 7731 . . . . . . . . . . . . . 14 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → (𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧))
50 suceq 5828 . . . . . . . . . . . . . 14 ((𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 𝑧) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5149, 50syl 17 . . . . . . . . . . . . 13 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → suc (𝑦 +𝑜 suc 𝑧) = suc suc (𝑦 +𝑜 𝑧))
5248, 51eqeq12d 2666 . . . . . . . . . . . 12 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧) ↔ suc (suc 𝑦 +𝑜 𝑧) = suc suc (𝑦 +𝑜 𝑧)))
5346, 52syl5ibr 236 . . . . . . . . . . 11 ((𝑦 ∈ ω ∧ 𝑧 ∈ ω) → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧)))
5453expcom 450 . . . . . . . . . 10 (𝑧 ∈ ω → (𝑦 ∈ ω → ((suc 𝑦 +𝑜 𝑧) = suc (𝑦 +𝑜 𝑧) → (suc 𝑦 +𝑜 suc 𝑧) = suc (𝑦 +𝑜 suc 𝑧))))
5528, 33, 38, 45, 54finds2 7136 . . . . . . . . 9 (𝑥 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝑥) = suc (𝑦 +𝑜 𝑥)))
5623, 55vtoclga 3303 . . . . . . . 8 (𝐵 ∈ ω → (𝑦 ∈ ω → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵)))
5756imp 444 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (suc 𝑦 +𝑜 𝐵) = suc (𝑦 +𝑜 𝐵))
58 nnasuc 7731 . . . . . . 7 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → (𝐵 +𝑜 suc 𝑦) = suc (𝐵 +𝑜 𝑦))
5957, 58eqeq12d 2666 . . . . . 6 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦) ↔ suc (𝑦 +𝑜 𝐵) = suc (𝐵 +𝑜 𝑦)))
6017, 59syl5ibr 236 . . . . 5 ((𝐵 ∈ ω ∧ 𝑦 ∈ ω) → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦)))
6160expcom 450 . . . 4 (𝑦 ∈ ω → (𝐵 ∈ ω → ((𝑦 +𝑜 𝐵) = (𝐵 +𝑜 𝑦) → (suc 𝑦 +𝑜 𝐵) = (𝐵 +𝑜 suc 𝑦))))
627, 10, 13, 16, 61finds2 7136 . . 3 (𝑥 ∈ ω → (𝐵 ∈ ω → (𝑥 +𝑜 𝐵) = (𝐵 +𝑜 𝑥)))
634, 62vtoclga 3303 . 2 (𝐴 ∈ ω → (𝐵 ∈ ω → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴)))
6463imp 444 1 ((𝐴 ∈ ω ∧ 𝐵 ∈ ω) → (𝐴 +𝑜 𝐵) = (𝐵 +𝑜 𝐴))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 383   = wceq 1523  wcel 2030  c0 3948  suc csuc 5763  (class class class)co 6690  ωcom 7107   +𝑜 coa 7602
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1762  ax-4 1777  ax-5 1879  ax-6 1945  ax-7 1981  ax-8 2032  ax-9 2039  ax-10 2059  ax-11 2074  ax-12 2087  ax-13 2282  ax-ext 2631  ax-sep 4814  ax-nul 4822  ax-pow 4873  ax-pr 4936  ax-un 6991
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1055  df-3an 1056  df-tru 1526  df-ex 1745  df-nf 1750  df-sb 1938  df-eu 2502  df-mo 2503  df-clab 2638  df-cleq 2644  df-clel 2647  df-nfc 2782  df-ne 2824  df-ral 2946  df-rex 2947  df-reu 2948  df-rab 2950  df-v 3233  df-sbc 3469  df-csb 3567  df-dif 3610  df-un 3612  df-in 3614  df-ss 3621  df-pss 3623  df-nul 3949  df-if 4120  df-pw 4193  df-sn 4211  df-pr 4213  df-tp 4215  df-op 4217  df-uni 4469  df-iun 4554  df-br 4686  df-opab 4746  df-mpt 4763  df-tr 4786  df-id 5053  df-eprel 5058  df-po 5064  df-so 5065  df-fr 5102  df-we 5104  df-xp 5149  df-rel 5150  df-cnv 5151  df-co 5152  df-dm 5153  df-rn 5154  df-res 5155  df-ima 5156  df-pred 5718  df-ord 5764  df-on 5765  df-lim 5766  df-suc 5767  df-iota 5889  df-fun 5928  df-fn 5929  df-f 5930  df-f1 5931  df-fo 5932  df-f1o 5933  df-fv 5934  df-ov 6693  df-oprab 6694  df-mpt2 6695  df-om 7108  df-wrecs 7452  df-recs 7513  df-rdg 7551  df-oadd 7609
This theorem is referenced by:  nnaordr  7745  nnmsucr  7750  nnaword2  7755  omopthlem2  7781  omopthi  7782  addcompi  9754  finxpreclem4  33361
  Copyright terms: Public domain W3C validator