HomeHome Metamath Proof Explorer < Previous   Next >
Related theorems
Unicode version

Theorem modval 7501
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.)
Assertion
Ref Expression
modval |- ((A e. RR /\ B e. RR+) -> (A mod B) = (A - (B x. (|_` (A / B)))))

Proof of Theorem modval
StepHypRef Expression
1 oprex 4907 . 2 |- (A - (B x. (|_` (A / B)))) e. _V
2 id 73 . . 3 |- (x = A -> x = A)
3 opreq1 4889 . . . . 5 |- (x = A -> (x / y) = (A / y))
43fveq2d 4685 . . . 4 |- (x = A -> (|_` (x / y)) = (|_` (A / y)))
54opreq2d 4898 . . 3 |- (x = A -> (y x. (|_` (x / y))) = (y x. (|_` (A / y))))
62, 5opreq12d 4900 . 2 |- (x = A -> (x - (y x. (|_` (x / y)))) = (A - (y x. (|_` (A / y)))))
7 id 73 . . . 4 |- (y = B -> y = B)
8 opreq2 4890 . . . . 5 |- (y = B -> (A / y) = (A / B))
98fveq2d 4685 . . . 4 |- (y = B -> (|_` (A / y)) = (|_` (A / B)))
107, 9opreq12d 4900 . . 3 |- (y = B -> (y x. (|_` (A / y))) = (B x. (|_` (A / B))))
1110opreq2d 4898 . 2 |- (y = B -> (A - (y x. (|_` (A / y)))) = (A - (B x. (|_` (A / B)))))
12 df-mod 7500 . 2 |- mod = {<.<.x, y>., z>. | ((x e. RR /\ y e. RR+) /\ z = (x - (y x. (|_` (x / y)))))}
131, 6, 11, 12oprabval2 4957 1 |- ((A e. RR /\ B e. RR+) -> (A mod B) = (A - (B x. (|_` (A / B)))))
Colors of variables: wff set class
Syntax hints:   -> wi 3   /\ wa 240   = wceq 1298   e. wcel 1300  ` cfv 3998  (class class class)co 4884  RRcr 6385   x. cmul 6391   - cmin 6445   / cdiv 6447  RR+crp 6453  |_cfl 7462   mod cmo 7499
This theorem is referenced by:  modcl 7502  modge0 7503  modlt 7504  modfrac 7505  modmulnn 7510  zmodcl 7511  modid 7512  modcyc 7516  modadd1 7518  modmul1 7519  moddi 7520  modsubdir 7521  modirr 7522  digit2 7904  gxmodid 9402  divalgmod 13709  modgcd 13738  rdr 15781  mod0 15800
This theorem was proved from axioms:  ax-1 4  ax-2 5  ax-3 6  ax-mp 7  ax-7 1304  ax-gen 1305  ax-8 1306  ax-9 1307  ax-10 1308  ax-11 1309  ax-12 1310  ax-13 1311  ax-14 1312  ax-17 1317  ax-4 1319  ax-5o 1321  ax-6o 1324  ax-9o 1481  ax-10o 1500  ax-16 1580  ax-11o 1588  ax-ext 1865  ax-sep 3438  ax-nul 3445  ax-pow 3481  ax-pr 3524  ax-un 3790
This theorem depends on definitions:  df-bi 164  df-or 241  df-an 242  df-3an 860  df-ex 1327  df-sb 1536  df-eu 1775  df-mo 1776  df-clab 1872  df-cleq 1877  df-clel 1880  df-ne 2019  df-rex 2110  df-v 2294  df-sbc 2454  df-csb 2541  df-dif 2597  df-un 2600  df-in 2603  df-ss 2605  df-nul 2876  df-pw 3035  df-sn 3049  df-pr 3050  df-op 3053  df-uni 3178  df-br 3339  df-opab 3396  df-id 3586  df-xp 4000  df-rel 4001  df-cnv 4002  df-co 4003  df-dm 4004  df-rn 4005  df-res 4006  df-ima 4007  df-fun 4008  df-fv 4014  df-opr 4886  df-oprab 4887  df-mod 7500
Copyright terms: Public domain