Documentation

Linglib.Semantics.Dynamic.PLA.Semantics

PLA satisfaction and truth #

Satisfaction and truth for Predicate Logic with Anaphora [Dek12]. Variables are interpreted by an assignment g; pronouns get their values from outside the formula through a witness sequence ê. Satisfaction M, g, ê ⊨ φ is relative to both; truth existentially quantifies the witness sequence.

Main definitions #

Main results #

@[reducible, inline]
abbrev PLA.Assignment (E : Type u_1) :
Type u_1

An assignment maps variable indices to entities

Equations
Instances For
    @[reducible, inline]
    abbrev PLA.WitnessSeq (E : Type u_1) :
    Type u_1

    A witness sequence maps pronoun indices to entities

    Equations
    Instances For
      def PLA.«term_[_↦_]» :
      Lean.TrailingParserDescr

      Assignment-update notation g[i ↦ e] for mathlib's Function.update.

      Unlike Semantics/Intensional/Variables.lean's notation:max, this stays at the default precedence: at max the trailing [ would capture the list-literal arguments of Formula.atom.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        structure PLA.Model (E : Type u_1) :
        Type u_1

        A model provides predicate interpretations

        • interp : StringList EBool

          Interpretation: predicate name → argument tuple → truth value

        Instances For
          def PLA.Term.eval {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) :
          TermE

          Evaluate a term given assignment g and witness sequence ê.

          ⟦x_i⟧^{g,ê} = g(i) (variables from assignment) ⟦p_i⟧^{g,ê} = ê(i) (pronouns from witness sequence)

          Variables and pronouns have different interpretation sources.

          Equations
          Instances For
            @[simp]
            theorem PLA.Term.eval_var {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) (i : VarIdx) :
            eval g ê (var i) = g i
            @[simp]
            theorem PLA.Term.eval_pron {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) (i : PronIdx) :
            eval g ê (pron i) = ê i
            theorem PLA.Term.eval_resolve {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) (ρ : Resolution) (t : Term) (h : ∀ (i : PronIdx), t = pron iê i = g (ρ i)) :
            eval g ê t = eval g ê (resolve ρ t)

            Term evaluation under resolution: when ê(i) = g(ρ(i)), evaluation is preserved.

            theorem PLA.Term.eval_witness_irrelevant {E : Type u_1} (t : Term) (ht : t.pronouns = ) (g : Assignment E) (ê₁ ê₂ : WitnessSeq E) :
            eval g ê₁ t = eval g ê₂ t

            For pronoun-free terms, evaluation doesn't depend on the witness sequence.

            def PLA.Formula.sat {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) :

            PLA Satisfaction: M, g, ê ⊨ φ

            [Dek12] Definition 4, Ch. 2 (PLA Satisfaction and Truth, p.22; adapted to type-theoretic setting).

            • Atomic: check predicate interpretation on evaluated terms
            • Negation: classical negation
            • Conjunction: both conjuncts satisfied
            • Existential: witness exists in domain
            Equations
            Instances For
              def PLA.Formula.trueIn {E : Type u_1} (M : Model E) (φ : Formula) :

              Truth in a model: M ⊨ φ iff for all g, ∃ê such that M, g, ê ⊨ φ

              Equations
              Instances For
                theorem PLA.Formula.sat_neg_neg {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (φ : Formula) :
                sat M g ê (φ) sat M g ê φ

                Double negation elimination

                theorem PLA.Formula.sat_conj_left {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (φ ψ : Formula) :
                sat M g ê (φ ψ)sat M g ê φ

                Conjunction elimination (left)

                theorem PLA.Formula.sat_conj_right {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (φ ψ : Formula) :
                sat M g ê (φ ψ)sat M g ê ψ

                Conjunction elimination (right)

                theorem PLA.Formula.sat_conj_intro {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (φ ψ : Formula) :
                sat M g ê φsat M g ê ψsat M g ê (φ ψ)

                Conjunction introduction

                theorem PLA.Formula.sat_exists_intro {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (i : VarIdx) (φ : Formula) (e : E) :
                sat M (Function.update g i e) ê φsat M g ê (exists_ i φ)

                Existential introduction

                theorem PLA.Formula.sat_resolve {E : Type u_1} (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (ρ : Resolution) (φ : Formula) (hcompat : iφ.range, ê i = g (ρ i)) (hnoCapture : iφ.range, ρ iφ.domain) :
                sat M g ê φ sat M g ê (resolve ρ φ)

                Resolution Correctness ([Dek12] Observation 7, §2.2, p.30).

                If the witness sequence agrees with the assignment via resolution (ê = g ∘ ρ on pronouns), and no pronoun resolves to a bound variable, then satisfaction is preserved:

                M, g, ê ⊨ φ ↔ M, g, ê ⊨ φ^ρ

                "A man walked. He sat down."

                Equations
                Instances For

                  Resolution: p₀ → x₀

                  Equations
                  Instances For
                    theorem PLA.obs4_pla_pl_equivalence {E : Type u_1} (M : Model E) (φ : Formula) (hfree : φ.range = ) (g : Assignment E) (ê₁ ê₂ : WitnessSeq E) :
                    Formula.sat M g ê₁ φ Formula.sat M g ê₂ φ

                    Observation 4 ([Dek12] §2.2, p.25): PLA and PL equivalence.

                    For pronoun-free formulas, satisfaction is independent of the witness sequence. This shows PLA conservatively extends PL: standard predicate logic formulas have the same truth conditions in PLA as in PL.

                    theorem PLA.obs5_relevance {E : Type u_1} (M : Model E) (φ : Formula) (g₁ g₂ : Assignment E) (ê₁ ê₂ : WitnessSeq E) (hg : xφ.freeVars, g₁ x = g₂ x) ( : iφ.range, ê₁ i = ê₂ i) :
                    Formula.sat M g₁ ê₁ φ Formula.sat M g₂ ê₂ φ

                    Observation 5 ([Dek12] §2.2): Relevance.

                    Satisfaction depends only on the values of free variables and pronouns that actually occur in the formula. Assignments that agree on freeVars and witness sequences that agree on range yield the same satisfaction.

                    Embedding into Dynamic Ty2 #

                    PLA distinguishes variables (VarIdx) from pronouns (PronIdx); Dynamic Ty2 ([Mus96]) has a single dref type S → E. The embedding uses the sum type (VarIdx ⊕ PronIdx) → E as the S parameter, providing type-safe separation without magic numbers. Because PLA updates are eliminative (filter, never extend), every PLA formula translates to a test in Dynamic Ty2.

                    @[reducible, inline]
                    abbrev PLA.MergedAssignment (E : Type u_2) :
                    Type u_2

                    PLA assignment merging variable and pronoun assignments via sum type: .inl i accesses variable i, .inr i accesses pronoun i.

                    Equations
                    Instances For

                      Variable dref: projection at .inl i.

                      Equations
                      Instances For

                        Pronoun dref: projection at .inr i.

                        Equations
                        Instances For

                          Interpret a PLA term as a Dynamic Ty2 dref.

                          Equations
                          Instances For
                            def PLA.extend {E : Type u_1} (g : MergedAssignment E) (i : VarIdx) (e : E) :

                            Functional update for merged assignments (only affects variables).

                            Equations
                            • PLA.extend g i e (Sum.inl j) = if j = i then e else g (Sum.inl j)
                            • PLA.extend g i e (Sum.inr j) = g (Sum.inr j)
                            Instances For
                              def PLA.evalTerm {E : Type u_1} (g : MergedAssignment E) :
                              TermE

                              Evaluate a term given a merged assignment.

                              Equations
                              Instances For

                                Split a merged assignment into variable and witness components.

                                Equations
                                Instances For
                                  theorem PLA.extend_fst_eq_update {E : Type u_1} (g : MergedAssignment E) (x : VarIdx) (e : E) :
                                  (splitAssignment (extend g x e)).1 = Function.update (splitAssignment g).1 x e
                                  theorem PLA.extend_snd_eq {E : Type u_1} (g : MergedAssignment E) (x : VarIdx) (e : E) :

                                  Translate a PLA formula to a Dynamic Ty2 condition.

                                  PLA existentials check for existence of a witness but don't extend the assignment (eliminative semantics).

                                  Equations
                                  Instances For

                                    Translate a PLA formula to a Dynamic Ty2 Update. PLA's eliminative updates mean every formula translates to a test.

                                    Equations
                                    Instances For
                                      theorem PLA.formulaToDRS_atom {E : Type u_1} (M : Model E) (name : String) (ts : List Term) :
                                      formulaToDRS M (Formula.atom name ts) = DynamicSemantics.Update.test fun (g : MergedAssignment E) => M.interp name (List.map (evalTerm g) ts) = true
                                      theorem PLA.formulaToDRS_exists {E : Type u_1} (M : Model E) (x : VarIdx) (φ : Formula) :
                                      theorem PLA.formulaToDRS_correct {E : Type u_1} (M : Model E) (φ : Formula) (g h : MergedAssignment E) :
                                      formulaToDRS M φ g h g = h Formula.sat M (splitAssignment g).1 (splitAssignment g).2 φ

                                      A merged assignment satisfies the embedded Update iff the split assignment satisfies the original PLA formula.