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

Theorem mod2eq1n2dvds 15688
Description: An integer is 1 modulo 2 iff it is odd (i.e. not divisible by 2), see example 3 in [ApostolNT] p. 107. (Contributed by AV, 24-May-2020.) (Proof shortened by AV, 5-Jul-2020.)
Assertion
Ref Expression
mod2eq1n2dvds (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 ↔ ¬ 2 ∥ 𝑁))

Proof of Theorem mod2eq1n2dvds
Dummy variable 𝑛 is distinct from all other variables.
StepHypRef Expression
1 zeo 12056 . . . 4 (𝑁 ∈ ℤ → ((𝑁 / 2) ∈ ℤ ∨ ((𝑁 + 1) / 2) ∈ ℤ))
2 zre 11973 . . . . . . . . 9 (𝑁 ∈ ℤ → 𝑁 ∈ ℝ)
3 2rp 12382 . . . . . . . . 9 2 ∈ ℝ+
4 mod0 13239 . . . . . . . . 9 ((𝑁 ∈ ℝ ∧ 2 ∈ ℝ+) → ((𝑁 mod 2) = 0 ↔ (𝑁 / 2) ∈ ℤ))
52, 3, 4sylancl 589 . . . . . . . 8 (𝑁 ∈ ℤ → ((𝑁 mod 2) = 0 ↔ (𝑁 / 2) ∈ ℤ))
65biimpar 481 . . . . . . 7 ((𝑁 ∈ ℤ ∧ (𝑁 / 2) ∈ ℤ) → (𝑁 mod 2) = 0)
7 eqeq1 2802 . . . . . . . 8 ((𝑁 mod 2) = 0 → ((𝑁 mod 2) = 1 ↔ 0 = 1))
8 0ne1 11696 . . . . . . . . 9 0 ≠ 1
9 eqneqall 2998 . . . . . . . . 9 (0 = 1 → (0 ≠ 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
108, 9mpi 20 . . . . . . . 8 (0 = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁)
117, 10syl6bi 256 . . . . . . 7 ((𝑁 mod 2) = 0 → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
126, 11syl 17 . . . . . 6 ((𝑁 ∈ ℤ ∧ (𝑁 / 2) ∈ ℤ) → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
1312expcom 417 . . . . 5 ((𝑁 / 2) ∈ ℤ → (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁)))
14 peano2zm 12013 . . . . . . . . 9 (((𝑁 + 1) / 2) ∈ ℤ → (((𝑁 + 1) / 2) − 1) ∈ ℤ)
15 zcn 11974 . . . . . . . . . . . 12 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
16 xp1d2m1eqxm1d2 11879 . . . . . . . . . . . 12 (𝑁 ∈ ℂ → (((𝑁 + 1) / 2) − 1) = ((𝑁 − 1) / 2))
1715, 16syl 17 . . . . . . . . . . 11 (𝑁 ∈ ℤ → (((𝑁 + 1) / 2) − 1) = ((𝑁 − 1) / 2))
1817eleq1d 2874 . . . . . . . . . 10 (𝑁 ∈ ℤ → ((((𝑁 + 1) / 2) − 1) ∈ ℤ ↔ ((𝑁 − 1) / 2) ∈ ℤ))
1918biimpd 232 . . . . . . . . 9 (𝑁 ∈ ℤ → ((((𝑁 + 1) / 2) − 1) ∈ ℤ → ((𝑁 − 1) / 2) ∈ ℤ))
2014, 19mpan9 510 . . . . . . . 8 ((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑁 − 1) / 2) ∈ ℤ)
21 oveq2 7143 . . . . . . . . . . 11 (𝑛 = ((𝑁 − 1) / 2) → (2 · 𝑛) = (2 · ((𝑁 − 1) / 2)))
2221adantl 485 . . . . . . . . . 10 (((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑛 = ((𝑁 − 1) / 2)) → (2 · 𝑛) = (2 · ((𝑁 − 1) / 2)))
2322oveq1d 7150 . . . . . . . . 9 (((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑛 = ((𝑁 − 1) / 2)) → ((2 · 𝑛) + 1) = ((2 · ((𝑁 − 1) / 2)) + 1))
24 peano2zm 12013 . . . . . . . . . . . . . 14 (𝑁 ∈ ℤ → (𝑁 − 1) ∈ ℤ)
2524zcnd 12076 . . . . . . . . . . . . 13 (𝑁 ∈ ℤ → (𝑁 − 1) ∈ ℂ)
26 2cnd 11703 . . . . . . . . . . . . 13 (𝑁 ∈ ℤ → 2 ∈ ℂ)
27 2ne0 11729 . . . . . . . . . . . . . 14 2 ≠ 0
2827a1i 11 . . . . . . . . . . . . 13 (𝑁 ∈ ℤ → 2 ≠ 0)
2925, 26, 28divcan2d 11407 . . . . . . . . . . . 12 (𝑁 ∈ ℤ → (2 · ((𝑁 − 1) / 2)) = (𝑁 − 1))
3029oveq1d 7150 . . . . . . . . . . 11 (𝑁 ∈ ℤ → ((2 · ((𝑁 − 1) / 2)) + 1) = ((𝑁 − 1) + 1))
31 npcan1 11054 . . . . . . . . . . . 12 (𝑁 ∈ ℂ → ((𝑁 − 1) + 1) = 𝑁)
3215, 31syl 17 . . . . . . . . . . 11 (𝑁 ∈ ℤ → ((𝑁 − 1) + 1) = 𝑁)
3330, 32eqtrd 2833 . . . . . . . . . 10 (𝑁 ∈ ℤ → ((2 · ((𝑁 − 1) / 2)) + 1) = 𝑁)
3433ad2antlr 726 . . . . . . . . 9 (((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑛 = ((𝑁 − 1) / 2)) → ((2 · ((𝑁 − 1) / 2)) + 1) = 𝑁)
3523, 34eqtrd 2833 . . . . . . . 8 (((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑛 = ((𝑁 − 1) / 2)) → ((2 · 𝑛) + 1) = 𝑁)
3620, 35rspcedeq1vd 3577 . . . . . . 7 ((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁)
3736a1d 25 . . . . . 6 ((((𝑁 + 1) / 2) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
3837ex 416 . . . . 5 (((𝑁 + 1) / 2) ∈ ℤ → (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁)))
3913, 38jaoi 854 . . . 4 (((𝑁 / 2) ∈ ℤ ∨ ((𝑁 + 1) / 2) ∈ ℤ) → (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁)))
401, 39mpcom 38 . . 3 (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 → ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
41 oveq1 7142 . . . . . 6 (𝑁 = ((2 · 𝑛) + 1) → (𝑁 mod 2) = (((2 · 𝑛) + 1) mod 2))
4241eqcoms 2806 . . . . 5 (((2 · 𝑛) + 1) = 𝑁 → (𝑁 mod 2) = (((2 · 𝑛) + 1) mod 2))
43 2cnd 11703 . . . . . . . . . . . . 13 (𝑛 ∈ ℤ → 2 ∈ ℂ)
44 zcn 11974 . . . . . . . . . . . . 13 (𝑛 ∈ ℤ → 𝑛 ∈ ℂ)
4543, 44mulcomd 10651 . . . . . . . . . . . 12 (𝑛 ∈ ℤ → (2 · 𝑛) = (𝑛 · 2))
4645oveq1d 7150 . . . . . . . . . . 11 (𝑛 ∈ ℤ → ((2 · 𝑛) mod 2) = ((𝑛 · 2) mod 2))
47 mulmod0 13240 . . . . . . . . . . . 12 ((𝑛 ∈ ℤ ∧ 2 ∈ ℝ+) → ((𝑛 · 2) mod 2) = 0)
483, 47mpan2 690 . . . . . . . . . . 11 (𝑛 ∈ ℤ → ((𝑛 · 2) mod 2) = 0)
4946, 48eqtrd 2833 . . . . . . . . . 10 (𝑛 ∈ ℤ → ((2 · 𝑛) mod 2) = 0)
5049oveq1d 7150 . . . . . . . . 9 (𝑛 ∈ ℤ → (((2 · 𝑛) mod 2) + 1) = (0 + 1))
51 0p1e1 11747 . . . . . . . . 9 (0 + 1) = 1
5250, 51eqtrdi 2849 . . . . . . . 8 (𝑛 ∈ ℤ → (((2 · 𝑛) mod 2) + 1) = 1)
5352oveq1d 7150 . . . . . . 7 (𝑛 ∈ ℤ → ((((2 · 𝑛) mod 2) + 1) mod 2) = (1 mod 2))
54 2z 12002 . . . . . . . . . . 11 2 ∈ ℤ
5554a1i 11 . . . . . . . . . 10 (𝑛 ∈ ℤ → 2 ∈ ℤ)
56 id 22 . . . . . . . . . 10 (𝑛 ∈ ℤ → 𝑛 ∈ ℤ)
5755, 56zmulcld 12081 . . . . . . . . 9 (𝑛 ∈ ℤ → (2 · 𝑛) ∈ ℤ)
5857zred 12075 . . . . . . . 8 (𝑛 ∈ ℤ → (2 · 𝑛) ∈ ℝ)
59 1red 10631 . . . . . . . 8 (𝑛 ∈ ℤ → 1 ∈ ℝ)
603a1i 11 . . . . . . . 8 (𝑛 ∈ ℤ → 2 ∈ ℝ+)
61 modaddmod 13273 . . . . . . . 8 (((2 · 𝑛) ∈ ℝ ∧ 1 ∈ ℝ ∧ 2 ∈ ℝ+) → ((((2 · 𝑛) mod 2) + 1) mod 2) = (((2 · 𝑛) + 1) mod 2))
6258, 59, 60, 61syl3anc 1368 . . . . . . 7 (𝑛 ∈ ℤ → ((((2 · 𝑛) mod 2) + 1) mod 2) = (((2 · 𝑛) + 1) mod 2))
63 2re 11699 . . . . . . . . 9 2 ∈ ℝ
64 1lt2 11796 . . . . . . . . 9 1 < 2
6563, 64pm3.2i 474 . . . . . . . 8 (2 ∈ ℝ ∧ 1 < 2)
66 1mod 13266 . . . . . . . 8 ((2 ∈ ℝ ∧ 1 < 2) → (1 mod 2) = 1)
6765, 66mp1i 13 . . . . . . 7 (𝑛 ∈ ℤ → (1 mod 2) = 1)
6853, 62, 673eqtr3d 2841 . . . . . 6 (𝑛 ∈ ℤ → (((2 · 𝑛) + 1) mod 2) = 1)
6968adantl 485 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑛 ∈ ℤ) → (((2 · 𝑛) + 1) mod 2) = 1)
7042, 69sylan9eqr 2855 . . . 4 (((𝑁 ∈ ℤ ∧ 𝑛 ∈ ℤ) ∧ ((2 · 𝑛) + 1) = 𝑁) → (𝑁 mod 2) = 1)
7170rexlimdva2 3246 . . 3 (𝑁 ∈ ℤ → (∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁 → (𝑁 mod 2) = 1))
7240, 71impbid 215 . 2 (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 ↔ ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
73 odd2np1 15682 . 2 (𝑁 ∈ ℤ → (¬ 2 ∥ 𝑁 ↔ ∃𝑛 ∈ ℤ ((2 · 𝑛) + 1) = 𝑁))
7472, 73bitr4d 285 1 (𝑁 ∈ ℤ → ((𝑁 mod 2) = 1 ↔ ¬ 2 ∥ 𝑁))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 209  wa 399  wo 844   = wceq 1538  wcel 2111  wne 2987  wrex 3107   class class class wbr 5030  (class class class)co 7135  cc 10524  cr 10525  0cc0 10526  1c1 10527   + caddc 10529   · cmul 10531   < clt 10664  cmin 10859   / cdiv 11286  2c2 11680  cz 11969  +crp 12377   mod cmo 13232  cdvds 15599
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2770  ax-sep 5167  ax-nul 5174  ax-pow 5231  ax-pr 5295  ax-un 7441  ax-cnex 10582  ax-resscn 10583  ax-1cn 10584  ax-icn 10585  ax-addcl 10586  ax-addrcl 10587  ax-mulcl 10588  ax-mulrcl 10589  ax-mulcom 10590  ax-addass 10591  ax-mulass 10592  ax-distr 10593  ax-i2m1 10594  ax-1ne0 10595  ax-1rid 10596  ax-rnegex 10597  ax-rrecex 10598  ax-cnre 10599  ax-pre-lttri 10600  ax-pre-lttrn 10601  ax-pre-ltadd 10602  ax-pre-mulgt0 10603  ax-pre-sup 10604
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2598  df-eu 2629  df-clab 2777  df-cleq 2791  df-clel 2870  df-nfc 2938  df-ne 2988  df-nel 3092  df-ral 3111  df-rex 3112  df-reu 3113  df-rmo 3114  df-rab 3115  df-v 3443  df-sbc 3721  df-csb 3829  df-dif 3884  df-un 3886  df-in 3888  df-ss 3898  df-pss 3900  df-nul 4244  df-if 4426  df-pw 4499  df-sn 4526  df-pr 4528  df-tp 4530  df-op 4532  df-uni 4801  df-iun 4883  df-br 5031  df-opab 5093  df-mpt 5111  df-tr 5137  df-id 5425  df-eprel 5430  df-po 5438  df-so 5439  df-fr 5478  df-we 5480  df-xp 5525  df-rel 5526  df-cnv 5527  df-co 5528  df-dm 5529  df-rn 5530  df-res 5531  df-ima 5532  df-pred 6116  df-ord 6162  df-on 6163  df-lim 6164  df-suc 6165  df-iota 6283  df-fun 6326  df-fn 6327  df-f 6328  df-f1 6329  df-fo 6330  df-f1o 6331  df-fv 6332  df-riota 7093  df-ov 7138  df-oprab 7139  df-mpo 7140  df-om 7561  df-wrecs 7930  df-recs 7991  df-rdg 8029  df-er 8272  df-en 8493  df-dom 8494  df-sdom 8495  df-sup 8890  df-inf 8891  df-pnf 10666  df-mnf 10667  df-xr 10668  df-ltxr 10669  df-le 10670  df-sub 10861  df-neg 10862  df-div 11287  df-nn 11626  df-2 11688  df-n0 11886  df-z 11970  df-uz 12232  df-rp 12378  df-fl 13157  df-mod 13233  df-dvds 15600
This theorem is referenced by:  2lgslem3b1  25985  2lgslem3c1  25986  ex-mod  28234  dig2nn1st  45019  0dig2nn0o  45027  dig2bits  45028
  Copyright terms: Public domain W3C validator