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

Theorem nnsub 12422
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 5112 . . . . . 6 (𝑥 = 1 → (𝑧 < 𝑥 ↔ 𝑧 < 1))
2 oveq1 7458 . . . . . . 7 (𝑥 = 1 → (𝑥 − 𝑧) = (1 − 𝑧))
32eleq1d 2849 . . . . . 6 (𝑥 = 1 → ((𝑥 − 𝑧) ∈ ℕ ↔ (1 − 𝑧) ∈ ℕ))
41, 3imbi12d 347 . . . . 5 (𝑥 = 1 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)))
54ralbidv 3189 . . . 4 (𝑥 = 1 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)))
6 breq2 5112 . . . . . 6 (𝑥 = 𝑦 → (𝑧 < 𝑥 ↔ 𝑧 < 𝑦))
7 oveq1 7458 . . . . . . 7 (𝑥 = 𝑦 → (𝑥 − 𝑧) = (𝑦 − 𝑧))
87eleq1d 2849 . . . . . 6 (𝑥 = 𝑦 → ((𝑥 − 𝑧) ∈ ℕ ↔ (𝑦 − 𝑧) ∈ ℕ))
96, 8imbi12d 347 . . . . 5 (𝑥 = 𝑦 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ)))
109ralbidv 3189 . . . 4 (𝑥 = 𝑦 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ)))
11 breq2 5112 . . . . . 6 (𝑥 = (𝑦 + 1) → (𝑧 < 𝑥 ↔ 𝑧 < (𝑦 + 1)))
12 oveq1 7458 . . . . . . 7 (𝑥 = (𝑦 + 1) → (𝑥 − 𝑧) = ((𝑦 + 1) − 𝑧))
1312eleq1d 2849 . . . . . 6 (𝑥 = (𝑦 + 1) → ((𝑥 − 𝑧) ∈ ℕ ↔ ((𝑦 + 1) − 𝑧) ∈ ℕ))
1411, 13imbi12d 347 . . . . 5 (𝑥 = (𝑦 + 1) → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
1514ralbidv 3189 . . . 4 (𝑥 = (𝑦 + 1) → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
16 breq2 5112 . . . . . 6 (𝑥 = 𝐵 → (𝑧 < 𝑥 ↔ 𝑧 < 𝐵))
17 oveq1 7458 . . . . . . 7 (𝑥 = 𝐵 → (𝑥 − 𝑧) = (𝐵 − 𝑧))
1817eleq1d 2849 . . . . . 6 (𝑥 = 𝐵 → ((𝑥 − 𝑧) ∈ ℕ ↔ (𝐵 − 𝑧) ∈ ℕ))
1916, 18imbi12d 347 . . . . 5 (𝑥 = 𝐵 → ((𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)))
2019ralbidv 3189 . . . 4 (𝑥 = 𝐵 → (∀𝑧 ∈ ℕ (𝑧 < 𝑥 → (𝑥 − 𝑧) ∈ ℕ) ↔ ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)))
21 nnnlt1 12410 . . . . . 6 (𝑧 ∈ ℕ → ¬ 𝑧 < 1)
2221pm2.21d 122 . . . . 5 (𝑧 ∈ ℕ → (𝑧 < 1 → (1 − 𝑧) ∈ ℕ))
2322rgen 3082 . . . 4 ∀𝑧 ∈ ℕ (𝑧 < 1 → (1 − 𝑧) ∈ ℕ)
24 breq1 5111 . . . . . . 7 (𝑧 = 𝑥 → (𝑧 < 𝑦 ↔ 𝑥 < 𝑦))
25 oveq2 7459 . . . . . . . 8 (𝑧 = 𝑥 → (𝑦 − 𝑧) = (𝑦 − 𝑥))
2625eleq1d 2849 . . . . . . 7 (𝑧 = 𝑥 → ((𝑦 − 𝑧) ∈ ℕ ↔ (𝑦 − 𝑥) ∈ ℕ))
2724, 26imbi12d 347 . . . . . 6 (𝑧 = 𝑥 → ((𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) ↔ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ)))
2827cbvralvw 3244 . . . . 5 (∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) ↔ ∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ))
29 nncn 12383 . . . . . . . . . . . 12 (𝑦 ∈ ℕ → 𝑦 ∈ ℂ)
3029adantr 486 . . . . . . . . . . 11 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → 𝑦 ∈ ℂ)
31 ax-1cn 11297 . . . . . . . . . . 11 1 ∈ ℂ
32 pncan 11602 . . . . . . . . . . 11 ((𝑦 ∈ ℂ ∧ 1 ∈ ℂ) → ((𝑦 + 1) − 1) = 𝑦)
3330, 31, 32sylancl 598 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑦 + 1) − 1) = 𝑦)
34 simpl 488 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → 𝑦 ∈ ℕ)
3533, 34eqeltrd 2864 . . . . . . . . 9 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑦 + 1) − 1) ∈ ℕ)
36 oveq2 7459 . . . . . . . . . 10 (𝑧 = 1 → ((𝑦 + 1) − 𝑧) = ((𝑦 + 1) − 1))
3736eleq1d 2849 . . . . . . . . 9 (𝑧 = 1 → (((𝑦 + 1) − 𝑧) ∈ ℕ ↔ ((𝑦 + 1) − 1) ∈ ℕ))
3835, 37syl5ibrcom 250 . . . . . . . 8 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 → ((𝑦 + 1) − 𝑧) ∈ ℕ))
39382a1dd 52 . . . . . . 7 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ))))
40 breq1 5111 . . . . . . . . . 10 (𝑥 = (𝑧 − 1) → (𝑥 < 𝑦 ↔ (𝑧 − 1) < 𝑦))
41 oveq2 7459 . . . . . . . . . . 11 (𝑥 = (𝑧 − 1) → (𝑦 − 𝑥) = (𝑦 − (𝑧 − 1)))
4241eleq1d 2849 . . . . . . . . . 10 (𝑥 = (𝑧 − 1) → ((𝑦 − 𝑥) ∈ ℕ ↔ (𝑦 − (𝑧 − 1)) ∈ ℕ))
4340, 42imbi12d 347 . . . . . . . . 9 (𝑥 = (𝑧 − 1) → ((𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) ↔ ((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ)))
4443rspcv 3576 . . . . . . . 8 ((𝑧 − 1) ∈ ℕ → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → ((𝑧 − 1) < 𝑦 → (𝑦 − (𝑧 − 1)) ∈ ℕ)))
45 nnre 12382 . . . . . . . . . . 11 (𝑧 ∈ ℕ → 𝑧 ∈ ℝ)
46 nnre 12382 . . . . . . . . . . 11 (𝑦 ∈ ℕ → 𝑦 ∈ ℝ)
47 1re 11347 . . . . . . . . . . . 12 1 ∈ ℝ
48 ltsubadd 11826 . . . . . . . . . . . 12 ((𝑧 ∈ ℝ ∧ 1 ∈ ℝ ∧ 𝑦 ∈ ℝ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
4947, 48mp3an2 1479 . . . . . . . . . . 11 ((𝑧 ∈ ℝ ∧ 𝑦 ∈ ℝ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
5045, 46, 49syl2anr 609 . . . . . . . . . 10 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → ((𝑧 − 1) < 𝑦 ↔ 𝑧 < (𝑦 + 1)))
51 nncn 12383 . . . . . . . . . . . 12 (𝑧 ∈ ℕ → 𝑧 ∈ ℂ)
52 subsub3 11629 . . . . . . . . . . . . 13 ((𝑦 ∈ ℂ ∧ 𝑧 ∈ ℂ ∧ 1 ∈ ℂ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5331, 52mp3an3 1480 . . . . . . . . . . . 12 ((𝑦 ∈ ℂ ∧ 𝑧 ∈ ℂ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5429, 51, 53syl2an 608 . . . . . . . . . . 11 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑦 − (𝑧 − 1)) = ((𝑦 + 1) − 𝑧))
5554eleq1d 2849 . . . . . . . . . 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 12396 . . . . . . . 8 (𝑧 ∈ ℕ → (𝑧 = 1 ∨ (𝑧 − 1) ∈ ℕ))
6059adantl 487 . . . . . . 7 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (𝑧 = 1 ∨ (𝑧 − 1) ∈ ℕ))
6139, 58, 60mpjaod 874 . . . . . 6 ((𝑦 ∈ ℕ ∧ 𝑧 ∈ ℕ) → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
6261ralrimdva 3166 . . . . 5 (𝑦 ∈ ℕ → (∀𝑥 ∈ ℕ (𝑥 < 𝑦 → (𝑦 − 𝑥) ∈ ℕ) → ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
6328, 62biimtrid 245 . . . 4 (𝑦 ∈ ℕ → (∀𝑧 ∈ ℕ (𝑧 < 𝑦 → (𝑦 − 𝑧) ∈ ℕ) → ∀𝑧 ∈ ℕ (𝑧 < (𝑦 + 1) → ((𝑦 + 1) − 𝑧) ∈ ℕ)))
645, 10, 15, 20, 23, 63nnind 12393 . . 3 (𝐵 ∈ ℕ → ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ))
65 breq1 5111 . . . . 5 (𝑧 = 𝐴 → (𝑧 < 𝐵 ↔ 𝐴 < 𝐵))
66 oveq2 7459 . . . . . 6 (𝑧 = 𝐴 → (𝐵 − 𝑧) = (𝐵 − 𝐴))
6766eleq1d 2849 . . . . 5 (𝑧 = 𝐴 → ((𝐵 − 𝑧) ∈ ℕ ↔ (𝐵 − 𝐴) ∈ ℕ))
6865, 67imbi12d 347 . . . 4 (𝑧 = 𝐴 → ((𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ) ↔ (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ)))
6968rspcva 3578 . . 3 ((𝐴 ∈ ℕ ∧ ∀𝑧 ∈ ℕ (𝑧 < 𝐵 → (𝐵 − 𝑧) ∈ ℕ)) → (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ))
7064, 69sylan2 605 . 2 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℕ) → (𝐴 < 𝐵 → (𝐵 − 𝐴) ∈ ℕ))
71 nngt0 12409 . . 3 ((𝐵 − 𝐴) ∈ ℕ → 0 < (𝐵 − 𝐴))
72 nnre 12382 . . . 4 (𝐴 ∈ ℕ → 𝐴 ∈ ℝ)
73 nnre 12382 . . . 4 (𝐵 ∈ ℕ → 𝐵 ∈ ℝ)
74 posdif 11849 . . . 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 2147  ∀wral 3080   class class class wbr 5108  (class class class)co 7451  ℂcc 11237  ℝcr 11238  0cc0 11239  1c1 11240   + caddc 11242   < clt 11382   − cmin 11580  ℕcn 12375
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 1945  ax-6 2002  ax-7 2043  ax-8 2149  ax-9 2157  ax-10 2180  ax-11 2197  ax-12 2216  ax-ext 2735  ax-sep 5255  ax-nul 5266  ax-pow 5334  ax-pr 5398  ax-un 7783  ax-resscn 11296  ax-1cn 11297  ax-icn 11298  ax-addcl 11299  ax-addrcl 11300  ax-mulcl 11301  ax-mulrcl 11302  ax-mulcom 11303  ax-addass 11304  ax-mulass 11305  ax-distr 11306  ax-i2m1 11307  ax-1ne0 11308  ax-1rid 11309  ax-rnegex 11310  ax-rrecex 11311  ax-cnre 11312  ax-pre-lttri 11313  ax-pre-lttrn 11314  ax-pre-ltadd 11315  ax-pre-mulgt0 11316
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 2102  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2839  df-nfc 2913  df-ne 2960  df-nel 3066  df-ral 3081  df-rex 3091  df-reu 3370  df-rab 3417  df-v 3456  df-sbc 3743  df-csb 3852  df-ss 3901  df-pss 4017  df-dif 4050  df-in 4094  df-un 4154  df-nul 4282  df-if 4486  df-pw 4562  df-sn 4589  df-pr 4591  df-op 4841  df-uni 4873  df-iun 4958  df-br 5109  df-opab 5174  df-mpt 5193  df-tr 5219  df-id 5553  df-eprel 5558  df-po 5566  df-so 5567  df-fr 5611  df-we 5613  df-xp 5664  df-rel 5665  df-cnv 5666  df-co 5667  df-dm 5668  df-rn 5669  df-res 5670  df-ima 5671  df-pred 6330  df-ord 6391  df-on 6392  df-lim 6393  df-suc 6394  df-iota 6520  df-fun 6568  df-fn 6569  df-f 6570  df-f1 6571  df-fo 6572  df-f1o 6573  df-fv 6574  df-riota 7408  df-ov 7454  df-oprab 7455  df-mpo 7456  df-om 7912  df-2nd 8036  df-frecs 8337  df-wrecs 8368  df-recs 8417  df-rdg 8456  df-er 8755  df-en 9012  df-dom 9013  df-sdom 9014  df-pnf 11384  df-mnf 11385  df-xr 11386  df-ltxr 11387  df-le 11388  df-sub 11582  df-neg 11583  df-nn 12376
This theorem is used by:  nnsubi  12423  nn0sub  12696  uz3m2nn  13061  faclbnd4lem4  14481  pythagtriplem13  17049  vdwlem12  17214  perfectlem1  27613  crctcshwlkn0lem6  30461  crctcshwlkn0lem7  30462  bcprod  36718  nndivsub  37460  fimgmcyc  43864  perfectALTVlem1  49153
  Copyright terms: Public domain W3C validator