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

Theorem modval 10975
Description: The value of the modulo operation. The modulo congruence notation of number theory,  J  ==  K ( modulo  N ), can be expressed in our notation as  ( J  mod  N )  =  ( K  mod  N ). 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  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( A  mod  B
)  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) ) )

Proof of Theorem modval
Dummy variables  x  y are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 oveq1 5865 . . . . 5  |-  ( x  =  A  ->  (
x  /  y )  =  ( A  / 
y ) )
21fveq2d 5529 . . . 4  |-  ( x  =  A  ->  ( |_ `  ( x  / 
y ) )  =  ( |_ `  ( A  /  y ) ) )
32oveq2d 5874 . . 3  |-  ( x  =  A  ->  (
y  x.  ( |_
`  ( x  / 
y ) ) )  =  ( y  x.  ( |_ `  ( A  /  y ) ) ) )
4 oveq12 5867 . . 3  |-  ( ( x  =  A  /\  ( y  x.  ( |_ `  ( x  / 
y ) ) )  =  ( y  x.  ( |_ `  ( A  /  y ) ) ) )  ->  (
x  -  ( y  x.  ( |_ `  ( x  /  y
) ) ) )  =  ( A  -  ( y  x.  ( |_ `  ( A  / 
y ) ) ) ) )
53, 4mpdan 649 . 2  |-  ( x  =  A  ->  (
x  -  ( y  x.  ( |_ `  ( x  /  y
) ) ) )  =  ( A  -  ( y  x.  ( |_ `  ( A  / 
y ) ) ) ) )
6 oveq2 5866 . . . . 5  |-  ( y  =  B  ->  ( A  /  y )  =  ( A  /  B
) )
76fveq2d 5529 . . . 4  |-  ( y  =  B  ->  ( |_ `  ( A  / 
y ) )  =  ( |_ `  ( A  /  B ) ) )
8 oveq12 5867 . . . 4  |-  ( ( y  =  B  /\  ( |_ `  ( A  /  y ) )  =  ( |_ `  ( A  /  B
) ) )  -> 
( y  x.  ( |_ `  ( A  / 
y ) ) )  =  ( B  x.  ( |_ `  ( A  /  B ) ) ) )
97, 8mpdan 649 . . 3  |-  ( y  =  B  ->  (
y  x.  ( |_
`  ( A  / 
y ) ) )  =  ( B  x.  ( |_ `  ( A  /  B ) ) ) )
109oveq2d 5874 . 2  |-  ( y  =  B  ->  ( A  -  ( y  x.  ( |_ `  ( A  /  y ) ) ) )  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B
) ) ) ) )
11 df-mod 10974 . 2  |-  mod  =  ( x  e.  RR ,  y  e.  RR+  |->  ( x  -  ( y  x.  ( |_ `  (
x  /  y ) ) ) ) )
12 ovex 5883 . 2  |-  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) )  e.  _V
135, 10, 11, 12ovmpt2 5983 1  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( A  mod  B
)  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    = wceq 1623    e. wcel 1684   ` cfv 5255  (class class class)co 5858   RRcr 8736    x. cmul 8742    - cmin 9037    / cdiv 9423   RR+crp 10354   |_cfl 10924    mod cmo 10973
This theorem is referenced by:  modcl  10976  mod0  10978  modge0  10980  modlt  10981  moddiffl  10982  modfrac  10984  modmulnn  10988  zmodcl  10989  modid  10993  modcyc  10999  modadd1  11001  modmul1  11002  moddi  11007  modsubdir  11008  modirr  11009  iexpcyc  11207  digit2  11234  dvdsmod  12585  divalgmod  12605  modgcd  12715  bezoutlem3  12719  prmdiv  12853  odzdvds  12860  fldivp1  12945  odmodnn0  14855  odmod  14861  gexdvds  14895  zlpirlem3  16443  sineq0  19889  efif1olem2  19905  lgseisenlem4  20591  dchrisumlem1  20638  ostth2lem2  20783  gxmodid  20946  rdr  26435
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pr 4214
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-ral 2548  df-rex 2549  df-rab 2552  df-v 2790  df-sbc 2992  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3456  df-if 3566  df-sn 3646  df-pr 3647  df-op 3649  df-uni 3828  df-br 4024  df-opab 4078  df-id 4309  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-iota 5219  df-fun 5257  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-mod 10974
  Copyright terms: Public domain W3C validator