ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  3dvds2dec Unicode version

Theorem 3dvds2dec 10748
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.)
Hypotheses
Ref Expression
3dvdsdec.a  |-  A  e. 
NN0
3dvdsdec.b  |-  B  e. 
NN0
3dvds2dec.c  |-  C  e. 
NN0
Assertion
Ref Expression
3dvds2dec  |-  ( 3 
|| ;; A B C  <->  3  ||  ( ( A  +  B )  +  C
) )

Proof of Theorem 3dvds2dec
StepHypRef Expression
1 3dvdsdec.a . . . . 5  |-  A  e. 
NN0
2 3dvdsdec.b . . . . 5  |-  B  e. 
NN0
31, 23dec 10020 . . . 4  |- ;; A B C  =  (
( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  +  C
)
4 sq10e99m1 10019 . . . . . . . 8  |-  (; 1 0 ^ 2 )  =  (; 9 9  +  1 )
54oveq1i 5623 . . . . . . 7  |-  ( (; 1
0 ^ 2 )  x.  A )  =  ( (; 9 9  +  1 )  x.  A )
6 9nn0 8630 . . . . . . . . . 10  |-  9  e.  NN0
76, 6deccl 8823 . . . . . . . . 9  |- ; 9 9  e.  NN0
87nn0cni 8618 . . . . . . . 8  |- ; 9 9  e.  CC
9 ax-1cn 7382 . . . . . . . 8  |-  1  e.  CC
101nn0cni 8618 . . . . . . . 8  |-  A  e.  CC
118, 9, 10adddiri 7443 . . . . . . 7  |-  ( (; 9
9  +  1 )  x.  A )  =  ( (; 9 9  x.  A
)  +  ( 1  x.  A ) )
1210mulid2i 7435 . . . . . . . 8  |-  ( 1  x.  A )  =  A
1312oveq2i 5624 . . . . . . 7  |-  ( (; 9
9  x.  A )  +  ( 1  x.  A ) )  =  ( (; 9 9  x.  A
)  +  A )
145, 11, 133eqtri 2109 . . . . . 6  |-  ( (; 1
0 ^ 2 )  x.  A )  =  ( (; 9 9  x.  A
)  +  A )
15 9p1e10 8811 . . . . . . . . 9  |-  ( 9  +  1 )  = ; 1
0
1615eqcomi 2089 . . . . . . . 8  |- ; 1 0  =  ( 9  +  1 )
1716oveq1i 5623 . . . . . . 7  |-  (; 1 0  x.  B
)  =  ( ( 9  +  1 )  x.  B )
18 9cn 8445 . . . . . . . 8  |-  9  e.  CC
192nn0cni 8618 . . . . . . . 8  |-  B  e.  CC
2018, 9, 19adddiri 7443 . . . . . . 7  |-  ( ( 9  +  1 )  x.  B )  =  ( ( 9  x.  B )  +  ( 1  x.  B ) )
2119mulid2i 7435 . . . . . . . 8  |-  ( 1  x.  B )  =  B
2221oveq2i 5624 . . . . . . 7  |-  ( ( 9  x.  B )  +  ( 1  x.  B ) )  =  ( ( 9  x.  B )  +  B
)
2317, 20, 223eqtri 2109 . . . . . 6  |-  (; 1 0  x.  B
)  =  ( ( 9  x.  B )  +  B )
2414, 23oveq12i 5625 . . . . 5  |-  ( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  =  ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )
2524oveq1i 5623 . . . 4  |-  ( ( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  +  C
)  =  ( ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )
268, 10mulcli 7437 . . . . . 6  |-  (; 9 9  x.  A
)  e.  CC
2718, 19mulcli 7437 . . . . . 6  |-  ( 9  x.  B )  e.  CC
28 add4 7587 . . . . . . 7  |-  ( ( ( (; 9 9  x.  A
)  e.  CC  /\  A  e.  CC )  /\  ( ( 9  x.  B )  e.  CC  /\  B  e.  CC ) )  ->  ( (
(; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  =  ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) ) )
2928oveq1d 5628 . . . . . 6  |-  ( ( ( (; 9 9  x.  A
)  e.  CC  /\  A  e.  CC )  /\  ( ( 9  x.  B )  e.  CC  /\  B  e.  CC ) )  ->  ( (
( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )  =  ( ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) )  +  C ) )
3026, 10, 27, 19, 29mp4an 418 . . . . 5  |-  ( ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )  =  ( ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) )  +  C )
3126, 27addcli 7436 . . . . . 6  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  e.  CC
3210, 19addcli 7436 . . . . . 6  |-  ( A  +  B )  e.  CC
33 3dvds2dec.c . . . . . . 7  |-  C  e. 
NN0
3433nn0cni 8618 . . . . . 6  |-  C  e.  CC
3531, 32, 34addassi 7440 . . . . 5  |-  ( ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) )  +  C )  =  ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( ( A  +  B )  +  C ) )
36 9t11e99 8938 . . . . . . . . . . 11  |-  ( 9  x. ; 1 1 )  = ; 9
9
3736eqcomi 2089 . . . . . . . . . 10  |- ; 9 9  =  ( 9  x. ; 1 1 )
3837oveq1i 5623 . . . . . . . . 9  |-  (; 9 9  x.  A
)  =  ( ( 9  x. ; 1 1 )  x.  A )
39 1nn0 8622 . . . . . . . . . . . 12  |-  1  e.  NN0
4039, 39deccl 8823 . . . . . . . . . . 11  |- ; 1 1  e.  NN0
4140nn0cni 8618 . . . . . . . . . 10  |- ; 1 1  e.  CC
4218, 41, 10mulassi 7441 . . . . . . . . 9  |-  ( ( 9  x. ; 1 1 )  x.  A )  =  ( 9  x.  (; 1 1  x.  A
) )
4338, 42eqtri 2105 . . . . . . . 8  |-  (; 9 9  x.  A
)  =  ( 9  x.  (; 1 1  x.  A
) )
4443oveq1i 5623 . . . . . . 7  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  =  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )
4541, 10mulcli 7437 . . . . . . . . 9  |-  (; 1 1  x.  A
)  e.  CC
4618, 45, 19adddii 7442 . . . . . . . 8  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )
4746eqcomi 2089 . . . . . . 7  |-  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )  =  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )
48 3t3e9 8507 . . . . . . . . . 10  |-  ( 3  x.  3 )  =  9
4948eqcomi 2089 . . . . . . . . 9  |-  9  =  ( 3  x.  3 )
5049oveq1i 5623 . . . . . . . 8  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( ( 3  x.  3 )  x.  ( (; 1 1  x.  A
)  +  B ) )
51 3cn 8432 . . . . . . . . 9  |-  3  e.  CC
5245, 19addcli 7436 . . . . . . . . 9  |-  ( (; 1
1  x.  A )  +  B )  e.  CC
5351, 51, 52mulassi 7441 . . . . . . . 8  |-  ( ( 3  x.  3 )  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )
5450, 53eqtri 2105 . . . . . . 7  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )
5544, 47, 543eqtri 2109 . . . . . 6  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  =  ( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )
5655oveq1i 5623 . . . . 5  |-  ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( ( A  +  B )  +  C ) )  =  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  +  ( ( A  +  B
)  +  C ) )
5730, 35, 563eqtri 2109 . . . 4  |-  ( ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )  =  ( ( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )  +  ( ( A  +  B )  +  C ) )
583, 25, 573eqtri 2109 . . 3  |- ;; A B C  =  (
( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )  +  ( ( A  +  B )  +  C ) )
5958breq2i 3828 . 2  |-  ( 3 
|| ;; A B C  <->  3  ||  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  +  ( ( A  +  B
)  +  C ) ) )
60 3z 8712 . . 3  |-  3  e.  ZZ
611nn0zi 8705 . . . . 5  |-  A  e.  ZZ
622nn0zi 8705 . . . . 5  |-  B  e.  ZZ
63 zaddcl 8723 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( A  +  B
)  e.  ZZ )
6461, 62, 63mp2an 417 . . . 4  |-  ( A  +  B )  e.  ZZ
6533nn0zi 8705 . . . 4  |-  C  e.  ZZ
66 zaddcl 8723 . . . 4  |-  ( ( ( A  +  B
)  e.  ZZ  /\  C  e.  ZZ )  ->  ( ( A  +  B )  +  C
)  e.  ZZ )
6764, 65, 66mp2an 417 . . 3  |-  ( ( A  +  B )  +  C )  e.  ZZ
6840nn0zi 8705 . . . . . . . 8  |- ; 1 1  e.  ZZ
69 zmulcl 8736 . . . . . . . 8  |-  ( (; 1
1  e.  ZZ  /\  A  e.  ZZ )  ->  (; 1 1  x.  A
)  e.  ZZ )
7068, 61, 69mp2an 417 . . . . . . 7  |-  (; 1 1  x.  A
)  e.  ZZ
71 zaddcl 8723 . . . . . . 7  |-  ( ( (; 1 1  x.  A
)  e.  ZZ  /\  B  e.  ZZ )  ->  ( (; 1 1  x.  A
)  +  B )  e.  ZZ )
7270, 62, 71mp2an 417 . . . . . 6  |-  ( (; 1
1  x.  A )  +  B )  e.  ZZ
73 zmulcl 8736 . . . . . 6  |-  ( ( 3  e.  ZZ  /\  ( (; 1 1  x.  A
)  +  B )  e.  ZZ )  -> 
( 3  x.  (
(; 1 1  x.  A
)  +  B ) )  e.  ZZ )
7460, 72, 73mp2an 417 . . . . 5  |-  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) )  e.  ZZ
75 zmulcl 8736 . . . . 5  |-  ( ( 3  e.  ZZ  /\  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) )  e.  ZZ )  ->  ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  e.  ZZ )
7660, 74, 75mp2an 417 . . . 4  |-  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )  e.  ZZ
77 dvdsmul1 10700 . . . . 5  |-  ( ( 3  e.  ZZ  /\  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) )  e.  ZZ )  ->  3  ||  (
3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) ) )
7860, 74, 77mp2an 417 . . . 4  |-  3  ||  ( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )
7976, 78pm3.2i 266 . . 3  |-  ( ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )  e.  ZZ  /\  3  ||  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) ) )
80 dvdsadd2b 10725 . . 3  |-  ( ( 3  e.  ZZ  /\  ( ( A  +  B )  +  C
)  e.  ZZ  /\  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  e.  ZZ  /\  3  ||  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) ) ) )  ->  ( 3  ||  ( ( A  +  B )  +  C
)  <->  3  ||  (
( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )  +  ( ( A  +  B )  +  C ) ) ) )
8160, 67, 79, 80mp3an 1271 . 2  |-  ( 3 
||  ( ( A  +  B )  +  C )  <->  3  ||  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  +  ( ( A  +  B
)  +  C ) ) )
8259, 81bitr4i 185 1  |-  ( 3 
|| ;; A B C  <->  3  ||  ( ( A  +  B )  +  C
) )
Colors of variables: wff set class
Syntax hints:    /\ wa 102    <-> wb 103    = wceq 1287    e. wcel 1436   class class class wbr 3820  (class class class)co 5613   CCcc 7292   0cc0 7294   1c1 7295    + caddc 7297    x. cmul 7299   2c2 8407   3c3 8408   9c9 8414   NN0cn0 8606   ZZcz 8683  ;cdc 8809   ^cexp 9853    || cdvds 10678
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1379  ax-7 1380  ax-gen 1381  ax-ie1 1425  ax-ie2 1426  ax-8 1438  ax-10 1439  ax-11 1440  ax-i12 1441  ax-bndl 1442  ax-4 1443  ax-13 1447  ax-14 1448  ax-17 1462  ax-i9 1466  ax-ial 1470  ax-i5r 1471  ax-ext 2067  ax-coll 3929  ax-sep 3932  ax-nul 3940  ax-pow 3984  ax-pr 4010  ax-un 4234  ax-setind 4326  ax-iinf 4376  ax-cnex 7380  ax-resscn 7381  ax-1cn 7382  ax-1re 7383  ax-icn 7384  ax-addcl 7385  ax-addrcl 7386  ax-mulcl 7387  ax-mulrcl 7388  ax-addcom 7389  ax-mulcom 7390  ax-addass 7391  ax-mulass 7392  ax-distr 7393  ax-i2m1 7394  ax-0lt1 7395  ax-1rid 7396  ax-0id 7397  ax-rnegex 7398  ax-precex 7399  ax-cnre 7400  ax-pre-ltirr 7401  ax-pre-ltwlin 7402  ax-pre-lttrn 7403  ax-pre-apti 7404  ax-pre-ltadd 7405  ax-pre-mulgt0 7406  ax-pre-mulext 7407
This theorem depends on definitions:  df-bi 115  df-dc 779  df-3or 923  df-3an 924  df-tru 1290  df-fal 1293  df-nf 1393  df-sb 1690  df-eu 1948  df-mo 1949  df-clab 2072  df-cleq 2078  df-clel 2081  df-nfc 2214  df-ne 2252  df-nel 2347  df-ral 2360  df-rex 2361  df-reu 2362  df-rmo 2363  df-rab 2364  df-v 2617  df-sbc 2830  df-csb 2923  df-dif 2990  df-un 2992  df-in 2994  df-ss 3001  df-nul 3276  df-if 3380  df-pw 3417  df-sn 3437  df-pr 3438  df-op 3440  df-uni 3637  df-int 3672  df-iun 3715  df-br 3821  df-opab 3875  df-mpt 3876  df-tr 3912  df-id 4094  df-po 4097  df-iso 4098  df-iord 4167  df-on 4169  df-ilim 4170  df-suc 4172  df-iom 4379  df-xp 4417  df-rel 4418  df-cnv 4419  df-co 4420  df-dm 4421  df-rn 4422  df-res 4423  df-ima 4424  df-iota 4946  df-fun 4983  df-fn 4984  df-f 4985  df-f1 4986  df-fo 4987  df-f1o 4988  df-fv 4989  df-riota 5569  df-ov 5616  df-oprab 5617  df-mpt2 5618  df-1st 5868  df-2nd 5869  df-recs 6024  df-frec 6110  df-pnf 7468  df-mnf 7469  df-xr 7470  df-ltxr 7471  df-le 7472  df-sub 7599  df-neg 7600  df-reap 7993  df-ap 8000  df-div 8079  df-inn 8358  df-2 8416  df-3 8417  df-4 8418  df-5 8419  df-6 8420  df-7 8421  df-8 8422  df-9 8423  df-n0 8607  df-z 8684  df-dec 8810  df-uz 8952  df-iseq 9780  df-iexp 9854  df-dvds 10679
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator