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

Theorem 3dvdsdec 16262
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 12667 . . . 4 𝐴𝐵 = ((10 · 𝐴) + 𝐵)
2 9p1e10 12666 . . . . . . . 8 (9 + 1) = 10
32eqcomi 2742 . . . . . . 7 10 = (9 + 1)
43oveq1i 7406 . . . . . 6 (10 · 𝐴) = ((9 + 1) · 𝐴)
5 9cn 12299 . . . . . . 7 9 ∈ ℂ
6 ax-1cn 11155 . . . . . . 7 1 ∈ ℂ
7 3dvdsdec.a . . . . . . . 8 𝐴 ∈ ℕ0
87nn0cni 12471 . . . . . . 7 𝐴 ∈ ℂ
95, 6, 8adddiri 11214 . . . . . 6 ((9 + 1) · 𝐴) = ((9 · 𝐴) + (1 · 𝐴))
108mullidi 11206 . . . . . . 7 (1 · 𝐴) = 𝐴
1110oveq2i 7407 . . . . . 6 ((9 · 𝐴) + (1 · 𝐴)) = ((9 · 𝐴) + 𝐴)
124, 9, 113eqtri 2765 . . . . 5 (10 · 𝐴) = ((9 · 𝐴) + 𝐴)
1312oveq1i 7406 . . . 4 ((10 · 𝐴) + 𝐵) = (((9 · 𝐴) + 𝐴) + 𝐵)
145, 8mulcli 11208 . . . . 5 (9 · 𝐴) ∈ ℂ
15 3dvdsdec.b . . . . . 6 𝐵 ∈ ℕ0
1615nn0cni 12471 . . . . 5 𝐵 ∈ ℂ
1714, 8, 16addassi 11211 . . . 4 (((9 · 𝐴) + 𝐴) + 𝐵) = ((9 · 𝐴) + (𝐴 + 𝐵))
181, 13, 173eqtri 2765 . . 3 𝐴𝐵 = ((9 · 𝐴) + (𝐴 + 𝐵))
1918breq2i 5152 . 2 (3 ∥ 𝐴𝐵 ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
20 3z 12582 . . 3 3 ∈ ℤ
217nn0zi 12574 . . . 4 𝐴 ∈ ℤ
2215nn0zi 12574 . . . 4 𝐵 ∈ ℤ
23 zaddcl 12589 . . . 4 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 + 𝐵) ∈ ℤ)
2421, 22, 23mp2an 691 . . 3 (𝐴 + 𝐵) ∈ ℤ
25 9nn 12297 . . . . . 6 9 ∈ ℕ
2625nnzi 12573 . . . . 5 9 ∈ ℤ
27 zmulcl 12598 . . . . 5 ((9 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (9 · 𝐴) ∈ ℤ)
2826, 21, 27mp2an 691 . . . 4 (9 · 𝐴) ∈ ℤ
29 zmulcl 12598 . . . . . . 7 ((3 ∈ ℤ ∧ 𝐴 ∈ ℤ) → (3 · 𝐴) ∈ ℤ)
3020, 21, 29mp2an 691 . . . . . 6 (3 · 𝐴) ∈ ℤ
31 dvdsmul1 16208 . . . . . 6 ((3 ∈ ℤ ∧ (3 · 𝐴) ∈ ℤ) → 3 ∥ (3 · (3 · 𝐴)))
3220, 30, 31mp2an 691 . . . . 5 3 ∥ (3 · (3 · 𝐴))
33 3t3e9 12366 . . . . . . . 8 (3 · 3) = 9
3433eqcomi 2742 . . . . . . 7 9 = (3 · 3)
3534oveq1i 7406 . . . . . 6 (9 · 𝐴) = ((3 · 3) · 𝐴)
36 3cn 12280 . . . . . . 7 3 ∈ ℂ
3736, 36, 8mulassi 11212 . . . . . 6 ((3 · 3) · 𝐴) = (3 · (3 · 𝐴))
3835, 37eqtri 2761 . . . . 5 (9 · 𝐴) = (3 · (3 · 𝐴))
3932, 38breqtrri 5171 . . . 4 3 ∥ (9 · 𝐴)
4028, 39pm3.2i 472 . . 3 ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))
41 dvdsadd2b 16236 . . 3 ((3 ∈ ℤ ∧ (𝐴 + 𝐵) ∈ ℤ ∧ ((9 · 𝐴) ∈ ℤ ∧ 3 ∥ (9 · 𝐴))) → (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵))))
4220, 24, 40, 41mp3an 1462 . 2 (3 ∥ (𝐴 + 𝐵) ↔ 3 ∥ ((9 · 𝐴) + (𝐴 + 𝐵)))
4319, 42bitr4i 278 1 (3 ∥ 𝐴𝐵 ↔ 3 ∥ (𝐴 + 𝐵))
Colors of variables: wff setvar class
Syntax hints:  wb 205  wa 397  wcel 2107   class class class wbr 5144  (class class class)co 7396  0cc0 11097  1c1 11098   + caddc 11100   · cmul 11102  3c3 12255  9c9 12261  0cn0 12459  cz 12545  cdc 12664  cdvds 16184
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2704  ax-sep 5295  ax-nul 5302  ax-pow 5359  ax-pr 5423  ax-un 7712  ax-resscn 11154  ax-1cn 11155  ax-icn 11156  ax-addcl 11157  ax-addrcl 11158  ax-mulcl 11159  ax-mulrcl 11160  ax-mulcom 11161  ax-addass 11162  ax-mulass 11163  ax-distr 11164  ax-i2m1 11165  ax-1ne0 11166  ax-1rid 11167  ax-rnegex 11168  ax-rrecex 11169  ax-cnre 11170  ax-pre-lttri 11171  ax-pre-lttrn 11172  ax-pre-ltadd 11173  ax-pre-mulgt0 11174
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2535  df-eu 2564  df-clab 2711  df-cleq 2725  df-clel 2811  df-nfc 2886  df-ne 2942  df-nel 3048  df-ral 3063  df-rex 3072  df-reu 3378  df-rab 3434  df-v 3477  df-sbc 3776  df-csb 3892  df-dif 3949  df-un 3951  df-in 3953  df-ss 3963  df-pss 3965  df-nul 4321  df-if 4525  df-pw 4600  df-sn 4625  df-pr 4627  df-op 4631  df-uni 4905  df-iun 4995  df-br 5145  df-opab 5207  df-mpt 5228  df-tr 5262  df-id 5570  df-eprel 5576  df-po 5584  df-so 5585  df-fr 5627  df-we 5629  df-xp 5678  df-rel 5679  df-cnv 5680  df-co 5681  df-dm 5682  df-rn 5683  df-res 5684  df-ima 5685  df-pred 6292  df-ord 6359  df-on 6360  df-lim 6361  df-suc 6362  df-iota 6487  df-fun 6537  df-fn 6538  df-f 6539  df-f1 6540  df-fo 6541  df-f1o 6542  df-fv 6543  df-riota 7352  df-ov 7399  df-oprab 7400  df-mpo 7401  df-om 7843  df-2nd 7963  df-frecs 8253  df-wrecs 8284  df-recs 8358  df-rdg 8397  df-er 8691  df-en 8928  df-dom 8929  df-sdom 8930  df-pnf 11237  df-mnf 11238  df-xr 11239  df-ltxr 11240  df-le 11241  df-sub 11433  df-neg 11434  df-nn 12200  df-2 12262  df-3 12263  df-4 12264  df-5 12265  df-6 12266  df-7 12267  df-8 12268  df-9 12269  df-n0 12460  df-z 12546  df-dec 12665  df-dvds 16185
This theorem is referenced by:  257prm  46102  139prmALT  46137  31prm  46138
  Copyright terms: Public domain W3C validator