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

Theorem modval 10991
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 5881 . . . . 5  |-  ( x  =  A  ->  (
x  /  y )  =  ( A  / 
y ) )
21fveq2d 5545 . . . 4  |-  ( x  =  A  ->  ( |_ `  ( x  / 
y ) )  =  ( |_ `  ( A  /  y ) ) )
32oveq2d 5890 . . 3  |-  ( x  =  A  ->  (
y  x.  ( |_
`  ( x  / 
y ) ) )  =  ( y  x.  ( |_ `  ( A  /  y ) ) ) )
4 oveq12 5883 . . 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 5882 . . . . 5  |-  ( y  =  B  ->  ( A  /  y )  =  ( A  /  B
) )
76fveq2d 5545 . . . 4  |-  ( y  =  B  ->  ( |_ `  ( A  / 
y ) )  =  ( |_ `  ( A  /  B ) ) )
8 oveq12 5883 . . . 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 5890 . 2  |-  ( y  =  B  ->  ( A  -  ( y  x.  ( |_ `  ( A  /  y ) ) ) )  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B
) ) ) ) )
11 df-mod 10990 . 2  |-  mod  =  ( x  e.  RR ,  y  e.  RR+  |->  ( x  -  ( y  x.  ( |_ `  (
x  /  y ) ) ) ) )
12 ovex 5899 . 2  |-  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) )  e.  _V
135, 10, 11, 12ovmpt2 5999 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 1632    e. wcel 1696   ` cfv 5271  (class class class)co 5874   RRcr 8752    x. cmul 8758    - cmin 9053    / cdiv 9439   RR+crp 10370   |_cfl 10940    mod cmo 10989
This theorem is referenced by:  modcl  10992  mod0  10994  modge0  10996  modlt  10997  moddiffl  10998  modfrac  11000  modmulnn  11004  zmodcl  11005  modid  11009  modcyc  11015  modadd1  11017  modmul1  11018  moddi  11023  modsubdir  11024  modirr  11025  iexpcyc  11223  digit2  11250  dvdsmod  12601  divalgmod  12621  modgcd  12731  bezoutlem3  12735  prmdiv  12869  odzdvds  12876  fldivp1  12961  odmodnn0  14871  odmod  14877  gexdvds  14911  zlpirlem3  16459  sineq0  19905  efif1olem2  19921  lgseisenlem4  20607  dchrisumlem1  20654  ostth2lem2  20799  gxmodid  20962  rdr  26538
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pr 4230
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-ral 2561  df-rex 2562  df-rab 2565  df-v 2803  df-sbc 3005  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-nul 3469  df-if 3579  df-sn 3659  df-pr 3660  df-op 3662  df-uni 3844  df-br 4040  df-opab 4094  df-id 4325  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-iota 5235  df-fun 5273  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-mod 10990
  Copyright terms: Public domain W3C validator