7.3  Permutations and Sign

An alternating form changes sign when two of its arguments are swapped (Theorem 7.2.1). To compare f(v3,v1,v2) with f(v1,v2,v3), we reach one list from the other by swaps and collect a factor −1 per swap. But the same rearrangement can be reached by different sequences of swaps, and Chapter 0 showed that even their number is not unique. If one route used an even number of swaps and another an odd number, we would get f(v1,v2,v3)=−f(v1,v2,v3) for every alternating form, which is absurd for signed volume. This section rules that out. It attaches to each permutation a sign defined without any choices, proves that the sign is multiplicative, and deduces that the parity of the number of transpositions is well defined, as Chapter 0 promised.

7.3.1. Permutations, recalled

Recall from Chapter 0 that Sn is the group of bijections {1,…,n}→{1,…,n}, with n! elements. A permutation can be written in two-line notation, with σ(i) below i, or as a product of cycles. The product στ is the composition σ∘τ: first τ, then σ, so products of cycles are read from right to left (Example (Computing with cycles)). A transposition (i j) swaps i and j and fixes everything else, and for n≥2 every permutation is a product of transpositions (Theorem 0.10.4). The product is far from unique, since (1 2 3)=(1 3)(1 2)=(1 2)(2 3)=(1 3)(1 2)(1 2)(1 2). Here the numbers of transpositions are 2,2,4, all even. The goal is to show this is no accident.

Why can we not simply define the sign of σ as (−1)r, where σ is a product of r transpositions? Because that definition depends on a choice of product, and we would have to prove that every choice gives the same answer. That is the statement we are trying to prove. We need a definition that involves no choice at all.

7.3.2. Inversions and the sign

To measure how much a permutation scrambles 1,2,…,n, look at the bottom row σ(1),σ(2),…,σ(n) of its two-line notation and count the pairs of entries that are in the wrong order. A sorted row has none, and each swap of two neighboring entries changes the count by exactly one. So the count is a natural candidate for tracking the parity of swaps.

The sign of a permutation records whether it puts an even or an odd number of pairs out of order.

Definition 7.3.1 (Inversion)

Let σ∈Sn. An inversion of σ is a pair (i,j) of positions with 1≤i<j≤n and σ(i)>σ(j). We write inv(σ) for the number of inversions of σ.

Definition 7.3.2 (Sign of a Permutation)

The sign of σ∈Sn is sgnσ=(−1)inv(σ)∈{1,−1}. The permutation σ is even if sgnσ=1 and odd if sgnσ=−1.

In words: an inversion is a pair of positions whose order σ reverses. The condition i<j makes each pair of positions count once, and σ(i)>σ(j) says the values come out in the opposite order. Since inv(σ) is the size of a subset of the finite set of pairs i<j, it is a well-defined integer between 0 and n(n−1)/2, and there is nothing to choose. That is the whole reason for this definition.

The identity. Its bottom row is sorted, so inv(id)=0 and id is even. In S1={id} this is the only permutation, with sign 1. The degenerate case matters: the identity is the empty product of transpositions, and its sign 1=(−1)0 is what a product of 0 swaps should give.

All of S3. Here is each permutation with its bottom row and inversions.

σ id (12) (23) (13) (123) (132)
bottom row 123 213 132 321 231 312
inversions none (1,2) (2,3) (1,2),(1,3),(2,3) (1,3),(2,3) (1,2),(1,3)
sgn 1 −1 −1 −1 1 1

For (1 2 3), the bottom row is σ(1),σ(2),σ(3)=2,3,1, and the out-of-order pairs of positions are (1,3), since 2>1, and (2,3), since 3>1.

Two things stand out. The three transpositions are odd, although (1 3) has three inversions, not one. And the two 3-cycles are even, consistent with (1 2 3)=(1 3)(1 2) being a product of two transpositions.

Why all pairs, not just neighbors. A tempting shortcut counts only adjacent positions (i,i+1) with σ(i)>σ(i+1). For (1 3), with bottom row 3,2,1, this count is 2, which would make (1 3) “even”. But (1 3)=(1 2)(2 3)(1 2), as one checks by following 1↦2↦3↦3, 2↦1↦1↦2, 3↦3↦2↦1, and each factor has adjacent count 1. A count that is to be multiplicative must give (−1)3=−1 here, so the adjacent count is the wrong one.

Quick check. Find sgn(1 4) in S4 by counting inversions.

Solution. The bottom row is 4,2,3,1. The pairs of positions in the wrong order are (1,2),(1,3),(1,4), since 4 is larger than everything after it, and (2,4),(3,4), since 2>1 and 3>1. The pair (2,3) is in order. So inv(1 4)=5 and sgn(1 4)=−1.

7.3.3. The sign is multiplicative

The key property is that signs multiply when permutations are composed.

Theorem 7.3.1 (The Sign Is Multiplicative)

For all σ,τ∈Sn, sgn(στ)=sgnσ⋅sgnτ.

Idea. Count inversions one pair at a time, and record each pair as +1 (order kept) or −1 (order reversed). The sign is the product of these ±1’s. Applying τ and then σ moves a pair of positions {i,j} to {τ(i),τ(j)} and then to {στ(i),στ(j)}. The order is reversed overall exactly when it is reversed at one of the two stages but not both, which is multiplication of ±1’s. Finally, as {i,j} runs over all pairs, so does {τ(i),τ(j)}, so the contributions of σ multiply to sgnσ, just in a different order.

Proof. For a non-zero integer m let s(m)=1 if m>0 and s(m)=−1 if m<0. Then s(mm′)=s(m)s(m′) for non-zero integers m,m′, by the sign rules for products of integers.

Let P be the set of 2-element subsets {i,j} of {1,…,n}. For ρ∈Sn and {i,j}∈P, define ερ({i,j})=s((ρ(i)−ρ(j))(i−j)). This is defined: i≠j and ρ(i)≠ρ(j) since ρ is injective, so the product is non-zero; and exchanging the names i and j negates both factors, so the product does not depend on the order in which the subset is written. If i<j, then i−j<0, so ερ({i,j})=−1 exactly when ρ(i)>ρ(j), that is, when (i,j) is an inversion of ρ. Hence, by Definition 7.3.2, (1)sgnρ=∏P∈Pερ(P).

Now let {i,j}∈P. Since τ(i)≠τ(j), we have (τ(i)−τ(j))2>0. Multiplying inside s by this positive integer does not change the value, so εστ({i,j})=s((σ(τ(i))−σ(τ(j)))(τ(i)−τ(j))⋅(τ(i)−τ(j))(i−j))=εσ({τ(i),τ(j)}) ετ({i,j}). Let τ^:P→P, {i,j}↦{τ(i),τ(j)}; the image has two elements because τ is injective. The same construction with τ−1 gives an inverse function, so τ^ is a bijection (Theorem 0.4.7). Taking the product over all P∈P and using (1) three times, sgn(στ)=∏P∈Pεσ(τ^(P))⋅∏P∈Pετ(P)=∏Q∈Pεσ(Q)⋅sgnτ=sgnσ⋅sgnτ, where the second equality substitutes Q=τ^(P), which runs over P exactly once because τ^ is a bijection, and reorders the finite product of integers. This proves the theorem.

By induction on the number of factors, sgn(σ1σ2⋯σr)=sgnσ1⋯sgnσr. In the language of Chapter 0, the set {1,−1} is a group under multiplication (it contains 1, and it is closed under products and inverses, since (−1)−1=−1), and the theorem says exactly that sgn:Sn→{1,−1} is a group homomorphism (Definition 0.10.3).

7.3.4. Transpositions and parity

Now we can compute the sign of the building blocks.

Corollary 7.3.2 (Sign of a Transposition)

Every transposition is odd: sgn(i j)=−1 for all i≠j in {1,…,n}.

Proof. Since (i j)=(j i), we may assume i<j. Let τ=(i j) and let p<q be positions. We decide when τ(p)>τ(q).

  • If neither p nor q lies in {i,j}, then τ(p)=p<q=τ(q): no inversion.
  • If (p,q)=(i,j), then τ(i)=j>i=τ(j): one inversion.
  • If p=i and q≠j, then τ(p)=j and τ(q)=q, an inversion exactly when i<q<j. This gives j−i−1 inversions.
  • If q=j and p≠i, then τ(p)=p and τ(q)=i, an inversion exactly when i<p<j. This gives j−i−1 inversions.
  • If p=j (so q>j), then τ(p)=i<q=τ(q); if q=i (so p<i), then τ(p)=p<j=τ(q): no inversion.

These cases cover every pair, so inv(τ)=1+2(j−i−1), an odd number. Hence sgnτ=−1.

The Quick check above is the case (i,j)=(1,4): 1+2⋅2=5 inversions. Combining the corollary with multiplicativity gives the fact that Chapter 0 left open.

Corollary 7.3.3 (Parity Is Well Defined)

Let n≥2 and σ∈Sn. If σ=τ1⋯τr is a product of r transpositions, then sgnσ=(−1)r. Consequently, if also σ=τ1′⋯τs′ with transpositions τm′, then r and s are both even or both odd.

Proof. By Theorem 7.3.1, extended to r factors, and Corollary 7.3.2, sgnσ=sgnτ1⋯sgnτr=(−1)r. In the same way sgnσ=(−1)s. Hence (−1)r=(−1)s, so r−s is even.

So a permutation is even exactly when it is a product of an even number of transpositions, and the “number of swaps” has a well-defined parity even though the number itself is not defined.

Proposition 7.3.4 (Sign of a Cycle)

A k-cycle has sign (−1)k−1. In particular, cycles of even length are odd and cycles of odd length are even.

Proof. For k=1 the cycle is id, with sign 1=(−1)0. Let k≥2 and let γ=(i1 i2 ⋯ ik). We claim γ=(i1 ik)(i1 ik−1)⋯(i1 i3)(i1 i2). Apply the factors from right to left. The element i1 is sent to i2 by (i1 i2), and no later factor involves i2. For 2≤m≤k−1, the element im is fixed by the factors before (i1 im), sent to i1 by it, then to im+1 by (i1 im+1), and no later factor involves im+1. The element ik is fixed until the last factor (i1 ik) sends it to i1. Elements outside the cycle are fixed by every factor. This agrees with γ everywhere, proving the claim. The product has k−1 transpositions, so sgnγ=(−1)k−1 by Corollary 7.3.3.

Warning. Only the parity of the number of transpositions is determined, and it is not the parity of the cycle length. The identity in S3 equals (1 2)(1 2) and also (1 2)(1 3)(1 2)(1 3)(1 2)(1 3), since ((1 2)(1 3))3=(1 3 2)3=id; the numbers 2 and 6 differ, only their parity agrees. And a 3-cycle, “of length 3”, is even: (1 2 3)=(1 3)(1 2). One more trap concerns order: (1 3)(1 2)=(1 2 3) but (1 2)(1 3)=(1 3 2). Multiplying in the wrong order gives the wrong permutation and the wrong bottom row, even though, by Theorem 7.3.1, it happens to give the right sign.

7.3.5. The alternating group

Since sgn is a homomorphism, its kernel is a subgroup of Sn (Theorem 0.10.3).

Definition 7.3.3 (Alternating Group)

The alternating group An is the kernel of sgn:Sn→{1,−1}, that is, the subgroup of even permutations in Sn.

For example, A3={id,(1 2 3),(1 3 2)} by the table above, and A2={id}. For n≥2, exactly half of the permutations are even (Exercise C1). The odd permutations do not form a subgroup: they do not contain id. The name is no coincidence: as we see below and in the next section, rearranging the arguments of an alternating form by an even permutation leaves its value unchanged.

7.3.6. Back to alternating forms

Here is why this section exists. Let f be an alternating 3-linear form and compare f(v3,v1,v2) with f(v1,v2,v3). Swapping the first two arguments of (v3,v1,v2) gives (v1,v3,v2), and swapping the last two then gives (v1,v2,v3). By Theorem 7.2.1 (a) each swap costs a factor −1, so f(v3,v1,v2)=(−1)2f(v1,v2,v3)=f(v1,v2,v3). The list (v3,v1,v2) is (vσ(1),vσ(2),vσ(3)) for σ=(1 3 2), with bottom row 3,1,2, and the factor 1 we found is sgnσ.

A different sequence of swaps could have been used, possibly a longer one. By Corollary 7.3.3, every such sequence has an even number of swaps, so every route gives the same factor. In general, the next section proves that f(vσ(1),…,vσ(k))=sgnσ⋅f(v1,…,vk) for every alternating k-linear form, and uses it to turn each of the n! surviving terms of the expansion sketched in the first section of this chapter into ±D(e1,…,en). Without the corollary, the factor computed swap by swap could depend on the route, and could not be identified with sgnσ.

7.3.7. Computing signs in practice

There are now two independent ways to find a sign: count inversions, or factor into cycles and use Proposition 7.3.4 with multiplicativity. Doing both is a good check.

Example (A Sign Computed Two Ways)

Find the sign of the permutation σ∈S6 with two-line notation (123456453621), first by counting inversions and then from its cycles.

Solution. Inversions. Go through the bottom row 4,5,3,6,2,1 from left to right, and for each entry count the later entries that are smaller:

position i 1 2 3 4 5 6
σ(i) 4 5 3 6 2 1
later and smaller 3, 2, 1 3, 2, 1 2, 1 2, 1 1 none
count 3 3 2 2 1 0

So inv(σ)=3+3+2+2+1+0=11, which is odd, and sgnσ=−1.

Cycles. Following elements as in Example (Computing with cycles): 1↦4↦6↦1, then 2↦5↦2, and 3↦3. So σ=(1 4 6)(2 5). By Proposition 7.3.4, the 3-cycle has sign 1 and the transposition has sign −1, so by Theorem 7.3.1, sgnσ=1⋅(−1)=−1. The two methods agree.

The following cell checks the example, and also tests Theorem 7.3.1 and Proposition 7.3.4 on all of S5 by brute force. Permutations are stored as tuples of values (σ(1),…,σ(n)), shifted to start at 0.

from itertools import permutations, combinations

def inv(s):
    return sum(1 for i, j in combinations(range(len(s)), 2) if s[i] > s[j])

def sgn(s):
    return (-1) ** inv(s)

def compose(s, t):          # (s t)(i) = s(t(i)): first t, then s
    return tuple(s[t[i]] for i in range(len(t)))

def cycle(entries, n):      # the cycle (entries[0] entries[1] ...), 0-based
    s = list(range(n))
    for a, b in zip(entries, entries[1:] + entries[:1]):
        s[a] = b
    return tuple(s)

sigma = (4, 5, 3, 6, 2, 1)
sigma0 = tuple(x - 1 for x in sigma)
print("inversions:", inv(sigma0), " sign:", sgn(sigma0))
print("(1 4 6)(2 5) equals sigma:", compose(cycle([0, 3, 5], 6), cycle([1, 4], 6)) == sigma0)

S5 = list(permutations(range(5)))
print("multiplicative on S_5:", all(sgn(compose(s, t)) == sgn(s) * sgn(t) for s in S5 for t in S5))
print("k-cycles have sign (-1)^(k-1):", all(sgn(cycle(list(range(k)), 5)) == (-1) ** (k - 1) for k in range(1, 6)))

7.3.8. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define an inversion of σ∈Sn and the sign sgnσ.
  • (b) True or false: every 3-cycle is odd. Justify your answer.
  • (c) True or false: some permutation is a product of 5 transpositions and also a product of 8 transpositions. Justify your answer.
  • (d) What is the kernel of sgn:Sn→{1,−1}? Is the set of odd permutations a subgroup?
  • (e) True or false: sgn(στ)=sgn(τσ) for all σ,τ∈Sn, even when στ≠τσ. Justify your answer.
  • (f) Let f be an alternating 3-linear form. Express f(v2,v3,v1) in terms of f(v1,v2,v3).

Solution.

  • (a) An inversion of σ is a pair (i,j) with 1≤i<j≤n and σ(i)>σ(j) (Definition 7.3.1); sgnσ=(−1)inv(σ) (Definition 7.3.2).

  • (b) False. By Proposition 7.3.4 a 3-cycle has sign (−1)2=1, so it is even; for instance (1 2 3)=(1 3)(1 2).

  • (c) False. By Corollary 7.3.3 the numbers of transpositions in two such products have the same parity, and 5 and 8 do not.

  • (d) The kernel is the alternating group An of even permutations (Definition 7.3.3). The odd permutations do not form a subgroup: id is even, so it is not among them.

  • (e) True. By Theorem 7.3.1 both sides equal sgnσ⋅sgnτ, and multiplication of integers is commutative. For example (1 3)(1 2)≠(1 2)(1 3), but both are 3-cycles, with sign 1.

  • (f) Swapping the first two arguments of (v2,v3,v1) gives (v3,v2,v1), and swapping the first and third then gives (v1,v2,v3). Each swap costs a factor −1 by Theorem 7.2.1 (a), so f(v2,v3,v1)=f(v1,v2,v3). This matches the sign of the rearrangement σ with bottom row 2,3,1, namely σ=(1 2 3), which is even.

B. Practice

Exercise (B1: Computing Signs)

Find the sign of each permutation, both by counting inversions and by using cycles.

  • (a) σ∈S4 with two-line notation (12342413).
  • (b) (1 2)(3 4 5)∈S5.
  • (c) (1 2 3)(2 3 4)∈S4.

Solution.

  • (a) Inversions. In the bottom row 2,4,1,3, the entry 2 is followed by the smaller entry 1, the entry 4 by 1 and 3, and the entry 1 by nothing smaller. So inv(σ)=1+2+0=3 and sgnσ=−1. Cycles. 1↦2↦4↦3↦1, so σ=(1 2 4 3), a 4-cycle, with sign (−1)3=−1 by Proposition 7.3.4.

  • (b) Cycles. By Proposition 7.3.4 and Theorem 7.3.1, the sign is (−1)⋅(−1)2=−1. Inversions. The permutation sends 1↦2, 2↦1, 3↦4, 4↦5, 5↦3, so the bottom row is 2,1,4,5,3. The inversions are (1,2), (3,5) and (4,5), so there are 3, and the sign is −1.

  • (c) Cycles. Both factors are 3-cycles, so the sign is 1⋅1=1. Inversions. Apply (2 3 4) first: 1↦1↦2, 2↦3↦1, 3↦4↦4, 4↦2↦3. The bottom row is 2,1,4,3, with inversions (1,2) and (3,4). So the sign is (−1)2=1, and in fact the product is (1 2)(3 4).

Exercise (B2: Sign of the Inverse)

Prove that sgn(σ−1)=sgnσ for every σ∈Sn.

Solution. Let σ∈Sn. By Theorem 7.3.1, sgnσ⋅sgn(σ−1)=sgn(σσ−1)=sgn(id)=1, since id has no inversions. Since sgnσ∈{1,−1} and (±1)−1=±1, multiplying both sides by sgnσ gives sgn(σ−1)=sgnσ.

Exercise (B3: The Reversal Permutation)

Let ρ∈Sn be the reversal, ρ(i)=n+1−i. Show that inv(ρ)=n(n−1)/2. Hence find the n for which ρ is even, and decide the sign of ρ for n=6 and n=9.

Solution. For 1≤i<j≤n, ρ(i)=n+1−i>n+1−j=ρ(j). So every pair i<j is an inversion, and inv(ρ) is the number of 2-element subsets of {1,…,n}, which is n(n−1)/2. Hence sgnρ=(−1)n(n−1)/2.

Write n=4q+t with t∈{0,1,2,3}. Then n(n−1)/2 is 2q(4q−1) for t=0, 2q(4q+1) for t=1, (4q+1)(2q+1) for t=2, and (2q+1)(4q+3) for t=3. The first two are even and the last two are odd. So ρ is even exactly when n leaves remainder 0 or 1 on division by 4. For n=6, inv(ρ)=15 and ρ is odd; for n=9, inv(ρ)=36 and ρ is even.

C. Going deeper

Exercise (C1: Half the Permutations Are Even)

Let n≥2. Prove that exactly n!/2 permutations in Sn are even.

Hint: consider σ↦(1 2)σ.

Solution. Let E and O be the sets of even and odd permutations; they are disjoint and E∪O=Sn, so |E|+|O|=n!. Let τ=(1 2), which exists since n≥2, and define L:Sn→Sn, L(σ)=τσ. By Theorem 7.3.1 and Corollary 7.3.2, sgnL(σ)=−sgnσ, so L maps E into O and O into E. Since ττ=id, L(L(σ))=σ, so L restricted to E is a bijection E→O with inverse L restricted to O (Theorem 0.4.7). Hence |E|=|O|=n!/2.

Exercise (C2: Sign from the Number of Cycles)

Suppose σ∈Sn is written as a product σ=γ1γ2⋯γc of disjoint cycles (no element appears in two of them) whose lengths k1,…,kc add up to n, where fixed points are included as cycles of length 1. (Such a product always exists: follow each element around its loop, as in Example (Computing with cycles).)

  • (a) Prove that sgnσ=(−1)n−c.
  • (b) Use (a) to find the sign of σ=(1 4 6)(2 5)∈S6, and compare with Example (A Sign Computed Two Ways).
  • (c) Deduce that an n-cycle in Sn and the identity in Sn have the same sign exactly when n is odd.

Solution.

  • (a) By Theorem 7.3.1 and Proposition 7.3.4, sgnσ=∏m=1csgnγm=∏m=1c(−1)km−1=(−1)(k1+⋯+kc)−c=(−1)n−c.

  • (b) Including the fixed point 3 as the cycle (3), σ=(1 4 6)(2 5)(3), with lengths 3+2+1=6 and c=3. So sgnσ=(−1)6−3=−1, as in Example (A Sign Computed Two Ways).

  • (c) An n-cycle has c=1 and sign (−1)n−1; the identity consists of n cycles of length 1, so c=n and its sign is (−1)0=1. These agree exactly when n−1 is even, that is, when n is odd.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.