5.4  Permutations and Iteration

Sections 5.1–5.3 built new functions from old ones: by cutting a domain down, by gluing pieces together, by passing to a quotient, and by combining two functions with an operation. This section does the simplest thing that can be done with a function whose codomain is its own domain: it applies the function again, and again. For a bijection, going forwards and backwards sorts the set into orbits, and on a finite set each orbit is a cycle. We prove that a bijection of a finite set, repeated often enough, gives back the identity, and we say after how many steps. Then we see what is left of this when the map is not a bijection.

5.4.1. Shuffling twelve cards

Lay twelve cards in a row and number the positions 0,1,…,11. Cut the row into three piles of four: positions 0–3, positions 4–7, positions 8–11. Now deal them back: take the first card of each pile in turn, then the second card of each pile, and so on. The new row holds the cards from the old positions 0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11, in that order. So the card that was at position 4 is now at position 1, and the card that was at position 1 is now at position 3.

The card at old position i moves to the new position σ(i), where σ(i)={3iif 0≤i≤3,3i−11if 4≤i≤7,3i−22if 8≤i≤11. Check one card from each pile: card 2 lands at 6, card 5 at 15−11=4, card 10 at 30−22=8, as the row above says. The three pieces {0,…,3}, {4,…,7}, {8,…,11} are disjoint and cover the positions, so σ is a gluing with nothing to check on overlaps (Example (Method: define a function by gluing)).

Now shuffle again by the same rule. After two shuffles the card from position i is at σ(σ(i)). Follow card 1 through the shuffles: it goes to 3, then 9, then 27−22=5, then 15−11=4, then 12−11=1. Card 2 goes to 6, 7, 10, 8, and back to 2. Cards 0 and 11 never move. These are 1+1+5+5=12 cards, every card of the deck, and each is back in its place after five shuffles. The deck is in its starting order.

Was that luck? Three questions organize the section. Does every shuffle of a finite deck, repeated, bring the deck back? After how many shuffles? And what is left of the answer when the rule is not a shuffle, for instance when it sends two positions to one?

5.4.2. Permutations and iterates

A shuffle sends every position to a position, sends no two positions to the same one, and fills every position. That is a bijection from the set of positions to itself.

Definition 5.4.1 (Permutation)

Let X be a set. A permutation of X is a bijection σ:X→X. The set of all permutations of X is written SX; it is a subset of XX, the set of all functions X→X.

For a finite set, a function X→X can be written as a two-line table: the elements of X in the top row, and under each element its image. For instance, (123231) is the function on {1,2,3} with 1↦2, 2↦3, 3↦1. It is a table, not a matrix: nothing is multiplied. Such a function is a permutation exactly when its bottom row lists every element of X once: “every element appears” is surjectivity, and “no element twice” is injectivity. The hook’s shuffle is the table with top row 0,…,11 and bottom row 0,3,6,9,1,4,7,10,2,5,8,11. The two permutations of {1,2} are the identity and the swap 1↦2, 2↦1.

Section 5.3 made composition an operation on XX (Proposition 5.3.5). The permutations are closed under it, and they keep everything that operation has.

Proposition 5.4.1 (Permutations under Composition)

Let X be a set.

  • (a) If σ,τ∈SX, then σ∘τ∈SX.
  • (b) idX∈SX.
  • (c) If σ∈SX, then σ−1∈SX, and σ∘σ−1=idX=σ−1∘σ.

Hence SX is closed under ∘, and ∘ is an associative operation on SX with identity idX, in which every element σ is invertible, with inverse σ−1.

Proof.

  • (a) is Theorem 1.5.4 (c). (b) idX∘idX=idX, so idX is a two-sided inverse of itself, and it is bijective by Theorem 1.6.4. (c) Since σ is bijective, it has the inverse σ−1 with σ−1∘σ=idX and σ∘σ−1=idX (Theorem 1.6.4, Definition 1.6.2). Read the other way round, the same two equations say that σ is a two-sided inverse of σ−1, so σ−1 is bijective by Theorem 1.6.4.

By (a), SX is closed under ∘, so ∘ restricted to SX×SX is an operation on SX (Definition 5.3.1). Associativity holds on all of XX (Proposition 5.3.5), so in particular on SX; idX lies in SX by (b) and is an identity there; and by (c) each σ∈SX has an inverse σ−1 that lies in SX.

So everything Section 5.3 proved for an associative operation with an identity applies to SX. For instance, Proposition 5.3.3 (c) gives (σ∘τ)−1=τ−1∘σ−1: undo the second shuffle first.

Composing a function with itself needs only that its codomain is its domain; bijectivity is not needed. Shuffling twice is σ∘σ, and “apply f a total of n times” is a definition by recursion.

Definition 5.4.2 (Iterates)

Let X be a set and f:X→X. The iterates fn:X→X, for n∈N, are defined by f0:=idX,fn+1:=f∘fn. For σ∈SX and n∈N, we also set σ−n:=(σ−1)n.

The definition is an instance of Theorem 2.3.1, applied to the set XX with the starting value idX and the step g:N×XX→XX, g(n,h):=f∘h: there is exactly one sequence n↦fn in XX with these two properties. Unwinding, f1=f∘idX=f, f2=f∘f, f3=f∘(f∘f), and fn(x) is “apply f to x, n times”. For a permutation the two clauses do not clash: σ−0=(σ−1)0=idX=σ0, and (σ−1)1=σ−1 is the inverse function. So σk has one meaning for every k∈Z. As Section 5.3 warned, fn is always an iterate in this book, never the pointwise power x↦f(x)n.

The definition adds one f at a time, on the left. The first thing to prove is that blocks of f’s can be moved around as the notation suggests.

Proposition 5.4.2 (Laws of Iterates)

Let X be a set, f:X→X, and m,n∈N.

  • (a) fm+n=fm∘fn.
  • (b) (fm)n=fmn.
  • (c) If σ∈SX, then σk∈SX for every k∈Z; σn∘σ−n=idX=σ−n∘σn; and σk+l=σk∘σl for all k,l∈Z.

Idea. Each law is an equation between iterates, and the definition only tells us how to peel one f off the left. So we induct on the exponent that appears first, peel one f, and use the induction hypothesis on what is left. For (c) the new feature is the sign: σ−n undoes σn, and a mixed sum k+l is handled by canceling the overlap.

Proof.

  • (a) Fix n and induct on m (Logic and Proof, Axiom 4.2.1). For m=0, f0+n=fn=idX∘fn=f0∘fn by Proposition 1.5.3. Suppose fm+n=fm∘fn. Then, by Definition 5.4.2, the induction hypothesis and Proposition 1.5.3, f(m+1)+n=f∘fm+n=f∘(fm∘fn)=(f∘fm)∘fn=fm+1∘fn.

  • (b) Induct on n. For n=0, (fm)0=idX=f0=fm⋅0. If (fm)n=fmn, then (fm)n+1=fm∘(fm)n=fm∘fmn=fm+mn by (a), and m+mn=m(n+1).

  • (c) First, σn∈SX for n∈N, by induction: σ0=idX∈SX, and σn+1=σ∘σn∈SX by Proposition 5.4.1 (a). Since σ−1∈SX (Proposition 5.4.1 (c)), the same induction gives σ−n=(σ−1)n∈SX. So σk∈SX for every k∈Z.

Next, σn∘σ−n=idX, by induction on n. For n=0 both factors are idX. If it holds for n, then σn+1=σn∘σ by (a) with the exponents n and 1, and σ−(n+1)=σ−1∘σ−n by Definition 5.4.2, so σn+1∘σ−(n+1)=σn∘(σ∘σ−1)∘σ−n=σn∘σ−n=idX, by Proposition 1.5.3 and Proposition 5.4.1 (c). The equation σ−n∘σn=idX is the same induction with the roles of σ and σ−1 exchanged.

Finally, σk+l=σk∘σl. When k,l≥0 this is (a). When k,l≤0, it is (a) for the map σ−1 with the exponents −k and −l. The cases with k and l of opposite signs reduce to these two by canceling, as the second reading below shows.

Second readingThe mixed signs in (c)

Let k and l have opposite signs. All equalities below use Proposition 1.5.3, the cases of (c) already proved, and σn∘σ−n=idX=σ−n∘σn for n∈N.

Case k≥0, l=−b with b>0. If k≥b, then σk=σk−b∘σb by (a), so σk∘σ−b=σk−b∘(σb∘σ−b)=σk−b. If k<b, then σ−b=σ−k∘σ−(b−k) by (a) for σ−1, so σk∘σ−b=(σk∘σ−k)∘σ−(b−k)=σk−b. In both cases σk∘σl=σk+l.

Case k=−a with a>0, l≥0. If l≥a, then σl=σa∘σl−a by (a), so σ−a∘σl=(σ−a∘σa)∘σl−a=σl−a. If l<a, then σ−a=σ−(a−l)∘σ−l by (a) for σ−1, so σ−a∘σl=σ−(a−l)∘(σ−l∘σl)=σl−a. Again σk∘σl=σk+l.

In particular σ−n is the inverse of σn, by the middle clause of (c) and Definition 1.6.2: shuffling backwards n times undoes shuffling forwards n times.

Quick check. For f:R→R, f(x)=x+3, find fn and prove your answer.

Solution. fn(x)=x+3n. By induction on n: f0(x)=x=x+3⋅0; and if fn(x)=x+3n, then fn+1(x)=f(fn(x))=(x+3n)+3=x+3(n+1) by Definition 5.4.2. Here fn is not the power (x+3)n.

5.4.3. Orbits

In the hook, the cards fell into sets that move among themselves: {1,3,9,5,4}, {2,6,7,10,8}, {0} and {11}. The natural guess for “in the same set” is “one card reaches the other”: y=fn(x) for some n∈N. This relation is reflexive (n=0) and transitive (add the exponents, Proposition 5.4.2 (a)). It is not symmetric. For f:N→N, f(n)=n+1, the point 0 reaches 1=f(0), but 1 never reaches 0, since fn(1)=1+n≥1. So reachability does not cut a set into pieces. For a permutation the repair is to allow negative exponents: walk backwards as well as forwards.

The orbit of a point is everywhere a permutation can take it, forwards or backwards.

Definition 5.4.3 (Orbit, Forward Orbit, Fixed Point)

Let X be a set and σ∈SX. For x,y∈X, let x∼σy mean that y=σk(x) for some k∈Z. The orbit of x under σ is Oσ(x):={σk(x):k∈Z}. For an arbitrary function f:X→X, the forward orbit of x is {fn(x):n∈N}. A fixed point of f is an x∈X with f(x)=x.

In words: the orbit collects every point reached from x by applying σ or σ−1 any number of times; the forward orbit uses f only, so it makes sense for every self-map. For a permutation, the forward orbit of x is contained in Oσ(x), since N⊆Z; on a finite set the two are equal, as the next subsection proves. A fixed point is a point the map does not move, the sense in which Section 3.4 called 0 a fixed point of a bijection. For the hook’s shuffle, Oσ(1)={1,3,9,5,4}: since σ5(1)=1, the negative powers give nothing new (σ−1(1)=σ4(1), and so on; Proposition 5.4.4 proves this in general), and 0 and 11 are the fixed points.

Warning. Forward orbits need not cut a set into pieces. For f(n)=n+1 on N, the forward orbit of 0 is N and that of 1 is {n∈N:n≥1}: they overlap and are not equal. Only orbits of a permutation, with k running over Z, are guaranteed to be disjoint or equal.

The guarantee is the next theorem: ∼σ is an equivalence relation, and the orbits are its classes.

Theorem 5.4.3 (The Orbits of a Permutation Partition the Set)

Let X be a set and σ∈SX. Then ∼σ is an equivalence relation on X, and the class of each x∈X is Oσ(x). Hence the orbits of σ form a partition of X. Moreover, x is a fixed point of σ if and only if Oσ(x)={x}.

Proof. We check (Eq1)–(Eq3) of Definition 4.2.1, using Proposition 5.4.2 (c) throughout. (Eq1): x=σ0(x), so x∼σx. (Eq2): if y=σk(x), then σ−k(y)=σ−k(σk(x))=σ−k+k(x)=σ0(x)=x, so y∼σx. (Eq3): if y=σk(x) and z=σl(y), then z=σl(σk(x))=σl+k(x) and l+k∈Z, so x∼σz.

The class of x is {y∈X:y∼σx} (Definition 4.2.2), which by (Eq2) is {y∈X:x∼σy}={σk(x):k∈Z}=Oσ(x). By Theorem 4.2.1 (d), the classes form a partition of X.

If Oσ(x)={x}, then σ(x)=σ1(x)∈Oσ(x), so σ(x)=x. Conversely, let σ(x)=x. Then σn(x)=x for every n∈N, by induction: σn+1(x)=σ(σn(x))=σ(x)=x. Also σ−1(x)=σ−1(σ(x))=x, so x is a fixed point of σ−1, and the same induction gives σ−n(x)=(σ−1)n(x)=x. Hence σk(x)=x for every k∈Z, and Oσ(x)={x}.

The theorem answers the hook’s first observation: the cards always fall into sets that move among themselves, because the orbits are the classes of an equivalence relation, and each card lies in exactly one class.

Quick check. Find the orbits of σ=(1234535124).

Solution. From 1: 1↦3↦1, so Oσ(1)={1,3} (going backwards, σ−1(1)=3, gives nothing new). From 2: 2↦5↦4↦2, so Oσ(2)={2,5,4}. These two orbits are disjoint and cover {1,…,5}, as Theorem 5.4.3 says they must; σ has no fixed point.

5.4.4. Following an orbit

In the hook, card 1 came back after five shuffles and card 0 after one. On a finite set this always happens, and the first return controls everything else about the orbit.

Proposition 5.4.4 (Following an Orbit)

Let X be a finite set, σ∈SX, and x∈X. Then there is a least integer k≥1 with σk(x)=x. For this k:

  • (a) the points x,σ(x),…,σk−1(x) are distinct;
  • (b) Oσ(x)={x,σ(x),…,σk−1(x)}, so Oσ(x) has exactly k elements;
  • (c) for every m∈Z, σm(x)=x if and only if k∣m.

The number k is the length of the orbit Oσ(x).

Idea (Scratch work). The set is finite and the forward orbit x,σ(x),σ2(x),… is an infinite list, so the list must repeat. A repeat is not yet a return to x: we need to cancel the front of it, and that is where injectivity comes in.

Givens Goal
X has n elements; σ bijective some k≥1 with σk(x)=x
the n+1 points σ0(x),…,σn(x) two of them equal: m↦σm−1(x) on {1,…,n+1} is not injective (Corollary 2.5.3 (a))
σi(x)=σj(x) with 0≤i<j≤n; σj=σi∘σj−i cancel σi, which is injective (Proposition 5.4.2 (c)): k=j−i works
a non-empty set of such k a least one (Theorem 2.1.3)

Once there is a least return time, (a) is minimality again, and (c) is division with remainder: m full rounds plus a part of a round.

Proof. Let X have n elements. The set {1,…,n+1} has n+1 elements, so the function {1,…,n+1}→X, m↦σm−1(x), is not injective (Corollary 2.5.3 (a)). So there are integers 0≤i<j≤n with σi(x)=σj(x). By Proposition 5.4.2 (c), σj=σi∘σj−i, so σi(σj−i(x))=σi(x), and since σi∈SX is injective, σj−i(x)=x. Hence the set K:={k∈N:k≥1 and σk(x)=x} contains j−i, and by Theorem 2.1.3 it has a least element k.

  • (a) Suppose σi(x)=σj(x) with 0≤i<j<k. As above, σj−i(x)=x, with 1≤j−i<k, so j−i∈K, against the choice of k. So the k points are distinct.

  • (b) First, σqk(x)=x for every q∈Z. For q≥0, by induction on q: σ0(x)=x, and σ(q+1)k(x)=σk(σqk(x))=σk(x)=x by Proposition 5.4.2 (c). For q<0, −q>0, so σ−qk(x)=x by the case just proved, and σqk(x)=σqk(σ−qk(x))=σ0(x)=x. Now let m∈Z, and write m=qk+r with q,r∈Z and 0≤r<k (Theorem 2.2.3). Then σm(x)=σr(σqk(x))=σr(x). If r=0, this is x. If 1≤r<k, then σr(x)≠x, since otherwise r∈K and r<k. So σm(x)=x if and only if r=0. By the uniqueness in Theorem 2.2.3, r=0 holds exactly when m=q′k for some q′∈Z, that is, when k∣m.

  • (c) The display shows that every point σm(x) of the orbit is one of σ0(x),…,σk−1(x); conversely each of these lies in the orbit. By (a), {1,…,k}→Oσ(x), j↦σj−1(x), is injective, and it is onto by what was just shown; so Oσ(x) has k elements (Definition 2.5.2).

Two things to take from the proof. The forward orbit already contains x,σ(x),…,σk−1(x), so on a finite set it equals the orbit: walking forwards reaches every point that walking backwards does. And in the existence of a return, the hypothesis “σ is a permutation” was used once, in the cancellation of σi; the rest of the proof needs negative powers only because the orbit is defined with them. The last subsection shows what goes wrong without it. The argument is a method in its own right.

Example (Method: follow an orbit)

Template. (1) List the forward orbit x,f(x),f2(x),…. (2) On a finite set of n elements, two of the first n+1 terms are equal (Corollary 2.5.3). (3) Take the first repeat, or the least return time (Theorem 2.1.3). (4) Carry the repeat with the map’s structure: cancel if the map is injective; push forward with fl+1=f∘fl always.

When to use it. Repeated application of one map on a finite set: shuffles, the tick of a clock, maps on Z/n.

The usual failure. Speaking of “the first repeat” without proving that a repeat exists; canceling a map that is not injective, which forgets the tail before the cycle.

Now the hook, in full.

Example (The three-pile shuffle)

Let σ be the shuffle of twelve cards in three piles of four. Show that σ is a permutation of {0,…,11}, find its orbits and their lengths, and find the least N≥1 with σN=id.

Solution. A formula. Write i=4p+r with 0≤r<4 (Theorem 2.2.3); for 0≤i≤11, p∈{0,1,2} is the pile and r the place in it. The card is dealt in round r (counting from 0), after the p cards of that round from the earlier piles, so σ(i)=3r+p; the three cases of the hook are p=0,1,2.

A permutation. Every j∈{0,…,11} is 3r+p for exactly one pair with 0≤p<3, by Theorem 2.2.3, and then 0≤r≤3, because −3<j−p=3r≤11. So 3r+p↦4p+r is a function {0,…,11}→{0,…,11}, and it undoes σ on both sides. By Theorem 1.6.4, σ∈SX for X={0,…,11}.

Arithmetic modulo 11. 3i−σ(i)=12p+3r−3r−p=11p, so σ(i)≡3i(mod11). For i≤10, σ(i)≠11, since 3r+p=11 forces r=3, p=2, that is i=11. So for i≤10, 3i=11p+σ(i) with 0≤σ(i)<11, and σ(i) is the remainder of 3i on division by 11 by the uniqueness in Theorem 2.2.3; and σ(11)=11.

Orbits. Follow each orbit (Example (Method: follow an orbit)), reducing modulo 11: 1↦3↦9↦5↦4↦1(27≡5, 15≡4, 12≡1),2↦6↦7↦10↦8↦2(18≡7, 21≡10, 30≡8, 24≡2), and 0, 11 are fixed. The orbits are {0}, {11}, {1,3,9,5,4}, {2,6,7,10,8}, of lengths 1,1,5,5.

The return. Each length divides 5, so σ5(x)=x for every x by Proposition 5.4.4 (c), and σ5=id by Proposition 1.5.1. For 1≤N<5, 5∤N, so σN(1)≠1 by the same part (c). Hence N=5. The arithmetic agrees: 35=243=22⋅11+1, so five shuffles multiply every position below 11 by 1 modulo 11.

Quick check. Let t:Z/12→Z/12, [a]↦[a+1], be the tick of Example (Maps out of the clock). What is the length of the orbit of [1] under t? And under [a]↦[a+3]?

Solution. By induction, tm([1])=[1+m] for m∈N, and [1+m]=[1] exactly when 12∣m (Theorem 4.2.1 (b), Definition 4.2.5). The least m≥1 is 12: the orbit is all of Z/12, of length 12. The map [a]↦[a+3] is well defined as the tick is ((a+3)−(a′+3)=a−a′), and is a permutation with inverse [a]↦[a−3]. From [1]: [1],[4],[7],[10],[13]=[1]. The orbit is {[1],[4],[7],[10]}, of length 4.

5.4.5. Cycles

The hook’s shuffle moves 1,3,9,5,4 round in a ring, moves 2,6,7,10,8 round in another ring, and leaves everything else alone. A permutation that moves one ring and nothing else deserves a name and a notation.

Definition 5.4.4 (Cycle)

Let X be a set, k≥2, and x1,…,xk∈X distinct. The cycle (x1 x2 ⋯ xk) is the function X→X that sends xj↦xj+1 for 1≤j<k, sends xk↦x1, and sends every other point of X to itself. Two cycles are disjoint if their sets of entries are disjoint.

The cycle is defined by gluing (Example (Method: define a function by gluing)): the pieces {x1,…,xk} and its complement are disjoint and cover X, so there are no overlaps to check. On the first piece the rule reads the index j of a point, and distinctness makes that index unique. On the second piece the rule is the identity. A cycle is a permutation: (xk ⋯ x2 x1) sends xj+1↦xj and x1↦xk, so composing it with (x1 ⋯ xk) in either order fixes each xj, and it fixes each point off the entries since both factors do. By Theorem 1.6.4 the cycle is bijective, with inverse the reversed cycle. The same cycle has k names: (1 3 9 5 4)=(3 9 5 4 1), since both send each entry to the next one round the ring.

The theorem below says that every permutation of a finite set is built from its orbits in this way: one cycle for each orbit with at least two points. Before stating it, note that such orbits are finitely many. Let X have n elements via a bijection φ:{1,…,n}→X. Send each orbit O to the least i with φ(i)∈O (Theorem 2.1.3). Distinct orbits are disjoint (Theorem 5.4.3), so they get distinct indices, and the orbits are in bijection with a subset of {1,…,n}, which is finite (Proposition 2.5.6).

Theorem 5.4.5 (Cycle Decomposition)

Let X be a finite set and σ∈SX. Let O1,…,Or be the distinct orbits of σ with at least two elements, choose xi∈Oi, let ki be the number of elements of Oi (so |Oi|=ki), and let γi:=(xi  σ(xi)  ⋯  σki−1(xi)). Then γ1,…,γr are pairwise disjoint cycles, γi∘γj=γj∘γi for all i,j, and σ=γ1∘γ2∘⋯∘γr, bracketed from the left; if r=0, this says σ=idX.

Idea. Both sides are functions on X, so we compare values (Proposition 1.5.1). A point of Oi is moved by γi exactly as σ moves it, and is left alone by every other γj. So composing the cycles one at a time, the composite agrees with σ on more and more orbits; an induction on the number of cycles composed makes that precise.

Proof. By Proposition 5.4.4, Oi={xi,σ(xi),…,σki−1(xi)} and these ki≥2 points are distinct, so γi is a cycle whose set of entries is Oi. Distinct orbits are disjoint (Theorem 5.4.3), so the cycles are pairwise disjoint.

The key value. Let y∈Oi, say y=σm(xi) with 0≤m<ki. If m<ki−1, then γi(y)=σm+1(xi)=σ(y) by Definition 5.4.2. If m=ki−1, then γi(y)=xi=σki(xi)=σ(y). So γi(y)=σ(y) for every y∈Oi; and σ(y)=σm+1(xi)∈Oi. For j≠i, γj fixes every point of Oi, since Oi∩Oj=∅.

Define δ(0):=idX and δ(j):=δ(j−1)∘γj for 1≤j≤r, by recursion (Theorem 2.3.1, with γj:=idX for j>r). So δ(r) is the composite of the theorem, bracketed from the left. Let Uj:=O1∪⋯∪Oj. We prove by induction on j≤r: δ(j)(y)=σ(y)  for y∈Uj,δ(j)(y)=y  for y∈X∖Uj. For j=0, U0=∅ and δ(0)=idX. Suppose the claim holds for j−1, and let y∈X. If y∈Oj, then γj(y)=σ(y)∈Oj, and Oj is disjoint from Uj−1, so δ(j)(y)=δ(j−1)(σ(y))=σ(y). If y∉Oj, then γj(y)=y, so δ(j)(y)=δ(j−1)(y); and since y∉Oj, y∈Uj exactly when y∈Uj−1. In both cases the claim holds for j.

For j=r: a point y outside Ur lies in an orbit with fewer than two elements, so Oσ(y)={y} and σ(y)=y (Theorem 5.4.3). Hence δ(r)(y)=σ(y) for every y∈X, and δ(r)=σ by Proposition 1.5.1. That disjoint cycles commute is a check of values at a point of Oi, of Oj, and of neither, which the second reading below carries out.

Second readingDisjoint cycles commute

Let i≠j and y∈X. If y∈Oi, then γj(y)=y, so γi(γj(y))=γi(y)=σ(y); and γi(y)=σ(y)∈Oi is fixed by γj, so γj(γi(y))=σ(y). If y∈Oj, the same two lines with i and j exchanged give σ(y) on both sides. If y lies in neither, both cycles fix it, and both composites give y. So γi∘γj=γj∘γi by Proposition 1.5.1. For i=j there is nothing to prove.

From now on we write γδ for γ∘δ, the right factor applied first, the convention of Algebraic Preliminaries, Chapter 2. Two examples. The three-pile shuffle of Example (The three-pile shuffle) is σ=(1 3 9 5 4)(2 6 7 10 8), and the two factors may be written in either order. The tick of Example (Maps out of the clock) has one orbit, all of Z/12, with tm([0])=[m], so it is the single cycle ([0] [1] ⋯ [11]).

The decomposition answers the hook’s second question. A permutation of a finite set comes back to the identity, and the orbit lengths say when.

Corollary 5.4.6 (Some Power Is the Identity)

Let X be a finite set and σ∈SX. For an integer N≥1, σN=idX if and only if the length of every orbit of σ divides N. There is such an N.

Proof. By Proposition 1.5.1, σN=idX means σN(x)=x for every x∈X, and by Proposition 5.4.4 (c) that holds exactly when the length kx of Oσ(x) divides N for every x. This proves the equivalence.

For existence, let X have n elements, and let φ:{1,…,n}→X be a bijection (Definition 2.5.2), and let N:=∏i=1nkφ(i) (Definition 2.3.1). Each factor is an integer ≥1, so N is an integer ≥1. Write Pj:=∏i=1jkφ(i). For a fixed i≤n, kφ(i)∣Pj for every j with i≤j≤n, by induction on j: Pi=Pi−1kφ(i), and Pj∣Pj+1=Pjkφ(j+1), so Proposition 1.1.1 carries the divisibility from Pj to Pj+1. Hence kx∣Pn=N for every x=φ(i)∈X, and σN=idX by the first part.

The least such N is the least positive common multiple of the orbit lengths: by the corollary, N works exactly when it is a common multiple of all of them. For two distinct lengths a and b, that least common multiple is the one found in Example (The supremum under divisibility is the least common multiple). For the three-pile shuffle the lengths are 1,1,5,5, and the answer is 5, as the hook found by hand.

Quick check. Decompose [a]↦[5a] on Z/12 into disjoint cycles.

Solution. The map is well defined by Proposition 4.2.5. Applying it twice gives [25a]=[a], since 25≡1(mod12), so it is its own inverse and a permutation. Following orbits: [1]↦[5]↦[25]=[1]; [2]↦[10]↦[50]=[2]; [4]↦[20]=[8]↦[40]=[4]; [7]↦[35]=[11]↦[55]=[7]; and [0],[3],[6],[9] are fixed (15≡3, 30≡6, 45≡9). So the map is ([1] [5])([2] [10])([4] [8])([7] [11]).

5.4.6. Maps that are not permutations

The last question of the hook: what if the rule sends two positions to one? Then there is no inverse, orbits in the sense of Definition 5.4.3 are not defined, and Proposition 5.4.4’s cancellation is not available. Forward orbits still exist, and on a finite set they still repeat. What changes is that the repeat need not involve the starting point.

Proposition 5.4.7 (Forward Orbits of a Self-Map of a Finite Set)

Let X be a set with n elements, f:X→X, and x∈X. There are integers m≥0 and p≥1 with m+p≤n such that fl+p(x)=fl(x)for every integer l≥m.

Idea. This is Example (Method: follow an orbit) with step (4) done without canceling: the pigeonhole repeat fi(x)=fj(x) cannot be pulled back to x, but it can be pushed forward, one application of f at a time.

Proof. As in the proof of Proposition 5.4.4, Corollary 2.5.3 (a) gives integers 0≤i<j≤n with fi(x)=fj(x). Let m:=i and p:=j−i≥1; then m+p=j≤n. We prove fl+p(x)=fl(x) by induction on l≥m (Theorem 2.2.1). For l=m it is fj(x)=fi(x). If it holds for l, then by Definition 5.4.2 fl+1+p(x)=f(fl+p(x))=f(fl(x))=fl+1(x).

The forward orbit of x is thus a tail x,f(x),…,fm−1(x) followed by a cycle that repeats with period p. For a permutation the tail can be taken empty: m=0 and p=k, the length of Oσ(x), work, by Proposition 5.4.4 (c). Without injectivity it need not be.

Example (Squaring on an eleven-hour clock)

Let s:Z/11→Z/11, s([a]):=[a2]. Show that s is well defined, follow the forward orbit of [2], and find m and p. Does [2] ever come back?

Solution. Well defined. If a≡a′(mod11), then a⋅a≡a′⋅a′ by the product clause of Proposition 4.2.5: the rule a↦[a2] is constant on classes (Example (Method: define a function on a quotient)).

The orbit. Squaring and reducing modulo 11: [2]↦[4]↦[16]=[5]↦[25]=[3]↦[9]↦[81]=[4], using 16−11=5, 25−22=3, 81−77=4. So s5([2])=[4]=s1([2]), with s1([2]),…,s4([2]) distinct: the tail is [2], and the cycle is [4],[5],[3],[9], so m=1 and p=4.

No return. The set C={[4],[5],[3],[9]} contains s([2])=[4], and the computation above shows that s maps C into C ([4]↦[5]↦[3]↦[9]↦[4]). So by induction on l≥1 (Theorem 2.2.1, Definition 5.4.2), every sl([2]) with l≥1 lies in C, and none of them is [2]. This is the tail-and-cycle shape that Proposition 5.4.7 predicts. The reason is the failure of injectivity: s([2])=[4]=s([9]), with [2]≠[9]. The point [4] has two arrows coming in, from [2] and from [9]; the cycle comes back to [4] through [9], and never needs [2] again.

The example is the usual failure of Example (Method: follow an orbit) in action: from s([2])=s([9]) one may not cancel s to conclude [2]=[9].

Quick check. Follow the forward orbit of [0] under [a]↦[a2+1] on Z/7, and find m and p.

Solution. [0]↦[1]↦[2]↦[5]↦[26]=[5], since 26−21=5. The tail is [0],[1],[2], so m=3, and [5] is a fixed point, so p=1.

Remark (Looking ahead). Algebraic Preliminaries, Chapter 2 gives a name, group, to a set with an associative operation that has an identity and inverses, as ∘ on SX does by Proposition 5.4.1, and studies SX among its examples.

5.4.7. Exercises

A. Check your understanding

Exercise (A1)
  • (a) For σ=(1 4)(2 3 5) on {1,…,5}, write the two-line tables of σ, σ−1 and σ2.
  • (b) Let f:{1,…,5}→{1,…,5} send 1↦2, 2↦3, 3↦4, 4↦2, 5↦5. Find m and p as in Proposition 5.4.7 for x=1, with m as small as possible.
  • (c) How many fixed points has the three-pile shuffle of twelve cards?

Solution.

  • (a) Applying the right factor first, σ sends 1↦4, 2↦3, 3↦5, 4↦1, 5↦2: σ=(1234543512),σ−1=(1234545213),σ2=(1234515243). The table of σ−1 is that of σ read from bottom to top; σ−1=(1 4)(2 5 3) and σ2=(2 5 3), since the swap (1 4) applied twice is the identity.

  • (b) The forward orbit is 1,2,3,4,2,…: f4(1)=2=f1(1), with f0(1),…,f3(1) distinct. So m=1, p=3 work. And m=0 is impossible: f maps {2,3,4} into itself and f(1)=2, so by induction fl(1)∈{2,3,4} for every l≥1, and fp(1)≠1=f0(1) for every p≥1.

  • (c) Two: positions 0 and 11 (Example (The three-pile shuffle)).

B. Practice

Exercise (B1: Doubling on nine hours)

Let d:Z/9→Z/9, d([a]):=[2a]. Show that d is a permutation, decompose it into disjoint cycles, and find the least N≥1 with dN=id.

Solution. d is well defined by Proposition 4.2.5, and so is e([a]):=[5a]. Since 10≡1(mod9), e(d([a]))=[10a]=[a] and d(e([a]))=[a], so d is bijective with inverse e (Theorem 1.6.4). Following orbits (Example (Method: follow an orbit)): [1]↦[2]↦[4]↦[8]↦[16]=[7]↦[14]=[5]↦[10]=[1], [3]↦[6]↦[12]=[3], and [0] is fixed. So d=([1] [2] [4] [8] [7] [5])([3] [6]), with orbit lengths 6,2,1. By Corollary 5.4.6, dN=id exactly when 6∣N, 2∣N and 1∣N, that is, when 6∣N (since 2∣6, Proposition 1.1.1). The least such N≥1 is 6.

Exercise (B2: Iterates commute)

Let f,g:X→X. Prove that fn+1=fn∘f for every n∈N, and that if f∘g=g∘f, then fn∘g=g∘fn for every n∈N.

Solution. The first equation is Proposition 5.4.2 (a) with the exponents n and 1, since f1=f. For the second, induct on n. For n=0, idX∘g=g=g∘idX (Proposition 1.5.3). If fn∘g=g∘fn, then, by Definition 5.4.2 and Proposition 1.5.3, fn+1∘g=f∘(fn∘g)=f∘(g∘fn)=(f∘g)∘fn=(g∘f)∘fn=g∘fn+1.

Exercise (B3: Orbits are invariant)

Let σ∈SX and x∈X. Prove that σ(Oσ(x))=Oσ(x).

Solution. (⊆) A point of σ(Oσ(x)) is σ(σk(x))=σk+1(x) for some k∈Z (Definition 1.7.1, Proposition 5.4.2 (c)), and k+1∈Z. (⊇) For k∈Z, σk(x)=σ(σk−1(x)) by Proposition 5.4.2 (c), and σk−1(x)∈Oσ(x).

Exercise (B4: Prove or disprove)

Prove or disprove each statement.

  • (a) If X is finite and f:X→X is injective, then every x∈X has fk(x)=x for some k≥1.
  • (b) If f:X→X and fN=idX for some N≥1, then f is a permutation.
  • (c) Every function from a finite non-empty set to itself has a fixed point.
  • (d) Every orbit of a permutation is finite.
  • (e) If X is finite and every orbit of σ∈SX has length 1 or 2, then σ∘σ=idX.

Solution.

  • (a) True. The proof of Proposition 5.4.4 used only that σi is injective. Here fi is injective for every i∈N, by induction with Theorem 1.5.4 (a) (f0=idX, fi+1=f∘fi). So pigeonhole gives fi(x)=fj(x) with i<j; by Proposition 5.4.2 (a), fj=fi∘fj−i, and canceling fi gives fj−i(x)=x, with j−i≥1.

  • (b) True. By Proposition 5.4.2 (a), f∘fN−1=fN=idX and fN−1∘f=f(N−1)+1=idX. So fN−1 is a two-sided inverse of f, and f is bijective by Theorem 1.6.4.

  • (c) False. The swap of {0,1}, 0↦1, 1↦0, moves both points.

  • (d) False. σ:Z→Z, σ(n)=n+1, is a permutation with inverse n↦n−1, and σk(0)=k for every k∈Z (induction in each direction), so Oσ(0)=Z. This is not finite: it contains N, which is infinite (Example (Hilbert’s Hotel), Proposition 2.5.6).

  • (e) True. Each orbit length kx divides 2, so σ2(x)=x by Proposition 5.4.4 (c), for every x; and σ2=σ∘σ by Definition 5.4.2. So σ∘σ=idX by Proposition 1.5.1.

C. Going deeper

Exercise (C1: Exit check: fifteen cards)

Fifteen cards lie at positions 0,…,14. Cut them into three piles of five and deal them back in turn, as in the hook, so that σ(i)={3iif 0≤i≤4,3i−14if 5≤i≤9,3i−28if 10≤i≤14. Show that σ is a permutation, decompose it into disjoint cycles, and find the least N≥1 with σN=id.

Solution. A permutation. The three pieces have images {0,3,6,9,12}, {1,4,7,10,13} and {2,5,8,11,14}: the positions with remainder 0, 1, 2 on division by 3. Each piece is injective (3i−c=3i′−c gives i=i′), and the images are disjoint and cover {0,…,14} by Theorem 2.2.3. So two different cards in one piece land in different places, two cards in different pieces land in different images, and every position is hit: σ is bijective. (This is the cross-piece check of Example (Method: define a function by gluing).)

Arithmetic modulo 14. Write i=5p+r with 0≤r<5; the card lands at σ(i)=3r+p, and 3i−σ(i)=15p−p=14p, so σ(i)≡3i(mod14). Since 3r+p=14 only for r=4, p=2, that is i=14, σ maps {0,…,13} into itself, with σ(i) the remainder of 3i on division by 14, and σ(14)=14. By induction and Proposition 4.2.5, σk(i)≡3ki(mod14) for i≤13.

Cycles. 0, 7 (21≡7) and 14 are fixed. Following orbits (Example (Method: follow an orbit)): 1↦3↦9↦13↦11↦5↦1(27≡13, 39≡11, 33≡5, 15≡1),2↦6↦4↦12↦8↦10↦2(18≡4, 36≡8, 24≡10, 30≡2). These account for 3+6+6=15 positions, so σ=(1 3 9 13 11 5)(2 6 4 12 8 10) by Theorem 5.4.5.

The return. The orbit lengths are 1,1,1,6,6. By Corollary 5.4.6, σN=id exactly when 6∣N; the least N≥1 is 6. Check: 36=729=52⋅14+1, so six shuffles multiply every position below 14 by 1 modulo 14.

Marking scheme. (10 points) - 2: proves σ bijective, including the check across pieces (or by an explicit inverse). - 2: reduces σ to multiplication by 3 modulo 14 on {0,…,13} with 14 fixed, or follows the orbits directly from the three formulas. - 3: finds the two 6-cycles and the fixed points 0,7,14, with the arithmetic shown. - 3: concludes N=6 and shows that no smaller N works, either from the orbit lengths by Corollary 5.4.6 or directly (36≡1(mod14) and σk(1)≠1 for 1≤k≤5). Fatal errors (0 for the step): claiming bijectivity from injectivity of each piece alone; taking N as the sum, rather than a common multiple, of the orbit lengths.

Exercise (C2: Find the error)

Here is a claim and a proof.

Claim. For every function f from a finite set X to itself and every x∈X, there is k≥1 with fk(x)=x.

Proof. By pigeonhole, fi(x)=fj(x) for some i<j. Apply f−i to both sides: x=fj−i(x). Take k=j−i.

Is the claim true? Find the line that fails, say why, and state what the argument does prove.

Solution. The claim is false. The line that fails is “apply f−i”: f−i is defined only for a permutation (Definition 5.4.2), and the claim is about every self-map. A counterexample to that step, and to the claim, is Example (Squaring on an eleven-hour clock) with x=[2]: s1([2])=s5([2])=[4], but no sk([2]) with k≥1 is [2]. The correct conclusion from the pigeonhole repeat is Proposition 5.4.7: after a tail, the forward orbit is periodic. For a permutation, or more generally an injective f (B4 (a)), the cancellation is legitimate and the claim holds.

Marking scheme. (10 points) - 3: says the claim is false, with a counterexample. - 4: names the failing line, “apply f−i”, and the reason: f need not be invertible, or even injective. - 3: states the correct conclusion (tail then cycle, Proposition 5.4.7), or the extra hypothesis under which the proof is right. Fatal errors (0 for the step): accepting the proof because the claim holds for permutations; objecting to the pigeonhole step, which is correct.

Exercise (C3: Each point, its own clock)

Let X be a finite set and σ∈SX. Show that the length of Oσ(x) is the same for all points x of one orbit. Show also that if σ has exactly two orbits, then the number of elements of X is the sum of their lengths.

Solution. Let y∈Oσ(x). Then x∼σy, so Oσ(y)=Oσ(x) by Theorem 5.4.3 and Theorem 4.2.1 (b). By Proposition 5.4.4 (b), the length of an orbit is its number of elements, so the length at y is the number of elements of Oσ(y)=Oσ(x), which is the length at x.

If σ has exactly two orbits O and O′, they are disjoint and their union is X (Theorem 5.4.3, Definition 4.2.3). By Proposition 5.4.4 (b), O and O′ have as many elements as their lengths k and k′, so X=O∪O′ has k+k′ elements by Proposition 2.5.5.

R. Review

Exercise (R1)

On R, let x∼y mean x−y∈Z. Show that [x]↦[2x] is a well-defined surjection R/∼→R/∼ that is not injective.

Solution. Here ∼ is the equivalence relation of Example (The reals modulo the integers). Let g:R→R/∼, g(x):=[2x]. If x∼x′, then 2x−2x′=2(x−x′)∈Z, so g is constant on classes, and Theorem 5.2.3 (a) gives the function [x]↦[2x] (Example (Method: define a function on a quotient)). It is onto: every class [y] is the image of [y/2]. It is not injective: [0]↦[0] and [12]↦[1]=[0], while [0]≠[12] by Example (The reals modulo the integers). The method is the well-definedness check of Section 4.2 (Example (Method: checking that a definition on classes is well defined)).

Exercise (R2)

Let φ:X→Y be a bijection. Show that σ↦φ∘σ∘φ−1 is a bijection from SX to SY, and that x is a fixed point of σ if and only if φ(x) is a fixed point of φ∘σ∘φ−1.

Solution. For σ∈SX, φ∘σ∘φ−1:Y→Y is a composite of bijections (φ−1 is bijective by Theorem 1.6.4, since φ is a two-sided inverse of it, Definition 1.6.2), so it lies in SY (Theorem 1.5.4 (c)); so the rule is a function c:SX→SY. In the same way d(τ):=φ−1∘τ∘φ defines d:SY→SX. By Proposition 1.5.3 and φ−1∘φ=idX, φ∘φ−1=idY (Definition 1.6.2), d(c(σ))=φ−1∘((φ∘σ)∘φ−1)∘φ=(φ−1∘(φ∘σ))∘(φ−1∘φ)=((φ−1∘φ)∘σ)∘idX=σ, with Proposition 1.5.3 at each regrouping, and likewise c(d(τ))=τ. So c has a two-sided inverse and is bijective (Theorem 1.6.4). For the fixed points, c(σ)(φ(x))=φ(σ(φ−1(φ(x))))=φ(σ(x)), which equals φ(x) if and only if σ(x)=x, since φ is injective. The tools are the composites and inverses of Sections 1.5 and 1.6. (Section 3.3’s Exercise (C2: Permutations of the naturals) used bijections of N for a different purpose.)

Exercise (R3)

Let f:R→R, f(x)=2x+1. Prove that fn(x)=2nx+2n−1 for every n∈N and x∈R.

Solution. By induction on n (Logic and Proof, Axiom 4.2.1), with the powers of Definition 2.3.2. For n=0: f0(x)=x=1⋅x+1−1. If fn(x)=2nx+2n−1, then by Definition 5.4.2 fn+1(x)=2(2nx+2n−1)+1=2n+1x+2n+1−1, since 2⋅2n=2n⋅2=2n+1. The method is the induction of Section 2.2 on a sequence defined by recursion (Theorem 2.3.1).

Exercise (R4)

Let f:X→Y, A⊆X and B⊆Y. Show that (f|A)−1(B)=A∩f−1(B).

Solution. For every a, by Definition 1.7.2 applied to f|A:A→Y and to f, and f|A(a)=f(a) for a∈A (Definition 5.1.1), a∈(f|A)−1(B)⟺a∈A∧f(a)∈B⟺a∈A∩f−1(B), where the second step uses A⊆X. The two sets have the same elements, so they are equal. This is the element-chasing of Section 1.7 applied to a function built in Section 5.1. The tool is the preimage definition (Definition 1.7.2), tested pointwise. The look-alike tools fail: image rules such as Proposition 5.1.1 compare images, not preimages, and f(A∩C) can be strictly smaller than f(A)∩f(C); and (f|A)−1 here is a preimage, not an inverse function, which f|A need not have.