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

Theorem addmodid 13868
Description: The sum of a positive integer and a nonnegative integer less than the positive integer is equal to the nonnegative integer modulo the positive integer. (Contributed by Alexander van der Vekens, 30-Oct-2018.) (Proof shortened by AV, 5-Jul-2020.)
Assertion
Ref Expression
addmodid ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = 𝐴)

Proof of Theorem addmodid
StepHypRef Expression
1 nncn 12204 . . . . . . 7 (𝑀 ∈ ℕ → 𝑀 ∈ ℂ)
21mullidd 11216 . . . . . 6 (𝑀 ∈ ℕ → (1 · 𝑀) = 𝑀)
323ad2ant2 1134 . . . . 5 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (1 · 𝑀) = 𝑀)
43eqcomd 2738 . . . 4 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 = (1 · 𝑀))
54oveq1d 7409 . . 3 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (𝑀 + 𝐴) = ((1 · 𝑀) + 𝐴))
65oveq1d 7409 . 2 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = (((1 · 𝑀) + 𝐴) mod 𝑀))
7 1zzd 12577 . . 3 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 1 ∈ ℤ)
8 nnrp 12969 . . . 4 (𝑀 ∈ ℕ → 𝑀 ∈ ℝ+)
983ad2ant2 1134 . . 3 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 ∈ ℝ+)
10 nn0re 12465 . . . . . 6 (𝐴 ∈ ℕ0𝐴 ∈ ℝ)
1110rexrd 11248 . . . . 5 (𝐴 ∈ ℕ0𝐴 ∈ ℝ*)
12113ad2ant1 1133 . . . 4 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 ∈ ℝ*)
13 nn0ge0 12481 . . . . 5 (𝐴 ∈ ℕ0 → 0 ≤ 𝐴)
14133ad2ant1 1133 . . . 4 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 0 ≤ 𝐴)
15 simp3 1138 . . . 4 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 < 𝑀)
16 0xr 11245 . . . . 5 0 ∈ ℝ*
17 nnre 12203 . . . . . . 7 (𝑀 ∈ ℕ → 𝑀 ∈ ℝ)
1817rexrd 11248 . . . . . 6 (𝑀 ∈ ℕ → 𝑀 ∈ ℝ*)
19183ad2ant2 1134 . . . . 5 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 ∈ ℝ*)
20 elico1 13351 . . . . 5 ((0 ∈ ℝ*𝑀 ∈ ℝ*) → (𝐴 ∈ (0[,)𝑀) ↔ (𝐴 ∈ ℝ* ∧ 0 ≤ 𝐴𝐴 < 𝑀)))
2116, 19, 20sylancr 587 . . . 4 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (𝐴 ∈ (0[,)𝑀) ↔ (𝐴 ∈ ℝ* ∧ 0 ≤ 𝐴𝐴 < 𝑀)))
2212, 14, 15, 21mpbir3and 1342 . . 3 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 ∈ (0[,)𝑀))
23 muladdmodid 13860 . . 3 ((1 ∈ ℤ ∧ 𝑀 ∈ ℝ+𝐴 ∈ (0[,)𝑀)) → (((1 · 𝑀) + 𝐴) mod 𝑀) = 𝐴)
247, 9, 22, 23syl3anc 1371 . 2 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (((1 · 𝑀) + 𝐴) mod 𝑀) = 𝐴)
256, 24eqtrd 2772 1 ((𝐴 ∈ ℕ0𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = 𝐴)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 205  w3a 1087   = wceq 1541  wcel 2106   class class class wbr 5142  (class class class)co 7394  0cc0 11094  1c1 11095   + caddc 11097   · cmul 11099  *cxr 11231   < clt 11232  cle 11233  cn 12196  0cn0 12456  cz 12542  +crp 12958  [,)cico 13310   mod cmo 13818
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 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2703  ax-sep 5293  ax-nul 5300  ax-pow 5357  ax-pr 5421  ax-un 7709  ax-cnex 11150  ax-resscn 11151  ax-1cn 11152  ax-icn 11153  ax-addcl 11154  ax-addrcl 11155  ax-mulcl 11156  ax-mulrcl 11157  ax-mulcom 11158  ax-addass 11159  ax-mulass 11160  ax-distr 11161  ax-i2m1 11162  ax-1ne0 11163  ax-1rid 11164  ax-rnegex 11165  ax-rrecex 11166  ax-cnre 11167  ax-pre-lttri 11168  ax-pre-lttrn 11169  ax-pre-ltadd 11170  ax-pre-mulgt0 11171  ax-pre-sup 11172
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 846  df-3or 1088  df-3an 1089  df-tru 1544  df-fal 1554  df-ex 1782  df-nf 1786  df-sb 2068  df-mo 2534  df-eu 2563  df-clab 2710  df-cleq 2724  df-clel 2810  df-nfc 2885  df-ne 2941  df-nel 3047  df-ral 3062  df-rex 3071  df-rmo 3376  df-reu 3377  df-rab 3433  df-v 3476  df-sbc 3775  df-csb 3891  df-dif 3948  df-un 3950  df-in 3952  df-ss 3962  df-pss 3964  df-nul 4320  df-if 4524  df-pw 4599  df-sn 4624  df-pr 4626  df-op 4630  df-uni 4903  df-iun 4993  df-br 5143  df-opab 5205  df-mpt 5226  df-tr 5260  df-id 5568  df-eprel 5574  df-po 5582  df-so 5583  df-fr 5625  df-we 5627  df-xp 5676  df-rel 5677  df-cnv 5678  df-co 5679  df-dm 5680  df-rn 5681  df-res 5682  df-ima 5683  df-pred 6290  df-ord 6357  df-on 6358  df-lim 6359  df-suc 6360  df-iota 6485  df-fun 6535  df-fn 6536  df-f 6537  df-f1 6538  df-fo 6539  df-f1o 6540  df-fv 6541  df-riota 7350  df-ov 7397  df-oprab 7398  df-mpo 7399  df-om 7840  df-2nd 7960  df-frecs 8250  df-wrecs 8281  df-recs 8355  df-rdg 8394  df-er 8688  df-en 8925  df-dom 8926  df-sdom 8927  df-sup 9421  df-inf 9422  df-pnf 11234  df-mnf 11235  df-xr 11236  df-ltxr 11237  df-le 11238  df-sub 11430  df-neg 11431  df-div 11856  df-nn 12197  df-n0 12457  df-z 12543  df-uz 12807  df-rp 12959  df-ico 13314  df-fl 13741  df-mod 13819
This theorem is referenced by:  addmodidr  13869  cshwidxn  14743  eucrctshift  29425  ex-mod  29631
  Copyright terms: Public domain W3C validator