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

Theorem modqaddmulmod 10176
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 984 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  A  e.  QQ )
2 qcn 9438 . . . . 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 985 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  B  e.  QQ )
5 simprl 520 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  M  e.  QQ )
6 simprr 521 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  0  <  M )
74, 5, 6modqcld 10113 . . . . . 6  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( B  mod  M )  e.  QQ )
8 simpl3 986 . . . . . . 7  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  C  e.  ZZ )
9 zq 9430 . . . . . . 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 9441 . . . . . 6  |-  ( ( ( B  mod  M
)  e.  QQ  /\  C  e.  QQ )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
127, 10, 11syl2anc 408 . . . . 5  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
13 qcn 9438 . . . . 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 7925 . . 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 5789 . 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 1004 . . . . 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 408 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  mod  M )  x.  C )  e.  QQ )
20 qmulcl 9441 . . . . 5  |-  ( ( B  e.  QQ  /\  C  e.  QQ )  ->  ( B  x.  C
)  e.  QQ )
214, 18, 20syl2anc 408 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( B  x.  C )  e.  QQ )
2221, 5, 6modqcld 10113 . . 3  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  x.  C )  mod  M )  e.  QQ )
23 modqmulmod 10174 . . . . 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 1137 . . . 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 10143 . . . . 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 1216 . . . 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 2175 . . 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 10146 . 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 10148 . . . 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 1217 . . 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 9438 . . . . . 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 7925 . . . 4  |-  ( ( ( A  e.  QQ  /\  B  e.  QQ  /\  C  e.  ZZ )  /\  ( M  e.  QQ  /\  0  <  M ) )  ->  ( ( B  x.  C )  +  A )  =  ( A  +  ( B  x.  C ) ) )
3433oveq1d 5789 . . 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 2172 . 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 2176 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 962    = wceq 1331    e. wcel 1480   class class class wbr 3929  (class class class)co 5774   CCcc 7630   0cc0 7632    + caddc 7635    x. cmul 7637    < clt 7812   ZZcz 9066   QQcq 9423    mod cmo 10107
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 603  ax-in2 604  ax-io 698  ax-5 1423  ax-7 1424  ax-gen 1425  ax-ie1 1469  ax-ie2 1470  ax-8 1482  ax-10 1483  ax-11 1484  ax-i12 1485  ax-bndl 1486  ax-4 1487  ax-13 1491  ax-14 1492  ax-17 1506  ax-i9 1510  ax-ial 1514  ax-i5r 1515  ax-ext 2121  ax-sep 4046  ax-pow 4098  ax-pr 4131  ax-un 4355  ax-setind 4452  ax-cnex 7723  ax-resscn 7724  ax-1cn 7725  ax-1re 7726  ax-icn 7727  ax-addcl 7728  ax-addrcl 7729  ax-mulcl 7730  ax-mulrcl 7731  ax-addcom 7732  ax-mulcom 7733  ax-addass 7734  ax-mulass 7735  ax-distr 7736  ax-i2m1 7737  ax-0lt1 7738  ax-1rid 7739  ax-0id 7740  ax-rnegex 7741  ax-precex 7742  ax-cnre 7743  ax-pre-ltirr 7744  ax-pre-ltwlin 7745  ax-pre-lttrn 7746  ax-pre-apti 7747  ax-pre-ltadd 7748  ax-pre-mulgt0 7749  ax-pre-mulext 7750  ax-arch 7751
This theorem depends on definitions:  df-bi 116  df-3or 963  df-3an 964  df-tru 1334  df-fal 1337  df-nf 1437  df-sb 1736  df-eu 2002  df-mo 2003  df-clab 2126  df-cleq 2132  df-clel 2135  df-nfc 2270  df-ne 2309  df-nel 2404  df-ral 2421  df-rex 2422  df-reu 2423  df-rmo 2424  df-rab 2425  df-v 2688  df-sbc 2910  df-csb 3004  df-dif 3073  df-un 3075  df-in 3077  df-ss 3084  df-pw 3512  df-sn 3533  df-pr 3534  df-op 3536  df-uni 3737  df-int 3772  df-iun 3815  df-br 3930  df-opab 3990  df-mpt 3991  df-id 4215  df-po 4218  df-iso 4219  df-xp 4545  df-rel 4546  df-cnv 4547  df-co 4548  df-dm 4549  df-rn 4550  df-res 4551  df-ima 4552  df-iota 5088  df-fun 5125  df-fn 5126  df-f 5127  df-fv 5131  df-riota 5730  df-ov 5777  df-oprab 5778  df-mpo 5779  df-1st 6038  df-2nd 6039  df-pnf 7814  df-mnf 7815  df-xr 7816  df-ltxr 7817  df-le 7818  df-sub 7947  df-neg 7948  df-reap 8349  df-ap 8356  df-div 8445  df-inn 8733  df-n0 8990  df-z 9067  df-q 9424  df-rp 9454  df-fl 10055  df-mod 10108
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator