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

Theorem 3dvdsdec 16391
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 12715 . . . 4 𝐴𝐵 = ((10 · 𝐴) + 𝐵)
2 9p1e10 12714 . . . . . . . 8 (9 + 1) = 10
32eqcomi 2772 . . . . . . 7 10 = (9 + 1)
43oveq1i 7422 . . . . . 6 (10 · 𝐴) = ((9 + 1) · 𝐴)
5 9cn 12342 . . . . . . 7 9 ∈ ℂ
6 ax-1cn 11159 . . . . . . 7 1 ∈ ℂ
7 3dvdsdec.a . . . . . . . 8 𝐴 ∈ ℕ0
87nn0cni 12517 . . . . . . 7 𝐴 ∈ ℂ
95, 6, 8adddiri 11223 . . . . . 6 ((9 + 1) · 𝐴) = ((9 · 𝐴) + (1 · 𝐴))
108mullidi 11215 . . . . . . 7 (1 · 𝐴) = 𝐴
1110oveq2i 7423 . . . . . 6 ((9 · 𝐴) + (1 · 𝐴)) = ((9 · 𝐴) + 𝐴)
124, 9, 113eqtri 2790 . . . . 5 (10 · 𝐴) = ((9 · 𝐴) + 𝐴)
1312oveq1i 7422 . . . 4 ((10 · 𝐴) + 𝐵) = (((9 · 𝐴) + 𝐴) + 𝐵)
145, 8mulcli 11217 . . . . 5 (9 · 𝐴) ∈ ℂ
15 3dvdsdec.b . . . . . 6 𝐵 ∈ ℕ0
1615nn0cni 12517 . . . . 5 𝐵 ∈ ℂ
1714, 8, 16addassi 11220 . . . 4 (((9 · 𝐴) + 𝐴) + 𝐵) = ((9 · 𝐴) + (𝐴 + 𝐵))
181, 13, 173eqtri 2790 . . 3 𝐴𝐵 = ((9 · 𝐴) + (𝐴 + 𝐵))
1918breq2i 5118 . 2 (3 ∥ 𝐴𝐵 ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
20 3z 12628 . . 3 3 ∈ ℤ
217nn0zi 12620 . . . 4 𝐴 ∈ ℤ
2215nn0zi 12620 . . . 4 𝐵 ∈ ℤ
23 zaddcl 12635 . . . 4 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 + 𝐵) ∈ ℤ)
2421, 22, 23mp2an 704 . . 3 (𝐴 + 𝐵) ∈ ℤ
25 9nn 12340 . . . . . 6 9 ∈ ℕ
2625nnzi 12619 . . . . 5 9 ∈ ℤ
27 zmulcl 12644 . . . . 5 ((9 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (9 · 𝐴) ∈ ℤ)
2826, 21, 27mp2an 704 . . . 4 (9 · 𝐴) ∈ ℤ
29 zmulcl 12644 . . . . . . 7 ((3 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (3 · 𝐴) ∈ ℤ)
3020, 21, 29mp2an 704 . . . . . 6 (3 · 𝐴) ∈ ℤ
31 dvdsmul1 16336 . . . . . 6 ((3 ∈ ℤ ∧ (3 · 𝐴) ∈ ℤ) → 3 ∥ (3 · (3 · 𝐴)))
3220, 30, 31mp2an 704 . . . . 5 3 ∥ (3 · (3 · 𝐴))
33 3t3e9 12409 . . . . . . . 8 (3 · 3) = 9
3433eqcomi 2772 . . . . . . 7 9 = (3 · 3)
3534oveq1i 7422 . . . . . 6 (9 · 𝐴) = ((3 · 3) · 𝐴)
36 3cn 12323 . . . . . . 7 3 ∈ ℂ
3736, 36, 8mulassi 11221 . . . . . 6 ((3 · 3) · 𝐴) = (3 · (3 · 𝐴))
3835, 37eqtri 2786 . . . . 5 (9 · 𝐴) = (3 · (3 · 𝐴))
3932, 38breqtrri 5139 . . . 4 3 ∥ (9 · 𝐴)
4028, 39pm3.2i 475 . . 3 ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))
41 dvdsadd2b 16365 . . 3 ((3 ∈ ℤ ∧ (𝐴 + 𝐵) ∈ ℤ ∧ ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))) → (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵))))
4220, 24, 40, 41mp3an 1490 . 2 (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
4319, 42bitr4i 281 1 (3 ∥ 𝐴𝐵 ↔ 3 ∥ (𝐴 + 𝐵))
Colors of variables: wff setvar class
Syntax hints:  wb 209  wa 400  wcel 2143   class class class wbr 5110  (class class class)co 7412  0cc0 11101  1c1 11102   + caddc 11104   · cmul 11106  3c3 12297  9c9 12303  0cn0 12505  cz 12592  cdc 12712  cdvds 16311
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1825  ax-4 1839  ax-5 1940  ax-6 1997  ax-7 2038  ax-8 2145  ax-9 2153  ax-10 2176  ax-11 2192  ax-12 2213  ax-ext 2735  ax-sep 5258  ax-nul 5270  ax-pow 5338  ax-pr 5406  ax-un 7734  ax-resscn 11158  ax-1cn 11159  ax-icn 11160  ax-addcl 11161  ax-addrcl 11162  ax-mulcl 11163  ax-mulrcl 11164  ax-mulcom 11165  ax-addass 11166  ax-mulass 11167  ax-distr 11168  ax-i2m1 11169  ax-1ne0 11170  ax-1rid 11171  ax-rnegex 11172  ax-rrecex 11173  ax-cnre 11174  ax-pre-lttri 11175  ax-pre-lttrn 11176  ax-pre-ltadd 11177  ax-pre-mulgt0 11178
This theorem depends on definitions:  df-bi 210  df-an 401  df-or 861  df-3or 1104  df-3an 1105  df-tru 1573  df-fal 1583  df-ex 1810  df-nf 1814  df-sb 2097  df-mo 2567  df-eu 2597  df-clab 2742  df-cleq 2755  df-clel 2838  df-nfc 2912  df-ne 2959  df-nel 3065  df-ral 3080  df-rex 3090  df-reu 3370  df-rab 3417  df-v 3457  df-sbc 3746  df-csb 3855  df-dif 3909  df-un 3911  df-in 3913  df-ss 3923  df-pss 3926  df-nul 4288  df-if 4489  df-pw 4565  df-sn 4591  df-pr 4593  df-op 4597  df-uni 4874  df-iun 4959  df-br 5111  df-opab 5175  df-mpt 5194  df-tr 5220  df-id 5558  df-eprel 5563  df-po 5571  df-so 5572  df-fr 5616  df-we 5618  df-xp 5669  df-rel 5670  df-cnv 5671  df-co 5672  df-dm 5673  df-rn 5674  df-res 5675  df-ima 5676  df-pred 6304  df-ord 6365  df-on 6366  df-lim 6367  df-suc 6368  df-iota 6494  df-fun 6540  df-fn 6541  df-f 6542  df-f1 6543  df-fo 6544  df-f1o 6545  df-fv 6546  df-riota 7369  df-ov 7415  df-oprab 7416  df-mpo 7417  df-om 7864  df-2nd 7988  df-frecs 8279  df-wrecs 8310  df-recs 8359  df-rdg 8398  df-er 8695  df-en 8945  df-dom 8946  df-sdom 8947  df-pnf 11246  df-mnf 11247  df-xr 11248  df-ltxr 11249  df-le 11250  df-sub 11444  df-neg 11445  df-nn 12235  df-2 12304  df-3 12305  df-4 12306  df-5 12307  df-6 12308  df-7 12309  df-8 12310  df-9 12311  df-n0 12506  df-z 12593  df-dec 12713  df-dvds 16312
This theorem is referenced by:  257prm  48290  139prmALT  48325  31prm  48326
  Copyright terms: Public domain W3C validator