SCM.ID.Discrete ID

Discrete ID support: point-mass algebra, positivity conditions, and the executable checker for finite/discrete identification formulas.

Mass 5 core · 16 supporting This file provides the finite-measure primitives used by the discrete ID lane: singleton masses, marginal singleton masses, and conditional masses as ratios. ★ valuesOn_measure_eq_of_singletonMass_eq

Finite masses for discrete ID

This file provides the finite-measure primitives used by the discrete ID lane: singleton masses, marginal singleton masses, and conditional masses as ratios. The definitions are intentionally point-mass based, so later ID proofs can state positivity on the actual denominators used by a formula.

The main API includes:

* singletonMass, marginalMass, conditionalMass, and conditionalDenominator for writing finite observational formulas. * measure_eq_of_singletonMass_eq and valuesOn_measure_eq_of_singletonMass_eq, which reduce equality of finite/countable measures to equality of all singleton masses. * singletonMass_map_eq_sum_fiber, singletonMass_comp_eq_sum, and the point-mass specializations for constant or degenerate mixtures. * conditionalMass_mul_denominator, the algebraic cancellation lemma that recovers the joint point mass from a conditional-mass ratio once the actual denominator is nonzero and finite.

def singletonMass reviewed
Causalean.SCM.ID.DiscreteID

The mass that a measure assigns to a single point.

Definition (Lean source)
noncomputable def singletonMass {α : Type*} [MeasurableSpace α] (μ : Measure α) (x : α) : ENNReal := μ ({x} : Set α)
Causalean.SCM.ID.DiscreteID.singletonMass · Causalean/SCM/ID/DiscreteID/Mass.lean:36
def marginalMass reviewed
Causalean.SCM.ID.DiscreteID

The marginal mass of a selected coordinate value.

Definition (Lean source)
noncomputable def marginalMass {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (μ : Measure α) (f : α → β) (_hf : Measurable f) (y : β) : ENNReal := singletonMass (μ.map f) y
Causalean.SCM.ID.DiscreteID.marginalMass · Causalean/SCM/ID/DiscreteID/Mass.lean:41
def conditionalMass reviewed
Causalean.SCM.ID.DiscreteID

A discrete conditional mass, written as a ratio of a joint point mass to a marginal point mass. A sound ID formula must separately carry positivity for the denominator when it uses this value.

Definition (Lean source)
noncomputable def conditionalMass {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (μ : Measure (α × β)) (a : α) (b : β) : ENNReal := singletonMass μ (a, b) / singletonMass (μ.map snd) b
Causalean.SCM.ID.DiscreteID.conditionalMass · Causalean/SCM/ID/DiscreteID/Mass.lean:46
def conditionalDenominator reviewed
Causalean.SCM.ID.DiscreteID

The denominator used by conditionalMass.

Definition (Lean source)
noncomputable def conditionalDenominator {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (μ : Measure (α × β)) (b : β) : ENNReal := singletonMass (μ.map snd) b
Causalean.SCM.ID.DiscreteID.conditionalDenominator · Causalean/SCM/ID/DiscreteID/Mass.lean:54
theorem valuesOn_measure_eq_of_singletonMass_eq reviewed
Causalean.SCM.ID.DiscreteID

For two measures on a finite-coordinate product over countable value spaces, if every value assignment carries the same singleton point mass under both measures, then the two measures are equal.

Formal statement
M :
Type*
M → Type*
∀ m, MeasurableSpace (Ω' m)
∀ m, Countable (Ω' m)
I :
h :
∀ x : ValuesOn I Ω', singletonMass μ x = singletonMass ν x
μ = ν
Proof (Lean source)
theorem valuesOn_measure_eq_of_singletonMass_eq {M : Type*} {Ω' : M → Type*} [∀ m, MeasurableSpace (Ω' m)] [∀ m, Countable (Ω' m)] (I : Finset M) {μ ν : Measure (ValuesOn I Ω')} (h : ∀ x : ValuesOn I Ω', singletonMass μ x = singletonMass ν x) : μ = ν := measure_eq_of_singletonMass_eq h
Causalean.SCM.ID.DiscreteID.valuesOn_measure_eq_of_singletonMass_eq · Causalean/SCM/ID/DiscreteID/Mass.lean:266 · uses singletonMass , ValuesOn
16 supporting declarations (lemmas, instances)
Positive 4 core · 4 supporting The discrete ID lane uses ratio-based conditional masses. ★ map_valuesProjection

Positivity assumptions for discrete ID formulas

The discrete ID lane uses ratio-based conditional masses. This file records the nonzero point-mass assumptions needed to make those ratios meaningful. The default model-level predicate is full observational support on every observed assignment at every fixed slice; later formula-level soundness lemmas can weaken it to only the denominators actually used by a concrete formula.

Important declarations are PositiveMass, DiscretePositive, and StandardDiscretePositive, together with transport lemmas showing that positive point mass is preserved by measurable surjections and coordinate projections. These lemmas turn full observational support into the denominator positivity needed by conditionalMass.

def PositiveMass reviewed
Causalean.SCM.ID.DiscreteID

A measure has full point-mass support when every singleton has nonzero mass.

Definition (Lean source)
def PositiveMass {α : Type*} [MeasurableSpace α] (μ : Measure α) : Prop := ∀ x : α, singletonMass μ x ≠ 0
Causalean.SCM.ID.DiscreteID.PositiveMass · Causalean/SCM/ID/DiscreteID/Positive.lean:33
def DiscretePositive reviewed
Causalean.SCM.ID.DiscreteID

A discrete SCM has full observational support on every observed assignment, at every fixed-value slice. This is strong but non-vacuous, and it is the safe default assumption for first-pass discrete ID soundness.

Definition (Lean source)
def DiscretePositive (M : SCM N Ω) : Prop := ∀ s : M.FixedValues, PositiveMass (M.obsKernel s)
Causalean.SCM.ID.DiscreteID.DiscretePositive · Causalean/SCM/ID/DiscreteID/Positive.lean:45 · uses SCM
theorem map_valuesProjection reviewed
Causalean.SCM.ID.DiscreteID.PositiveMass

If a measure assigns nonzero point mass to every value assignment on the full index set, then restricting to the values on a subset of coordinates reached by projection preserves this: the pushed-forward measure still assigns nonzero point mass to every value assignment on that subset.

Formal statement
M :
Type*
M → Type*
∀ m, MeasurableSpace (Ω' m)
∀ m, Nonempty (Ω' m)
μ :
:
hJI :
J ⊆ I
PositiveMass (μ.map (valuesProjection (Ω := Ω') hJI))
Proof (Lean source)
theorem PositiveMass.map_valuesProjection {M : Type*} {I J : Finset M} {Ω' : M → Type*} [∀ m, MeasurableSpace (Ω' m)] [∀ m, Nonempty (Ω' m)] [MeasurableSingletonClass (ValuesOn J Ω')] {μ : Measure (ValuesOn I Ω')} (hμ : PositiveMass μ) (hJI : J ⊆ I) : PositiveMass (μ.map (valuesProjection (Ω := Ω') hJI)) := by classical exact PositiveMass.map_of_surjective (measurable_valuesProjection hJI) hμ (valuesProjection_surjective hJI)
Causalean.SCM.ID.DiscreteID.PositiveMass.map_valuesProjection · Causalean/SCM/ID/DiscreteID/Positive.lean:73 · uses PositiveMass , ValuesOn , valuesProjection
def StandardDiscretePositive reviewed
Causalean.SCM.ID.DiscreteID

The structural assumptions for the first discrete ID soundness target.

Definition (Lean source)
def StandardDiscretePositive (M : SCM N Ω) : Prop := M.isStandard ∧ DiscretePositive M
Causalean.SCM.ID.DiscreteID.StandardDiscretePositive · Causalean/SCM/ID/DiscreteID/Positive.lean:123 · uses SCM
4 supporting declarations (lemmas, instances)
Checker 3 core · 5 supporting id_sound_rec proves soundness for the *declarative* success certificate idSucceedsRec (an inductive predicate — an existence claim needing a hand-built derivation). ★ idAlgorithm_sound

The executable ID algorithm and its soundness

id_sound_rec proves soundness for the declarative success certificate idSucceedsRec (an inductive predicate — an existence claim needing a hand-built derivation). This file adds the executable checker: a computable Bool-valued function idAlgorithm that runs Tian's IDENTIFY procedure with a fuel bound, together with idAlgorithm_sound — when the checker reports true, the interventional query is identified.

* cFactorReachableRecB — computable, choice-free fuel-bounded IDENTIFY reachability (mirrors the inductive CFactorReachableRec, using cComponentSet.any in place of the noncomputable containingCComponent). * idAlgorithm — the runnable checker: valid intervention, observed query, and every post-intervention ancestral district recursively reachable. * idAlgorithm_sound — the public soundness theorem: idAlgorithm … = true implies IdentifiableUnder … (interventionalQuery X Y) over the standard discrete positive model class. Obtained from id_sound_rec_discrete through the structural bridge idAlgorithm_success_toRec.

def cFactorReachableRecB reviewed
Causalean.SCM.ID

Computable fuel-bounded IDENTIFY reachability. Returns true when the c-factor Q[C] can be recovered from Q[T] within fuel IDENTIFY steps. This is the executable mirror of the inductive CFactorReachableRec: it is choice-free (it searches (G.induce A).cComponentSet with any instead of naming the component via the noncomputable containingCComponent).

Definition (Lean source)
def cFactorReachableRecB (G : SWIGGraph N) : ℕ → Finset (SWIGNode N) → Finset (SWIGNode N) → Bool | 0, _, _ => false | fuel + 1, T, C => decide C.Nonempty && decide (C ⊆ T) && (let A := inducedAncestral G T C if A = C then true else if A = T then false else decide (∃ C' ∈ (G.induce A).cComponentSet, C ⊆ C' ∧ cFactorReachableRecB G fuel C' C = true))
Causalean.SCM.ID.cFactorReachableRecB · Causalean/SCM/ID/DiscreteID/Checker.lean:36 · uses SWIGGraph , SWIGNode
def idAlgorithm reviewed
Causalean.SCM.ID

The executable ID checker. Runs the recursive Tian–Shpitser algorithm on (G, X, Y) with fuel reduction steps: it requires a valid intervention split, an observed query disjoint from X, and that every c-component of the post-intervention ancestral graph is recursively reachable from its containing district. Computable — usable with #eval / decide on concrete graphs.

Definition (Lean source)
def idAlgorithm (fuel : ℕ) (G : SWIGGraph N) (X : Finset N) (Y : Finset (SWIGNode N)) : Bool := if h : interventionValid X G then decide (Y ⊆ G.observed) && decide (∀ d ∈ X, SWIGNode.random d ∉ Y) && decide (∀ S ∈ ((G.splitMono X h.1 h.2).induce ((G.splitMono X h.1 h.2).dag.ancestralSet Y)).cComponentSet, ∃ C ∈ G.cComponentSet, S ⊆ C ∧ cFactorReachableRecB G fuel C S = true) else false
theorem idAlgorithm_sound reviewed
Causalean.SCM.ID

Soundness of the executable ID algorithm. When the runnable checker idAlgorithm returns true on the graph G, intervention set X, query Y, and the given fuel bound, the interventional query P(Y ∣ do(X)) is identified within the standard discrete positive model class.

Formal statement
∀ n, StandardBorelSpace (Ω n)
∀ n, Nonempty (Ω n)
∀ n, Fintype (Ω n)
fuel :
G :
X :
Y :
h :
idAlgorithm fuel G X Y = true
Proof (Lean source)
theorem idAlgorithm_sound [∀ n, StandardBorelSpace (Ω n)] [∀ n, Nonempty (Ω n)] [∀ n, Fintype (Ω n)] [∀ n, MeasurableSingletonClass (Ω n)] (fuel : ℕ) (G : SWIGGraph N) (X : Finset N) (Y : Finset (SWIGNode N)) (h : idAlgorithm fuel G X Y = true) : IdentifiableUnder G (fun _ => True) StandardDiscretePositive (interventionalQuery (Ω := Ω) X Y) := id_sound_rec_discrete X Y G (idAlgorithm_success_toRec fuel G X Y h)
5 supporting declarations (lemmas, instances)