| 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 7422 | . . . 4 ⊢ (𝑥 = 𝐴 → (⌊‘(𝑥 / 𝑦)) = (⌊‘(𝐴 / 𝑦))) | |
| 2 | 1 | oveq2d 7415 | . . 3 ⊢ (𝑥 = 𝐴 → (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) |
| 3 | oveq12 7408 | . . 3 ⊢ ((𝑥 = 𝐴 ∧ (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) | |
| 4 | 2, 3 | mpdan 687 | . 2 ⊢ (𝑥 = 𝐴 → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) |
| 5 | oveq2 7407 | . . . . 5 ⊢ (𝑦 = 𝐵 → (𝐴 / 𝑦) = (𝐴 / 𝐵)) | |
| 6 | 5 | fveq2d 6876 | . . . 4 ⊢ (𝑦 = 𝐵 → (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) |
| 7 | oveq12 7408 | . . . 4 ⊢ ((𝑦 = 𝐵 ∧ (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) | |
| 8 | 6, 7 | mpdan 687 | . . 3 ⊢ (𝑦 = 𝐵 → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) |
| 9 | 8 | oveq2d 7415 | . 2 ⊢ (𝑦 = 𝐵 → (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦)))) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
| 10 | df-mod 13876 | . 2 ⊢ mod = (𝑥 ∈ ℝ, 𝑦 ∈ ℝ+ ↦ (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦))))) | |
| 11 | ovex 7432 | . 2 ⊢ (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵)))) ∈ V | |
| 12 | 4, 9, 10, 11 | ovmpo 7561 | 1 ⊢ ((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ+) → (𝐴 mod 𝐵) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ∧ wa 395 = wceq 1539 ∈ wcel 2107 ‘cfv 6527 (class class class)co 7399 ℝcr 11120 · cmul 11126 − cmin 11458 / cdiv 11886 ℝ+crp 13000 ⌊cfl 13796 mod cmo 13875 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1794 ax-4 1808 ax-5 1909 ax-6 1966 ax-7 2006 ax-8 2109 ax-9 2117 ax-10 2140 ax-11 2156 ax-12 2176 ax-ext 2706 ax-sep 5263 ax-nul 5273 ax-pr 5399 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3an 1088 df-tru 1542 df-fal 1552 df-ex 1779 df-nf 1783 df-sb 2064 df-mo 2538 df-eu 2567 df-clab 2713 df-cleq 2726 df-clel 2808 df-nfc 2884 df-ne 2932 df-ral 3051 df-rex 3060 df-rab 3414 df-v 3459 df-sbc 3764 df-dif 3927 df-un 3929 df-ss 3941 df-nul 4307 df-if 4499 df-sn 4600 df-pr 4602 df-op 4606 df-uni 4881 df-br 5117 df-opab 5179 df-id 5545 df-xp 5657 df-rel 5658 df-cnv 5659 df-co 5660 df-dm 5661 df-iota 6480 df-fun 6529 df-fv 6535 df-ov 7402 df-oprab 7403 df-mpo 7404 df-mod 13876 |
| This theorem is referenced by: modvalr 13878 modcl 13879 mod0 13882 modge0 13885 modlt 13886 moddiffl 13888 modfrac 13890 modmulnn 13895 zmodcl 13897 modid 13902 modcyc 13912 modadd1 13914 modmul1 13931 moddi 13946 modsubdir 13947 modirr 13949 iexpcyc 14213 digit2 14242 dvdsmod 16333 divalgmod 16410 modgcd 16536 bezoutlem3 16545 prmdiv 16789 odzdvds 16800 fldivp1 16902 mulgmodid 19081 odmodnn0 19506 odmod 19512 gexdvds 19550 zringlpirlem3 21410 sineq0 26469 efif1olem2 26488 lgseisenlem4 27325 dchrisumlem1 27436 ostth2lem2 27581 sineq0ALT 44888 ltmod 45597 fourierswlem 46189 |
| Copyright terms: Public domain | W3C validator |