| 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 7376 | . . . 4 ⊢ (𝑥 = 𝐴 → (⌊‘(𝑥 / 𝑦)) = (⌊‘(𝐴 / 𝑦))) | |
| 2 | 1 | oveq2d 7369 | . . 3 ⊢ (𝑥 = 𝐴 → (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) |
| 3 | oveq12 7362 | . . 3 ⊢ ((𝑥 = 𝐴 ∧ (𝑦 · (⌊‘(𝑥 / 𝑦))) = (𝑦 · (⌊‘(𝐴 / 𝑦)))) → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) | |
| 4 | 2, 3 | mpdan 687 | . 2 ⊢ (𝑥 = 𝐴 → (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦)))) = (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦))))) |
| 5 | oveq2 7361 | . . . . 5 ⊢ (𝑦 = 𝐵 → (𝐴 / 𝑦) = (𝐴 / 𝐵)) | |
| 6 | 5 | fveq2d 6830 | . . . 4 ⊢ (𝑦 = 𝐵 → (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) |
| 7 | oveq12 7362 | . . . 4 ⊢ ((𝑦 = 𝐵 ∧ (⌊‘(𝐴 / 𝑦)) = (⌊‘(𝐴 / 𝐵))) → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) | |
| 8 | 6, 7 | mpdan 687 | . . 3 ⊢ (𝑦 = 𝐵 → (𝑦 · (⌊‘(𝐴 / 𝑦))) = (𝐵 · (⌊‘(𝐴 / 𝐵)))) |
| 9 | 8 | oveq2d 7369 | . 2 ⊢ (𝑦 = 𝐵 → (𝐴 − (𝑦 · (⌊‘(𝐴 / 𝑦)))) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
| 10 | df-mod 13792 | . 2 ⊢ mod = (𝑥 ∈ ℝ, 𝑦 ∈ ℝ+ ↦ (𝑥 − (𝑦 · (⌊‘(𝑥 / 𝑦))))) | |
| 11 | ovex 7386 | . 2 ⊢ (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵)))) ∈ V | |
| 12 | 4, 9, 10, 11 | ovmpo 7513 | 1 ⊢ ((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ+) → (𝐴 mod 𝐵) = (𝐴 − (𝐵 · (⌊‘(𝐴 / 𝐵))))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ∧ wa 395 = wceq 1540 ∈ wcel 2109 ‘cfv 6486 (class class class)co 7353 ℝcr 11027 · cmul 11033 − cmin 11365 / cdiv 11795 ℝ+crp 12911 ⌊cfl 13712 mod cmo 13791 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1795 ax-4 1809 ax-5 1910 ax-6 1967 ax-7 2008 ax-8 2111 ax-9 2119 ax-10 2142 ax-11 2158 ax-12 2178 ax-ext 2701 ax-sep 5238 ax-nul 5248 ax-pr 5374 |
| This theorem depends on definitions: df-bi 207 df-an 396 df-or 848 df-3an 1088 df-tru 1543 df-fal 1553 df-ex 1780 df-nf 1784 df-sb 2066 df-mo 2533 df-eu 2562 df-clab 2708 df-cleq 2721 df-clel 2803 df-nfc 2878 df-ne 2926 df-ral 3045 df-rex 3054 df-rab 3397 df-v 3440 df-sbc 3745 df-dif 3908 df-un 3910 df-ss 3922 df-nul 4287 df-if 4479 df-sn 4580 df-pr 4582 df-op 4586 df-uni 4862 df-br 5096 df-opab 5158 df-id 5518 df-xp 5629 df-rel 5630 df-cnv 5631 df-co 5632 df-dm 5633 df-iota 6442 df-fun 6488 df-fv 6494 df-ov 7356 df-oprab 7357 df-mpo 7358 df-mod 13792 |
| This theorem is referenced by: modvalr 13794 modcl 13795 mod0 13798 modge0 13801 modlt 13802 moddiffl 13804 modfrac 13806 modmulnn 13811 zmodcl 13813 modid 13818 modcyc 13828 modadd1 13830 modmul1 13849 moddi 13864 modsubdir 13865 modirr 13867 iexpcyc 14132 digit2 14161 dvdsmod 16258 divalgmod 16335 modgcd 16461 bezoutlem3 16470 prmdiv 16714 odzdvds 16725 fldivp1 16827 mulgmodid 19010 odmodnn0 19437 odmod 19443 gexdvds 19481 zringlpirlem3 21389 sineq0 26449 efif1olem2 26468 lgseisenlem4 27305 dchrisumlem1 27416 ostth2lem2 27561 sineq0ALT 44910 ltmod 45620 fourierswlem 46212 |
| Copyright terms: Public domain | W3C validator |