I am self-studying some basic linear algebra. I encountered the following theorem:
Theorem$\quad$ Let $A$ be an $n \times n$ matrix.
$A$ is diagonalizable if and only if it has eigenvectors $\mathbf{x_1},\mathbf{x_2},\dots,\mathbf{x_n}$ such that the matrix $P=\begin{pmatrix}\mathbf{x_1} & \mathbf{x_2} & \dots & \mathbf{x_n}\end{pmatrix}$ is invertible.
When this is the case, $P^{-1}AP=\text{diag}(\lambda_1,\lambda_2,\dots,\lambda_n)$, where, for each $i$, $\lambda_i$ is the eigenvalue of $A$ corresponding to $\mathbf{x_i}$.
I was wondering if this theorem is the same as the following statement:
Statement$\quad$ An $n \times n$ matrix $A$ is diagonalizable, that is, $P^{-1}AP=D$ is diagonal for some invertible $n \times n$ matrix P, if and only if the diagonal entries of $D$ are eigenvalues of $A$ and the columns of $P$ are corresponding eigenvectors.
Here is some of my thought: I do not think these two statements are the same, and I do not think the second statement is correct. Because, since there could be multiple eigenvectors corresponding to the same eigenvalue, and not every such corresponding eigenvectors might make the matrix consisting of them as columns invertible (and thus a diagonalizing matrix).
More specifically, denote the diagonalized matrix $D=\begin{pmatrix} \lambda_1 & 0 & \dots & 0 \\ 0 & \lambda_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & \lambda_n\end{pmatrix}$. Suppose, for simplicity, that, for $i = 2, \dots, n$, there are only one eigenvector $\mathbf{x_i}$ corresponding to the eigenvalue $\lambda_i$. But there are more than one (say two) eigenvectors $\mathbf{x_1}$ and $\mathbf{x_1}'$ corresponding to the eigenvalue $\lambda_1$, and that only one of them (say $\mathbf{x_1}$) can make the matrix $P=\begin{pmatrix}\mathbf{x_1} & \mathbf{x_2} & \dots & \mathbf{x_n}\end{pmatrix}$ invertible. In such case, the second statement would not hold.
Is my thought correct? If so, could someone please give a concrete numerical example showing that the reasoning I provided above is indeed possible. If my thought is wrong, could someone please correct me with a proof? Thanks a lot in advance!