TITLE: First order formulas for finite groups and invariant theory
QUESTION [9 upvotes]: Let $G$ be a finite group, and let $K$ be a field of characteristic zero.
Let $\phi(x_1,\ldots,x_n)$ be a first order formula in the language of group theory (so $\phi$ can be for example something of the form $\exists y\in G$ $y^2=x$ or $\exists y_1,y_2\in G $ $ x_1=y_1y_2,x_2=y_2y_1$).
For every such formula $\phi$ we consider the element 
$$t_{\phi}:=\sum_{\{(g_1,\ldots g_n)\in G^n| \phi(g_1,\ldots g_n)\}}g_1\otimes g_2\otimes\cdots\otimes g_n$$
In other words, $t_{\phi}$ is the sum over all tuples who satisfy the formula $\phi$. 
If now $\mu:G\to G$ is a group automorphism, then $\phi(g_1,\ldots,g_n)$ holds if and only if $\phi(\mu(g_1),\ldots,\mu(g_n))$ holds. It thus follows that the elements $t_{\phi}$ are all $Aut(G)$-invariants inside $(KG)^{\otimes n}$.
Is there an elementary proof that the elements $t_{\phi}$ span the invariant subspace $(KG^{\otimes n})^{Aut(G)}$?

REPLY [6 votes]: The assumption on the characteristic of $K$ implies that $(KG^{\otimes n})^{Aut(G)}$ is spanned by the indicator functions of the $Aut(G)$-orbits in $G^n$. So it suffices to observe that for every $(g_1,\dots,g_n) \in G^n$ the formula "$(x_1,\dots,x_n)$ belongs to the $Aut(G)$-orbit of $(g_1,\dots,g_n)$" is a first-order formula. 
But (if I remember correctly what a first-order formula is) this is clear, as it can be written as "$\exists (y_g)_{g \in G} \in G, y_{g h}=y_{g}y_h, y_g \neq y_h$ if $g \neq h$ and $y_{g_i} = x_i$".