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

Theorem modadd1 11001
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 10975 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  mod  D
)  =  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) ) )
2 modval 10975 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  mod  D
)  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) )
31, 2eqeqan12d 2298 . . . . . . 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 804 . . . . . 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 696 . . . . 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 5865 . . . . 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 219 . . . 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 8827 . . . . . . . 8  |-  ( A  e.  RR  ->  A  e.  CC )
98adantr 451 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  A  e.  CC )
10 recn 8827 . . . . . . . 8  |-  ( C  e.  RR  ->  C  e.  CC )
1110ad2antrl 708 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  C  e.  CC )
12 rpcn 10362 . . . . . . . . . 10  |-  ( D  e.  RR+  ->  D  e.  CC )
1312adantl 452 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  ->  D  e.  CC )
14 rerpdivcl 10381 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  /  D
)  e.  RR )
15 reflcl 10928 . . . . . . . . . . 11  |-  ( ( A  /  D )  e.  RR  ->  ( |_ `  ( A  /  D ) )  e.  RR )
1615recnd 8861 . . . . . . . . . 10  |-  ( ( A  /  D )  e.  RR  ->  ( |_ `  ( A  /  D ) )  e.  CC )
1714, 16syl 15 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( A  /  D ) )  e.  CC )
1813, 17mulcld 8855 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( D  x.  ( |_ `  ( A  /  D ) ) )  e.  CC )
1918adantrl 696 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( D  x.  ( |_ `  ( A  /  D ) ) )  e.  CC )
209, 11, 19addsubd 9178 . . . . . 6  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( ( A  +  C )  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) )  =  ( ( A  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  +  C ) )
2120adantlr 695 . . . . 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 8827 . . . . . . . 8  |-  ( B  e.  RR  ->  B  e.  CC )
2322adantr 451 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  B  e.  CC )
2410ad2antrl 708 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  C  e.  CC )
2512adantl 452 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  ->  D  e.  CC )
26 rerpdivcl 10381 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  /  D
)  e.  RR )
27 reflcl 10928 . . . . . . . . . . 11  |-  ( ( B  /  D )  e.  RR  ->  ( |_ `  ( B  /  D ) )  e.  RR )
2827recnd 8861 . . . . . . . . . 10  |-  ( ( B  /  D )  e.  RR  ->  ( |_ `  ( B  /  D ) )  e.  CC )
2926, 28syl 15 . . . . . . . . 9  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( B  /  D ) )  e.  CC )
3025, 29mulcld 8855 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( D  x.  ( |_ `  ( B  /  D ) ) )  e.  CC )
3130adantrl 696 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( D  x.  ( |_ `  ( B  /  D ) ) )  e.  CC )
3223, 24, 31addsubd 9178 . . . . . 6  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( ( B  +  C )  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) )  =  ( ( B  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  +  C ) )
3332adantll 694 . . . . 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 2297 . . . 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 225 . . 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 5865 . . . 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 8820 . . . . . . . 8  |-  ( ( A  e.  RR  /\  C  e.  RR )  ->  ( A  +  C
)  e.  RR )
3837adantrr 697 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( A  +  C )  e.  RR )
39 simprr 733 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  D  e.  RR+ )
4014flcld 10930 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( A  /  D ) )  e.  ZZ )
4140adantrl 696 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( |_ `  ( A  /  D
) )  e.  ZZ )
42 modcyc2 11000 . . . . . . 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 1182 . . . . . 6  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( (
( A  +  C
)  -  ( D  x.  ( |_ `  ( A  /  D
) ) ) )  mod  D )  =  ( ( A  +  C )  mod  D
) )
4443adantlr 695 . . . . 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 8820 . . . . . . . 8  |-  ( ( B  e.  RR  /\  C  e.  RR )  ->  ( B  +  C
)  e.  RR )
4645adantrr 697 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( B  +  C )  e.  RR )
47 simprr 733 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  D  e.  RR+ )
4826flcld 10930 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( |_ `  ( B  /  D ) )  e.  ZZ )
4948adantrl 696 . . . . . . 7  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( |_ `  ( B  /  D
) )  e.  ZZ )
50 modcyc2 11000 . . . . . . 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 1182 . . . . . 6  |-  ( ( B  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  ( (
( B  +  C
)  -  ( D  x.  ( |_ `  ( B  /  D
) ) ) )  mod  D )  =  ( ( B  +  C )  mod  D
) )
5251adantll 694 . . . . 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 2297 . . . 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 210 . . 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 40 . 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 1148 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 176    /\ wa 358    /\ w3a 934    = wceq 1623    e. wcel 1684   ` cfv 5255  (class class class)co 5858   CCcc 8735   RRcr 8736    + caddc 8740    x. cmul 8742    - cmin 9037    / cdiv 9423   ZZcz 10024   RR+crp 10354   |_cfl 10924    mod cmo 10973
This theorem is referenced by:  modadd12d  11005  moddvds  12538  modsubi  13087  lgslem4  20538  lgsvalmod  20554  lgsmod  20560  lgsne0  20572  lgseisen  20592  modaddabs  24011  pellexlem6  26919
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-riota 6304  df-recs 6388  df-rdg 6423  df-er 6660  df-en 6864  df-dom 6865  df-sdom 6866  df-sup 7194  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-n0 9966  df-z 10025  df-uz 10231  df-rp 10355  df-fl 10925  df-mod 10974
  Copyright terms: Public domain W3C validator