Colour-preserving symmetry group (source code)

= Colour-preserving symmetry group
{title2=$G_c=\{g\in G:c(gx)=c(x)\text{ for all }x\in X\}$}

Let a <group action> of $G$ on a <set> $X$ be given, and let a <function> $c:X\to C$ attach a colour label to each point. The colour-preserving subgroup of $G$ is
$$
G_c=\{g\in G:c(gx)=c(x)\text{ for every }x\in X\}.
$$
It is a <subgroup>: the <identity map> preserves all labels, compositions of two preserving maps preserve them, and replacing $x$ by $g^{-1}x$ shows that <inverse maps> preserve them too. Extra object data restrict the allowable transformations; the labels are now part of the object rather than bookkeeping for a drawing.

For a geometric <square>, take $G=D_4$, of <group order> eight. If all four vertices have the same colour, all eight maps remain. If two adjacent vertices are red and the others blue, only the identity and one <reflection> remain. Putting the two red vertices opposite one another instead leaves four maps: the identity, a half-turn <rotation>, and the two diagonal <reflections>. Giving all four vertices distinct colours leaves only the identity.

\Image[/square-colours-restrict-symmetry-groups.png]
{title=Fixed vertex colours restrict the geometric symmetry group}
{description=Original computed examples. Counts refer to Euclidean motions of the square that preserve each vertex colour. Two adjacent red vertices and two opposite red vertices have the same colour counts but different symmetry groups. Dashed lines show surviving reflection axes; the rotation labels count surviving rotations including the identity.}

The count alone does not specify the pattern. Both two-red examples have the same number of red and blue vertices, but their <stabilizer subgroups> differ. For a single red vertex, the <orbit-stabilizer theorem> gives a <group orbit> of size four and a <stabilizer subgroup> of <group order> two, agreeing with the existing <group action> illustration. Such counts identify equivalent placements without treating each placement as a new geometric case.