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

Theorem modadd1 11270
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 11244 . . . . . . . 8  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  mod  D
)  =  ( A  -  ( D  x.  ( |_ `  ( A  /  D ) ) ) ) )
2 modval 11244 . . . . . . . 8  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  mod  D
)  =  ( B  -  ( D  x.  ( |_ `  ( B  /  D ) ) ) ) )
31, 2eqeqan12d 2450 . . . . . . 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 6080 . . . . 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 9072 . . . . . . . 8  |-  ( A  e.  RR  ->  A  e.  CC )
98adantr 452 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  A  e.  CC )
10 recn 9072 . . . . . . . 8  |-  ( C  e.  RR  ->  C  e.  CC )
1110ad2antrl 709 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( C  e.  RR  /\  D  e.  RR+ )
)  ->  C  e.  CC )
12 rpcn 10612 . . . . . . . . . 10  |-  ( D  e.  RR+  ->  D  e.  CC )
1312adantl 453 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  ->  D  e.  CC )
14 rerpdivcl 10631 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  D  e.  RR+ )  -> 
( A  /  D
)  e.  RR )
15 reflcl 11197 . . . . . . . . . . 11  |-  ( ( A  /  D )  e.  RR  ->  ( |_ `  ( A  /  D ) )  e.  RR )
1615recnd 9106 . . . . . . . . . 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 9100 . . . . . . . 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 9424 . . . . . 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 9072 . . . . . . . 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 10631 . . . . . . . . . 10  |-  ( ( B  e.  RR  /\  D  e.  RR+ )  -> 
( B  /  D
)  e.  RR )
27 reflcl 11197 . . . . . . . . . . 11  |-  ( ( B  /  D )  e.  RR  ->  ( |_ `  ( B  /  D ) )  e.  RR )
2827recnd 9106 . . . . . . . . . 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 9100 . . . . . . . 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 9424 . . . . . 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 2449 . . . 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 6080 . . . 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 9065 . . . . . . . 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 11199 . . . . . . . 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 11269 . . . . . . 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 9065 . . . . . . . 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 11199 . . . . . . . 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 11269 . . . . . . 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 2449 . . . 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 1652    e. wcel 1725   ` cfv 5446  (class class class)co 6073   CCcc 8980   RRcr 8981    + caddc 8985    x. cmul 8987    - cmin 9283    / cdiv 9669   ZZcz 10274   RR+crp 10604   |_cfl 11193    mod cmo 11242
This theorem is referenced by:  modadd12d  11274  moddvds  12851  modsubi  13400  lgslem4  21075  lgsvalmod  21091  lgsmod  21097  lgsne0  21109  lgseisen  21129  modaddabs  25107  pellexlem6  26888  modaddmod  28131  modaddmulmod  28136
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059  ax-pre-sup 9060
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rmo 2705  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-uni 4008  df-iun 4087  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-riota 6541  df-recs 6625  df-rdg 6660  df-er 6897  df-en 7102  df-dom 7103  df-sdom 7104  df-sup 7438  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-div 9670  df-nn 9993  df-n0 10214  df-z 10275  df-uz 10481  df-rp 10605  df-fl 11194  df-mod 11243
  Copyright terms: Public domain W3C validator