[proofplan]
We prove both directions. The forward direction shows that if $A$ is diagonalisable, the eigenspaces must be large enough that $m_g = m_a$ for each eigenvalue, using the dimension count from a direct sum decomposition. The reverse direction shows that if $m_g = m_a$ everywhere, then the eigenspaces together span $\mathbb{F}^n$, so a basis of eigenvectors exists and $A$ is diagonalisable.
[/proofplan]
[step:Record the dimension constraint from the splitting hypothesis]
Since $p_A$ splits over $\mathbb{F}$ and has degree $n$, the algebraic multiplicities satisfy
\begin{align*}
\sum_{i=1}^{k} m_a(\lambda_i) = n.
\end{align*}
By the [Multiplicity Inequality](/theorems/3276), each eigenvalue satisfies $1 \le m_g(\lambda_i) \le m_a(\lambda_i)$.
[/step]
[step:Prove the forward direction: diagonalisable implies $m_g = m_a$]
Suppose $A$ is diagonalisable. By the [Characterisations of Diagonalisability](/theorems/404), $\mathbb{F}^n$ decomposes as a direct sum of eigenspaces:
\begin{align*}
\mathbb{F}^n = E_{\lambda_1} \oplus \cdots \oplus E_{\lambda_k},
\end{align*}
where $E_{\lambda_i} := \ker(A - \lambda_i I)$. Applying the [Dimension of a Direct Sum](/theorems/3273) iteratively gives
\begin{align*}
n = \dim \mathbb{F}^n = \sum_{i=1}^{k} \dim E_{\lambda_i} = \sum_{i=1}^{k} m_g(\lambda_i).
\end{align*}
Since $m_g(\lambda_i) \le m_a(\lambda_i)$ for each $i$ by the [Multiplicity Inequality](/theorems/3276), and both sums equal $n$, we must have $m_g(\lambda_i) = m_a(\lambda_i)$ for every $i$.
[guided]
Suppose $A$ is diagonalisable. By the [Characterisations of Diagonalisability](/theorems/404), $\mathbb{F}^n$ has a basis of eigenvectors, and equivalently the eigenspaces provide a direct sum decomposition:
\begin{align*}
\mathbb{F}^n = E_{\lambda_1} \oplus \cdots \oplus E_{\lambda_k}.
\end{align*}
Why is this a direct sum (rather than just a sum)? Because the [Linear Independence of Eigenvectors for Distinct Eigenvalues](/theorems/920) guarantees that eigenvectors belonging to different eigenvalues are linearly independent, so the eigenspaces have pairwise intersections equal to $\{0\}$.
Applying the [Dimension of a Direct Sum](/theorems/3273) iteratively:
\begin{align*}
n = \dim \mathbb{F}^n = \sum_{i=1}^{k} \dim E_{\lambda_i} = \sum_{i=1}^{k} m_g(\lambda_i).
\end{align*}
We also know from the splitting hypothesis that $\sum_{i=1}^{k} m_a(\lambda_i) = n$. The [Multiplicity Inequality](/theorems/3276) gives $m_g(\lambda_i) \le m_a(\lambda_i)$ for each $i$. If any single inequality were strict, the sum $\sum m_g(\lambda_i)$ would be strictly less than $\sum m_a(\lambda_i) = n$, contradicting the dimension equality. Therefore $m_g(\lambda_i) = m_a(\lambda_i)$ for every $i = 1, \ldots, k$.
[/guided]
[/step]
[step:Prove the reverse direction: $m_g = m_a$ implies diagonalisable]
Conversely, suppose $m_g(\lambda_i) = m_a(\lambda_i)$ for every $i$. Consider the sum of eigenspaces $W := E_{\lambda_1} + \cdots + E_{\lambda_k}$. By the [Linear Independence of Eigenvectors for Distinct Eigenvalues](/theorems/920), any collection of eigenvectors — one basis for each eigenspace — is linearly independent. Therefore the sum is direct:
\begin{align*}
W = E_{\lambda_1} \oplus \cdots \oplus E_{\lambda_k}.
\end{align*}
By the [Dimension of a Direct Sum](/theorems/3273),
\begin{align*}
\dim W = \sum_{i=1}^{k} m_g(\lambda_i) = \sum_{i=1}^{k} m_a(\lambda_i) = n.
\end{align*}
Since $W$ is a subspace of $\mathbb{F}^n$ with $\dim W = n$, we have $W = \mathbb{F}^n$. A basis of eigenvectors for $A$ exists (formed by taking bases for each $E_{\lambda_i}$), so $A$ is diagonalisable by the [Characterisations of Diagonalisability](/theorems/404).
[guided]
Now suppose $m_g(\lambda_i) = m_a(\lambda_i)$ for every $i$. We need to show $A$ is diagonalisable, which by the [Characterisations of Diagonalisability](/theorems/404) amounts to finding a basis of eigenvectors for $\mathbb{F}^n$.
For each $i = 1, \ldots, k$, choose a basis $\mathcal{B}_i = \{v_1^{(i)}, \ldots, v_{m_g(\lambda_i)}^{(i)}\}$ of $E_{\lambda_i}$. Consider the union $\mathcal{B} = \mathcal{B}_1 \cup \cdots \cup \mathcal{B}_k$. The [Linear Independence of Eigenvectors for Distinct Eigenvalues](/theorems/920) guarantees that eigenvectors from distinct eigenspaces are linearly independent. More precisely, if a linear combination $\sum_{i=1}^{k} \sum_{j} c_j^{(i)} v_j^{(i)} = 0$, then for each $i$ the partial sum $\sum_j c_j^{(i)} v_j^{(i)}$ must be zero (as it lies in $E_{\lambda_i}$ and the eigenspaces have pairwise intersections equal to $\{0\}$). Since each $\mathcal{B}_i$ is a basis for $E_{\lambda_i}$, all coefficients $c_j^{(i)} = 0$. So $\mathcal{B}$ is linearly independent.
The number of vectors in $\mathcal{B}$ is
\begin{align*}
|\mathcal{B}| = \sum_{i=1}^{k} m_g(\lambda_i) = \sum_{i=1}^{k} m_a(\lambda_i) = n.
\end{align*}
By the [Dimension Count Criterion](/theorems/3272), a linearly independent set of $n$ vectors in $\mathbb{F}^n$ is a basis. Therefore $\mathcal{B}$ is a basis of eigenvectors, and $A$ is diagonalisable.
[/guided]
[/step]