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

Theorem 3dvds2dec 10177
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 9586 . . . 4  |- ;; A B C  =  (
( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  +  C
)
4 sq10e99m1 9585 . . . . . . . 8  |-  (; 1 0 ^ 2 )  =  (; 9 9  +  1 )
54oveq1i 5550 . . . . . . 7  |-  ( (; 1
0 ^ 2 )  x.  A )  =  ( (; 9 9  +  1 )  x.  A )
6 9nn0 8263 . . . . . . . . . 10  |-  9  e.  NN0
76, 6deccl 8441 . . . . . . . . 9  |- ; 9 9  e.  NN0
87nn0cni 8251 . . . . . . . 8  |- ; 9 9  e.  CC
9 ax-1cn 7035 . . . . . . . 8  |-  1  e.  CC
101nn0cni 8251 . . . . . . . 8  |-  A  e.  CC
118, 9, 10adddiri 7096 . . . . . . 7  |-  ( (; 9
9  +  1 )  x.  A )  =  ( (; 9 9  x.  A
)  +  ( 1  x.  A ) )
1210mulid2i 7088 . . . . . . . 8  |-  ( 1  x.  A )  =  A
1312oveq2i 5551 . . . . . . 7  |-  ( (; 9
9  x.  A )  +  ( 1  x.  A ) )  =  ( (; 9 9  x.  A
)  +  A )
145, 11, 133eqtri 2080 . . . . . 6  |-  ( (; 1
0 ^ 2 )  x.  A )  =  ( (; 9 9  x.  A
)  +  A )
15 9p1e10 8429 . . . . . . . . 9  |-  ( 9  +  1 )  = ; 1
0
1615eqcomi 2060 . . . . . . . 8  |- ; 1 0  =  ( 9  +  1 )
1716oveq1i 5550 . . . . . . 7  |-  (; 1 0  x.  B
)  =  ( ( 9  +  1 )  x.  B )
18 9cn 8078 . . . . . . . 8  |-  9  e.  CC
192nn0cni 8251 . . . . . . . 8  |-  B  e.  CC
2018, 9, 19adddiri 7096 . . . . . . 7  |-  ( ( 9  +  1 )  x.  B )  =  ( ( 9  x.  B )  +  ( 1  x.  B ) )
2119mulid2i 7088 . . . . . . . 8  |-  ( 1  x.  B )  =  B
2221oveq2i 5551 . . . . . . 7  |-  ( ( 9  x.  B )  +  ( 1  x.  B ) )  =  ( ( 9  x.  B )  +  B
)
2317, 20, 223eqtri 2080 . . . . . 6  |-  (; 1 0  x.  B
)  =  ( ( 9  x.  B )  +  B )
2414, 23oveq12i 5552 . . . . 5  |-  ( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  =  ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )
2524oveq1i 5550 . . . 4  |-  ( ( ( (; 1 0 ^ 2 )  x.  A )  +  (; 1 0  x.  B
) )  +  C
)  =  ( ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )
268, 10mulcli 7090 . . . . . 6  |-  (; 9 9  x.  A
)  e.  CC
2718, 19mulcli 7090 . . . . . 6  |-  ( 9  x.  B )  e.  CC
28 add4 7235 . . . . . . 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 5555 . . . . . 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 411 . . . . 5  |-  ( ( ( (; 9 9  x.  A
)  +  A )  +  ( ( 9  x.  B )  +  B ) )  +  C )  =  ( ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) )  +  C )
3126, 27addcli 7089 . . . . . 6  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  e.  CC
3210, 19addcli 7089 . . . . . 6  |-  ( A  +  B )  e.  CC
33 3dvds2dec.c . . . . . . 7  |-  C  e. 
NN0
3433nn0cni 8251 . . . . . 6  |-  C  e.  CC
3531, 32, 34addassi 7093 . . . . 5  |-  ( ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( A  +  B ) )  +  C )  =  ( ( (; 9 9  x.  A
)  +  ( 9  x.  B ) )  +  ( ( A  +  B )  +  C ) )
36 9t11e99 8556 . . . . . . . . . . 11  |-  ( 9  x. ; 1 1 )  = ; 9
9
3736eqcomi 2060 . . . . . . . . . 10  |- ; 9 9  =  ( 9  x. ; 1 1 )
3837oveq1i 5550 . . . . . . . . 9  |-  (; 9 9  x.  A
)  =  ( ( 9  x. ; 1 1 )  x.  A )
39 1nn0 8255 . . . . . . . . . . . 12  |-  1  e.  NN0
4039, 39deccl 8441 . . . . . . . . . . 11  |- ; 1 1  e.  NN0
4140nn0cni 8251 . . . . . . . . . 10  |- ; 1 1  e.  CC
4218, 41, 10mulassi 7094 . . . . . . . . 9  |-  ( ( 9  x. ; 1 1 )  x.  A )  =  ( 9  x.  (; 1 1  x.  A
) )
4338, 42eqtri 2076 . . . . . . . 8  |-  (; 9 9  x.  A
)  =  ( 9  x.  (; 1 1  x.  A
) )
4443oveq1i 5550 . . . . . . 7  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  =  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )
4541, 10mulcli 7090 . . . . . . . . 9  |-  (; 1 1  x.  A
)  e.  CC
4618, 45, 19adddii 7095 . . . . . . . 8  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )
4746eqcomi 2060 . . . . . . 7  |-  ( ( 9  x.  (; 1 1  x.  A
) )  +  ( 9  x.  B ) )  =  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )
48 3t3e9 8140 . . . . . . . . . 10  |-  ( 3  x.  3 )  =  9
4948eqcomi 2060 . . . . . . . . 9  |-  9  =  ( 3  x.  3 )
5049oveq1i 5550 . . . . . . . 8  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( ( 3  x.  3 )  x.  ( (; 1 1  x.  A
)  +  B ) )
51 3cn 8065 . . . . . . . . 9  |-  3  e.  CC
5245, 19addcli 7089 . . . . . . . . 9  |-  ( (; 1
1  x.  A )  +  B )  e.  CC
5351, 51, 52mulassi 7094 . . . . . . . 8  |-  ( ( 3  x.  3 )  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )
5450, 53eqtri 2076 . . . . . . 7  |-  ( 9  x.  ( (; 1 1  x.  A
)  +  B ) )  =  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )
5544, 47, 543eqtri 2080 . . . . . 6  |-  ( (; 9
9  x.  A )  +  ( 9  x.  B ) )  =  ( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )
5655oveq1i 5550 . . . . 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 2080 . . . 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 2080 . . 3  |- ;; A B C  =  (
( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )  +  ( ( A  +  B )  +  C ) )
5958breq2i 3800 . 2  |-  ( 3 
|| ;; A B C  <->  3  ||  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  +  ( ( A  +  B
)  +  C ) ) )
60 3z 8331 . . 3  |-  3  e.  ZZ
611nn0zi 8324 . . . . 5  |-  A  e.  ZZ
622nn0zi 8324 . . . . 5  |-  B  e.  ZZ
63 zaddcl 8342 . . . . 5  |-  ( ( A  e.  ZZ  /\  B  e.  ZZ )  ->  ( A  +  B
)  e.  ZZ )
6461, 62, 63mp2an 410 . . . 4  |-  ( A  +  B )  e.  ZZ
6533nn0zi 8324 . . . 4  |-  C  e.  ZZ
66 zaddcl 8342 . . . 4  |-  ( ( ( A  +  B
)  e.  ZZ  /\  C  e.  ZZ )  ->  ( ( A  +  B )  +  C
)  e.  ZZ )
6764, 65, 66mp2an 410 . . 3  |-  ( ( A  +  B )  +  C )  e.  ZZ
6840nn0zi 8324 . . . . . . . 8  |- ; 1 1  e.  ZZ
69 zmulcl 8355 . . . . . . . 8  |-  ( (; 1
1  e.  ZZ  /\  A  e.  ZZ )  ->  (; 1 1  x.  A
)  e.  ZZ )
7068, 61, 69mp2an 410 . . . . . . 7  |-  (; 1 1  x.  A
)  e.  ZZ
71 zaddcl 8342 . . . . . . 7  |-  ( ( (; 1 1  x.  A
)  e.  ZZ  /\  B  e.  ZZ )  ->  ( (; 1 1  x.  A
)  +  B )  e.  ZZ )
7270, 62, 71mp2an 410 . . . . . 6  |-  ( (; 1
1  x.  A )  +  B )  e.  ZZ
73 zmulcl 8355 . . . . . 6  |-  ( ( 3  e.  ZZ  /\  ( (; 1 1  x.  A
)  +  B )  e.  ZZ )  -> 
( 3  x.  (
(; 1 1  x.  A
)  +  B ) )  e.  ZZ )
7460, 72, 73mp2an 410 . . . . 5  |-  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) )  e.  ZZ
75 zmulcl 8355 . . . . 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 410 . . . 4  |-  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )  e.  ZZ
77 dvdsmul1 10129 . . . . 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 410 . . . 4  |-  3  ||  ( 3  x.  (
3  x.  ( (; 1
1  x.  A )  +  B ) ) )
7976, 78pm3.2i 261 . . 3  |-  ( ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) )  e.  ZZ  /\  3  ||  ( 3  x.  ( 3  x.  ( (; 1 1  x.  A
)  +  B ) ) ) )
80 dvdsadd2b 10154 . . 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 1243 . 2  |-  ( 3 
||  ( ( A  +  B )  +  C )  <->  3  ||  ( ( 3  x.  ( 3  x.  (
(; 1 1  x.  A
)  +  B ) ) )  +  ( ( A  +  B
)  +  C ) ) )
8259, 81bitr4i 180 1  |-  ( 3 
|| ;; A B C  <->  3  ||  ( ( A  +  B )  +  C
) )
Colors of variables: wff set class
Syntax hints:    /\ wa 101    <-> wb 102    = wceq 1259    e. wcel 1409   class class class wbr 3792  (class class class)co 5540   CCcc 6945   0cc0 6947   1c1 6948    + caddc 6950    x. cmul 6952   2c2 8040   3c3 8041   9c9 8047   NN0cn0 8239   ZZcz 8302  ;cdc 8427   ^cexp 9419    || cdvds 10108
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 103  ax-ia2 104  ax-ia3 105  ax-in1 554  ax-in2 555  ax-io 640  ax-5 1352  ax-7 1353  ax-gen 1354  ax-ie1 1398  ax-ie2 1399  ax-8 1411  ax-10 1412  ax-11 1413  ax-i12 1414  ax-bndl 1415  ax-4 1416  ax-13 1420  ax-14 1421  ax-17 1435  ax-i9 1439  ax-ial 1443  ax-i5r 1444  ax-ext 2038  ax-coll 3900  ax-sep 3903  ax-nul 3911  ax-pow 3955  ax-pr 3972  ax-un 4198  ax-setind 4290  ax-iinf 4339  ax-cnex 7033  ax-resscn 7034  ax-1cn 7035  ax-1re 7036  ax-icn 7037  ax-addcl 7038  ax-addrcl 7039  ax-mulcl 7040  ax-mulrcl 7041  ax-addcom 7042  ax-mulcom 7043  ax-addass 7044  ax-mulass 7045  ax-distr 7046  ax-i2m1 7047  ax-1rid 7049  ax-0id 7050  ax-rnegex 7051  ax-precex 7052  ax-cnre 7053  ax-pre-ltirr 7054  ax-pre-ltwlin 7055  ax-pre-lttrn 7056  ax-pre-apti 7057  ax-pre-ltadd 7058  ax-pre-mulgt0 7059  ax-pre-mulext 7060
This theorem depends on definitions:  df-bi 114  df-dc 754  df-3or 897  df-3an 898  df-tru 1262  df-fal 1265  df-nf 1366  df-sb 1662  df-eu 1919  df-mo 1920  df-clab 2043  df-cleq 2049  df-clel 2052  df-nfc 2183  df-ne 2221  df-nel 2315  df-ral 2328  df-rex 2329  df-reu 2330  df-rmo 2331  df-rab 2332  df-v 2576  df-sbc 2788  df-csb 2881  df-dif 2948  df-un 2950  df-in 2952  df-ss 2959  df-nul 3253  df-if 3360  df-pw 3389  df-sn 3409  df-pr 3410  df-op 3412  df-uni 3609  df-int 3644  df-iun 3687  df-br 3793  df-opab 3847  df-mpt 3848  df-tr 3883  df-eprel 4054  df-id 4058  df-po 4061  df-iso 4062  df-iord 4131  df-on 4133  df-suc 4136  df-iom 4342  df-xp 4379  df-rel 4380  df-cnv 4381  df-co 4382  df-dm 4383  df-rn 4384  df-res 4385  df-ima 4386  df-iota 4895  df-fun 4932  df-fn 4933  df-f 4934  df-f1 4935  df-fo 4936  df-f1o 4937  df-fv 4938  df-riota 5496  df-ov 5543  df-oprab 5544  df-mpt2 5545  df-1st 5795  df-2nd 5796  df-recs 5951  df-irdg 5988  df-frec 6009  df-1o 6032  df-2o 6033  df-oadd 6036  df-omul 6037  df-er 6137  df-ec 6139  df-qs 6143  df-ni 6460  df-pli 6461  df-mi 6462  df-lti 6463  df-plpq 6500  df-mpq 6501  df-enq 6503  df-nqqs 6504  df-plqqs 6505  df-mqqs 6506  df-1nqqs 6507  df-rq 6508  df-ltnqqs 6509  df-enq0 6580  df-nq0 6581  df-0nq0 6582  df-plq0 6583  df-mq0 6584  df-inp 6622  df-i1p 6623  df-iplp 6624  df-iltp 6626  df-enr 6869  df-nr 6870  df-ltr 6873  df-0r 6874  df-1r 6875  df-0 6954  df-1 6955  df-r 6957  df-lt 6960  df-pnf 7121  df-mnf 7122  df-xr 7123  df-ltxr 7124  df-le 7125  df-sub 7247  df-neg 7248  df-reap 7640  df-ap 7647  df-div 7726  df-inn 7991  df-2 8049  df-3 8050  df-4 8051  df-5 8052  df-6 8053  df-7 8054  df-8 8055  df-9 8056  df-n0 8240  df-z 8303  df-dec 8428  df-uz 8570  df-iseq 9376  df-iexp 9420  df-dvds 10109
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator