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 A0
3dvdsdec.b B0
3dvds2dec.c C0
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 A0
2 3dvdsdec.b B0
3 3dvds2dec.c C0
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 102=99+1
6 5 oveq1i 102A=99+1A
7 9nn0 90
8 7 7 deccl 990
9 8 nn0cni 99
10 ax-1cn 1
11 1 nn0cni A
12 9 10 11 adddiri 99+1A=99A+1A
13 11 mullidi 1A=A
14 13 oveq2i 99A+1A=99A+A
15 6 12 14 3eqtri 102A=99A+A
16 9p1e10 9+1=10
17 16 eqcomi 10=9+1
18 17 oveq1i 10B=9+1B
19 9cn 9
20 2 nn0cni B
21 19 10 20 adddiri 9+1B=9B+1B
22 20 mullidi 1B=B
23 22 oveq2i 9B+1B=9B+B
24 18 21 23 3eqtri 10B=9B+B
25 15 24 oveq12i 102A+10B=99A+A+9B+B
26 25 oveq1i 102A+10B+C=99A+A+9B+B+C
27 9 11 mulcli 99A
28 19 20 mulcli 9B
29 add4 99AA9BB99A+A+9B+B=99A+9B+A+B
30 29 oveq1d 99AA9BB99A+A+9B+B+C=99A+9B+A+B+C
31 27 11 28 20 30 mp4an 99A+A+9B+B+C=99A+9B+A+B+C
32 27 28 addcli 99A+9B
33 11 20 addcli A+B
34 3 nn0cni C
35 32 33 34 addassi 99A+9B+A+B+C=99A+9B+A+B+C
36 9t11e99 911=99
37 36 eqcomi 99=911
38 37 oveq1i 99A=911A
39 1nn0 10
40 39 39 deccl 110
41 40 nn0cni 11
42 19 41 11 mulassi 911A=911A
43 38 42 eqtri 99A=911A
44 43 oveq1i 99A+9B=911A+9B
45 41 11 mulcli 11A
46 19 45 20 adddii 911A+B=911A+9B
47 46 eqcomi 911A+9B=911A+B
48 3t3e9 33=9
49 48 eqcomi 9=33
50 49 oveq1i 911A+B=3311A+B
51 3cn 3
52 45 20 addcli 11A+B
53 51 51 52 mulassi 3311A+B=3311A+B
54 50 53 eqtri 911A+B=3311A+B
55 44 47 54 3eqtri 99A+9B=3311A+B
56 55 oveq1i 99A+9B+A+B+C=3311A+B+A+B+C
57 31 35 56 3eqtri 99A+A+9B+B+C=3311A+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 ABA+B
64 61 62 63 mp2an A+B
65 3 nn0zi C
66 zaddcl A+BCA+B+C
67 64 65 66 mp2an A+B+C
68 40 nn0zi 11
69 zmulcl 11A11A
70 68 61 69 mp2an 11A
71 zaddcl 11AB11A+B
72 70 62 71 mp2an 11A+B
73 zmulcl 311A+B311A+B
74 60 72 73 mp2an 311A+B
75 zmulcl 3311A+B3311A+B
76 60 74 75 mp2an 3311A+B
77 dvdsmul1 3311A+B33311A+B
78 60 74 77 mp2an 33311A+B
79 76 78 pm3.2i 3311A+B33311A+B
80 dvdsadd2b 3A+B+C3311A+B33311A+B3A+B+C33311A+B+A+B+C
81 60 67 79 80 mp3an 3A+B+C33311A+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 |-