Can a matrix have an invariant line (that does not pass through the origin) if and only if one of its eigenvalues is $1$? By a "line of invariance", I mean the span of a single vector, shifted such that it does not pass through the origin, such that any point on this line is mapped by $M$ to another point on this line.
In class today my teacher proposed that invariant lines could exist that don't pass through the origin. This shocked me, since I'd never entertained the idea before, as someone who'd already studied linear algebra, as I thought eigenvectors were the only lines of invariance (eigenvectors weren't introduced in class, and my teacher didn't quite get my objection, which is why I ask here). We know by the fundamental theorem of algebra and the existence of the characteristic polynomial that a square matrix of order $n$ has $n$ eigenvalues with multiplicity, and that a vector can only be an eigenvector if it is associated to one such eigenvalue.
As lines of eigenvectors, and eigenspaces in general, be they planes, hyperplanes.., pass through the origin, a line of invariance that does not pass through the origin must somehow not be an eigenvector but display eigenvector-like properties. We are looking for $v+c$, where both are vectors and $c$ represents the "y-intercept", the non-zero constant shifting term, such that $M(v+c)=\lambda v+c$, and then $v,c$ represent a line of invariance $kv+c$ for any scalar $k$, and $M$ is the square matrix of interest.
Well, $M(v+c)=Mv+Mc=\lambda v+c$ by proposition, which implies $v$ is an eigenvector of eigenvalue $\lambda$, and $c$ must also be an eigenvector of eigenvalue $1$, as $c$ is assumed not to be the zero vector here. I propose then that only matrices with two linearly independent eigenspaces, of which one has associated eigenvalue $1$, may have invariant lines that do not pass through the origin $(1)$. My teacher didn't really bother to read what I wrote about this, and just suggest reflections as examples. I know that a reflection matrix must have at least one eigenvalue of $1$, and one of $-1$, with two perpendicular and thus distinct eigenspaces (the mirror line and its orthogonal), and I know one could surely construct matrices that satisfy the conditions of $(1)$ that aren't reflection matrices, but I am struggling to visually see lines of invariance in those cases (that don't pass through the origin).
Am I correct in $(1)$? I feel as if my modelling in $(1)$ is correct but perhaps I'm overlooking something. If anyone has insight about example transformations as said in the second paragraph, that would be appreciated.
 A: The OP has postulated that the matrix must have an eigenvalue of 1 in order for this to work.  A one-dimensional affine subspace in the plane can be parameterized as
$$
v + t w,
$$
with $-\infty<t<\infty$.
where the line goes through the point represented by $v$ and is parallel to the vector w. If we act on this with a linear transformation $M$, we get
$$
M(v+t w) = M(v) + t M(w),
$$
which maps out the affine subspace through the point represented by the vector $M(v)$ in the direction of $M(w)$. One way in which this can be the same line is if $M(v) =v$ and $M(w)=\lambda w$ (with $\lambda\neq0$), which is the condition that the OP reached.  But it can also in other situations as well.  Let's make it happen.
Re-write the above as
$$
M(v+t w) = M(v) + t M(w)
= v + tM(w) +(M(v) - v).
$$
Now, if $M(w)=\lambda w$ (with $\lambda\neq0$) and $M(v) =v+ \gamma w$, then
$$
M(v+t w) = M(v) + t M(w)= v + (t\lambda +\gamma) w,
$$
and we can see that the same line is mapped out.
Note however that this construction can generate a second eigenvector of $M$! Namely,
\begin{align}
M(v+\gamma w-\lambda v) &= 
M(v+\gamma w-\lambda v) = M(v)+\gamma M(w)-\lambda M(v)\\
&=\gamma w+v+\gamma \lambda w-\lambda(\gamma w+v)\\
&=\gamma w+v-\lambda v.
\end{align}
Notice that the eigenvalue is 1, provided that $\gamma w+v-\lambda v\neq 0$. But if it is zero, then
$$
\gamma w = (\lambda-1)v.
$$
There are then a couple of possibilities:

*

*$\gamma\neq0\neq\lambda-1$: The vectors are parallel to each other, in which case the line that is fixed is just the subspace spanned by $w$ and not a pure affine subspace. In that case, an eigenvalue of 1 is not required.

*$\lambda=1$ and either $\gamma=0$ or $w=0$, in which case $M(v) = \gamma w+v=v$, and $v$ is therefore an eigenvector with eigenvalue 1.


By way of illustration, consider the matrix
$$
M=\begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix}.
$$
This transforms the $x$-$y$ plane by shearing it horizontally. To see this, consider the point $(x,y)$.  Under the transformation, this point is transformed into
$$
\begin{bmatrix}
1 & 1 \\
0 & 1
\end{bmatrix}
\begin{bmatrix}
x \\ y
\end{bmatrix}
=
\begin{bmatrix}
x + y \\ y
\end{bmatrix}.
$$
If we imagine $y$ fixed, say as $y=1$, we can see that the points $(x,1)$ map out the horizontal line $y=1$ (letting $x$ vary). We can also see that the points $(x + 1,1)$ also map out the same line.  Thus, this line is fixed under the transformation. In fact, all horizontal lines are fixed under this transformation.
Now, one of these lines corresponds to the span of an eigenvector of $M$; namely, $(1,0)$ is an eigenvector of the matrix, which of course fixes this line through the origin.  The difference is that $(1,0)$ is mapped to itself, whereas $(1,1)$, say, is mapped to a different vector whose tip is on the same horizontal line as $(1,1)$.  The idea is that the locus of tips of the vectors made by mapping $M$ on $(x,y_0)$ (where $y_0$ is fixed) is the same as the locus of points mapped out by $(x,y_0)$ itself.  This illustrates the distinction between a vector fixed by a matrix (an eigenvector), and the image of a subset of the entire space, which need not be a vector space but can still be invariant under the transformation.
Finally, this matrix has an eigenvalue of 1 (check!) but it has only one eigenvector, so there need not be two distinct eigenspaces in order fix an affine subspace (i.e., a straight line not through the origin) in the plane!
Note also that the matrix
$$
M'=\begin{bmatrix}
2 & 2 \\
0 & 1
\end{bmatrix},
$$
does a similar thing: it maps $(x,y_0)$ to $(2x+2y_0,y_0)$, so this again maps the horizontal line $(x,y_0)$ to itself. This matrix has two eigenvalues, and one is indeed equal to 1!
A: Instead of talking abut a specific matrix $M$ it's instructive to consider a linear transformation $T$ of some abstract finite-dimensional vector space.
The benefit of this is that now we get to choose which basis we will use to write a matrix representation of $T$ in. This makes the reasoning look quite a bit more concrete than the coordinate-free formulation in March's answer.
First, suppose we know that $T$ has an invariant line that doesn't contain the origin.  We can then choose a vector along the invariant line as the first basis element, and a point on the line as the second basis element. Extend these two vectors (linearly independent, since the line doesn't pass through the origin) to a basis, and let us consider what $T$ does in those coordinates.
The assumption that the line is invariant under $T$ is now
$$ T\begin{bmatrix}t \\ 1 \\0\\\vdots\\ 0\end{bmatrix}
= \begin{bmatrix}f(t) \\ 1 \\ 0 \\\vdots\\ 0\end{bmatrix} $$
but since $T$ is linear, the $f(t)$ element that appears here must have the form $at+b$, so
$$ T\begin{bmatrix}t\\1\\0\\\vdots\\ 0\end{bmatrix}
= \begin{bmatrix}at+b\\1 \\ 0 \\\vdots\\ 0\end{bmatrix} $$
And, again since $T$ is linear, the only place the constants $b$ and $1$ can come from here is that they are actually the coefficients of the second element of the input vector:
$$ T\begin{bmatrix}t\\u\\0\\\vdots\\ 0\end{bmatrix}
= \begin{bmatrix}at+bu\\ u \\ 0 \\\vdots\\ 0\end{bmatrix} $$
But that means we now know the two first columns of the matrix of $T$ in our chosen coordinate system:
$$ T = \begin{bmatrix} a & b & * & \cdots & * \\
0 & 1 & * & \cdots & * \\
0 & 0 & * & \cdots & * \\
\vdots & \vdots & \\
0 & 0 & * & \cdots & * \end{bmatrix} $$
which is simple enough that we can immediately see that $T-I$ cannot be invertible: the first two columns of the matrix of $T-I$ are proportional to each other (or one or both might even be zero). In other words, $1$ is an eigenvalue.
And if $1$ is an eigenvalue in one coordinate system, then it is in particular also an eigenvalue of the $M$ we originally derived our $T$ from.

Conversely, suppose that $T$ has 1 as an eigenvalue: $T(v)=v$ for some $v\ne 0$.
If $T$ has another eigenvector $w$ that's linearly independent from $v$, then
$$ \{ v+tw \mid t\in\mathbb R \} $$
is the invariant line that we seek. Well -- that is, unless the eigenvalue corresponding to $w$ is $0$, in which case $T$ collapses the entire line to the single point $v$, and it will be a bit of a stretch to call the line invariant then. However that is the best we can do in general, as shown by the 2-dimensional example
$$ T(x,y) = (x,0) $$
where the only invariant line that doesn't collapse goes through the origin.
On the other hand it might also be that $v$ is the only eigenvector of $T$ (up to scalar multiples). If we're working over the real numbers, there may or may not be an invariant line avoiding the origin, as these examples show:
$$ A=\begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}
\qquad
B=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & -1 & 0 \end{bmatrix}
$$
For $A$ the line $(t,1,0)$ is invariant; but for $B$ the only invariant line is the $x$-axis.
Over the complex numbers, the Jordan normal form theorem tells us that the only way to have just a single eigenvector (up to scalar multiples) is if the matrix is similar to $A$ (or its higher-dimensional analogues) -- in which case there is always such an invariant line.
