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

Theorem modval 13860
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.)
Assertion
Ref Expression
modval ((๐ด โˆˆ โ„ โˆง ๐ต โˆˆ โ„+) โ†’ (๐ด mod ๐ต) = (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))))

Proof of Theorem modval
Dummy variables ๐‘ฅ ๐‘ฆ are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 fvoveq1 7437 . . . 4 (๐‘ฅ = ๐ด โ†’ (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐‘ฆ)))
21oveq2d 7430 . . 3 (๐‘ฅ = ๐ด โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ))) = (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))))
3 oveq12 7423 . . 3 ((๐‘ฅ = ๐ด โˆง (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ))) = (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))) โ†’ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))) = (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))))
42, 3mpdan 686 . 2 (๐‘ฅ = ๐ด โ†’ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))) = (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))))
5 oveq2 7422 . . . . 5 (๐‘ฆ = ๐ต โ†’ (๐ด / ๐‘ฆ) = (๐ด / ๐ต))
65fveq2d 6895 . . . 4 (๐‘ฆ = ๐ต โ†’ (โŒŠโ€˜(๐ด / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐ต)))
7 oveq12 7423 . . . 4 ((๐‘ฆ = ๐ต โˆง (โŒŠโ€˜(๐ด / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐ต))) โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))) = (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต))))
86, 7mpdan 686 . . 3 (๐‘ฆ = ๐ต โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))) = (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต))))
98oveq2d 7430 . 2 (๐‘ฆ = ๐ต โ†’ (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))) = (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))))
10 df-mod 13859 . 2 mod = (๐‘ฅ โˆˆ โ„, ๐‘ฆ โˆˆ โ„+ โ†ฆ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))))
11 ovex 7447 . 2 (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))) โˆˆ V
124, 9, 10, 11ovmpo 7575 1 ((๐ด โˆˆ โ„ โˆง ๐ต โˆˆ โ„+) โ†’ (๐ด mod ๐ต) = (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))))
Colors of variables: wff setvar class
Syntax hints:   โ†’ wi 4   โˆง wa 395   = wceq 1534   โˆˆ wcel 2099  โ€˜cfv 6542  (class class class)co 7414  โ„cr 11129   ยท cmul 11135   โˆ’ cmin 11466   / cdiv 11893  โ„+crp 12998  โŒŠcfl 13779   mod cmo 13858
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1790  ax-4 1804  ax-5 1906  ax-6 1964  ax-7 2004  ax-8 2101  ax-9 2109  ax-10 2130  ax-11 2147  ax-12 2164  ax-ext 2698  ax-sep 5293  ax-nul 5300  ax-pr 5423
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 847  df-3an 1087  df-tru 1537  df-fal 1547  df-ex 1775  df-nf 1779  df-sb 2061  df-mo 2529  df-eu 2558  df-clab 2705  df-cleq 2719  df-clel 2805  df-nfc 2880  df-ne 2936  df-ral 3057  df-rex 3066  df-rab 3428  df-v 3471  df-sbc 3775  df-dif 3947  df-un 3949  df-in 3951  df-ss 3961  df-nul 4319  df-if 4525  df-sn 4625  df-pr 4627  df-op 4631  df-uni 4904  df-br 5143  df-opab 5205  df-id 5570  df-xp 5678  df-rel 5679  df-cnv 5680  df-co 5681  df-dm 5682  df-iota 6494  df-fun 6544  df-fv 6550  df-ov 7417  df-oprab 7418  df-mpo 7419  df-mod 13859
This theorem is referenced by:  modvalr  13861  modcl  13862  mod0  13865  modge0  13868  modlt  13869  moddiffl  13871  modfrac  13873  modmulnn  13878  zmodcl  13880  modid  13885  modcyc  13895  modadd1  13897  modmul1  13913  moddi  13928  modsubdir  13929  modirr  13931  iexpcyc  14194  digit2  14222  dvdsmod  16297  divalgmod  16374  modgcd  16499  bezoutlem3  16508  prmdiv  16745  odzdvds  16755  fldivp1  16857  mulgmodid  19059  odmodnn0  19486  odmod  19492  gexdvds  19530  zringlpirlem3  21377  sineq0  26445  efif1olem2  26464  lgseisenlem4  27298  dchrisumlem1  27409  ostth2lem2  27554  sineq0ALT  44299  ltmod  44949  fourierswlem  45541
  Copyright terms: Public domain W3C validator