Reduction: the FO fragment of type-driven composition #
Compiles the first-order fragment of [HK98] trees into mathlib
FirstOrder.Language.Formulas and proves agreement with the engine: whenever
compileFO succeeds, the denotation Tree.interp composes is equivalent to
mathlib Realize of the compiled formula over the model — the same triangle
Semantics/Dynamic/DRS/Reduction.lean proves for DRT.
Trace indices are the formulas' free-variable type (ℕ), so the Heim-Kratzer
bind index is the variable name, and assignment update g[n ↦ x] on the
engine side is literally Function.update on the realize side. Quantifiers
bind exactly one trace, so closure is by the computable singleton binders
Formula.all₁ / Formula.ex₁ (mathlib's iAlls/iExs are noncomputable).
Main declarations #
FOWords,Model.lexiconFO— the logical vocabulary over a naming-map lexicon;FOWords.FreshFor,LexNaming.Disjoint— well-formednesscompileFO— the partial compiler over QR'd Heim-Kratzer tree shapesinterp_compileFO,holdsAt_iff_realize— the agreement theoremholdsAt_of_models— consequence transfer (cross-model entailment from first-order consequence)
Most (and the other proportional determiners) is deliberately outside the
compiled fragment: its first-order undefinability is the planned
Barwise-Cooper payoff theorem, and the principled reason compileFO is
partial.
The logical vocabulary #
Word forms for the compiled logical vocabulary, parameterizable per fragment/language.
- every : String
- some_ : String
- no : String
- not_ : String
- and_ : String
- or_ : String
Instances For
The logical vocabulary's lexicon entries: GQ denotations from
Quantification, truth-functional connectives from
Intensional. The connectives flip arguments so that
[t₁ [and t₂]] composes to ⟦t₁⟧ ∧ ⟦t₂⟧.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A naming-map lexicon extended with the logical vocabulary. Content words
take priority; FOWords.FreshFor rules out collisions.
Instances For
The logical word forms are fresh for the naming maps.
Equations
Instances For
Each word form names at most one kind of symbol, so the compiler's classification of a word agrees with the lexicon's lookup order.
Instances For
The compiler #
Recognized (QR'd Heim-Kratzer) shapes: name/trace–verb predication with
optional object, sentence negation [not t], sentence coordination
[t₁ [and t₂]], and quantified clauses [[Q N] [bind k body]]. Everything
else — in particular most — is outside the fragment and compiles to
none.
Compile an entity subtree: a proper name or a trace.
Equations
- Semantics.Composition.compileTerm nm (Syntax.Tree.terminal a s) = Option.map FirstOrder.Language.Constants.term (nm.names s)
- Semantics.Composition.compileTerm nm (Syntax.Tree.trace k a) = some (FirstOrder.Language.var k)
- Semantics.Composition.compileTerm nm x✝ = none
Instances For
Compile a predicate subtree applied to a subject term: an intransitive verb, or a transitive verb with a name/trace object.
Equations
- One or more equations did not get rendered due to their size.
- Semantics.Composition.compilePred nm τ (Syntax.Tree.terminal a v) = Option.map (fun (R : L.Relations 1) => R.formula₁ τ) (nm.preds₁ v)
- Semantics.Composition.compilePred nm τ x✝ = none
Instances For
Compile the FO fragment of a tree to a first-order formula with trace
indices as free variables. Partial: none outside the fragment.
Equations
- One or more equations did not get rendered due to their size.
- Semantics.Composition.compileFO fw nm (Syntax.Tree.node a [Syntax.Tree.trace k a_1, r]) = Semantics.Composition.compilePred nm (FirstOrder.Language.var k) r
- Semantics.Composition.compileFO fw nm x✝ = none
Instances For
Lookup lemmas #
At a word fresh for the naming maps, lookup falls through to the logical vocabulary.
Realization at a model's world #
Model carries structures as terms, so Realize needs the instance fixed
per world; realizeAt/termAt package that.
Realize a formula over the model's structure at world w.
Equations
- m.realizeAt w φ g = φ.Realize g
Instances For
Realize a term over the model's structure at world w.
Equations
- m.termAt w τ g = FirstOrder.Language.Term.realize g τ
Instances For
Atomic agreement, unary: realization of R(τ) is the model-sourced
extensional predicate at the term's value.
Atomic agreement, binary: realization of R(τ₁, τ₂) is the model-sourced
object-first relation at the terms' values (subject first in the vector).
Engine reduction helpers (at M = Id) #
Agreement #
Entity-subtree agreement: a compiled term's engine value is its realization over the model.
Predication agreement: subject term + predicate subtree compose to the compiled atom's realization.
The agreement theorem: whenever the compiler succeeds, the engine's
composed denotation is the realization of the compiled formula over the
model at w — the DRT triangle for type-driven composition.
Truth and consequence transfer #
Truth of a tree at a model's world under an assignment: it composes to a true truth value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Consequence transfer: first-order consequence between compiled formulas yields cross-model entailment between the trees — for every composition model, world, and assignment.
The default logical vocabulary is pairwise distinct.
Bridge to mathlib Theory consequence #
For universe-0 languages, composition models and mathlib's bundled models
coincide: tree entailment over nonempty-domain composition models is
first-order consequence over the empty theory, and compactness transfers
to families of trees. (ModelType requires nonempty carriers, hence the
nonempty-domain restriction — standard in the GQ literature.)
A first-order structure as a one-world composition model.
Equations
- Semantics.Composition.Model.ofStructure M S = { E := M, W := Unit, interp := fun (x : Unit) => S }
Instances For
Tree entailment is first-order consequence: mathlib's ⊨ᵇ over the
empty theory coincides with cross-model entailment between compiled trees,
over nonempty-domain composition models.
Closed trees as sentences, and compactness #
Compactness at the tree level: a family of closed fragment trees is
jointly satisfiable in a nonempty-domain composition model iff every finite
subfamily is. The nontrivial direction is mathlib's compactness theorem
(Theory.isSatisfiable_iff_isFinitelySatisfiable, via ultraproducts).