On the rix statistic and valley-hopping

This paper studies the relationship between the modiﬁed Foata–Strehl action (a.k.a. valley-hopping)—a group action on permutations used to demonstrate the γ -positivity of the Eulerian polynomials—and the number of rixed points rix —a recursively-deﬁned permutation statistic introduced by Lin in the context of an equidistribution problem. We give a linear-time iterative algorithm for computing the set of rixed points, and prove that the rix statistic is homomesic under valley-hopping. We also demonstrate that a bijection Φ introduced by Lin and Zeng in the study of the rix statistic sends orbits of the valley-hopping action to orbits of a cyclic version of valley-hopping, which implies that the number of ﬁxed points ﬁx is homomesic under cyclic valley-hopping.

The descent number des and excedance number exc are classical permutation statistics which are well known to be equidistributed over S n ; in other words, for any fixed n and k, the number of permutations in S n with des(π) = k is equal to the number of permutations in S n with exc(π) = k.The distributions of both statistics are encoded by the Eulerian polynomials A n (t) := π∈Sn t des(π) = π∈Sn t exc (π) .
The Eulerian polynomials are γ-positive: there exist non-negative coefficients γ k for which

Nadia Lafrenière and Yan Zhuang
The γ-positivity of A n (t) implies that the coefficients of A n (t) are unimodal and symmetric.One method of proving the γ-positivity of A n (t) which yields a combinatorial interpretation of the coefficients γ k is via a group action on permutations which we will refer to as valley-hopping (but which is also called the modified Foata-Strehl action in the literature).One can show that the distribution of des over each orbit of the valley-hopping action is of the form t k (1 + t) n−1−2k , and summing over all orbits completes the proof.Valley-hopping and its variants have been used to provide combinatorial proofs for related γ-positivity results, some of which are described in the survey article [1] on γ-positivity in combinatorics and geometry.
This paper concerns the relationship between valley-hopping and a permutation statistic denoted rix.The rix statistic is defined recursively in the following way: let rix(∅) = 0, and if w = w 1 w 2 • • • w k is a word with distinct positive integer letters and largest letter w i , then let (1.1) Equivalently, rix(π) is the number of "rixed points" of π as defined by Lin and Zeng [8].
The rix statistic was introduced by Lin [7] in the context of an equidistribution problem which we will now describe.Consider the basic Eulerian polynomials A n (t, q, r) := π∈Sn t exc(π) r fix(π) q maj(π)−exc (π)   where fix(π) is the number of fixed points of π and maj(π) := πi>πi+1 i is the major index of π (the sum of its descents).Since des and exc are equidistributed over S n , one may ask if there are statistics st 1 and st 2 for which (exc, fix, maj − exc) and (des, st 1 , st 2 ) are equidistributed over S n .Lin showed that we can take st 1 = rix and st 2 = ai, where the latter is the number of "admissible inversions" of π.In other words, A n (t, q, r) = π∈Sn t des(π) r rix(π) q ai(π) is an alternative interpretation for the basic Eulerian polynomials.
Prior to Lin's introduction of the rix statistic, Shareshian and Wachs [12] had remarked that the polynomials A n (t, 0, r) and A n (t, 1, r) satisfy a refined version of γ-positivity.Later, Lin and Zeng [8] used valley-hopping and Lin's interpretation of the basic Eulerian polynomials to give combinatorial interpretations for the γ-coefficients of A n (t, 0, r) and A n (t, 1, r).Along the way, they defined a bijection Φ : S n → S n satisfying des(π) = exc(Φ(π)) and Rix(π) = Fix(Φ(π)) where Rix is the set of rixed points and Fix the set of fixed points.The existence of this bijection Φ demonstrates that not only are (exc, fix) and (des, rix) jointly equidistributed over S n , but (exc, Fix) and (des, Rix) are as well. (i)  Dynamical algebraic combinatorics-which, broadly speaking, investigates phenomena associated with actions on combinatorial structures-is an emerging area of research within algebraic combinatorics.An example of such phenomena is homomesy, where a statistic on a set of combinatorial objects has the same average value over each orbit of an action; see [9] for a survey of this topic.Motivated by [4], which was (i) The same is not true for (exc, Fix, maj − exc) and (des, Rix, ai).
On the rix statistic and valley-hopping 3 a systematic investigation of the homomesy phenomenon on permutations, the present work originated as an attempt to identify permutation statistics which are homomesic under valley-hopping, which was not considered in [4].Following the approach of [4], we automatically searched for permutation statistics from the online FindStat database [10] that exhibited homomesic behavior under valley-hopping for 2 ≤ n ≤ 6.Our positive matches included the descent number and some related statistics (such as the number of ascents), but aside from these, the only statistic that appeared to be homomesic under valley-hopping is the rix statistic. (ii)  A simple examination of the orbit structure of the valley-hopping action shows that des is homomesic under valley-hopping, (iii) which in turn implies that the related statistics are homomesic by way of symmetry arguments.On the other hand, proving that rix is homomesic under valley-hopping required further investigation, and it soon became evident to us that there is more to the relationship between the rix statistic and valley-hopping than meets the eye.Our subsequent explorations on this topic led to the full results presented here.
The organization of our paper is as follows.Section 2 introduces the definitions of several permutation statistics that are relevant to this work, as well as Lin and Zeng's "rix-factorization" of a permutation (which is needed to define the Rix statistic).Section 3 is devoted to a linear-time iterative algorithm for computing the set of rixed points and the rix-factorization.After we present and demonstrate the validity of our algorithm, we will use this algorithm to help prove several results, including a recursive definition for Rix that lifts the definition of rix given in (1.1), another characterization for rixed points, and a few additional lemmas about rixed points and the rix-factorization which we will use later on in this paper.
Section 4 is again expository, and provides the definition of valley-hopping and introduces a cyclic version of valley-hopping.Cyclic valley-hopping was originally defined on derangements by Sun and Wang [14], and was extended to all permutations by Cooper, Jones, and the second author [3].While the version of cyclic valley-hopping due to Cooper-Jones-Zhuang fixes all fixed points, our version of cyclic valley-hopping does not fix fixed points.We also define "restricted" versions of valley-hopping and cyclic valley-hopping.Restricted valley-hopping was first introduced by Lin and Zeng [8], whereas restricted cyclic valley-hopping is precisely the version of cyclic valley-hopping due to Cooper-Jones-Zhuang mentioned above.
Sections 5-6 focus on our main results concerning the relationship between valley-hopping and the rix statistic.In Section 5, we prove that rix is homomesic under valley-hopping.Finally, in Section 6, we show that the bijection Φ of Lin and Zeng sends valley-hopping orbits to cyclic valley-hopping orbits (and sends restricted valley-hopping orbits to restricted cyclic valley-hopping orbits).As a consequence, fix (the number of fixed points) is homomesic under cyclic valley-hopping.

Permutation statistics
The purpose of this preliminary section is to introduce several permutation statistics that will be relevant to our work.Fix a permutation π = π 1 π 2 • • • π n in S n .We have already defined descents; an ascent of π is a letter π i (where i ∈ [n]) for which π i < π i+1 , with the convention π n+1 = ∞-i.e., an ascent is a letter that is not a descent.For example, take π = 135987426.Then the ascents of π are 1, 3, 5, 2, (ii) As of June 28, 2023, there were 387 other permutation statistics with code in the FindStat database, but we found counterexamples for all of them. (iii) In fact, the homomesy of des under valley-hopping is implicit in the valley-hopping proof for the γ-positivity of the Eulerian polynomials.
and 6, whereas its descents are π are 9, 8, 7, and 4. Notice that, under our definition, the last letter of a permutation is always an ascent.Let us adopt the convention π 0 = π n+1 = ∞ for the definitions below.Given i ∈ [n], we call π i : Continuing the example above, the only peak of π = 135987426 is 9; its valleys are 1 and 2; its double ascents are 3, 5, and 6; and its double descents are 8, 7, and 4. In particular, observe that every letter of a permutation is either a peak, valley, double ascent, or double descent.We note that the terms ascent, descent, peak, valley, double ascent, and double descent more commonly refer to a position i as opposed to a letter π i , and most authors do not take π 0 = π n+1 = ∞ when defining these terms.It will be more convenient for us to adopt these conventions.
Next, recall that the rix statistic was defined by Lin using the recursive formula (1.1), and that Lin and Zeng later defined the set-valued statistic Rix for which rix gives the cardinality.The definition of Rix relies on Lin and Zeng's "rix-factorization", which is given below.Definition 1.Each permutation π ∈ S n can be uniquely written in the form where the factors α 1 , . . ., α k , β (henceforth called rix-factors) are obtained by applying the following algorithm: (1) Initialize w := π and i := 0.
(2) If w is an increasing word, let β := w and terminate the algorithm.Otherwise, increase i by 1, let x be the largest descent of w, and write w = w ′ xw ′′ (so that w ′ consists of all the letters of w to the left of x, and w ′′ all the letters to the right of x).
The expression (2.1) is called the rix-factorization of π.
When writing out the rix-factorization of a permutation, we will often use vertical bars to demarcate the rix-factors.It will also be convenient for us to let β 1 (π) denote the first letter of β in the rix-factorization of a permutation π.Definition 2. A rixed point of π is a letter in the maximal increasing suffix of π which is not smaller than β 1 (π), and the set of rixed points of π is denoted Rix(π).
Example 3. Let us walk through the algorithm in Definition 1 for the permutation π = 142785369: (1) Set w = 142785369 and i = 0.
The above example showcased a permutation for which the algorithm terminates in step (3).Below is an example in which termination occurs in step (2).(1) Set w = 23816457 and i = 0.
While the algorithm in Definition 1 is recursive, our algorithm in the next section is iterative.

An iterative algorithm for rixed points and the rix-factorization
In this section, we give an iterative algorithm for computing the rixed points of a permutation along with its rix-factorization.This is achieved through the use of pointers on the permutation, restricting it to a valid factor.At first the valid factor is taken to be the entire permutation, but we gradually restrict the valid factor as the algorithm progresses.To make this algorithm iterative, we consider all the entries of the permutation in decreasing order.For each entry x, we first check if it appears in the valid factor, and if it does, we use the local shape of the permutation around x to move a boundary of the valid factor inward.When we move the left boundary, then a new term is added to the rix-factorization; when we move the right boundary, x is added as a rixed point.
After describing the algorithm explicitly, we will prove that the output of our algorithm indeed gives the rix-factorization and the rixed points as defined by Lin and Zeng, and then we use our algorithm to prove several more results concerning rixed points and the rix-factorization.
Nadia Lafrenière and Yan Zhuang 3.1.Explicit description of the algorithm Algorithm 5. Let π ∈ S n and σ = π −1 .Throughout this algorithm, let π l • • • π r denote the valid factor.We begin with l = 1 and r = n, so that the entire permutation π is the valid factor.We let x iterate through each of the letters n, n − 1, n − 2, . . ., 1-in that order-until the stopping condition described below occurs.Let i be the position of x in π, so that π i = x or, equivalently, σ x = i.If x belongs to the valid factor (i.e., if l ≤ i ≤ r): (a) If x is a peak of π, then the valid factor becomes π i+1 • • • π r , and Otherwise, x is either the first or the last letter of the valid factor (because letters are examined in decreasing order).
(b) If x is the first letter of the valid factor, then we add and x is added as a rixed point if x is an ascent of π.The algorithm terminates.
(c) If x is the last letter (but not the first) of the valid factor, then the valid factor becomes π l • • • π i−1 , and x is added as a rixed point.
Once the algorithm stops (when x is the first letter of the valid factor), we return the set of rixed points and the rix-factorization.
Pseudocode for Algorithm 5 is given below.Remark 6. Algorithm 5 is executed in a time that is linear with respect to n.The number of operations is at least linear, since finding the inverse of a permutation requires reading it all and is thus executed in linear time.All other operations (comparisons, attributions, additions to list) are done in constant time, and there is a single for-loop (that we go through at most n times), meaning that the algorithm requires a number of operations that is at most linear with respect to n.
Let us illustrate this algorithm with two examples; compare with Examples 3-4.
Example 7 (Example 3 continued).Let us walk through Algorithm 5 for π = 142785369, highlighting the evolution of the valid factor: (x = 9) 142785369 → 14278536, because x = 9 is at the end of the valid factor.The rix-factorization contains no terms yet, and 9 is added as a rixed point.
(x = 8) 14278536 → 536, because x = 8 is a peak.We add 14278 to the rix-factorization, and the set of rixed points is unchanged.
(x = 7) 536 → 536, because x = 7 is outside the valid factor.The rix-factorization and the set of rixed points are unchanged.
(x = 6) 536 → 53, because x = 6 is at the end of the valid factor.The rix-factorization is unchanged, and 6 is added as a rixed point.
(x = 5) The algorithm terminates because x = 5 is the first letter of the valid factor 53.We add 5369 to the rix-factorization, but 5 is not added as a rixed point because it is not an ascent.

Algorithm 5 Compute rixed points and rix-factorization
Ensure: π is a permutation else if i = l then ⊲ x is the first letter of valid factor 15:

Proof that Algorithm 5 gives the rix-factorization
We first show that Algorithm 5 indeed gives what Lin and Zeng defined to be the rix-factorization (as in Definition 1).To do so, we need a lemma regarding what is to the right of the valid factor.

Lemma 9. At any stage during the execution of Algorithm 5, if the valid factor is
Proof: We proceed by induction.Our base case is at the start of the algorithm, at which point there is nothing to the right of the valid factor.Since the last letter of a permutation is defined to be an ascent by convention, the result holds.Now, assume that the statement is true when the valid factor is π l • • • π r .We need to show that iterating Algorithm 5 by one step preserves the accuracy of the statement.For this, we show that whenever the right boundary of the valid factor moves, it moves only by one position and the new right boundary is an ascent of π.By Algorithm 5, the right boundary changes only when π r is the largest letter of the valid factor π l • • • π r and l = r, at which point the valid factor becomes π l • • • π r−1 .Hence, π r−1 < π r , so π r−1 is an ascent of π.We also know from the induction hypothesis that π r , π r+1 , . . ., π n are ascents.Thus, everything weakly to the right of the right boundary π r−1 is an ascent, or equivalently, Proposition 10.Algorithm 5 produces the rix-factorization as given in Definition 1.
Proof: To prove the proposition, we simultaneously apply to a permutation π the procedures in Definition 1 and in Algorithm 5, showing that the terms added to the rix-factorization are the same at each step.
Algorithm 5 considers a factor of π (seen as a word), called the valid factor.Let w be as in Definition 1 and let v be the valid factor of π plus what is to its right.At first, we have w = v = π.We show, by induction, that v = w at each step of the joint execution of the procedure in Definition 1 and that of Algorithm 5.The base case is v = w = π, and no term is in the rix-factorization at this stage.For the induction hypothesis, we assume v = w, and we apply the recursive procedure in Definition 1 and the iterative procedure in Algorithm 5. Consider the following two cases: (1) Suppose that w has a descent; then it is not an increasing word.Let y be the largest descent of w.We have v = w by the induction hypothesis, so y is also the largest descent of v. Also, let x be the largest letter of the valid factor.There are two options for x: either it is an ascent or it is a descent.If x is a descent, then it must be the largest descent in v, and since what is to the right of the valid factor consists only of ascents (by Lemma 9), we have y = x.If x is an ascent and is the largest letter of the valid factor, then it must be the rightmost letter of the valid factor (otherwise, the letter to its right is a larger letter in the valid factor).Hence, in Algorithm 5, the right boundary of the valid factor moves one position to the left, and v is untouched.We repeat the process until the largest letter is a descent, making x = y.
Let us write w = w ′ yw ′′ .Following the procedure in Definition 1, if w ′ is empty, the algorithm stops and β = w is added to the rix-factorization as the last rix-factor.Otherwise, if w ′ is not empty, then we add w ′ y to the rix-factorization and repeat the process with w ′′ in place of w.Also, let us write v as v ′ xv ′′ .Following Algorithm 5, if v ′ is empty then x is the first letter of the valid factor, so β = v is added to the rix-factorization and the algorithm stops.If v ′ is not empty, then x is a peak, so we add v ′ x to the rix-factorization and repeat the process with v ′′ in place of v. Since x = y and v = w, we have v ′ = w ′ and v ′′ = w ′′ ; thus the same terms have been added to the rix-factorization, concluding the induction step in this case.
(2) If w has no descent, then neither does v, so they are both increasing words.In that case, Definition 1 sets β = w and terminates the process.As for v, since it is increasing, its largest letter is successively the largest letter of the valid factor.Thus, during the execution of Algorithm 5, the right boundary of the valid factor moves one step to the left at a time, which does not impact v.
Hence, the process in Algorithm 5 is repeated until the valid factor has a single letter, in which case the algorithm stops and we add β = v to the rix-factorization.
By these two cases, we have shown inductively that the terms of the rix-factorization obtained using Definition 1 and Algorithm 5 are the same, thus completing the proof.

Proof that Algorithm 5 gives the rixed points
Recall from Definition 2 that the set of rixed points of a permutation π is defined as a letter in the maximal increasing suffix of π that is no smaller than β 1 (π), the first letter of the rix-factor β of π.We show here that the set of rixed points obtained from Algorithm 5 is indeed the same set.
Proposition 11.Algorithm 5 produces the set of rixed points as given in Definition 2.
Proof: We let A be the set of letters in the maximal increasing suffix of π that are no smaller than the first letter of β 1 (π) (so A is the set of rixed points as obtained from Definition 2).Also, let B contain the successive right boundaries of the valid factor of π, as well as the left boundary of the valid factor when Algorithm 5 terminates if it is an ascent (so B is the set of rixed points as obtained from Algorithm 5).We show that A = B. Let y ∈ A. Then y is larger than or equal to β 1 (π), which is the stopping point of Algorithm 5. Hence, y is considered during the execution of the Algorithm 5. We also know that y is part of the valid factor when it is considered, since the right boundary only excludes letters after consideration, and the left boundary only moves to the right of peaks.However, since y is part of an increasing suffix, it cannot have a peak to its right nor can it be a peak itself (or a descent in general).In particular, the fact that y is not a peak also implies that y must either be the first or the last letter of the valid factor when it is considered.If y is the first letter of the valid factor, then the algorithm stops, and y is in B because it is an ascent (as it is part of an increasing suffix).Otherwise, if y is the last letter (but not the first), then the algorithm still adds y to B. In any case, y ∈ B.
We now prove the other inclusion.Let z ∈ B. Then, z is either the first letter of the valid factor when the algorithm stops, or it is the last letter of the valid factor at some point during the execution of the algorithm.In the latter case, z being at the end of the valid factor means that everything to its right is greater than z (by Lemma 9), so it is part of an increasing suffix of π.If z is the first letter of the valid factor when the algorithm stops, then it is in B only if is an ascent of π, in which case z is also the last letter of the valid factor by the argument in Case (1) of the proof of Proposition 10.In either case, z belongs to the maximal increasing suffix of π.Moreover, we know that z is considered by Algorithm 5 during its execution and that β 1 (π) is the last letter considered prior to termination.Since the algorithm considers the letters in π in decreasing order of their values, it follows that z ≥ β 1 (π).Therefore, z ∈ A.
We have thus proved that A = B, so Algorithm 5 indeed gives the set of rixed points.
We now show that the recursive definition (1.1) for the rix statistic can be adapted to obtain a recursive algorithm for computing the set of rixed points.As a consequence, we get that rix(π) is indeed the cardinality of Rix(π) for any permutation π. (iv)   Proposition 12.Given a word w = w 1 w 2 • • • w k with distinct positive integer letters, define Rix(w) in the following way: If k = 0 (i.e., if w = ∅), then Rix(w) = ∅.Otherwise, if w i is the largest letter of w, then let Then, for any permutation π, the set Rix(π) obtained using the above recursive definition is indeed the set of rixed points of π.
Before proving Proposition 12, let us illustrate this recursive algorithm for Rix with a couple examples.By comparing these with Examples 7-8, which compute the rixed points of the same permutations but using Algorithm 5, we see that the valid factors of Algorithm 5 are precisely the words w at each step of (3.1).This will be key to our proof of Proposition 12.
Example 13 (Examples 3 and 7 continued).We use Proposition 12 to compute the rixed points of π = 142785369: Example 14 (Examples 4 and 8 continued).We use Proposition 12 to compute the rixed points of π = 23816457: Proof of Proposition 12: We show using induction that the three cases in (3.1) correspond (with a slight adjustment) to the three cases in Algorithm 5, and that the word w changes in the same way as the valid factor in Algorithm 5.Both procedures begin with the entire permutation π, which establishes the base case.For our induction hypothesis, suppose that w = w 1 • • • w k is the valid factor of π.Let w i be the largest letter of w.Consider the following cases: • If w i is the first letter (but not the last) of w, then there are no rixed points in w according to (3.1).Note that if w i is both an ascent of π and the first letter of w, then it is the only (and therefore last) letter of w because it is the largest letter in w.Hence, this case corresponds to case (b) of Algorithm 5 when w i is not an ascent of π, in which no rixed points are added and the algorithm terminates.
• If w i is the last letter of w, then (3.1) adds w i as a rixed point and w becomes w 1 • • • w k−1 .Note that if w i is the only letter of w, then w 1 • • • w k−1 = ∅ and the procedure in (3.1) stops.This corresponds to case (c) of Algorithm 5, as well as case (b) when w i is the only letter of w (and thus an ascent of π by Lemma 9).
• Otherwise, the largest letter w i of w is neither its first nor last (which means that w i is a peak of π), so w becomes w i+1 • • • w k and no rixed point is added.This corresponds to case (a) of Algorithm 5.
Because the valid factor and the set of rixed points change in the same way at each step of both algorithms, we get the same set of rixed points at the end.

A characterization of rixed points
If y is a descent of π, let us call y a leading descent of π if there is no larger descent of π appearing after y.For example, the leading descents of π = 194376528 are 9, 7, 6, and 5, whereas 4 is a descent of π but not a leading descent because the larger letters 7, 6, and 5 are all descents of π that appear after 4.
Leading descents are useful in the study of rixed points.For example, note that the x in step (2) of Definition 1 is always a leading descent of π.We will now use leading descents to define the "maximal descending ridge" of a permutation, which plays a role in our subsequent characterization of rixed points.
Definition 15.In this definition, we will prepend ∞ to π and consider ∞ to be the first leading descent of ∞π.We define the maximal descending ridge of a permutation π in the following way: • If π i and π i+1 are the leftmost pair of leading descents in adjacent positions, then the maximal descending ridge of π is the prefix of ∞π ending with π i .
• If ∞π does not have two leading descents in adjacent positions, then the maximal descending ridge of π is the prefix of ∞π ending with the rightmost descent of π.
To illustrate, the maximal descending ridges of the permutations 142785369 and 23816457 (from the earlier examples) are ∞14278 and ∞23816, respectively.
Theorem 16.Let π ∈ S n .The rixed points of π are characterized by the following: (a) If y ∈ Rix(π), then either y is a double ascent of π, or y is the rightmost valley of π and is either the first letter of π or immediately follows a peak in π.
(b) A letter y satisfying the above conditions is a rixed point of π if and only if none of y +1, y +2, . . ., n is immediately to the right of the maximal descending ridge of π or appears as a peak to the right of y.
Before giving the proof, let us use the characterization given by Theorem 16 to determine the rixed points of the two permutations from the earlier examples.
Example 17 (Examples 3, 7, and 13 continued).Take π = 142785369, whose maximal descending ridge is ∞14278.The letters of π meeting the requirements in Theorem 16 (a) are 7, 6, and 9, but 7 is not a rixed point because 8 is a peak immediately following 7. (v) On the other hand, 6 and 9 are both rixed points because none of 7, 8, and 9 is immediately to the right of the maximal descending ridge or is a peak to the right of 6, and there is no letter in π larger than 9. Thus, Rix(π) = {6, 9}.
Remark 19.In Examples 17 and 18, the letter following the maximal descending ridge of π coincides with the beginning of the β rix-factor of π.This will be confirmed in the proof of Theorem 16 below, as we shall show that if Algorithm 5 terminates while considering x (so that x is the first letter β 1 (π) of β), then x immediately follows the maximal descending ridge of π.Therefore, we can also compute the rixed points of a permutation π by using the maximal descending ridge to determine β 1 (π) and then applying Definition 2.

Proof of Theorem 16:
We first prove (a).By Definition 2, every rixed point y of π belongs to an increasing suffix of π, so y is an ascent of π.Every ascent is either a double ascent or a valley, and if y is (v) We also know that 7 cannot be a rixed point because it is not part of an increasing suffix of π.
a valley, then it is the rightmost valley of π as it must be the first letter of the maximal increasing suffix of π.Furthermore, in Algorithm 5, we see that a valley y is added as a rixed point only when it is the first letter of the valid factor; if y is instead the last letter (but not the first) of the valid factor, then y would not be the largest letter of the valid factor, contradicting the fact that Algorithm 5 considers the letters of π in decreasing order.Since y is the first letter of the valid factor, it follows that it is either the first letter of π or it is immediately to the right of a peak (because this is how the left boundary is moved in Algorithm 5).Hence, part (a) is proven.
To prove (b), let us first assume that y is a rixed point of π, and show that none of y + 1, y + 2, . . ., n is immediately to the right of the maximal descending ridge of π or appears as a peak to the right of y.For this, recall again that the letters of π are inspected in decreasing order by Algorithm 5 until we reach the stopping condition, which is when the largest letter of the valid factor is its first letter.Let q be the largest (and thus first) letter of the valid factor when the algorithm stops.None of q + 1, q + 2, . . ., n is a peak to the right of q; otherwise, the left boundary of the valid factor would have been moved to the right of q, and so q would not be in the valid factor.We also know that y is weakly to the right of q and that y ≥ q because y is a rixed point, so {y + 1, y + 2, . . ., n} is a subset of {q + 1, q + 2, . . ., n}, and thus it follows from the analogous statement for q that none of y + 1, y + 2, . . ., n is a peak to the right of y.
By the same reasoning as in part (a), either q is the first letter of π, or it immediately follows a peak of π-call it z.In the latter case, we claim that z is the last letter of the maximal descending ridge of π, which we prove in the following steps: (1) We show that z is a leading descent of π.Otherwise, if z ′ were the largest descent to the right of z that is greater than z, then z ′ would be a peak, and so the left boundary of Algorithm 5 would have moved to the right of z ′ upon considering z ′ .Hence, no such z ′ exists, so z is indeed a leading descent.
(2) We show that there cannot be leading descents in adjacent positions weakly to the left of z, which would imply that z belongs to the maximal descending ridge.Suppose otherwise, and let z ′ and z ′′ be the leftmost pair of leading descents in adjacent positions.(Note that z ′ can be ∞, and z ′′ can be z unless z ′ = ∞.)Since z ′ > z ′′ ≥ z > q and Algorithm 5 terminates while considering q, the algorithm must consider z ′ (unless z ′ = ∞) and z ′′ at some point.If z ′ = ∞, then z ′′ is the first letter of π and thus the first letter of the valid factor at the beginning of Algorithm 5.If z ′ = ∞, then z ′ is a peak, so the left boundary of the valid factor would move to z ′′ upon considering z ′ .Either way, the valid factor will begin with z ′′ at some point during the execution of the algorithm.And since z ′′ is a leading descent, there are no peaks larger than z ′′ to the right of z ′′ , so the left boundary would stay at z ′′ until z ′′ is considered by the algorithm, at which point the algorithm terminates.This contradicts the assumption that the algorithm terminates while considering q, so no such z ′ and z ′′ exist.
(3) If q is a descent, then q is a leading descent by the same reasoning as in (1), so z is the last letter of the maximal descending ridge.If q is an ascent, then it is added by Algorithm 5 as a rixed point, and since the rixed points form an increasing suffix of π, this means that z is the rightmost descent of π and therefore the last letter of the maximal descending ridge.
Note that if q is the first letter of π, then the argument in (3) suffices to show that the maximal descending ridge is ∞.In either case, q is immediately to the right of the maximal descending ridge, and since y ≥ q, it follows that none of y + 1, y + 2, . . ., n is immediately to the right of the maximal descending ridge.
Conversely, suppose that y satisfies the conditions in part (a), and that none of y + 1, y + 2, . . ., n immediately follows the maximal descending ridge of π or appears as a peak to the right of y.We wish to show that y is a rixed point of π.First, note that the left boundary of the valid factor never moves to the right of y during the execution of Algorithm 5, since no letter larger than y is a peak to the right of y.Also, if the algorithm were to terminate while considering a letter q larger than y, then we know from an argument earlier in this proof that q immediately follows the maximal descending ridge, which is a contradiction.Hence, y is considered by Algorithm 5 at some point during its execution, and y appears in the valid factor while under consideration.Now, recall that the conditions in part (a) imply that y is an ascent and therefore not a peak, so y is either the first or the last letter of the valid factor when it is considered by the algorithm.If y is the first letter, then the fact that it is an ascent guarantees that it is a rixed point.If y is the last letter (but not the first) of the valid factor, then Algorithm 5 adds it as a rixed point as well.Thus the proof of part (b) is complete.

Properties of rixed points and the rix-factorization
Before proceeding, we shall give a few more properties of rixed points and the rix-factorization which will be used later in this paper.

Lemma 20. Let π be a permutation with rix-factorization
, and is a double ascent of π otherwise.
Proof: Recall from Theorem 16 (a) that a rixed point of π is either a valley or a double ascent of π.By the algorithm in Definition 1, β 1 (π) must either be the first letter of π or is immediately preceded by a descent.Hence, if y = β 1 (π), then y is a valley of π.Now, suppose that y = β 1 (π), so that y > β 1 (π).Then y is added to the set of rixed points in Algorithm 5 when it is the last letter of the valid factor, which is subsequently set to π l • • • π r where π r is the letter immediately preceding y.If π r is a peak of π, then in particular π r > y and so the algorithm must have examined x = π r prior to x = y, at which stage the valid factor would have been set to begin with y.This means that the algorithm would terminate at x = y and y would be the first letter of β, a contradiction.Therefore, y is not the first letter of π and does not immediately follow a peak, so y is a double ascent of π by Theorem 16.

Lemma 21. Let π be a permutation with rix-factorization
If y is a leading descent of π, then either y is an entry of β or y is the last letter of α i for some 1 ≤ i ≤ k.
Proof: Suppose that y is a leading descent of π but does not belong to β.Then y belongs to a rix-factor α i of π.It is evident from both Definition 1 and Algorithm 5 that the last letter of α i is the largest letter of α i and is a descent of π.So, if y were not the last letter of α i , then the last letter of α i would be a descent of π to the right of y which is larger than y, contradicting the assumption that y is a leading descent of π.(c) Every letter of β is either a rixed point of π or is β 1 (π).

Lemma 22. Let π be a permutation with rix-factorization
Furthermore, let y be any letter of β that is neither β 1 (π) nor a rixed point.Then y < β 1 (π).(c).If every letter of β appearing after β 1 (π) is a rixed point of π, then β 1 (π) is also part of the maximal increasing suffix consisting of letters not smaller than β 1 (π), so β 1 (π) is also a rixed point of π.Thus (c) implies (b).Now, let y be a letter of β that is neither β 1 (π) nor a rixed point.Then it is easy to see that y is a non-initial letter of the valid factor when Algorithm 5 terminates, whereas β 1 (π) is the initial letter of that valid factor and is the letter being considered by the algorithm at that point.Since the letter being considered at any point is the largest letter of the valid factor (or is not in the valid factor), it follows that y < β 1 (π).

Valley-hopping and cyclic valley-hopping
Most of our remaining results will deal with the interplay between rixed points and valley-hopping; here we shall define the latter.Fix π ∈ S n and x ∈ [n].We may write π = w 1 w 2 xw 4 w 5 where w 2 is the maximal consecutive subword immediately to the left of x whose letters are all smaller than x, and w 4 is the maximal consecutive subword immediately to the right of x whose letters are all smaller than x.Define ϕ x : S n → S n by ϕ x (π) := w 1 w 4 xw 2 w 5 , if x is a double ascent or double descent of π, π, if x is a peak or valley of π.
It is easy to see that ϕ x is an involution, and that ϕ x commutes with ϕ y for all x, y ∈ [n].Thus, given a subset S ⊆ [n], it makes sense to define ϕ S : S n → S n by ϕ S := x∈S ϕ x .The involutions {ϕ S } S⊆[n] define a Z n 2 -action on S n , called the modified Foata-Strehl action or valley-hopping.For example, if π = 834279156 and S = {6, 7, 8}, then we have ϕ S (π) = 734289615; see Figure 4.1.This figure makes it apparent that, pictorially, the elements of S are indeed "hopping" over valleys upon applying ϕ S .Also, observe that x ∈ S is a double ascent of π if and only if x is a double descent of ϕ S (π), and that it is a double descent of π if and only if it is a double ascent of ϕ S (π).
The valley-hopping action originated in work of Foata and Strehl [5], and was independently discovered by Shapiro, Woan, and Getu [11] and by Brändén [2].A cyclic version of valley-hopping was later defined by Sun and Wang [14] for derangements, and then extended to the entire symmetric group by Cooper, Jones, and the second author [3].Below, we will extend Sun and Wang's action in a slightly different way.
As of this point, we have only needed to write permutations in one-line notation, but we shall now need both one-line notation and cycle notation.When writing a permutation in cycle notation, we shall write each cycle with its largest value first and listing the cycles in increasing order of their largest value; this convention is referred to as canonical cycle representation.We will also consider "restricted" versions of valley-hopping and cyclic valley-hopping.Define restricted valley-hopping to be the Z n 2 -action on S n induced by the involutions φS := x∈S φx where Moreover, define restricted cyclic valley-hopping to be the Z n 2 -action on S n induced by the involutions ψS := x∈S ψx where ψx (π) := π, if x ∈ Fix(π) or if x is the first letter of o(π), ψ x (π), otherwise.
Restricted valley-hopping was first defined by Lin and Zeng [8, Section 4], and restricted cyclic valleyhopping is precisely the aforementioned extension of Sun and Wang's action due to Cooper, Jones, and the second author.

rix is homomesic under valley-hopping
Having defined the valley-hopping action, our next goal is to prove the following.

Theorem 23. The rix statistic is 1-mesic under valley-hopping.
A statistic is k-mesic under an action if its average value over each orbit is equal to k.In other words, we claim that the permutations in each valley-hopping orbit have 1 rixed point on average.
Given an orbit Π of the valley-hopping action, define the set R Π by and the map φ : R Π → Π by taking φ(π, x) := ϕ x (π)-i.e., the permutation in Π obtained by letting x hop in π.
Lemma 24.For any (π, x) ∈ R Π , we have x = β 1 (φ(π, x)). Proof: be the rix-factorizations of π and φ(π, x), respectively.Suppose that x = β 1 (π).Then x is a valley of π by Lemma 20, so π = φ(π, x) and thus x = β 1 (π) = β 1 (φ(π, x)).Hence, let us assume for the rest of Nadia Lafrenière and Yan Zhuang this proof that x = β 1 (π), which by Lemma 20 means that x is a double ascent of π.Since x is a double ascent of π, we know that x is a double descent of φ(π, x).In addition, we know that x hops over β 1 (π) because x > β 1 (π)-that is, x appears before β 1 (π) in φ(π, x).In fact, we claim that x is a leading descent of φ(π, x).To see this, first recall from Definition 1 that either β is increasing or β 1 (π) is the largest descent of β; in either case, there cannot be a descent of φ(π, x) larger than x to the right of β 1 (π).There also cannot be a descent of φ(π, x) larger than x located between x and β 1 (π), as x would not have been able to hop over that descent.Therefore, x is a leading descent of φ(π, x), which by Lemma 21 implies that x is either the last letter of some α ′ i or belongs to β ′ .Assume by way of contradiction that x is the last letter of α ′ i .If x is the first letter of φ(π, x), then x cannot be the last letter of α ′ i because α ′ i has length at least 2 by Definition 1; but in this case, we would have β ′ = φ(π, x) which gives the desired conclusion.Otherwise, let y be the letter immediately preceding x in φ(π, x).We know that y > x by the definition of valley-hopping; after all, if y < x, then x would have hopped over it.In other words, y is a descent of φ(π, x).In fact, y is also a descent of π; the letter z immediately following y in π appears after x in φ(π, x), and so x > z (and thus y > z) because x hopped over it.The following illustrates the relative placements of y, z, β 1 (π), x before and after valley-hopping: Because x is a leading descent of φ(π, x) and y > x, it follows that y is a leading descent of both π and φ(x, π).We know that y cannot be in β ′ because x is not in β ′ , so by Lemma 21, it must be true that y is the last letter of α ′ i−1 , and yet this is impossible because it would mean that α ′ i has length 1.Therefore, our assumption that x is the last letter of some α ′ i is false, and so x belongs to β ′ and either y is the last letter of α ′ m or also belongs to β ′ .If we can show that y is the last letter of α ′ m , then x would be the first letter of β ′ as desired.
Up to this point, we've only used the fact that y is a leading descent of φ(x, π), but recall that y is also a leading descent of π.Since y is not in β, by appealing to Lemma 21 again, it follows that y is the last letter of some α j .Letting x hop does not change the prefix of the permutation π up to and including y, nor does it change whether y is a leading descent, so the first j rix-factors α 1 , . . ., α j of π are precisely the rix-factors α ′ 1 , . . ., α ′ m of φ(x, π).Hence, y is the last letter of α ′ m and we are done.
Theorem 23 is an immediate corollary of Proposition 25.After all, the fact that φ is a bijection tells us that the total number of rixed points among permutations in Π is equal to the number of permutations in Π.In other words, the average value of rix over any valley-hopping orbit is 1.
On the rix statistic and valley-hopping 19 Theorem 26.Let π be a permutation, Π the valley-hopping orbit containing π, Π the restricted valleyhopping orbit containing π, Π ′ the cyclic valley-hopping orbit containing Φ(π), and Π′ the restricted cyclic valley-hopping orbit containing Φ(π).Then: In other words, Φ sends orbits of the valley-hopping action to orbits of cyclic valley-hopping-so that these actions are in sense "the same" up to Φ-and the restricted versions of valley-hopping and cyclic valley-hopping are related in the same way.Before reviewing the definition of Φ and working toward the proof of Theorem 26, we note that the following is an immediate consequence of Theorems 23 and 26 since Rix(π) = Fix(Φ(π)) implies rix(π) = fix(Φ(π)).
Remark 28.In [6] and [13], the authors show that the number of fixed points is homomesic under some "Foatic actions", which are compositions of the form f • o −1 • g • o where f, g are dihedral actions (such as the reverse map, the inverse map, and the complement map).We checked whether the rix statistic is homomesic under any Foatic actions, but found counterexamples for all of them.
In (6.1), each cycle is written with its largest letter first, the cycles of length at least 2 are arranged in decreasing order of their largest letter, (vi) and the fixed points are arranged in increasing order and after the cycles of length at least 2.However, for our purposes, we will need to rearrange the order of the cycles to be in line with canonical cycle representation.To that end, let us write Φ(π) as where each µ i consists of all fixed points (in increasing order) which are greater than the first entry of the previous cycle and (if i > 0) less than the first entry of the subsequent cycle.Continuing with the example π = 7 6 9 1 8 4 2 3 5 10 11, the cycles of Φ(π) are rearranged to become Φ(π) = (4, 3, 2)(5)(8, 1)(9, 6, 7)(10) (11) so that µ 2 = (5), µ 1 is empty, and µ 0 = (10)(11).

Proof of Theorem 26
Our proof of Theorem 26 will require a few additional lemmas.
Lemma Before giving the proof of Lemma 29, let us briefly describe the intuition behind this lemma.The map o • Φ takes a permutation π in one-line notation, considers the permutation Φ(π) in cycle notation where the cycles are determined by the rix-factorization of π, but then erases the parentheses to obtain the permutation o(Φ(π)) in one-line notation.The overarching idea of the proof is to show that if x is a peak of π and if o • Φ changes the neighboring letters of π, then x will stay a peak, and that the same is true if x is instead a valley.However, we will need to carefully check a number of cases to verify that this is indeed true.
Proof: We shall first establish the forward directions of (a) and (b): if x is a peak (respectively, valley) of π, then x is a peak (respectively, valley) of o(Φ(π)).

Case 1:
x is an element of α i for some 1 ≤ i ≤ k.
Suppose that x is a peak of π.Because each α i ends with a descent, x cannot be the first letter of α i .This means that a 1 • • • a j cannot be empty but is empty, then x would be the first letter of the cycle αi , so as long as αi is not the first cycle of Φ(π), we are guaranteed by canonical cycle representation that x is a peak of o(Φ(π)).If αi were the first cycle of Φ(π), then that means δ is empty and that there are no rixed points of π smaller than x; however, that would imply that x is immediately followed in π by a rixed point larger than x, which is a contradiction because x is the last letter of α i and thus a descent.Therefore, x is a peak of o(Φ(π)).Now, suppose that x is a valley of π.Because each α i ends with a descent, x cannot be the last letter of α i .This means that a empty, then x is the last letter of the cycle αi , in which case x would still be a valley of o(Φ(π)) by the definition of canonical cycle representation.
To prove (b), let us first make the following observations.First, it is clear from the definition of canonical cycle representation that every fixed point of Φ(π) is a double ascent of o(Φ(π)) unless the fixed point is the first cycle of Φ(π), in which case it is a valley of o(Φ(π)).In addition, it is easy to see that the first cycle of Φ(π) is a fixed point if and only if the first cycle is (β 1 (π)), which occurs if and only if β 1 (π) is a rixed point of π.As such, let us divide into the following cases: By Lemma 20, we know that β 1 (π) is a valley of π while all of the other rixed points are double ascents of π, so the number of permutations in Π is 2 dbl(π)−rix(π)+1 .On the other hand, from the discussion above, we know that the number of permutations in Π′ is 2 dbl(o(Φ(π)))−fix(Φ(π))+1 = 2 dbl(π)−rix(π)+1 .
Thus the proof of (b) is complete.
We now seek to show that whenever two permutations π and σ are in the same (restricted) valleyhopping orbit, then Φ(π) and Φ(σ) are in the same (restricted) cyclic valley-hopping orbit.Toward this goal, we prove the following lemma, which will again require extensive casework.Proof: We divide into cases based on the position of x in π.In all of the cases below, let be the rix-factorization of σ.Cases 1-2 will establish part (a), whereas Cases 3-5 will prove parts (b) and (c).
If x is a peak or valley of π, then σ = π and x is also a peak or valley of o(Φ(π)) by Lemma 29, which together imply Φ(σ) = ψ x (Φ(π)).So, for the remainder of this case, let us assume that x is neither a peak nor a valley of π.In particular, this means that x is not the last letter of α i , since we know from Algorithm 5 that the last letter of each α i is a peak of π.Observe that both the last letter of α i−1 (if i > 1) and the last letter of α i are larger than x; if x were instead larger than either, then x would have been considered by Algorithm 5 and thus removed from the valid factor prior to when α i was added to the rix-factorization, which is impossible.Hence, upon applying ϕ x to π, the letter x belongs to the same rix-factor, so the number of rix-factors is unchanged.This means that π and σ have exactly the same rix-factors except for α i and α ′ i , and similarly with the cycles in the canonical cycle representation of Φ(π) and Φ(σ).Now, let us write so that αi = (a l , . . ., a p+1 , x, a p , . . ., a 1 ).
If x is a double descent of π, then we have . ., a q+1 , x, a q , . . ., a p+1 , a p , . . ., a 1 ); here, a q+1 is the closest letter to the right of x in α i that is larger than x.It is clear that when we apply ψ x to Φ(π), the cycle αi is transformed to α′ i and therefore Φ(σ) = ψ x (Φ(π)).The case when x is a double ascent of π is similar.
Case 2: x is in β but is neither β 1 (π) nor a rixed point of π.
By Lemma 22, we have x < β 1 (π), and therefore x is also smaller than the rixed points of π.This means that Φ(π) and Φ(σ) have exactly the same cycles except for δ and δ′ , and the remainder of the proof for this case follows in a similar way as in Case 1.
We know from Lemma 22 that, in this case, x is the smallest rixed point of π.Moreover, by Lemma 24, we have β 1 (σ) = x and thus there are no rixed points of σ smaller than x.This means that our set S as defined in the statements of (b) and (c) is given by S = {x}.Note that x is a valley of π by Lemma 20 and therefore a valley of o(Φ(π)) by Lemma 29.Since x being a valley of π implies σ = π, we have Φ(σ) = ψ S (Φ(π)) as desired.
Let Rix(π) = {π j , π j+1 , . . ., π l−1 , π l = x, π l+1 , . . ., π n } be the set of rixed points of π.Then we can write the rix-factorization of π as As usual, we write From Lemma 24, we have that x = β 1 (σ).This means that the rix-factorization of σ is given by Note that the last letter of α m is the closest letter to the left of x in π that is larger than x, and that π j , π j+1 , . . ., π l−1 are not rixed points of σ because they are less than x.Taking δ ′ to be the analogue of δ but for σ, we have Note that the letters in the cycles α′ m • • • α′ k+1 are precisely d p−1 , . . ., d 3 , d 2 in this given order.Comparing with δ = (x, d l , d l−1 . . ., d 2 ), we see that in going from o(Φ(π)) to o(Φ(σ)), the only difference is in the positions of the letters d p = β 1 (σ) and the letters x, d q , d q+1 , . . ., d l (the rixed points of σ smaller than or equal to x).We must show that the movement of these letters corresponds precisely to letting them hop-that is, applying ϕ S to o(Φ(π)) where S = {d p , x, d q , d q+1 , . . ., d l } results in o(Φ(σ)).
Let y be any of the letters x, d q , d q+1 , . . ., d l , which are all rixed points of σ and thus fixed points of Φ(σ).Per canonical cycle representation, to go from o(Φ(π)) to o(Φ(σ)), each of these y must be moved to the position immediately before the closest letter to the right of y that is larger than y, which is the first entry of the cycle immediately after (y) in Φ(σ).Now, recall that together, these imply that d q is either a double descent or valley (vii) of o(Φ(π)), and all the other y are double descents of o(Φ(π)), so they will all hop to the right (or remain stationary) in applying ϕ S .By the definition of valley-hopping, each of these y will move to the position immediately before the closest letter to the right of y that is larger than y, precisely as described above.Hence, in applying ϕ S to o(Φ(π)), all of the letters x, d q , d q+1 , . . ., d l will move to the desired positions.It remains to show that d p will move to the correct position as well.
At this point, we note that it is possible for d p = β 1 (σ) to be a rixed point of σ, and in this case we would have d p = d q and the proof would be complete.So let us assume that d p is not a rixed point of σ.In going from o(Φ(π)) to o(Φ(σ)), the letter d p is moved to the very beginning of the permutation.Upon letting the letters x, d q , d q+1 , . . ., d l hop in o(Φ(π)), only the letters d q−1 , . . ., d p+1 appear before d p , so it suffices to show that d p is a double ascent of o(Φ(π)) and that it is larger than all of the letters d q−1 , . . ., d p+1 .The latter follows from Lemma 22, as d p = β 1 (σ) and d q−1 , . . ., d p+1 are precisely the letters in β ′ which are neither β 1 (σ) nor rixed points of σ.To see that d p is a double ascent of o(Φ(π)), we first note that Therefore, the remaining letter d p also moves to the correct position after applying ϕ S , and the proof is complete.

Example 4 .
Let us walk through the algorithm in Definition 1 for the permutation π = 23816457:

Fig. 3 . 1 :(x = 4 )
Fig. 3.1: Visual depictions of Algorithm 5 on π = 142785369 and π = 23816457, as in Examples 7 and 8.The peaks that mark the end of each α-factor in the rix-factorization are depicted as green squares, and the rixed points as red diamonds.The progression of the valid factor is depicted on top of the permutation.
The following are equivalent:(a) The rix-factor β is increasing.On the rix statistic and valley-hopping 15 (b) Every letter of β is a rixed point of π.
x and δ = (x, d l , d l−1 . . ., d 2 ); d p is preceded by d p+1 in o(Φ(π)) and d p+1 < d p .Now we consider two subcases: • If p = 2, then d p is the last entry of the cycle δ of Φ(π), which by canonical cycle representation implies that d p is a double ascent of o(Φ(π)).• If p > 2, then d p is followed by d p−1 in o(Φ(π)).Note that d p−1 is the first entry of the cycle α′ m appearing after δ′ in Φ(σ), which by canonical cycle representation implies that d p < d p−1 .Hence, d p is a double ascent of o(Φ(π)).