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

Theorem modsubdir 11765
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 11710 . . . 4  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  e.  RR )
213adant2 1007 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  e.  RR )
3 modcl 11710 . . . 4  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  e.  RR )
433adant1 1006 . . 3  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  e.  RR )
52, 4subge0d 9927 . 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 9671 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR )  ->  ( A  -  B
)  e.  RR )
763adant3 1008 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  -  B )  e.  RR )
8 simp3 990 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR+ )
9 rerpdivcl 11016 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  /  C
)  e.  RR )
109flcld 11646 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  ZZ )
11103adant2 1007 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  ZZ )
12 rerpdivcl 11016 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  /  C
)  e.  RR )
1312flcld 11646 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  ZZ )
14133adant1 1006 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  ZZ )
1511, 14zsubcld 10750 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( |_ `  ( A  /  C ) )  -  ( |_ `  ( B  /  C
) ) )  e.  ZZ )
16 modcyc2 11742 . . . . . . 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 1218 . . . . . 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 9370 . . . . . . . . . 10  |-  ( A  e.  RR  ->  A  e.  CC )
19183ad2ant1 1009 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  A  e.  CC )
20 recn 9370 . . . . . . . . . 10  |-  ( B  e.  RR  ->  B  e.  CC )
21203ad2ant2 1010 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  B  e.  CC )
22 rpre 10995 . . . . . . . . . . . . 13  |-  ( C  e.  RR+  ->  C  e.  RR )
2322adantl 466 . . . . . . . . . . . 12  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
24 reflcl 11644 . . . . . . . . . . . . 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 9412 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  RR )
2726recnd 9410 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( A  /  C ) ) )  e.  CC )
28273adant2 1007 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( A  /  C
) ) )  e.  CC )
2922adantl 466 . . . . . . . . . . . 12  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
30 reflcl 11644 . . . . . . . . . . . . 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 9412 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  RR )
3332recnd 9410 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( C  x.  ( |_ `  ( B  /  C ) ) )  e.  CC )
34333adant1 1006 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( C  x.  ( |_ `  ( B  /  C
) ) )  e.  CC )
3519, 21, 28, 34sub4d 9766 . . . . . . . 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 1011 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  RR )
3736recnd 9410 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  C  e.  CC )
3825recnd 9410 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( A  /  C ) )  e.  CC )
39383adant2 1007 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( A  /  C ) )  e.  CC )
4031recnd 9410 . . . . . . . . . . 11  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( |_ `  ( B  /  C ) )  e.  CC )
41403adant1 1006 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( |_ `  ( B  /  C ) )  e.  CC )
4237, 39, 41subdid 9798 . . . . . . . . 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 6105 . . . . . . . 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 11708 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C ) ) ) ) )
45443adant2 1007 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  =  ( A  -  ( C  x.  ( |_ `  ( A  /  C
) ) ) ) )
46 modval 11708 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
( B  mod  C
)  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C ) ) ) ) )
47463adant1 1006 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( B  mod  C )  =  ( B  -  ( C  x.  ( |_ `  ( B  /  C
) ) ) ) )
4845, 47oveq12d 6107 . . . . . . . 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 2483 . . . . . . 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 6104 . . . . . 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 2475 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  -  B
)  mod  C )  =  ( ( ( A  mod  C )  -  ( B  mod  C ) )  mod  C
) )
5251adantr 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
) )
532, 4resubcld 9774 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  e.  RR )
5453adantr 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 )
55 simpl3 993 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  /\  0  <_  ( ( A  mod  C )  -  ( B  mod  C ) ) )  ->  C  e.  RR+ )
56 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 ) ) )
57 modge0 11715 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( B  mod  C ) )
58573adant1 1006 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( B  mod  C
) )
592, 4subge02d 9929 . . . . . . . 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 210 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <_  ( A  mod  C ) )
61 modlt 11716 . . . . . . . 8  |-  ( ( A  e.  RR  /\  C  e.  RR+ )  -> 
( A  mod  C
)  <  C )
62613adant2 1007 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  ( A  mod  C )  < 
C )
6353, 2, 36, 60, 62lelttrd 9527 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  (
( A  mod  C
)  -  ( B  mod  C ) )  <  C )
6463adantr 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 )
65 modid 11730 . . . . 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 1219 . . . 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 2473 . . 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 11715 . . . . . . 7  |-  ( ( ( A  -  B
)  e.  RR  /\  C  e.  RR+ )  -> 
0  <_  ( ( A  -  B )  mod  C ) )
696, 68sylan 471 . . . . . 6  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  C  e.  RR+ )  ->  0  <_  (
( A  -  B
)  mod  C )
)
70693impa 1182 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  RR  /\  C  e.  RR+ )  ->  0  <_  ( ( A  -  B )  mod  C
) )
7170adantr 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 ) )
72 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 ) ) )
7371, 72breqtrd 4314 . . 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 828 . 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 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 965    = wceq 1369    e. wcel 1756   class class class wbr 4290   ` cfv 5416  (class class class)co 6089   CCcc 9278   RRcr 9279   0cc0 9280    x. cmul 9285    < clt 9416    <_ cle 9417    - cmin 9593    / cdiv 9991   ZZcz 10644   RR+crp 10989   |_cfl 11638    mod cmo 11706
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2422  ax-sep 4411  ax-nul 4419  ax-pow 4468  ax-pr 4529  ax-un 6370  ax-cnex 9336  ax-resscn 9337  ax-1cn 9338  ax-icn 9339  ax-addcl 9340  ax-addrcl 9341  ax-mulcl 9342  ax-mulrcl 9343  ax-mulcom 9344  ax-addass 9345  ax-mulass 9346  ax-distr 9347  ax-i2m1 9348  ax-1ne0 9349  ax-1rid 9350  ax-rnegex 9351  ax-rrecex 9352  ax-cnre 9353  ax-pre-lttri 9354  ax-pre-lttrn 9355  ax-pre-ltadd 9356  ax-pre-mulgt0 9357  ax-pre-sup 9358
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2428  df-cleq 2434  df-clel 2437  df-nfc 2566  df-ne 2606  df-nel 2607  df-ral 2718  df-rex 2719  df-reu 2720  df-rmo 2721  df-rab 2722  df-v 2972  df-sbc 3185  df-csb 3287  df-dif 3329  df-un 3331  df-in 3333  df-ss 3340  df-pss 3342  df-nul 3636  df-if 3790  df-pw 3860  df-sn 3876  df-pr 3878  df-tp 3880  df-op 3882  df-uni 4090  df-iun 4171  df-br 4291  df-opab 4349  df-mpt 4350  df-tr 4384  df-eprel 4630  df-id 4634  df-po 4639  df-so 4640  df-fr 4677  df-we 4679  df-ord 4720  df-on 4721  df-lim 4722  df-suc 4723  df-xp 4844  df-rel 4845  df-cnv 4846  df-co 4847  df-dm 4848  df-rn 4849  df-res 4850  df-ima 4851  df-iota 5379  df-fun 5418  df-fn 5419  df-f 5420  df-f1 5421  df-fo 5422  df-f1o 5423  df-fv 5424  df-riota 6050  df-ov 6092  df-oprab 6093  df-mpt2 6094  df-om 6475  df-recs 6830  df-rdg 6864  df-er 7099  df-en 7309  df-dom 7310  df-sdom 7311  df-sup 7689  df-pnf 9418  df-mnf 9419  df-xr 9420  df-ltxr 9421  df-le 9422  df-sub 9595  df-neg 9596  df-div 9992  df-nn 10321  df-n0 10578  df-z 10645  df-uz 10860  df-rp 10990  df-fl 11640  df-mod 11707
This theorem is referenced by:  modeqmodmin  11766  digit1  11996  4sqlem12  14015
  Copyright terms: Public domain W3C validator