Let $K$ be a (commutative) field.
We can define the free $K$-algebra of polynomials in non commutative variables $x\_1, \cdots, x\_n$. It is usually denoted by $K\langle x\_1, \cdots, x\_n \rangle$.


Fix a non commutative polynomial $P \in K\langle x\_1, \cdots, x\_n \rangle$.
For every natural number $m$ and every choice of matrices $M\_1, \cdots, M\_n \in {\rm M}\_m(K)$, we can evaluate $P$ at $(M\_1, \cdots, M\_n)$ to obtain a matrix $P(M\_1, \cdots, M\_n) \in {\rm M}\_m(K)$.


**My question is :** if the evaluation of $P$ on every $n$-tuple of $m\times m$-matrices $(M\_1, \cdots, M\_n)$ for every $m$ is $0$, is necessary $P = 0 \in K\langle x\_1, \cdots, x\_n \rangle$ ?


I don't know if the question is totally trivial.


1. In fact, if we restrict the condition to $m=1$, the answer is clearly no because the non commutative polynomial $x\_1 x\_2 - x\_2 x\_1$ for example is non zero. But it is yes if we consider polynomial in commutative variables.
2. Algebras ${\rm M}\_m(K)$ are polynomial identity rings. In particular, the answer is no again if the condition $P(M\_1, \cdots, M\_n) =0$ only for all $M\_1, \cdots, M\_n \in {\rm M}\_m(K)$ for a fixed $m$. Amitsur–Levitzki theorem gives an explicit counter-example.


**Extension of the question :** same question where we replace $P \in K\langle x\_1, \cdots, x\_n \rangle$ by a non commutative formal power series $S \in K\langle\langle x\_1, \cdots, x\_n \rangle\rangle$ . Here we assume that the matrices $M\_1, \cdots, M\_n$ have to be jointly nilpotent (i.e., any sufficiently long product $M\_{i\_1} M\_{i\_2} \cdots M\_{i\_k}$ is $0$).



non commutative polynomial which is zero for all matrix evaluation
This is an algebraic elaboration on Emil's answer.


Let $A = K \langle x\_1,\ldots,x\_n \rangle$ and let $\hat{A} = K \langle\langle x\_1,\ldots, x\_n \rangle \rangle$. Since $A$ is a subring of $\hat{A}$, a positive answer for $\hat{A}$ implies one for $A$.


Now for each $d \in \mathbb{N}$, let $\hat{A}\_{d}$ be the $K$-linear span of all products of the generators $x\_1,\ldots, x\_n$ of length exactly $d$. Then $\hat{A}\_{d} \cdot \hat{A}\_e = \hat{A}\_{d+e}$ for all $d,e\in\mathbb{N}$, and there is a vector space isomorphism


$$\prod\_{d=0}^\infty \hat{A}\_d \stackrel{\cong}{\longrightarrow} \hat{A}.$$


This just says that every non-commutative formal power series can be uniquely decomposed as an infinite (convergent in a natural topology on $\hat{A}$) sum of its homogeneous components.


Now let $\hat{A}\_{>m} := \prod\_{d>m} \hat{A}\_d$ for each $m \geq 0$. These are two-sided ideals of $\hat{A}$, and for each $m \geq 0$,


$$V\_m := \hat{A} / \hat{A}\_{>m} \cong \prod\_{d=0}^m \hat{A}\_d$$


is a *finite dimensional* vector space over $K$, of dimension $N\_m$, say. This gives us matrix representations 


$$\rho\_m : \hat{A} \to End\_K(V\_m) \cong M\_{N\_m}(K).$$


Clearly $\hat{A}\_{> m}$ is contained in $\ker \rho\_m$, but in fact we have equality, because $\hat{A} / \hat{A}\_{>m}$ (being an associative $K$-algebra in its own right) acts faithfully on itself by left multiplication.


So if $P \in \hat{A}$ is zero on every set of $n$ matrices of size $N$ for all $N \geq 0$, then we see that in particular, $P \in \ker \rho\_m$ for all $m \geq 0$. Hence $P \in \bigcap\_{m \geq 0} \hat{A}\_{>m}$, which implies that every homogeneous component of $P$ is zero. Hence $P$ is also zero.


