I'm trying to provide a general proof for the following theorem.
Let $0 < n < 1000$ be an integer. If the sum of the digits of $n$ is divisible by $9$, then $n$ is divisible by $9$.
The book showed us how to do this in the following way.
$n = 100a + 10b +c\,(1)$
$a + b+ c = 9k, k\in \mathbb{Z}\,(2)$
Add $99a + 9b$ to both sides of $(2)$ to make the left side match $(1)$
$a + b + c + 99a + 9b = 9k + 99a + 9b$
$100a + 10b + c = n = 9(k+11a+b)$
Since integers are closed by addition and $k, a, b \in \mathbb{Z}$, $(k+11a+b) \in \mathbb{Z}$
QED.
Now it asks us to generalize this proof to any integer.
I started off by giving the following representation to $n$.
$n = \sum_{i=0}^{k-1} 10^ia_i\,(1)$ where $a_i$ is a digit
$\sum_{i=1}^{k-1}a_i=9q, \in \mathbb{Z}\,(2)$
$\sum_{i=1}^{k-1}(10^i - 1)a_i + \sum_{i=1}^{k-1}a_i = \sum_{i=1}^{k-1}(10^i-1)a_i + 9q\,(3)$
After this, I'm unsure of how to show that the LHS of $(3)$ is the same as the RHS of $(1)$ and how the RHS of $(3)$ is divisible by $9$. I think there's some sort of sequences/series trick involved that isn't coming to mind.
Attempt at Proof
Lemma 1: $(\forall i \in \mathbb{Z})(i \geq 0)(9 \mid 10^i -1)$
Proof by Contradiction
Assume: $(\forall i \in \mathbb{Z})(i \geq 0)(9 \not \mid 10^i -1)$
Let $i = 1$
$9 \not \mid 10^1 - 1 \implies 9 \not \mid 9$. Contradiction.
Theorem 1: $(\forall n \in \mathbb{Z})$($9 \mid$sum of digits in $n$ $\implies 9 \mid n$)
$n = \sum_{i=0}^{k-1} 10^ia_i\,(1)$ where $a_i$ is a digit
$\sum_{i=1}^{k-1}a_i=9q, q \in \mathbb{Z}\,(2)$
$\sum_{i=1}^{k-1}(10^i - 1)a_i + \sum_{i=1}^{k-1}a_i = \sum_{i=1}^{k-1}(10^i-1)a_i + 9q_3\,(3)$
By Lemma 1, $9 \mid \sum_{i=1}^{k-1}(10^i - 1)a_i$. The above statement can be rewritten as.
$\sum_{i=1}^{k-1}9q_ia_i + \sum_{i=1}^{k-1}a_i = 9q_x + 9q_y$ where $q_i,q_x,q_y \in \mathbb{Z}$
$\sum_{i=1}^{k-1}9q_ia_i + \sum_{i=1}^{k-1}a_i = 9(q_x+q_y)$
So I have a few problems with this:
Is Lemma 1 strong enough? Since the claim is $\forall i$ and I found one $i$ that breaks it, I figured it would work.
At the end of my partial proof, I've proved that the RHS is divisible by $9$ but I don't know how to show the LHS is equal to $n$.
$$\mathring{n} : \mbox{ multiple of }n$$ $$ 9k = \sum_{i=0}^{n} 10^i a_i = \sum_{i=0}^{n} (9+1)^i a_i = \sum_{i=0}^{n} (\mathring{9} + 1) a_i = \mathring{9}+ \sum_{i=0}^{n} a_i = 9k \iff \sum_{i=0}^{n} a_i = \mathring{9} $$