  We consider systems of linear differential and difference equations
\begin{eqnarray*} \partial Y(x) =A(x)Y(x), \sigma Y(x) =B(x)Y(x)
\end{eqnarray*} with $\partial = \frac{d}{dx}$, $\sigma$ a shift operator
$\sigma(x) = x+a$, $q$-dilation operator $\sigma(x) = qx$ or Mahler operator
$\sigma(x) = x^p$ and systems of two linear difference equations
\begin{eqnarray*} \sigma_1 Y(x) =A(x)Y(x), \sigma_2 Y(x) =B(x)Y(x)
\end{eqnarray*} with $(\sigma_1,\sigma_2)$ a sufficiently independent pair of
shift operators, pair of $q$-dilation operators or pair of Mahler operators.
Here $A(x)$ and $B(x)$ are $n\times n$ matrices with rational function entries.
Assuming a consistency hypothesis, we show that such system can be reduced to a
system of a very simple form. Using this we characterize functions satisfying
two linear scalar differential or difference equations with respect to these
operators. We also indicate how these results have consequences both in the
theory of automatic sets, leading to a new proof of Cobham's Theorem, and in
the Galois theories of linear difference and differential equations, leading to
hypertranscendence results.
