Equality Cases of the Alexandrov–Fenchel Inequality Are Not in the Polynomial Hierarchy

Describing the equality conditions of the Alexandrov–Fenchel inequality has been a major open problem for decades. We prove that for a natural class of convex polytopes, the equality cases of the AF inequality are not in unless the polynomial hierarchy collapses to a finite level. This is the first hardness result for the problem. The proof involves Stanley’s order polytopes and a delicate analysis of linear extensions of finite posets, with some number theoretic results added to the mix. We also give applications to combinatorial interpretations of the defect of Stanley’s log-concave inequality for the number of linear extensions.

1. Introduction 1.1.Foreword.Geometric inequalities play a central role in convex geometry, probability and analysis, with numerous combinatorial and algorithmic applications.The Alexandrov-Fenchel (AF) inequality lies close to the heart of convex geometry.It is one of the deepest and most general results in the area, generalizing a host of simpler geometric inequalities such as the isoperimetric inequality and the Brunn-Minkowski inequality, see §3.1.
The equality conditions for geometric inequalities are just as fundamental as the inequalities themselves, and are crucial for many applications, see §10.2.For simpler inequalities they tend to be straightforward and follow from the proof.As the inequalities become more complex, their proofs became more involved, and the equality cases become more numerous and cumbersome.This is especially true for the Alexandrov-Fenchel inequality, where the complete description of the equality cases remain open despite much effort and many proofs, see §3.2.
We use the language and ideas from computational complexity and tools from poset theory, to prove that the equality cases of the Alexandrov-Fenchel inequality cannot be explicitly described for convex polytopes in a certain formal sense.We give several applications to stability in geometric inequalities and to combinatorial interpretation of the defect of poset inequalities.We also raise multiple questions, both mathematical and philosophical, see Section 10. 1.2.Alexandrov-Fenchel inequality.Let V(Q 1 , . . ., Q n ) denote the mixed volume of convex bodies Q 1 , . . ., Q n in R n (see below).The Alexandrov-Fenchel inequality states that for convex bodies K, L, Q 1 , . . ., Q n−2 in R n , we have: Let polytope K ⊂ R n be defined by a system of inequalities A x b.We say that K is a TUpolytope if vector b ∈ Z n , and matrix A is totally unimodular, i.e. all its minors have determinants in {0, ±1}.Note that all vertices of TU-polytopes are integral.Denote by EqualityAF the equality verification problem of the Alexandrov-Fenchel inequality, defined as the decision problem whether (AF) is an equality.
Theorem 1.1 (Main theorem).Let K, L, Q 1 , . . ., Q n−2 ⊂ R n be TU-polytopes.Then the equality verification problem of the Alexandrov-Fenchel inequality (AF) is not in the polynomial hierarchy unless the polynomial hierarchy collapses to a finite level: Informally, the theorem says that the equality cases of the Alexandrov-Fenchel inequality (AF) are unlikely to have a description in the polynomial hierarchy. 1This is in sharp contrast with other geometric inequalities, including many special cases of (AF), when the equality cases have an explicit description, thus allowing an efficient verification (see §3.1).
Let us emphasize that constraining to TU-polytopes makes the theorem stronger rather than weaker.Indeed, one would hope that the equality verification problem is easy at least in the case when both vertices and facets are integral (cf.§10.3).In fact, we chose the smallest natural class of H-polytopes which contains all order polytopes (see below).
Let us quickly unpack the very strong claim of Theorem 1.1.In particular, the theorem implies that given the polytopes, the equality in (AF) cannot be decided in polynomial time: EqualityAF / ∈ P, nor even in probabilistic polynomial time: EqualityAF / ∈ BPP (unless PH collapses).Moreover, there can be no polynomial size certificate which verifies that (AF) is an equality: EqualityAF / ∈ NP, or a strict inequality: EqualityAF / ∈ coNP (ditto).Our results can be viewed as a complexity theoretic counterpart of the geometric description of the Alexandrov-Fenchel inequality that was proved recently by Shenfeld and van Handel [SvH23].In this context, Theorem 1.1 says that this geometric description is not computationally effective, and cannot be made so under standard complexity assumptions.From this point of view, the results in [SvH23] are optimal, at least for convex polytopes in the full generality (cf.§10.12).1.3.Stability.In particular, Theorem 1.1 prohibits certain stability inequalities.In the context of general inequalities, these results give quantitative measurements of how close are the objects of study (variables, surfaces, polytopes, lattice points, etc.) to the equality cases in some suitable sense, when the inequality is close to an equality, see e.g.[Fig13].
In the context of geometric inequalities, many sharp stability results appear in the form of Bonnesen type inequality, see [Oss79].These are defined as the strengthening of a geometric inequality f g to f − g h, such that h 0, and h = 0 if and only if f = g. 2 They are named after the celebrated extension of the isoperimetric inequality by Bonnesen (see §3.3).
While there are numerous Bonnesen type inequalities of various strength for the Brunn-Minkowski inequalities and their relatives, the case of Alexandrov-Fenchel inequality (AF) remains unapproachable in full generality.Formally, define the Alexandrov-Fenchel defect as: One would want to find a bound of the form δ(•) ξ(•), where ξ is a nonnegative computable function of the polytopes.The following result is an easy corollary from the proof of Theorem 1.1.
Informally, the corollary implies that for the stability of the AF inequality, one should either avoid polytopes altogether and require some regularity conditions for the convex bodies (as has 1 The collapse in the theorem contradicts standard assumptions in computational complexity.A conjecture that the collapse does not happen is a strengthening of the P = NP conjecture that remains out of reach, see §3.8. 2 Following [Oss79], function h should also have a (not formally defined) "geometric description".
been done in the past, see §3.3), or be content with functions ξ which are hard to compute (such inequalities can still be very useful, of course).See §10.10 for further implications.
To understand how the corollary follows from the proof of Theorem 1.1, the Bonnesen condition in this case states that ξ(•) = 0 if and only if δ(•) = 0. Thus, the equality {δ(•) = ?0} can be decided in polynomial time on TU-polytopes, giving the assumption in the theorem.
1.4.Stanley inequality.We restrict ourselves to a subset of TU-polytopes given by the order polytopes (see §2.4).Famously, Stanley showed in [Sta81], that the Alexandrov-Fenchel inequality applied to certain such polytopes gives the Stanley inequality, that the numbers of certain linear extensions of finite posets form a log-concave sequence.This inequality is of independent interest in order theory (see §3.4), and is the starting point of our investigation.
Let P = (X, ≺) be a poset with |X| = n elements.Denote [n] := {1, . . ., n}.A linear extension of P is a bijection f : X → [n], such that f (x) < f (y) for all x ≺ y.Denote by E(P ) the set of linear extensions of P , and let e(P ) := | E(P )|.
Let x, z 1 , . . ., z k ∈ X and a, c 1 , . . ., c k ∈ [n]; we write z = (z 1 , . . ., z k ) and c = (c 1 , . . ., c k ), and we assume without loss of generality that c 1 < . . .< c k .Let E z c (P, x, a) be the set of linear extensions f ∈ E(P ), such that f (x) = a and f (z i ) = c i for all 1 ≤ i ≤ k.Denote by N z c (P, x, a) := E z c (P, x, a) the number of such linear extensions.The Stanley inequality [Sta81] states that the sequence N z c (P, x, a), 1 ≤ a ≤ n is log-concave: The problem of finding the equality conditions for (Sta) was first asked by Stanley in the original paper [Sta81,§3], see also [BT02,  is not in the polynomial hierarchy unless the polynomial hierarchy collapses to a finite level: In fact, the proof of Theorem 1.3 shows that, if EqualityStanley k ∈ Σ p m for some m, then PH = Σ p m+1 (i.e.collapse to the (m + 1)-th level).In Section 5, we deduce Theorem 1.1 from Theorem 1.3.For the proof, any fixed k in (Sta) suffices, of course.In the opposite direction, we prove the following extension of the Shenfeld and van Handel's result mentioned above: Theorem 1.4.EqualityStanley 1 ∈ P.
Together, Theorems 1.3 and 1.4 complete the analysis of equality cases of Stanley's inequality.1.5.Combinatorial interpretation.The problem of finding a combinatorial interpretation is fundamental in both enumerative and algebraic combinatorics, and was the original motivation of this investigation (see §3.7).Although very different in appearance and technical details, there are certain natural parallels with the stability problems discussed above.
Let f g be an inequality between two counting functions f, g ∈ #P.We say that (f − g) has a combinatorial interpretation, if (f − g) ∈ #P.While many combinatorial inequalities have a combinatorial interpretation, for the Stanley inequality (Sta) this is an open problem.Formally, let Φ z c (P, x, a) := N z c (P, x, a) 2 − N z c (P, x, a + 1) • N z c (P, x, a − 1) denote the defect in (Sta).Let φ k : P, X k+1 , [n] k+1 → N be the function computing Φ z c (P, x, a).
Corollary 1.5.For all k ≥ 2, function φ k does not have a combinatorial interpretation unless the polynomial hierarchy collapses to the second level: To see some context behind this result, note that N z c (P, x, a) ∈ #P by definition, so φ k ∈ GapP ≥0 , a class of nonnegative functions in GapP := #P − #P.We currently know very few functions which are in GapP ≥0 but not in #P.The examples include 2 and e(P ) − e(P ′ ) 2 , where F, F ′ are CNF Boolean formulas and P, P ′ are posets [CP23a,IP22].In other words, all three functions in (⊛) do not have a combinatorial interpretation (unless PH collapses).The corollary provides the first natural example of a defect function that is GapP ≥0 but not in #P.
To understand how the corollary follows from the proof of Theorem 1.3, note that φ 2 ∈ #P implies that there is a polynomial certificate for the Stanley inequality being strict.In other words, we have EqualityStanley 2 ∈ coNP, giving the assumption in the theorem.
Structure of the paper.We begin with definitions and notation in Section 2, followed by the lengthy background and literature review in Section 3 (see also §10.1).In the key Section 4, we give proofs of Theorems 1.1 and 1.3, followed by proofs of Corollaries 1.2 and 1.5.These results are reduced to several independent lemmas, which are proved one by one in Sections 5-8.We prove Theorem 1.4 in Section 9.This section is independent of the previous sections (except for notation in §6.1).We conclude with extensive final remarks and open problems in Section 10.

Mixed volumes.
Fix n ≥ 1.For two sets A, B ⊂ R n and constants α, β > 0, denote by the Minkowski sum of these sets.For a convex body K ⊂ R n with affine dimension d, denote by Vol d (K) the volume of K. We drop the subscript when d = n.
One of the basic result in convex geometry is Minkowski's theorem, see e.g.[BZ88, §19.1], that the volume of convex bodies with affine dimension d behaves as a homogeneous polynomial of degree d with nonnegative coefficients: Theorem 2.1 (Minkowski).For all convex bodies K 1 , . . ., K r ⊂ R n and λ 1 , . . ., λ r > 0, we have: where the functions V(•) are nonnegative and symmetric, and where d is the affine dimension of λ 1 K 1 + . . .+ λ r K r (which does not depend on the choice of λ 1 , . . ., λ r ).
The coefficients V(A i 1 , . . ., A i d ) are called mixed volumes of A i 1 , . . ., A i d .We refer to [HW20, Lei80,Schn14] for an accessible introduction to the subject.2.3.Posets.For a poset P = (X, ≺) and a subset Y ⊂ X, denote by P Y = (Y, ≺) a subposet of P .We use (P − z) to denote a subposet P X−z , where z ∈ X. Element x ∈ X is minimal in P , if there exists no element y ∈ X − x such that y ≺ x.Define maximal elements similarly.Denote by min(P ) and max(P ) the set of minimal and maximal elements in P , respectively.
In a poset P = (X, ≺), elements x, y ∈ X are called parallel or incomparable if x ≺ y and y ≺ x.We write x y in this case.Comparability graph is a graph on X, with edges (x, y) where x ≺ y.Element x ∈ X is said to cover y ∈ X, if y ≺ x and there are no elements z ∈ X such that y ≺ z ≺ x.
A chain is a subset C ⊂ X of pairwise comparable elements.The height of poset P = (X, ≺) is the maximum size of a chain.An antichain is a subset A ⊂ X of pairwise incomparable elements.The width of poset P = (X, ≺) is the size of the maximal antichain.
A dual poset is a poset P * = (X, ≺ * ), where x ≺ * y if and only if y ≺ x.
, where the relation ≺ ⋄ coincides with ≺ and ≺ ′ on X and Y , and x y for all x ∈ X, y ∈ Y .A linear sum P ⊕ Q of posets P = (X, ≺) and Q = (Y, ≺ ′ ) is a poset (X ∪ Y, ≺ ⋄ ), where the relation ≺ ⋄ coincides with ≺ and ≺ ′ on X and Y , and x ≺ ⋄ y for all x ∈ X, y ∈ Y .
Posets constructed from one-element posets by recursively taking disjoint and linear sums are called series-parallel.Both n-chain C n and n-antichain A n are examples of series-parallel posets.Forest is a series-parallel poset formed by recursively taking disjoint sums (as before), and linear sums with one element: C 1 ⊕ P .We refer to [Sta12,Ch. 3] for an accessible introduction, and to surveys [BW00,Tro95] for further definitions and standard results.
Similarly, the chain polytope (also known as the stable set polytope) S P ⊂ R n is defined as In [Sta86], Stanley computed the volume of both polytopes: (2.4) Vol(O P ) = Vol(S P ) = e(P ) n! .
This connection is the key to many applications of geometry to poset theory and vice versa.
2.5.Terminology.For functions f, g : X → R, we write f g, if f (x) ≥ g(x) for all x ∈ X.For an inequality f g, the defect is a function h := f − g.The equality cases to describe the set of x ∈ X such that f (x) = g(x).Denote by X h := {x ∈ X : h(x) = 0} ⊆ X the subset of equality cases.
We use E h to denote the equality verification of f (x) = g(x), i.e. the decision problem where x ∈ X is an input.Since E h = x ∈ ?X h }, this is a special case of the inclusion problem.
We use V h to denote the verification of h(x) = a, i.e. the decision problem where a ∈ R and x ∈ X are the input.Clearly, V h is a more general problem than E h .For a subset Y ⊆ X, we use description for an equivalent condition for the inclusion problem x ∈ ?Y , where x ∈ X.We use equality conditions for a description of E h .We say that equality cases of f g have a description in the polynomial hierarchy if E h ∈ PH.In other words, there is a CNF Boolean formula Φ(y 1 , y 2 , y 3 , . . ., x), such that ∀x ∈ X : E h ⇐⇒ ∃y 1 ∀y 2 ∃y 3 . . .Φ(y 1 , y 2 , y 3 , . . ., x).
2.6.Complexity.We assume that the reader is familiar with basic notions and results in computational complexity and only recall a few definitions.We use standard complexity classes: P, FP, NP, coNP, #P, Σ p m and PH.The notation {a = ?b} is used to denote the decision problem whether a = b.We use the oracle notation R S for two complexity classes R, S ⊆ PH, and the polynomial closure A for a problem A ∈ PSPACE.We will also use less common classes Note that coNP ⊆ C = P.
We also assume that the reader is familiar with standard decision and counting problems: 3SAT, #3SAT and PERMANENT.Denote by #LE the problem of computing the number e(P ) of linear extensions.For a counting function f ∈ #P, the coincidence problem is defined as: Note the difference with the equality verification problem E f −g defined above.Clearly, we have both E f −g ∈ C = P and C f ∈ C = P.Note also that C #3SAT is both C = P-complete and coNP-hard.
The distinction between binary and unary presentation will also be important.We refer to [GJ78] and [GJ79, §4.2] for the corresponding notions of NP-completeness and strong NPcompleteness.Unless stated otherwise, we use the word "reduction" to mean "polynomial Turing reduction".We refer to [AB09,Gol08,Pap94] for definitions and standard results in computational complexity.

Background and historical overview
3.1.Geometric inequalities.The history of equality conditions of geometric inequalities goes back to antiquity, see e.g.[Blå05,Por33], when it was discovered that the isoperimetric inequality is an equality if and only if X is a circle.Here ℓ(X) is the perimeter and a(X) is the area of a convex X ⊂ R 2 .This classical result led to numerous extensions and generalizations leading to the Alexandrov-Fenchel inequality (AF).We refer to [BZ88,Schn14] for a review of the literature.Below we highlight only the most important developments to emphasize how the equality conditions become more involved as one moves in the direction of the AF inequality (see also §10.4 and §10.5).The celebrated Brunn-Minkowski inequality states that for all convex K, L ⊂ R d , we have: , see e.g.[Gar02] for a detailed survey.This inequality "plays an important role in almost all branches of mathematics" [Bar07].Notably, both Brunn and Minkowski showed the equality in (BM) holds if and only if K is an expansion of L.
For the mean width inequality for all convex K ⊂ R 3 , Minkowski conjectured (1903) the equality cases are the cap bodies (balls with attached tangent cones).Here s(K) is the surface area and w(K) is the mean width of K. Minkowski's conjecture was proved by Bol (1943), see e.g.[BF34,BZ88].The Minkowski's quadratic inequality for three convex bodies K, L, M ⊂ R 3 , states: This is a special case of (AF) for n = d = 3.When L = B 1 is a unit ball and K = M, this gives (MWI).Favard [Fav33,p. 248] wrote that the equality conditions for (MQI) "parait difficile à énonce" ("seem difficult to state").There are even interesting families of convex polytopes that give equality cases (see e.g.[SvH23, Fig. 2.1]).
Shenfeld and van Handel [SvH22] gave a complete characterization of the equality cases of (MQI) as triples of convex bodies that are similarly truncated in a certain formal sense.Notably, for the full-dimensional H-polytopes in R3 , each with at most n facets, the equality conditions amount to checking O(n) linear relations for distances between facet inequalities.This can be easily done in polynomial time.
3.2.Alexandrov-Fenchel inequality.For the AF inequality (AF), the equality conditions have long believed to be out of reach, as they would generalize those for (MWI) and (MQI).Alexandrov made a point of this in his original 1937 paper: "Serious difficulties occur in determining the conditions for equality to hold in the general inequalities just derived" [Ale37, §4].Half a century later, Burago and Zalgaller reviewed the literature and summarized: "A conclusive study of all these situations when the equality sign holds has not been carried out, probably because they are too numerous" [BZ88, §20.5].Schneider made a case for perseverance: "As (AF) represents a classical inequality of fundamental importance and with many applications, the identification of the equality cases is a problem of intrinsic geometric interest.Without its solution, the Brunn-Minkowski theory of mixed volumes remains in an uncompleted state."[Schn94,p. 426].The AF inequality has a number of proofs using ideas from convex geometry, analysis and algebraic geometry, going back to two proofs by Alexandrov (Fenchel's full proof never appeared).We refer to [BZ88,Schn14] for an overview of the older literature, especially [Schn14,p. 398] for historical remarks, and to [BL23, CP22, CKMS19, KK12, SvH19, Wang18] for some notable recent proofs.All these proofs use a limit argument at the end, which can create new equality cases that do not hold for generic convex bodies.This partially explains the difficulty of the problem (cf.§10.2 and [SvH22, Rem.3.7]).
In [Ale37], Alexandrov gave a description of equality cases for combinatorially isomorphic polytopes.This is a large family of full-dimensional polytopes, for which every convex body is a limit.In particular, he showed that for the full-dimensional axis-parallel boxes [ℓ 1 ×. ..×ℓ n ], the equality in (AF) is equivalent to K and L being homothetic (cf.§10.6).
In the pioneering work [Schn85], Schneider published a conjectural description of the equality cases, corrected later by Ewald [Ewa88], see also [Schn14].After many developments, this conjecture was confirmed for all smooth (full-dimensional) convex bodies Q i [Schn90a], and for all (not necessarily full-dimensional) convex bodies Q 1 = . . .= Q n−2 , by Shenfeld and van Handel [SvH23].Closer to the subject of this paper, in a remarkable development, the authors gave a geometric description of the equality cases for all convex polytopes.They explain: "Far from being esoteric, it is precisely the case of convex bodies with empty interior (which is not covered by previous conjectures) that arises in combinatorial applications" [SvH23, §1.3].The geometric description of the equality cases in [SvH23] is indirect, technically difficult to prove, and computationally hard in the degenerate cases. 3While we will not quote the full statement (Theorem 2.13 in [SvH23]), let us mention the need to find witnesses polytopes M i , N i ⊂ R n which must satisfy certain conditions (Def.2.10, ibid.)The second of these conditions is an equality of certain mixed volumes (Eq.(2.4), ibid.) In [SvH23, §2.2.3], the authors write: "Condition (2.4) should be viewed merely as a normalization". 4From the computational complexity point of view, asking for the equality of mixed volumes (known to be hard to compute, see §3.8), lifts the problem outside of the polynomial hierarchy, to a hard coincidence problem (see §2.6).This coincidence problem eventually percolated into [MS24], see (3.3) below, which in turn led directly to this work.
3.3.Stability.Bonnesen's inequality is an extension of the isoperimetric inequality (Isop), which states that for every convex X ⊂ R 2 , we have: where R is the smallest radius of the circumscribed circle, and r is the maximal radius of the inscribed circle.5Moreover, Bonnesen proved [Bon29], that there is an annulus (thin shell) U between concentric circles of radii R ≥ r, such that ∂X ⊆ U and (Bon) holds.Note that the optimal such annulus can be computed in polynomial time, see [AAHS99].
Bonnesen's inequality (Bon) was an inspiration for many Bonnesen type inequalities [Oss78,Oss79,Gro90].See also discrete versions in §10.4,and applications in computational geometry in [KS99].There is now an extensive literature on stability inequalities in geometric and more general context, see e.g.[Fig13,Gro93].
There is an especially large literature on the stability of the Brunn-Minkowski inequality (BM).For major early advances by Diskant (1973), Groemer (1988) and others, see e.g.[Gro93] and references therein.We refer to [Fig14] for an overview of more recent results, including [FMP09,FMP10].See also [EK14] for the thin shell type bounds, and [FJ17] for the stability of (BM) for nonconvex sets.
For the Alexandrov-Fenchel inequality (AF), the are very few stability results, all for the full dimensional convex bodies with various regularity conditions, see e.g.[Mar17,Schn90b].
3.4.Linear extensions.Linear extensions play a cental role in enumerative combinatorics and order theory.They appear in connection with saturated chains in distributive lattices, standard Young tableaux and P -partitions, see e.g.[Sta12].
The world of inequalities for linear extensions has a number of remarkable results, some with highly nontrivial equality conditions.Notably, the Björner-Wachs inequality for e(P ) is an equality if and only if P is a forest [BW89, Thm 6.3], see also [CPP23b].On the other hand, the celebrated XYZ inequality established by Shepp in [She82] (see also [AS16,§6.4]),has no nontrivial equality cases [Fis84].
An especially interesting example is the Sidorenko inequality for posets P, P • on the same ground set with n elements, which have complementary comparability graphs [Sid91] (other proofs are given in [CPP23b,GG22]).Sidorenko also proved that the series-parallel posets are the only equality cases.This solves the equality verification problem of (3.1), since the recognition problem of series-parallel posets is in P, see [VTL82].It was noticed in [BBS99], that the Sidorenko inequality follows from Mahler's conjecture, which states that for every convex centrally symmetric body K ⊂ R n , we have: To derive (3.1) from (3.2), take K to be the union all axis reflections the chain polytope S P defined in (2.3).Mahler's conjecture (3.2) is known for all axis symmetric convex bodies [StR81], but remains open in full generality [AASS20], in part due to the many equality cases [Tao08, §1.3].

Stanley inequality.
Stanley's inequality (Sta) is of independent interest in order theory, having inspired a large literature especially in the last few years.The case k = 0 is especially interesting.The unimodality in this case was independently conjectured by Kislitsyn [Kis68] and Rivest, while the log-concavity was conjectured by Chung, Fishburn and Graham [CFG80], who established both conjectures for posets of width two.Stanley proved them in [Sta81] in full generality. 6The authors of [CFG80] called Rivest's conjecture "tantalizing" and Stanley's proof "very ingenious".The Kahn-Saks inequality is a generalization of the k = 0 case of (Sta), and is also proved from the AF inequality.This inequality was used to obtain the first positive result in the direction of the 1 3 − 2 3 conjecture [KS84].For posets of width two, both the k = 0 case of the Stanley inequality, and the Kahn-Saks inequality have natural q-analogues [CPP23a].A generalization of Stanley's inequality to marked posets was given in [LMS19].
For all k ≥ 0, the vanishing conditions {N As we mentioned in the introduction, Shenfeld and van Handel resolved the k = 0 case of Stanley equality conditions by giving explicit necessary and sufficient conditions, which can be verified in polynomial time, see [SvH23].Similar explicit necessary and sufficient conditions for the Kahn-Saks inequality were conjectured in [CPP23a, Conj.8.7], and proved for posets of width two.Building on the technology in [SvH23], van Handel, Yan and Zeng gave the proof of this conjecture in [vHYZ23].
In [CP24a], we gave a new proof of the k = 0 case of (Sta), using a combinatorial atlas technology.This is an inductive self-contained linear algebraic approach; see [CP22] for the introduction.We also gave a new proof of the Shenfeld and van Handel equality conditions, and generalized both results to weighted linear extensions (see § §1.16-18 in [CP24a]).
In an important development, Ma and Shenfeld [MS24] advanced the technology of [SvH23], to give a clean albeit ineffective combinatorial description of the equality cases in full generality.In particular, they showed that (AF) is an equality if and only if They proceeded to give explicit necessary and sufficient conditions for these equalities in some cases (see §10.11).About the remaining cases that they called critical (see §9.2), they write: "It is an interesting problem to find [an explicit description] for critical posets" [MS24, Rem.1.6].Our Theorem 1.3 implies that such a description is unlikely, as it would imply a disproof of a major conjecture in computational complexity (see also §10.12).

Complexity aspects.
There are two standard presentations of polytopes: H-polytopes described by the inequalities and V-polytopes described by the vertices.These two presentation types have very different nature in higher dimensions, see e.g.[DGH98].We refer to [GK94,GK97] for an overview of standard complexity problems in geometry, and to [Schr86, §19], [Schr03, §5.16], for the background on totally unimodular matrices and TU-polytopes.Note also that testing whether matrix A is totally unimodular can be done in polynomial time, see [Sey80].
When the dimension n is bounded, H-polytopes and V-polytopes have the same complexity, so the volume and the mixed volumes are in FP.Thus, the dimension n is unbounded throughout the paper.The volume of TU-polytopes is #P-hard via reduction to KNAPSACK [DF88].Note that for rational H-polytopes in R n , the volume denominators can be doubly exponential [Law91], thus not in PSPACE.This is why we constrain ourselves to TU-polytopes which is a subclass of H-polytopes that includes all order polytopes (see §5.1).
The mixed volume V(Q 1 , . . ., Q n ) coincides with the permanent when all Q i are axis parallel boxes, see [vL82] and §10.6.Thus, computing the mixed volume is #P-hard even for the boxes, see [DGH98].For rational H-polytopes, the vanishing problem {V(•) = ?0} can be described combinatorially, and is thus in NP, see [DGH98,Est10].It is equivalent to computing the rank of intersection of two geometric matroids (with a given realization), which is in P, see [Schr03,§41].For TU-polytopes in R n , the uniqueness problem V(•) = ? 1 n! is in NP by a result in [EG15].The problem #LE is proved #P-complete by Brightwell and Winkler [BW91, Thm 1], and this holds even for posets of height two [DP20].Linial noticed [Lin86], that this result and (2.4) together imply that the volume of H-polytopes is #P-hard even when the input is in unary.Linial also observed that the number of vertices of order polytopes is #P-complete (ibid.) Now, fix k ≥ 0, x ∈ X and z ∈ X k .Clearly, we have: where the summation has size O(n k+1 ).Thus, computing N z c (P, x, a) is also #P-complete.
Finally, it was proved in [CP23a], that C #3SAT , C PERMANENT and C #LE are not in PH, unless PH collapses to a finite level.The proof idea of Theorem 1.3 is inspired by these results.3.7.Combinatorial interpretations.Finding a combinatorial interpretation is a standard problem throughout combinatorics, whenever a positivity phenomenon or an inequality emerges.Having a combinatorial interpretation allows one to deeper understand the underlying structures, give asymptotic and numerical estimates, as well as analyze certain algorithms.We refer to [Huh18,Sta89,Sta00] for an overview of inequalities in algebraic combinatorics and matroid theory, and to [Pak22] for a recent survey from the complexity point of view.
Recall that GapP := #P − #P is a the class of difference of two #P functions, and let GapP ≥0 be a subclass of GapP of nonnegative functions.Thus, for every inequality f g of counting functions f, g ∈ #P, we have see also the first function in (⊛).The other two functions in (⊛) were given in [CP23a].A natural GapP ≥0 problem of computing S n character squared: [χ λ (µ)] 2 , was proved not in #P (in unary), under the same assumptions [IPP22].
The idea that some natural combinatorial inequalities can have no combinatorial interpretations appeared in [Pak19].A number of interesting examples were given in [IP22, §7], including the Cauchy, Minkowski, Hadamard, Karamata and Ahlswede-Daykin inequalities, all proved not in #P under varying complexity assumptions.
Closer to the subject of this paper, Ikenmeyer and the second author showed that the AF defect δ(•) is not in #P (unless PH = Σ p 2 ), even for axis parallel rectangles in R 2 whose edge length are given by #3SAT formulas [IP22, Thm 7.1.5].This is a nonstandard model of computation.One can think of our Main Theorem 1.1 as a tradeoff: in exchange for needing a higher dimension, we now have unary input and the standard model of computation.
3.8.Complexity assumptions.The results in the paper use different complexity assumptions, and navigating between them can be confusing.Here is short list of standard implications: In other words, the assumption in Theorems 1.1 and 1.3 is the strongest, while P = NP is the weakest.Proving either of these would be a major breakthrough in theoretical computer science.Disproving either of these would bring revolutionary changes to the way the computational complexity understands the nature of computation.We refer to [Aar16,Wig19] for an extensive discussion, philosophy and implications in mathematics and beyond.

Proof roadmap
The results in the paper follow from a series of largely independent polynomial reductions and several known results.In this section, we only state the reductions whose proofs will be given in the next few sections.We then deduce both theorems from these reductions.4.1.Around Stanley equality.First, we show that Theorem 1.1 follows from Theorem 1.3.Recall the notation from the introduction.Let P = (X, ≺) be a poset on |X| = n elements.As before, let x ∈ X, a ∈ [n], z ∈ X k , and c ∈ [n] k .Recall also where N z c (P, x, a) are defined in §1.4.
The proof of the proposition is given in Section 5, is very close to Stanley's original proof of the inequality (Sta).The key difference is the observation that slices of order polytopes are TU-polytopes.Next, we need a simple technical result.
Proof.Let P = (X, ≺) be a poset on n elements, and let z ∈ X k , c ∈ [n] k , x ∈ X, a ∈ [n] be as in §1.4.Denote by Varying a, we conclude that EqualityStanley k is equivalent to EqualityStanley ℓ in this special case.This gives the desired reduction.
Next, we simplify the Stanley equality problem to the following flatness problem: The idea is to ask whether a is in the flat part of the distribution of f (x) (cf. Figure 15.1 in [SvH23]).
We prove Lemma 4.3 in Section 6.

4.2.
Relative numbers of linear extensions.Let P = (X, ≺) be a poset on |X| = n elements, and let min(P ) ⊆ X be the set of minimal elements of P .For every x ∈ min(P ), define the relative number of linear extensions: (4.1) ρ(P, x) := e(P ) e(P − x) .
In other words, ρ(P, x) = P[f (x) = 1] −1 , where f ∈ E(P ) is a uniform random linear extension of P .Denote by #RLE the problem of computing ρ(P, x).
Lemma 4.4.#RLE is polynomial time equivalent to #LE.
Proof.By definition, #RLE reduces to #LE.In the opposite direction, let P = (X, ≺) be a poset on |X| = n elements.Fix a linear extension g ∈ E(P ), and let Denote by P i a subposet of P restricted to x i , . . ., x n and observe that x i ∈ min(P i ).We have: which gives the desired reduction from #LE to #RLE.
We relate RLE to flatness equality through the following series of reductions.Consider the following coincidence problem: where P = (X, ≺), Q = (Y, ≺ ′ ) are posets, and x ∈ min(P ), y ∈ min(Q).Next, consider the following decision problem: where P 1 , P 2 , P 3 , P 4 are finite posets and x i ∈ min(P i ), for all 1 ≤ i ≤ 4. Note that the opposite direction "⊇" is also true and easy to prove.Indeed, suppose you have an oracle VerRLE.Guess the values a i := ρ(P i , x i ) ∈ Q, verify that they are correct, and check that a 1 • a 2 = a 3 • a 4 .This gives QuadRLE.We will only need the direction in the lemma which is highly nontrivial.4.4.Putting everything together.We can now obtain all the results stated in the introduction, except for Theorem 1.4 which uses different tools and is postponed until Section 9.
Proof of Theorem 1.3.Recall that #LE is #P-complete [BW91] (see also §3.6).By Lemma 4.4, we conclude that #RLE is #P-hard.We then have: where the first inclusion is Toda's theorem [Toda91], the second inclusion is because #RLE is #P-hard, and the third inclusion is because one can simulate #RLE by first guessing and then verifying the answer.Fix k ≥ 2. Combining Lemmas 4.2, 4.3, 4.5 and 4.6, we conclude that QuadRLE reduces to EqualityStanley k .We have: where the first inclusion is the Verification Lemma 4.7.Now, suppose EqualityStanley k ∈ PH.
As a byproduct of the proof, we get the same conclusion for the intermediate problems.This result is potentially of independent interest (cf.[CP23a]).Proof of Corollary 1.2.By the "Bonnesen type" assumption, we have Since computing ξ is in FP, we have EqualityAF ∈ P. Then (4.5) for k = 2, and Proposition 4.1 give: as desired.

AF equality from Stanley equality
5.1.Slices of order polytopes.Let P = (X, ≺) be a poset on |X| = n elements.Recall the construction of order polytopes O P ⊆ [0, 1] n given in (2.2).Fix z 1 ≺ . . .≺ z k and 1 ≤ c 1 < . . .< c k ≤ n.Denote Z := {z 1 , . . ., z k } and let Y := X Z.For all 0 ≤ i ≤ k, consider the following slices of the order polytopes: Here the conditions x z i and x z i+1 are vacuous when i = 0 and i = k, respectively.Note that dim S i ≤ n − k for all 0 ≤ i ≤ k, since α x is a constant on S i for all x ∈ Z. 7 The same argument implies that these slices are themselves order polytopes of subposets of P , a fact we do not need.Instead, we need the following simple result: (5.1) V S 0 , . . ., S 0 Now let z i ← x and c i ← a for some i, such that 1 ≤ c 1 < . . .< c k ≤ n.By Lemma 5.2, the AF inequality (AF) becomes (Sta).By Lemma 5.1, slices S i ⊂ R n are TU-polytopes defined by O(n 2 ) inequalities.This gives the desired reduction.
6. Stanley equality from flatness 6.1.Ma-Shenfeld poset notation.Recall the following terminology from [MS24].Let s ∈ {−1, 0, 1} .For any f ∈ E z c (P, x, a + s), the companions in f are the elements in Note that |Com(f )| = 2 for all s as above.Let the lower companion lc(f ) ∈ Com(f ) be the companion with smaller of the two values in f .Similarly, let the upper companion uc(f ) ∈ Com(f ) be the companion with larger of the two values in f .Denote by C(x) ⊂ X the set of elements y ∈ X comparable to x, i.e.C(x) := {y ∈ X : x ≺ y or x ≻ y}.6.2.Proof of Lemma 4.3.Let P = (X, ≺), and let x, a, z = (z 1 , . . ., z k ) and c = (c 1 , . . ., c k ) be an instance of FlatLE k as in Lemma 4.3.To prove the reduction in the lemma, we construct a poset Q = (Y, ≺) for which P is a subposet, and x, b, y and x, which give the desired instance EqualityStanley k+2 .
Without loss of generality, we can assume that min(P ) = {z 0 } and max(P ) = {z k+1 }.In other words, assume that there are elements z 0 , z k+1 ∈ X such that z 0 y z k+1 for all y ∈ X.
Let M 1 , M 2 , M 3 be given by Note that the two sets in the definition of M 3 are in bijection with each other via the map that swaps f (a) with f (a + 1) .It then follows from here that N z c (P, x, a) = M 1 + M 3 and N z c (P, x, a + 1) = M 2 + M 3 .
In the notation above, for s ∈ {−1, 0, 1} and f ∈ E y b (Q, x, b + s), the companions in f are the elements in Claim 6.1.We have: Proof.We only compute the values F(b, * , * ), as proof of the other cases is analogous.Denote by E z c (P ) the set of all linear extensions f ∈ E(P ), such that f (z i ) = c i for all i.
Let ψ : E y b (Q) → E z c (P ) be the map given by ψ(f ) = g, where for all s ∈ X.It follows from the definition of lc(f ) and uc(f ), that It then follows that ϕ restricted to F(b, com, inc) is a bijection onto g ∈ E z c (P, x, a + 1) : g −1 (a + 1) ≺ x , which gives us F(b, com, inc) = M 2 .Similar arguments gives F(b, inc, com) = M 1 .Note that F(b, com, com) = 0, because v is always a companion in f but v x by definition.Note also that It then follows that ψ restricted to F(b, com, inc) is a bijection onto g ∈ E z c (P, x, a + 1) : g −1 (a) x ∪ g ∈ E z c (P, x, a) : g −1 (a + 1) x , which gives F(b, inc, inc) = 2M 3 .This finishes proof of the claim.
By the claim, we have: Similarly, we have: We conclude: This implies that (6.2) Lemma 4.3 now follows by combining (6.1) and (6.2).

Flatness from the quadruple relative ratio
Recall several key definitions from Section 4. Let N(R, z, c) be the number of linear extensions f ∈ E(R) for which f (z) = c.Similarly, let Proof.Let P * = (X, ≺ * ) be the dual poset of P .Define R = (Z, ≺ • ) to be a poset on where w, z are two new elements.Let the partial order ≺ • coincide with ≺ * on (X − x), and with ≺ ′ on (Y − y), with additional relations p ≺ • w if and only if x ≺ p , for all p ∈ X − x, (7.4) w ≺ • q if and only if y ≺ ′ q , for all q ∈ Y − y. (7.5)That is, we are taking the series sum (P * − x) ⊕ {z} ⊕ (Q − y), then adding an element w to emulate x in P for f (w) < f (z), where f ∈ E(R), and emulate y in Q when f (w) > f (z).It then follows from a direct calculation that N(R, z, n + 1) = e(P ) • e(Q − y).Indeed, by (7.3), for every f ∈ N (R, z, n + 1) we have: These two labelings define a linear extension of P * after a substitution w ← x given by (7.4), and a linear extension of Q − y, and it is clear that this construction defines a bijection.By an analogous argument, we have: Set c ← n.Combining these two observations, we get which gives the desired reduction and proves the result.
The following result give a quantitative version of Lemma 4.6.
We now build toward the proof of this theorem. .
Proof.Let P * = (X, ≺ * ) denotes the dual poset to P .Let R := (Z, ≺ • ) be given by where ≺ • inherits the partial order ≺ * on X − x, the partial order ≺ ′ on Y − y , and with additional relations: That is, we are taking the series sum (P * − x) ⊕ {v} ⊕ (Q − y), then adding an element w to emulate x in P for all f (w) < f (v), emulate y in Q for all f (w) > f (v), and finally adding z to track the value of f (v).Here the linear extension f ∈ E(R) in each case.By construction, we have either Claim.We have: For such f we have: Note that the restriction of f to f −1 (1), . . ., f −1 (m) defines a linear extension of (P * − x + z).Additionally, note that the restriction of f to f −1 (m + 2), . . ., f −1 (m + n + 1) defines a linear extension of Q.It is also clear that this construction defines a bijection.In total, we have e(P * − x + z) e(Q) = m e(P − x) e(Q) linear extensions f as above.
Similarly, let us show that the second term (m + 1) e(P ) e(Q − y) is the number of linear extensions f ∈ E(R) s.t.f (v) = m + 2. For such f we have: Note that the restriction of f to f −1 (1), . . ., f −1 (m + 1) defines a linear extension of (P * + z).Additionally, note that the restriction of f to f −1 (m + 3), . . ., f −1 (m + n + 1) defines a linear extension of (Q − y).It is also clear that this construction defines a bijection.In total, we have e(P * + z) e(Q − y) = (m + 1) e(P ) e(Q − y) linear extensions f as above.This completes the proof.Proof.Let Q be as in the proof of Lemma 7.4.Note that x ∈ min(Q), and that since z is the unique minimal element in Q − x.We now take y ← x, and observe that = e(P ) + e(P − x) e(P − x) = 1 + ρ(P, x), as desired.
Additionally, poset P has On the other hand, by Lemma 7.3 we get a poset Q and y ∈ min(Q), s.t.such that , and with as desired.

Verification lemma
The proof of the Verification Lemma 4.7 is different from other reductions which are given by parsimonious bijections.Before proceeding to the proof, we need several technical and seemingly unrelated results.8.1.Continued fractions.Given a 0 ≥ 0 , a 1 , . . ., a s ∈ Z ≥1 , where s ≥ 0, the corresponding continued fraction is defined as follows: [a 0 ; a 1 , . . ., a s ] := a 0 + 1 a 1 + 1 . . .+ 1 as Numbers a i are called quotients, see e.g.[HW08, §10.1].We refer to [Knu98, §4.5.3] for a detailed asymptotic analysis of the quotients in connection with the Euclidean algorithm, and further references.The following technical result is key in the proof of the Verification Lemma.Proof.This follows from [a 1 ; a 2 , . . ., a s ] = [0; a 1 , . . ., a s ] −1 .
Remark 8.3.Proposition 8.1 was proved implicitly in [KS21,§3].Unfortunately, the notation and applications in that paper are very different from ours, so we chose to include a self-contained proof for completeness.
We now present the proof of Proposition 8.1, which uses the following corollary of Lemma 7.4 and Lemma 7.5.
Proof.Use Lemma 7.4 once, and Lemma 7.5 (a − 1) times.Also note that the operations used in Lemma 7.4 and Lemma 7.5 do not increase the width of the poset Q if the input poset P is not a chain.
Proof of Proposition 8.1.We use induction on s.For s = 0, let P := C a 0 −1 + {x} be a disjoint sum of two chains, and observe that ρ(P, x) = a 0 .Suppose the claim holds for s − 1, i.e. there exists a poset P 1 on n = a 1 + . . .+ a s elements and x 1 ∈ min(P 1 ), such that ρ(P 1 , x 1 ) = [a 1 ; a 2 , . . ., a s ], and with |P 1 | = a 1 + . . .+ a s .By Corollary 8.4, there exists a poset Q on a 0 + n elements, and x ∈ min(P ), such that This completes the proof.Note that every rational number can be represented by continued fractions in two ways (depending if the last quotient is strictly greater than 1, or is equal to 1), and S A (m) are equal for both representations.Also note that (8.1) and m ′ := m gcd(A, m) are normalized to be coprime integers.The following technical result will also be used in the proof of the Verification Lemma 4.7.
Proposition 8.5.There exists a constant C > 0, such that for all coprime integers A, B which satisfy C < B < A < 2B, there exists an integer m := m(A, B) such that m < B, We now build toward the proof of this result.We need the following technical result.Lemma 8.6 (Yao-Knuth [YK75]).We have: By the Markov inequality, it follows from Lemma 8.6 that To prove the result, it sufficed to show that Now, it follows from the inclusion-exclusion principle, that On the other hand, we have: and Combining these inequalities, we get and the result follows since 1 − 9 π 2 > 0.
Remark 8.7.The proof of Proposition 8.5 does not give a (deterministic) polynomial time algorithm to find the desired m, i.e. in poly(log A) time.There is, however, a relatively simple probabilistic polynomial time algorithm, cf.[CP23a, Rem.5.31].Most recently, we were able to improve upon the estimate in Proposition 8.5 using Larcher's bound, see [?, §1.5]CP-CF.
8.3.Bounds on relative numbers of linear extensions.The following simple bound is the final ingredient we need for the proof of the Verification Lemma.
x is the unique minimal element.
The lower bound holds for all x ∈ X, see e.g.[EHS89].The upper bound is a special case of [CPP24, Lem.5.1].We include a short proof for completeness.
Proof.The lower bound e(P − x) ≤ e(P ) follows from the injection E(P − x) → E(P ) that maps f ∈ E(P − x) into g ∈ E(P ) by letting g(x) ← 1, g(y) ← f (x) + 1 for all y = x.For the second part, note that e(P ) − e(P − x) is the number of f ∈ E(P ) such that f (x) > 1, so e(P ) − e(P − x) = 0 implies min(P ) = {x}.
The upper bound e(P ) ≤ ne(P − x) follows from the injection E(P ) → E(P − x) × [n] that maps g ∈ E(P ) into a pair f, g(x) where f ∈ E(P − x) is defined as f (y) ← g(y) if g(y) < g(x), f (y) ← g(y) − 1 if g(y) > g(x).

Proof of Verification Lemma 4.7. Recall the decision problem
VerRLE := ρ(P, x) = ?A B , where P = (X, ≺) is a poset on n = |X| elements, x ∈ min(P ), and A, B are coprime integers with B < A ≤ n! .We simulate VerRLE with an oracle for QuadRLE as follows.
By Proposition 8.8, we need only to consider the cases 1 < A B ≤ n.Indeed, when ρ(P, x) < 1 or ρ(P, x) > n!, VerRLE does not hold.Additionally, when ρ(P, x) = 1, VerRLE holds if and only if P is a chain.Let k := A B .As in the s = 0 part of the proof of Proposition 8.1, there exists a poset P 3 = (X 3 , ≺ 3 ) with |X 3 | = k ≤ n, and an element x 3 ∈ min(P 3 ), such that ρ(P 3 , x 3 ) = k.
Let A ′ , B ′ be coprime integers such that At this point we guess such m.Since computing the quotients of m/A ′ can be done in polynomial time, we can verify in polynomial time that m satisfies the inequalities above.By Corollary 8.2, we can construct posets P 2 = (X 2 , ≺ 2 ), P 4 = (X 4 , ≺ 4 ) with x 2 ∈ min(P 2 ), x 4 ∈ min(P 2 ), such that The corollary also gives us and we similarly have . Since posets P 2 , P 3 and P 4 have polynomial size, we can call QuadRLE to check ρ(P, x) • ρ(P 2 , x 2 ) = ?ρ(P 3 , x 3 ) • ρ(P 4 , x 4 ) .
Observe that Thus, in this case QuadRLE is equivalent to VerRLE, as desired.
Remark 8.9.In our recent paper [CP24b], we use ideas from the proof above to obtain further results for relative numbers of linear extensions.We also use stronger number theoretic estimates than those given by Lemma 8.6.

Fixing one element
In this section we prove Theorem 1.4.The proof relies heavily on [MS24].We also need the definition and basic properties of the promotion and demotion operations on linear extensions, see e.g.[Sta09] and [Sta12, §3.20].9.1.Explicit equality conditions.For k = 1, the equality cases of Stanley's inequality (Sta) are tuples (P, x, z, a, c), where P = (X, ≺) is a poset on n = |X| elements, x, z ∈ X, a, c ∈ [n], and the following holds: (9.1) N z c (P, x, a) 2 = N z c (P, x, a + 1) • N z c (P, x, a − 1).
The subscripts here and throughout this section are no longer bold, to emphasize that k = 1.Recall also both the notation in §1.4, and the Ma-Shenfeld poset notation in §6.1.
We prove Lemma 9.1 later in this section.
Remark 9.2.For the case k = 0, the analogue of ( ) that companions of f are incomparable to x, was proved in [SvH23, Thm 15.3(c)].However, ( ) fails for k = 2, as shown in the "hope shattered" Example 1.4 in [MS24].Thus, Lemma 9.1 closes the gap between these two results.See §10.8 for potential complexity implications of this observation.Note also that condition ( ) is in P since can be equivalently described in terms of explicit conditions on the partial order (rather than in terms of linear extensions of the poset).This is proved in [SvH23, Thm 15.Indeed, each vanishing condition in (9.2) is checking whether there exists a companion of x in a linear extension that is comparable to x.
Recall that each vanishing condition in (9.2) is in P, see references in §3.5.There are at most 6n instances to check, since for all y ∈ X there are at most 6 choices of distinct a ′ , b ′ in {a − 1, a, a + 1}.Therefore, EqualityStanley 1 ∈ P. 9.2.Ma-Shenfeld theory.We now present several ingredients needed to prove Lemma 9.1.We follow closely the Ma-Shenfeld paper [MS24], presenting several results from that paper.
In [MS24], Ma-Shenfeld defined the notions of subcritical, critical, and supercritical posets, which are directly analogous to the corresponding notions for polytopes given in [SvH23], cf.§3.2.As the precise definitions are rather technical, we will not state them here while still including key properties of those families that are needed to prove Lemma 9.1.
We start with the following hierarchical relationship between the three families: A poset that is subcritical but not critical is called sharp subcritical, and a poset that is critical but not super critical is called sharp critical.
The equality conditions for (9.1) are directly determined by the classes to which the poset P belongs, as we explain below.We note that these families depend on the choices of P, x, a, z, c, which we omit from the notation to improve readability.Furthermore, without loss of generality we can assume that z / ∈ {a − 1, a, a + 1}, as otherwise one of the numbers in (9.1) are equal to 0, making the problem in P (see above).
We now state two other properties of these families, which require the following definitions.Following [MS24], we add two elements z 0 , z k+1 into the poset such that z 0 y z k+1 for all y ∈ X, and we define c 0 := 0 and c k+1 := n + 1 .A splitting pair is a pair of integers (r, s) in {0, . . ., k + 1}, such that (r, s) = (0, k + 1) .10Lemma 9.3 ([MS24, Lemma 5.10]).Let P = (X, ≺) be a sharp subcritical poset.Then there exists a splitting pair (r, s) such that We say that poset P is split indecomposable if, for every splitting pair (r, s), In particular, by Lemma 9.3 every sharp subcritical poset is not split indecomposable.It was shown in [MS24], that we can without loss of generality assume that poset P is split indecomposable.Indeed, otherwise (9.1) can be reduced to checking the same problem for a smaller poset: either restricting to the set in (9.3), or removing this set from the poset, see [MS24,§6] for details.Thus we can without loss of generality assume that P is a critical poset.
Lemma 9.4 ([MS24, Lemma 5.11]).Let P be a split indecomposable sharp critical poset.Then there exists a splitting pair (r, s) such that c r < a < c s and Remark 9.5.Lemmas 9.3 and 9.4 can be modified to imply that deciding whether poset P is subcritical, critical, or supercritical is in P. We do not need this result for the proof of Lemma 9.1, so we omit these changes to stay close to the presentation in [MS24].More generally, one can ask similar questions for H-polytopes (i.e., deciding if a given collection of polytopes is subcritical/critical/supercritical).While we believe that for TU-polytopes these decision problems are still likely to be in P, proving that would already be an interesting challenge beyond the scope of this paper.
Recall from §6.2 that F(a, com, com) is the set of linear extensions in E z c (P, x, a), such that both the lower and upper companions of x are incomparable to x. Next, F(a, com, inc) is the set of linear extensions in E z c (P, x, a), such that the lower companion is comparable to x, but the upper companion is incomparable to x.Similarly, F(a, inc, com) is the set of linear extensions in E z c (P, x, a), such that the lower companion is incomparable to x, but the upper companion is comparable to x.Let F(a − 1, •, •) and F(a + 1, •, •) be defined analogously.Finally, let F(a + s, •, •) := |F(a + s, •, •)| where s ∈ {0, ±1}, be the numbers of these linear extensions.
On the other hand, the existence of h implies that (9.10) a contradiction.This finishes the proof of the claim.
10. Final remarks 10.1.The basis of our work.Due to the multidisciplinary nature of this paper, we make a special effort to simplify the presentation.Namely, the proofs of our main results (Theorems 1.1 and 1.3), are largely self-contained in a sense that we only use standard results in combinatorics (Stanley's theorem in §5.2 and the Brightwell-Winkler's theorem in §3.6), computational complexity (Toda's theorem in §4.4), and number theory (Yao-Knuth's theorem in §8.2).In reality, the paper freely uses tools and ideas from several recent results worth acknowledging.
First, we heavily build on the recent paper by Shenfeld and van Handel [SvH23], and the followup by Ma and Shenfeld [MS24].Without these results we would not know where to look for "bad posets" and "bad polytopes".Additionally, the proof in §6.2 is a reworking and simplification of many technical results and ideas in [MS24].
Second, in §8.1 we use and largely rework the continued fraction approach by Kravitz and Sah [KS21].There, the authors employ the Stern-Brocot and Calkin-Wilf tree notions, which we avoid in our presentation as we aim for different applications.
Third, in the heart of our proof of Theorem 1.3 in §4.4,we follow the complexity roadmap championed by Ikenmeyer, Panova and the second author in [IP22,IPP22].Same for the heart of the proof of the Verification Lemma 4.7 in §8.4,which follows the approach in our companion paper [CP23a].
On the other hand, the proof of Theorem 1.4 given in Section 9, is the opposite of self-contained, as we rely heavily on both results and ideas in [MS24].We also use properties the promotion and demotion operations on linear extensions, that were introduced by Schützenberger in the context of algebraic combinatorics, see [Schü72] 11 .Panova and the authors employed this approach in a closely related setting in [CPP23a,CPP23b,CPP24].We emphasize once again that our proof of Theorem 1.4 is independent of the rest of the paper and is the only part that uses results in [MS24].10.2.Equality cases.The reader unfamiliar with the subject may wonder whether equality conditions of known inequalities are worth an extensive investigation.Here is how Gardner addresses this question: "If inequalities are silver currency in mathematics, those that come along with precise equality conditions are gold.Equality conditions are treasure boxes containing valuable information."[Gar02,p. 360].
Closer to the subject of this paper, Shenfeld and van Handel explain the difficulty of finding equality conditions for (MQI) and (AF): "In first instance, it may be expected that the characterization of the extremals of the Minkowski and Alexandrov-Fenchel inequalities should follow from a careful analysis of the proofs of these inequalities.It turns out, however, that none of the classical proofs provides information on the cases of equality: the proofs rely on strong regularity assumptions (such as smooth bodies or polytopes with restricted face directions) under which only trivial equality cases arise, and deduce the general result by approximation.10.5.Brunn-Minkowski inequality.There are several proofs of the Brunn-Minkowski inequality (BM), but some of them do not imply the equality conditions, such as, e.g., the "brick-by-brick" inductive argument in [Mat02, §12.2].Note also that Alexandrov's proof of the Minkowski uniqueness theorem (of polytopes with given facet volumes and normals) relies on the equality conditions for the Brunn-Minkowski inequality, see [Ale50].This is essential for Alexandrov's "topological method", and is the basis for the variational principle approach, see e.g.[Pak09].10.6.Van der Waerden conjecture.The Alexandrov-Fenchel inequality (AF) came to prominence in combinatorics after Egorychev [Ego81] used it to prove the van der Waerden conjecture, that was proved earlier by Falikman [Fal81].12See [Knu81,vL82] for friendly expositions.This development set the stage for Stanley's paper [Sta81].The conjecture states that for every bistochastic n × n matrix A, we have and the equality holds only if A = (a ij ) has uniform entries: a ij = 1 n for all 1 ≤ i, j ≤ n.Note that Egorychev's proof of the equality conditions for (vdW) used Alexandrov's equality conditions (AF) for nondegenerate boxes, see §3.2 (cf.[Knu81, p. 735] and [vL82, §7]).In a followup paper [CP24+], we analyze the complexity of the Alexandrov-Fenchel equality condition for degenerate boxes.Note also that Knuth's exposition in [Knu81] is essentially self-contained, while Gurvits's proof of (vdW) completely avoids (AF), see [Gur08,LS10].10.7.Matroid inequalities.Of the several log-concavity applications of the AF inequality given by Stanley in [Sta81] (see also [Sta86,§6]), one stands out as a special case of a Mason's conjecture (Thm 2.9 in [Sta81]).The strongest of the three Mason's conjectures states that the numbers I(M, k)/ n k are log-concave, where I(M, k) is the number of independent sets of size k in a matroid M on n elements.These Mason's conjectures were recently proved in a long series of spectacular papers culminating with [AHK18, ALOV24, BH20], see also an overview in [Huh18,Kal22].
Curiously, the equality cases for these inequalities are rather trivial and can be verified in polynomial time [MNY21] (see also [CP24a,§1.6]).Here we assume that the matroid is given in a concise presentation (such presentations include graphical, bicircular and representable matroids).Curiously, for the weighted extension of Mason's third conjecture given in [CP24a, Thm 1.6], the equality cases are more involved.It follows from [CP24a, Thm 1.9], however, that this problem is in coNP.In other words, Theorem 1.3 shows that EqualityStanley 2 is likely much more powerful.
Note that the defect ψ(M, k) := I(M, k) 2 − I(M, k + 1) • I(M, k − 1) is conjectured to be not in #P, see [Pak22,Conj. 5.3].Clearly, the argument in the proof of Corollary 1.5 does not apply in this case.Thus, another approach is needed to prove this conjecture, just as another approach is need to prove that φ 0 / ∈ #P (see §1.4).
10.8.Complexity of equality cases.Recall that Theorem 1.1 does not imply that EqualityAF is NP-hard or coNP-hard, more traditional measures of computational hardness.This remains out of reach.Note, however, that EqualityStanley k is naturally in the class C = P, see §2.6.
Conjecture 10.1.EqualityStanley k is C = P-complete for large enough k.
If this holds for all k ≥ 2, this would imply a remarkable dichotomy with k ≤ 1 (see Theorem 1.4).To motivate the conjecture, recall from §3.6, that C = P-complete problem C #3SAT is coNP-hard.See [CP23a] for more on the complexity of combinatorial coincidence problems.
Note that the proof of EqualityStanley 2 / ∈ PH implies that EqualityAF / ∈ PH even when at most four polytopes are allowed to be distinct.It would be interesting to decide if this number can be reduced down to three.It is known that two distinct TU-polytopes are not enough.This follows from a combination of our argument that for supercritical cases (in the sense of [SvH23]), we have EqualityAF ∈ coNP, and an argument that for two polytopes the equality cases are supercritical.1310.9.Injective proofs.In enumerative combinatorics, whenever one has an equality between the numbers counting certain combinatorial objects, one is tempted to find a direct bijection between the sides, see e.g.[Loe11,Pak05,Sta12].Similarly, when presented an inequality f g, one is tempted to find a direct injection, see e.g.[Pak19,Sta89].In the context of linear extensions, such injections appear throughout the literature, see e.g.[Bre89, BT02, CPP23a, DD85, GG22, LP07].
Typically, a direct injection and its inverse are given by simple polynomial time algorithms, thus giving a combinatorial interpretation for the defect (f − g).Therefore, if a combinatorial inequality is not in #P, it is very unlikely that there is a proof by a direct injection.In particular, Corollary 1.5 implies that the Stanley inequality (Sta) most likely cannot be proved by a direct injection.This confirm an old speculation: "It appears unlikely that Stanley's Theorem for linear extensions quoted earlier can be proved using the kind of injection presented here."[DDP84, §4].
Similarly, Corollary 1.5 suggests that the strategy in [CPP23b, §9.12] is unlikely to succeed, at least for k ≥ 2. 14To fully appreciate how delicate is Corollary 1.5, compare it with a closely related problem.It is known that for all k ≥ 0, the analogue of the Stanley inequality (Sta) holds for the number Ω(P, t) of order preserving maps X → [t], for all t ∈ N.This was conjectured by Graham in [Gra82, p. 129] (see also [Gra83,p. 233]), motivated by the proof of the XYZ inequality [She82] (cf.§3.4).The result was proved in [DDP84, Thm 4] by a direct injection (see also [Day84, §4.2] for additional details of the proof).In other words, in contrast with φ k , the defect of the analogue of (Sta) for order preserving maps has a combinatorial interpretation.Note that it is not known whether the defect of the XYZ inequality is in #P, see [Pak22, Conj.6.4].10.10.Stability proofs.By analogy with the injective proofs, Corollary 1.2 suggests that certain proofs of the Alexandrov-Fenchel inequality are likely not possible.Here we are thinking of the mass transportation proof of characterization of the isoperimetric sets given in [FMP10, App.], following Gromov's approach in [Gro86].It would be interesting to make this idea precise.10.11.Dichotomy of the equality cases.As we discuss in §9.2, it follows from the results in [MS24], that the equality verification of the Stanley inequality (Sta) can be decided in polynomial time for supercritical posets.In contrast, by Theorem 1.3, the problem is not in PH for critical posets. 15We believe that this dichotomy also holds for the equality cases of the Alexandrov-Fenchel inequality (AF) for classes of H-polytopes for which the scaled mixed volume is in #P.10.12.The meaning of it all.Finding the equality conditions of an inequality may seem like a straightforward unambiguous problem, but the case of the Alexandrov-Fenchel inequality shows that it is nothing of the kind.Even the words "equality conditions" are much too vague for our taste.What the problem asks is a description of the equality cases.But since many geometric and combinatorial inequalities have large families of equalities cases, the word "description" becomes open-ended (cf.§2.5).How do you know when you are done?At what point are you satisfied with the solution and do not need further details?
These are difficult questions which took many decades to settle, and the answers depend heavily on the area.In the context of geometric inequalities discussed in §3.1, the meaning of "description" starts out simple enough.There is nothing ambiguous about discs as equality cases of the isoperimetric inequality in the plane (Isop), or of homothetic convex bodies for the Brunn-Minkowski inequality (BM), or circumscribed polygons with given normals for the discrete isoperimetric inequality (see §10.4).Arguably, Bol's equality cases of (MWI) are also unambiguous -in R 3 , you literally know the cap bodies when you see them.
However, when it comes to Minkowski's quadratic inequality (MQI), the exact meaning of "description" is no longer obvious.Shenfeld and van Handel write "The main results of this paper will provide a complete solution to this problem" [SvH22].Indeed, their description of 3-dimensional triples of convex bodies cannot be easily improved upon, at least not in the case of convex polytopes (see §3.1).Some questions may still linger, but they are on the structure of the equality cases rather than on their recognition. 16hat Shenfeld and van Handel did, is finished off the geometric approach going back to Brunn, Minkowski, Favard, Fenchel, Alexandrov and others, further formalized by Schneider."Maybe a published conjecture will stimulate further study of this question", Schneider wrote in [Schn85].This was prophetic, but that conjecture was not the whole story, as it turned out.
In [SvH23], the authors write again: "We completely settle the extremals of the Alexandrov-Fenchel inequality for convex polytopes."Unfortunately, their description is extraordinary complicated in higher dimensions, so the problem of recognizing the equality cases is no longer easy (see §3.2).And what good is a description if it cannot be used to recognize the equality cases?
In combinatorics, the issue of "description" has also been a major problem for decades, until it was fully resolved with the advent of computational complexity.For example, consider the following misleadingly simple description: "Let G be a planar cubic Hamiltonian graph."Is that good enough?How can you tell if a given graph G is as you describe?We now know that the problem whether G is planar, cubic and Hamiltonian is NP-complete [GJT76].But if you only need the "planar" condition, the problem is computationally easy, while the "cubic" condition is trivial.Consequently, "planar cubic Hamiltonian" should not be viewed as a "good" description, but if one must consider the whole class of such graphs, this description is (most likely) the best one can do.
Going over equality cases for various inequalities on the numbers of linear extensions, already gives an interesting picture.For the Björner-Wachs inequality (see §3.4), the recognition problem of forests is in P, of course.On the other hand, as we explain in §3.4,for the Sidorenko inequality (3.1), the recognition problem of series-parallel posets is in P for a more involved reason.On the opposite end of the spectrum, for the (rather artificial) inequality (e(P ) − e(Q)) 2 ≥ 0, the equality verification is not in PH, unless PH collapses, see §3.In this language, for the k = 0 case of the Stanley inequality (Sta), the description of equality cases given in [SvH23] is trivially in P. Similarly, for the k = 1 case, the description of equality cases is also in P by Theorem 1.4.On the other hand, Theorem 1.3 shows that for k ≥ 2, the description in [MS24] is (very likely) not in P.Under standard complexity assumptions, there is no description of the equality cases in P at all, or even in PH for that matter.Now, the problem of counting the equality cases brings a host of new computational difficulties, making seemingly easy problems appear hard when formalized, see [Pak22].Even for counting non-isomorphic forest posets on n elements, to show that this function in #P one needs to define a canonical labeling to be able to distinguish the forests, to make sure each is counted exactly once, see e.g.[SW19].
In this language, Corollary 1.5 states that there are no combinatorial objects that can be counted to give the number of non-equality cases of the Stanley inequality, neither the non-equality cases themselves nor anything else.The same applies to the equality cases.Fundamentally, this is because you should not be able to efficiently tell if the instances you are observing are the ones you should be counting.
Back to the Alexandrov-Fenchel inequality (AF), the description of equality cases by Shenfeld and van Handel is a breakthrough in convex geometry, and gives a complete solution for a large family of (n-tuples of) convex polytopes (see §10.11).However, our Theorem 1.1 says that from the computational point of view, the equality cases are intractable in full generality.Colloquially, this says that there is no good description of the equality cases of the Alexandrov-Fenchel inequality, unless the world of computational complexity is what we think it is.As negative as this may seem, this is what we call a complete solution indeed.
Question 6.3], [CPP23b, §9.9] and [MS24].Formally, for every k ≥ 0, denote by EqualityStanley k the equality verification problem of the Stanley inequality with k fixed elements, defined as the decision problem whether (Sta) is an equality.It was shown by Shenfeld and van Handel that EqualityStanley 0 ∈ P, see [SvH23, Thm 15.3].Theorem 1.3.Let k ≥ 2. Then the equality verification problem of the Stanley inequality (Sta) z c (P, x, a) = ?0} are in P.This was shown by David and Jacqueline Daykin in [DD85, Thm 8.2], via explicit necessary and sufficient conditions.Recently, this result was rediscovered in [CPP23b, Thm 1.11] and [MS24, Thm 5.3].Similarly, the uniqueness conditions {N z c (P, x, a) = ?1} are in P by the result of Panova and the authors [CPP23b, Thm 7.5], where we gave explicit necessary and sufficient conditions.Both the vanishing and the uniqueness conditions give examples of equality cases of the Stanley inequality, which remained a "major challenge" in full generality [CPP23b, §9.10].

Lemma 5. 1 .
Slices S i are TU-polytopes.Proof.Write S i in the form A • (α y ) y∈Y ≤ b.Observe that A has {−1, 0, 1} entries, and so does b.Every square submatrix B of A corresponds to taking a subposet with added rows of 0's, or with rows of 0's and a single ±1.By definition of O P , we can rearrange columns in B to make it upper triangular.Thus, det(B) ∈ {−1, 0, 1}, as desired.5.2.Proof of Proposition 4.1.Denote by E z c (P ) the set of all linear extensions f ∈ E(P ), such that f (z i ) = c i for all i, and let N z c (P ) := | E z c (P )|.Let S 0 , . . ., S k ⊂ R n be the slices defined above, and note that the dimension dim S 0 , . . ., S k of the subspace spanned by vectors in S 0 , . . ., S k is equal to n − k.Stanley's original proof of (Sta) is based on the following key observation: Lemma 5.2 ([Sta81, Thm 3.2]).Let z 1 ≺ . . .≺ z k and 1 ≤ c 1 < . . .< c k ≤ n.We have: and we write F(b, •, •) := |F(b, •, •)|.Note that by construction it follows that, for all f ∈ F(b, •, •), we have b− 2 = f (u) < f (v) < f (w) = b + 2, so f (v) ∈ {b − 1, b, b + 1},and thus v will always be a companion in f .Sets F(b + 1, * , * ) and F(b − 1, * , * ) are defined analogously.

8. 2 .
Number theoretic estimates.For A ∈ Z ≥1 and m ∈ [A], consider the quotients in the continued fraction of m/A and their sum: m A = [0; a 1 (m), . . ., a s (m)] and S A (m) := s i=1 a i (m) .
[Fej72,e isoperimetric inequality.For a discrete version of the isoperimetric inequality in the plane, one can consider convex polygons with given normals to edges.In this case, L'Huilier (1775) proved that the isoperimetric ratio is minimized for circumscribed polygons, see e.g.[Fej72,  §I.4].In the 1860s, Steiner and Lindelöf studied a natural generalization of this problem in R 3 , but were unable to solve it in full generality.At the turn of 20th century, Minkowski developed the theory of mixed volumes, motivated in part to resolve the Steiner-Lindelöf problem.He showed that among all polytopes with given normals, the isoperimetric ratio is minimized on circumscribed polytopes, see e.g.[Fej72, §V.7].There are several Bonnesen type and stability versions of the discrete isoperimetric inequality, see e.g.[FRS85, IN15, Zhang98].Let us single out a hexagon version used by Hales in his famous proof of the honeycomb conjecture [Hal01, Thm 4].
[BCSS98] vertices (but not a description in P, as V-polytopes are defined to have).In[CP24+], we consider a family of axis-parallel boxes which have similar properties.Clearly, for general convex bodies there is no natural way to set up a computational problem that would not be immediately intractable (unless one moves to a more powerful computational model, see e.g.[BCSS98]).10.4.