Graphical Mahonian Statistics on Words

Foata and Zeilberger defined the graphical major index, $\mathrm{maj}'_U$, and the graphical inversion index, $\mathrm{inv}'_U$, for words. These statistics are a generalization of the classical permutation statistics $\mathrm{maj}$ and $\mathrm{inv}$ indexed by directed graphs $U$. They showed that $\mathrm{maj}'_U$ and $\mathrm{inv}'_U$ are equidistributed over all rearrangement classes if and only if $U$ is bipartitional. In this paper we strengthen their result by showing that if $\mathrm{maj}'_U$ and $\mathrm{inv}'_U$ are equidistributed on a single rearrangement class then $U$ is essentially bipartitional. Moreover, we define a graphical sorting index, $\mathrm{sor}'_U$, which generalizes the sorting index of a permutation. We then characterize the graphs $U$ for which $\mathrm{sor}'_U$ is equidistributed with $\mathrm{inv}'_U$ and $\mathrm{maj}'_U$ on a single rearrangement class.


Introduction
Let α = (α 1 , α 2 , . . . , α n ) be a sequence of nonnegative integers. We will denote by R(α) the set of permutations of the multiset {1 α 1 , 2 α 2 , . . . , n αn }, i.e., R(α) is the set of all words containing α i occurrences of the letter i for all i = 1, 2, . . . , n. For w = x 1 x 2 . . . x m ∈ R(α), the inversion number is defined as inv w = 1≤i<j≤m X (x i > x j ), and the major index is defined as The set of all positions i such that x i > x i+1 is known as the descent set of w, Des w, and its cardinality is denoted by des w. So, maj w = i∈Des w i. The generating function for permutations by number of inversions goes back to Rodriguez [19] and the generalization to multisets is due to MacMahon [14]. MacMahon also showed [13,15] that maj and inv are equidistributed on R(α). Namely, w∈R(α) q inv w = w∈R(α) q maj w = α 1 + α 2 + · · · + α n α 1 , α 2 , . . . , α n E-mail addresses: agrady@clemson.edu (A. Grady), spoznan@clemson.edu (S. Poznanović) 1 The second author is partially supported by the NSF grant DMS-1312817.
In honor of MacMahon, all permutation statistics that share the same distribution are called Mahonian. These two classical Mahonian statistics have been generalized in various ways. Some examples are Kadell's weighted inversion number [11], the r-major index introduced by Rawlings [18], the statistics introduced by Clarke [3], and the maj-inv statistics of Kasraoui [12]. The generalization that we will be considering in this paper is due to Foata and Zeilberger [7]. They defined graphical statistics (graphical inversions and graphical major index) parameterized by a general directed graph U and they described the graphs U for which these statistics are equidistributed on all rearrangement classes. A similar result was proved in [6], where the definition of graphical inversions and major index is modified to allow different behavior of the letters at the end of the word.
Here we do two different things. First, we strengthen Foata and Zeilberger's result by showing that the equidistribution of inv ′ U and maj ′ U on a single rearrangement class R(α) implies that U is essentially bipartitional (Theorem 2.1). Second, we define a graphical sorting index on words, a statistics which generalizes the sorting index for permutations [16]. We then describe the directed graphs U for which sor ′ U is equidistributed with inv ′ U and maj ′ U on a fixed class R(α) (Theorem 2.2). In the next section we define the terminology we need and state the main results. Then we prove Theorem 2.1 and Theorem 2.2 in Section 3 and Section 4, respectively.

Preliminaries and Main Results
A directed graph on X = {1, 2, . . . , n} is any subset U of the Cartesian product X × X. For each such directed graph U , we have the following statistics defined on each word w = x 1 x 2 . . . x m with letters from X: Since U is also a relation on X, for convenience, in some places we will use the notation x > U y to represent the edge (x, y) ∈ U . We will say x is related to y if (x, y) ∈ U or (y, x) ∈ U . An ordered bipartition of X is a sequence (B 1 , B 2 , . . . , B k ) of nonempty disjoint subsets of X such that B 1 ∪ B 2 ∪ · · · ∪ B k = X, together with a sequence (β 1 , β 2 , . . . , β k ) of elements equal to 0 or 1. If β i = 0 we say the subset B i is non-underlined, and if β i = 1 we say the subset B i is underlined.
A relation U on X × X is said to be bipartitional, if there exists an ordered bipartition ((B 1 , B 2 , . . . , B k ), (β 1 , β 2 , . . . , β k )) such that (x, y) ∈ U if and only if either x ∈ B i , y ∈ B j and i < j, or x and y belong to the same underlined block B i . Bipartitional relations were introduced in [7] as an answer to the question "When are inv ′ U and maj ′ U equidistributed over all rearrangement classes?". In particular, there the authors showed that if U is bipartitional with blocks ((B 1 , . . . , B k ), (β 1 , . . . , β k )) then Here and later we use the notation Han [9] showed that bipartitional relations U can also be characterized as relations U for which both U and its complement are transitive. Hetyei and Krattenthaler [10] showed that the poset of bipartitional relations ordered by inclusions has nice combinatorial properties. In this paper we will be considering the distribution of inv ′ U and maj ′ U over a fixed rearrangement class R(α). Notice that if the multiplicity α x of x ∈ X is 1, then the pair (x, x) cannot contribute to neither inv ′ U nor maj ′ U . Therefore, omitting or adding such pairs to U doesn't change these two statistics over R(α). For that purpose, we define U to be essentially bipartitional relative to α if there are disjoint sets I ⊆ X and J ⊆ X such that (1) α x = 1 for all x ∈ I ∪ J and Theorem 2.1. The statistics inv ′ U and maj ′ U are equidistributed over R(α) if and only if the relation U is essentially bipartitional relative to α.
In view of the comment preceding the theorem, the"if" part of Theorem 2.1 follows from Theorem 1.1. We prove the "only if" in Section 3.
The sorting index has been extended to labeled forests by the authors [8]. It can also be naturally extended to words w ∈ R(α) by a generalization of Straight Selection Sort which reorders the letters into a weakly increasing sequence. At each step transpositions are applied to place all the n's at the end, then all the n − 1's to the left of them, etc, so that for each x ∈ X, the α x copies of x stay in the same relative order they were right before they were "processed". Then we define sor w to be the sum of the number of positions each element moved during the sorting. For example, applying this sorting algorithm to w = 143123123 yields and thus sor w = 7 + 2 + 3 + 4 + 2 = 18. We define a graphical sorting index that depends on U using the same sorting algorithm but at each step, when sorting x, we only count how many elements y such that (x, y) ∈ U it "jumps over". More formally, to compute sor ′ U w for w = x 1 x 2 . . . x m : • Begin with i = m, and sor ′ U w = 0.
• Consider the largest element in w with respect to integer order. If there is a tie, pick the element with the largest subscript, and call this element x j .
• Interchange x j with x i .
Theorem 2.2. The statistics sor ′ U , inv ′ U and maj ′ U are equidistributed on a fixed rearrangement class R(α) if and only if the relation U has the following properties.
1. U is bipartitional with no underlined blocks, 2. If (x, y) ∈ U then x > y, 3. All but the last block of U are of size at most 2, We give the proof of Theorem 2.2 in Section 4. We mention also that recently the question "When are sor and inv equidistributed on order ideals of the Bruhat order?" was recently addressed in [4].

The Proof of Theorem 2.1
We begin the proof with a simple observation.
Proof. This follows from the fact that for every w ∈ R(α), Lemma 3.2. For any α = (α 1 , . . . , α n ) and any relation U on X = {1, 2, . . . , n}, Proof. We will use induction on |α|. It's clear that the statement holds when |α| = 1. Assume that it holds for all α with |α| ≤ m. Consider a rearrangement class R(α) such that |α| = m + 1 and a relation U on [n]. Let (α, U ) be a directed graph with vertex set {1 α 1 , . . . , n αn } and a directed edge x → y whenever (x, y) ∈ U . Let x 1 → x 2 → · · · → x n be a directed path in (α, U ) of maximal possible length. This means we have a descending chain Let u ′ be a word that maximizes maj ′ U on the rearrangement class R(α ′ ). One can easily verify that for the word u = u ′ x 1 x 2 · · · x l in R(α) we have To bound max w∈R(α) inv ′ U w, first suppose there is an element y ∈ (α ′ , U ) is such that for all i = 1, 2, . . . , l we have (y, However, this implies that there are elements x i and x i+1 such that (x i , y), (y, x i+1 ) ∈ U , which yields a longer chain Now consider a word v ∈ R(α) and the corresponding word v ′ ∈ R(α ′ ) obtained by deleting x 1 , . . . , x l . By the argument in the previous paragraph, the m + 1 − l letters in v ′ create at most (m + 1 − l)(l − 1) graphical inversions with x 1 , . . . , x l . Therefore, by (3.1) and the induction hypothesis, The proof of Lemma 3.2 also shows that a word w = w k w k−1 · · · w 1 with the property maj ′ U v can be constructed by "peeling off" descending chains of maximal length from (α, U ) and ordering them from right to left, forming the subwords w 1 , w 2 , . . . , w k in that order. These kind of words will be used in the proof and for a fixed relation U , we will call such words maximal chain words in R(α).
Proof. Condition (i) is necessary for equality to hold in (3.2). The property (ii) also follows from the fact that equality holds in (3.2) and the definition of a maximal chain word which implies that the chain w j is be the longest one that can be formed among the letters in w k w k−1 · · · w j .
The following lemma shows that if maj ′ U and inv ′ U are equidistributed on R(α) the elements in the maximal chains can be reordered, if necessary, so that within each of them the following property holds: if x precedes y in the same chain of a maximal chain word then (x, y) ∈ U .
, then there exists a maximal chain word w = w k w k−1 · · · w 1 ∈ R(α) with subwords w i formed from descending chains such that for Proof. Since the equality in (3.2) holds, the elements x 1 , x 2 , . . . , x l in the maximal chain can be arranged so that they form l 2 graphical inversions, which implies the statement in the lemma. Lemma 3.5. Suppose maj ′ U and inv ′ U are equidistributed on R(α). Let w = w k w k−1 · · · w 1 be a maximal chain word in R(α) for U with maximal chains w 1 , . . . , w k . If (x, y) ∈ U and (y, x) ∈ U for some x = y, then the x's and y's are all in the same chain w i .
Proof. Without loss of generality, suppose there is an x that appears in a chain w j 1 and a y that appears in the chain w j 2 , j 1 > j 2 . Consider the chain w is a longer chain than w j 2 . This contradicts the definition of a maximal chain word.
Lemma 3.6. Suppose there exists an element x ∈ X with α x ≥ 1 such that U ⊂ (X \{x})×(X \{x}) and U = ∅. Then inv ′ U and maj ′ U are not equidistributed over R(α). Proof. Set . Since x does not create any graphical inversions, by Lemma 3.2, we have Consequently, if inv ′ U and maj ′ U are equidistributed on R(α), then des ′ U w ′ = 0 and thus max This contradicts the fact that U = ∅. Lemma 3.7. Suppose maj ′ U and inv ′ U are equidistributed on R(α). If (x, y), (y, x) ∈ U and α x > 1 then (x, x) ∈ U .
Proof. Since (x, y), (y, x) ∈ U , by Lemma 3.5, all the x's and y's must be in the same maximal chain of a maximal chain word. In particular, since two x's are in the same chain, part (i) of Lemma 3.3 implies that (x, x) ∈ U . Proof. If z = x then α x > 1 and the claim follows from Lemma 3.7. The same is true if z = y. So, suppose z = x, z = y. Because of symmetry, it suffices to prove To see (3.8), suppose that (z, x) ∈ U, (z, y) / ∈ U . We consider two cases. Case 1: (y, z) / ∈ U . Let w = w t w t−1 · · · w 1 ∈ R(α) be a maximal chain word that satisfies (3.7). By Lemma 3.5, x and y are in the same chain w i of w. By Lemma 3.3, z is in a different chain w j and by Lemma 3.5, (x, z) / ∈ U . If j > i, notice that, by Lemma 3.3, x cannot precede y in w i , so w i must be of the form w i = b 1 · · · b k yb k+1 · · · b l xb l+1 · · · b m . Then b 1 · · · b k zb k+1 · · · b l xyb l+1 · · · b m is a descending chain longer than w i . If j < i, then w j = b 1 · · · b k zb k+1 · · · b l . By part (ii) of Lemma 3.3, (b k , x), (y, b k+1 ) ∈ U , which implies that b 1 · · · b k xyb k+1 · · · b l is a descending chain longer than w j .
Case 2: (y, z) ∈ U . By Lemma 3.1, maj ′ U c and inv ′ U c are equidistributed on R(α). Let w = w t w t−1 · · · w 1 ∈ R(α) be a maximal chain word for U c that satisfies (3.7). Suppose x, y, z are in the chains w i , w j , w k , respectively. By Lemma 3.3, i = j, i = k. If i < j, k and w i = b 1 · · · b l xb l+1 · · · b m then a different maximal chain word w ′ could be constructed by taking the same chains w 1 , . . . , w i−1 as in w and replacing w i by b 1 · · · b l yb l+1 · · · b m . Since (z, y) ∈ U c , it follows from Lemma 3.3 that z is not in relation U c with some b r , r ≤ l and therefore (z, x) ∈ U c , which contradicts (z, x) ∈ U . The similar argument holds if j < i, k. If k < i, j and w k = b 1 · · · b l zb l+1 · · · b m then y is not in relation U c with some b r , r > l, and a different maximal chain word for U c could be formed by replacing w k with b 1 · · · b l zb l+1 · · · b r−1 yb r+1 · · · b m . Part (ii) of Lemma 3.3 now implies that (z, x) ∈ U c , which contradicts (z, x) ∈ U . Finally, if j = k < i, then since (z, x) / ∈ U c and (x, y), (y, x) / ∈ U c , Lemma 3.3 implies that (x, z) ∈ U c and y precedes z in w j . Therefore, (y, z) ∈ U c , which contradicts (y, z) / ∈ U . The implication (3.9) can be proved by considering completely analogous cases, so we omit it here.
For a relation U on X, call S(U ) = {(x, y) ∈ X × X : (x, y), (y, x) ∈ U }, the symmetric part of U , and call A(U ) = U \ S(U ) the asymmetric part of U . Let X U = {x ∈ X : (x, y) ∈ S(U ) for some y ∈ X}. Lemma 3.9. If maj ′ U and inv ′ U are equidistributed over a rearrangement class R(α), then S(U ) ∪ {(x, x) : x ∈ X U , α x = 1} is an equivalence relation on X U × X U .
Proof. Let x ∈ X U and y ∈ X such that (x, y) ∈ U . If y = x then we have (x, x) ∈ U . If y = x then we have (x, y), (y, x) ∈ U and thus, if α x > 1 by Lemma 3.7 we have (x, x) ∈ U . S(U ) is symmetric by definition because (x, y) ∈ S(U ) implies (y, x) ∈ S(U ). Now consider x, y, z ∈ X U and assume (x, y), (y, z) ∈ S(U ). Then by definition of S(U ), (y, x), (z, y) ∈ S(U ) and Lemma 3.8 implies (x, z) ∈ S(U ).
Consequently, X U can be partitioned into blocks B 1 , . . . , B l such that Lemma 3.10. Suppose that maj ′ U and inv ′ U are equidistributed over a rearrangement class R(α). Then either there is a block B of X U such that for all x ∈ B and all y ∈ X \ B we have (x, y) / ∈ U, or there is an element x ∈ X \ X U such that for all y ∈ X\{x} we have (x, y) / ∈ U.
Proof. Suppose that the lemma does not hold. In other words, assume that maj ′ U and inv ′ U are equidistributed over a rearrangement class R(α), but for all blocks B i of X U there exists a x ∈ B i and y ∈ X \ B i such that (x, y) ∈ U , and for all x ∈ X \ X U there exists a y ∈ X \ {x} such that (x, y) ∈ U .
Note that if we began with x 0 / ∈ X U our assumptions would still give an element x 2 ∈ X \ {x} such that (x 0 , x 2 ) ∈ U , and (x 2 , x 0 ) / ∈ U because x 0 / ∈ X U . Now there are two cases to consider.
Case 1: Then there exists a x 3 ∈ B i 1 and x 4 / ∈ B i 1 such that (x 4 , x 3 ) ∈ U and, by Lemma 3.8, (x 2 , x 4 ) ∈ U and (x 4 , x 2 ) / ∈ U . Case 2: x 2 / ∈ X U , and then there exists a x 4 ∈ X \{x 2 } such that (x 2 , x 4 ) ∈ U and (x 4 , x 2 ) / ∈ U . Continuing this process we can build a sequence x 0 , x 2 , x 4 , x 6 , . . . with the properties The set X is finite and thus this sequence can not be infinite with distinct terms. Therefore, with relabeling there is a finite sequence y 1 , y 2 , y 3 , . . . , y l+1 such that If l = 2 then we have y 1 < U y 2 < U y 1 and y 1 < U y 2 < U y 1 which is a contradiction and hence l ≥ 3.
Let w ∈ R(α) be a maximal chain word for U . If all y 1 , . . . , y l appear in the same chain w i , then by Lemma 3.4, they can be relabeled to give a sequence z 1 , . . . , z l such that (z r , z s ) ∈ U for all 1 ≤ r < s ≤ l. If z l = y i , then this means that y i+1 > U y i , which is a contradiction. If not all all y 1 , . . . , y l appear in the same chain let y j be the one that appears in the rightmost chain of w. Then either y j+1 is already in the same chain or its not related to an element to the right of y j . In the latter case, another maximal chain word can be constructed in which y j and y j+1 are in the same chain, while the other y i 's are either in the same chain or in chains to the left. Continuing this argument, we see that we can construct a maximal chain word in which all y 1 , . . . , y l are in the same chain, which as we saw before is impossible.
Lemma 3.11. Suppose that maj ′ U and inv ′ U are equidistributed over a rearrangement class R(α). If C is nonempty then for all y ∈ X \ C and for all x ∈ C we have (y, x) ∈ U.
If C is empty and B is the block defined in Lemma 3.10 then for all y ∈ X \ B and for all x ∈ B we have (y, x) ∈ U.
Proof. Suppose C is nonempty, and that the claim does not hold. In other words assume that there exists a y ∈ X \ C and x ∈ C such that (y, x) / ∈ U . Now y / ∈ C so there exists a z ∈ X such that (y, z) ∈ U . Notice that we may have y = z if y ∈ X U , but then α y > 1, and z = x by assumption. Now we have (y, z) ∈ U , (y, x) / ∈ U , and (x, y), (x, z) / ∈ U since x ∈ C. Since (x, y), (y, x) / ∈ U , and (x, z) / ∈ U , Lemma 3.8 applied to U c yields (y, z) / ∈ U , which is a contradiction. Now suppose C is empty, B is the block defined in Lemma 3.10, and the claim does not hold. In other words, there exists a y ∈ X \ B and x ∈ B such that (y, x) / ∈ U . Since y / ∈ B, and C is nonempty there must be an element z such that (y, z) ∈ U . Now we have (y, z) ∈ U , (y, x) / ∈ U , and (x, y), (x, z) / ∈ U since x ∈ B. Therefore, the same argument as above gives a contradiction.
Proof of Theorem 2.1 . Theorem 2.1 can be proved using induction on the size of the set X.
Suppose first that C = ∅. Then, by Lemma 3.11, C × X = ∅ and (X \ C) × C ⊂ U . Consider inv ′ U and maj ′ U over the rearrangement class R(α ′ ) of the permutations of the multiset {x αx : x ∈ X \C}. Inserting the elements from C in all possible ways among the letters of a word w ′ ∈ R(α ′ ) results in a set of words S(w ′ ) ⊂ R(α). It is not hard to see that as w ranges over S(w ′ ), the difference inv ′ U w − inv ′ U w ′ ranges over the multiset {i 1 + i 2 + · · · + i r : 0 ≤ i 1 ≤ i 2 ≤ · · · ≤ i l ≤ s} where r = |α(C)| and s = |α(X \ C)|. The same is true for the difference maj ′ U w − maj ′ U w ′ . This is less obvious but follows from a similar property of the classical major index for words (see e.g. [2, Lemma 4.6] for a proof). Let Thus if inv ′ U and sor ′ U are equidistributed on R(α) then inv ′ U 1 and maj ′ U 1 are equidistributed on R(α ′ ). By the induction hypothesis, U 1 is essentially bipartitional relative to α ′ and thus U is essentially bipartitional relative to α with one more non-underlined block C.
In the case when C = ∅ there is a block B such that B × (X \ B) is empty and X × B ⊂ U . Then we consider the relation U 1 = U ∩ ((X \ B) × (X \ B)) on X \ B. Similar reasoning as above yields So, U 1 is essentially bipartitional relative to α ′ and thus U is essentially bipartitional relative to α with one more underlined block B.

Graphical Sorting Index
In this section we will prove Theorem 2.2. The "if" part follows from the following proposition and (2.1), while the "only if" part follows from Lemma 4.3 and Lemma 4.5.
Proof. We will prove the statement using a B-code for the words in R(α) that we define. Let w = x 1 x 2 . . . x l ∈ R(α). B-code w is a pair of two sequences: a sequence of partitions and a sequence of nonnegative integers. Precisely, we define B-code w to be B-code w is computed as follows.
(2) If B j = {y 1 , y 2 } has two integers y 2 > y 1 then let p j = i be the position of y 2 in the subword of w formed by the elements of B j . Otherwise set p j = 0.
(3) Sort the elements of the block B j and form the partition b j,1 ≥ . . . ≥ b j,m j ≥ 0 from the contributions to sor w (listed in nonincreasing order) by the elements of B j . Keep calling the partially sorted word w.
Since the parts of the partitions in the B-code represent contributions to the sorting index, the bound for their size b i,j ≤ m i+1 + m i+2 + · · · + m k easily follows. Therefore, the B-code is clearly a map from R(α) to the set of pairs of sequences of partitions and integers which satisfy (1 • ) and (2 • ), which we claim is a bijection. For describing the inverse, the crucial observation is that for blocks of size 2, B j = {y 1 < y 2 }, the contribution to the sorting index is given by b j,p j . Then given which satisfies (1 • ) and (2 • ), the corresponding word w ∈ R(α) is constructed as follows.
(1) Let j = k and w be the empty word.
(2) Add to the end of w the elements of B j with their multiplicities, listed in nondecreasing order x j,1 x j,2 · · · x j,m j .
(3) If |B j | = 1, then for i = 1, . . . , m j , swap x j,i with the element of w which is b j,i places to the left of x j,i .
j,m j −1 be the partition obtained from b j,1 ≥ . . . ≥ b j,m j by deleting the part b j,p j . Then for i = 1, . . . , m j − 1, swap x j,i with the element of w which is b ′ j,i places to the left of x j,i . Finally, swap x j,m j = y 2 with the element in w which is b j,p j + m j − p j positions to its left. (After this step there are b j,p j elements from B j+1 , . . . , B k and m j − p j elements from B j to the right of y 2 .) (5) If j > 1 decrease j by 1 and go to step (2). Otherwise stop.
The B-code is designed so that sor ′ U w = k i=1 m i j=1 b i,j . The bijection described above then yields the generating function for sor ′ U . Let p(j, k, n) denote the number of partitions of n into at most k parts, with largest part at most j. It is known that n≥0 p(j, k, n)q n = j+k j . The block B j contributes m j α(B j ) n≥0 p(m j+1 + m j+2 · · · + m n , m j , n)q n = m j α(B j ) m j + m j+1 · · · + m n m j to w∈R(α) q sor ′ U w , where the leading binomial coefficient counts the number of possible values of p j . Thus we have .
In particular, we get the generating function for the standard sorting index for words. Finally, we prove the "only if" part of Theorem 2.2 via the following few lemmas.
Lemma 4.3. If sor ′ U , maj ′ U , and inv ′ U are equidistributed over a fixed rearrangement class R(α) then the relation U must be a subset of the integer order modulo relations (x, x).
Proof. Suppose sor ′ U , maj ′ U , and inv ′ U are equidistributed on R(α). By Theorem 2.1, U must be essentially bipartitional relative to α. That means that there are subsets I, J ⊂ {x : x ∈ J} is bipartitional. Without loss of generality we may assume that I, J are chosen so that U ′ does not have underlined blocks {x} of size 1 such that α x = 1. We claim that U ′ is a subset of the natural order.
First we will show that there are no underlined blocks in U ′ . Suppose the contrary. Then there exist elements x and y such that (x, y), (y, x) ∈ U ′ (x = y or y is a second copy of the same element with α x > 1). Because we have both (x, y) and (y, x) in U ′ every word w ∈ R(α) has at least one U ′ -inversion. Therefore the minimum inv ′ U over the rearrangement class R(α) is 1. On the other hand, sor ′ U 11 · · · 122 · · · 2 · · · nn · · · n = 0. This is a contradiction, and thus there are no underlined blocks in U ′ . Now assume that U ′ is not a subset of the natural integer order. Then there exist at least two elements such that (x, y) ∈ U ′ , but y > x with respect to the natural order. Let B 1 , B 2 , . . . , B k be the blocks of U ′ . Now consider the words created by placing the elements of B 1 in some order followed by the elements of B 2 placed to the right of B 1 and continue the process until the elements of B k in some order are the last elements of the word. The words of this type will have inv ′ U equal to the number of edges in the graph (α, U ′ ) as defined in the proof of Lemma 3.2. Therefore, the maximum inv ′ U is bounded below by the number of edges in (α, U ′ ) (it is in fact equal to the number of edges in (α, U ′ )). In the sorting algorithm, however, elements are only sorted over elements that are smaller than them with respect to the natural order. Therefore x will never jump over y, and thus the relation (x, y) will never contribute to the sorting index. Since each edge of the graph (α, U ′ ) contributes at most 1 to sor ′ U , we conclude that the maximum sor ′ U on R(α) is less than the maximum inv ′ U . This is a contradiction, and U ′ must be a subset of the natural order.
This completes the proof of Theorem 2.2.