Walking a finite linear order, first-order #
Shared machinery for constructions that traverse a finite linear order – or the
lexicographic order on tuples – one step at a time, with each step described by
a first-order guard over the ordered expansion L.sum Language.order.
Two clients, one technique. The SO-Horn definition of HORN-SAT
(DescriptiveComplexity.Problems.HornSat.Definability) assembles the unbounded body of
an input clause by walking the order of its elements; the translation of
FO(LFP) into SO-Horn (DescriptiveComplexity.FixedPointHorn) walks the lexicographic
order of stage and valuation tuples to derive the complement of a fixed
point. Both need the same three ingredients, provided here:
- guards: formulas
DescriptiveComplexity.minF,DescriptiveComplexity.maxF,DescriptiveComplexity.succF– being minimal, maximal, the immediate successor – and their tuple analoguesDescriptiveComplexity.minTupF,DescriptiveComplexity.maxTupF,DescriptiveComplexity.succTupFfor the lexicographic order, with realization lemmas phrased purely in terms of the order of the structure; - induction:
DescriptiveComplexity.order_induction, walking any finite linear order from its minimum along immediate successors – applied not only to the universe of a structure but to lexicographic tuple orders over it; - the bridge to
Lex: the coordinatewise conditions realized by the tuple guards characterize bottom, top and covering (DescriptiveComplexity.tupSucc_iff_covBy…) inLex (Fin D → A), andDescriptiveComplexity.prodLex_covBy_iff/DescriptiveComplexity.finCovBy_iffdo the same for the lexicographic product heading a static index; so a walk described by guards is a walk along covers of a bona fide finite linear order.
Finally DescriptiveComplexity.orank – the rank of an element of a finite linear order,
the number of its strict predecessors – converts that walk into arithmetic:
rank 0 at the bottom (DescriptiveComplexity.orank_eq_zero), +1 along a cover
(DescriptiveComplexity.orank_covBy), Nat.card - 1 at the top
(DescriptiveComplexity.orank_isTop). This is how a fixed-point stage indexed by a
tuple is matched with the ℕ-indexed stages of
DescriptiveComplexity.derivesIn.
Order guards #
t₁ ≤ t₂, as a formula over the ordered expansion.
Equations
- DescriptiveComplexity.leF t₁ t₂ = FirstOrder.Language.leSymb.formula₂ t₁ t₂
Instances For
Dependency graph
t₁ < t₂, as a formula over the ordered expansion.
Equations
Instances For
Dependency graph
The variable x holds a minimum.
Equations
Instances For
Dependency graph
The variable x holds a maximum.
Equations
Instances For
Dependency graph
w holds the immediate predecessor of z.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Immediate predecessors, and induction along a finite linear order #
In a finite linear order, an element that is not a minimum has an immediate predecessor.
Dependency graph
Induction along a finite linear order: from the minimum, one immediate successor at a time.
Dependency graph
In a finite linear order, an element that is not a maximum has an immediate successor.
Dependency graph
Induction along a finite linear order, downwards: from the maximum, one immediate predecessor at a time. This is the direction a scan is proved correct in – a walk that stops at the greatest element knows about the elements above the one it stands on.
Dependency graph
The lexicographic successor of a tuple, coordinatewise #
The tuple t' is the immediate successor of t in the lexicographic
order (most significant coordinate first), stated coordinatewise: the two
tuples agree before some position p, at p the second covers the first, and
after p the first is all maxima and the second all minima. This is the
condition the guard DescriptiveComplexity.succTupF realizes;
DescriptiveComplexity.tupSucc_iff_covBy identifies it with covering in
Lex (Fin D → A).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Tuple guards, for the lexicographic order #
The variables sel hold a lexicographically minimal tuple: every
coordinate is minimal.
Equations
- DescriptiveComplexity.minTupF sel = DescriptiveComplexity.listInf (List.map (fun (p : Fin D) => DescriptiveComplexity.minF (sel p)) (List.finRange D))
Instances For
Dependency graph
The variables sel hold a lexicographically maximal tuple.
Equations
- DescriptiveComplexity.maxTupF sel = DescriptiveComplexity.listInf (List.map (fun (p : Fin D) => DescriptiveComplexity.maxF (sel p)) (List.finRange D))
Instances For
Dependency graph
The tuple held by sel' is the immediate lexicographic successor of the
one held by sel.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The bridge to Lex: bottom, top and covering, coordinatewise #
The tuple guards above speak coordinatewise; the walk they describe is along
the finite linear order Lex (Fin D → A). These lemmas identify the two
languages. (Lex is a type synonym, so Finite and Nonempty instances are
provided for it here.)
Dependency graph
Dependency graph
Dependency graph
A tuple is a lexicographic bottom iff each coordinate is minimal.
Dependency graph
A tuple is a lexicographic top iff each coordinate is maximal.
Dependency graph
Coordinatewise successors are lexicographic covers: the condition of
the guard DescriptiveComplexity.succTupF says exactly that the second tuple covers
the first in Lex (Fin D → A).
Dependency graph
The lexicographic product with a static head #
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Covering in a lexicographic product: either the heads agree and the tails cover, or the heads cover, the first tail is a top and the second a bottom.
Dependency graph
Covering in Fin n is incrementing the value.
Dependency graph
Reaching an element from below a cover #
Whatever is below a cover is below its base, or is the cover itself.
Dependency graph
The rank of an element of a finite linear order #
The rank of an element of a finite linear order: the number of its strict
predecessors. This converts a walk along covers into arithmetic, matching
tuple-indexed fixed-point stages with the ℕ-indexed
DescriptiveComplexity.derivesIn.
Instances For
Dependency graph
A minimum has rank 0.
Dependency graph
Rank increases by one along a cover.