Bundled decidable total preorders #
A TotalPreorder α bundles a relation with mathlib's unbundled relation-class
laws (IsPreorder, Std.Total) and decidability. Bundled — unlike a
Preorder instance — because consumers quantify over orderings of a fixed
carrier: plausibility frames rank worlds ([Lew73b] comparative
similarity), and metalinguistic common grounds are sets of ordering-world
pairs ranking semantic interpretations ([RK24]), so orderings
must be first-class data.
Main declarations #
TotalPreorder— the bundle, withlt,equiv, andofBool(construction from a Boolean table, for finite models).IsMaximal,AcceptedAt— top-ranked points, and truth of a predicate throughout them (Stalnaker-style acceptance on a plausibility frame).
Implementation notes #
The canonical form of an ordering-as-data is the model-theoretic one: a
Language.order.Structure modeling the total-preorder theory
(Core/Logic/FirstOrder/TotalPreorder.lean, where toStructure/ofModel
exchange the two presentations). This bundle is that object's decidable,
proof-transparent working presentation. Mathlib has no bundled
order-on-a-carrier object (its Preord bundles a type with one order);
among term-level presentations, a raw relation with unbundled relation
classes — the founding used here — beats extends Preorder α, which would
transport the Preorder API but makes lt an opaque field where consumers
need the transparent le a b ∧ ¬ le b a for decide and destructuring.
Same-rank equivalence is mathlib's AntisymmRel rather than a new
definition.
A bundled total preorder. Laws are carried as mathlib's unbundled relation
classes, registered as instances; decidability is not part of the frame — it
enters locally where finite models compute (decidableLE_ofBool).
- le : α → α → Prop
The preorder relation:
le a bmeans a is ranked no higher than b. - isPreorder : IsPreorder α self.le
Reflexivity and transitivity, as mathlib's unbundled relation class.
- total : Std.Total self.le
Totality, as mathlib's unbundled relation class.
Instances For
Reflexivity (mathlib's Std.Refl, field-style).
Transitivity (mathlib's IsTrans, field-style).
Totality (mathlib's Std.Total, field-style).
Strict ordering: a is ranked strictly below b.
Instances For
Equations
- ord.decRelLt x✝¹ x✝ = Core.Order.TotalPreorder.decRelLt._aux_1 ord x✝¹ x✝
Every nonempty finset has a greatest element under a total preorder.
Equivalence: a and b are ranked at the same level — mathlib's
AntisymmRel (whose AntisymmRel.setoid is the level-quotient).
Instances For
Equations
- ord.decRelEquiv x✝¹ x✝ = Core.Order.TotalPreorder.decRelEquiv._aux_1 ord x✝¹ x✝
¬(a < b) → b ≤ a (by totality).
Construct a TotalPreorder from a Bool-valued table — the convenient
form for concrete finite models defined by pattern matching.
Equations
- Core.Order.TotalPreorder.ofBool f h_refl h_trans h_total = { le := fun (a b : α) => f a b = true, isPreorder := ⋯, total := ⋯ }
Instances For
Table-built orderings are decidable — the local decidability finite models recover in one instance.
Equations
- Core.Order.TotalPreorder.decidableLE_ofBool f h₁ h₂ h₃ x✝¹ x✝ = Core.Order.TotalPreorder.decidableLE_ofBool._aux_1 f h₁ h₂ h₃ x✝¹ x✝
A top-ranked point: no point is ranked strictly above it.
Instances For
Equations
- ord.instDecidableIsMaximalOfFintypeOfDecidableRelLe x = id inferInstance
Acceptance: a predicate holds throughout the top-ranked points.
Equations
- ord.AcceptedAt A = ∀ (x : α), ord.IsMaximal x → A x
Instances For
Equations
- ord.instDecidableAcceptedAtOfFintypeOfDecidableRelLeOfDecidablePred A = id inferInstance