Documentation

Linglib.Core.Assignment

Variable Assignments #

@cite{heim-kratzer-1998} @cite{henkin-monk-tarski-1971} @cite{spector-2025} @cite{beaver-krahmer-2001}

Tarski-style total assignments and their partial extension. The polymorphic substrate shared by extensional Heim-Kratzer composition, DPL-style register state, CDRT, Charlow continuations, and trivalent partial-valuation systems.

Assignment E := ℕ → E is pre-intensional — pure Tarski variable mapping — so it lives at the top of Core rather than inside Core.Logic.Intensional. The intensional substrate (Frame, SitAssignment F := Assignment F.Index, DenotGS) builds on this in Core/Logic/Intensional/.

When to use Assignment E vs raw Nat → E #

A struct field, function parameter, or local definition should use Assignment E (or PartialAssign E) precisely when its semantic role is Tarski-style variable assignment / register state / discourse-referent embedding — the same role that gets updated by quantifier binders and looked-up by free variables.

It should not be Assignment E when the structural shape Nat → E happens for an unrelated reason — e.g., model-theoretic name interpretation functions (Name_M in Kamp & Reyle), arity-indexed interpretation tables, lookup arrays, or any Nat → α that doesn't participate in variable-binding semantics. Renaming those would conflate distinct primitives. (KRModel.names : Nat → E in Theories/Semantics/Dynamic/DRT/Basic.lean documents one such case.)

Out of scope #

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

Variable assignment: a function from natural-number indices to values in E. Instantiated at F.Entity for entity pronouns (Heim & Kratzer 1998), at F.Index for situation pronouns (Hanink 2021 / Bondarenko 2023), at Time for temporal variables, and at any other carrier whenever a framework needs Tarski-style variable interpretation.

Equations
Instances For
    def Core.Assignment.update {E : Type u_1} (g : Assignment E) (n : ) (d : E) :

    Pointwise update g[n↦d]: set register n to d, leaving all other registers fixed.

    Equations
    • g.update n d m = if m = n then d else g m
    Instances For
      @[simp]
      theorem Core.Assignment.update_at {E : Type u_1} (g : Assignment E) (n : ) (d : E) :
      g.update n d n = d
      @[simp]
      theorem Core.Assignment.update_ne {E : Type u_1} (g : Assignment E) {n m : } (d : E) (h : m n) :
      g.update n d m = g m
      @[simp]
      theorem Core.Assignment.update_overwrite {E : Type u_1} (g : Assignment E) (n : ) (x y : E) :
      (g.update n x).update n y = g.update n y
      theorem Core.Assignment.update_comm {E : Type u_1} (g : Assignment E) {n m : } (x y : E) (h : n m) :
      (g.update n x).update m y = (g.update m y).update n x
      @[simp]
      theorem Core.Assignment.update_self {E : Type u_1} (g : Assignment E) (n : ) :
      g.update n (g n) = g
      @[reducible, inline]
      abbrev Core.PartialAssign (D : Type u_1) :
      Type u_1

      Partial assignment: variables may be undefined (none).

      Used in trivalent semantics (@cite{spector-2025}, @cite{beaver-krahmer-2001}) where g(x) = none means variable x is not valued. The trivalent application rule that turns this into the third value # lives with the predicate machinery in Theories/Semantics/Presupposition/, not here.

      Equations
      Instances For

        A partial assignment that values no variables.

        Equations
        Instances For
          def Core.PartialAssign.update {D : Type u_1} (g : PartialAssign D) (n : ) (d : D) :

          Update a partial assignment at index n.

          Equations
          • g.update n d m = if m = n then some d else g m
          Instances For
            def Core.PartialAssign.valued {D : Type u_1} (g : PartialAssign D) (n : ) :
            Bool

            Whether variable n is valued by g.

            Equations
            Instances For
              @[simp]
              theorem Core.PartialAssign.update_at {D : Type u_1} (g : PartialAssign D) (n : ) (d : D) :
              g.update n d n = some d
              @[simp]
              theorem Core.PartialAssign.update_ne {D : Type u_1} (g : PartialAssign D) {n m : } (d : D) (h : m n) :
              g.update n d m = g m
              theorem Core.PartialAssign.update_self {D : Type u_1} {g : PartialAssign D} {n : } {a : D} (h : g n = some a) :
              g.update n a = g

              Updating a partial assignment at n to its existing value is a no-op: g.update n a = g whenever g n = some a. The partial-assignment analogue of Assignment.update_self for total assignments above; needed by formalisations that recover the witness as g(x).get (e.g., Mandelkern's bounded theory §5.6 atomic bound-equivalence proofs).

              @[simp]
              theorem Core.PartialAssign.valued_update_at {D : Type u_1} (g : PartialAssign D) (n : ) (d : D) :
              (g.update n d).valued n = true
              @[simp]
              theorem Core.PartialAssign.valued_update_ne {D : Type u_1} (g : PartialAssign D) {n m : } (d : D) (h : m n) :
              (g.update n d).valued m = g.valued m
              theorem Core.PartialAssign.valued_empty {D : Type u_1} (n : ) :
              empty.valued n = false

              Coerce a total assignment to a partial assignment (always valued).

              Equations
              Instances For
                theorem Core.PartialAssign.valued_ofTotal {D : Type u_1} (g : Assignment D) (n : ) :
                (ofTotal g).valued n = true
                structure Core.PluralAssign (D : Type u_1) :
                Type u_1

                Plural assignment: a set of atomic (partial) assignments.

                Originates in plural dynamic semantics (@cite{van-den-berg-1996}, @cite{nouwen-2003}, @cite{brasoveanu-2008}). The plural information state is the basic carrier of Plural CDRT (Brasoveanu, Dotlačil) and its partial extension PPCDRT (Haug 2014, @cite{haug-dalrymple-2020}). Spector's static reuse (@cite{spector-2025}) is the trivalent point of this primitive: variables that are singular across the plural state behave classically; variables that are not are gappy.

                Wrapped in a structure so the bespoke Membership instance is found by typeclass search instead of mathlib's Set instances.

                Consumers: Phenomena/Anaphora/Studies/Spector2025.lean (trivalent), Theories/Semantics/Dynamic/PPCDRT/ (plural partial CDRT).

                Instances For
                  theorem Core.PluralAssign.ext {D : Type u_1} {x y : PluralAssign D} (pred : x.pred = y.pred) :
                  x = y
                  theorem Core.PluralAssign.ext_iff {D : Type u_1} {x y : PluralAssign D} :
                  x = y x.pred = y.pred
                  @[implicit_reducible]
                  Equations

                  Whether G contains at least one atomic assignment. Named IsNonempty rather than Nonempty to avoid shadowing _root_.Nonempty.

                  Equations
                  Instances For
                    def Core.PluralAssign.restrict {D : Type u_1} (G : PluralAssign D) (x : ) (a : D) :

                    Restrict a plural assignment to atomic assignments mapping x to a. Spector §6.2: G_{x=a} is the subset of G where g(x) = a.

                    Equations
                    Instances For
                      def Core.PluralAssign.defined {D : Type u_1} (G : PluralAssign D) (x : ) :

                      Whether any atomic assignment in G is defined for x.

                      Equations
                      Instances For

                        The universal plural assignment: contains every partial assignment. Spector §6: the starting context contains all pairs.

                        Equations
                        Instances For

                          Build a plural assignment from a predicate.

                          Equations
                          Instances For

                            The singleton plural assignment containing exactly g. The minimal plural state — used for the singleton-collapse bridges between PPCDRT and the singular CDRT-style semantics.

                            Equations
                            Instances For
                              def Core.PluralAssign.singularAt {D : Type u_1} (G : PluralAssign D) (x : ) (d : D) :

                              Witness-level singularity: G assigns x uniquely to d. Spector §6.2: at least one atomic assignment maps x to d, and all assignments in G that define x agree on d.

                              NOTE: this allows assignments where x is undefined to coexist with assignments where x = d (only the defined rows are required to agree). The all-defined reading would be stronger; the present reading is the one Spector's static reuse of plural states needs.

                              Equations
                              Instances For
                                def Core.PluralAssign.singular {D : Type u_1} (G : PluralAssign D) (x : ) :

                                singular G x ↔ there is some d such that G assigns x uniquely to it. Spector's atomic(x) predicate; replaces U(x) from the simplified system.

                                Equations
                                Instances For
                                  def Core.PluralAssign.sumDref {D : Type u_1} (G : PluralAssign D) (n : ) :
                                  Set D

                                  Sum-of-values for dref n across the plural state. Spector §6.2 and @cite{haug-dalrymple-2020}'s ∪u operator (paper §2.1, eq 8): the set of values that n takes across all atomic assignments in G.

                                  Equations
                                  Instances For