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

Theorem modsubdir 11287
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 11255 . . . 4  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  e.  RR )
213adant2 977 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  e.  RR )
3 modcl 11255 . . . 4  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  e.  RR )
433adant1 976 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  e.  RR )
52, 4subge0d 9618 . 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 9367 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR )  ->  ( A  -  B
)  e.  RR )
763adant3 978 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  -  B )  e.  RR )
8 simp3 960 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR+ )
9 rerpdivcl 10641 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  /  C
)  e.  RR )
109flcld 11209 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  ZZ )
11103adant2 977 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  ZZ )
12 rerpdivcl 10641 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  /  C
)  e.  RR )
1312flcld 11209 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  ZZ )
14133adant1 976 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  ZZ )
1511, 14zsubcld 10382 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C
) ) )  e.  ZZ )
16 modcyc2 11279 . . . . . . 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 1185 . . . . . 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 9082 . . . . . . . . . 10  |-  ( A  e.  RR  ->  A  e.  CC )
19183ad2ant1 979 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  A  e.  CC )
20 recn 9082 . . . . . . . . . 10  |-  ( B  e.  RR  ->  B  e.  CC )
21203ad2ant2 980 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  B  e.  CC )
22 rpre 10620 . . . . . . . . . . . . 13  |-  ( C  e.  RR+  ->  C  e.  RR )
2322adantl 454 . . . . . . . . . . . 12  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
24 reflcl 11207 . . . . . . . . . . . . 13  |-  ( ( A  /  C )  e.  RR  ->  ( |_ `  ( A  /  C ) )  e.  RR )
259, 24syl 16 . . . . . . . . . . . 12  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  RR )
2623, 25remulcld 9118 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  RR )
2726recnd 9116 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  CC )
28273adant2 977 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( A  /  C
) ) )  e.  CC )
2922adantl 454 . . . . . . . . . . . 12  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
30 reflcl 11207 . . . . . . . . . . . . 13  |-  ( ( B  /  C )  e.  RR  ->  ( |_ `  ( B  /  C ) )  e.  RR )
3112, 30syl 16 . . . . . . . . . . . 12  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  RR )
3229, 31remulcld 9118 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  RR )
3332recnd 9116 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  CC )
34333adant1 976 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( B  /  C
) ) )  e.  CC )
3519, 21, 28, 34sub4d 9462 . . . . . . . 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 ) ) ) ) ) )
36223ad2ant3 981 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
3736recnd 9116 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  CC )
3825recnd 9116 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  CC )
39383adant2 977 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  CC )
4031recnd 9116 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  CC )
41403adant1 976 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  CC )
4237, 39, 41subdid 9491 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( ( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) )  =  ( ( C  x.  ( |_ `  ( A  /  C ) ) )  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )
4342oveq2d 6099 . . . . . . . 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 ) ) ) ) ) )
44 modval 11254 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C ) ) ) ) )
45443adant2 977 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C
) ) ) ) )
46 modval 11254 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )
47463adant1 976 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C
) ) ) ) )
4845, 47oveq12d 6101 . . . . . . . 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 ) ) ) ) ) )
4935, 43, 483eqtr4d 2480 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  -  ( C  x.  ( ( |_
`  ( A  /  C ) )  -  ( |_ `  ( B  /  C ) ) ) ) )  =  ( ( A  mod  C )  -  ( B  mod  C ) ) )
5049oveq1d 6098 . . . . . 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 ) )
5117, 50eqtr3d 2472 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  mod  C )  =  ( ( ( A  mod  C )  -  ( B  mod  C ) )  mod  C
) )
5251adantr 453 . . . 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
) )
532, 4resubcld 9467 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  e.  RR )
5453adantr 453 . . . . 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 )
55 simpl3 963 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  C  e.  RR+ )
56 simpr 449 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )
57 modge0 11259 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( B  mod  C ) )
58573adant1 976 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( B  mod  C
) )
592, 4subge02d 9620 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
0  <_  ( B  mod  C )  <->  ( ( A  mod  C )  -  ( B  mod  C ) )  <_  ( A  mod  C ) ) )
6058, 59mpbid 203 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <_  ( A  mod  C ) )
61 modlt 11260 . . . . . . . 8  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  <  C )
62613adant2 977 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  < 
C )
6353, 2, 36, 60, 62lelttrd 9230 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <  C )
6463adantr 453 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <  C )
65 modid 11272 . . . . 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 ) ) )
6654, 55, 56, 64, 65syl22anc 1186 . . . 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 ) ) )
6752, 66eqtrd 2470 . . 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 ) ) )
68 modge0 11259 . . . . . . 7  |-  ( ( ( A  -  B
)  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( ( A  -  B )  mod  C ) )
696, 68sylan 459 . . . . . 6  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  C  e.  RR+ )  ->  0  <_  (
( A  -  B
)  mod  C )
)
70693impa 1149 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( ( A  -  B )  mod  C
) )
7170adantr 453 . . . 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 ) )
72 simpr 449 . . . 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 ) ) )
7371, 72breqtrd 4238 . . 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 ) ) )
7467, 73impbida 807 . 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 ) ) ) )
755, 74bitr3d 248 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 set class
Syntax hints:    -> wi 4    <-> wb 178    /\ wa 360    /\ w3a 937    = wceq 1653    e. wcel 1726   class class class wbr 4214   ` cfv 5456  (class class class)co 6083   CCcc 8990   RRcr 8991   0cc0 8992    x. cmul 8997    < clt 9122    <_ cle 9123    - cmin 9293    / cdiv 9679   ZZcz 10284   RR+crp 10614   |_cfl 11203    mod cmo 11252
This theorem is referenced by:  digit1  11515  4sqlem12  13326
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-cnex 9048  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069  ax-pre-sup 9070
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-riota 6551  df-recs 6635  df-rdg 6670  df-er 6907  df-en 7112  df-dom 7113  df-sdom 7114  df-sup 7448  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-div 9680  df-nn 10003  df-n0 10224  df-z 10285  df-uz 10491  df-rp 10615  df-fl 11204  df-mod 11253
  Copyright terms: Public domain W3C validator