QUD: Equivalence-Relation Partitioning of a Meaning Space #
@cite{roberts-2012}
A QUD M partitions a meaning space M via an equivalence relation: two
meanings are equivalent iff they "answer the question the same way."
Design #
A QUD M is a Setoid M together with decidability of its equivalence
relation. Setoid is the single source of truth for the equivalence
structure (no separately-stored Bool field that can drift); decidability
is bundled so consumer code doesn't need to thread [DecidableRel q.r]
through every signature.
This file is the algebraic core: the bundle, constructors (trivial,
compose, ofProject, ofDecEq, exact), equivalence-class cells,
the Bool-view (sameAnswer), and the ProductQUD projections.
Place in the Question API #
QUD M lives inside Core/Question/ (rather than a parallel
Core/QUD/ directory) as the construction-side API for partition-shaped
questions. The inquisitive Question W (Core/Question/Basic.lean) is
the consumer-side type with the richer lattice and answerhood structure;
Question.fromSetoid (Core/Mood/PartitionAsInquiry.lean) is the
canonical bridge from a Setoid (or QUD) into an inquisitive
Question. Long-term mathlib alignment is abbrev QUD M := Setoid M
once the Bool-API consumer sites have migrated to [DecidableRel s.r]
plus Prop-valued outputs; the bundled {toSetoid, decR} shape is a
transitional form that preserves Bool ergonomics while keeping Setoid
as the single source of truth.
A QUD partitions a meaning space M via an equivalence relation.
Bundles a Setoid M with decidability of its equivalence relation —
Setoid is the source of truth, decidability is along for the ride.
- toSetoid : Setoid M
The underlying setoid (equivalence relation + reflexivity/symmetry/transitivity).
- decR : DecidableRel ⇑self.toSetoid
Decidability of the equivalence relation.
Instances For
Equations
- q.instDecidableRel = q.decR
Reflexivity is guaranteed by construction.
Symmetry is guaranteed by construction.
Transitivity is guaranteed by construction.
Trivial QUD: all meanings are equivalent. Mathlib ⊤ : Setoid M.
Equations
- QUD.trivial = { toSetoid := ⊤, decR := fun (x x_1 : M) => isTrue True.intro }
Instances For
Equations
- QUD.instMul = { mul := QUD.compose }
Build QUD from a projection function with DecidableEq codomain.
The name argument is documentation-only; it is discarded.
Equations
- QUD.ofDecEq project name = { toSetoid := Setoid.comap project ⊥, decR := fun (a b : M) => inst✝ (project a) (project b) }
Instances For
Build QUD from a projection function with BEq/LawfulBEq codomain.
The name argument is documentation-only; it is discarded.
Equations
- QUD.ofProject f name = { toSetoid := Setoid.comap f ⊥, decR := fun (a b : M) => decidable_of_iff ((f a == f b) = true) ⋯ }
Instances For
QUD that cares only about first component.
Equations
- ProductQUD.fst = QUD.ofProject Prod.fst "fst"
Instances For
QUD that cares only about second component.
Equations
- ProductQUD.snd = QUD.ofProject Prod.snd "snd"
Instances For
QUD that cares about both components (exact).