This is homework and I'm looking for a push in the right direction. Proofs were never something I was properly taught, so now they're kind of a weak point.
Here's the problem:
The following grammar generates numbers in binary notation ($C$ is the start symbol):
$\qquad \begin{align}C &\to C 0 \mid A 1 \mid 0 \\ A &\to B 0 \mid C 1 \mid 1 \\ B &\to A 0 \mid B 1 \end{align}$
Prove that the alternating sums of the digits of the generated numbers are multiples of $3$. The alternating sum of $w=w_0\dots w_n$ is defined as $\sum_{i=0}^n (-1)^i \cdot w_i$. As an example, $C$ generates $1001$ via $C \Rightarrow A1 \Rightarrow B01 \Rightarrow A001 \Rightarrow 1001$ with alternating sum of $0$; clearly, $0$ is a multiple of $3$.
Prove that all such numbers (i.e., numbers whose alternating sum is a multiple of 3) are generated by the grammar.
I'm thinking I need to show that the grammar can only generate strings which are made up of repeated subsequences of digits which always add up to 0, 3, or -3. But I'm not sure how to show that it can only generate those three subsequences.
I also have worked out these thoughts:
Consider that any even number of consecutive 1s is irrelevant, as they cancel each other out.
Consider that all zeros are in of themselves irrelevant, as they add nothing.
Consider then that the only relevant pattern is that of alternating 1s and zeros, and where this pattern starts and ends.