Let $f:\mathbb{R}^n\to\mathbb{R}$ be an asymmetric function with respect to its variables. How can I transform it to become symmetric?
For example, when $n=2$, take $f(x,y)=x+y^2$. Pairwise adding extra positional variables $p_y>p_x$, I can write $$ f_s((x,p_x),(y,p_y))=f(x,y)+H(p_x-p_y)(f(y,x)-f(x,y)) $$ where $H$ is the heaviside function. $f_s$ is symmetric with respect to $(x,p_x)$ and $(y,p_y)$, since $$ \begin{align} f_s((x,p_x),(y,p_y))&=f(x,y)+H(p_x-p_y)(f(y,x)-f(x,y))\\ & =f(x,y)\\ f_s((y,p_y),(x,p_x))&=f(y,x)+H(p_y-p_x)(f(x,y)-f(y,x))\\&=f(y,x)+f(x,y)-f(y,x)\\&=f(x,y) \end{align} $$ This could be easily generalised to $n$ variables (is there an efficient way of doing that?), but I wonder if this has been studied in a different way. Any ideas?
For a proposition $P$, let $[P] = 1$, if $P$ is true and $[P] = 0$, if $P$ is false. Then $f(x,y,z) = F((x,0),(y,1),(z,2))$, where $$\begin{align} F((x,X),(y,Y),(z,Z)) &= [X<Y][Y<Z]f(x,y,z) + [X<Z][Z<Y]f(x,z,y) \\ &+ [Y<X][X<Z]f(y,x,z) + [Y<Z][Z<X]f(y,z,x) \\ &+ [Z<X][X<Y]f(z,x,y) + [Z<Y][Y<X]f(z,y,x). \end{align}$$
If $f(x,y,z)$ is $C^∞$, then this can be made $C^∞$ by replacing $[X<Y]$ with $P(X-Y)$, for any $C^∞$ function $P(z)$ such that $P(z) + P(-z) = 1$, $P(z) = 1$ for $z ≥ ½$ and $P'(z) ≥ 0$.