Problem: Let $a_1$, $a_2$, \dots, $a_n$ be integers whose greatest common divisor is $1$.
Let $S$ be a set of integers with the following properties:
\begin{enumerate}
  \ii[(a)] $a_i \in S$ for $i = 1, \dots, n$.
  \ii[(b)] $a_i - a_j \in S$ for $i, j = 1, \dots, n$, not necessarily distinct.
  \ii[(c)] If $x, y \in S$ and $x+y \in S$, then $x-y \in S$ too.
\end{enumerate}
Prove that $S = \ZZ$.

Solution: The idea is to show any linear combination of the $a_i$ are in $S$,
which implies (by Bezout) that $S = \ZZ$.
This is pretty intuitive, but the details require some care
(in particular there is a parity obstruction at the second lemma).

First, we make the following simple observations:
\begin{itemize}
  \ii $0 \in S$, by putting $i=j=1$ in (b).
  \ii $s \in S \iff -s \in S$, by putting $x=0$ in (c).
\end{itemize}

Now, we prove that:
\begin{lemma*}
  For any integers $c$, $d$, and indices $i$, $j$, we have $ca_i + da_j \in S$.
\end{lemma*}
\begin{proof}
  We will assume $c,d > 0$ since the other cases are analogous.
  In that case it follows by induction on $c+d$;
  for example $ca_i + (d-1)a_j$, $a_j$, $ca_i + da_j$ in $S$
  implies $ca_i + (d+1)a_j \in S$.
\end{proof}

\begin{lemma*}
  For any nonzero integers $c_1$, $c_2$, \dots, $c_m$,
  and any distinct indices $\{i_1 , i_2 , \dots , i_m\}$, we have
  \[ \sum_k c_k a_{i_k} \in S. \]
\end{lemma*}
\begin{proof}
  By induction on $m$, with base case $m \le 2$ already done.

  For the inductive step,
  we will assume that $i_1 = 1$, $i_2 = 2$, et cetera, for notational convenience.
  The proof is then split into two cases.

  \begin{itemize}
  \ii \textbf{First Case}: some $c_i$ is even.
  WLOG $c_1 \neq 0$ is even and note that
  \begin{align*}
    x &\coloneq \half c_1 a_1 + \sum_{k \ge 3} c_k a_k \in S \\
    y &\coloneq -\half c_1 a_1 - c_2 a_2 \in S \\
    x+y &= -c_2 a_2 + \sum_{k \ge 3} c_k a_k \in S \\
    \implies x-y &= \sum_{k \ge 1} c_k a_k \in S.
  \end{align*}

  \ii \textbf{Second Case}: all $c_i$ are odd.
  We reduce this to the first case as follows.
  Let $u = \frac{a_1}{\gcd(a_1, a_2)}$ and $v = \frac{a_2}{\gcd(a_1, a_2)}$.
  Then $\gcd(u,v) = 1$ and so WLOG $u$ is odd.
  Then
  \[
    c_1 a_1 + c_2 a_2
    = (c_1 + v)a_1 + (c_2 - u) a_2
  \]
  and so we can replace our given combination
  by $(c_1+v)a_1 + (c_2-u)a_2 + c_3a_3 + \dots$
  which now has an even coefficient for $a_2$. \qedhere
  \end{itemize}
\end{proof}

We then apply the lemma at $m = n$; this finishes the problem since Bezout's lemma
says that $\sum c_i a_i = 1$ for some choice of $c_i \in \ZZ$.