Skip to content

PermutationReplace ​

Apply a permutation by VALUE rather than by position: a point ii becomes σ(i)\sigma(i), wherever it shows up. On a plain point or a list this renames entries in place; on Cycles it conjugates — σ⋅c⋅σ−1\sigma \cdot c \cdot \sigma^{-1} — since conjugating a cycle is exactly relabelling the points it names.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguagePermutationReplace✓
PermutationReplace(i, perm)σ(i)\sigma(i), or ii itself past perm's own support
PermutationReplace(list, perm)list with every entry ii replaced by σ(i)\sigma(i)
PermutationReplace(Cycles(...), perm)the cycles conjugated by perm — each point renamed, same cycle structure
Typed signatures
TypePackageApplies
(expression<Cycles> | integer | list<integer>, expression<Cycles> | list<integer>) -> expression<Cycles> | integer | list<integer>groupalgebraalways

Domain: Permutations

Details
  • Permute moves items by POSITION; PermutationReplace renames them by VALUE — Permute(List(a, b, c), perm) and PermutationReplace(List(1, 2, 3), perm) answer different questions
  • perm in either notation — Cycles or a one-line word
  • A point beyond perm's own support is fixed and passes through unchanged
  • A conjugated Cycles prints in ITS canonical form — smallest point first, singletons dropped, cycles ordered by that first point — not whatever rotation the per-point relabelling produced; this is the same presentation PermutationCycles and GroupElements use

Examples

Basic #

(1 2 3)(1\,2\,3) sends 2→32 \to 3

live ↗
InPermutationReplace(2,Cycles([[1,2,3]]))\mathrm{PermutationReplace}(2, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 3\bigr\rbrack\bigr\rbrack))Out33

each VALUE is replaced, not the position it sits in — 4 is past the cycle's support, so it is fixed

live ↗
InPermutationReplace([1,2,3,4],Cycles([[1,2,3]]))\mathrm{PermutationReplace}(\bigl\lbrack1, 2, 3, 4\bigr\rbrack, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 3\bigr\rbrack\bigr\rbrack))Out[2,3,1,4]\bigl\lbrack2, 3, 1, 4\bigr\rbrack

on Cycles, PermutationReplace conjugates: every point the cycle names is relabelled by the second permutation

live ↗
InPermutationReplace(Cycles([[1,2,3]]),Cycles([[1,2]]))\mathrm{PermutationReplace}(\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 3\bigr\rbrack\bigr\rbrack), \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack\bigr\rbrack))OutCycles([[1,3,2]])\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 3, 2\bigr\rbrack\bigr\rbrack)

Applies the cycle to a point: 4 goes to 6

live ↗
InPermutationReplace(4,Cycles([[2,3,4,6]]))\mathrm{PermutationReplace}(4, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack2, 3, 4, 6\bigr\rbrack\bigr\rbrack))Out66

The identity leaves a point alone

live ↗
InPermutationReplace(4,Cycles([]))\mathrm{PermutationReplace}(4, \mathrm{Cycles}(\bigl\lbrack\bigr\rbrack))Out44

Applying one permutation to another composes them

live ↗
InPermutationReplace(Cycles([[1,4],[2,5,6,3]]),Cycles([[2,3,5,1,4,6]]))\mathrm{PermutationReplace}(\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 4\bigr\rbrack, \bigl\lbrack2, 5, 6, 3\bigr\rbrack\bigr\rbrack), \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack2, 3, 5, 1, 4, 6\bigr\rbrack\bigr\rbrack))OutCycles([[1,2,5,3],[4,6]])\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 5, 3\bigr\rbrack, \bigl\lbrack4, 6\bigr\rbrack\bigr\rbrack)
Scope #

5 moves to 3, the next point in its cycle

live ↗
InPermutationReplace(5,Cycles([[1,5,3],[2,7]]))\mathrm{PermutationReplace}(5, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 5, 3\bigr\rbrack, \bigl\lbrack2, 7\bigr\rbrack\bigr\rbrack))Out33

The cycle wraps around: 3 returns to 1

live ↗
InPermutationReplace(3,Cycles([[1,5,3],[2,7]]))\mathrm{PermutationReplace}(3, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 5, 3\bigr\rbrack, \bigl\lbrack2, 7\bigr\rbrack\bigr\rbrack))Out11

4 is in no cycle, so it is fixed

live ↗
InPermutationReplace(4,Cycles([[1,5,3],[2,7]]))\mathrm{PermutationReplace}(4, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 5, 3\bigr\rbrack, \bigl\lbrack2, 7\bigr\rbrack\bigr\rbrack))Out44

Replaces every entry of a list through the permutation

live ↗
InPermutationReplace([1,2,3,4,5,6],Cycles([[1,5,3],[2,7]]))\mathrm{PermutationReplace}(\bigl\lbrack1, 2, 3, 4, 5, 6\bigr\rbrack, \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 5, 3\bigr\rbrack, \bigl\lbrack2, 7\bigr\rbrack\bigr\rbrack))Out[5,7,1,4,3,6]\bigl\lbrack5, 7, 1, 4, 3, 6\bigr\rbrack
Properties #

the result prints the way Cycles always does when it's computed rather than typed: smallest point first, singletons dropped — not whatever rotation the per-point relabelling happened to produce

live ↗
InPermutationReplace(Cycles([[1,2]]),Cycles([[1,3,2]]))\mathrm{PermutationReplace}(\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack\bigr\rbrack), \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 3, 2\bigr\rbrack\bigr\rbrack))OutCycles([[1,3]])\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 3\bigr\rbrack\bigr\rbrack)

conjugating by pp then by qq is conjugating by their composite: two steps land where one big permutation would

live ↗
InPermutationReplace(PermutationReplace(Cycles([[1,2,3]]),Cycles([[1,2]])),Cycles([[1,2,3]]))\mathrm{PermutationReplace}(\mathrm{PermutationReplace}(\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 3\bigr\rbrack\bigr\rbrack), \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2\bigr\rbrack\bigr\rbrack)), \mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 2, 3\bigr\rbrack\bigr\rbrack))OutCycles([[1,3,2]])\mathrm{Cycles}(\bigl\lbrack\bigl\lbrack1, 3, 2\bigr\rbrack\bigr\rbrack)
About
Examples12
Checked againstWolfram Language 12 agree
CrosswalkWolfram Language

See also: Permute, Cycles, PermutationList, InversePermutation