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

For a measure on a measurable space and a point in that space, the singleton mass is the mass that the measure assigns to the set containing that point alone.

Definition (Lean source)
α :
μ :
x :
α
singletonMass μ x :
μ ({x} : Set α)
Causalean.SCM.ID.DiscreteID.singletonMass · Causalean/SCM/ID/DiscreteID/Mass.lean:36
def marginalMass reviewed
Causalean.SCM.ID.DiscreteID

For a measure, a map to a second measurable space, proof that the map is measurable, and a value in that second space, the marginal mass is the singleton mass of that value under the pushforward of the measure by the map.

Definition (Lean source)
α β :
μ :
f :
α → β
_hf :
y :
β
marginalMass μ f _hf y :
singletonMass (μ.map f) y
Causalean.SCM.ID.DiscreteID.marginalMass · Causalean/SCM/ID/DiscreteID/Mass.lean:43
def conditionalMass reviewed
Causalean.SCM.ID.DiscreteID

For a measure on a product of two measurable spaces, a value of the first coordinate, and a value of the second coordinate, the conditional mass is the joint singleton mass at the two values divided by the singleton mass of the second value under the second-coordinate marginal.

Definition (Lean source)
α β :
μ :
Measure (α × β)
a :
α
b :
β
conditionalMass μ a b :
singletonMass μ (a, b) / singletonMass (μ.map snd) b
Causalean.SCM.ID.DiscreteID.conditionalMass · Causalean/SCM/ID/DiscreteID/Mass.lean:51
def conditionalDenominator reviewed
Causalean.SCM.ID.DiscreteID

For a measure on a product of two measurable spaces and a value of the second coordinate, the conditional denominator is the singleton mass of that value under the measure's second-coordinate marginal.

Definition (Lean source)
α β :
μ :
Measure (α × β)
b :
β
conditionalDenominator μ b :
singletonMass (μ.map snd) b
Causalean.SCM.ID.DiscreteID.conditionalDenominator · Causalean/SCM/ID/DiscreteID/Mass.lean:64
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:278 · 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

For a measure on a measurable space, positive point mass means that every point of that space has nonzero singleton mass.

Definition (Lean source)
α :
μ :
x :
α
PositiveMass μ :
Prop
singletonMass μ x ≠ 0
Causalean.SCM.ID.DiscreteID.PositiveMass · Causalean/SCM/ID/DiscreteID/Positive.lean:33
def DiscretePositive reviewed
Causalean.SCM.ID.DiscreteID

For a finite node-label set, measurable node-value spaces, and a structural causal model, discrete positivity means that, at every assignment of its fixed variables, the model's observational probability measure assigns nonzero mass to every assignment of its observed variables.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
DiscretePositive M :
Prop
PositiveMass (M.obsKernel s)
Causalean.SCM.ID.DiscreteID.DiscretePositive · Causalean/SCM/ID/DiscreteID/Positive.lean:46 · 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:79 · uses PositiveMass , ValuesOn , valuesProjection
def StandardDiscretePositive reviewed
Causalean.SCM.ID.DiscreteID

For a finite node-label set, measurable node-value spaces, and a structural causal model, standard discrete positivity means that the model is standard and has discrete positivity.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
StandardDiscretePositive M :
Prop
clause 1
M.isStandard
Causalean.SCM.ID.DiscreteID.StandardDiscretePositive · Causalean/SCM/ID/DiscreteID/Positive.lean:129 · 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

For a finite population of variables, a SWIG graph, a nonnegative fuel bound, a proposed containing node set, and a target node set, the computable reachability checker returns false at zero fuel, while at positive fuel it accepts exactly the stated one-step or recursively reachable cases.

Definition (Lean source)
N :
Type u_1
shared
G :
cFactorReachableRecB G :
ℕ → Finset (SWIGNode N) → Finset (SWIGNode N) → Bool
clause 1
| 0, _, _ => false
clause 2
| 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

For a finite population of variables, a fuel bound, a SWIG graph, an intervention set, and an outcome-node set, the executable ID checker returns true exactly when the intervention is valid, the outcomes are observed and disjoint from intervention random nodes, and every post-intervention ancestral c-component passes the fuel-bounded reachability check.

Definition (Lean source)
N :
Type u_1
shared
fuel :
G :
X :
Y :
idAlgorithm fuel G X Y :
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 :
Type u_1
N → Type u_2
shared
∀ 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)