Hi !
please forgive my english because I am from KUrdistan /Iraq.
Thank you
attachment
In a more simple way, what you wrote means
(i) the sum of the digits of a number is divisible by 3 if and only if the number is divisible by 3.
(ii) the sum of the digits of a number is divisible by 9 if and only if the number is divisible by 9.
(i) Let a number divisible by 3 be $\displaystyle N = a_na_{n-1}...a_0 $ then $\displaystyle N = 0 \text{ mod } 3 $
The number in front of the mod is the rest after dividing by the modulo number.
We can write any number as $\displaystyle a_n10^n+a_{n-1}10^{n-1}+ ... + a_0 $.
Remark that $\displaystyle 10 = 1 \text{ mod } 3 $.
Therefore $\displaystyle 10^n = 1 \text{ mod } 3 $ and $\displaystyle a10^n = a\cdot 1=a \text{ mod } 3 $.
It follows $\displaystyle a_n10^n+a_{n-1}10^{n-1}+ ... + a_0 = a_n+a_{n-1}+ ... + a_0 = 0 \text{ mod } 3 $
And you have your answer that is $\displaystyle 3|N \Longleftrightarrow 3| \sum a_i $
(ii) Since $\displaystyle 10 = 1 \text{ mod } 9 $ you can draw the same conclusions.