Documentation

Linglib.Semantics.Dynamic.PLA.Semantics

@[reducible, inline]

An assignment maps variable indices to entities

Equations
Instances For
    @[reducible, inline]

    A witness sequence maps pronoun indices to entities

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

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

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        structure Semantics.Dynamic.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 Semantics.Dynamic.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 Semantics.Dynamic.PLA.Term.eval_var {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) (i : VarIdx) :
            eval g ê (var i) = g i
            @[simp]
            theorem Semantics.Dynamic.PLA.Term.eval_pron {E : Type u_1} (g : Assignment E) (ê : WitnessSeq E) (i : PronIdx) :
            eval g ê (pron i) = ê i
            def Semantics.Dynamic.PLA.Formula.sat {E : Type u_1} [Nonempty E] (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 Semantics.Dynamic.PLA.Formula.trueIn {E : Type u_1} [Nonempty E] (M : Model E) (φ : Formula) :

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

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

                Double negation elimination

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

                Conjunction elimination (left)

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

                Conjunction elimination (right)

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

                Conjunction introduction

                theorem Semantics.Dynamic.PLA.Formula.sat_exists_intro {E : Type u_1} [Nonempty E] (M : Model E) (g : Assignment E) (ê : WitnessSeq E) (i : VarIdx) (φ : Formula) (e : E) :
                sat M (g[i e]) ê φsat M g ê (exists_ i φ)

                Existential introduction

                theorem Semantics.Dynamic.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 Semantics.Dynamic.PLA.Formula.sat_resolve {E : Type u_1} [Nonempty E] (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
                • One or more equations did not get rendered due to their size.
                Instances For

                  Resolution: p₀ → x₀

                  Equations
                  Instances For
                    theorem Semantics.Dynamic.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.

                    theorem Semantics.Dynamic.PLA.obs4_pla_pl_equivalence {E : Type u_1} [Nonempty E] (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 Semantics.Dynamic.PLA.obs5_relevance {E : Type u_1} [Nonempty E] (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.

                    PLA distinguishes variables (VarIdx) from pronouns (PronIdx); Dynamic Ty2 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]

                    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

                          Convert PLAPoss to merged assignment.

                          Equations
                          Instances For

                            Convert merged assignment to PLAPoss.

                            Equations
                            Instances For

                              Functional update for merged assignments (only affects variables).

                              Equations
                              Instances For

                                Evaluate a term given a merged assignment.

                                Equations
                                Instances For

                                  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 Semantics.Dynamic.PLA.formulaToDRS_atom {E : Type u_1} [Nonempty E] (M : Model E) (name : String) (ts : List Term) :
                                      formulaToDRS M (Formula.atom name ts) = Core.test fun (g : MergedAssignment E) => M.interp name (List.map (evalTerm g) ts) = true
                                      theorem Semantics.Dynamic.PLA.formulaToDRS_neg {E : Type u_1} [Nonempty E] (M : Model E) (φ : Formula) :
                                      theorem Semantics.Dynamic.PLA.formulaToDRS_conj {E : Type u_1} [Nonempty E] (M : Model E) (φ ψ : Formula) :
                                      theorem Semantics.Dynamic.PLA.formulaToDRS_exists {E : Type u_1} [Nonempty E] (M : Model E) (x : VarIdx) (φ : Formula) :
                                      formulaToDRS M (Formula.exists_ x φ) = Core.test fun (g : MergedAssignment E) => ∃ (e : E), formulaToCondition M φ (extend g x e)

                                      Split a merged assignment into variable and witness components.

                                      Equations
                                      Instances For
                                        theorem Semantics.Dynamic.PLA.extend_fst_eq_update {E : Type u_1} [Nonempty E] (g : MergedAssignment E) (x : VarIdx) (e : E) :
                                        (splitAssignment (extend g x e)).1 = (splitAssignment g).1[x e]
                                        theorem Semantics.Dynamic.PLA.extend_snd_eq {E : Type u_1} [Nonempty E] (g : MergedAssignment E) (x : VarIdx) (e : E) :
                                        theorem Semantics.Dynamic.PLA.formulaToDRS_correct {E : Type u_1} [Nonempty E] (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.