ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  q2submod Unicode version

Theorem q2submod 9519
Description: If a number is between a modulus and twice the modulus, the first number modulo the modulus equals the first number minus the modulus. (Contributed by Jim Kingdon, 25-Oct-2021.)
Assertion
Ref Expression
q2submod  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  mod  B )  =  ( A  -  B ) )

Proof of Theorem q2submod
StepHypRef Expression
1 qcn 8852 . . . . . . 7  |-  ( B  e.  QQ  ->  B  e.  CC )
213ad2ant2 961 . . . . . 6  |-  ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  ->  B  e.  CC )
32adantr 270 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  B  e.  CC )
43mulid1d 7250 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( B  x.  1 )  =  B )
54oveq2d 5579 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  -  ( B  x.  1
) )  =  ( A  -  B ) )
65oveq1d 5578 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( ( A  -  ( B  x.  1 ) )  mod 
B )  =  ( ( A  -  B
)  mod  B )
)
7 simpl1 942 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  A  e.  QQ )
8 1zzd 8511 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  1  e.  ZZ )
9 simpl2 943 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  B  e.  QQ )
10 simpl3 944 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  0  <  B
)
11 modqcyc2 9494 . . 3  |-  ( ( ( A  e.  QQ  /\  1  e.  ZZ )  /\  ( B  e.  QQ  /\  0  < 
B ) )  -> 
( ( A  -  ( B  x.  1
) )  mod  B
)  =  ( A  mod  B ) )
127, 8, 9, 10, 11syl22anc 1171 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( ( A  -  ( B  x.  1 ) )  mod 
B )  =  ( A  mod  B ) )
13 qsubcl 8856 . . . 4  |-  ( ( A  e.  QQ  /\  B  e.  QQ )  ->  ( A  -  B
)  e.  QQ )
147, 9, 13syl2anc 403 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  -  B )  e.  QQ )
15 simpr 108 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( B  <_  A  /\  A  <  (
2  x.  B ) ) )
16 qre 8843 . . . . . . . 8  |-  ( A  e.  QQ  ->  A  e.  RR )
177, 16syl 14 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  A  e.  RR )
18 qre 8843 . . . . . . . 8  |-  ( B  e.  QQ  ->  B  e.  RR )
199, 18syl 14 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  B  e.  RR )
2017, 19subge0d 7754 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( 0  <_ 
( A  -  B
)  <->  B  <_  A ) )
2120bicomd 139 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( B  <_  A 
<->  0  <_  ( A  -  B ) ) )
2232timesd 8392 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( 2  x.  B )  =  ( B  +  B ) )
2322breq2d 3817 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  < 
( 2  x.  B
)  <->  A  <  ( B  +  B ) ) )
2417, 19, 19ltsubaddd 7760 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( ( A  -  B )  < 
B  <->  A  <  ( B  +  B ) ) )
2523, 24bitr4d 189 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  < 
( 2  x.  B
)  <->  ( A  -  B )  <  B
) )
2621, 25anbi12d 457 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( ( B  <_  A  /\  A  <  ( 2  x.  B
) )  <->  ( 0  <_  ( A  -  B )  /\  ( A  -  B )  <  B ) ) )
2715, 26mpbid 145 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( 0  <_ 
( A  -  B
)  /\  ( A  -  B )  <  B
) )
28 modqid 9483 . . 3  |-  ( ( ( ( A  -  B )  e.  QQ  /\  B  e.  QQ )  /\  ( 0  <_ 
( A  -  B
)  /\  ( A  -  B )  <  B
) )  ->  (
( A  -  B
)  mod  B )  =  ( A  -  B ) )
2914, 9, 27, 28syl21anc 1169 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( ( A  -  B )  mod 
B )  =  ( A  -  B ) )
306, 12, 293eqtr3d 2123 1  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  0  <  B )  /\  ( B  <_  A  /\  A  <  ( 2  x.  B ) ) )  ->  ( A  mod  B )  =  ( A  -  B ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 102    /\ w3a 920    = wceq 1285    e. wcel 1434   class class class wbr 3805  (class class class)co 5563   CCcc 7093   RRcr 7094   0cc0 7095   1c1 7096    + caddc 7098    x. cmul 7100    < clt 7267    <_ cle 7268    - cmin 7398   2c2 8208   ZZcz 8484   QQcq 8837    mod cmo 9456
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2065  ax-sep 3916  ax-pow 3968  ax-pr 3992  ax-un 4216  ax-setind 4308  ax-cnex 7181  ax-resscn 7182  ax-1cn 7183  ax-1re 7184  ax-icn 7185  ax-addcl 7186  ax-addrcl 7187  ax-mulcl 7188  ax-mulrcl 7189  ax-addcom 7190  ax-mulcom 7191  ax-addass 7192  ax-mulass 7193  ax-distr 7194  ax-i2m1 7195  ax-0lt1 7196  ax-1rid 7197  ax-0id 7198  ax-rnegex 7199  ax-precex 7200  ax-cnre 7201  ax-pre-ltirr 7202  ax-pre-ltwlin 7203  ax-pre-lttrn 7204  ax-pre-apti 7205  ax-pre-ltadd 7206  ax-pre-mulgt0 7207  ax-pre-mulext 7208  ax-arch 7209
This theorem depends on definitions:  df-bi 115  df-3or 921  df-3an 922  df-tru 1288  df-fal 1291  df-nf 1391  df-sb 1688  df-eu 1946  df-mo 1947  df-clab 2070  df-cleq 2076  df-clel 2079  df-nfc 2212  df-ne 2250  df-nel 2345  df-ral 2358  df-rex 2359  df-reu 2360  df-rmo 2361  df-rab 2362  df-v 2612  df-sbc 2825  df-csb 2918  df-dif 2984  df-un 2986  df-in 2988  df-ss 2995  df-pw 3402  df-sn 3422  df-pr 3423  df-op 3425  df-uni 3622  df-int 3657  df-iun 3700  df-br 3806  df-opab 3860  df-mpt 3861  df-id 4076  df-po 4079  df-iso 4080  df-xp 4397  df-rel 4398  df-cnv 4399  df-co 4400  df-dm 4401  df-rn 4402  df-res 4403  df-ima 4404  df-iota 4917  df-fun 4954  df-fn 4955  df-f 4956  df-fv 4960  df-riota 5519  df-ov 5566  df-oprab 5567  df-mpt2 5568  df-1st 5818  df-2nd 5819  df-pnf 7269  df-mnf 7270  df-xr 7271  df-ltxr 7272  df-le 7273  df-sub 7400  df-neg 7401  df-reap 7794  df-ap 7801  df-div 7880  df-inn 8159  df-2 8217  df-n0 8408  df-z 8485  df-q 8838  df-rp 8868  df-fl 9404  df-mod 9457
This theorem is referenced by:  modifeq2int  9520  modaddmodup  9521
  Copyright terms: Public domain W3C validator