| Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
| Mirrors > Home > MPE Home > Th. List > addmodid | Structured version Visualization version GIF version | ||
| 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.) |
| Ref | Expression |
|---|---|
| addmodid | ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = 𝐴) |
| Step | Hyp | Ref | Expression |
|---|---|---|---|
| 1 | nncn 12228 | . . . . . . 7 ⊢ (𝑀 ∈ ℕ → 𝑀 ∈ ℂ) | |
| 2 | 1 | mullidd 11211 | . . . . . 6 ⊢ (𝑀 ∈ ℕ → (1 · 𝑀) = 𝑀) |
| 3 | 2 | 3ad2ant2 1148 | . . . . 5 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (1 · 𝑀) = 𝑀) |
| 4 | 3 | eqcomd 2769 | . . . 4 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 = (1 · 𝑀)) |
| 5 | 4 | oveq1d 7411 | . . 3 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (𝑀 + 𝐴) = ((1 · 𝑀) + 𝐴)) |
| 6 | 5 | oveq1d 7411 | . 2 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = (((1 · 𝑀) + 𝐴) mod 𝑀)) |
| 7 | 1zzd 12612 | . . 3 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 1 ∈ ℤ) | |
| 8 | nnrp 13015 | . . . 4 ⊢ (𝑀 ∈ ℕ → 𝑀 ∈ ℝ+) | |
| 9 | 8 | 3ad2ant2 1148 | . . 3 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 ∈ ℝ+) |
| 10 | nn0re 12500 | . . . . . 6 ⊢ (𝐴 ∈ ℕ0 → 𝐴 ∈ ℝ) | |
| 11 | 10 | rexrd 11243 | . . . . 5 ⊢ (𝐴 ∈ ℕ0 → 𝐴 ∈ ℝ*) |
| 12 | 11 | 3ad2ant1 1147 | . . . 4 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 ∈ ℝ*) |
| 13 | nn0ge0 12516 | . . . . 5 ⊢ (𝐴 ∈ ℕ0 → 0 ≤ 𝐴) | |
| 14 | 13 | 3ad2ant1 1147 | . . . 4 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 0 ≤ 𝐴) |
| 15 | simp3 1152 | . . . 4 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 < 𝑀) | |
| 16 | 0xr 11240 | . . . . 5 ⊢ 0 ∈ ℝ* | |
| 17 | nnre 12227 | . . . . . . 7 ⊢ (𝑀 ∈ ℕ → 𝑀 ∈ ℝ) | |
| 18 | 17 | rexrd 11243 | . . . . . 6 ⊢ (𝑀 ∈ ℕ → 𝑀 ∈ ℝ*) |
| 19 | 18 | 3ad2ant2 1148 | . . . . 5 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝑀 ∈ ℝ*) |
| 20 | elico1 13402 | . . . . 5 ⊢ ((0 ∈ ℝ* ∧ 𝑀 ∈ ℝ*) → (𝐴 ∈ (0[,)𝑀) ↔ (𝐴 ∈ ℝ* ∧ 0 ≤ 𝐴 ∧ 𝐴 < 𝑀))) | |
| 21 | 16, 19, 20 | sylancr 596 | . . . 4 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (𝐴 ∈ (0[,)𝑀) ↔ (𝐴 ∈ ℝ* ∧ 0 ≤ 𝐴 ∧ 𝐴 < 𝑀))) |
| 22 | 12, 14, 15, 21 | mpbir3and 1357 | . . 3 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → 𝐴 ∈ (0[,)𝑀)) |
| 23 | muladdmodid 13933 | . . 3 ⊢ ((1 ∈ ℤ ∧ 𝑀 ∈ ℝ+ ∧ 𝐴 ∈ (0[,)𝑀)) → (((1 · 𝑀) + 𝐴) mod 𝑀) = 𝐴) | |
| 24 | 7, 9, 22, 23 | syl3anc 1392 | . 2 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → (((1 · 𝑀) + 𝐴) mod 𝑀) = 𝐴) |
| 25 | 6, 24 | eqtrd 2798 | 1 ⊢ ((𝐴 ∈ ℕ0 ∧ 𝑀 ∈ ℕ ∧ 𝐴 < 𝑀) → ((𝑀 + 𝐴) mod 𝑀) = 𝐴) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ↔ wb 208 ∧ w3a 1099 = wceq 1561 ∈ wcel 2143 class class class wbr 5101 (class class class)co 7396 0cc0 11084 1c1 11085 + caddc 11087 · cmul 11089 ℝ*cxr 11226 < clt 11227 ≤ cle 11228 ℕcn 12220 ℕ0cn0 12491 ℤcz 12578 ℝ+crp 13003 [,)cico 13361 mod cmo 13889 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1816 ax-4 1830 ax-5 1931 ax-6 1988 ax-7 2029 ax-8 2145 ax-9 2153 ax-10 2176 ax-11 2192 ax-12 2213 ax-ext 2735 ax-sep 5247 ax-nul 5257 ax-pow 5323 ax-pr 5391 ax-un 7718 ax-cnex 11140 ax-resscn 11141 ax-1cn 11142 ax-icn 11143 ax-addcl 11144 ax-addrcl 11145 ax-mulcl 11146 ax-mulrcl 11147 ax-mulcom 11148 ax-addass 11149 ax-mulass 11150 ax-distr 11151 ax-i2m1 11152 ax-1ne0 11153 ax-1rid 11154 ax-rnegex 11155 ax-rrecex 11156 ax-cnre 11157 ax-pre-lttri 11158 ax-pre-lttrn 11159 ax-pre-ltadd 11160 ax-pre-mulgt0 11161 ax-pre-sup 11162 |
| This theorem depends on definitions: df-bi 209 df-an 400 df-or 859 df-3or 1100 df-3an 1101 df-tru 1564 df-fal 1574 df-ex 1801 df-nf 1805 df-sb 2092 df-mo 2567 df-eu 2597 df-clab 2742 df-cleq 2755 df-clel 2838 df-nfc 2912 df-ne 2959 df-nel 3063 df-ral 3078 df-rex 3088 df-rmo 3368 df-reu 3369 df-rab 3416 df-v 3457 df-sbc 3746 df-csb 3854 df-dif 3908 df-un 3910 df-in 3912 df-ss 3922 df-pss 3925 df-nul 4287 df-if 4482 df-pw 4558 df-sn 4584 df-pr 4586 df-op 4590 df-uni 4867 df-iun 4952 df-br 5102 df-opab 5164 df-mpt 5183 df-tr 5209 df-id 5543 df-eprel 5548 df-po 5556 df-so 5557 df-fr 5601 df-we 5603 df-xp 5654 df-rel 5655 df-cnv 5656 df-co 5657 df-dm 5658 df-rn 5659 df-res 5660 df-ima 5661 df-pred 6288 df-ord 6349 df-on 6350 df-lim 6351 df-suc 6352 df-iota 6477 df-fun 6523 df-fn 6524 df-f 6525 df-f1 6526 df-fo 6527 df-f1o 6528 df-fv 6529 df-riota 7353 df-ov 7399 df-oprab 7400 df-mpo 7401 df-om 7847 df-2nd 7971 df-frecs 8262 df-wrecs 8293 df-recs 8342 df-rdg 8381 df-er 8678 df-en 8928 df-dom 8929 df-sdom 8930 df-sup 9386 df-inf 9387 df-pnf 11229 df-mnf 11230 df-xr 11231 df-ltxr 11232 df-le 11233 df-sub 11427 df-neg 11428 df-div 11856 df-nn 12221 df-n0 12492 df-z 12579 df-uz 12850 df-rp 13004 df-ico 13365 df-fl 13812 df-mod 13890 |
| This theorem is referenced by: addmodidr 13943 cshwidxn 14832 eucrctshift 30452 ex-mod 30658 8mod5e3 47951 gpgedgvtx1 48675 |
| Copyright terms: Public domain | W3C validator |