# Regarding a proof of: "if $A,B \in M_n(\mathbb{k})$ are diagonalizable and commute, they are simultaneously diagonalizable".

As the title states, I'm looking for a proof of the following,

Proposition. Let $A, B \in M_n(\mathbb{k})$ be commuting diagonalizable matrices, so that $AB = BA$. Therefore, $A$ and $B$ can be diagonalized in the same basis.

with these additional requirements: no usage of minimal polynomials, and as elementary an argument as possible.

Looking for similar questions, I stumbled upon this answer. It proves that eigenvalues of $A$ are $B$-invariant and vice versa. If these were one dimensional, then by restricting $A$ or $B$ as functions to the eigenspaces of the other, we see that they share all eigenvectors (although possibly with different eigenvalues) and thus any base of them will diagonalize both matrices simultaneously. However, the case for eigenspaces of arbitrary dimension is left as an exercise.

Any hints on how to proceed?

Edit: upon reading this answer, I think the question can be reduced to: how can we show that given an eigenspace $E_\lambda$, $B : E_\lambda \to E_\lambda$ is diagonalizable? If this is answered, then since

$$\mathbb{k}^n = E_{\lambda_1} \oplus \cdots \oplus E_{\lambda_n}$$

with $\lambda_1, \dots, \lambda_n$ the eigenvalues of $A$, and each restriction of $B$ to $E_{\lambda_i}$ can be diagonalized on a basis $B_i = \{v^i_1 , \dots, v^i_{k_i}\}$, the basis $\mathcal{B} = \cup_{i=1}^nB_i$ of $\mathbb{k}^n$ consists of eigenvectors of $B$ that are also eigenvectors of $A$, precisely because each $v_j^i \in E_{\lambda_i}$. Thus, each element of $\mathcal{B}$ would be an eigenvector for both $A$ and $B$, which implies that $\mathcal{B}$ diagonalizes the matrices at the same time.

In short, if I have thought about this correctly, my question reduces to: how can one show that a $B$-invariant eigenspace of $A$ has a basis of eigenvectors of $B$?

As proven in this post, the idea goes as follows: take $W$ an $B$-invariant subspace. Now, since $B$ is diagonalizable with eigenvalues $\mu_1, \dots, \mu_k$,

$$\mathbb{k}^n = E_{\mu_1} \oplus \cdots \oplus E_{\mu_k}$$

It suffices to see that $W = (W\cap E_{\mu_1}) \oplus \cdots \oplus ( W\cap E_{\mu_k})$ in which case one can form a basis from basis of each $W \cap E_{\mu_i}$, which will be made of eigenvalues of $B$ because it is contained in $E_{\mu_i}$. In effect, let's see both inclusion: the immediate one is that $(W\cap E_{\mu_1}) \oplus \cdots \oplus ( W\cap E_{\mu_k})\subseteq W$ since each space is contained in $W$, and the latter is a subspace.

As for the other, since $W = W \cap \mathbb{k}^k = W \cap \bigoplus_{i=1}^n E_{\mu_i}$, any element $w$ of $W$ is a sum of eigenvectors,

$$w = e_1 + \dots + e_l$$

with $e_i$ eigenvector of eigenvalue $\mu_{j_i}$. Therefore, it is sufficient to show that if $\sum_{i=1}^ke_l \in W$, then $e_1, \dots, e_l \in W$. We proceed by induction on $l$. If $l = 1$, then $e_1 = w \in W$. If $l >1$, since

$$Bw - \mu_{j_1}w = (\mu_{j_1} - \mu_{j_1})e_1 + \dots + (\mu_{j_l} - \mu_{j_1})e_l \in W$$

and $\mu_{j_i} - \mu_{j_1} \neq 0$, by inductive hypothesis $e_i \in W$ for $i >1$, and so finally $e_1 = w - e_2 - \dots - e_l \in W$, completing the proof.