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

Theorem nnsub 12382
Description: Subtraction of positive integers. (Contributed by NM, 20-Aug-2001.) (Revised by Mario Carneiro, 16-May-2014.)
Assertion
Ref Expression
nnsub ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝐴 < 𝐵 ↔ (𝐵 − 𝐴) ∈ ℕ))

Proof of Theorem nnsub
Dummy variables 𝑧 𝑥 𝑦 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 breq2 5107 . . . . . 6 (𝑥 = 1 → (𝑧 < 𝑥 ↔ 𝑧 < 1))
2 oveq1 7427 . . . . . . 7 (𝑥 = 1 → (𝑥 − 𝑧) = (1 − 𝑧))
32eleq1d 2846 . . . . . 6 (𝑥 = 1 → ((𝑥 − 𝑧) ∈ ℕ ↔ (1 − 𝑧) ∈ ℕ))
41, 3imbi12d 347 . . . . 5 (𝑥 = 1 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)))
54ralbidv 3186 . . . 4 (𝑥 = 1 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)))
6 breq2 5107 . . . . . 6 (𝑥 = 𝑦 → (𝑧 < 𝑥 ↔ 𝑧 < 𝑦))
7 oveq1 7427 . . . . . . 7 (𝑥 = 𝑦 → (𝑥 − 𝑧) = (𝑦 − 𝑧))
87eleq1d 2846 . . . . . 6 (𝑥 = 𝑦 → ((𝑥 − 𝑧) ∈ ℕ ↔ (𝑦 − 𝑧) ∈ ℕ))
96, 8imbi12d 347 . . . . 5 (𝑥 = 𝑦 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ)))
109ralbidv 3186 . . . 4 (𝑥 = 𝑦 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ)))
11 breq2 5107 . . . . . 6 (𝑥 = (𝑦 + 1) → (𝑧 < 𝑥 ↔ 𝑧 < (𝑦 + 1)))
12 oveq1 7427 . . . . . . 7 (𝑥 = (𝑦 + 1) → (𝑥 − 𝑧) = ((𝑦 + 1) − 𝑧))
1312eleq1d 2846 . . . . . 6 (𝑥 = (𝑦 + 1) → ((𝑥 − 𝑧) ∈ ℕ ↔ ((𝑦 + 1) − 𝑧) ∈ ℕ))
1411, 13imbi12d 347 . . . . 5 (𝑥 = (𝑦 + 1) → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
1514ralbidv 3186 . . . 4 (𝑥 = (𝑦 + 1) → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
16 breq2 5107 . . . . . 6 (𝑥 = 𝐵 → (𝑧 < 𝑥 ↔ 𝑧 < 𝐵))
17 oveq1 7427 . . . . . . 7 (𝑥 = 𝐵 → (𝑥 − 𝑧) = (𝐵 − 𝑧))
1817eleq1d 2846 . . . . . 6 (𝑥 = 𝐵 → ((𝑥 − 𝑧) ∈ ℕ ↔ (𝐵 − 𝑧) ∈ ℕ))
1916, 18imbi12d 347 . . . . 5 (𝑥 = 𝐵 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)))
2019ralbidv 3186 . . . 4 (𝑥 = 𝐵 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)))
21 nnnlt1 12370 . . . . . 6 (𝑧 ∈ ℕ → ¬ 𝑧 < 1)
2221pm2.21d 122 . . . . 5 (𝑧 ∈ ℕ → (𝑧 < 1 → (1 − 𝑧) ∈ ℕ))
2322rgen 3079 . . . 4 ∀𝑧 ∈ ℕ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)
24 breq1 5106 . . . . . . 7 (𝑧 = 𝑥 → (𝑧 < 𝑦 ↔ 𝑥 < 𝑦))
25 oveq2 7428 . . . . . . . 8 (𝑧 = 𝑥 → (𝑦 − 𝑧) = (𝑦 − 𝑥))
2625eleq1d 2846 . . . . . . 7 (𝑧 = 𝑥 → ((𝑦 − 𝑧) ∈ ℕ ↔ (𝑦 − 𝑥) ∈ ℕ))
2724, 26imbi12d 347 . . . . . 6 (𝑧 = 𝑥 → ((𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) ↔ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ)))
2827cbvralvw 3241 . . . . 5 (∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) ↔ ∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ))
29 nncn 12343 . . . . . . . . . . . 12 (𝑦 ∈ ℕ → 𝑦 ∈ ℂ)
3029adantr 486 . . . . . . . . . . 11 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → 𝑦 ∈ ℂ)
31 ax-1cn 11258 . . . . . . . . . . 11 1 ∈ ℂ
32 pncan 11563 . . . . . . . . . . 11 ((𝑦 ∈ ℂ ∧ 1 ∈ ℂ) → ((𝑦 + 1) − 1) = 𝑦)
3330, 31, 32sylancl 598 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑦 + 1) − 1) = 𝑦)
34 simpl 488 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → 𝑦 ∈ ℕ)
3533, 34eqeltrd 2861 . . . . . . . . 9 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑦 + 1) − 1) ∈ ℕ)
36 oveq2 7428 . . . . . . . . . 10 (𝑧 = 1 → ((𝑦 + 1) − 𝑧) = ((𝑦 + 1) − 1))
3736eleq1d 2846 . . . . . . . . 9 (𝑧 = 1 → (((𝑦 + 1) − 𝑧) ∈ ℕ ↔ ((𝑦 + 1) − 1) ∈ ℕ))
3835, 37syl5ibrcom 250 . . . . . . . 8 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 → ((𝑦 + 1) − 𝑧) ∈ ℕ))
39382a1dd 52 . . . . . . 7 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ))))
40 breq1 5106 . . . . . . . . . 10 (𝑥 = (𝑧 − 1) → (𝑥 < 𝑦 ↔ (𝑧 − 1) < 𝑦))
41 oveq2 7428 . . . . . . . . . . 11 (𝑥 = (𝑧 − 1) → (𝑦 − 𝑥) = (𝑦 − (𝑧 − 1)))
4241eleq1d 2846 . . . . . . . . . 10 (𝑥 = (𝑧 − 1) → ((𝑦 − 𝑥) ∈ ℕ ↔ (𝑦 − (𝑧 − 1)) ∈ ℕ))
4340, 42imbi12d 347 . . . . . . . . 9 (𝑥 = (𝑧 − 1) → ((𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) ↔ ((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ)))
4443rspcv 3573 . . . . . . . 8 ((𝑧 − 1) ∈ ℕ → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → ((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ)))
45 nnre 12342 . . . . . . . . . . 11 (𝑧 ∈ ℕ → 𝑧 ∈ ℝ)
46 nnre 12342 . . . . . . . . . . 11 (𝑦 ∈ ℕ → 𝑦 ∈ ℝ)
47 1re 11308 . . . . . . . . . . . 12 1 ∈ ℝ
48 ltsubadd 11786 . . . . . . . . . . . 12 ((𝑧 ∈ ℝ ∧ 1 ∈ ℝ ∧ 𝑦 ∈ ℝ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
4947, 48mp3an2 1478 . . . . . . . . . . 11 ((𝑧 ∈ ℝ ∧ 𝑦 ∈ ℝ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
5045, 46, 49syl2anr 609 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
51 nncn 12343 . . . . . . . . . . . 12 (𝑧 ∈ ℕ → 𝑧 ∈ ℂ)
52 subsub3 11590 . . . . . . . . . . . . 13 ((𝑦 ∈ ℂ ∧ 𝑧 ∈ ℂ ∧ 1 ∈ ℂ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5331, 52mp3an3 1479 . . . . . . . . . . . 12 ((𝑦 ∈ ℂ ∧ 𝑧 ∈ ℂ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5429, 51, 53syl2an 608 . . . . . . . . . . 11 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5554eleq1d 2846 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑦 − (𝑧 − 1)) ∈ ℕ ↔ ((𝑦 + 1) − 𝑧) ∈ ℕ))
5650, 55imbi12d 347 . . . . . . . . 9 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ) ↔ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
5756biimpd 232 . . . . . . . 8 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
5844, 57syl9r 79 . . . . . . 7 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑧 − 1) ∈ ℕ → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ))))
59 nn1m1nn 12356 . . . . . . . 8 (𝑧 ∈ ℕ → (𝑧 = 1 ∨ (𝑧 − 1) ∈ ℕ))
6059adantl 487 . . . . . . 7 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 ∨ (𝑧 − 1) ∈ ℕ))
6139, 58, 60mpjaod 874 . . . . . 6 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
6261ralrimdva 3163 . . . . 5 (𝑦 ∈ ℕ → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
6328, 62biimtrid 245 . . . 4 (𝑦 ∈ ℕ → (∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) → ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
645, 10, 15, 20, 23, 63nnind 12353 . . 3 (𝐵 ∈ ℕ → ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ))
65 breq1 5106 . . . . 5 (𝑧 = 𝐴 → (𝑧 < 𝐵 ↔ 𝐴 < 𝐵))
66 oveq2 7428 . . . . . 6 (𝑧 = 𝐴 → (𝐵 − 𝑧) = (𝐵 − 𝐴))
6766eleq1d 2846 . . . . 5 (𝑧 = 𝐴 → ((𝐵 − 𝑧) ∈ ℕ ↔ (𝐵 − 𝐴) ∈ ℕ))
6865, 67imbi12d 347 . . . 4 (𝑧 = 𝐴 → ((𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ) ↔ (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ)))
6968rspcva 3575 . . 3 ((𝐴 ∈ ℕ ∧ ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)) → (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ))
7064, 69sylan2 605 . 2 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ))
71 nngt0 12369 . . 3 ((𝐵 − 𝐴) ∈ ℕ → 0 < (𝐵 − 𝐴))
72 nnre 12342 . . . 4 (𝐴 ∈ ℕ → 𝐴 ∈ ℝ)
73 nnre 12342 . . . 4 (𝐵 ∈ ℕ → 𝐵 ∈ ℝ)
74 posdif 11809 . . . 4 ((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) → (𝐴 < 𝐵 ↔ 0 < (𝐵 − 𝐴)))
7572, 73, 74syl2an 608 . . 3 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝐴 < 𝐵 ↔ 0 < (𝐵 − 𝐴)))
7671, 75imbitrrid 249 . 2 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → ((𝐵 − 𝐴) ∈ ℕ → 𝐴 < 𝐵))
7770, 76impbid 215 1 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝐴 < 𝐵 ↔ (𝐵 − 𝐴) ∈ ℕ))
Colors of variables:    wff setvar class
This proof depends on syntax axioms:   → wi 4   ↔ wb 209   ∧ wa 401   ∨ wo 861   = wceq 1570   ∈ wcel 2145  ∀wral 3077   class class class wbr 5103  (class class class)co 7420  ℂcc 11198  ℝcr 11199  0cc0 11200  1c1 11201   + caddc 11203   < clt 11343   − cmin 11541  ℕcn 12335
This proof depends on axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1828  ax-4 1842  ax-5 1943  ax-6 2000  ax-7 2041  ax-8 2147  ax-9 2155  ax-10 2178  ax-11 2194  ax-12 2213  ax-ext 2733  ax-sep 5249  ax-nul 5260  ax-pow 5327  ax-pr 5391  ax-un 7751  ax-resscn 11257  ax-1cn 11258  ax-icn 11259  ax-addcl 11260  ax-addrcl 11261  ax-mulcl 11262  ax-mulrcl 11263  ax-mulcom 11264  ax-addass 11265  ax-mulass 11266  ax-distr 11267  ax-i2m1 11268  ax-1ne0 11269  ax-1rid 11270  ax-rnegex 11271  ax-rrecex 11272  ax-cnre 11273  ax-pre-lttri 11274  ax-pre-lttrn 11275  ax-pre-ltadd 11276  ax-pre-mulgt0 11277
This proof depends on definitions:  df-bi 210  df-an 402  df-or 862  df-3or 1104  df-3an 1105  df-tru 1573  df-fal 1583  df-ex 1813  df-nf 1817  df-sb 2100  df-mo 2565  df-eu 2595  df-clab 2740  df-cleq 2753  df-clel 2836  df-nfc 2910  df-ne 2957  df-nel 3063  df-ral 3078  df-rex 3088  df-reu 3367  df-rab 3414  df-v 3453  df-sbc 3740  df-csb 3848  df-dif 3902  df-un 3904  df-in 3906  df-ss 3916  df-pss 3919  df-nul 4280  df-if 4483  df-pw 4559  df-sn 4585  df-pr 4587  df-op 4591  df-uni 4868  df-iun 4953  df-br 5104  df-opab 5168  df-mpt 5187  df-tr 5213  df-id 5546  df-eprel 5551  df-po 5559  df-so 5560  df-fr 5604  df-we 5606  df-xp 5657  df-rel 5658  df-cnv 5659  df-co 5660  df-dm 5661  df-rn 5662  df-res 5663  df-ima 5664  df-pred 6304  df-ord 6365  df-on 6366  df-lim 6367  df-suc 6368  df-iota 6494  df-fun 6540  df-fn 6541  df-f 6542  df-f1 6543  df-fo 6544  df-f1o 6545  df-fv 6546  df-riota 7377  df-ov 7423  df-oprab 7424  df-mpo 7425  df-om 7878  df-2nd 8002  df-frecs 8299  df-wrecs 8330  df-recs 8379  df-rdg 8418  df-er 8717  df-en 8974  df-dom 8975  df-sdom 8976  df-pnf 11345  df-mnf 11346  df-xr 11347  df-ltxr 11348  df-le 11349  df-sub 11543  df-neg 11544  df-nn 12336
This theorem is used by:  nnsubi  12383  nn0sub  12656  uz3m2nn  13021  faclbnd4lem4  14440  pythagtriplem13  17005  vdwlem12  17170  perfectlem1  27556  crctcshwlkn0lem6  30404  crctcshwlkn0lem7  30405  bcprod  36503  nndivsub  37245  fimgmcyc  43598  perfectALTVlem1  48818
  Copyright terms: Public domain W3C validator