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

Theorem modadd1 11207
Description: Addition property of the modulo operation. (Contributed by NM, 12-Nov-2008.)
Assertion
Ref Expression
modadd1  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ )  /\  ( A  mod  D )  =  ( B  mod  D
) )  ->  (
( A  +  C
)  mod  D )  =  ( ( B  +  C )  mod 
D ) )

Proof of Theorem modadd1
StepHypRef Expression
1 modval 11181 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  mod  D
)  =  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) ) )
2 modval 11181 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  mod  D
)  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) )
31, 2eqeqan12d 2404 . . . . . . 7  |-  ( ( ( A  e.  RR  /\  D  e.  RR+ )  /\  ( B  e.  RR  /\  D  e.  RR+ )
)  ->  ( ( A  mod  D )  =  ( B  mod  D
)  <->  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) ) )
43anandirs 805 . . . . . 6  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  D  e.  RR+ )  ->  ( ( A  mod  D )  =  ( B  mod  D
)  <->  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) ) )
54adantrl 697 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( A  mod  D
)  =  ( B  mod  D )  <->  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) ) ) )
6 oveq1 6029 . . . . 5  |-  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  ->  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
)  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) )
75, 6syl6bi 220 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( A  mod  D
)  =  ( B  mod  D )  -> 
( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  +  C
) ) )
8 recn 9015 . . . . . . . 8  |-  ( A  e.  RR  ->  A  e.  CC )
98adantr 452 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  A  e.  CC )
10 recn 9015 . . . . . . . 8  |-  ( C  e.  RR  ->  C  e.  CC )
1110ad2antrl 709 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  C  e.  CC )
12 rpcn 10554 . . . . . . . . . 10  |-  ( D  e.  RR+  ->  D  e.  CC )
1312adantl 453 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  ->  D  e.  CC )
14 rerpdivcl 10573 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  /  D
)  e.  RR )
15 reflcl 11134 . . . . . . . . . . 11  |-  ( ( A  /  D )  e.  RR  ->  ( |_ `  ( A  /  D ) )  e.  RR )
1615recnd 9049 . . . . . . . . . 10  |-  ( ( A  /  D )  e.  RR  ->  ( |_ `  ( A  /  D ) )  e.  CC )
1714, 16syl 16 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( A  /  D ) )  e.  CC )
1813, 17mulcld 9043 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( D  x.  ( |_ `  ( A  /  D ) ) )  e.  CC )
1918adantrl 697 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( D  x.  ( |_ `  ( A  /  D ) ) )  e.  CC )
209, 11, 19addsubd 9366 . . . . . 6  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  +  C ) )
2120adantlr 696 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
) )
22 recn 9015 . . . . . . . 8  |-  ( B  e.  RR  ->  B  e.  CC )
2322adantr 452 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  B  e.  CC )
2410ad2antrl 709 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  C  e.  CC )
2512adantl 453 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  ->  D  e.  CC )
26 rerpdivcl 10573 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  /  D
)  e.  RR )
27 reflcl 11134 . . . . . . . . . . 11  |-  ( ( B  /  D )  e.  RR  ->  ( |_ `  ( B  /  D ) )  e.  RR )
2827recnd 9049 . . . . . . . . . 10  |-  ( ( B  /  D )  e.  RR  ->  ( |_ `  ( B  /  D ) )  e.  CC )
2926, 28syl 16 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( B  /  D ) )  e.  CC )
3025, 29mulcld 9043 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( D  x.  ( |_ `  ( B  /  D ) ) )  e.  CC )
3130adantrl 697 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( D  x.  ( |_ `  ( B  /  D ) ) )  e.  CC )
3223, 24, 31addsubd 9366 . . . . . 6  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) )
3332adantll 695 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( B  +  C
)  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  +  C
) )
3421, 33eqeq12d 2403 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  <->  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  +  C
)  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) ) )
357, 34sylibrd 226 . . 3  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( A  mod  D
)  =  ( B  mod  D )  -> 
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) ) )
36 oveq1 6029 . . . 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 ) )
37 readdcl 9008 . . . . . . . 8  |-  ( ( A  e.  RR  /\  C  e.  RR )  ->  ( A  +  C
)  e.  RR )
3837adantrr 698 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( A  +  C )  e.  RR )
39 simprr 734 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  D  e.  RR+ )
4014flcld 11136 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( A  /  D ) )  e.  ZZ )
4140adantrl 697 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( |_ `  ( A  /  D
) )  e.  ZZ )
42 modcyc2 11206 . . . . . . 7  |-  ( ( ( A  +  C
)  e.  RR  /\  D  e.  RR+  /\  ( |_ `  ( A  /  D ) )  e.  ZZ )  ->  (
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( A  +  C )  mod  D
) )
4338, 39, 41, 42syl3anc 1184 . . . . . 6  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( (
( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( A  +  C )  mod  D
) )
4443adantlr 696 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( A  +  C )  mod  D
) )
45 readdcl 9008 . . . . . . . 8  |-  ( ( B  e.  RR  /\  C  e.  RR )  ->  ( B  +  C
)  e.  RR )
4645adantrr 698 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( B  +  C )  e.  RR )
47 simprr 734 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  D  e.  RR+ )
4826flcld 11136 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( B  /  D ) )  e.  ZZ )
4948adantrl 697 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( |_ `  ( B  /  D
) )  e.  ZZ )
50 modcyc2 11206 . . . . . . 7  |-  ( ( ( B  +  C
)  e.  RR  /\  D  e.  RR+  /\  ( |_ `  ( B  /  D ) )  e.  ZZ )  ->  (
( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  =  ( ( B  +  C )  mod  D
) )
5146, 47, 49, 50syl3anc 1184 . . . . . 6  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( (
( B  +  C
)  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  =  ( ( B  +  C )  mod  D
) )
5251adantll 695 . . . . 5  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  =  ( ( B  +  C )  mod  D
) )
5344, 52eqeq12d 2403 . . . 4  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  mod  D )  =  ( ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  mod  D
)  <->  ( ( A  +  C )  mod 
D )  =  ( ( B  +  C
)  mod  D )
) )
5436, 53syl5ib 211 . . 3  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  =  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  ->  ( ( A  +  C )  mod  D )  =  ( ( B  +  C
)  mod  D )
) )
5535, 54syld 42 . 2  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ ) )  ->  (
( A  mod  D
)  =  ( B  mod  D )  -> 
( ( A  +  C )  mod  D
)  =  ( ( B  +  C )  mod  D ) ) )
56553impia 1150 1  |-  ( ( ( A  e.  RR  /\  B  e.  RR )  /\  ( C  e.  RR  /\  D  e.  RR+ )  /\  ( A  mod  D )  =  ( B  mod  D
) )  ->  (
( A  +  C
)  mod  D )  =  ( ( B  +  C )  mod 
D ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 177    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1717   ` cfv 5396  (class class class)co 6022   CCcc 8923   RRcr 8924    + caddc 8928    x. cmul 8930    - cmin 9225    / cdiv 9611   ZZcz 10216   RR+crp 10546   |_cfl 11130    mod cmo 11179
This theorem is referenced by:  modadd12d  11211  moddvds  12788  modsubi  13337  lgslem4  20952  lgsvalmod  20968  lgsmod  20974  lgsne0  20986  lgseisen  21006  modaddabs  24896  pellexlem6  26590
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2370  ax-sep 4273  ax-nul 4281  ax-pow 4320  ax-pr 4346  ax-un 4643  ax-cnex 8981  ax-resscn 8982  ax-1cn 8983  ax-icn 8984  ax-addcl 8985  ax-addrcl 8986  ax-mulcl 8987  ax-mulrcl 8988  ax-mulcom 8989  ax-addass 8990  ax-mulass 8991  ax-distr 8992  ax-i2m1 8993  ax-1ne0 8994  ax-1rid 8995  ax-rnegex 8996  ax-rrecex 8997  ax-cnre 8998  ax-pre-lttri 8999  ax-pre-lttrn 9000  ax-pre-ltadd 9001  ax-pre-mulgt0 9002  ax-pre-sup 9003
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2244  df-mo 2245  df-clab 2376  df-cleq 2382  df-clel 2385  df-nfc 2514  df-ne 2554  df-nel 2555  df-ral 2656  df-rex 2657  df-reu 2658  df-rmo 2659  df-rab 2660  df-v 2903  df-sbc 3107  df-csb 3197  df-dif 3268  df-un 3270  df-in 3272  df-ss 3279  df-pss 3281  df-nul 3574  df-if 3685  df-pw 3746  df-sn 3765  df-pr 3766  df-tp 3767  df-op 3768  df-uni 3960  df-iun 4039  df-br 4156  df-opab 4210  df-mpt 4211  df-tr 4246  df-eprel 4437  df-id 4441  df-po 4446  df-so 4447  df-fr 4484  df-we 4486  df-ord 4527  df-on 4528  df-lim 4529  df-suc 4530  df-om 4788  df-xp 4826  df-rel 4827  df-cnv 4828  df-co 4829  df-dm 4830  df-rn 4831  df-res 4832  df-ima 4833  df-iota 5360  df-fun 5398  df-fn 5399  df-f 5400  df-f1 5401  df-fo 5402  df-f1o 5403  df-fv 5404  df-ov 6025  df-oprab 6026  df-mpt2 6027  df-riota 6487  df-recs 6571  df-rdg 6606  df-er 6843  df-en 7048  df-dom 7049  df-sdom 7050  df-sup 7383  df-pnf 9057  df-mnf 9058  df-xr 9059  df-ltxr 9060  df-le 9061  df-sub 9227  df-neg 9228  df-div 9612  df-nn 9935  df-n0 10156  df-z 10217  df-uz 10423  df-rp 10547  df-fl 11131  df-mod 11180
  Copyright terms: Public domain W3C validator