Documentation

Linglib.Semantics.Causation.Valuation

Valuation: Pi-Typed Partial Variable Assignment #

Replaces the old Situation (which fixed Variable → Option Bool). A Valuation α is a Π-type partial valuation where each vertex v has its own value type α v. The Pi pattern follows mathlib's Algebra/Group/Pi/Basic.lean idiom for index-dependent value families.

α := fun _ => Bool recovers the legacy binary substrate.

A DecidableValuation aggregator typeclass bundles ∀ v, DecidableEq (α v) for use throughout the API.

@[reducible, inline]
abbrev Causation.Valuation {V : Type u_1} (α : VType u_2) :
Type (max u_1 u_2)

Partial valuation: each vertex v either has a value of type α v (encoded some x) or is undetermined (none). Generalizes the old Situation (which fixed α := fun _ => Bool).

Defined as an abbrev for Π-type rather than a structure, so elaboration unifies Valuation α with Π v, Option (α v) directly.

Equations
Instances For
    @[reducible, inline]
    abbrev Causation.DecidableValuation {V : Type u_1} (α : VType u_2) :
    Type (max u_1 u_2)

    Per-vertex decidable equality. An abbrev (not a class) so it unfolds transparently to the bare ∀ v, DecidableEq (α v) constraint typeclass search expects. Avoids the bundled-class antipattern.

    Equations
    Instances For
      def Causation.Valuation.empty {V : Type u_1} {α : VType u_2} :

      The empty valuation: nothing is determined.

      Equations
      Instances For
        @[instance_reducible]
        instance Causation.Valuation.instInhabited {V : Type u_1} {α : VType u_2} :
        Inhabited (Valuation α)
        Equations
        def Causation.Valuation.get {V : Type u_1} {α : VType u_2} (s : Valuation α) (v : V) :
        Option (α v)

        Get the value of a variable (if determined).

        Equations
        Instances For
          def Causation.Valuation.hasValue {V : Type u_1} {α : VType u_2} (s : Valuation α) (v : V) (x : α v) :

          The variable has the given value in the valuation.

          Equations
          Instances For
            def Causation.Valuation.extend {V : Type u_1} {α : VType u_2} [DecidableEq V] (s : Valuation α) (v : V) (x : α v) :

            Extend a valuation with a new assignment. Overwrites if already set.

            Equations
            • s.extend v x w = if h : w = v then some ( x) else s w
            Instances For
              def Causation.Valuation.remove {V : Type u_1} {α : VType u_2} [DecidableEq V] (s : Valuation α) (v : V) :

              Remove a variable from the valuation (set to undetermined).

              Equations
              • s.remove v w = if w = v then none else s w
              Instances For
                @[instance_reducible]
                instance Causation.Valuation.instPartialOrder {V : Type u_1} {α : VType u_2} :
                PartialOrder (Valuation α)

                The information order: s₁ ≤ s₂ iff every value determined in s₁ is determined identically in s₂.

                Equations
                • One or more equations did not get rendered due to their size.
                theorem Causation.Valuation.le_def {V : Type u_1} {α : VType u_2} {s₁ s₂ : Valuation α} :
                s₁ s₂ ∀ (v : V) (x : α v), s₁.hasValue v xs₂.hasValue v x

                The information order unfolds to pointwise preservation of determined values.

                @[simp]
                theorem Causation.Valuation.extend_get_same {V : Type u_1} {α : VType u_2} [DecidableEq V] (s : Valuation α) (v : V) (x : α v) :
                (s.extend v x).get v = some x
                theorem Causation.Valuation.extend_get_ne {V : Type u_1} {α : VType u_2} [DecidableEq V] {s : Valuation α} {v w : V} {x : α v} (h : w v) :
                (s.extend v x).get w = s.get w
                theorem Causation.Valuation.le_extend {V : Type u_1} {α : VType u_2} [DecidableEq V] {s : Valuation α} {v : V} (x : α v) (h : s.get v = none) :
                s s.extend v x

                Extending at an undetermined vertex only adds information.

                @[simp]
                theorem Causation.Valuation.empty_get {V : Type u_1} {α : VType u_2} (v : V) :
                empty.get v = none
                theorem Causation.Valuation.hasValue_empty_iff {V : Type u_1} {α : VType u_2} (v : V) (x : α v) :