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

Theorem modqaddmulmod 10336
Description: The sum of a rational number and the product of a second rational number modulo a modulus and an integer equals the sum of the rational number and the product of the other rational number and the integer modulo the modulus. (Contributed by Jim Kingdon, 26-Oct-2021.)
Assertion
Ref Expression
modqaddmulmod  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( A  +  ( ( B  mod  M )  x.  C ) )  mod 
M )  =  ( ( A  +  ( B  x.  C ) )  mod  M ) )

Proof of Theorem modqaddmulmod
StepHypRef Expression
1 simpl1 995 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  A  e.  QQ )
2 qcn 9582 . . . . 5  |-  ( A  e.  QQ  ->  A  e.  CC )
31, 2syl 14 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  A  e.  CC )
4 simpl2 996 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  B  e.  QQ )
5 simprl 526 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  M  e.  QQ )
6 simprr 527 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  0  <  M )
74, 5, 6modqcld 10273 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( B  mod  M )  e.  QQ )
8 simpl3 997 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  C  e.  ZZ )
9 zq 9574 . . . . . . 7  |-  ( C  e.  ZZ  ->  C  e.  QQ )
108, 9syl 14 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  C  e.  QQ )
11 qmulcl 9585 . . . . . 6  |-  ( ( ( B  mod  M
)  e.  QQ  /\  C  e.  QQ )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
127, 10, 11syl2anc 409 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
13 qcn 9582 . . . . 5  |-  ( ( ( B  mod  M
)  x.  C )  e.  QQ  ->  (
( B  mod  M
)  x.  C )  e.  CC )
1412, 13syl 14 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  mod  M )  x.  C )  e.  CC )
153, 14addcomd 8059 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( A  +  ( ( B  mod  M )  x.  C ) )  =  ( ( ( B  mod  M )  x.  C )  +  A
) )
1615oveq1d 5866 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( A  +  ( ( B  mod  M )  x.  C ) )  mod 
M )  =  ( ( ( ( B  mod  M )  x.  C )  +  A
)  mod  M )
)
1793ad2ant3 1015 . . . . 5  |-  ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  ->  C  e.  QQ )
1817adantr 274 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  C  e.  QQ )
197, 18, 11syl2anc 409 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
20 qmulcl 9585 . . . . 5  |-  ( ( B  e.  QQ  /\  C  e.  QQ )  ->  ( B  x.  C
)  e.  QQ )
214, 18, 20syl2anc 409 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( B  x.  C )  e.  QQ )
2221, 5, 6modqcld 10273 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  x.  C )  mod  M )  e.  QQ )
23 modqmulmod 10334 . . . . 5  |-  ( ( ( B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  < 
M ) )  -> 
( ( ( B  mod  M )  x.  C )  mod  M
)  =  ( ( B  x.  C )  mod  M ) )
24233adantl1 1148 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( B  mod  M
)  x.  C )  mod  M )  =  ( ( B  x.  C )  mod  M
) )
25 modqabs2 10303 . . . . 5  |-  ( ( ( B  x.  C
)  e.  QQ  /\  M  e.  QQ  /\  0  <  M )  ->  (
( ( B  x.  C )  mod  M
)  mod  M )  =  ( ( B  x.  C )  mod 
M ) )
2621, 5, 6, 25syl3anc 1233 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( B  x.  C
)  mod  M )  mod  M )  =  ( ( B  x.  C
)  mod  M )
)
2724, 26eqtr4d 2206 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( B  mod  M
)  x.  C )  mod  M )  =  ( ( ( B  x.  C )  mod 
M )  mod  M
) )
2819, 22, 1, 5, 6, 27modqadd1 10306 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( ( B  mod  M )  x.  C )  +  A )  mod 
M )  =  ( ( ( ( B  x.  C )  mod 
M )  +  A
)  mod  M )
)
29 modqaddmod 10308 . . . 4  |-  ( ( ( ( B  x.  C )  e.  QQ  /\  A  e.  QQ )  /\  ( M  e.  QQ  /\  0  < 
M ) )  -> 
( ( ( ( B  x.  C )  mod  M )  +  A )  mod  M
)  =  ( ( ( B  x.  C
)  +  A )  mod  M ) )
3021, 1, 5, 6, 29syl22anc 1234 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( ( B  x.  C )  mod  M
)  +  A )  mod  M )  =  ( ( ( B  x.  C )  +  A )  mod  M
) )
31 qcn 9582 . . . . . 6  |-  ( ( B  x.  C )  e.  QQ  ->  ( B  x.  C )  e.  CC )
3221, 31syl 14 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( B  x.  C )  e.  CC )
3332, 3addcomd 8059 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  x.  C )  +  A )  =  ( A  +  ( B  x.  C ) ) )
3433oveq1d 5866 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( B  x.  C
)  +  A )  mod  M )  =  ( ( A  +  ( B  x.  C
) )  mod  M
) )
3530, 34eqtrd 2203 . 2  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( (
( ( B  x.  C )  mod  M
)  +  A )  mod  M )  =  ( ( A  +  ( B  x.  C
) )  mod  M
) )
3616, 28, 353eqtrd 2207 1  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( A  +  ( ( B  mod  M )  x.  C ) )  mod 
M )  =  ( ( A  +  ( B  x.  C ) )  mod  M ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 103    /\ w3a 973    = wceq 1348    e. wcel 2141   class class class wbr 3987  (class class class)co 5851   CCcc 7761   0cc0 7763    + caddc 7766    x. cmul 7768    < clt 7943   ZZcz 9201   QQcq 9567    mod cmo 10267
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 609  ax-in2 610  ax-io 704  ax-5 1440  ax-7 1441  ax-gen 1442  ax-ie1 1486  ax-ie2 1487  ax-8 1497  ax-10 1498  ax-11 1499  ax-i12 1500  ax-bndl 1502  ax-4 1503  ax-17 1519  ax-i9 1523  ax-ial 1527  ax-i5r 1528  ax-13 2143  ax-14 2144  ax-ext 2152  ax-sep 4105  ax-pow 4158  ax-pr 4192  ax-un 4416  ax-setind 4519  ax-cnex 7854  ax-resscn 7855  ax-1cn 7856  ax-1re 7857  ax-icn 7858  ax-addcl 7859  ax-addrcl 7860  ax-mulcl 7861  ax-mulrcl 7862  ax-addcom 7863  ax-mulcom 7864  ax-addass 7865  ax-mulass 7866  ax-distr 7867  ax-i2m1 7868  ax-0lt1 7869  ax-1rid 7870  ax-0id 7871  ax-rnegex 7872  ax-precex 7873  ax-cnre 7874  ax-pre-ltirr 7875  ax-pre-ltwlin 7876  ax-pre-lttrn 7877  ax-pre-apti 7878  ax-pre-ltadd 7879  ax-pre-mulgt0 7880  ax-pre-mulext 7881  ax-arch 7882
This theorem depends on definitions:  df-bi 116  df-3or 974  df-3an 975  df-tru 1351  df-fal 1354  df-nf 1454  df-sb 1756  df-eu 2022  df-mo 2023  df-clab 2157  df-cleq 2163  df-clel 2166  df-nfc 2301  df-ne 2341  df-nel 2436  df-ral 2453  df-rex 2454  df-reu 2455  df-rmo 2456  df-rab 2457  df-v 2732  df-sbc 2956  df-csb 3050  df-dif 3123  df-un 3125  df-in 3127  df-ss 3134  df-pw 3566  df-sn 3587  df-pr 3588  df-op 3590  df-uni 3795  df-int 3830  df-iun 3873  df-br 3988  df-opab 4049  df-mpt 4050  df-id 4276  df-po 4279  df-iso 4280  df-xp 4615  df-rel 4616  df-cnv 4617  df-co 4618  df-dm 4619  df-rn 4620  df-res 4621  df-ima 4622  df-iota 5158  df-fun 5198  df-fn 5199  df-f 5200  df-fv 5204  df-riota 5807  df-ov 5854  df-oprab 5855  df-mpo 5856  df-1st 6117  df-2nd 6118  df-pnf 7945  df-mnf 7946  df-xr 7947  df-ltxr 7948  df-le 7949  df-sub 8081  df-neg 8082  df-reap 8483  df-ap 8490  df-div 8579  df-inn 8868  df-n0 9125  df-z 9202  df-q 9568  df-rp 9600  df-fl 10215  df-mod 10268
This theorem is referenced by:  modprm0  12197  modprmn0modprm0  12199
  Copyright terms: Public domain W3C validator