Renaming the variables in a polynomial ring does not change its isomorphism type

Let $R$ be a commutative ring and $x_1$, $x_2$, … $x_n$ be symbols. Prove that $R[x_1,\ldots,x_n] \cong R[x_{\sigma(1)}, \ldots, x_{\sigma(n)}]$, where $\sigma$ is any permutation in $S_n$.

We will approach this problem from a slightly different perspective; we will see that polynomial rings are really monoid rings. Given a ring $R$ and a monoid $M$, the monoid ring $R[M]$ is defined just like the group ring $R[G]$. (Recall that a monoid is a set with (1) an associative binary operator and (2) an identity element.)

Lemma 1: Let $R$ be a commutative ring. Then the polynomial ring $R[x]$ is isomorphic to the monoid ring $R[\mathbb{N}]$, where $\mathbb{N}$ is considered a monoid under addition. Proof: Define $\varphi : R[x] \rightarrow R[\mathbb{N}]$ as follows: $\varphi(\sum_{k=0}^n r_kx^k) = \sum_{k=0}^n r_k \cdot k$. It is easy to see that this mapping is an isomorphism. $\square$

Lemma 2: Let $R$ be a commutative ring and let $M,N$ be monoids. Then $R[M \times N] \cong (R[M])[N]$. Proof: Define $\varphi : R[M \times N] \rightarrow (R[M])[N]$ by $\varphi(\sum_{i,j} r_{i,j}(m_i,n_i)) = \sum_{i,j} (r_{i,j}m_i)n_j$, where $i$ and $j$ index $M$ and $N$, respectively. It is clear that this mapping is surjective. It is also clear that its kernel is trivial, so that $\varphi$ is injective. That $\varphi$ is a ring homomorphism is also clear. $\square$

Now it is clear that renaming the variables in a polynomial ring (with finitely many variables) does not change its isomorphism type, as in both cases the ring is isomorphic to $R[\mathbb{N}^k]$ for the same $k$. We could extend this to infinitely many variables by defining the direct sum of monoids in analogous fashion to direct sums of groups- that is, the subset of a direct products in which each element has only finitely many nonidentity entries.