Documentation

Linglib.Semantics.Composition.Reduction

The first-order fragment of type-driven composition #

The first-order constants over a signature are its constant and relation symbols, the determiners every, some and no, negation, conjunction and disjunction. Every logical form over them reads back to a first-order formula whose realization is the logical form's denotation. The readback evaluates the logical form in a syntactic model built from mathlib's terms and bounded formulas, and a logical relation with the standard model proves it sound, so first-order consequence between readbacks is entailment between trees, as Semantics/Dynamic/DRS/Reduction.lean shows for DRT.

Main definitions #

Main results #

Implementation notes #

The syntactic model is indexed by the number of bound variables in scope, and gives truth values and functions at every larger number, so a determiner binds the next de Bruijn variable of BoundedFormula without computing a fresh name. Formulas are never carried to more bound variables, since BoundedFormula.castLE keeps the index an inner quantifier binds. Most is not first-order definable, as Barwise and Cooper showed, so it is not a first-order constant.

References #

First-order constants #

inductive HeimKratzer.FirstOrderConstant (L : FirstOrder.Language) :
Montague.Ty → Type (max u v)

The first-order constants over a signature L are its constant symbols at type e, its unary and binary relation symbols at e ⇒ t and e ⇒ e ⇒ t, the determiners every, some and no, negation, and conjunction and disjunction.

Instances For
    def HeimKratzer.Model.lexicon {L : FirstOrder.Language} {X : Type u_1} (m : Model L) (words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L ty)) (w : m.W) :
    X → Option (Montague.Denotation m.E m.W)

    The lexicon a composition model induces at a world from a translation of words into first-order constants.

    Equations
    Instances For

      The syntactic model #

      The syntactic model takes the function and relation symbols of the signature in one universe, so that terms and bounded formulas share it.

      @[reducible, inline]
      abbrev Montague.Ty.SyntacticDomain (L : FirstOrder.Language) (α : Type w) :
      Ty → ℕ → Type (max u w)

      In the syntactic model of the types over the free variables α, with n bound variables in scope, an entity is a term, and a truth value and a function are given at every larger number of bound variables, as a bounded formula and as a function on the values there.

      Equations
      Instances For
        def Montague.Ty.SyntacticDomain.applyNext {L : FirstOrder.Language} {α : Type w} {k j : ℕ} (P : SyntacticDomain L α (e ⇒ t) k) (h : k ≤ j) :
        L.BoundedFormula α (j + 1)

        A predicate of the syntactic model applied to the next bound variable, with j + 1 bound variables in scope, as a determiner applies its restrictor and scope to the variable it binds.

        Equations
        • P.applyNext h = P (j + 1) ⋯ (FirstOrder.Language.var (Sum.inr (Fin.last j))) (j + 1) ⋯
        Instances For
          def Montague.Ty.Realizes {L : FirstOrder.Language} {α : Type w} {M W D : Type} (S : L.Structure M) (v : α → M) (ty : Ty) (n : ℕ) :
          (Fin n → M) → SyntacticDomain L α ty n → Domain M W ty D → Prop

          The logical relation between the syntactic model and the standard one over a structure, under a valuation v of the free variables and xs of the n bound ones. A term realizes the entity it denotes, a formula realizes a truth value with xs extended to any larger number of bound variables, a function realizes a function that sends realized arguments to realized values with xs so extended, and an intension is realized at every world.

          Equations
          Instances For
            def HeimKratzer.Mode.readback {L : FirstOrder.Language} {α : Type w} {σ₁ σ₂ τ : Montague.Ty} {n : ℕ} :
            Mode σ₁ σ₂ τ → Montague.Ty.SyntacticDomain L α σ₁ n → Montague.Ty.SyntacticDomain L α σ₂ n → Montague.Ty.SyntacticDomain L α τ n

            In the syntactic model a mode applies at the current number of bound variables, the intensional modes to the argument itself, and predicate modification and event identification conjoin pointwise.

            Equations
            Instances For
              def HeimKratzer.FirstOrderConstant.readback {L : FirstOrder.Language} {α : Type w} {ty : Montague.Ty} (n : ℕ) :

              In the syntactic model a symbol is an atom, a determiner binds the next bound variable where its scope is complete, and negation and the connectives are the formula connectives.

              Equations
              Instances For
                def HeimKratzer.Term.readback {L : FirstOrder.Language} {α : Type w} {K : Montague.Ty → Type u_1} (R : {ty : Montague.Ty} → (n : ℕ) → K ty → Montague.Ty.SyntacticDomain L α ty n) (n : ℕ) (ρ : ℕ → L.Term (α ⊕ Fin n)) {ty : Montague.Ty} :

                The readback of a term in the syntactic model, given readbacks of its constants, with n bound variables in scope and a valuation ρ of its variables in terms. An abstraction reads back to a function at every larger number of bound variables, under ρ carried there and updated at its variable.

                Equations
                Instances For
                  def HeimKratzer.Term.toFormula {L : FirstOrder.Language} (u : Term (FirstOrderConstant L) Montague.Ty.t) :
                  L.Formula ℕ

                  The first-order formula a logical form over the first-order constants reads back to, whose free variables are the logical form's variables.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Soundness of the readback #

                    theorem HeimKratzer.Mode.realizes_readback {L : FirstOrder.Language} {α : Type w} {M W D : Type} (S : L.Structure M) (v : α → M) {σ₁ σ₂ τ : Montague.Ty} (μ : Mode σ₁ σ₂ τ) {n : ℕ} {xs : Fin n → M} {a : Montague.Ty.SyntacticDomain L α σ₁ n} {b : Montague.Ty.SyntacticDomain L α σ₂ n} {a' : Montague.Ty.Domain M W σ₁ D} {b' : Montague.Ty.Domain M W σ₂ D} (ha : Montague.Ty.Realizes S v σ₁ n xs a a') (hb : Montague.Ty.Realizes S v σ₂ n xs b b') :
                    Montague.Ty.Realizes S v τ n xs (μ.readback a b) (μ.eval a' b')

                    A composition mode preserves the logical relation.

                    theorem HeimKratzer.Term.realizes_readback {L : FirstOrder.Language} {α : Type w} {M W D : Type} (S : L.Structure M) (v : α → M) {K : Montague.Ty → Type u_1} {R : {ty : Montague.Ty} → (n : ℕ) → K ty → Montague.Ty.SyntacticDomain L α ty n} {I : {ty : Montague.Ty} → K ty → Montague.Ty.Domain M W ty D} (hR : ∀ {ty : Montague.Ty} (c : K ty) (n : ℕ) (xs : Fin n → M), Montague.Ty.Realizes S v ty n xs (R n c) (I c)) {ty : Montague.Ty} (u : Term K ty) {n : ℕ} {ρ : ℕ → L.Term (α ⊕ Fin n)} {xs : Fin n → M} {g : Assignment M} (hρ : ∀ (i : ℕ), Montague.Ty.Realizes S v Montague.Ty.e n xs (ρ i) (g i)) :
                    Montague.Ty.Realizes S v ty n xs (readback (fun {ty : Montague.Ty} => R) n ρ u) (eval (fun {ty : Montague.Ty} => I) g u)

                    When the readbacks of the constants realize their denotations, the readback of a term under a valuation of its variables realizes the term's denotation under the assignment that valuation realizes. This is the fundamental lemma of the logical relation.

                    theorem HeimKratzer.FirstOrderConstant.realizes_readback {L : FirstOrder.Language} {α : Type w} (m : Model L) (w : m.W) (v : α → m.E) {ty : Montague.Ty} (c : FirstOrderConstant L ty) (n : ℕ) (xs : Fin n → m.E) :
                    Montague.Ty.Realizes (m.interp w) v ty n xs (readback n c) (interp m w c)

                    The readbacks of the first-order constants realize their denotations in a composition model at a world.

                    theorem HeimKratzer.Term.realizeAt_toFormula {L : FirstOrder.Language} (m : Model L) (w : m.W) (u : Term (FirstOrderConstant L) Montague.Ty.t) (g : Assignment m.E) :

                    A first-order logical form denotes, at a world of a composition model and under an assignment, the realization of its readback there.

                    Trees #

                    def HeimKratzer.Tree.HoldsAt {C : Type} {X : Type u_1} {E W : Type} (lex : X → Option (Montague.Denotation E W)) (g : Assignment E) (t : PhraseStructure.Tree C X) :

                    A tree holds under a lexicon and an assignment when it composes to a true truth value.

                    Equations
                    Instances For
                      theorem HeimKratzer.Tree.holdsAt_iff_eval {L : FirstOrder.Language} {C : Type} {X : Type u_1} {words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L ty)} (m : Model L) (w : m.W) {t : PhraseStructure.Tree C X} {u : Term (FirstOrderConstant L) Montague.Ty.t} (h : translate words t = some ⟨Montague.Ty.t, u⟩) (g : Assignment m.E) :
                      HoldsAt (m.lexicon words w) g t ↔ Term.eval (fun {ty : Montague.Ty} => FirstOrderConstant.interp m w) g u

                      A tree that translates to a logical form of type t holds where the logical form is true.

                      theorem HeimKratzer.Tree.holdsAt_iff_realizeAt {L : FirstOrder.Language} {C : Type} {X : Type u_1} {words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L ty)} (m : Model L) (w : m.W) {t : PhraseStructure.Tree C X} {u : Term (FirstOrderConstant L) Montague.Ty.t} (h : translate words t = some ⟨Montague.Ty.t, u⟩) (g : Assignment m.E) :
                      HoldsAt (m.lexicon words w) g t ↔ u.toFormula.RealizeAt m.interp w g

                      A tree that translates to a logical form of type t holds where the readback of the logical form is realized.

                      theorem HeimKratzer.Tree.holdsAt_of_models {L : FirstOrder.Language} {C : Type} {X : Type u_1} {words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L ty)} {t₁ t₂ : PhraseStructure.Tree C X} {u₁ u₂ : Term (FirstOrderConstant L) Montague.Ty.t} (h₁ : translate words t₁ = some ⟨Montague.Ty.t, u₁⟩) (h₂ : translate words t₂ = some ⟨Montague.Ty.t, u₂⟩) (hmod : ∀ (M : Type) (S : L.Structure M) (v : ℕ → M), u₁.toFormula.Realize v → u₂.toFormula.Realize v) (m : Model L) (w : m.W) (g : Assignment m.E) :
                      HoldsAt (m.lexicon words w) g t₁ → HoldsAt (m.lexicon words w) g t₂

                      First-order consequence between the readbacks of two trees yields entailment between the trees in every composition model, at every world and under every assignment.

                      Consequence and compactness #

                      For universe-0 languages, composition models and mathlib's bundled models coincide: entailment between trees over composition models with nonempty domains is first-order consequence over the empty theory, and compactness transfers to families of trees. Mathlib's ModelType has nonempty carriers, hence the restriction to nonempty domains, which is standard in the study of generalized quantifiers.

                      def HeimKratzer.Model.ofStructure {L : FirstOrder.Language} (M : Type) (S : L.Structure M) :

                      A first-order structure as a one-world composition model.

                      Equations
                      Instances For
                        theorem HeimKratzer.Tree.models_imp_iff_entails {L₀ : FirstOrder.Language} {C : Type} {X : Type u_1} {words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L₀ ty)} {t₁ t₂ : PhraseStructure.Tree C X} {u₁ u₂ : Term (FirstOrderConstant L₀) Montague.Ty.t} (h₁ : translate words t₁ = some ⟨Montague.Ty.t, u₁⟩) (h₂ : translate words t₂ = some ⟨Montague.Ty.t, u₂⟩) :
                        ∅ ⊨ᵇ u₁.toFormula.imp u₂.toFormula ↔ ∀ (m : Model L₀), Nonempty m.E → ∀ (w : m.W) (g : Assignment m.E), HoldsAt (m.lexicon words w) g t₁ → HoldsAt (m.lexicon words w) g t₂

                        Over composition models with nonempty domains, entailment between two trees is mathlib's ⊨ᵇ between their readbacks over the empty theory.

                        theorem HeimKratzer.Tree.holdsAt_compactness {L₀ : FirstOrder.Language} {C : Type} {X : Type u_1} {words : X → Option ((ty : Montague.Ty) × FirstOrderConstant L₀ ty)} {ι : Type} {trees : ι → PhraseStructure.Tree C X} {us : ι → Term (FirstOrderConstant L₀) Montague.Ty.t} (hc : ∀ (i : ι), translate words (trees i) = some ⟨Montague.Ty.t, us i⟩) (hcl : ∀ (i : ι), FirstOrder.Language.BoundedFormula.freeVarFinset (us i).toFormula = ∅) :
                        (∃ (m : Model L₀) (_ : Nonempty m.E) (w : m.W) (g : Assignment m.E), ∀ (i : ι), HoldsAt (m.lexicon words w) g (trees i)) ↔ ∀ (s : Finset ι), ∃ (m : Model L₀) (_ : Nonempty m.E) (w : m.W) (g : Assignment m.E), ∀ i ∈ s, HoldsAt (m.lexicon words w) g (trees i)

                        A family of trees whose readbacks are closed is jointly true in a composition model with a nonempty domain iff every finite subfamily is. The nontrivial direction is mathlib's compactness theorem Theory.isSatisfiable_iff_isFinitelySatisfiable.