Documentation

Linglib.Core.Causal.Mechanism.Deterministic

Mechanism.deterministic: Deterministic-as-Dirac Constructor (V2) #

The deterministic mechanism induced by an honest function over parents is built as a Dirac PMF — the exact mathlib pattern from Mathlib/Probability/Kernel/Basic.lean where Kernel.deterministic (f) := dirac ∘ f.

noncomputable def Core.Causal.Mechanism.deterministic {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (f : ((u : (G.parents v)) → α u)α v) :
Mechanism G α v

The deterministic mechanism induced by an honest function over parents. Mirrors Kernel.deterministic from Mathlib/Probability/Kernel/Basic.lean. Noncomputable because PMF.pure is noncomputable.

Equations
Instances For
    @[simp]
    theorem Core.Causal.Mechanism.deterministic_run {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (f : ((u : (G.parents v)) → α u)α v) (ρ : (u : (G.parents v)) → α u) :
    (deterministic f).run ρ = PMF.pure (f ρ)
    @[implicit_reducible]
    instance Core.Causal.Mechanism.instIsDeterministicDeterministic {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (f : ((u : (G.parents v)) → α u)α v) :

    Deterministic mechanisms satisfy the IsDeterministic mixin.

    Equations
    @[simp]
    theorem Core.Causal.Mechanism.deterministic_toFun {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (f : ((u : (G.parents v)) → α u)α v) :
    noncomputable def Core.Causal.Mechanism.const {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (x : α v) :
    Mechanism G α v

    A constant mechanism: ignores parents, always returns the same value via Dirac. Useful for intervene-style mechanism replacement. Noncomputable inherited via deterministic.

    Equations
    Instances For
      @[simp]
      theorem Core.Causal.Mechanism.const_run {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (x : α v) (ρ : (u : (G.parents v)) → α u) :
      (const x).run ρ = PMF.pure x
      @[implicit_reducible]
      instance Core.Causal.Mechanism.instIsDeterministicConst {V : Type u_1} {α : VType u_2} {G : CausalGraph V} {v : V} (x : α v) :
      Equations