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

Theorem modadd1 13031
Description: Addition property of the modulo operation. (Contributed by NM, 12-Nov-2008.)
Assertion
Ref Expression
modadd1 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+) ∧ (𝐴 mod 𝐷) = (𝐵 mod 𝐷)) → ((𝐴 + 𝐶) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷))

Proof of Theorem modadd1
StepHypRef Expression
1 modval 12994 . . . . . . . 8 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐴 mod 𝐷) = (𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))))
2 modval 12994 . . . . . . . 8 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐵 mod 𝐷) = (𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))))
31, 2eqeqan12d 2794 . . . . . . 7 (((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) ∧ (𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) ↔ (𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = (𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷))))))
43anandirs 669 . . . . . 6 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ 𝐷 ∈ ℝ+) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) ↔ (𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = (𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷))))))
54adantrl 706 . . . . 5 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) ↔ (𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = (𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷))))))
6 oveq1 6931 . . . . 5 ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = (𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) → ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) + 𝐶) = ((𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) + 𝐶))
75, 6syl6bi 245 . . . 4 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) → ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) + 𝐶) = ((𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) + 𝐶)))
8 recn 10364 . . . . . . . 8 (𝐴 ∈ ℝ → 𝐴 ∈ ℂ)
98adantr 474 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐴 ∈ ℂ)
10 recn 10364 . . . . . . . 8 (𝐶 ∈ ℝ → 𝐶 ∈ ℂ)
1110ad2antrl 718 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐶 ∈ ℂ)
12 rpcn 12154 . . . . . . . . . 10 (𝐷 ∈ ℝ+𝐷 ∈ ℂ)
1312adantl 475 . . . . . . . . 9 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → 𝐷 ∈ ℂ)
14 rerpdivcl 12174 . . . . . . . . . 10 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐴 / 𝐷) ∈ ℝ)
15 reflcl 12921 . . . . . . . . . . 11 ((𝐴 / 𝐷) ∈ ℝ → (⌊‘(𝐴 / 𝐷)) ∈ ℝ)
1615recnd 10407 . . . . . . . . . 10 ((𝐴 / 𝐷) ∈ ℝ → (⌊‘(𝐴 / 𝐷)) ∈ ℂ)
1714, 16syl 17 . . . . . . . . 9 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (⌊‘(𝐴 / 𝐷)) ∈ ℂ)
1813, 17mulcld 10399 . . . . . . . 8 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐷 · (⌊‘(𝐴 / 𝐷))) ∈ ℂ)
1918adantrl 706 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (𝐷 · (⌊‘(𝐴 / 𝐷))) ∈ ℂ)
209, 11, 19addsubd 10757 . . . . . 6 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) + 𝐶))
2120adantlr 705 . . . . 5 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) + 𝐶))
22 recn 10364 . . . . . . . 8 (𝐵 ∈ ℝ → 𝐵 ∈ ℂ)
2322adantr 474 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐵 ∈ ℂ)
2410ad2antrl 718 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐶 ∈ ℂ)
2512adantl 475 . . . . . . . . 9 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → 𝐷 ∈ ℂ)
26 rerpdivcl 12174 . . . . . . . . . 10 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐵 / 𝐷) ∈ ℝ)
27 reflcl 12921 . . . . . . . . . . 11 ((𝐵 / 𝐷) ∈ ℝ → (⌊‘(𝐵 / 𝐷)) ∈ ℝ)
2827recnd 10407 . . . . . . . . . 10 ((𝐵 / 𝐷) ∈ ℝ → (⌊‘(𝐵 / 𝐷)) ∈ ℂ)
2926, 28syl 17 . . . . . . . . 9 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (⌊‘(𝐵 / 𝐷)) ∈ ℂ)
3025, 29mulcld 10399 . . . . . . . 8 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (𝐷 · (⌊‘(𝐵 / 𝐷))) ∈ ℂ)
3130adantrl 706 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (𝐷 · (⌊‘(𝐵 / 𝐷))) ∈ ℂ)
3223, 24, 31addsubd 10757 . . . . . 6 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) = ((𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) + 𝐶))
3332adantll 704 . . . . 5 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) = ((𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) + 𝐶))
3421, 33eqeq12d 2793 . . . 4 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) ↔ ((𝐴 − (𝐷 · (⌊‘(𝐴 / 𝐷)))) + 𝐶) = ((𝐵 − (𝐷 · (⌊‘(𝐵 / 𝐷)))) + 𝐶)))
357, 34sylibrd 251 . . 3 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) → ((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷))))))
36 oveq1 6931 . . . 4 (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) mod 𝐷) = (((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) mod 𝐷))
37 readdcl 10357 . . . . . . . 8 ((𝐴 ∈ ℝ ∧ 𝐶 ∈ ℝ) → (𝐴 + 𝐶) ∈ ℝ)
3837adantrr 707 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (𝐴 + 𝐶) ∈ ℝ)
39 simprr 763 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐷 ∈ ℝ+)
4014flcld 12923 . . . . . . . 8 ((𝐴 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (⌊‘(𝐴 / 𝐷)) ∈ ℤ)
4140adantrl 706 . . . . . . 7 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (⌊‘(𝐴 / 𝐷)) ∈ ℤ)
42 modcyc2 13030 . . . . . . 7 (((𝐴 + 𝐶) ∈ ℝ ∧ 𝐷 ∈ ℝ+ ∧ (⌊‘(𝐴 / 𝐷)) ∈ ℤ) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) mod 𝐷) = ((𝐴 + 𝐶) mod 𝐷))
4338, 39, 41, 42syl3anc 1439 . . . . . 6 ((𝐴 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) mod 𝐷) = ((𝐴 + 𝐶) mod 𝐷))
4443adantlr 705 . . . . 5 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) mod 𝐷) = ((𝐴 + 𝐶) mod 𝐷))
45 readdcl 10357 . . . . . . . 8 ((𝐵 ∈ ℝ ∧ 𝐶 ∈ ℝ) → (𝐵 + 𝐶) ∈ ℝ)
4645adantrr 707 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (𝐵 + 𝐶) ∈ ℝ)
47 simprr 763 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → 𝐷 ∈ ℝ+)
4826flcld 12923 . . . . . . . 8 ((𝐵 ∈ ℝ ∧ 𝐷 ∈ ℝ+) → (⌊‘(𝐵 / 𝐷)) ∈ ℤ)
4948adantrl 706 . . . . . . 7 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (⌊‘(𝐵 / 𝐷)) ∈ ℤ)
50 modcyc2 13030 . . . . . . 7 (((𝐵 + 𝐶) ∈ ℝ ∧ 𝐷 ∈ ℝ+ ∧ (⌊‘(𝐵 / 𝐷)) ∈ ℤ) → (((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷))
5146, 47, 49, 50syl3anc 1439 . . . . . 6 ((𝐵 ∈ ℝ ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷))
5251adantll 704 . . . . 5 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷))
5344, 52eqeq12d 2793 . . . 4 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) mod 𝐷) = (((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) mod 𝐷) ↔ ((𝐴 + 𝐶) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷)))
5436, 53syl5ib 236 . . 3 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → (((𝐴 + 𝐶) − (𝐷 · (⌊‘(𝐴 / 𝐷)))) = ((𝐵 + 𝐶) − (𝐷 · (⌊‘(𝐵 / 𝐷)))) → ((𝐴 + 𝐶) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷)))
5535, 54syld 47 . 2 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+)) → ((𝐴 mod 𝐷) = (𝐵 mod 𝐷) → ((𝐴 + 𝐶) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷)))
56553impia 1106 1 (((𝐴 ∈ ℝ ∧ 𝐵 ∈ ℝ) ∧ (𝐶 ∈ ℝ ∧ 𝐷 ∈ ℝ+) ∧ (𝐴 mod 𝐷) = (𝐵 mod 𝐷)) → ((𝐴 + 𝐶) mod 𝐷) = ((𝐵 + 𝐶) mod 𝐷))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 198  wa 386  w3a 1071   = wceq 1601  wcel 2107  cfv 6137  (class class class)co 6924  cc 10272  cr 10273   + caddc 10277   · cmul 10279  cmin 10608   / cdiv 11035  cz 11733  +crp 12142  cfl 12915   mod cmo 12992
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1839  ax-4 1853  ax-5 1953  ax-6 2021  ax-7 2055  ax-8 2109  ax-9 2116  ax-10 2135  ax-11 2150  ax-12 2163  ax-13 2334  ax-ext 2754  ax-sep 5019  ax-nul 5027  ax-pow 5079  ax-pr 5140  ax-un 7228  ax-cnex 10330  ax-resscn 10331  ax-1cn 10332  ax-icn 10333  ax-addcl 10334  ax-addrcl 10335  ax-mulcl 10336  ax-mulrcl 10337  ax-mulcom 10338  ax-addass 10339  ax-mulass 10340  ax-distr 10341  ax-i2m1 10342  ax-1ne0 10343  ax-1rid 10344  ax-rnegex 10345  ax-rrecex 10346  ax-cnre 10347  ax-pre-lttri 10348  ax-pre-lttrn 10349  ax-pre-ltadd 10350  ax-pre-mulgt0 10351  ax-pre-sup 10352
This theorem depends on definitions:  df-bi 199  df-an 387  df-or 837  df-3or 1072  df-3an 1073  df-tru 1605  df-ex 1824  df-nf 1828  df-sb 2012  df-mo 2551  df-eu 2587  df-clab 2764  df-cleq 2770  df-clel 2774  df-nfc 2921  df-ne 2970  df-nel 3076  df-ral 3095  df-rex 3096  df-reu 3097  df-rmo 3098  df-rab 3099  df-v 3400  df-sbc 3653  df-csb 3752  df-dif 3795  df-un 3797  df-in 3799  df-ss 3806  df-pss 3808  df-nul 4142  df-if 4308  df-pw 4381  df-sn 4399  df-pr 4401  df-tp 4403  df-op 4405  df-uni 4674  df-iun 4757  df-br 4889  df-opab 4951  df-mpt 4968  df-tr 4990  df-id 5263  df-eprel 5268  df-po 5276  df-so 5277  df-fr 5316  df-we 5318  df-xp 5363  df-rel 5364  df-cnv 5365  df-co 5366  df-dm 5367  df-rn 5368  df-res 5369  df-ima 5370  df-pred 5935  df-ord 5981  df-on 5982  df-lim 5983  df-suc 5984  df-iota 6101  df-fun 6139  df-fn 6140  df-f 6141  df-f1 6142  df-fo 6143  df-f1o 6144  df-fv 6145  df-riota 6885  df-ov 6927  df-oprab 6928  df-mpt2 6929  df-om 7346  df-wrecs 7691  df-recs 7753  df-rdg 7791  df-er 8028  df-en 8244  df-dom 8245  df-sdom 8246  df-sup 8638  df-inf 8639  df-pnf 10415  df-mnf 10416  df-xr 10417  df-ltxr 10418  df-le 10419  df-sub 10610  df-neg 10611  df-div 11036  df-nn 11380  df-n0 11648  df-z 11734  df-uz 11998  df-rp 12143  df-fl 12917  df-mod 12993
This theorem is referenced by:  modaddabs  13032  modaddmod  13033  modadd12d  13050  modaddmulmod  13061  moddvds  15407  modsubi  16191  lgsvalmod  25504  lgsmod  25511  lgsne0  25523  lgseisen  25567  pellexlem6  38372
  Copyright terms: Public domain W3C validator