Commutant of generic matrix with polynomial coefficients Let $k={\mathbb Q}(X_1,X_2,X_3,\ldots X_{n^2})$ and
$M={\cal M}_{n,n}(k)$ denote the $k$-algebra of $n\times n$ matrices
with coefficients in $k$. 
Let $A\in M$ be defined by
$$
A=\left(
\begin{array}{ccclc}
X_1 & X_2 & X_3 & \ldots & X_n \\
X_{n+1} & X_{n+2} & X_{n+3} & \ldots & X_{n+n} \\
X_{2n+1} & X_{2n+2} & X_{2n+3} & \ldots & X_{2n+n} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
X_{(n-1)n+1} & X_{(n-1)n+2} & X_{(n-1)n+3} & \ldots & X_{n^2} \\
\end{array}
\right)
$$
and let $C=\lbrace B\in M | AB=BA\rbrace$ be the commutant of $A$.
Then $C$ is a $k$-vector space. What is its dimension (call it $d$) ?
It is easy to see that in $M$, the matrices $1,A,A^2,\ldots,A^{n-1}$
are linearly independent over $k$. If we denote by $V$ the $k$-vector space spanned by those matrices, then $V \subseteq C$. This forces $d\geq n$. 
The obvious guess is then that $V=C$ and $d=n$. I am stuck at this point.
 A: I use the notation $A=[X_{i,j}]$ where the $(X_{i,j})$ are independent commuting indeterminates over $\mathbb{Q}$; in other words, the $(X_{i,j})$ are elements of a transcendental extension of $\mathbb{Q}$ and they are mutually transcendental over $\mathbb{Q}$. Let $k=\mathbb{Q}(X_{i,j})$ be the quotient field and $\overline{k}$ be "its" algebraic closure. $A$ is called  generic matrix over $\mathbb{Q}$. Let $\chi_A$ be the characteristic polynomial of $A\in M_n(k)$.
Proposition. $\chi_A$ is irreducible over $k$ and its Galois group $G$ is $S_n$.
Proof. 1. If we consider a specialization $(X_{t;i,j})$ of the $(X_{i,j})$, that is a specialization $A_t$ of $A$, then the galois group $G_t$ of $\chi_{A_t}$ is a subgroup of $G$. (It is a corollary of Hilbert's irreducibility theorem).


*The Galois group of $P_n(x)=x^n+ax^s+b$ is $S_n$. cf. Osada:  https://projecteuclid.org/download/pdf_1/euclid.tmj/1178228289

*For $A_t$, we choose the companion matrix of $P_n$. Then $G_t=S_n$ and therefore $G=S_n$.
Conclusion. Since $\overline{k}$ is a perfect field, the roots of $\chi_A$ are distinct and $C=k[A]$ has dimension $n$.
