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

Theorem 3dvdsdec 15531
Description: A decimal number is divisible by three iff the sum of its two "digits" is divisible by three. The term "digits" in its narrow sense is only correct if 𝐴 and 𝐵 actually are digits (i.e. nonnegative integers less than 10). However, this theorem holds for arbitrary nonnegative integers 𝐴 and 𝐵, especially if 𝐴 is itself a decimal number, e.g. 𝐴 = 𝐶𝐷. (Contributed by AV, 14-Jun-2021.) (Revised by AV, 8-Sep-2021.)
Hypotheses
Ref Expression
3dvdsdec.a 𝐴 ∈ ℕ0
3dvdsdec.b 𝐵 ∈ ℕ0
Assertion
Ref Expression
3dvdsdec (3 ∥ 𝐴𝐵 ↔ 3 ∥ (𝐴 + 𝐵))

Proof of Theorem 3dvdsdec
StepHypRef Expression
1 dfdec10 11907 . . . 4 𝐴𝐵 = ((10 · 𝐴) + 𝐵)
2 9p1e10 11906 . . . . . . . 8 (9 + 1) = 10
32eqcomi 2781 . . . . . . 7 10 = (9 + 1)
43oveq1i 6980 . . . . . 6 (10 · 𝐴) = ((9 + 1) · 𝐴)
5 9cn 11539 . . . . . . 7 9 ∈ ℂ
6 ax-1cn 10385 . . . . . . 7 1 ∈ ℂ
7 3dvdsdec.a . . . . . . . 8 𝐴 ∈ ℕ0
87nn0cni 11713 . . . . . . 7 𝐴 ∈ ℂ
95, 6, 8adddiri 10445 . . . . . 6 ((9 + 1) · 𝐴) = ((9 · 𝐴) + (1 · 𝐴))
108mulid2i 10437 . . . . . . 7 (1 · 𝐴) = 𝐴
1110oveq2i 6981 . . . . . 6 ((9 · 𝐴) + (1 · 𝐴)) = ((9 · 𝐴) + 𝐴)
124, 9, 113eqtri 2800 . . . . 5 (10 · 𝐴) = ((9 · 𝐴) + 𝐴)
1312oveq1i 6980 . . . 4 ((10 · 𝐴) + 𝐵) = (((9 · 𝐴) + 𝐴) + 𝐵)
145, 8mulcli 10439 . . . . 5 (9 · 𝐴) ∈ ℂ
15 3dvdsdec.b . . . . . 6 𝐵 ∈ ℕ0
1615nn0cni 11713 . . . . 5 𝐵 ∈ ℂ
1714, 8, 16addassi 10442 . . . 4 (((9 · 𝐴) + 𝐴) + 𝐵) = ((9 · 𝐴) + (𝐴 + 𝐵))
181, 13, 173eqtri 2800 . . 3 𝐴𝐵 = ((9 · 𝐴) + (𝐴 + 𝐵))
1918breq2i 4931 . 2 (3 ∥ 𝐴𝐵 ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
20 3z 11821 . . 3 3 ∈ ℤ
217nn0zi 11813 . . . 4 𝐴 ∈ ℤ
2215nn0zi 11813 . . . 4 𝐵 ∈ ℤ
23 zaddcl 11828 . . . 4 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 + 𝐵) ∈ ℤ)
2421, 22, 23mp2an 679 . . 3 (𝐴 + 𝐵) ∈ ℤ
25 9nn 11537 . . . . . 6 9 ∈ ℕ
2625nnzi 11812 . . . . 5 9 ∈ ℤ
27 zmulcl 11837 . . . . 5 ((9 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (9 · 𝐴) ∈ ℤ)
2826, 21, 27mp2an 679 . . . 4 (9 · 𝐴) ∈ ℤ
29 zmulcl 11837 . . . . . . 7 ((3 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (3 · 𝐴) ∈ ℤ)
3020, 21, 29mp2an 679 . . . . . 6 (3 · 𝐴) ∈ ℤ
31 dvdsmul1 15481 . . . . . 6 ((3 ∈ ℤ ∧ (3 · 𝐴) ∈ ℤ) → 3 ∥ (3 · (3 · 𝐴)))
3220, 30, 31mp2an 679 . . . . 5 3 ∥ (3 · (3 · 𝐴))
33 3t3e9 11607 . . . . . . . 8 (3 · 3) = 9
3433eqcomi 2781 . . . . . . 7 9 = (3 · 3)
3534oveq1i 6980 . . . . . 6 (9 · 𝐴) = ((3 · 3) · 𝐴)
36 3cn 11514 . . . . . . 7 3 ∈ ℂ
3736, 36, 8mulassi 10443 . . . . . 6 ((3 · 3) · 𝐴) = (3 · (3 · 𝐴))
3835, 37eqtri 2796 . . . . 5 (9 · 𝐴) = (3 · (3 · 𝐴))
3932, 38breqtrri 4950 . . . 4 3 ∥ (9 · 𝐴)
4028, 39pm3.2i 463 . . 3 ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))
41 dvdsadd2b 15506 . . 3 ((3 ∈ ℤ ∧ (𝐴 + 𝐵) ∈ ℤ ∧ ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))) → (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵))))
4220, 24, 40, 41mp3an 1440 . 2 (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
4319, 42bitr4i 270 1 (3 ∥ 𝐴𝐵 ↔ 3 ∥ (𝐴 + 𝐵))
Colors of variables: wff setvar class
Syntax hints:  wb 198  wa 387  wcel 2048   class class class wbr 4923  (class class class)co 6970  0cc0 10327  1c1 10328   + caddc 10330   · cmul 10332  3c3 11489  9c9 11495  0cn0 11700  cz 11786  cdc 11904  cdvds 15457
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1758  ax-4 1772  ax-5 1869  ax-6 1928  ax-7 1964  ax-8 2050  ax-9 2057  ax-10 2077  ax-11 2091  ax-12 2104  ax-13 2299  ax-ext 2745  ax-sep 5054  ax-nul 5061  ax-pow 5113  ax-pr 5180  ax-un 7273  ax-resscn 10384  ax-1cn 10385  ax-icn 10386  ax-addcl 10387  ax-addrcl 10388  ax-mulcl 10389  ax-mulrcl 10390  ax-mulcom 10391  ax-addass 10392  ax-mulass 10393  ax-distr 10394  ax-i2m1 10395  ax-1ne0 10396  ax-1rid 10397  ax-rnegex 10398  ax-rrecex 10399  ax-cnre 10400  ax-pre-lttri 10401  ax-pre-lttrn 10402  ax-pre-ltadd 10403  ax-pre-mulgt0 10404
This theorem depends on definitions:  df-bi 199  df-an 388  df-or 834  df-3or 1069  df-3an 1070  df-tru 1510  df-ex 1743  df-nf 1747  df-sb 2014  df-mo 2544  df-eu 2580  df-clab 2754  df-cleq 2765  df-clel 2840  df-nfc 2912  df-ne 2962  df-nel 3068  df-ral 3087  df-rex 3088  df-reu 3089  df-rab 3091  df-v 3411  df-sbc 3678  df-csb 3783  df-dif 3828  df-un 3830  df-in 3832  df-ss 3839  df-pss 3841  df-nul 4174  df-if 4345  df-pw 4418  df-sn 4436  df-pr 4438  df-tp 4440  df-op 4442  df-uni 4707  df-iun 4788  df-br 4924  df-opab 4986  df-mpt 5003  df-tr 5025  df-id 5305  df-eprel 5310  df-po 5319  df-so 5320  df-fr 5359  df-we 5361  df-xp 5406  df-rel 5407  df-cnv 5408  df-co 5409  df-dm 5410  df-rn 5411  df-res 5412  df-ima 5413  df-pred 5980  df-ord 6026  df-on 6027  df-lim 6028  df-suc 6029  df-iota 6146  df-fun 6184  df-fn 6185  df-f 6186  df-f1 6187  df-fo 6188  df-f1o 6189  df-fv 6190  df-riota 6931  df-ov 6973  df-oprab 6974  df-mpo 6975  df-om 7391  df-wrecs 7743  df-recs 7805  df-rdg 7843  df-er 8081  df-en 8299  df-dom 8300  df-sdom 8301  df-pnf 10468  df-mnf 10469  df-xr 10470  df-ltxr 10471  df-le 10472  df-sub 10664  df-neg 10665  df-nn 11432  df-2 11496  df-3 11497  df-4 11498  df-5 11499  df-6 11500  df-7 11501  df-8 11502  df-9 11503  df-n0 11701  df-z 11787  df-dec 11905  df-dvds 15458
This theorem is referenced by:  257prm  43031  139prmALT  43067  31prm  43068
  Copyright terms: Public domain W3C validator