Endpoint scans for chain counts and lattice structure in ordered matching intervals
Endpoint scans for chain counts and lattice structure in ordered matching intervals Given the endpoint pairings of two comparable ordered matchings \(P\le Q\), how many chains of a prescribed length lie in \([P,Q]\), and when is the interval a distributive lattice? Two endpoint scans answer these questions. The first counts distinct chains for each prescribed rank profile, yielding ordinary and saturated chain counts with either endpoint included or omitted. The second classifies the interval as a nonlattice, a nondistributive lattice, or a distributive lattice, and returns actual matching witnesses in the first two cases. An ordered matching pairs the vertices of a finite linear order. The relation \(P\le Q\) means that deleting whole chords of \(Q\) and relabeling the surviving endpoints in increasing order gives \(P\). The interval \([P,Q]\) consists of the distinct standardized matchings \(X\) with \(P\le X\le Q\). Equivalently, retain only the standardized restrictions of \(Q\) that contain \(P\) in the whole-chord deletion order, with all selections that produce the same matching representing one element. The linear order is fixed, so rotations give no further identifications. Chords may cross arbitrarily. The results also allow the empty lower matching, extending the positive-size convention of the original questions. Write \(|X|\) for the number of chords in \(X\), \(n=|Q|\), \(g=|Q|-|P|\), and \(w\) for the maximum number of simultaneously open chords during the scan of \(Q\). Both algorithms use \(O_{g,w}(n+1)\) operations without materializing the interval. The linear bound holds at fixed \(g,w\), and the counting bound counts arithmetic operations on exact integers. Cervetti–Ferrari, *Annals of Combinatorics* 26 (2022), §§1 and 6 The shared endpoint comparison Scan endpoints from left to right, listing open chords in their opening order. Encode an opening by \(0\) and a closing by the one-based rank \(j\) of its mate in that list. The code reconstructs the matching by appending the current endpoint on \(0\) and pairing it to the indexed opening on \(j>0\). For a chord selection, fix the decision at the opening and use it again at the mate's closing. Skip both endpoints of a deleted chord. Emit \(0\) at each retained opening and emit \[j-\#\{\text{live deleted chords of host rank less than }j\} \] at a retained closing of host rank \(j\). This is its rank in the retained live list. In particular, crossing and nested pairs have codes \(0011\) and \(0021\), respectively, and retaining just the inner chord of the nested pair produces \(01\). To compare two selections of \(Q\), cancel matching output prefixes as tokens become available and reject at the first mismatch. After \(i\) host endpoints, a selection that has skipped \(d_i\) endpoints has emitted \(i-d_i\) tokens. When each selection deletes at most \(g\) chords, their output lengths differ by at most \(2g\), so only one unmatched suffix of length at most \(2g\) needs to be stored. A comparison succeeds exactly when every compared token matches and the suffix is empty at the end. To compare a selection with the given \(P\), compare each emitted token directly with the token at position \(i-d_i\) in the code of \(P\) and check the final length. Exact counts of ordinary and saturated chains Cervetti–Ferrari ask for fixed-length ordinary and saturated chain counts in a generic matching interval in §6, printed p. 992. The recurrence below gives an exact algorithmic answer for every comparable pair, including the empty-bottom extension. Original chain-counting question, §6, p. 992 For \(g>0\), let \(h=(h_1,\ldots,h_J)\) be a composition of \(g\) into positive descending rank drops. At each opening of \(Q\), assign its chord a tag \(a\in\{1,\ldots,J+1\}\). Require exactly \(h_a\) chords of tag \(a\) for \(1\le a\le J\). At level \(b\), delete the chords whose tags satisfy \(a\le b\), using the shared closing-rank rule to emit the code of that level. Require the final code to equal that of \(P\). Every chain with profile \(h\) and both endpoints included has such a representation because embeddings of consecutive matchings compose to nested selections of chords of \(Q\). Count just the lexicographically first tag sequence for each chain, reading tags in opening order. For a trial sequence, maintain the set of feasible rival states. Each rival makes its own tag choices, is tracked as equal or earlier in lexicographic order, and compares its output with the trial output separately at each level. Discard a rival at the first greater tag following an equal prefix or at the first output mismatch. An accepting rival ends strictly earlier, meets the quotas, and has an empty unmatched suffix at every level. Updating the set of rival states is deterministic once the trial choice is fixed. Let \(s\) comprise the trial quota counters, live tagged ranks, bottom skip count, and rival-state set. Start with count one at the initial state and zero elsewhere. At endpoint \(i+1\), update \[F_{i+1}(s')=\sum_s F_i(s)\,\#\{a\in\mathcal A_i(s):\delta_i(s,a)=s'\}, \] where \(F_i(s)\) counts trial prefixes, \(\mathcal A_i(s)\) is the set of legal trial actions at that endpoint, and \(\delta_i\) is the state update. A closing uses its opening's choice and has a single action. The profile count \(C_h\) is the sum of terminal counts satisfying the trial quotas and bottom comparison and having no accepting rival. Each chain contributes once because its finite set of tag representations has a unique first element. All state components are bounded in terms of \(g,w\). For arbitrary endpoint conventions, sum \(C_h\) over profiles and allowed trim choices \((u,v)\in\{0,1\}^2\), with \(u=1\) omitting \(Q\) and \(v=1\) omitting \(P\). A choice contributes to the count of chains with \(k\) vertices exactly when \(k=J+1-u-v\). For saturated chains, also require \(h_b=1\) for every \(u+1\le b\le J-v\). These are precisely the gaps between consecutive retained vertices. A comparable pair with rank gap one is a cover, and a larger gap admits an intermediate matching by restoring one chord to an embedding of the smaller matching. Appending missing endpoints recovers the original profile and trim choice uniquely. A nonempty chain with \(k\) vertices has \(k-1\) steps. For \(P<Q\), trimming both ends of the direct two-vertex chain yields the empty chain once. For \(P=Q\), the only chains are the singleton and the empty chain, subject to the requested convention for that one vertex. Saturation is vacuous when a chain has fewer than two vertices. Cervetti–Ferrari §5.1 treats special principal intervals. Earlier matching principal intervals, §5.1 The counting scan reuses nested deletion tags and endpoint trimming from the internal Dyck chain-counting work (#28986 v6831) and its Dyck and Schröder word antecedents (#4566 v1140 and #4578 v1160). Those methods compare literal retained letters within each layer. The additional step here is to compare the induced matchings after paired deletion and closing-rank recomputation at every layer, then count each chain once even when it has multiple embeddings. This yields exact rank-profile counts for arbitrary crossing matching intervals. Lattice and distributivity decisions with witnesses In the final sentence of the interval questions in §6, printed p. 992, Cervetti–Ferrari ask which intervals are lattices and which are distributive. The scan gives an exact decision for each comparable pair. The adjacent question about Möbius values is separate from this classification. Original lattice and distributivity question, §6, p. 992 A track \(X\) chooses which host chords to retain, with at most \(g\) deletions, and \(T(X)\) denotes its standardized matching. Let \(\mathrm{Sub}(X,Y)\) mean inclusion of the retained host chord sets, \(\mathrm{Same}(X,Y)\) mean equality of their emitted codes, and \(\mathrm{Bottom}(X)\) mean that \(X\) emits the code of \(P\). The interval membership and order predicates are \[\begin{aligned} \mathrm{In}(X)&=\exists R\,[\mathrm{Sub}(R,X)\land\mathrm{Bottom}(R)],\\ \mathrm{Le}(X,Y)&=\exists R\,[\mathrm{Sub}(R,Y)\land\mathrm{Same}(R,X)],\\ \mathrm{Lt}(X,Y)&=\mathrm{Le}(X,Y)\land\neg\mathrm{Same}(X,Y). \end{aligned} \] An embedding in a standardized restriction pulls back to a selection of the same chords in any representative of that restriction. The witness \(R\) for membership therefore drops exactly \(g\) chords, and the witness for comparison retains \(|T(X)|\) chords and drops at most \(g\). These predicates give membership and comparison independently of the chosen representatives. Restrict element variables to tracks satisfying \(\mathrm{In}\). For a pair \(A,B\), define \(U(Z;A,B)=\mathrm{Le}(A,Z)\land\mathrm{Le}(B,Z)\). A minimal common upper bound satisfies \[\mathrm{MinU}(Z;A,B)=U(Z;A,B)\land\neg\exists Y\,[U(Y;A,B)\land\mathrm{Lt}(Y,Z)]. \] The interval is a nonlattice exactly when some pair has two such bounds \(C,D\) with \(\neg\mathrm{Same}(C,D)\). The scan returns \(T(A),T(B),T(C),T(D)\). Since \(Q\) is a common upper bound and the interval is finite, a unique minimal common upper bound is the join. If all joins exist, joining the common lower bounds of each pair gives its meet, since that set is finite, contains \(P\), and is closed under joins. In the lattice case, define \(\mathrm{Join}(Z;A,B)\) by \(U(Z;A,B)\) together with \(\mathrm{Le}(Z,Y)\) for every common upper bound \(Y\). Reverse the comparisons to obtain \(\mathrm{Meet}\). Use these predicates to test whether some triple satisfies \[A\wedge(B\vee C)\ne (A\wedge B)\vee(A\wedge C). \] If so, the scan returns the three standardized matchings and both computed sides. Otherwise the lattice is distributive, because this identity implies its dual in any lattice. The scan implements conjunction by synchronous products, existential quantification by guessing a track's retain bits at openings and projecting them out, and negat
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24797806
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint