Is any function on $(\mathbb S^1)^4$ which is invariant under isometries, invariant under permutations? $\newcommand{\S}{\mathbb{S}^1}$This might be silly, but here it goes:
Let $E:(\mathbb{S}^1)^4 \to \mathbb{R}$ be a smooth function.
Let $f \in \text{Iso}(\mathbb{S}^1)$ be an isometry of $\mathbb{S}^1$. $f$ induces a map $\tilde f:(\mathbb{S}^1)^4 \to (\mathbb{S}^1)^4$, given by
$$
\tilde f(x_1,x_2,x_3,x_4):=\big(f(x_1),f(x_2),f(x_3),f(x_4)\big).
$$
Suppose that $E \circ \tilde f = E$ for any $f \in \text{Iso}(\mathbb{S}^1)$.
Is it true that
$$
E(x_1,x_2,x_3,x_4)=E(x_{\sigma(1)},x_{\sigma(2)},x_{\sigma(3)},x_{\sigma(4)})
$$
for any permutation $\sigma \in S^4$ and any $(x_1,x_2,x_3,x_4) \in (\mathbb{S}^1)^4$?
I guess that the answer is negative, but I am not sure.

 A: [As noted in the comment, this only works for orientation-preserving isometries, not flips. I'll leave it up as "an interesting contribution". :-) ]
Treat $S^1$ as $\mathbb R / \mathbb Z$, so that the isometries (which are the rotations) become translations by a fixed amount, i.e. $x \mapsto x + \alpha$, for some fixed $\alpha$.
Pick some $g: S^1 \rightarrow \mathbb R$ so that there is some $y_0$ with $g(y_0) \ne g(-y_0)$, and define
$$ f(x_1, x_2, x_3, x_4) = g(x_2 - x_1)$$
Then $f$ is not invariant under the permutation $(1,2)$.
[For completeness, $g$ could be $g(x) = \sin(2\pi x)$.]
A: OK, as the question is stated, the answers is negative, for "stupid" reasons:
Take $E(x_1,x_2,x_3,x_4)=\|x_1-x_2\|$. Then $E$ invariant under isometries, but is not invariant under the permutation $(1,3)$.
Here is a more interesting example, where $E$ depends non-trivially on all four points:
$$
E(x_1,x_2,x_3,x_4)=\|x_1-x_2\|+\sum_{i<j}\|x_i-x_j\|.
$$
Then $E(x_1,x_2,x_3,x_4)=E(x_3,x_2,x_1,x_4)$ if and only if $\|x_1-x_2\|=\|x_3-x_2\|$, so $E$ is not invariant under the permutation $(1,3)$.
In fact, any
$$
E(x_1,x_2,x_3,x_4)=\|x_1-x_2\|+F\big((\|x_i-x_j\|)_{i<j}\big),
$$
where $F:\mathbb{R}^6 \to \mathbb{R}$ is permutation-invariant will work.
