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

Theorem modval 13869
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 7440 . . . 4 (๐‘ฅ = ๐ด โ†’ (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐‘ฆ)))
21oveq2d 7433 . . 3 (๐‘ฅ = ๐ด โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ))) = (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))))
3 oveq12 7426 . . 3 ((๐‘ฅ = ๐ด โˆง (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ))) = (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))) โ†’ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))) = (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))))
42, 3mpdan 685 . 2 (๐‘ฅ = ๐ด โ†’ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))) = (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))))
5 oveq2 7425 . . . . 5 (๐‘ฆ = ๐ต โ†’ (๐ด / ๐‘ฆ) = (๐ด / ๐ต))
65fveq2d 6898 . . . 4 (๐‘ฆ = ๐ต โ†’ (โŒŠโ€˜(๐ด / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐ต)))
7 oveq12 7426 . . . 4 ((๐‘ฆ = ๐ต โˆง (โŒŠโ€˜(๐ด / ๐‘ฆ)) = (โŒŠโ€˜(๐ด / ๐ต))) โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))) = (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต))))
86, 7mpdan 685 . . 3 (๐‘ฆ = ๐ต โ†’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ))) = (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต))))
98oveq2d 7433 . 2 (๐‘ฆ = ๐ต โ†’ (๐ด โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐ด / ๐‘ฆ)))) = (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))))
10 df-mod 13868 . 2 mod = (๐‘ฅ โˆˆ โ„, ๐‘ฆ โˆˆ โ„+ โ†ฆ (๐‘ฅ โˆ’ (๐‘ฆ ยท (โŒŠโ€˜(๐‘ฅ / ๐‘ฆ)))))
11 ovex 7450 . 2 (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))) โˆˆ V
124, 9, 10, 11ovmpo 7579 1 ((๐ด โˆˆ โ„ โˆง ๐ต โˆˆ โ„+) โ†’ (๐ด mod ๐ต) = (๐ด โˆ’ (๐ต ยท (โŒŠโ€˜(๐ด / ๐ต)))))
Colors of variables: wff setvar class
Syntax hints:   โ†’ wi 4   โˆง wa 394   = wceq 1533   โˆˆ wcel 2098  โ€˜cfv 6547  (class class class)co 7417  โ„cr 11137   ยท cmul 11143   โˆ’ cmin 11474   / cdiv 11901  โ„+crp 13006  โŒŠcfl 13788   mod cmo 13867
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1789  ax-4 1803  ax-5 1905  ax-6 1963  ax-7 2003  ax-8 2100  ax-9 2108  ax-10 2129  ax-11 2146  ax-12 2166  ax-ext 2696  ax-sep 5299  ax-nul 5306  ax-pr 5428
This theorem depends on definitions:  df-bi 206  df-an 395  df-or 846  df-3an 1086  df-tru 1536  df-fal 1546  df-ex 1774  df-nf 1778  df-sb 2060  df-mo 2528  df-eu 2557  df-clab 2703  df-cleq 2717  df-clel 2802  df-nfc 2877  df-ne 2931  df-ral 3052  df-rex 3061  df-rab 3420  df-v 3465  df-sbc 3775  df-dif 3948  df-un 3950  df-ss 3962  df-nul 4324  df-if 4530  df-sn 4630  df-pr 4632  df-op 4636  df-uni 4909  df-br 5149  df-opab 5211  df-id 5575  df-xp 5683  df-rel 5684  df-cnv 5685  df-co 5686  df-dm 5687  df-iota 6499  df-fun 6549  df-fv 6555  df-ov 7420  df-oprab 7421  df-mpo 7422  df-mod 13868
This theorem is referenced by:  modvalr  13870  modcl  13871  mod0  13874  modge0  13877  modlt  13878  moddiffl  13880  modfrac  13882  modmulnn  13887  zmodcl  13889  modid  13894  modcyc  13904  modadd1  13906  modmul1  13922  moddi  13937  modsubdir  13938  modirr  13940  iexpcyc  14203  digit2  14231  dvdsmod  16306  divalgmod  16383  modgcd  16508  bezoutlem3  16517  prmdiv  16754  odzdvds  16764  fldivp1  16866  mulgmodid  19073  odmodnn0  19500  odmod  19506  gexdvds  19544  zringlpirlem3  21395  sineq0  26489  efif1olem2  26508  lgseisenlem4  27342  dchrisumlem1  27453  ostth2lem2  27598  sineq0ALT  44458  ltmod  45106  fourierswlem  45698
  Copyright terms: Public domain W3C validator