Solution (source code)

= Solution

The <Jordan normal form> theorem says that every complex square <matrix> is similar to a direct sum of Jordan blocks, uniquely up to their order. For an <eigenvalue> $\lambda$, if its blocks have sizes $n_1,\ldots,n_r$, then its <algebraic multiplicity> and <geometric multiplicity> are
$$
a_\lambda=\sum_{j=1}^r n_j,
\qquad
g_\lambda=r,
$$
and its contribution to the <minimal polynomial> is $(t-\lambda)^{\max_j n_j}$. Thus
$$
m_\alpha(t)=\prod_\lambda(t-\lambda)^{s_\lambda},
$$
where $s_\lambda$ is the largest $\lambda$-block size.

For the given <matrix>,
$$
\det(tI-A)=(t-2)(t+1)^2.
$$
Moreover,
$$
\dim\ker(A-2I)=1,
\qquad
\dim\ker(A+I)=1.
$$
Hence
$$
\boxed{a_2=g_2=1,
\qquad a_{-1}=2,
\qquad g_{-1}=1}.
$$
The <eigenvalue> $-1$ therefore has one Jordan block of size two, so
$$
\boxed{m_\alpha(t)=(t-2)(t+1)^2}.
$$