Metamath Proof Explorer


Theorem 3dvds2dec

Description: A decimal number is divisible by three iff the sum of its three "digits" is divisible by three. The term "digits" in its narrow sense is only correct if A , B and C actually are digits (i.e. nonnegative integers less than 10). However, this theorem holds for arbitrary nonnegative integers A , B and C . (Contributed by AV, 14-Jun-2021) (Revised by AV, 1-Aug-2021)

Ref Expression
Hypotheses 3dvdsdec.a A 0
3dvdsdec.b B 0
3dvds2dec.c C 0
Assertion 3dvds2dec Could not format assertion : No typesetting found for |- ( 3 || ; ; A B C <-> 3 || ( ( A + B ) + C ) ) with typecode |-

Proof

Step Hyp Ref Expression
1 3dvdsdec.a A 0
2 3dvdsdec.b B 0
3 3dvds2dec.c C 0
4 1 2 3dec Could not format ; ; A B C = ( ( ( ( ; 1 0 ^ 2 ) x. A ) + ( ; 1 0 x. B ) ) + C ) : No typesetting found for |- ; ; A B C = ( ( ( ( ; 1 0 ^ 2 ) x. A ) + ( ; 1 0 x. B ) ) + C ) with typecode |-
5 sq10e99m1 10 2 = 99 + 1
6 5 oveq1i 10 2 A = 99 + 1 A
7 9nn0 9 0
8 7 7 deccl 99 0
9 8 nn0cni 99
10 ax-1cn 1
11 1 nn0cni A
12 9 10 11 adddiri 99 + 1 A = 99 A + 1 A
13 11 mulid2i 1 A = A
14 13 oveq2i 99 A + 1 A = 99 A + A
15 6 12 14 3eqtri 10 2 A = 99 A + A
16 9p1e10 9 + 1 = 10
17 16 eqcomi 10 = 9 + 1
18 17 oveq1i 10 B = 9 + 1 B
19 9cn 9
20 2 nn0cni B
21 19 10 20 adddiri 9 + 1 B = 9 B + 1 B
22 20 mulid2i 1 B = B
23 22 oveq2i 9 B + 1 B = 9 B + B
24 18 21 23 3eqtri 10 B = 9 B + B
25 15 24 oveq12i 10 2 A + 10 B = 99 A + A + 9 B + B
26 25 oveq1i 10 2 A + 10 B + C = 99 A + A + 9 B + B + C
27 9 11 mulcli 99 A
28 19 20 mulcli 9 B
29 add4 99 A A 9 B B 99 A + A + 9 B + B = 99 A + 9 B + A + B
30 29 oveq1d 99 A A 9 B B 99 A + A + 9 B + B + C = 99 A + 9 B + A + B + C
31 27 11 28 20 30 mp4an 99 A + A + 9 B + B + C = 99 A + 9 B + A + B + C
32 27 28 addcli 99 A + 9 B
33 11 20 addcli A + B
34 3 nn0cni C
35 32 33 34 addassi 99 A + 9 B + A + B + C = 99 A + 9 B + A + B + C
36 9t11e99 9 11 = 99
37 36 eqcomi 99 = 9 11
38 37 oveq1i 99 A = 9 11 A
39 1nn0 1 0
40 39 39 deccl 11 0
41 40 nn0cni 11
42 19 41 11 mulassi 9 11 A = 9 11 A
43 38 42 eqtri 99 A = 9 11 A
44 43 oveq1i 99 A + 9 B = 9 11 A + 9 B
45 41 11 mulcli 11 A
46 19 45 20 adddii 9 11 A + B = 9 11 A + 9 B
47 46 eqcomi 9 11 A + 9 B = 9 11 A + B
48 3t3e9 3 3 = 9
49 48 eqcomi 9 = 3 3
50 49 oveq1i 9 11 A + B = 3 3 11 A + B
51 3cn 3
52 45 20 addcli 11 A + B
53 51 51 52 mulassi 3 3 11 A + B = 3 3 11 A + B
54 50 53 eqtri 9 11 A + B = 3 3 11 A + B
55 44 47 54 3eqtri 99 A + 9 B = 3 3 11 A + B
56 55 oveq1i 99 A + 9 B + A + B + C = 3 3 11 A + B + A + B + C
57 31 35 56 3eqtri 99 A + A + 9 B + B + C = 3 3 11 A + B + A + B + C
58 4 26 57 3eqtri Could not format ; ; A B C = ( ( 3 x. ( 3 x. ( ( ; 1 1 x. A ) + B ) ) ) + ( ( A + B ) + C ) ) : No typesetting found for |- ; ; A B C = ( ( 3 x. ( 3 x. ( ( ; 1 1 x. A ) + B ) ) ) + ( ( A + B ) + C ) ) with typecode |-
59 58 breq2i Could not format ( 3 || ; ; A B C <-> 3 || ( ( 3 x. ( 3 x. ( ( ; 1 1 x. A ) + B ) ) ) + ( ( A + B ) + C ) ) ) : No typesetting found for |- ( 3 || ; ; A B C <-> 3 || ( ( 3 x. ( 3 x. ( ( ; 1 1 x. A ) + B ) ) ) + ( ( A + B ) + C ) ) ) with typecode |-
60 3z 3
61 1 nn0zi A
62 2 nn0zi B
63 zaddcl A B A + B
64 61 62 63 mp2an A + B
65 3 nn0zi C
66 zaddcl A + B C A + B + C
67 64 65 66 mp2an A + B + C
68 40 nn0zi 11
69 zmulcl 11 A 11 A
70 68 61 69 mp2an 11 A
71 zaddcl 11 A B 11 A + B
72 70 62 71 mp2an 11 A + B
73 zmulcl 3 11 A + B 3 11 A + B
74 60 72 73 mp2an 3 11 A + B
75 zmulcl 3 3 11 A + B 3 3 11 A + B
76 60 74 75 mp2an 3 3 11 A + B
77 dvdsmul1 3 3 11 A + B 3 3 3 11 A + B
78 60 74 77 mp2an 3 3 3 11 A + B
79 76 78 pm3.2i 3 3 11 A + B 3 3 3 11 A + B
80 dvdsadd2b 3 A + B + C 3 3 11 A + B 3 3 3 11 A + B 3 A + B + C 3 3 3 11 A + B + A + B + C
81 60 67 79 80 mp3an 3 A + B + C 3 3 3 11 A + B + A + B + C
82 59 81 bitr4i Could not format ( 3 || ; ; A B C <-> 3 || ( ( A + B ) + C ) ) : No typesetting found for |- ( 3 || ; ; A B C <-> 3 || ( ( A + B ) + C ) ) with typecode |-