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

Theorem modqadd1 9443
Description: Addition property of the modulo operation. (Contributed by Jim Kingdon, 22-Oct-2021.)
Hypotheses
Ref Expression
modqadd1.a  |-  ( ph  ->  A  e.  QQ )
modqadd1.b  |-  ( ph  ->  B  e.  QQ )
modqadd1.c  |-  ( ph  ->  C  e.  QQ )
modqadd1.dq  |-  ( ph  ->  D  e.  QQ )
modqadd1.dgt0  |-  ( ph  ->  0  <  D )
modqadd1.ab  |-  ( ph  ->  ( A  mod  D
)  =  ( B  mod  D ) )
Assertion
Ref Expression
modqadd1  |-  ( ph  ->  ( ( A  +  C )  mod  D
)  =  ( ( B  +  C )  mod  D ) )

Proof of Theorem modqadd1
StepHypRef Expression
1 modqadd1.ab . 2  |-  ( ph  ->  ( A  mod  D
)  =  ( B  mod  D ) )
2 modqadd1.a . . . . . . 7  |-  ( ph  ->  A  e.  QQ )
3 modqadd1.dq . . . . . . 7  |-  ( ph  ->  D  e.  QQ )
4 modqadd1.dgt0 . . . . . . 7  |-  ( ph  ->  0  <  D )
5 modqval 9406 . . . . . . 7  |-  ( ( A  e.  QQ  /\  D  e.  QQ  /\  0  <  D )  ->  ( A  mod  D )  =  ( A  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) ) )
62, 3, 4, 5syl3anc 1170 . . . . . 6  |-  ( ph  ->  ( A  mod  D
)  =  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) ) )
7 modqadd1.b . . . . . . 7  |-  ( ph  ->  B  e.  QQ )
8 modqval 9406 . . . . . . 7  |-  ( ( B  e.  QQ  /\  D  e.  QQ  /\  0  <  D )  ->  ( B  mod  D )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) ) )
97, 3, 4, 8syl3anc 1170 . . . . . 6  |-  ( ph  ->  ( B  mod  D
)  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) )
106, 9eqeq12d 2096 . . . . 5  |-  ( ph  ->  ( ( A  mod  D )  =  ( B  mod  D )  <->  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) ) ) )
11 oveq1 5550 . . . . 5  |-  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  ->  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
)  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) )
1210, 11syl6bi 161 . . . 4  |-  ( ph  ->  ( ( A  mod  D )  =  ( B  mod  D )  -> 
( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  +  C
) ) )
13 qcn 8800 . . . . . . 7  |-  ( A  e.  QQ  ->  A  e.  CC )
142, 13syl 14 . . . . . 6  |-  ( ph  ->  A  e.  CC )
15 modqadd1.c . . . . . . 7  |-  ( ph  ->  C  e.  QQ )
16 qcn 8800 . . . . . . 7  |-  ( C  e.  QQ  ->  C  e.  CC )
1715, 16syl 14 . . . . . 6  |-  ( ph  ->  C  e.  CC )
18 qcn 8800 . . . . . . . 8  |-  ( D  e.  QQ  ->  D  e.  CC )
193, 18syl 14 . . . . . . 7  |-  ( ph  ->  D  e.  CC )
204gt0ne0d 7680 . . . . . . . . . 10  |-  ( ph  ->  D  =/=  0 )
21 qdivcl 8809 . . . . . . . . . 10  |-  ( ( A  e.  QQ  /\  D  e.  QQ  /\  D  =/=  0 )  ->  ( A  /  D )  e.  QQ )
222, 3, 20, 21syl3anc 1170 . . . . . . . . 9  |-  ( ph  ->  ( A  /  D
)  e.  QQ )
2322flqcld 9359 . . . . . . . 8  |-  ( ph  ->  ( |_ `  ( A  /  D ) )  e.  ZZ )
2423zcnd 8551 . . . . . . 7  |-  ( ph  ->  ( |_ `  ( A  /  D ) )  e.  CC )
2519, 24mulcld 7201 . . . . . 6  |-  ( ph  ->  ( D  x.  ( |_ `  ( A  /  D ) ) )  e.  CC )
2614, 17, 25addsubd 7507 . . . . 5  |-  ( ph  ->  ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
) )
27 qcn 8800 . . . . . . 7  |-  ( B  e.  QQ  ->  B  e.  CC )
287, 27syl 14 . . . . . 6  |-  ( ph  ->  B  e.  CC )
29 qdivcl 8809 . . . . . . . . . 10  |-  ( ( B  e.  QQ  /\  D  e.  QQ  /\  D  =/=  0 )  ->  ( B  /  D )  e.  QQ )
307, 3, 20, 29syl3anc 1170 . . . . . . . . 9  |-  ( ph  ->  ( B  /  D
)  e.  QQ )
3130flqcld 9359 . . . . . . . 8  |-  ( ph  ->  ( |_ `  ( B  /  D ) )  e.  ZZ )
3231zcnd 8551 . . . . . . 7  |-  ( ph  ->  ( |_ `  ( B  /  D ) )  e.  CC )
3319, 32mulcld 7201 . . . . . 6  |-  ( ph  ->  ( D  x.  ( |_ `  ( B  /  D ) ) )  e.  CC )
3428, 17, 33addsubd 7507 . . . . 5  |-  ( ph  ->  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  +  C
) )
3526, 34eqeq12d 2096 . . . 4  |-  ( ph  ->  ( ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  <->  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
)  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) ) )
3612, 35sylibrd 167 . . 3  |-  ( ph  ->  ( ( A  mod  D )  =  ( B  mod  D )  -> 
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) ) )
37 oveq1 5550 . . . 4  |-  ( ( ( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  ->  ( (
( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  mod  D ) )
38 qaddcl 8801 . . . . . . 7  |-  ( ( A  e.  QQ  /\  C  e.  QQ )  ->  ( A  +  C
)  e.  QQ )
392, 15, 38syl2anc 403 . . . . . 6  |-  ( ph  ->  ( A  +  C
)  e.  QQ )
40 modqcyc2 9442 . . . . . 6  |-  ( ( ( ( A  +  C )  e.  QQ  /\  ( |_ `  ( A  /  D ) )  e.  ZZ )  /\  ( D  e.  QQ  /\  0  <  D ) )  ->  ( (
( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( A  +  C )  mod  D
) )
4139, 23, 3, 4, 40syl22anc 1171 . . . . 5  |-  ( ph  ->  ( ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  mod  D )  =  ( ( A  +  C )  mod 
D ) )
42 qaddcl 8801 . . . . . . 7  |-  ( ( B  e.  QQ  /\  C  e.  QQ )  ->  ( B  +  C
)  e.  QQ )
437, 15, 42syl2anc 403 . . . . . 6  |-  ( ph  ->  ( B  +  C
)  e.  QQ )
44 modqcyc2 9442 . . . . . 6  |-  ( ( ( ( B  +  C )  e.  QQ  /\  ( |_ `  ( B  /  D ) )  e.  ZZ )  /\  ( D  e.  QQ  /\  0  <  D ) )  ->  ( (
( B  +  C
)  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  =  ( ( B  +  C )  mod  D
) )
4543, 31, 3, 4, 44syl22anc 1171 . . . . 5  |-  ( ph  ->  ( ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  mod  D )  =  ( ( B  +  C )  mod 
D ) )
4641, 45eqeq12d 2096 . . . 4  |-  ( ph  ->  ( ( ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  mod  D
)  =  ( ( ( B  +  C
)  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  <->  ( ( A  +  C )  mod  D )  =  ( ( B  +  C
)  mod  D )
) )
4737, 46syl5ib 152 . . 3  |-  ( ph  ->  ( ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  ->  (
( A  +  C
)  mod  D )  =  ( ( B  +  C )  mod 
D ) ) )
4836, 47syld 44 . 2  |-  ( ph  ->  ( ( A  mod  D )  =  ( B  mod  D )  -> 
( ( A  +  C )  mod  D
)  =  ( ( B  +  C )  mod  D ) ) )
491, 48mpd 13 1  |-  ( ph  ->  ( ( A  +  C )  mod  D
)  =  ( ( B  +  C )  mod  D ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    = wceq 1285    e. wcel 1434    =/= wne 2246   class class class wbr 3793   ` cfv 4932  (class class class)co 5543   CCcc 7041   0cc0 7043    + caddc 7046    x. cmul 7048    < clt 7215    - cmin 7346    / cdiv 7827   ZZcz 8432   QQcq 8785   |_cfl 9350    mod cmo 9404
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 2064  ax-sep 3904  ax-pow 3956  ax-pr 3972  ax-un 4196  ax-setind 4288  ax-cnex 7129  ax-resscn 7130  ax-1cn 7131  ax-1re 7132  ax-icn 7133  ax-addcl 7134  ax-addrcl 7135  ax-mulcl 7136  ax-mulrcl 7137  ax-addcom 7138  ax-mulcom 7139  ax-addass 7140  ax-mulass 7141  ax-distr 7142  ax-i2m1 7143  ax-0lt1 7144  ax-1rid 7145  ax-0id 7146  ax-rnegex 7147  ax-precex 7148  ax-cnre 7149  ax-pre-ltirr 7150  ax-pre-ltwlin 7151  ax-pre-lttrn 7152  ax-pre-apti 7153  ax-pre-ltadd 7154  ax-pre-mulgt0 7155  ax-pre-mulext 7156  ax-arch 7157
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 1687  df-eu 1945  df-mo 1946  df-clab 2069  df-cleq 2075  df-clel 2078  df-nfc 2209  df-ne 2247  df-nel 2341  df-ral 2354  df-rex 2355  df-reu 2356  df-rmo 2357  df-rab 2358  df-v 2604  df-sbc 2817  df-csb 2910  df-dif 2976  df-un 2978  df-in 2980  df-ss 2987  df-pw 3392  df-sn 3412  df-pr 3413  df-op 3415  df-uni 3610  df-int 3645  df-iun 3688  df-br 3794  df-opab 3848  df-mpt 3849  df-id 4056  df-po 4059  df-iso 4060  df-xp 4377  df-rel 4378  df-cnv 4379  df-co 4380  df-dm 4381  df-rn 4382  df-res 4383  df-ima 4384  df-iota 4897  df-fun 4934  df-fn 4935  df-f 4936  df-fv 4940  df-riota 5499  df-ov 5546  df-oprab 5547  df-mpt2 5548  df-1st 5798  df-2nd 5799  df-pnf 7217  df-mnf 7218  df-xr 7219  df-ltxr 7220  df-le 7221  df-sub 7348  df-neg 7349  df-reap 7742  df-ap 7749  df-div 7828  df-inn 8107  df-n0 8356  df-z 8433  df-q 8786  df-rp 8816  df-fl 9352  df-mod 9405
This theorem is referenced by:  modqaddabs  9444  modqaddmod  9445  modqadd12d  9462  modqaddmulmod  9473  moddvds  10349
  Copyright terms: Public domain W3C validator