Extensions of the Kahn--Saks inequality for posets of width two

The Kahn--Saks inequality is a classical result on the number of linear extensions of finite posets. We give a new proof of this inequality for posets of width two using explicit injections of lattice paths. As a consequence we obtain a $q$-analogue, a multivariate generalization and an equality condition in this case. We also discuss the equality conditions of the Kahn--Saks inequality for general posets and prove several implications between conditions conjectured to be equivalent.

1. Introduction 1.1. Foreword. The study of linear extensions of finite posets is surprisingly rich as they generalize permutations, combinations, standard Young tableaux, etc. By contrast, the inequalities for the numbers of linear extensions are quite rare and difficult to prove as they have to hold for all posets. Posets of width two serve a useful middle ground as on the one hand there are sufficiently many of them to retain the diversity of posets, and on the other hand they can be analyzed by direct combinatorial tools.
In this paper, we study two classical results in the area: the Stanley inequality (1981), and its generalization, the Kahn-Saks inequality (1984). Both inequalities were proved using the geometric Alexandrov-Fenchel inequalities and remain largely mysterious. Despite much effort, no combinatorial proof of these inequalities has been found.
We give a new, fully combinatorial, proof of the Kahn-Saks inequality for posets of width two and both elements in the same chain. In this case, linear extensions are in bijection with certain lattice paths, and we prove the inequality by explicit injections. This is the approach first pioneered in [CFG80,GYY80] and more recently extended by the authors in [CPP21a]. In fact, Chung, Fishburn and Graham [CFG80] proved Stanley's inequality for width two posets and their conjecture paved a way to Stanley's paper [Sta81]. The details of our approach are somewhat different, but we do recover the Chung-Fishburn-Graham (CFG) injection as a special case. The construction in this paper is quite a bit more technical and is heavily based on ideas in our previous paper [CPP21a], where we established the cross-product conjecture in the special case of width two posets. Now, our approach allows us to obtain q-analogues of both inequalities in the style of the q-cross-product inequality in [CPP21a]. More importantly, it is also robust enough to imply conditions for equality of the Kahn-Saks inequalities for the case of posets of width two and both elements in the same chain. The corresponding result for the Stanley inequality in the generality of all posets was obtained by Shenfeld and van Handel [SvH20+] using technology of geometric inequalities. Most recently, a completely different proof was obtained by the first two authors [CP21]. Although the equality condition in the special case of the Kahn-Saks inequality is the main result of paper, we start with a special case of the Stanley inequality as a stepping stone to our main results.
1.2. Two main inequalities. Let P = (X, ≺) be a finite poset. A linear extension of P is a bijection L : X → [n], such that L(x) < L(y) for all x ≺ y. Denote by E(P ) the set of linear extensions of P , and write e(P ) := | E(P )|. The following are two key results in the area: Theorem 1.1 (Stanley inequality [Sta81, Thm 3.1]). Let P = (X, ≺) be a finite poset, and let x ∈ X. Denote by N(k) the number of linear extensions L ∈ E(P ), such that L(x) = k. Then: (1.1) N(k) 2 ≥ N(k − 1) N(k + 1) for all k > 1. In other words, the distribution of value of linear extensions on x is log-concave.
Note that the Stanley inequality follows from the Kahn-Saks inequality by adding the maximal element 1 to the poset P , and letting y ← 1.
1.3. The q-analogues. From this point on, we consider only posets P of width two. Fix a partition of P into two chains C 1 , C 2 ⊂ X, where C 1 ∩ C 2 = ∅. Let C 1 = {α 1 , . . . , α a } and C 2 = {β 1 , . . . , β b } be these chains of lengths a and b, respectively. The weight of a linear extension L ∈ E(P ) is defined in [CPP21a] as Note that the definition of the weight wt(L) depends on the chain partition (C 1 , C 2 ). We can now state our first two results.
Theorem 1.3 (q-Stanley inequality). Let P = (X, ≺) be a finite poset of width two, let x ∈ X, and let (C 1 , C 2 ) be the chain partition as above. Define Then: (1.4) N q (k) 2 N q (k − 1) N q (k + 1) for all k > 1, where the inequality between polynomials in q is coefficient-wise.
The following result is a generalization, sice we can always assume that element y = 1 is in the same chain as element x.
Theorem 1.4 (q-Kahn-Saks inequality). Let x, y ∈ X be distinct elements of a finite poset P = (X, ≺) of width two. Suppose that either x, y ∈ C 1 , or x, y ∈ C 2 . Define: Then: where the inequality between polynomials in q is coefficient-wise.
In Section 7, we give a multivariate generalization of both theorems. Note that the assumption that x and y belong to the same chain in the partition (C 1 , C 2 ) are necessary for the conclusion of Theorem 1.4 to hold, as shown in the next example.
The equivalence (a) ⇔ (b) was recently proved by Shenfeld and van Handel [SvH20+] for general posets via a condition implying (e), see Theorem 8.1 and the discussion that follows. Conditions (c) and (d) are specific to posets of width two. The following result is a generalization of Theorem 1.6 and the main result of the paper: Theorem 1.7 (Equality condition for the q-Kahn-Saks inequality). Let x, y ∈ X be distinct elements of a finite poset P = (X, ≺) of width two. Let F(k), F q (k) be defined as above. Suppose that either x, y ∈ C 1 or x, y ∈ C 2 . Also suppose that k ∈ {2, . . . , n − 2} and F(k) > 0. Then the following are equivalent: there is an element z ∈ {x, y}, such that for every L ∈ E(P ) for which L(y) − L(x) = k, there are elements u, v ∈ X which satisfy u || z, v || z, and L(u) + 1 = L(z) = L(v) − 1.
Note that conditions (c) and (d) are specific to posets of width two. While conditions (a) and (b) do extend to general posets, the equivalence (a) ⇔ (b) does not hold in full generality. Even for the poset P = C 3 + C 3 of width two given in Example 1.5, we have F(2) 2 = F(3) F(1) = 4, even though F(1) = 1, F(2) = 2 and F(3) = 4.
We should also mention that the F(k) > 0 assumption is a very weak constraint, as the vanishing can be completely characterized for general posets (see Theorem 8.5). We refer to Section 8 for further discussion of general posets, and for the k-midway property which generalizes the k-pentagon property but is more involved.
1.5. Proof discussion. As we mentioned above, we start by translating the problem into a natural question about directed lattice paths in a row/column convex region in the grid (cf. §9.4). From this point on, we do not work with posets and the proof becomes purely combinatorial enumeration of lattice paths.
While the geometric proofs in [KS84,Sta81] are quite powerful, the equality cases of the Alexandrov-Fenchel inequality are yet to be fully understood. So proving the equality conditions of poset inequalities is quite challenging, see [SvH20+,CP21] and §9.1. This is why our direct combinatorial approach is so useful, as the explicit injection becomes a bijection in the case of equality.
In the case of Stanley's inequality the CFG injection is quite simple and elegant, leading to a quick proof of the equality condition. For the Kahn-Saks inequality, the direct injection is a large composition of smaller injections, each of which is simple and either generalizes the CFG injection or of a different flavor, all influenced by the noncrossing paths in the Lindström-Gessel-Viennot lemma [GV89] (see also [GJ83,§5.4]). Consequently, the equality condition of the Kahn-Saks inequality is substantially harder to obtain as one has to put together the equalities for each component of the proof and do a careful case analysis. In summary, our proof of the main result (Theorem 1.7) is like an elaborate but delicious dish: the individual ingredients are elegant and natural, but the instruction on how they are put together is so involved the resulting recipe may seem difficult and unapproachable.
1.6. Structure of the paper. We start with an introductory Section 2 on posets, lattice paths, and lattice path inequalities. This section also includes some reformulated key lemmas from our previous paper [CPP21a], whose proof is sketched both for clarity and completeness. A reader very familiar with the standard definitions, notation and the results in [CPP21a] can safely skip this section.
In the next Section 3, we introduce key combinatorial lemmas which we employ throughout the paper: a criss-cross inequality (Lemma 3.1), and two equality lemmas (Lemma 3.2 and Lemma 3.3). In a short Section 4, we prove both the Stanley inequality (Theorem 1.1) which easily extends to the proof of the q-Stanley inequality (Theorem 1.3), and the equality conditions for Stanley's inequality (Theorem 1.6). Even though these results are known in greater generality (except for Theorem 1.3 which is new), we recommend the reader not skip this section, as the proofs we present use the same approach as the following sections.
In Sections 5 and 6, we present the proofs of Theorems 1.4 and 1.7, respectively, by combining the previous tools together. These are the central sections of the paper. In a short Section 7, we give a multivariate generalizations of our q-analogues. Finally, in Section 8, we discuss generalizations of Theorem 1.7 to all finite posets. We state Conjecture 8.7 characterizing the complete equality conditionsi and prove several implications in support of the conjecture using the properties of promotion-like maps (see §9.6). We conclude with final remarks and open problems in Section 9.
is a polynomial with nonnegative coefficients. Note the difference between relations x y , a ≤ b and f g , for posets elements, integers and polynomials, respectively.
2.2. Lattice path interpretation. Let P = (X, ≺) be a finite poset of width two and let (C 1 , C 2 ) be a fixed partition into two chains. Denote by 0 = (0, 0) the origin and by e 1 = (1, 0), e 2 = (0, 1) two standard unit vectors in Z 2 . For a linear extension L ∈ E(P ), define the North-East (NE) lattice path φ(L) obtained from L by interpreting it as a sequence of North and East steps corresponding to elements in C 1 and C 2 , respectively. Formally, let φ(L) := (Z t ) 1≤t≤n in Z 2 from 0 = (0, 0) to (a, b), be the path defined recursively as follows: Denote by C(P ) the set Let F up (P ) and F down (P ) be the set of unit squares in [0, a] × [0, b] whose centers are in C up (P ) and C down (P ), respectively. Note that the region F up (P ) lies above the region F down (P ), and their interiors do not intersect. Let Reg(P ) be the (closed) region of [0, a] × [0, b] that is bounded from above by the region F up (P ), and from below by the region F down (P ), see Figure 2.1. It follows directly from the definition that Reg(P ) is a connected row and column convex region, with boundary defined by two lattice paths. Moreover, the lower boundary of Reg(P ) is the lattice path corresponding to the C 1 -minimal linear extension (i.e. assigning the smallest possible values to the elements of C 1 ), and the upper boundary corresponds to the C 1 -maximal linear extension.  Remark 2.2. It is not hard to see the regions Reg(P ) which appear in Lemma 2.1 have no other constraints. Formally, for every region Γ ⊂ Z 2 between two noncrossing paths γ, γ : 0 → (a, b), there is a poset P of width two with a partition into two chains of sizes a and b, such that Γ = Reg(P ). We leave the proof to the reader, see also §9.4.

2.3.
Inequalities for pairs of paths. We will use the lattice path inequalities from [CPP21a] and prove their extensions. In order to explain the combinatorics, we will briefly describe the proofs from [CPP21a]. Informally, they state that there are more pairs of paths which pass closer to the inside of the region than to the outside of the region.  Proof outline. We exhibit an injection κ from pairs of paths γ : A → C, δ : B → D in Reg(P ) to pairs of paths γ : A → C, δ : B → D in Reg(P ). Let v = − − → BA and δ = δ + v be the translated path δ, which starts at A = B + v and ends at D = D + v, lying on or above C by the condition in the Lemma. Then γ and δ must intersect, and let E be their first (closest to A) intersection point.
Then γ ⊂ Reg(P ) since δ is on or above δ ⊂ Reg(P ) (because a 2 ≥ b 2 ) and is strictly below γ ⊂ Reg(P ) since E is the first intersection point. Similarly, γ(A, E) − v is also between γ and δ and hence in Reg(P ). The other parts of γ , δ are part of the original paths γ, δ and so are also in Reg(P ). Then κ is clearly an injection. Since the paths are composed of the same pieces, some of which translated vertically with zero net effect, the total q-weight is preserved.

Lattice paths toolkit expansion
3.1. Criss-cross inequalities. Here we consider inequalities between sums of pairs of paths.
Lemma 3.1 (Criss-cross lemma). Let A, A , B , B ∈ Reg(P ) be on the same vertical line, with A the highest and B the lowest points. In addition, let C, C , D, D ∈ Reg(P ) be on another vertical line, with C the highest and D the lowest points, and such that Proof. The idea is to consider the pairs of paths counted on each side, and show that each pair (after the necessary transformation) is counted less times on the RHS than on the LHS, where the number of times it could appear on each side is 0, 1, 2.
Here we have 4-tuples of paths with the given endpoints, such that their only intersection points are the endpoints, namely γ ∩ γ = {E} and δ ∩ δ = {F }. Connecting the paths in S(E, F ) with (π, ρ), we can obtain four different pairs of paths from the points A, A to C, C . We now count how often each such pair is counted in LHS and RHS of the desired inequality in (3.1), after we translate one of the paths by Illustration of the proof of Lemma 3.1. Here we show points E, F and paths γ, γ , δ, δ , π (in red) and ρ (in blue). The green path η 1 is formed by following γ then ρ and then δ and translating the resulting path by v, so it is a path B → D. The orange path η 2 is also shown.
Fix points E, F as above, paths π, ρ : E → F , and 4-tuple (γ, γ , δ, δ ) ∈ S(E, F ). These 6 paths can be combined in different ways to give 2 paths from A, A to C, C , and after translating one by v obtain pairs appearing in (3.1). The pairs are: Case 1: At least one of ζ 3 , η 3 is not (entirely contained) in Reg(P ), and at least one of ζ 4 , η 4 is not in Reg(P ), then none of these pairs of paths is counted in the RHS of (3.1), and the contribution to the RHS is 0.
Case 3 and 4: Exactly one pair is in Reg(P ), say ζ 3 , η 3 ⊂ Reg(P ) and at least one of ζ 4 , η 4 is not in Reg(P ). Then γ, δ , γ + v, δ + v ⊂ Reg(P ). Since γ is between γ and γ + v, both of which are contained in Reg(P ), and since Reg(P ) is simply connected, we conclude that γ is also in Reg(P ). Thus, ζ 2 ⊂ Reg(P ). Similarly, since γ + v is between γ and γ + v, we have γ + v ⊂ Reg(P ). Thus, ζ 2 , η 2 ⊂ Reg(P ). Hence these paths are counted once in the RHS and at least once in the LHS.
Moreover, these constructions reassign portions of the same paths on the RHS and LHS, total translated areas cancel out, so the q-weights are preserved and the inequality holds for the q-weighted paths. This completes the proof.
if and only if either both sides are zero, or Furthermore, if a 2 > a 2 and the segment CD lies strictly to the right of segment AB, then the segment AB is part of the lower boundary of Reg(P ).
Proof. We assume that a 2 > a 2 and the segment CD lies strictly to the right of AB, as otherwise the lemma is straightforward. The equality in Lemma 2.3 implies that the map κ is a bijection. Let ξ : B → D be the highest possible path in Reg(P ) and η : A → C be the lowest possible path in Reg(P ), see Figure 3.2. Then these paths must be in the image of κ, and their preimages are ξ : B → D and η : Following the construction of κ −1 , we see that the paths η and ξ + v must intersect, with E the closest intersection point to A. By the minimality of η and maximality of ξ in Reg(P ), we have that ξ + v is on or above η. Since the endpoints of ξ + v (i.e. A and D ) are strictly above the endpoints of η (i.e. A and C) by assumptions, we have E is contained in lower boundary of Reg(P ). Since ξ is below ξ + v and is above the lower boundary of Reg(P ), we have E is contained in ξ. Next, we observe that if E ∈ AB, then η(A, E) is strictly above ξ(B , E), which contradicts the maximality of ξ in Reg(P ). Thus E is contained in AB and is on or above A, and so the lower boundary of Reg(P ) contains the segment AB. This completes the proof.
The following Lemma treats the special case when A = B in the Equality Lemma 3.2. The inequality itself reduces directly to Lindström-Gessel-Viennot lemma as the translation vector v = 0. Lemma 3.3 (Special equality lemma). Let A, B ∈ Reg(P ) be two points on the same vertical line with A above B, and C, D ∈ Reg(P ) points on another vertical line with C above D to the east of the line AB. Then: with equality if and only if there exists a point E for which every path counted here must pass through, i.e., Proof. We assume that segment CD lies strictly to the right of AB, as otherwise the lemma is straightforward. First, observe that the inequality follows from Lemma 2.3 by setting A ← A, B ← B and A ← B, B ← A. In that case the translation vector is zero and we apply the intersection argument directly to the paths A → C, B → D.
To analyze the equality, we notice that Lemma 3.2 does not apply anymore, so a different argument is needed. The "only if" part of the claim is clear. We now prove the if part. Let γ : A → C be the highest path within Reg(P ) from A → C, and let δ : B → D be the lowest possible path within Reg(P ) from B to D. Since the injection κ in Lemma 2.3 is now a bijection, it follow that γ and δ intersects at a point E. If E is contained in the segment AB (resp. CD), then the segment AB (resp. CD) is contained in the lower (resp. upper) boundary of Reg(P ) and thus every path counted here must pass through E = A (resp. E = D). If E is not contained in the segment AB or CD, then E is an intersection of the upper and lower boundary of Reg(P ), and every path in Reg(P ) must pass through E. This completes the proof.

Stanley's log-concavity
Theorem 1.3 is a direct Corollary of Theorem 1.4 when setting x to be a 0 element in the poset. But its proof via lattice paths is much more direct, and illustrative, so we discuss it separately here first.
4.1. Proof of Theorem 1.3. Without loss of generality, assume x ∈ C 1 , so x = α r for some r. Let Y k = (r − 1, k − r), so that the lattice paths corresponding to linear extensions L with L(x) = k pass through Then the paths with L(x) = k + 1 pass through A 1 , A and the paths with L(x) = k − 1 pass through B 1 , B. We can then write the difference between the left and right hand sides of inequality (1.4) in terms of lattice paths as We now apply Lemma 2.3 twice as follows. Let B 1 = A 1 and C = D = 0. Observe that this configuration matches the configuration in the Lemma by rotating Reg(P ) by 180 • . Note that we can apply the lemma since Similarly, on the other side we apply the lemma with A = B and C = D = Q, satisfying the conditions since Multiplying the last two inequalities we obtain the desired inequality ∆ ≥ 0.
. We now show that (a) ⇒ (d). In the proof of the Stanley inequality, notice that the equality is achieved exactly when all applications of Lemma 2.3 lead to equalities. For the equality in the first application of Lemma 2.3, we have: . This equality case is covered by Lemma 3.2 (after 180 • rotation), which implies that the segment A 1 B 1 is part of the upper boundary of Reg(P ) (which is the condition after rotating by 180 • ). The second application of Lemma 2.3 implies that AB is part of the lower boundary of Reg(P ). Thus every path 0 → Q passes on or below B 1 and on or above A. Hence qN q (k − 1) = N q (k) = q −1 N q (k − 1), where the factors of q arise from the different horizontal levels of the path passing from the A 1 B 1 segment to the AB segment.
We now show that (a) ⇒ (e). Since the lattice paths and Reg(P ) correspond to the poset structure, we can restate the above conditions on poset level. The fact that A 1 B 1 is an upper boundary of Reg(P ) implies that the element β k−r α r−1 . The fact that BB 1 , AA 1 ⊂ Reg(P ) implies that β k−r , β k−r+1 are not comparable to α r . Finally, AB on the lower boundary of Reg(P ) implies α r+1 β k+1−r .
The lattice paths equality Lemma 3.2 (after 180 • rotation) implies that all paths passing through A 1 also pass through B 1 , so A 1 B 1 is part of the upper boundary of Reg(P ) (shaded in gray). Similarly for the paths passing through A, B. We see that the square centered at (r − 1 + 1 2 , k − r + 1 2 ) ∈ Reg(P ), which means that α r || β k−r+1 , and similarly we derive the other conditions. We now show (e) ⇒ (b) (cf. Proposition 8.8 for a proof of the analogous implication for Kahn-Saks equality for general posets). Denote However, by the Stanley inequality (Theorem 1.1), we have N(k) 2 ≥ N(k − 1) N(k + 1), implying that all inequalities are in fact equalities.

Proof of Theorem 1.4
For a given integer w ∈ N, let F q (w; k) be the q-weighted sum where the sum is over all linear extensions L ∈ E(P ), such that L(x) = w and L(y) = w + k. By definition, We can thus express the difference where we have grouped the terms in the expansions of products of F q ( * ; * ) using In order to verify the identity (5.1), let u ≥ w − 1. Note that by setting v ← w, v ← u into the first term, and setting v ← u + 1, v ← w − 1 into the second term of (5.2), we cover the cases v ≥ v − 1 and v ≥ v + 1 in the positive summands in (5.1), where the double appearance of v = v − 1 is balanced out by the factor 1 2 . Similarly, for the negative terms,  Figure (b) shows the paths involved in S(u; u+1), which is the difference between the q-weighted sum of (red, blue) pairs minus the q-weighted sum of (green, brown) pairs. setting Similarly, we have: and the remaining case of v = v − 1 comes from 1 2 S(u; u + 1).
We now prove that S(u; w) 0 for all u ≥ w − 1 appearing in (5.1). Suppose x, y ∈ C 1 so x = α s , and y = α s+r . For u ∈ Z, let Y u := (s − 1, u − s) and V u := (s + r − 1, u − (s + r)), that is, if a linear extensions has L(x) = w then its lattice path passes through Y w , Y w + e 1 , and if L(y) = w + k then it passes through V w+k , V w+k + e 1 .
In terms of lattice paths, we have: Let first u > w − 1 and for simplicity label the following points Thus, letting = 2 a+1 2 + 2u + 2w + 2k, we can expand S(u; w) and regroup its terms as follows: (5.3) Here the ∆ notation means that we take differences of paths passing through either E or E when using the E/E , and ∆ 2 plays the role of a second derivative. Specifically, the restructured terms above are given as follows, they are each nonnegative by our lattice paths lemmas: Here the second inequality follows by applying Lemma 2.3 twice: Now let u = w − 1, we set Y := Y u + e 1 and Y := Y w + e 1 = Y u+1 + e 1 = Y + e 2 , and V := V u+k and V := V u+k+1 = V + e 2 . Then: This completes the proof. For (e) ⇒ (d), we adapt the proof of Proposition 8.8 below, of the analogous implication for general posets. Without loss of generality, we assume that z = x and x ∈ C 1 . Then (e) implies that, given a linear extension L ∈ E(P ) with L(y) − L(x) = k, we can obtain linear extension L ∈ E(P ) with L (y) − L (x) = k − 1, and linear extension L ∈ E(P ) with L (y) − L (x) = k + 1, by switching element x with the succeeding and preceding element in L, respectively. This map is clearly an injection that changes the q-weight by a factor of q ±1 , so we have q F(k) and F q (k + 1) q −1 F(k).
Since we also have F q (k) 2 ≥ F q (k − 1)F q (k + 1) by Kahn-Saks Theorem 1.4, we conclude that equality occurs in the equation above, which proves (d).
The proof of (a) ⇒ (e) will occupy the rest of this section. Together with the implications above, this implies the theorem. 6.2. Lattice paths interpretation. Suppose that x = α s and y = α s+r . We will assume without loss of too much generality that r > 1, so that the boundary between the region of x and the region of y does not overlap. This allows us to apply the combinatorial interpretation in Lemma 3.2 and Lemma 3.3. We remark that the method described here still applies to the case r = 1 (by a slight modification of Lemma 3.2 and Lemma 3.3), and we omit the details here for brevity.
The idea of the proof is as follows. Informally, we will show that condition (a) implies that the regions above x or y is a vertical strip of width 1, that is the upper and lower boundary above x and above y are at distance 1 from each other, see Figure 4.1. These strips extend to the levels for which there exist a linear extension L ∈ E(P ) with L(y) − L(x) = k ± 1 (see the full proof for precise description in each possible case). In order to show this, we analyze the proof of Theorem 1.4 in Section 5. In order to have equality we must have S(u; w) = 0 for every u ≥ w − 1. So we apply the equality conditions from Lemmas 3.2 and 3.3 for every inequality involved in the proofs of S(u; w) ≥ 0. These equality conditions impose restrictions on the boundaries of Reg(P ), making them vertical at the relevant levels above x and y, and ultimately drawing the width-1 vertical strip. This analysis requires choosing special points u and w from Section 5, and the application of the equality Lemmas requires certain conditions. Thus there are several different cases which need to be considered.
In order to apply this analysis we parameterize Reg(P ) above x and y as follows. Let u 0 be the smallest possible value L(x) = L(α s ) can take, i.e. (Y u0 , Y u0 + e 1 ) is a segment in the lower boundary of Reg(P ), see Figure 6.1. Let u 1 − 1 be the largest possible value that L(α s−1 ) can take, i.e. (Y u1 − e 1 , Y u1 ) is a segment in the upper boundary of Reg(P ). Let u 2 + 1 be the smallest possible value L(α s+1 ) can take, i.e. (Y u2 + e 1 , Y u2 + 2e 1 ) is a segment in the lower boundary of Reg(P ). Finally, let u 3 be the largest possible value L(x) can take, so (Y u3 , Y u3 + e 1 ) is a segment in the upper boundary of Reg(P ). Clearly we have u 0 ≤ u 1 and u 2 ≤ u 3 . Similarly, let w 0 + k be the smallest possible value L(y) can take, so this gives the level of the lower boundary of Reg(P ) above y. Finally, let w 1 + k − 1 be the largest possible value L(α r+s−1 ) can take, let w 2 + k + 1 be the smallest possible value L(α r+s+1 ) can take, and w 3 + k be the largest possible value L(y) can take. Clearly, we have w 0 ≤ w 1 and w 2 ≤ w 3 .
Here we are only concerned with effectively possible values of u, i.e. values for which there exist linear extensions with L(x) = u and L(y)−L(x) ∈ [k −1, k +1]. We can thus restrict our region above x and y, as follows. If we had w 0 − u 0 > 1, then F(u 0 ; j) = 0 for j ∈ {k − 1, k, k + 1}, since L(y) ≤ u 0 + k + 1 < w 0 + k. Thus we can assume that the region above x starts at L(x) = w 0 − 1. Similarly, if w 0 − u 0 < −1, we can restrict the region above y accordingly. Thus we can assume |w 0 − u 0 | ≤ 1. Similarly, we can apply the same argument to the upper boundaries, and assume that |w 3 − u 3 | ≤ 1. Finally, let v max be the largest integer such that F(v max ; k) > 0, and let v min be the smallest integer such that F(v min ; k) > 0. Note that v max = min{u 3 , w 3 } and v min = max{u 0 , w 0 }.
In the language of lattice paths, condition (e) follows from showing either of the following: (S1) For every v ∈ [v min , v max ], we have Y v−1 is contained in the upper boundary of Reg(P ), and Y v+1 + e 1 is contained in the lower boundary of Reg(P ).
(S2) For every v ∈ [v min , v max ], we have Y v+k−1 is contained in the upper boundary of Reg(P ), and Y v+k+1 + e 1 is contained in the lower boundary of Reg(P ). Note that these condition imply the width-1 vertical strip above x or y for all relevant values. It also implies that L −1 (v ± 1) ∈ C 2 and that L −1 (v ± 1) || x since Y v±1 , Y v±1 + e 1 ∈ Reg(P ).
For the rest of the section, we write A := Y u , B := Y w , and let the notations A, B, A 1 , B 1 , A 1 , B 1 , C, D, C , D , C 1 , D 1 , C 1 , D 1 be as in the proof of Theorem 1.4 in Section 5. The choices of u and w will be chosen separately for each case of consideration. We also write m := u 3 − u 0 and m := w 3 − w 0 .
We split the proof into different cases, depending on the values of m, m , u 1 − u 0 , w 3 − w 2 , u 0 − w 0 , and u 3 − w 3 . 6.3. The cases m ≥ 2, u 0 < u 1 or m ≥ 2, w 2 < w 3 . We will now prove that (S2) holds for the first case. The second case is analogous, after 180 • rotation of the configuration, and leads to (S1).
Note that F(u 0 + 1; k) > 0 since there is a linear extensions L(x) = u 0 + 1 and L(y) = u 0 + k + 1 ∈ [w 0 + k, w 3 + k]. We then have: We now turn to the proof of the inequality in Section 5, and notice that equality in (1.2) would be achieved only if S(u; w) = 0. Let u := v max and w := v min . Since S(u; w) = 0, this means that Let us show that every terms in the left side of (6.1) is nonzero. Suppose otherwise, that K(A , C ) = 0 (the other cases are treated analogously). By the monotonous boundaries of Reg(P ), we must have A or C not in Reg(P ), contradicting the choice of u since there are linear extensions with L(x) = u and L(y) = y + k.
Therefore, we must have equality in both applications of Lemma 2.3, so we can apply the Equality Lemma 3.2 to both terms in (6.1) (one after 180 • rotation). These equalities imply that CD = Y vmax +k+1 Y vmin +k−1 is part of the upper boundary of Reg(P ), and that C 1 D 1 = (Y vmax +k+1 + e 1 ) (Y vmin +k−1 + e 1 ) is part of the lower boundary of Reg(P ). This implies (S2).
For the rest of the proof, we can assume that w 2 = w 3 if m ≥ 2 and u 0 = u 1 if m ≥ 2.
6.4. The case m ≥ 2, u 0 = u 1 , u 3 > w 3 . Since u 3 > w 3 , we have that w 3 = v max and u 3 = v max +1. Let u := v max and w := v max . Since m ≥ 2 we have that A 1 , B 1 ∈ Reg(P ), and since w 3 < u 3 we have that CC 1 ∈ Reg(P ). Thus we have: We will first show that the segment AB is contained in the lower boundary of Reg(P ). Since S(u; w) = 0, the vanishing of the second summand in (5.3) implies that either The first product is nonzero from above. Below we show that ∆ 1 (C 1 /C 1 , D 1 /D 1 ; Q) = 0, implying that ∆ 1 (A/A , B /B; C , D ) = 0. Note that the expression for S(u; w) is implicitly over paths containing the entire horizontal segments above x, y. That is, in equation 5.3, there is a summand containing K( * , C) if and only if it also contains K(C 1 , Q), because the whole expression counts paths passing through CC 1 . Thus, we can replace K(C 1 , Q) everywhere by K(C 1 , Q) := K(C, C 1 , Q). With this replacement we have that K(C 1 , Q) = 0 since C ∈ Reg(P ) and so: This implies that ∆ 1 (C 1 /C 1 , D 1 /D 1 ; Q) = 0, and, therefore, ∆ 1 (A/A , B /B; C , D ) = 0. This in turn implies that AB is contained in the lower boundary of Reg(P ) by the Equality Lemma 3.2. Now note that, since AB is in the lower boundary of Reg(P ), every path in Reg(P ) must pass through A = Y vmax +1 + e 1 = Y u3 + e 1 . Also note that, since u 0 = u 1 , we have Y u0 Y u0+1 is in the upper boundary of Reg(P ), so every path in Reg(P ) must pass through Y u0 . These two properties imply that paths differ only by the level of their horizontal segment above x and so We will use (6.2) to show that v min = u 0 + 1.
Suppose first that v min = u 0 . Then (6.2) gives us So we have F(k) 2 > F(k − 1) F(k + 1), a contradiction. Then suppose that v min = u 0 − 1. Then (6.2) gives us On the other hand, since v min = u 0 − 1 and v max = u 3 − 1, we then have m = m ≥ 2, so we can without loss of generality assume that w 2 = w 3 from the conclusion of the previous subsection. Since w 2 = w 3 , we then have: F(u 0 ; k − 1) ≤ F(u 0 ; k). Combining these two equations, we then have which is another contradiction. Hence, since v min ∈ [u 0 − 1, u 0 + 1], we conclude that we must have v min = u 0 + 1. Now recall that the combinatorial properties say that Y u0 = Y vmin −1 is contained in the upper boundary of Reg(P ), and Y vmax +1 + e 1 is contained in the lower boundary of Reg(P ). This implies (S1), as desired.
An analogous conclusion can be derived for the case u 0 > w 0 by applying the same argument. Finally, by the 180 • rotation, an analogous conclusion can be drawn for the case u 3 < w 3 and/or u 0 < w 0 . Hence for the rest of the proof we can assume that u 0 = w 0 and u 3 = w 3 if m ≥ 2.
6.5. The case m ≥ 2, u 0 = u 1 , w 2 = w 3 , u 0 = w 0 , u 3 = w 3 . Note that in this case m = u 3 − u 0 = w 3 − w 0 = m , v min = u 0 = w 0 and v max = u 3 = w 3 . We will show that this case leads to a contradiction. Claim: Either the segment (Y vmax + e 1 , Y vmin + e 1 ) is contained in the lower boundary of Reg(P ), or the segment (V vmax +k , V vmin +k ) is contained in the upper boundary of Reg(P ).
To prove the claim, let first u := v max −1 and w := v max . Since S(u; u + 1) = 0, we get from equation (5.4) that where Y = Y vmax + e 1 , Y = Y vmax −1 + e 1 and V = V vmax +k , V = V vmax +k−1 . It then follows from Special Equality Lemma 3.3 that there exists a point E for which every path counted here must pass through, and there are three subcases: (i) E is equal to A := Y vmax + e 1 and is contained in the lower boundary of Reg(P ), (ii) E is equal to D := V vmax and is contained in the upper boundary of Reg(P ), (iii) E is contained in the upper and lower boundary of Reg(P ) (which then necessarily intersect).

Case (iii).
Suppose that E is contained in the upper and lower boundary of Reg(P ), and in particular every path in Reg(P ) must pass through E. We now change our choice of u and w to u := v max −1 and w := v min +1. Note that here AB = (Y vmax + e 1 , Y vmin + e 1 ) and CD = (V vmax +k , V vmin +k ). Observe that from m ≥ 2 we have u ≥ w. It follows from S(u; w) = 0 and equation ( One of the factors must be zero, so suppose that By applying the Equality Lemma 3.2, we then have that AB = (Y vmax + e 1 , Y vmin + e 1 ) is contained in the lower boundary of Reg(P ), as desired. The case uses a similar argument. In that case, we conclude that (V vmax +k , V vmin +k ) is contained in the upper boundary of Reg(P ) instead, which proves the claim. Case (i). Suppose that E is equal to A = Y vmax + e 1 and is contained in the lower boundary of Reg(P ). Then it follows that the segment (Y vmax + e 1 , Y vmin + e 1 ) is contained in the lower boundary of Reg(P ), as desired. Case (ii). Suppose that E is equal to D = V vmax +k−1 and is contained in the upper boundary of Reg(P ). This implies that (V vmax +k , V vmax +k−1 ) is contained in the upper boundary of Reg(P ). By 180 • rotation and using the same argument, we can without loss of generality also assume that (Y vmin +1 + e 1 , Y vmin + e 1 ) is contained in the lower boundary of Reg(P ). Now let u := v max −1 and w := v min +1. It again follows from S(u; w) = 0 that ∆ 2 (A, B; C, D) = 0. Since (V vmax +k , V vmax +k−1 ) is contained in the upper boundary of Reg(P ), we have: Without loss of generality, assume that K(A, C) − K(A , C) = 0. This implies that the segment AA = (Y vmax + e 1 , Y vmax −1 + e 1 ) is contained in the lower boundary of Reg(P ), which in turn implies that (Y vmax + e 1 , Y vmin + e 1 ) is contained in the lower boundary of Reg(P ). This concludes the proof of the claim.
Applying the claim, let (Y vmax + e 1 , Y vmin + e 1 ) be contained in the lower boundary of Reg(P ), the other case are treated analogously. Note that we also have that (Y vmax , Y vmin ) is contained in the upper boundary of Reg(P ) since u 0 = u 1 . This implies that We then have So we have F(k) 2 > F(k − 1)F(k + 1), a contradiction. Hence this case does not lead to equality. 6.6. The case m < 2 and m < 2. We now check the last remaining cases of Theorem 1.7.
We first consider the case m = 0. We have L(x) = u = u 0 = u 3 is the unique possible value. Then, for every k ∈ N, we have: where N(j) is the number of linear extensions L ∈ E(P ) for which L(y) = j. It then follows from the combinatorial description of Theorem 1.6 that (S2) holds. By the same argument, we get an analogous conclusion for the case m = 0. We now consider the case m = m = 1. First note that, if either w 0 = u 0 + 1 or w 0 = u 0 − 1, then we either have F(k − 1) = 0 or F(k + 1) = 0, which contradicts the assumption that F(k) > 0. So we assume w 0 = u 0 . Let u := u 0 and w := u 0 + 1. By using S(u; u + 1) = 0, from this part of the proof in Section 5, we have an application of Lemma 3.3. By its equality criterion we see that there exists a point E for which every path counted here must pass through. We now set for brevity a := K(0, A 1 , A, E), b := K (0, B 1 , B, E), c := K(E, C, C 1 , Q), d := K(E, D, D 1 , Q).
This equation is equal to zero only if ac = bd = 0, which implies that F(k) = 0, a contradiction. This completes the proof of (a) ⇒ (e), and finishes the proof of Theorem 1.7.

Multivariate generalization
The q-weights in the introduction can be refined as follows. Let q := (q 1 , . . . , q a ) be formal variables. Define the multivariate weight of a linear extension L ∈ E(P ) as where we set L(α 0 ) := 0. In the language of lattice paths we see that the power of q i is equal to one plus the number of vertical steps on the vertical line passing through (i − 1, 0). Theorem 7.1 (Multivariate Stanley inequality). Let P = (X, ≺) be a finite poset of width two, let (C 1 , C 2 ) be the chain partition of P , and let x ∈ C 1 . Define Then: where the inequality between polynomials in the variables q = (q 1 , . . . , q a ) is coefficient-wise.
Theorem 7.2 (Multivariate Kahn-Saks inequality). Let P = (X, ≺) be a finite poset of width two, let (C 1 , C 2 ) be the chain partition of P , and let x, y ∈ C 1 be two distinct elements. Define: Then: where the inequality between polynomials in the variables q = (q 1 , . . . , q a ) is coefficient-wise.
For the proof, note that in the case x, y ∈ C 1 , the lattice paths lemmas in Subsections 2.3 and 3.1 rearrange and reassign pieces of paths via vertical translation. Thus, we preserve the total number of vertical segments above each (i, 0) in each pair of paths. Therefore, the resulting injections preserve the multivariate weight q L , and both theorems follow. We omit the details.
Remark 7.3. Note that, in general, this function is not quasi-symmetric in q 1 , q 2 , . . . , much less symmetric. This generalization is different from the quasisymmetric functions associated to P -partitions, see e.g. [Sta81,§7.19]. Still, the multivariate polynomials in the theorems can be expressed in terms of the (usual) symmetric functions in certain cases.
For example, let P be the parallel product of two chains C 1 and C 2 of sizes a and b, respectively. Clearly, e(P ) = a+b a in this case. Fix x = α s and y = α r+s . Then we have: where h i (x 1 , . . . , x k ) is the homogeneous symmetric function of degree i, see e.g. [Sta81,§7.5]. Similarly, from Section 5, we have: The ∆ terms involved in the other S(u; w) can be similarly expressed in terms of Schur functions s λ as in the formula above. We leave the details to the reader.  The proof is a straightforward case analysis and is left to the reader. Of course, the proposition also follows by combining Theorem 1.6 and Theorem 8.1. Corollary 8.4. Let P = (X, ≺) be a poset on |X| = n elements, and let x ∈ X. Then, deciding whether N(k) 2 = N(k − 1)N(k + 1) can be done in poly(n) time.
Here and everywhere below we assume that posets are presented in such a way that testing comparisons "x ≺ y" has O(1) cost, so e.g. the function f (x) can be computed in O(n) time. Proof. For the "only if " direction, let L ∈ E(P ) be a linear extension such that L(y) − L(x) = k. By definition, we have f (x) ≤ L(x) − 1 and g(y) ≤ n − L(y), which implies Furthermore, condition L(y) − L(x) = k implies that h(x, y) ≤ k − 1, as desired.
For the "if " direction, let c := min{n − g(x), n − k − g(y)}. Note that g(x) ≤ n − c and g(y) ≤ n − c − k. We also have f (x) ≤ n − g(x) − 1 by definition of upper and lower ideals, and f (x) ≤ n − k − g(y) − 1 by assumption. Combining these two inequalities, we get f (x) ≤ c − 1.
Since f (x) ≤ c − 1 and g(x) ≤ n − c, by Proposition 8.3, there is a linear extension L ∈ E(P ) such that L(x) = c. We are done if L(y) = c + k, so suppose that L(y) = c + k. We split the proof into two cases.
(1) Suppose that L(y) < c + k. Since g(y) ≤ n − c − k, there exists w ∈ X such that w || y and L(w) > L(y). Let w be such an element for which L(w) is minimal, let a := L(y) and b := L(w). The minimality assumption implies that every u ∈ {L −1 (a), . . . , L −1 (b − 1)} satisfies u y, which gives u || w. (2) Suppose that L(y) > c + k. This implies that L(y) − L(x) > k. Proceed analogously to (1). Since h(x, y) < k, there exists w ∈ X such that L(x) < L(w) < L(y), and either w || x or w || y. Assume that w || x, and let w be such an element for which L(w) is minimal. Let a := L(x) and b := L(w). This minimality assumption implies that every u ∈ {L −1 (a), . . . , L −1 (b − 1)} satisfies u x, which gives u || w.
Define L ∈ E(P ), obtained from L by setting The case w || y is completely analogous. This completes the proof of case (2), and the "if" direction.
Corollary 8.6. Let P = (X, ≺) be a poset on |X| = n elements, let k > 0, and let x, y ∈ X be distinct elements. Then deciding whether F(k) > 0 can be done in poly(n) time.
8.3. Complete equality conditions in the Kahn-Saks inequality. As we discuss in the introduction, the equivalence (a) ⇒ (b) in Theorem 1.7 does not extend to general posets. However, the condition (b) which states F(k) = F(k + 1) = F(k − 1) is of independent interest and perhaps can be completely characterized. Below we give some partial results in this direction. First, observe that the equality condition (c) in Theorem 8.1 is remarkably clean when compared to our condition (e) in Theorem 1.7. This suggests the following natural generalization.
Let P = (X, ≺) and let x, y ∈ X. We write h(x, y) := |{u ∈ X : x ≺ u ≺ y}|. We say that (x, y) satisfies k-midway property, if • f (z) + g(y) > n − k for every z ∈ X such that x ≺ z and z y, • h(z, y) > k for every z ≺ x, and f (y) > k.
Note that the last condition f (y) > k is equivalent to h(z, y) > k for z = 0, i.e. can be dropped when the element 0 is added to P . Similarly, we say that (x, y) satisfies dual k-midway property, if: • g(z) + f (x) > n − k for every z ∈ X such that z ≺ y and z ≺ x, • h(x, z) > k for every z y, and g(z) > k.
By definition, pair (x, y) satisfies the k-midway property in the poset P = (X, ≺), if and only if pair (y, x) satisfies the dual k-midway property in the dual poset P * = (X, ≺ * ), obtained by reversing the partial order: u ≺ v ⇔ v ≺ * u, for all u, v ∈ X.
Conjecture 8.7 (Complete equality condition for the Kahn-Saks inequality). Let x, y ∈ X be distinct elements of a finite poset P = (X, ≺). Denote by F(k) the number of linear extensions L ∈ E(P ), such that L(y) − L(x) = k. Suppose that k ∈ {2, . . . , n − 2} and F(k) > 0. Then the following are equivalent: (a) F(k) = F(k + 1) = F(k − 1), (b) there is an element z ∈ {x, y}, such that for every L ∈ E(P ) for which L(y) − L(x) = k, there are elements u, v ∈ X which satisfy u || z, v || z, and L(u) + 1 = L(z) = L(v) − 1, (c) the pair (x, y) satisfies either the k-midway or the dual k-midway property.
Below we prove three implications, which reduce the conjecture to the implications (a) ⇒ (c).
In other words, condition (b) in Conjecture 8.7, which is the same as condition (e) in Theorem 1.7, can be viewed as a stepping stone towards the structural condition (c) in the conjecture. We omit it from the introduction for the sake of clarity.
Proof of Theorem 8.9. For (c) ⇒ (b), let (x, y) be a pair of elements which satisfies the k-midway property. We prove (b) by setting z ← x. Let L ∈ E(P ) such that L(y) − L(x) = k. Note that L(x) > 1 as otherwise L(y) = k + 1, which contradicts the assumption that f (y) > k. Let u ∈ X be such that L(u) = L(x) − 1. Suppose to the contrary that u ≺ x. It then follows from k-midway property that h(u, y) > k. On the other hand, since L(u) = L(x) − 1 = L(y) − k − 1, we have h(u, y) ≤ k, and gives us the desired contradiction. Now, let v ∈ X be such that L(v) = L(x) + 1. We will again show that v || x. Suppose to the contrary that v x. Note that v y since L(v) < L(y). It then follows from k-midway property that f (v) > n − g(y) − k. On the other hand, since L(v) = L(x) + 1, we have f (v) ≤ L(x) = L(y) − k. We then obtain L(y) − k > n − g(y) − k, which contradicts the fact that L(y) ≤ n − g(y).
Thus, the pair of elements (u, v) are as in (b), as desired. The case when (x, y) satisfies the dual k-midway property leads analogously to (b) by setting z ← y.
For (b) ⇒ (c), suppose that in (b) we have z = x. Now let w ∈ X be such that w x and w y. The proof is based on the following Claim: There exists a linear extension L ∈ E(P ), such that L(y) − L(x) = k, L(y) = n − g(y), and L(w) = f (w) + 1.
Proof of Claim. Since F(k) > 0, there exists a linear extension L ∈ F(k), i.e. such that L(y) − L(x) = k. The claim follows if L(y) = n − g(y) and L(w) = f (w) + 1. So suppose that L(y) < n − g(y).
Then there exists p ∈ X such that p || y and L(p) > L(y), and let p be such an element for which L(p) is minimal. Let a := L(y) and b := L(p). This minimality assumption implies that every q ∈ {L −1 (a), . . . , L −1 (b − 1)} satisfies q y, which implies q || p. Now, by (b) there exists v ∈ X such that v || Denote by Ω : L → L the resulting map on F(k). From above, Ω increases L(y) by one when defined. Iterate Ω until we obtain a linear extension that satisfies L(y) − L(x) = k and L(y) = n − g(y).
We will now show that we can modify the current L to additionally satisfy L(w) = f (w) + 1. We are done if this is already the case, and since L(w) ≥ f (w) + 1 by definition of f , we can without loss of generality assume that L(w) > f (w) + 1. We will find a new L , which preserves L(x) and L(y) while decreasing L(w) by 1. Note that L(x) < L(w) < L(y) since x ≺ w y and L(y) is at its maximal value. Since L(w) > f (w) + 1, there exists p ∈ X such that p || w and L(p) < L(w), and let p be such an element for which L(p) is maximal. By the same argument as in the previous paragraph, we can then create a new linear extension L by moving p to the right of w, i.e., . This is so that the resulting linear extension L always satisfies L (y) − L (x) = k. Also note that L (w) = L(w) − 1 and L (y) = L(y) by construction.
We thus obtain a map Θ : L → L such that L (w) = L(w) − 1, while preserving the values of the linear extensions at y and x, i.e. L (y) = n − g(y) and L (y) − L (x) = k. Iterate Θ until we obtain a linear extensions that satisfies L(w) = f (w) + 1, and the proof is complete.
We now have f (w) + 1 = L(w) > L(x) + 1 = n − g(y) − k + 1, where the equalities are due to the claim above, while the inequality is due to applying (b) to conclude that L(w) = L(x) + 1 since w = v. This shows that f (w) > n − g(y) + k. Now let w ∈ X such that w ≺ x. By an analogous argument, we conclude that there exists a linear extension L ∈ E(P ) such that L(y) − L(x) = k, L(y) = f (y) + 1, and L(y) − L(w) = h(w, y) + 1. On the other hand, we have h(w, y) where the equalities are due to the claim above, while the inequality is due to applying (b) to w. This shows that h(w, y) ≥ k + 1. Now note that L(x) > 1 by (b), so it then follow that We thus conclude that (x, y) satisfies the k-midway property.
Finally, suppose that z = y. In this case we obtain that (x, y) satisfies the dual k-midway property. This follows by taking a dual poset P * , and relabeling x ↔ y, f ↔ g in the argument above. This completes the proof of the theorem. Proposition 8.11. In notation of Conjecture 8.7, let P = (X, ≺) be a poset of width two, and let (C 1 , C 2 ) be partition into two chain as in the introduction. Let (x, y) be a pair of elements in C 1 , where x = α s and y = α s+r . Then (x, y) satisfies k-midway property if and only if there are integers 1 < c < d ≤ n, such that: • β c+k−r−s ≺ α s+r ≺ β d+k−r−s , • α s || β c−s , . . . , α s || β d−s , and • α s+r || β c+(k−r−s)+1 , . . . , α s+r || β d+(k−r−s)−1 .
The proposition follow directly from the proof of Theorem 1.7 in Section 6, where we let c := v min and d := v max +1. We omit the details. Note also that when y = 1 is the maximal element, we obtain the (n − k)-pentagon property. Remark 8.12. Figure 8.1 may seem surprising at first due to its vertical symmetry. So let us emphasize that in contrast with the k-pentagon property, the k-midway property is not invariant under poset duality due to the asymmetry of the labels. This is why it is different from the dual k-midway property even for posets of width two.

9.
Final remarks and open problems 9.1. Finding the equality conditions is an important problem for inequalities across mathematics, see e.g. [BB65], and throughout the sciences, see e.g. [Dahl96]. Notably, for geometric inequalities, such as the isoperimetric inequalities, these problems are classical (see e.g. [BZ88]), and in many cases the equality conditions are equally important and are substantially harder to prove. For example, in the Brunn-Minkowski inequality, the equality conditions are crucially used in the proof of the Minkowski theorem on existence of a polytope with given normals and facet volumes (see e.g. §7.7, §36.1 and §41.6 in [Pak09]).
For poset inequalities, the equality conditions have also been studied, see e.g. an overview in [Win86]. In fact, Stanley's original paper [Sta81] raises several versions of this question. In recent years, there were a number of key advances on combinatorial inequalities using algebraic and analytic tools, see e.g. [CP21,Huh18], but the corresponding equality conditions are understood in only very few instances. 1 9.2. In a special case of the Kahn-Saks inequality, finding the equality conditions in full generality remains a major challenge. From this point of view, the equivalences (a) ⇒ (b) ⇒ (c) in Theorem 1.7 combined with Theorem 8.9 is the complete characterization in a special case of width two posets with two elements in the same chain. As we mentioned in the introduction, this result is optimal and does not extend even to elements in different chains.
We should also mention that both Stanley's inequality (Theorem 1.1) and the equality conditions in Stanley's inequality inequality (Theorem 8.1) was recently proved by elementary means in [CP21]. Despite our best efforts, the technology of [CP21] does not seem to translate to the Kahn-Saks inequality, suggesting the difference between the two. In fact, the close connection between the inequalities and equality conditions in the proofs of [CP21] hints that perhaps the equality conditions of the Kahn-Saks inequality are substantially harder to obtain. 9.3. From the universe of poset inequalities, let us single out the celebrated XYZ inequality, which was later proved to be always strict [Fis84] (see also [Win86]). Another notable example in the Ahlswede-Daykin correlation inequality whose equality was studied in a series of papers, see [AK95] and references therein.
The Sidorenko inequality is an equality if and only if a poset is series-parallel, as proved in the original paper [Sid91]. The latter inequality turned out to be a special case of the conjectural Mahler inequality. It would be interesting to find an equality condition of the more general mixed Sidorenko inequality for pairs of two-dimensional posets, recently introduced in [AASS20].
In our previous paper [CPP21a], we proved both the cross-product inequality as well the equality conditions for the case of posets of width two. While in full generality this inequality implies the Kahn-Saks inequality, the reduction does not preserve the width of the posets, so the results in [CPP21a] do not imply the results in this paper. Let us also mention some recent work on poset inequalities for posets of width two [Chen18,Sah18] generalizing the classical approach in [Lin84]. 9.4. The bijection in Lemma 2.1, see also Remark 2.2, is natural from both order theory and enumerative combinatorics points of view. Indeed, the order ideals of a width two poset P with fixed chain partitions (C 1 , C 2 ) are in natural bijection with lattice points in a region Reg(P ) ⊂ Z 2 . Now the fundamental theorem for finite distributive lattices (see e.g. [Sta99, Thm 3.4.1]), gives the same bijection between E(P ) and lattice paths 0 → (a, b) in Reg(P ). 9.5. As we mentioned in the introduction, the injective proof of the Stanley inequality (Theorem 1.3) given in Section 4, does in fact coincide with the CFG injection given in [CFG80]. The latter is stated somewhat informally, but we find the formalism useful for generalizations. In a different direction, our breakdown into lemmas allowed us a completely different generalization of the Stanley inequality to exit probabilities of random walks, which we discuss in a follow up paper [CPP21b]. 9.6. Maps Φ, Ψ, Ω, Θ on E(P ) used in the proofs of Theorem 8.5 and Theorem 8.9, are closely related to the promotion map heavily studied in poset literature, see e.g. [Sta99,§3.20] and [Sta09]. We chose to avoid using the known properties of promotion to keep proofs simple and self-contained. Note that the promotion map can also be used to prove Proposition 8.3 as we do in greater generality in the forthcoming [CPP22+]. 9.7. Recall that computing e(P ) is #P-complete even for posets of height two, or of dimension two; see [DP18] for an overview. The same holds for N(k), which both a refinement and a generalization of e(P ). Following the approach in [Pak09], it is natural to conjecture that T(x, k) := N(k) 2 − N(k + 1) N(k − 1) is #P-hard for general posets. We also conjecture that T(x, k) is not in #P even though it is in GapP ≥0 by definition. From this point of view, Corollary 8.4 is saying that the decision problem whether T(x, k) = 0 is in P, further complicating the matter.