Necessary and sufficient condition to have an upper-triangular matrix

The following is result 5.44 from Linear Algebra Done Right, fourth edition by Sheldon Axler:

Theorem. Suppose $$V$$ is finite-dimensional and $$T \in \mathcal{L}(V)$$. Then $$T$$ has an upper-triangular matrix with respect to some basis of $$V$$ if and only if the minimal polynomial of $$T$$ equals $$(z-\lambda_1) \cdots (z-\lambda_m)$$ for some $$\lambda_1, \ldots, \lambda_m \in \mathbf{F}$$.

Proof of forward direction. First suppose $$T$$ has an upper-triangular matrix with respect to some basis of $$V$$. Let $$\alpha_1, \ldots, \alpha_n$$ denote the diagonal entries of that matrix. Define a polynomial $$q \in \mathcal{P}(\mathbf{F})$$ by

$$q(z) = (z - \alpha_1) \cdots (z - \alpha_n)$$

Then $$q(T)=0$$, by 5.40. Hence $$q$$ is a polynomial multiple of the minimal polynomial of $$T$$, by 5.29. Thus the minimal polynomial of $$T$$ equals $$(z - \lambda_1) \cdots (z - \lambda_m)$$ for some $$\lambda_1, \ldots, \lambda_m \in \mathbf{F}$$ with $$\{\lambda_1, \ldots, \lambda_m\} \subseteq \{\alpha_1, \ldots, \alpha_n\}$$.

Something seems off to me. We're letting $$\alpha_1, \ldots, \alpha_n$$ denote the diagonal entries of the upper-triangular matrix of $$T$$. By result 5.41 in the book, this means that $$\alpha_1, \ldots, \alpha_n$$ are the eigenvalues of $$T$$. By result 5.27(a), these must be the zeros of the minimal polynomial. But then in the proof, we say that $$\{\lambda_1, \ldots, \lambda_m\} \subseteq \{\alpha_1, \ldots, \alpha_n\}$$, which suggests to me there may be an $$\alpha \in \{\alpha_1, \ldots, \alpha_n\}$$ that is not in $$\{\lambda_1, \ldots, \lambda_m\}$$. If that's the case, then how can $$(z - \lambda_1) \cdots (z - \lambda_m)$$ possibly be the minimal polynomial if it is missing some $$\alpha$$ as a zero?

• I agree that $\{ \lambda_1, \ldots, \lambda_m \}$ and $\{ \alpha_1, \ldots, \alpha_n \}$ are equal as sets, but this equality is not necessary for the proof. Commented Aug 7 at 6:39

$$A = \begin{bmatrix} \lambda & 1 & 0 \\ 0 & \lambda & 0 \\ 0 & 0 & \lambda \end{bmatrix}$$
then the minimal polynomial is $$(t - \lambda)^2$$ but the polynomial $$q$$ constructed by taking the product of the diagonal entries (which is the characteristic polynomial) is $$(t - \lambda)^3$$. So they have the same roots (they have to, because the roots have to be the eigenvalues of $$A$$) but the minimal polynomial has those roots with smaller multiplicity.
Generally, assuming that we're working over an algebraically closed field for simplicity, the multiplicity of an eigenvalue $$\lambda$$ of $$A$$ as a root of the characteristic polynomial is called its algebraic multiplicity. It must also be a root of the minimal polynomial $$m$$, but with multiplicity $$\le$$ the algebraic multiplicity. The exact multiplicity can be described using the Jordan normal form of $$A$$: it's the maximum size of a Jordan block with eigenvalue $$\lambda$$ (which in the above example is $$2$$), whereas the algebraic multiplicity is the sum of the sizes of all the Jordan blocks with eigenvalue $$\lambda$$. As a simple example, $$A$$ could be a diagonal matrix with entries $$\lambda$$, and then the minimal polynomial would be $$t - \lambda$$ but the characteristic polynomial would be $$(t - \lambda)^n$$.