Repeatable patterns and the maximum multiplicity of a generator in a reduced word

We study the maximum multiplicity $\mathcal{M}(k,n)$ of a simple transposition $s_k=(k \: k+1)$ in a reduced word for the longest permutation $w_0=n \: n-1 \: \cdots \: 2 \: 1$, a problem closely related to much previous work on sorting networks and on the"$k$-set"problem. After reinterpreting the problem in terms of monotone weakly separated paths, we show that, for fixed $k$ and sufficiently large $n$, the optimal density is realized by paths which are periodic in a precise sense, so that \[ \mathcal{M}(k,n)=c_k n + p_k(n) \] for a periodic function $p_k$ and constant $c_k$. In fact we show that $c_k$ is always rational, and compute several bounds and exact values for this quantity with"repeatable patterns", which we introduce.


Introduction
Write s k = (k k+1) for the adjacent transpositions in the symmetric group S n .A reduced word for a permutation w ∈ S n is an expression w = s i1 • • • s i ℓ of minimal length, and in this case ℓ = ℓ(w) is called the length of w; we write R(w) for the set of reduced words of w.
There is a unique permutation w 0 = n n − 1 • • • 2 1 of maximum length n 2 , called the longest permutation.Reduced words of w 0 have been extensively studied, as maximal chains in the weak Bruhat order [4], in total positivity and cluster algebras, and in the context of random sorting networks [2].It is not hard to see that the minimum multiplicity of s k in a reduced word for w 0 is min(k, n − k) (see Section 5), while the average multiplicity can be computed using the Edelman-Greene bijection [5].This paper describes our study of the quantity M(k, n), the maximum multiplicity of s k among all reduced words of w 0 .This problem is considerably more difficult, as evidenced by its close connection to the wellknown "k-set problem".The maximum multiplicity problem for reduced words of general permutations has been studied by Tenner [12], who gave bounds expressed in terms of permutation patterns.
Throughout much of this paper 1 we consider monotone weakly separated paths or generalized wiring diagrams instead of reduced words themselves.From this perspective certain periodicity phenomena appear which are obscured when considering reduced words or their associated pseudoline arrangements.
Date: July 4, 2024.C.G. was partially supported by an NSF Fellowship under grant DMS-2103121.P.J. was supported by Elchanan Mossel's Vannevar Bush Faculty Fellowship ONR-N00014-20-1-2826 and by Elchanan Mossel's Simons Investigator award (622132).G.N. was supported by the Knut and Alice Wallenberg Foundation, KAW 2017.0394. 1 An extended abstract of this work appears in the proceedings of FPSAC [7].The k-set problem, studied since work of Lovász [8] and Erdős-Lovász-Simmons-Straus [6] in the 1970s, asks for the maximum number of k-sets admitted by any collection A. This problem has since found application in the analysis of some geometric algorithms.
A common approach to this problem proceeds by first applying projective duality to recast the problem in terms of regions of height k in an arrangement of n lines, and then relaxing it by considering arrangements of n pseudolines (curves in the plane such that each pair crosses exactly once).Many of the strongest known results for the k-set problem work with this relaxation, and all available data [1] indicates that the answers in fact agree for lines and for pseudolines.An arrangement of n pseudolines can equivalently be thought of as the wiring diagram for a reduced word of w 0 , and in this context the problem becomes to maximize the total number of s k 's and s n−k 's appearing.We show in Section 4 that there is a well-defined slope c k defined by M(k, n) ∼ c k n and that this quantity is the same whether we consider the total multiplicity of s k and s n−k or just that of s k , so that our original problem is very closely linked to the (pseudoline version of) the k-set problem.
1.2.Relation to weak separation.Given a reduced word of a permutation w, we can associate a weakly separated collection to it, and more specifically, a monotone weakly separated path.This process can be viewed as first obtaining a plabic graph from the reduced word, and then taking certain face labels.Weakly separated collections are fundamental objects in the theory of the totally nonnegative Grassmannian and related cluster algebras (see, e.g.[11]).In particular, Oh-Postnikov-Speyer [9] constructed a bijection between reduced plabic graphs of any positroid M and certain maximal weakly separated collections, establishing the purity property.Moreover, maximal weakly separated collections of [n]   k correspond to Plücker clusters of the Grassmannian Gr(k, n), which behave nicely among other clusters.In fact, in this paper, we will very often think of a reduced word via its corresponding monotone weakly separated path.We elaborate on this connection in Section 2.
1.3.Outline and main results.In Section 2 we introduce monotone weakly separated paths and establish an equivalent version of the main problem in these terms.Section 3 introduces arc diagrams and applies these to give bounds and some exact values for M(k, n).Arc diagrams and their weights give a tool for computing upper bounds on M(k, n), while repeatable patterns, also introduced in Section 3, allow explicit constructions of reduced words for all n at once, and thus for determining lower bounds on M(k, n).This technology allows us to show: Theorem 1.1 (See Section 3).For k = 1, 2, 3, the quantity c k exists and we have c 1 = 1, c 2 = 3  2 , and c 3 = 11 6 .Furthermore, explicit reduced words realizing M(k, n) for k = 1, 2, 3 and n ∈ N can be obtained from the repeatable patterns given in Section 3.
In Section 4 we introduce generalized wiring diagrams, which, for arbitrary fixed k, can be used to reason about M(k, n) for all n simultaneously.We use these objects to show that for all k the quantity c k := lim n→∞ M(k, n) n exists, is rational, and is equal to the corresponding limit which counts multiplicities of both s k and s n−k .In fact, what we prove is much stronger: Theorem 1.2 (See Section 4).For fixed k and sufficiently large n, c k is realized by diagrams which are are periodic in a precise sense, so that computing c k reduces to a finite search for repeatable patterns.
Finally, in Section 5 we discuss the problem (which is easy for the symmetric group) of minimizing the multiplicity of s k in a reduced word for the longest element w 0 in other finite Coxeter groups.

Reduced words and weakly separated paths
In this section, we establish relations between reduced words and monotone weakly separated paths.We say that two different sets I, J ⊂ [n] of cardinality k are weakly separated if max I − J < min J − I or max J − I < min I − J, and that a collection of cardinality k subsets of [n] is weakly separated if each pair of sets is weakly separated.Note that being weakly separated is not a transitive relation.A sequence of subsets (A 0 , A 1 , . . ., A N ) is a monotone weakly separated path if the collection {A 0 , . . ., A N } is weakly separated and for each i = 1, . . ., N , both A i − A i−1 =: {x i } and A i−1 − A i =: {y i } are singleton sets with x i > y i .
Given a reduced word s i1 • • • s i ℓ = i ∈ R(w), and a fixed simple generator s k = (k k + 1), let a 1 < • • • < a N be the positions of all s k 's in i.We obtain permutations w (j) = s i1 s i2 • • • s ia j as the products of prefixes of i, where w (0) = id.For j = 1, . . ., N , let A j = {w (j) (1), w (j) (2), . . ., w (j) (k)} be the set of values of w (j) on inputs 1, . . ., k, and write its corresponding wiring diagram consists of wires labeled by 1, 2, . . ., n starting at levels 1, 2, . . .respectively from top to bottom, traveling from left to right such that at each timestamp t, the two wires at levels i t and i t+1 cross.
Proof.Let i ∈ R(w) and P k (i) = (A 0 , . . ., A N ).If some A j and A j ′ with j < j ′ are not weakly separated, then there exists a ∈ A j − A j ′ and a ′ ∈ A j ′ − A j such that a > a ′ .By definition, w (j) < w (j ′ ) in the right weak Bruhat order, but (a, a ′ ) is a left inversion of w (j) , not of w (j ′ ) , contradiction.In other words, if we consider the wiring diagram associated to i, the wires labeled a and a ′ must intersect from A 0 to A j , and intersect again from A j to A j ′ , meaning that i cannot be reduced.As a result, {A 0 , . . ., A N } is a weakly separated collection.At the same time, x < y since i is reduced.Thus, P k (i) = (A 0 , . . ., A N ) is a monotone weakly separated path.Now suppose that we are given a monotone weakly separated path P = (A 0 , . . ., A N ) with A 0 = {1, . . ., k}.Start with w (0) = id.We are going to construct w (1) , w (2) , . . .with a reduced word i along the way such that P k (i) = P .Suppose that we have constructed In the end, the s k exchanges the values x and y.Therefore, we automatically have {w (j+1) (1), . . ., w (j+1) (k)} = A j − {x} ∪ {y} = A j+1 as desired.The only thing left to show is that the word i coming from such construction is reduced.
If i is not reduced, we can without loss of generality assume that in some step when we are constructing w (j+1) from w (j) , a simple generator s p exchanges a larger value at position p with a smaller value at position p + 1. Keep the notation as in the above paragraph.We cannot have p = k since s k always exchanges A j − A j+1 at position k with A j+1 − A j at position k + 1.So by symmetry, we assume p < k, and that such s p exchanges value x ∈ A j+1 −A j at position p with value z at position p+1, with x > z.Since z < x, the values z and x must have been switched before, when we are constructing w (j ′ +1) from w (j ′ ) , with j ′ < j.By construction, we are either moving z out of A j ′ to A j ′ +1 , or moving x into A j ′ +1 from out of A j ′ .In both cases, z / ∈ A j ′ +1 and x ∈ A j ′ +1 .As a result, x ∈ A j ′ +1 − A j+1 , z ∈ A j+1 − A j ′ +1 , but z < x.As A j+1 and A j ′ +1 are weakly separated, we must have max A j+1 − A j ′ +1 < min A j ′ +1 − A j+1 .But j ′ < j, there cannot possibly be a monotone path from A j ′ +1 to A j+1 .Contradiction.Thus, this construction results in a reduced word i as desired.
Consequently, we say that P k (i) is the monotone weakly separated path associated to i ∈ R(w).Clearly, if P k (i) consists of N + 1 subsets from A 0 to A N , then there are exactly N s k 's in i. Proposition 2.3 allows us to translate the problem of finding the maximal number of s k 's in R(w) to finding the longest monotone weakly separated path that starts at {1, 2, . . ., k}.

Repeatable patterns and arc diagrams
This section introduces arc diagrams and repeatable patterns, and shows: We give a quick remark about the above definition of D(P ).Note that, for each pair {i, j}, if there exists a ∈ [N ] such that {i, j} = (A a−1 − A a ) ∪ (A a − A a−1 ), then such an index a is unique: the equation implies that in the corresponding wiring diagram, the a th s k -crossing from the left is a crossing between wire i and wire j, and any two wires intersect exactly once in a wiring diagram of a reduced word of w 0 .(See Figures 1 and 2  Given an arc diagram, we put each vertex i ∈ [n] of the diagram at the point (i, 0) ∈ R 2 and draw each edge (i, j) as a semicircle on the upper-half plane.Imagine that each semicircular curve in the arc diagram has weight 1.For each curve, assume that the weight is distributed uniformly across the horizontal length (not the curve length).For example, if an edge e joins (1, 0) and (4, 0), then there is weight 2/3 above [2,4] coming from e.If we have a finite collection of curves, define the total weight as the sum of individual weights.Note that M(k, n) is the maximum possible total weight in an arc diagram.Proposition 3.2.For any positive integers k and n with 1 ≤ k ≤ n − 1, we have Proof.Let P be a monotone weakly separated path from A 0 = {1, 2, . . ., k} to A N = {n − k + 1, . . ., n}.Perform the following auxiliary decoration using k different colors col 1 , col 2 , . . ., col k .First, we color 1, 2, . . ., k in A 0 so that i gets color col i .Each time we go from A j to A j+1 , if we have A j+1 = A j ∪ {y} − {x}, then color y in A j+1 the same color as x in A j .Also color the semicircle connecting (x, 0) and (y, 0) with the same color that we used to color x ∈ A j and y ∈ A j+1 .For each number z ∈ A j ∩ A j+1 , color z in A j+1 the same color as we color z in A j .See Figure 3 for an example.As a result of the decoration, the k numbers in A N are now colored with k different colors.There is a permutation σ ∈ S k such that for each i ∈ [k], the number n − k + σ(i) has color col i .Now there are k continuous curves γ 1 , γ 2 , . . ., γ k such that γ i has endpoints (i, 0) and (n − k + σ(i), 0), and has color col i from one end to the other.
From the coloring argument above, there are at most k pieces of different semicircles in the vertical strip above [i, i + 1] for each i ∈ [n − 1].Furthermore, for each t ∈ Z ≥1 , there exist at most t pieces that come from semicircles whose diameters are exactly t.Each such piece contributes the weight of 1/t.Therefore, the weight of the arc diagram above [i, i + 1] is at most 1 + 1/2 + 1/2 + 1/3 + 1/3 + 1/3 + • • • , and hence the total weight is at most the right-hand side of (1).
By estimating the summation in Proposition 3.2, we obtain the following corollary.
which is slightly stronger than O( √ k) • n.Our pseudoline setting is more general.We do not know if the upper bound (2) of Pach-Steiger-Szemerédi holds for M(k, n) or not.This might be an interesting direction to further investigate.
The upper bound in Proposition 3.2 can be slightly improved as follows.First, note that the number of unit segments [i, i + 1] is actually n − 1 (instead of n).Second, note that the segments [i, i + 1] near the ends (vertices (1, 0) and (n, 0)) should have smaller upper bounds because there are fewer than k pieces of curve above those segments.This improvement leads to sharp results when k is small.For k = 1, we find that 2 n − 3. We will see in the next subsection that these bounds in the cases k = 1 and k = 2 are sharp.
Things get more interesting when k = 2.In the previous subsection, we have also seen that M(2, n) ≤ 3 2 n − 3, for each n ≥ 3. Now we claim that the inequality is in fact an equality by giving explicit constructions using the idea of repeatable patterns.
In the definition below, if S is a finite set of integers and t is an integer, we write S + t to denote {s + t : s ∈ S}.Definition 3.5.Let L and d be positive integers.A repeatable pattern R with parameters (L, d) is a monotone weakly separated path R = (A 0 , A 1 , . . ., A L ) which satisfies the following conditions: and • for any positive integer m, the sequence Any finite prefix of the infinite sequence above is a monotone weakly separated path.Theorem 3.7.For each positive integer n ≥ 3, we have M(2, n) = 3  2 n − 3. Proof.The first 3  2 n −2 terms of the infinite sequence in the previous example is a monotone weakly separated path from {1, 2} to {n − 1, n}.Combine this construction with the upper bound for M(2, n) above to finish.
For general k, the existence of a repeatable pattern yields a lower bound for M(k, n).In Section 4, we will see that for every positive integer k, the limit c k := lim n→∞ exists.The existence of a repeatable pattern R with parameters (L, d) immediately yields the lower bound c k ≥ L d .It turns out, as Theorem 4.16 below shows, that c k = max R L/d, where the maximization is over all repeatable patterns R = (A 0 , A 1 , . . ., A L ) with |A 0 | = k, and the ratio L/d depends on the repeatable pattern R. In particular, the maximum (not just the supremum) exists.

3.3.
Arc diagrams when k = 3, part i: decomposition algorithm.We use the "decomposition algorithm" (Algorithm 3.9) below to break the interval [1, n] in the arc diagram into smaller non-overlapping intervals in a way that we can prove upper bounds of weights for these intervals separately.
Suppose that an arc diagram coming from a monotone weakly separated path from {1, 2, 3} to {n − 2, n − 1, n} is given.Write wt to denote the weight function, so that if I ⊆ [1, n] is an interval, then wt(I) is the weight above I.We also define the weight limit function wtlim as follows.Declare wtlim The weight limit function is also defined to satisfy the usual additivity condition: wtlim Observe that for a unit interval [i, i + 1] ⊆ [1, n] (with i ∈ Z) to exceed its weight limit, the only possible way is to have wt , and [n − 1, n] never exceed their weight limits.These observations follow from the definition.
The "decomposition algorithm" (Algorithm 3.9) is given below.The input of the algorithm is an arc diagram D that comes from a monotone weakly separated path from {1, 2, 3} to {n − 2, n − 1, n}.The output of the algorithm is the collection F = F (D) of intervals with non-overlapping interiors.
Begin with an empty collection F = ∅.

If for every
then output F (D) = ∅, and we finish the algorithm.
On the other hand, if some unit interval exceeds its weight limit, then write where where 1, ℓ 0 , h 1 , ℓ 1 , . . ., h m , n is a strictly increasing sequence of positive integers such that every unit interval in any L i has weight under or equal to its weight limit, and every unit interval in any H i has weight exceeding its weight limit.
For i = 1, 2, . . ., m: consider the interval H i .We know from Proposition 3.16 (proved below) that There is a semicircle connecting (a − 1, 0) and (a, 0), but there is no semicircle connecting (a + 2, 0) and There is a semicircle connecting (a − 1, 0) and (a, 0), and also there is a semicircle connecting (a + 2, 0) and There is a semicircle connecting (a − 1, 0) and (a, 0), but there is no semicircle connecting (a + 1, 0) and There is a semicircle connecting (a − 1, 0) and (a, 0), and also there is a semicircle connecting (a + 1, 0) and Output F (D) = F , and we finish the algorithm.The proof of Theorem 3.10 will be given in Section 3.4.
Corollary 3.11.For any positive integer n ≥ 6, we have Proof.Take any arc diagram D of a monotone weakly separated path from {1, 2, 3} to {n − 2, n − 1, n} with the maximum possible weight so that M(3, n) = wt([1, n]).From Theorem 3.10, we have Before proving the proposition, we show a lemma about black edges.Lemma 3.15.Let P = (A 0 , A 1 , . . ., A N ) and C 1 , C 2 , . . ., C N be defined as in Definition 3.12.Suppose that j is a positive integer such that 1 ≤ j ≤ N − 1. Write C j = {a, b} and C j+1 = {c, d}, where a < b and c < d.Then one of the following six outcomes happens: To visualize Lemma 3.15, consider Figure 6.If C j and C j+1 are curves from the Csequence, then they must follow one of the three configurations shown in the figure.(For p q r (p < q < r) p q r s (p < q < r < s) p q r s (p < q < r < s) (p < q < r) p q r (p < q < r) p q (p < q) p q r s (p < q < r < s) Figure 7.If C j and C j+1 are curves from the C-sequence, then they cannot follow any of these four forbidden configurations.
each configuration, there are two choices for which curve is C j and which curve is C j+1 , so there are six outcomes in total as listed in Lemma 3.15.)Equivalently, Lemma 3.15 states that the four configurations shown in Figure 7 cannot represent two consecutive curves in the C-sequence.
Proof of Lemma 3.15.Suppose, for the sake of contradiction, that none of the six outcomes happens.Then either a = c, or b = d, or b < c, or d < a. Recall that we obtain A j from A j−1 by removing a and adding b, and we obtain A j+1 from A j by removing c and adding d.If the first case, a = c, happens, then we would need two copies of a in the set A j−1 , a contradiction.Similarly, if the second case, b = d, happens, then we would need two copies of b in the set A j+1 , a contradiction.If the third case, b < c, or the fourth case, d < a, happens, then there would be an element x ∈ [n], different from a, b, c, d, such that A j−1 = {x, a, c} and A j+1 = {x, b, d}.Note that A j−1 and A j+1 are not weakly separated, a contradiction.Proof of Proposition 3.14.For any pair of different nodes i, j ∈ [n], we know that the pair is connected by at most one black edge.It suffices to show that for each new red edge added with endpoints i and j, the nodes i and j have not already had a black edge or a red edge connecting them.
Recall that the red edges are added in N − 1 different steps.Consider the red edges added in the t th step.Following Definition 3.12, we consider the pairs C t = {a, b} and C t+1 = {c, d}, with a < b and c < d.Let χ t and χ t+1 denote the crossings in the wiring diagram which correspond to C t and C t+1 , respectively.We claim that the red edges constructed in this step correspond to crossings which happen between χ t and χ t+1 (on different levels: s k ′ with k ′ = 3).With this claim, the proposition is proved, because we are selecting different crossings in each of the N − 1 steps.
To establish the claim, we use Lemma 3.15.The pairs C t and C t+1 exhibit one of the six outcomes as listed in the lemma.Consider the outcome (iii) (and one argues similarly for the other outcomes).Note that wires a and b cross at χ t , wires c and d cross at χ t+1 , and no other crossings can happen on the third level.This means that wires a and d must cross somewhere between χ t and χ t+1 on the (k ′ ) th level for some k ′ ≥ 4. Similarly, wires b and c must cross somewhere between χ t and χ t+1 as well on either the first or the second level.
The decomposition algorithm (Algorithm 3.9) uses the result that in D(P ) the length of each µ(H i ) is at most 4, which follows from the following proposition.Proposition 3.16.In D(P ), there is no index i such that all nine (black) edges {i, i + 1}, {i + 1, i + 2}, {i + 2, i + 3}, {i + 3, i + 4}, {i + 4, i + 5}, {i, i + 2}, {i + 1, i + 3}, {i + 2, i + 4}, and {i + 3, i + 5} appear.(See Figure 8 for an illustration.) Before proceeding to the proof, we give a quick explanation here how this proposition implies that each µ(H i ) in Algorithm 3.9 is at most 4. If µ(H i ) is at least 5, then there must be an index i for which the five intervals and thus arcs {i + j − 1, i + j} exist in D(P ) for j ∈ [5], and arcs {i + j − 2, i + j} exist in D(P ) for j ∈ [6].These many arcs would contain the configuration as shown in Figure 8.
Proof of Proposition 3.16.Suppose, for the sake of contradiction, that there is such an index i.Since there are at most three pieces of curves above each unit interval, we know that there are no more black edges above the segment [i + 1, i + 4].Above [i, i + 1], we now have two black curves.Thus, there can be at most one more black curve whose right endpoint is i + 1.Call this curve, if it exists, ζ.Similarly, there is at most one curve connecting i + 4 and some j > i + 5.Call this curve, if it exists, µ.
Call the nine curves in the proposition α, β, γ, δ, ε, η, θ, κ, λ, in the same order as displayed in the proposition statement.These nine curves, together with ζ and µ, are all black curves above the segment [i, i + 5].Recall that we have the C-sequence C 1 , C 2 , . . ., C N which lists all the black curves in BiD(P ).We will consider which two curves are consecutive in this sequence.
Consider the curve β.From Lemma 3.15, we know that none of δ, ε, η, θ, λ, and (µ) can be consecutive to β in the C-sequence.(The parentheses about µ in the previous sentence serve as a reminder that perhaps µ does not exist.)Moreover, α and β cannot be consecutive edges in the C-sequence.Otherwise, there would be a red edge connecting i and i + 2 in BiD(P ), contradicting Proposition 3.14 as the black curve η is already connecting i and i + 2. Similarly, γ cannot be a neighbor of β.
There are only two choices left for the neighbors of β: (ζ) and κ.If ζ does exist, then β cannot be C 1 (the starting curve in the C-sequence).We know β cannot be C N either.Thus, β must be adjacent to both ζ and κ.If ζ does not exist, β must be adjacent to κ.In either case, we know β and κ are neighbors in the C-sequence, and thus there must be a red curve connecting i + 1 and i + 4 corresponding to a crossing between β and κ.
However, the same reasoning implies that θ and δ must be adjacent in the C-sequence as well.There must be another red curve connecting i + 1 and i + 4 corresponding to a crossing between θ and δ.This contradicts Proposition 3.14.Lemma 3.17.Suppose that i is an integer with 4 ≤ i ≤ n − 4. Suppose that in D(P ), there are indices i ′ and i ′′ with i ′ ≤ i − 3 and i ′′ ≥ i + 4 such that the edges {i − 1, i}, {i, i + 1}, {i + 1, i + 2}, {i − 1, i + 1}, {i, i + 2}, {i ′ , i}, and {i + 1, i ′′ } appear in the diagram.Let α denote the curve connecting i − 1 and i.Let δ denote the curve connecting i + 1 and i + 2. Let (β) and γ be the curves whose right endpoints are i − 1.Let (ε) and η be the curves whose left endpoints are i + 2.
Then either • the neighbors of α in the C-sequence are (β) and γ, or • the neighbors of δ in the C-sequence are (ε) and η.
Once again, the parentheses about β and ε in the lemma above mean "if it exists".In the case i = 4, there is only one curve whose right endpoint is i − 1 = 3.We denote that curve by γ, and β is non-existent.Similarly, ε is non-existent if and only if i = n − 4.
Proof of Lemma 3.17.Let ξ denote the curve connecting i − 1 and i + 1, and let ζ denote the curve connecting i and i + 2. Suppose that the neighbors of α are not (β) and γ.Then by arc diagram chasing, ζ must be a neighbor of α.Therefore, in BiD(P ), we have a red curve connecting i − 1 and i + 2 corresponding to a crossing between the crossings of α and ζ.This shows that ξ cannot be a neighbor of δ.Thus, the neighbors of δ are (ε) and η.
Lemmas 3.17 and 3.18 deal with the situation where we encounter one unit interval of weight 2. When there are two consecutive unit intervals of weight 2, arc diagram chasing gives a result similar to Lemma 3.17 as follows.
Then both of the following are true: • the neighbors of α are (β) and γ.
A degenerate version of Lemma 3.19 is Lemma 3.20 below.Given an arc diagram D(P ), we have seen in Algorithm 3.9 that we can decompose the interval [ where every unit interval in L i does not exceed its weight limit, and every unit interval in H i has weight 2. (In Algorithm 3.9, we defined this decomposition for arc diagrams with at least one unit interval with weight 2. Here, we define it for any D(P ).For arc diagrams in which every unit interval does not exceed its weight limit, we can simply let m = 0 and The following proposition gives some restrictions on the lengths of the intervals L 0 , H 1 , L 1 , . . ., H m , L m .
Proof of Theorem 3.10(a).In Algorithm 3.9, we note that each interval we add to F (D) contains either one or two unit intervals from m i=0 L i .More precisely, Case 3.3 and Case 4.3 in the algorithm are the only two cases that give intervals with two unit intervals from m i=0 L i .Let F and F ′ be two different intervals in F (D). From Proposition 3.21(c), we see that if either F or F ′ does not come from these two cases, then µ(F ∩ F ′ ) = 0.The only potentially problematic case is when both F and F ′ come from Case 3.3 or Case 4.3 and the overlap F ∩ F ′ has length 1.We will show that this is not possible.
After drawing these eight edges, we observe that there are already three pieces of curve above [a + 1, a + 2] and another three pieces above [a + 5, a + 6].At the moment, there are only two pieces of curve above [a + 2, a + 3].As no more curve can be added above [a + 1, a + 2], there must be another curve γ whose left endpoint is a + 2. The right endpoint must be either a+ 4 or a+ 5.However, if the right endpoint were a+ 4, then wt([a+ 2, a+ 3]) would be 2, a contradiction.This forces γ to connect a + 2 and a + 5. Now, there are three pieces of curves above [a + 2, a + 3], and also three pieces above [a + 4, a + 5].
Now consider [a + 3, a + 4].At the moment, there is only one piece of curve above it, and so we need two more pieces.On the other hand, no more curves can be added above [a + 1, a + 3] or above [a + 4, a + 6].This gives a contradiction.We have finished the proof of Theorem 3.10(a).
We have shown that the intervals in the collection F (D) do not overlap.Next, we show that each interval has weight under or equal to its weight limit.
Proof of Theorem 3.10(b).Let I be an arbitrary interval in F (D).
Similarly, we find that a ≤ n − 5 and there is an index a ′′ ≥ a + 5 such that there is a curve connecting a + 2 and a ′′ .Note that we now have the assumptions of Lemma 3.19 (with a, a ′ , a ′′ here playing the roles of i, i ′ , i ′′ in the lemma).Following the notations in the lemma, let δ denote the curve connecting a − 1 and a.Let the curves whose right endpoints are a − 1 be (ε) and η.By Lemma 3.19, we have that the neighbors of δ are (ε) and η.
Let κ denote the curve connecting a ′ and a.We have that the left endpoints of κ, (ε), and η are all distinct.(Otherwise, by a little bit of arc diagram chasing, there would be a red curve with the same endpoints as κ in BiD(P ), contradicting Proposition 3.14.)We now check the weight wt(I).
If a = 4, the curve ε is non-existent.The curve κ connects 1 and 4. The curve η connects 2 and 3. We have wt(I) = wt([2, 5]) = 31 6 = wtlim( [2,5]).If a ≥ 5, then ε exists.Suppose that the lengths of κ, ε, η are u + 1, v, w, respectively.Since the left endpoints of the three curves are all distinct, we have that u, v, w are distinct positive integers.It is straightforward to compute wt(I) = 2 u+1 + 1 v + 1 w + 7 2 .Note that the weight limit is wtlim(I) = 11  2 .It is a pleasant exercise to show that for distinct positive integers u, v, w, we have the inequality which we will leave to the reader.This shows that wt(I) ≤ wtlim(I).If n = 6, then a = 3 and the edges {1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {2, 4}, and {3, 5} appear in D(P ).This directly contradicts Lemma 3.18(c).Assume now that n ≥ 7. If a = 3, then we are in the situation of Lemma 3.18(a).By using an argument similar to one in Case 3.3, we find that [3,6] is under its weight limit.The case a = n − 3 is analogous.Now assume 4 ≤ a ≤ n − 4. We see that there exist indices a ′ ≤ a − 3 and a ′′ ≥ a + 4 such that there are edges {a ′ , a} and {a + 1, a ′′ } in D(P ).We are in the situation of Lemma 3.17 (with a, a ′ , a ′′ here playing the roles of i, i ′ , i ′′ in the lemma).Following notations in the lemma, let us denote the curve connecting a−1 and a by α, and denote the curve connecting a + 1 and a + 2 by δ.Let the curves whose right endpoints are a − 1 be (β) and γ.Let the curves whose left endpoints are a + 2 be (ε) and η.Lemma 3.17 says that either the neighbors of α are (β) and γ, or the neighbors of δ are (ε) and η.
If the neighbors of α are (β) and γ, then by an argument similar to one in Case 3.3, we find that [a − 2, a + 1] has weight under or equal to its weight limit.On the other hand, if the neighbors of δ are (ε) and η, then the weight of [a, a + 3] is under or equal to its weight limit.We have finished the proof.

3.5.
Repeatable patterns for k = 3.We now establish the lower bound on M(3, n) by giving explicit repeatable patterns.Definition 3.22.Let P = (A 0 , A 1 , . . ., A N ) and Q = (B 0 , B 1 , . . ., B M ) be sequences of k-element sets of integers.Suppose that there exists an integer t such that A N = B 0 + t.Then we define the concatenation of P and Q to be the sequence Therefore, a repeatable pattern R is a monotone weakly separated path such that for any positive integer m, the m th -concatenation power R * R * • • • * R of R is well-defined and is also a monotone weakly separated path.Now we construct optimal monotone weakly separated paths as follows.We define: It is straightforward to check that P is a repeatable pattern with parameters (L, d) = (11,6).
For each integer n ≥ 10, define P n := P * P n−6 .It is also straightforward to check that for every integer n ∈ Z ≥4 , the sequence P n is a monotone weakly separated path from {1, 2, 3} to {n−2, n−1, n} with 11  6 n −4 terms.Combining these constructions with Corollary 3.11, we have proved the following theorem.We end this section with a remark about the general formula for M(k, n).Considering the formulas for k = 1, 2, 3, one might conjecture that in general there exist real numbers a k and b k for which the formula M(k, n) = ⌈a k n + b k ⌉ holds for every n ≥ k+1.Unfortunately, from our computational results, we can show, for example by Fourier-Motzkin Elimination, that there cannot be such a formula when k = 4.The formula for M(4, n) has to be somewhat more complicated.

Periodicity for M(k, n)
Fix a positive integer k throughout this section.Define the constant Our main goal of this section is to show that for any k, c k exists, is rational and can be achieved by repeatable patterns.
4.1.Existence of c k .In Section 3, c k was explicitly computed for k = 1, 2, 3. To be precise, , and c 3 = 11 6 .Theorem 4.1 shows that this limit exists for all k ∈ N. Theorem 4.1.The limit c k exists for any k ∈ N.
The proof rests on the following lemma.
Proof.We prove part (b); part (a) follows since M(k, m) is nonnegative.It follows from the basic theory of Coxeter groups (see [3]) that the longest permutation w 0,n in S n is less than the longest permutation w 0,n+m in S n+m in the weak Bruhat order, if we view S n ⊂ S n+m as those permutations fixing n + 1, . . ., n + m pointwise.Thus we can write we may write u = u ′ • w 0,m , again with S m ⊂ S n+m embedded in the standard way, and again with lengths adding.For any reduced words i, i ′ of w 0,n and w 0,m and a reduced word j for u ′ , this implies that the concatenation iji ′ is a reduced word for w 0,n+m .In particular, by choosing i, i ′ to each maximize the occurrences of s k , we have: for all k.
Proof of Theorem 4.1.By Lemma 4.2(b), M(k, n) is subadditive function of n, so by Fekete's Lemma, the desired limit 4.2.Asymptotic equivalence with the pseudoline k-set problem.As discussed in Section 1.1, in the context of the "k-set problem" it is natural to consider a related problem, namely the maximization of the total number of appearances of s k and s n−k in a reduced word.Let M(k, n) be the maximal total number of appearances of s k and s n−k in the reduced words from S n .The following theorem shows that the same slopes c k arise in this version.
Theorem 4.3.For any k ∈ N, the following limit exists and is given by Proof.Consider any reduced word and its wiring diagram.We say that a wire has type (i, j, ±) if its highest position is i and its lowest position is j, and + (−) means that the highest position is to the left (right) of the lowest position.Note that no two wires share the same type (otherwise they should intersect at least twice, but our word is reduced).Let a be the number of wires which were at some moment at one of the k highest levels, and let b be the number of wires which were at some moment at one of the k lowest levels.At most 2k 2 wires are counted by both a and b, so a + b ≤ n + 2k 2 .Note that the number of s k depends only on these a wires and the number of s n−k depends only on these b wires.Hence, the number of appearances of s k and s n−k in this reduced word is at most We introduce the new tool of generalized wiring diagrams; these are certain wiring diagrams with infinitely many wires which are sometimes allowed to "go to infinity".Intuitively, these diagrams allow us to reason about wiring diagrams for all n ∈ N simultaneously.A generalized wiring diagram is reduced if no pair of wires cross more than once.
To clarify, when two wires at level h and h + 1 cross as in the usual wiring diagrams, we say that they cross at level h.And when a wire a at level h goes to infinity, we say that this wire falls, and it creates intersections at levels h, h + 1, . .., while the wires which were at levels h + 1, h + 2, . . .before wire a falls go to levels h, h + 1, . . .respectively, so that at every timestamp, there is a wire at each level indexed by positive integers.Proof.Let m(k, n) be the maximum number of intersections on level k among W(k, n).Then we have m(k, n) ≥ M(k, n) since a reduced word in S n , which can be viewed as a wiring diagram, is an instance of W(k, n).Now for W ∈ W(k, n), at each timestamp t, let A (t) ⊂ [n]   k be the set of wires that occupy the first k levels.Let (A 0 , A 1 , . . ., A N ) be the sequence of A (t) 's where A i = A (ti) if step t i creates a crossing at level k.With the same reasoning as in Proposition 2.3, we show that (A 0 , A 1 , . . ., A N ) is a monotone weakly separated path.Since W is reduced, to go from A i to A i+1 , we take away some wire a and add in some wire b with a < b and this shows monotonicity.Then for i < j, if there exists b ∈ A i \ A j , a ∈ A j \ A i with a < b, then wire a must cross wire b (strictly) prior to step t i and also (strictly) between t i and t j , contradicting W being reduced.This shows that (A 0 , A 1 , . . ., A N ) is weakly separated.Here, N is the number of crossings at level k in W .By Proposition 2.3, there exists a reduced word in S n with N copies of s k .Thus m(k, n) ≤ M(k, n) as desired.
We now consider a particularly nice set of reduced generalized wiring diagrams.We remark that (S1) implies that in a simple diagram, wire a and wire a + 1 can only intersect at level k.Also note that (S1) needs to be considered when the wire a is falling to infinity.In particular, this means that in a simple diagram, the first step can only be an intersection between wires k and k + 1, or wire k falling to infinity.
We write W(k, n) for the set of simple reduced generalized wiring diagrams from W(k, n).And write W(k) = n>k W(k, n) for the set of simple reduced generalized wiring diagrams for fixed k.Proof.Let W ∈ W(k, n) and let t be the first timestamp where W violates some condition in Definition 4.7.If condition (S1) is violated by wires a < b crossing normally (not during while a is going to infinity), we simply remove this intersection to obtain W .The new diagram W is still reduced, because in order for some wire c to intersect the new wire a (or b) twice without intersecting the previous a and b twice, c must be between a and b.However, (S1) says that c has already fallen, so there are no such possibilities.
If condition (S1) is violated by wires a < b intersecting as a goes to infinity, we make sure that wire b is the "first" violation of condition (S1), i.e. the highest (with the smallest level).We expand this step of a going to infinity by letting wire a intersect those wires below a and above b at this timestamp first, and then going to infinity.Next, as above, we uncross the intersection between wires a and b by letting wire b go to infinity instead while wire a in W takes on the role of wire b in W after this timestamp.The same argument in the last paragraph shows that W is reduced.At the same time, the number of intersections at level k stays unchanged.
If condition (S2) is violated with wire a, then we assume that at time t, wire a crosses with b k at level h where a < b k ; moreover, wire a has already intersected with b 1 , . . ., b k−1 that are larger than a.Let W be obtained from W by replacing the intersection at time t with wire a going to infinity.By reducedness, at time t, wires b 1 , . . ., b k−1 must be at a higher (smaller) level than wire a, so h ≥ k.This says that the number of intersections at level k is the same in W .If W becomes not reduced, then there must be some wire c < a which is at level ≥ h + 2 at time t so that it intersects a the second time in W at time t.However, since c < b 1 , . . ., b k and c is at a lower (greater in value) level at time t, by condition (S2) and the minimality of t, wire c must have fallen already.As a result, W stays reduced.
We can continue the above process so that the end result W is simple.
For a diagram W ∈ W(k, n) and a timestamp t, we can associate a permutation π ∈ S ∞ to it that records the positions of the non-fallen wires.To be precise, if a 1 < a 2 < • • • are the labels of the non-fallen wires at time t, then a π (t) (h) is at level h for h = 1, 2, . ... Here, the infinite symmetric group S ∞ is the set of bijections on Z >0 with all but finitely many fixed points.We also let f (t) W = f (t) be the number of fallen wires of W at timestamp t and let κ (t) W = κ (t) be the number of intersections at level k that have happened.In particular, we always start with f (0) = 0, κ (0) = 0 and π (0) = id.Lemma 4.9.A simple reduced generalized wiring diagram W can be uniquely encoded by the sequence {(f W )} t defined above.In other words, given a sequence {(f (t) , κ (t) , π (t) )} t , there is at most one W ∈ W(k) such that {(f Proof.Fix {(f (t) , κ (t) , π (t) )} t and we will recover W ∈ W(k) step by step.Note that there is a lot of redundancy in this encoding, as the information from f and π are almost sufficient.
At step t > 0, if f (t) = f (t−1) meaning no wires fall, we simply apply a crossing at level h if π (t) = π (t−1) s h .The critical case is that f (t) = f (t−1) + 1 meaning that a wire falls at this step.Note that from a permutation π (t−1) , it is possible that deleting an entry (and flattening the permutation) will result in the same permutation as deleting another entry.For example, if π (t−1) = id, deleting any entry and flattening the values to 1, 2, . . .will result in π (t) = id.In such cases, to uniquely reconstruct a simple diagram W , the conditions in Definition 4.7 become important.
Suppose that at time t, letting the wire at level a go to infinity will result in the permutation π (t) , i.e. deleting the entry at index a of π (t−1) and flattening the values to 1, 2, . . .give us π (t) , and letting the wire at level b > a go to infinity will result in the same permutation π (t) .Choose such minimal a and maximal b.We analyze the permutation u = π (t−1) ∈ S ∞ .
First, for every positive integer i such that i < a or i > b, u(i) must not lie in between u(a) and u(b).Secondly, if u(a) > u(a + 1), then letting this wire at level a go to infinity results in a double crossing with the wire at level a + 1 at this timestamp.Thus, u(a) < u(a + 1).By comparing the two permutations obtained from u by deleting index a and b respectively, we must have u(a + 1) < u(a + 2).This further implies u(a + 2) < u(a + 3) and so on.Thus, u(a) < u(a + 1) < • • • < u(b).It is now clear that deleting any index between a and b from u results in the same permutation π (t) , and finally we claim that at most one choice is possible.For a ≤ c ≤ b − 1, if wire c falls at time t, an intersection at level c between this wire and the wire at level c + 1 is created.By the arguments above, all the wires with labels between these two must have fallen (since they cannot exist before level a or after level b), and by condition (S1) for simple diagrams, c = k.Thus, if b ≤ k, only wire b is allowed to fall; if a ≤ k < b, only wire b can fall if κ (t) = κ (t−1) and only wire k can fall if κ (t) = κ (t−1) + 1; and the case a > k cannot result in any valid diagrams.W at all timestamps t across all W ∈ W(k).In this section, we will show that T k is finite and resolve the rationality of c k .
For a simple reduced generalized wiring diagram W ∈ W(k), let N t (W ) be the set of non-fallen wires at timestamp t and let E t (W ) ⊂ N t (w) be the set of non-fallen wires at timestamp t that were on the first k levels at or before timestamp t.Lemma 4.11.For W ∈ W(k) and t, any wire a ∈ N t (W ) \ E t (W ) does not intersect wires with larger labels at time t or earlier.
Proof.Assume the opposite and let a ∈ N t (W ) \ E t (W ) intersect some wire b > a at time t or earlier.Note that the condition a ∈ N t (W ) \ E t (W ) means that wire a has not yet fallen but it has never been to the first k levels.Choose t to be minimal and then choose b to be minimal among all such wires.The minimality of t means that wire a and wire b intersect at time t and let h > k be the level of this intersection.
Each wire i strictly between a and b must intersect a or b at some time before t.If such a wire i intersects a at time t ′ < t, then the minimality of b is violated.So such a wire i must not intersect a and must intersect b, at some timestamp t ′ < t.If it does not intersect b by falling, then i ∈ N t ′ (W ) \ E t ′ (W ) since it has never been to level k or above, and the minimality of t is violated.As a result, all such wires i have fallen at time t, and since h > k, condition (S1) is violated.Lemma 4.12.For W ∈ W(k) and t, |E t (W )| ≤ k 2 + 2k.
Proof.Assume the opposite that |E t (W )| ≥ k 2 + 2k + 1.Let a 1 < a 2 < • • • be the set of wires that have not fallen at timestamp t and let Since the wire a z has been to the first k levels, there are at most k − 1 wires from a 1 , . . ., a z1 that do not intersect a z .This means |A| ≥ (z − 1) Since |A| ≥ k(k + 1) + 1, the Erdős-Szekeres Theorem says that we have either k wires from A which intersect pairwise, or k + 1 wires from A where no wires intersect.In the first case where a set B ⊂ A of wires intersect pairwise with |B| ≥ k, the smallest wire from B then needs to intersect k wires with larger labels, including k − 1 wires from B and a z , contradicting (S2).In the second case where a set B ⊂ A of wires have no intersections with |B| ≥ k + 1, the largest wire a i from B can never visit the first k levels, contradicting a i ∈ E t (W ).If a i / ∈ E t (W ), meaning that a i has not been to the first k levels, then by Lemma 4.11, any a j with j > i does not intersect a i so has not been to the first k levels either.This means that E t (W ) = {a 1 , a 2 , . . ., a z } and that code(π) i = 0 for i > z.At the same time, by (S2), each a i with i ≤ z can only intersect at most k − 1 wires with larger labels.So code(π) i ∈ {0, 1, . . ., k − 1} for i ∈ {1, 2, . . ., z}.As a result, the total number of possible permutations is bounded by A piece P is a segment of a generalized wiring diagram W containing the single move (adjacent crossing or falling wire) occurring in W at some time t together with the information of the permutations π − P := π (t−1) W and π + P := π (t) W .The piece P is simple (with respect to k) if it can be obtained from a simple diagram W ∈ W(k).A series P 1 , . . ., P r of pieces such that π + Pi = π − Pi+1 for all i may be concatenated into a pattern Q = P 1 + • • • + P r , which is the segment of a generalized wiring diagram obtained by drawing P 1 , . . ., P r next to each other, together with the information of π − Q := π − P1 and π + Q := π + Pr .The following proposition shows that being simple is a local property of a generalized wiring diagram: a diagram is simple if and only if all of its constituent pieces are simple.Proposition 4.14.Let Q = P 1 + • • • + P r , where each piece P i is simple with respect to k and where π − P1 = id, then Q ∈ W(k).Proof.First note that Q, viewed as a generalized wiring diagram, is reduced, since each piece, by virtue of coming from a reduced diagram and carrying with it the permutations π − and π + clearly preserves reducedness when concatenated.The condition (S1) from Definition 4.7 is also clearly preserved when we apply each piece, since it is equivalent to the condition that no simple piece swaps two wires with adjacent labels, or has a wire fall from a level other than k when the wire below it has label one larger, where we read labels from π − .Finally, to check condition (S2), we can just check that for each index i and time t, Q (i)}| < k.This is because, since Q is reduced, none of the wires with label higher than a π (t) Q (i) which have crossed this wire can have fallen at or before time t, so We call a pattern Q = P 1 + • • • + P r simple (with respect to k) if all of its constituent pieces P i are simple with respect to k.By Proposition 4.14, this does not conflict with our earlier definition of simple diagrams.
In particular, c k is rational.
Proof.We first show that c k ≥ max f ∈N,π∈T k K(f,π) f . Let (f 0 , π 0 ) be such that K(f 0 , π 0 )/f 0 achieves the maximum, and let Q be a simple pattern realizing K(f 0 , π 0 ) crossings at level k, with π . By Proposition 4.14, we have D m ∈ W(k) since R and Q simple.By Lemma 4.12, and since Q has f 0 fallen wires, we have D m ∈ W(k, k 2 + 2k + mf 0 ).The number of intersections on level k of D m is the number r in R, plus mK(f 0 , π 0 ).We conclude We now prove the upper bound on c k .Write M for the maximum on the right-hand side of (3), and let W be any diagram from W(k).Express W uniquely as a sum of its constituent simple pieces: W fallen wires and κ (r) = κ (r) W crossings at level k.Let i ≤ j be a closest pair of indices such that π − Pi = π + Pj , and write π for this common permutation.Consider the encodings (f (i−1) , κ (i−1) , π) and (f (j) , κ (j) , π) immediately before and after the pieces P i , P j respectively.Since π by removing the piece P i +• • •+P j and W ′ ∈ W(k) by Proposition 4.14.This new diagram has f (r) − (f (j) − f (i−1) ) fallen wires and κ (r) − (κ (j) − κ (i−1) ) crossings at level k.By construction, we have Since W ′ remains simple, we can iteratively apply this procedure until we reach a diagram W 0 with all permutations distinct.By Corollary 4.13, there are finitely many such diagrams, so there is some maximum possible number Dividing by k 2 + 2k + f (r) and letting f (r) → ∞, we obtain c k ≤ M, as desired.
Corollary 4.17.The optimal density c k can be achieved by a repeatable pattern, in the sense of Section 3.
Proof.Let (f 0 , π 0 ) achieve the maximum in the right-hand side of (3), and let Q be the diagram realizing f 0 , π 0 as in the proof of Theorem 4.16, which, by the theorem, achieves the density c k .Taking the labels of the wires occupying the top k levels in a reduced generalized wiring diagram gives a monotone weakly separated path by the same reasoning as in Proposition 2.3, and applying this operation to Q gives the desired repeatable pattern, by construction.Proof.Let M(k, n, π) be the maximal number of intersections on level k among diagrams from It follows from the proof of Theorem 4.16 that p k (n, π) is a bounded function of n and π.Furthermore, since c k is rational, this function takes rational values of bounded denominator, and thus p k (n, π) attains only finitely many different values.Thus we may find a < b ∈ N so that p k (a, π) = p k (b, π) for all π ∈ T k , since T k is finite by Corollary 4.13.Now, it is clear that p k (n, π) depends only on {p k (n − 1, σ)} σ∈T k .Thus we have that p k (n + b − a, π) = p k (n, π) for all n ≥ a and all π ∈ T k .In particular, for n sufficiently large, p k (n) = max π∈T k p k (n, π) is periodic in n.

The minimization problem for finite Coxeter groups
In this section, we investigate a related question: for the longest element w 0 of a finite Coxeter group W , what is the minimum number of appearances of a generator s i in R(w 0 ), the set of reduced words for w 0 .This question is very easy in type A n−1 where W ≃ S n .Namely, the minimum number of occurrences of the simple transposition (i i + 1) in R(w 0 ) is min{i, n − i}.We observe a surprising phenomenon with respect to these numbers and the Cartan matrix of W (Theorem 5.2).Throughout this section, let W = s 1 , . . ., s n | (s i s j ) mij = id for all i, j be a finite Coxeter group generated by a set of simple reflections S = {s 1 , . . ., s n }.For w ∈ W , let ℓ(W ) denote the Coxeter length of w.For J ⊆ S, the parabolic subgroup W J is the subgroup of W generated by J, viewed as a Coxeter group with simple reflections J.Each left coset wW J of W J in W contains a unique element w J of minimal length, and the set {w J | w ∈ W } of these minimal coset representatives is called the parabolic quotient W J .Letting w J ∈ W J be the unique element such that w J w J = w, we have ℓ(w J ) + ℓ(w J ) = ℓ(w) and this is called the parabolic decomposition of w.As W is finite, W J is finite and it contains a unique element w J 0 of maximum length.We utilize the Bruhat order on W and W J , where u ≤ w if u equals a subword of a (or equivalently, any) reduced word of w.For convenience, we adopt the notation that J i := S − {s i } for each s i ∈ S. We refer readers to [3] for a detailed exposition on Coxeter groups.
We start with an algorithm to compute the minimum number of s i that appears in R(w) for all w.Proposition 5.1.Fix w ∈ W and s i ∈ S. Define a sequence of Coxeter group elements w (0) , w (1) , . . .as follows: w (0) = w Ji and w (k+1) = (w (k) s i ) Ji if w (k) = id, for k ≥ 0. This algorithm will eventually stop (at some w (N ) = id).Then the minimum number of s i that appears in R(w) is the k for which w (k) = id.
Proof.First notice that in this procedure, if w (j) = id, then as w (j) ∈ W Ji , it must have a single descent at s i .As a result, ℓ(w (j+1) ) ≤ ℓ(w (j) s i ) < ℓ(w (j) ) so we will eventually end up at the identity.This procedure also produces a (class of) reduced word of w with k s i 's where w (k) = id.
Let k be such that w (k) = id and take an arbitrary reduced word s i1 s i2 which is the product from s i1 to the (j + 1) th s i in this reduced word counted from the right.Also say u (K) = id.
Recall the following standard fact of Coxeter groups: if x ≤ y, then x J ≤ y J for any subset J ⊂ S.This can be proved via an application of the subword property of Bruhat orders.Also see [3].
We now show that u (j) ≥ w (j) for j = 0, 1, . . ., k in the Bruhat order by induction.For the base case, notice that both u (0) and w (0) are in the left coset wW Ji and since w (0) is the minimal coset representative, we have u (0) ≥ w (0) .Now assume u (j) ≥ w (j) = id for some j ≥ 0. By definition, both of them have a right descent at s i so we have u (j) s i ≥ w (j) s i by the fact in the last paragraph with J = {s i }.With another application of this fact with J = J i , we have (u (j) s i ) Ji ≥ (w (j) s i ) Ji = w (j+1) .At the same time, u (j+1) and u (j) s i are in the same coset of W Ji by definition, so u (j+1) ≥ (u (j) s i ) Ji ≥ w (j+1) .The induction step goes through.
Recall that a generalized Cartan matrix A of a Coxeter system (W, S) is a real n × n matrix such that • A ii = 2 for i = 1, . . ., n and A ij ≤ 0 for i = j, • A ij < 0 if and only if A ji < 0 and A ij A ji = 4 cos 2 (π/m ij ) for i = j.We say that a generalized Cartan matrix A is restricted if m ij = 3, or equivalently, there is a single edge between s i and s j in the Dynkin diagram, implies that A ij = A ji = −1.Note that if (W, S) is simply-laced, then any restricted generalized Cartan matrix is the Cartan matrix.We now state our main result of the section.Theorem 5.2.Let W be a finite Coxeter group generated by S = {s 1 , . . ., s n } and let v ∈ R n >0 be such that v i is the minimum number of appearances of s i in a reduced word of w 0 .Then there exists a restricted generalized Cartan matrix A ∈ R n×n of (W, S) such that Av ≥ 0, where the comparison is made entry-wise.
Proof.We make use of Proposition 5.1 for each type separately and provide the corresponding restricted generalized Cartan matrix.Note that (Av) i = 2v i + j∼i A ij v j , where j ∼ i means that the nodes i and j are adjacent in the Dynkin diagram.So Av ≥ 0 is intuitively saying that the value v at each node i is at least half of the weighted sum of its neighbors.
For the classical types, we mainly argue about type B n , whose Coxeter group W (B n ) is isomorphic to the group of signed permutations.The argument for type D n , whose Coxeter group W (D n ) is an index-2 subgroup of W (B n ), is similar and we will omit unnecessary details.The argument for type A n is simpler.And for the exceptional types, we use Proposition 5.1 and a computer to generate each v i , and then provide the matrix A directly.Type B n .Writing ī := −i, we adopt the convention that W (B n ) = {w is a permutation on n, . . ., 1, 1, 2, . . ., n | w(i) = −w( ī) ∀i} which is generated by S = {s 1 , . . ., s n } where s 1 = (1 1), s i = (i−1 i)(i−1 ī) in cycle notation for i = 2, . . ., n.The Dynkin diagram and the v i 's that we are about to compute can be seen in Figure 12.
Taking the parabolic quotient to obtain w (1) = (w (0) s i ) Ji , where J i = S \ {s i }, we effectively get rid of the signs in coordinates 1, . . ., i − 1 and sort these values, and also sort the values in coordinates i, i + 1, . . ., n respectively.This gives as desired, establishing the base case.Checking the inductive steps is also done in the same way, by writing down sorting the values without the signs in coordinates 1, . . ., i − 1 and sorting the values while keeping the signs in coordinates i, . . ., n to obtain w (k+1) = (w (k) s i ) Ji .Finally, when k = n + 1 − i, we see that w (k) = s i so we conclude that v i = n + 2 − i.
To see that v 1 = n, we notice in fact that every time s 1 is applied to reduce the length of a signed permutation, there is one less negative values among w(1), . . ., w(n), and every time some other s i is applied, where i ≥ 2, the number of negative values among w(1), . . ., w(n) stays the same.This directly gives v 1 = n.
Finally, to specify a restricted generalized Cartan matrix A ∈ R n×n , it suffices to specify A 12 = −2 and A 21 = −1.We check that Av = (0, 1, 0, . . ., 0, 0, 1) T ≥ 0. Type D n .The same argument as in type B n works in this case, by explicitly writing down the signed permutations w (0) , w (1) , . . .for each s i .We omit the tedious details here and provide the answers for v i 's in Figure 13.Since type D n is simply-laced, the restricted generalized Cartan matrix is fixed.We check that Av ≥ 0, which in fact has value 0 at most coordinates.
Type A n−1 .We quickly go over the algorithm in Proposition 5.1.Fix i ≤ n−1 2 .Let Z k = {w (k) (1), . . ., w (k) (i)} so that Z 0 = {n − i + 1, . . ., n}.To obtain Z k+1 from Z k , we exchange the largest entry of Z k with the smallest entry of {1, . . ., n} \ Z k .It is then immediate that Z i becomes {1, . . ., i} so that v i = i.By symmetry of the Dynkin diagram, v i = n − i for i ≥ n−1 2 .We check again that most entries of Av are zeroes, except one or two positive integers in the middle.
Type E 6 , E 7 , E 8 .The v i 's are shown in Figure 14.We check that each v i is at least half of the sum of its neighbors.

1 1. 1 .
Relation to the k-set problem.Given a collection A of n distinct points in R 2 , a k-set is a subset B ⊆ A of size k which can be separated from A − B by a straight line in R 2 .

Example 3 . 1 .Figure 2 .
Figure 2. The arc diagram D(P ) of the monotone weakly separated path P in Example 3.1.

Corollary 3 . 3 .Remark 3 . 4 .
For any positive integers k and n such that 1 ≤ k ≤ n − 1, we have the upper bound M(k, n) ≤ √ 2k • n.Together with Theorem 4.3 below, our arguments above give a short proof of the upper bound O( √ k) • n for the pseudoline k-sets problem.It might be instructive to compare this bound with the known upper bounds in the literature of the straight line setting.For the classical planar k-sets problem, Pach, Steiger, and Szemerédi [10] have shown the upper bound (2) is a monotone weakly separated path.Example 3.6.The pattern 12 − 13 − 23 − 34 is a repeatable pattern with parameters (L, d) = (3, 2).Here, we use the shorthand ab to denote {a, b}.By concatenation, the pattern gives the infinite sequence 12 − 13 − 23 − 34 − 35 − 45 − 56 − 57 − 67 − 78 − 79 − 89 − • • • .

Figure 4 .
Figure 4.The arc diagram D(P ) of the monotone weakly separated path P in Example 3.8.

Theorem 3 .
10 (decomposition theorem).Let n ≥ 6 be a positive integer.Let D be an arc diagram of a monotone weakly separated path from {1, 2, 3} to {n − 2, n − 1, n}.Let F (D) be the collection of intervals obtained from Algorithm 3.9.Then (a) any two different intervals in F (D) are non-overlapping, and (b) any interval I ∈ F (D) satisfies wt(I) ≤ wtlim(I).

Figure 6 .
Figure 6.A pair of consecutive curves C j and C j+1 in the C-sequence are in one of the three configurations.The configuration on the left corresponds to outcomes (i) and (ii) in Lemma 3.15.The middle one corresponds to outcomes (iii) and (iv).The right one corresponds to outcomes (v) and (vi).

Figure 8 .
Figure 8.The nine curves in this configuration cannot simultaneously appear in the arc diagram D(P ) of a monotone weakly separated path P .

exists and is equal to c k . Remark 4 . 4 . 4 . 3 .
We can similarly define numbers M(S, n) and M(S, n) for any finite subset S ⊂ N and n ∈ N. Their asymptotics are still the same and well-defined, i.e., Generalized wiring diagrams.We now work towards showing the rationality of c k .

Definition 4 . 5 .
A generalized wiring diagram consists of countably many wires, labeled by 1, 2, . . .starting at levels 1, 2, . . .respectively from top to bottom, traveling from left to right such that at each timestamp t, either• two wires at adjacent levels cross; or • one wire goes to infinity ∞, intersecting all wires at lower levels.

Figure 9 .
Figure 9.A reduced generalized wiring diagram

Lemma 4 . 6 .
The maximum number of intersections on level k among diagrams in W(k, n) equals M(k, n).

Definition 4 . 7 .
A reduced generalized wiring diagram W is simple, if there is no (S1) Pair of wires a < b which intersects on a level other than k, and at the moment of their intersection wires {a + 1, . . ., b − 1} have already fallen; or (S2) Wire a, which intersects with k wires with larger labels (not counting when wire a is going to infinity).

Proposition 4 . 8 .
A diagram W ∈ W(k, n) can be transformed into a simple reduced diagram W ′ ∈ W(k, n) without changing the number of intersections on level k.

Corollary 4 .
13.For any k, |T k | ≤ k k 2 +2k .In particular, |T k | is finite.Proof.Let W ∈ W(k) be simple and consider π = π (t) W ∈ T k .As above, let a 1 , a 2 , . . .be the labels of wires that have not yet fallen.Let z = |E t (W )| ≤ k 2 + 2k and consider the Lehmer code code(π) where code(π) i equals the number of wires a j that have intersected a i , where j > i.It is a classical fact that Lehmer codes uniquely characterize permutations in S ∞ .

Definition 4 .
15.For f ∈ N and π ∈ T k , let K(f, π) be the maximum number of crossings at level k among all simple patternsQ = P 1 + • • • + P r such that π − P1 , . . ., π − Pr are distinct, π − P1 = π + Pr = π,and Q has f fallen wires.Since T k is finite by Corollary 4.13, there are finitely many simple patterns whose constituent pieces have distinct values of π − .Theorem 4.16.For any k ∈ Z >0 we have: and no fallen wires.For any m ∈ N, consider the diagram

Proposition 4 .
18. Let p k (n) := M(k, n) − c k n.Then, for sufficiently large n, p k (n) is periodic in n.

2 s n−1 s n labels v i 's n n n−1 n−2 4 3 2 Figure 12 .
Figure 12. minimal number of occurrences of each s i in reduced words of w 0 of type B n , with labels on top and v i 's on the bottom

Figure 13 .
Figure 13.minimal number of occurrences of each s i in reduced words of w 0 of type D n
}| is this number of wires.Since this is a condition satisfied by all π • • • s i ℓ of w.Pick out the s i 's in this reduced word as i aK