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

Theorem modsubdir 12058
Description: Distribute the modulo operation over a subtraction. (Contributed by NM, 30-Dec-2008.)
Assertion
Ref Expression
modsubdir  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( B  mod  C
)  <_  ( A  mod  C )  <->  ( ( A  -  B )  mod  C )  =  ( ( A  mod  C
)  -  ( B  mod  C ) ) ) )

Proof of Theorem modsubdir
StepHypRef Expression
1 modcl 12003 . . . 4  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  e.  RR )
213adant2 1015 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  e.  RR )
3 modcl 12003 . . . 4  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  e.  RR )
433adant1 1014 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  e.  RR )
52, 4subge0d 10163 . 2  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
0  <_  ( ( A  mod  C )  -  ( B  mod  C ) )  <->  ( B  mod  C )  <_  ( A  mod  C ) ) )
6 resubcl 9902 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR )  ->  ( A  -  B
)  e.  RR )
763adant3 1016 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  -  B )  e.  RR )
8 simp3 998 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR+ )
9 rerpdivcl 11272 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  /  C
)  e.  RR )
109flcld 11938 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  ZZ )
11103adant2 1015 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  ZZ )
12 rerpdivcl 11272 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  /  C
)  e.  RR )
1312flcld 11938 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  ZZ )
14133adant1 1014 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  ZZ )
1511, 14zsubcld 10995 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C
) ) )  e.  ZZ )
16 modcyc2 12035 . . . . . . 7  |-  ( ( ( A  -  B
)  e.  RR  /\  C  e.  RR+  /\  (
( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C
) ) )  e.  ZZ )  ->  (
( ( A  -  B )  -  ( C  x.  ( ( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  mod 
C )  =  ( ( A  -  B
)  mod  C )
)
177, 8, 15, 16syl3anc 1228 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( ( A  -  B )  -  ( C  x.  ( ( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  mod 
C )  =  ( ( A  -  B
)  mod  C )
)
18 recn 9599 . . . . . . . . . 10  |-  ( A  e.  RR  ->  A  e.  CC )
19183ad2ant1 1017 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  A  e.  CC )
20 recn 9599 . . . . . . . . . 10  |-  ( B  e.  RR  ->  B  e.  CC )
21203ad2ant2 1018 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  B  e.  CC )
22 rpre 11251 . . . . . . . . . . . . 13  |-  ( C  e.  RR+  ->  C  e.  RR )
2322adantl 466 . . . . . . . . . . . 12  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
24 refldivcl 11960 . . . . . . . . . . . 12  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  RR )
2523, 24remulcld 9641 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  RR )
2625recnd 9639 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  CC )
27263adant2 1015 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( A  /  C
) ) )  e.  CC )
2822adantl 466 . . . . . . . . . . . 12  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
29 refldivcl 11960 . . . . . . . . . . . 12  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  RR )
3028, 29remulcld 9641 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  RR )
3130recnd 9639 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  CC )
32313adant1 1014 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( B  /  C
) ) )  e.  CC )
3319, 21, 27, 32sub4d 9999 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  -  ( ( C  x.  ( |_
`  ( A  /  C ) ) )  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )  =  ( ( A  -  ( C  x.  ( |_ `  ( A  /  C ) ) ) )  -  ( B  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) ) )
34223ad2ant3 1019 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
3534recnd 9639 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  CC )
3624recnd 9639 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  CC )
37363adant2 1015 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  CC )
3829recnd 9639 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  CC )
39383adant1 1014 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  CC )
4035, 37, 39subdid 10033 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( ( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) )  =  ( ( C  x.  ( |_ `  ( A  /  C ) ) )  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )
4140oveq2d 6312 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  -  ( C  x.  ( ( |_
`  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  =  ( ( A  -  B )  -  (
( C  x.  ( |_ `  ( A  /  C ) ) )  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) ) )
42 modval 12001 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C ) ) ) ) )
43423adant2 1015 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C
) ) ) ) )
44 modval 12001 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )
45443adant1 1014 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C
) ) ) ) )
4643, 45oveq12d 6314 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  =  ( ( A  -  ( C  x.  ( |_ `  ( A  /  C ) ) ) )  -  ( B  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) ) )
4733, 41, 463eqtr4d 2508 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  -  ( C  x.  ( ( |_
`  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
4847oveq1d 6311 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( ( A  -  B )  -  ( C  x.  ( ( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  mod 
C )  =  ( ( ( A  mod  C )  -  ( B  mod  C ) )  mod  C ) )
4917, 48eqtr3d 2500 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  mod  C )  =  ( ( ( A  mod  C )  -  ( B  mod  C ) )  mod  C
) )
5049adantr 465 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( A  -  B
)  mod  C )  =  ( ( ( A  mod  C )  -  ( B  mod  C ) )  mod  C
) )
512, 4resubcld 10008 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  e.  RR )
5251adantr 465 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  e.  RR )
53 simpl3 1001 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  C  e.  RR+ )
54 simpr 461 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )
55 modge0 12008 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( B  mod  C ) )
56553adant1 1014 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( B  mod  C
) )
572, 4subge02d 10165 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
0  <_  ( B  mod  C )  <->  ( ( A  mod  C )  -  ( B  mod  C ) )  <_  ( A  mod  C ) ) )
5856, 57mpbid 210 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <_  ( A  mod  C ) )
59 modlt 12009 . . . . . . . 8  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  <  C )
60593adant2 1015 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  < 
C )
6151, 2, 34, 58, 60lelttrd 9757 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <  C )
6261adantr 465 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <  C )
63 modid 12023 . . . . 5  |-  ( ( ( ( ( A  mod  C )  -  ( B  mod  C ) )  e.  RR  /\  C  e.  RR+ )  /\  ( 0  <_  (
( A  mod  C
)  -  ( B  mod  C ) )  /\  ( ( A  mod  C )  -  ( B  mod  C ) )  <  C ) )  ->  ( (
( A  mod  C
)  -  ( B  mod  C ) )  mod  C )  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
6452, 53, 54, 62, 63syl22anc 1229 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( ( A  mod  C )  -  ( B  mod  C ) )  mod  C )  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
6550, 64eqtrd 2498 . . 3  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( A  -  B
)  mod  C )  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
66 modge0 12008 . . . . . 6  |-  ( ( ( A  -  B
)  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( ( A  -  B )  mod  C ) )
676, 66stoic3 1610 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( ( A  -  B )  mod  C
) )
6867adantr 465 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  ( ( A  -  B )  mod  C
)  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )  -> 
0  <_  ( ( A  -  B )  mod  C ) )
69 simpr 461 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  ( ( A  -  B )  mod  C
)  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )  -> 
( ( A  -  B )  mod  C
)  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
7068, 69breqtrd 4480 . . 3  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  ( ( A  -  B )  mod  C
)  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )  -> 
0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )
7165, 70impbida 832 . 2  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
0  <_  ( ( A  mod  C )  -  ( B  mod  C ) )  <->  ( ( A  -  B )  mod 
C )  =  ( ( A  mod  C
)  -  ( B  mod  C ) ) ) )
725, 71bitr3d 255 1  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( B  mod  C
)  <_  ( A  mod  C )  <->  ( ( A  -  B )  mod  C )  =  ( ( A  mod  C
)  -  ( B  mod  C ) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    /\ w3a 973    = wceq 1395    e. wcel 1819   class class class wbr 4456   ` cfv 5594  (class class class)co 6296   CCcc 9507   RRcr 9508   0cc0 9509    x. cmul 9514    < clt 9645    <_ cle 9646    - cmin 9824    / cdiv 10227   ZZcz 10885   RR+crp 11245   |_cfl 11930    mod cmo 11999
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-cnex 9565  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586  ax-pre-sup 9587
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1398  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4252  df-iun 4334  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-om 6700  df-recs 7060  df-rdg 7094  df-er 7329  df-en 7536  df-dom 7537  df-sdom 7538  df-sup 7919  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-div 10228  df-nn 10557  df-n0 10817  df-z 10886  df-uz 11107  df-rp 11246  df-fl 11932  df-mod 12000
This theorem is referenced by:  modeqmodmin  12059  digit1  12303  4sqlem12  14486
  Copyright terms: Public domain W3C validator