Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
||
Mirrors > Home > MPE Home > Th. List > modval | Structured version Visualization version GIF version |
Description: The value of the modulo operation. The modulo congruence notation of number theory, 𝐽≡𝐾 (modulo 𝑁), can be expressed in our notation as (𝐽 mod 𝑁) = (𝐾 mod 𝑁). Definition 1 in Knuth, The Art of Computer Programming, Vol. I (1972), p. 38. Knuth uses "mod" for the operation and "modulo" for the congruence. Unlike Knuth, we restrict the second argument to positive reals to simplify certain theorems. (This also gives us future flexibility to extend it to any one of several different conventions for a zero or negative second argument, should there be an advantage in doing so.) (Contributed by NM, 10-Nov-2008.) (Revised by Mario Carneiro, 3-Nov-2013.) |
Ref | Expression |
---|---|
modval | ⊢ ((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ+) → (𝐴 mod 𝐵) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | fvoveq1 7181 | . . . 4 ⊢ (𝑥 = 𝐴 → (⌊‘(𝑥 / 𝑦)) = (⌊‘(𝐴 / 𝑦))) | |
2 | 1 | oveq2d 7174 | . . 3 ⊢ (𝑥 = 𝐴 → (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) |
3 | oveq12 7167 | . . 3 ⊢ ((𝑥 = 𝐴 ∧ (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) | |
4 | 2, 3 | mpdan 685 | . 2 ⊢ (𝑥 = 𝐴 → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) |
5 | oveq2 7166 | . . . . 5 ⊢ (𝑦 = 𝐵 → (𝐴 / 𝑦) = (𝐴 / 𝐵)) | |
6 | 5 | fveq2d 6676 | . . . 4 ⊢ (𝑦 = 𝐵 → (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) |
7 | oveq12 7167 | . . . 4 ⊢ ((𝑦 = 𝐵 ∧ (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) | |
8 | 6, 7 | mpdan 685 | . . 3 ⊢ (𝑦 = 𝐵 → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) |
9 | 8 | oveq2d 7174 | . 2 ⊢ (𝑦 = 𝐵 → (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦)))) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
10 | df-mod 13241 | . 2 ⊢ mod = (𝑥 ∈ ℝ, 𝑦 ∈ ℝ+ ↦ (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦))))) | |
11 | ovex 7191 | . 2 ⊢ (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵)))) ∈ V | |
12 | 4, 9, 10, 11 | ovmpo 7312 | 1 ⊢ ((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ+) → (𝐴 mod 𝐵) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ∧ wa 398 = wceq 1537 ∈ wcel 2114 ‘cfv 6357 (class class class)co 7158 ℝcr 10538 · cmul 10544 − cmin 10872 / cdiv 11299 ℝ+crp 12392 ⌊cfl 13163 mod cmo 13240 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1796 ax-4 1810 ax-5 1911 ax-6 1970 ax-7 2015 ax-8 2116 ax-9 2124 ax-10 2145 ax-11 2161 ax-12 2177 ax-ext 2795 ax-sep 5205 ax-nul 5212 ax-pr 5332 |
This theorem depends on definitions: df-bi 209 df-an 399 df-or 844 df-3an 1085 df-tru 1540 df-ex 1781 df-nf 1785 df-sb 2070 df-mo 2622 df-eu 2654 df-clab 2802 df-cleq 2816 df-clel 2895 df-nfc 2965 df-ral 3145 df-rex 3146 df-rab 3149 df-v 3498 df-sbc 3775 df-dif 3941 df-un 3943 df-in 3945 df-ss 3954 df-nul 4294 df-if 4470 df-sn 4570 df-pr 4572 df-op 4576 df-uni 4841 df-br 5069 df-opab 5131 df-id 5462 df-xp 5563 df-rel 5564 df-cnv 5565 df-co 5566 df-dm 5567 df-iota 6316 df-fun 6359 df-fv 6365 df-ov 7161 df-oprab 7162 df-mpo 7163 df-mod 13241 |
This theorem is referenced by: modvalr 13243 modcl 13244 mod0 13247 modge0 13250 modlt 13251 moddiffl 13253 modfrac 13255 modmulnn 13260 zmodcl 13262 modid 13267 modcyc 13277 modadd1 13279 modmul1 13295 moddi 13310 modsubdir 13311 modirr 13313 iexpcyc 13572 digit2 13600 dvdsmod 15680 divalgmod 15759 modgcd 15882 bezoutlem3 15891 prmdiv 16124 odzdvds 16134 fldivp1 16235 mulgmodid 18268 odmodnn0 18670 odmod 18676 gexdvds 18711 zringlpirlem3 20635 sineq0 25111 efif1olem2 25129 lgseisenlem4 25956 dchrisumlem1 26067 ostth2lem2 26212 sineq0ALT 41278 ltmod 41926 fourierswlem 42522 |
Copyright terms: Public domain | W3C validator |