SCM.ID.Density.Chain­Rule­Density

The joint density of the observed variables of a structural causal model, with respect to a product of σ-finite reference measures, factorizes along the topological order as the product of one-node conditional densities

Core 6 core · 10 supporting This file defines the measurable fibre Radon--Nikodym data and prefix-density products used by the chain rule. ★ rnDeriv_compProd_prod_sigmaFinite_of_fiber_ac

Core constructions for the observational chain-rule density

This file defines the measurable fibre Radon--Nikodym data and prefix-density products used by the chain rule. It also establishes the reference-measure reindexing and product-measure Radon--Nikodym lemmas needed for the induction; the final observational factorization is proved in RadonNikodym.

def obsStepCondDensity reviewed
Causalean.SCM

For a finite collection of distinguishable node labels with measurable value spaces, a structural causal model, a family of σ\sigma-finite reference measures for its node values, a fixed-node assignment, an observed-node position, and assuming finite observational kernels, standard-Borel and nonempty one-node value spaces, and countably generated prefix value spaces, the one-node conditional density factor maps each full observed assignment to the Radon--Nikodym derivative of the conditional law of the node at that position, given its preceding observed values, with respect to that node's reference measure.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
i :
Fin M.observed.card
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
StandardBorelSpace (ValuesOn ({(M.observedAt i).val} : Finset (SWIGNode N)) (swigΩ Ω))
Nonempty (ValuesOn ({(M.observedAt i).val} : Finset (SWIGNode N)) (swigΩ Ω))
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes i.val) (swigΩ Ω))
obsStepCondDensity M ref s i :
ValuesOn M.observed (swigΩ Ω) → ENNReal
fun x
=> ((M.obsStepCondKernel i.isLt) (s, valuesProjection (M.prefixNodes_subset_observed i.val) x)).rnDeriv (ref.μ (M.observedAt i).val) (x (M.observedAt i))
def qFactorDensityProduct reviewed
Causalean.SCM

For a finite collection of distinguishable node labels with measurable value spaces, a structural causal model, a family of σ\sigma-finite reference measures for its node values, and a fixed-node assignment, assuming finite observational kernels, standard-Borel and nonempty one-node value spaces, and countably generated prefix value spaces, the chain-rule density product maps each full observed assignment to the product of all one-node conditional density factors in the canonical observed topological order.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
∀ (k : ℕ) (hk : k < M.observed.card),
StandardBorelSpace (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ (k : ℕ) (hk : k < M.observed.card),
Nonempty (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ k : ℕ,
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes k) (swigΩ Ω))
qFactorDensityProduct M ref s :
ValuesOn M.observed (swigΩ Ω) → ENNReal
fun x => ∏ i : Fin M.observed.card, M.obsStepCondDensity ref s i x
def prefixDensityProduct reviewed
Causalean.SCM

For a finite collection of distinguishable node labels with measurable value spaces, a structural causal model, a family of σ\sigma-finite reference measures for its node values, and a fixed-node assignment, assuming finite observational kernels, standard-Borel and nonempty one-node value spaces, and countably generated prefix value spaces, the recursive prefix-density product maps every prefix length and assignment on that prefix to the value 11 for the empty prefix, and otherwise the preceding prefix density multiplied by the conditional density of the newly appended node, or by 11 when that position is not observed.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
∀ (k : ℕ) (hk : k < M.observed.card),
StandardBorelSpace (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ (k : ℕ) (hk : k < M.observed.card),
Nonempty (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ k : ℕ,
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes k) (swigΩ Ω))
k :
ℕ
prefixDensityProduct M ref s k :
ValuesOn (M.prefixNodes k) (swigΩ Ω) → ENNReal
clause 1
| 0, _ => 1
clause 2
| k + 1, z
=> M.prefixDensityProduct ref s k (valuesProjection (M.prefixNodes_mono (le_succ k)) z) * if h : k < M.observed.card then ((M.obsStepCondKernel h) (s, valuesProjection (M.prefixNodes_mono (le_succ k)) z)).rnDeriv (ref.μ (M.observedAt ⟨k, h⟩).val) (z ⟨(M.observedAt ⟨k, h⟩).val, by rw [M.prefixNodes_succ h] exact mem_union_right _ (mem_singleton_self _)⟩) else 1
def ObsStepFiberRN reviewed
Causalean.SCM

For a finite collection of distinguishable node labels with measurable value spaces, a structural causal model, a family of σ\sigma-finite reference measures for its node values, and a fixed-node assignment, assuming finite observational kernels, standard-Borel and nonempty one-node value spaces, and countably generated prefix value spaces, the stepwise fibre Radon--Nikodym condition requires that, at every observed position, the next observed node is selected, the product reference measure on its preceding prefix is formed, the observational law of that prefix is formed, the conditional kernel of that next node given the prefix is formed, and that kernel is almost surely dominated by its reference measure under the prefix law while its fibre derivative is jointly almost-everywhere measurable under the product reference measure.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
∀ (k : ℕ) (hk : k < M.observed.card),
StandardBorelSpace (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ (k : ℕ) (hk : k < M.observed.card),
Nonempty (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ k : ℕ,
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes k) (swigΩ Ω))
k :
ℕ
hk :
k < M.observed.card
ObsStepFiberRN M ref s :
Prop
node :
(M.observedAt ⟨k, hk⟩).val (: SWIGNode N)
νk :
jointRef ref (M.prefixNodes k) (: Measure (ValuesOn (M.prefixNodes k) (swigΩ Ω)))
chain :
M.obsChainKernel k (le_of_lt hk) s (: Measure (ValuesOn (M.prefixNodes k) (swigΩ Ω)))
stepK :
(M.obsStepCondKernel hk).sectR s (: Kernel (ValuesOn (M.prefixNodes k) (swigΩ Ω)) (swigΩ Ω node))
∀ᵐ a ∂chain, stepK a ≪ ref.μ node
AEMeasurable (fun p : ValuesOn (M.prefixNodes k) (swigΩ Ω) × swigΩ Ω node => (stepK p.1).rnDeriv (ref.μ node) p.2) (νk.prod (ref.μ node))
def prefixStepDensityInPrefix reviewed
Causalean.SCM

For a finite collection of distinguishable node labels with measurable value spaces, a structural causal model, a family of σ\sigma-finite reference measures for its node values, a fixed-node assignment, a prefix length kk, an assignment on its prefix, and a natural-number position ii, assuming finite observational kernels, standard-Borel and nonempty one-node value spaces, and countably generated prefix value spaces, the prefix-read one-step density factor is the conditional density factor at position ii when i<ki<k and that position is observed, the value 11 when i<ki<k but the position is not observed, and the value 11 when i≥ki\ge k.

Definition (Lean source)
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
s :
M.FixedValues
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
∀ (i : ℕ) (hi : i < M.observed.card),
StandardBorelSpace (ValuesOn ({(M.observedAt ⟨i, hi⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ (i : ℕ) (hi : i < M.observed.card),
Nonempty (ValuesOn ({(M.observedAt ⟨i, hi⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ i : ℕ,
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes i) (swigΩ Ω))
k :
ℕ
z :
ValuesOn (M.prefixNodes k) (swigΩ Ω)
i :
ℕ
prefixStepDensityInPrefix M ref s k z i :
if hi : i < k then if hcard : i < M.observed.card then ((M.obsStepCondKernel hcard) (s, valuesProjection (M.prefixNodes_mono (le_of_lt hi)) z)).rnDeriv (ref.μ (M.observedAt ⟨i, hcard⟩).val) (z ⟨(M.observedAt ⟨i, hcard⟩).val, by rw [M.observedAt_mem_prefixNodes_iff k ⟨i, hcard⟩] exact hi⟩) else 1 else 1
lemma rnDeriv_compProd_prod_sigmaFinite_of_fiber_ac reviewed
Causalean.SCM

For two measurable spaces, a finite source measure, a source reference measure, a target reference measure, a finite transition kernel, and a proposed source density, if the source measure is dominated by its reference, almost every transition fibre is dominated by the target reference, the fibre density is jointly almost-everywhere measurable, and the proposed source density is the source Radon–Nikodym derivative, then the joint composition-product density is almost surely the product of the source and conditional densities.

Formal statement
α β :
μ ν :
ρ :
κ :
Kernel α β
f :
α → ENNReal
hμν :
μ ≪ ν
hfiber :
∀ᵐ a ∂μ, κ a ≪ ρ
hfiber_meas :
AEMeasurable (fun p : α × β => (κ p.1).rnDeriv ρ p.2) (ν.prod ρ)
hf :
μ.rnDeriv ν =ᵐ[ν] f
(μ ⊗ₘ κ).rnDeriv (ν.prod ρ) =ᵐ[ν.prod ρ] fun p => f p.1 * (κ p.1).rnDeriv ρ p.2
Proof (Lean source)
lemma rnDeriv_compProd_prod_sigmaFinite_of_fiber_ac {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] (μ ν : Measure α) (ρ : Measure β) (κ : Kernel α β) (f : α → ENNReal) [IsFiniteMeasure μ] [SigmaFinite ν] [SigmaFinite ρ] [IsFiniteKernel κ] (hμν : μ ≪ ν) (hfiber : ∀ᵐ a ∂μ, κ a ≪ ρ) (hfiber_meas : AEMeasurable (fun p : α × β => (κ p.1).rnDeriv ρ p.2) (ν.prod ρ)) (hf : μ.rnDeriv ν =ᵐ[ν] f) : (μ ⊗ₘ κ).rnDeriv (ν.prod ρ) =ᵐ[ν.prod ρ] fun p => f p.1 * (κ p.1).rnDeriv ρ p.2 := by exact rnDeriv_compProd_prod_sigmaFinite μ ν ρ κ f hμν hfiber hfiber_meas hf
Causalean.SCM.rnDeriv_compProd_prod_sigmaFinite_of_fiber_ac · Causalean/SCM/ID/Density/ChainRuleDensity/Core.lean:517
10 supporting declarations (lemmas, instances)
Radon­Nikodym 1 core · 8 supporting This file proves the prefix induction that turns stepwise conditional Radon--Nikodym derivatives into the density of the observational chain kernel. ★ obsDensity_eq_qFactorDensityProduct

Radon--Nikodym chain rule for observational densities

This file proves the prefix induction that turns stepwise conditional Radon--Nikodym derivatives into the density of the observational chain kernel. It concludes that obsDensity equals the product of the one-node q-factor densities under the stated domination and measurability assumptions.

theorem obsDensity_eq_qFactorDensityProduct reviewed
Causalean.SCM

Observational density chain rule. In a structural causal model whose observational law is absolutely continuous with respect to the joint reference measure on the observed nodes, if in addition the stepwise fibre Radon--Nikodym condition holds along the observed topological order, then the joint observational density agrees, almost everywhere with respect to that joint reference measure, with the product of the one-node conditional density factors taken in observed topological order.

Formal statement
N :
Type u_1
N → Type u_2
shared
M :
SCM N Ω
hdom :
s :
M.FixedValues
∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')
∀ (k : ℕ) (hk : k < M.observed.card),
StandardBorelSpace (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ (k : ℕ) (hk : k < M.observed.card),
Nonempty (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))
∀ k : ℕ,
CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes k) (swigΩ Ω))
hstep :
M.obsDensity ref s =ᵐ[jointRef ref M.observed] M.qFactorDensityProduct ref s
Proof (Lean source)
theorem obsDensity_eq_qFactorDensityProduct (M : SCM N Ω) (ref : ReferenceMeasures Ω) (hdom : DominatedObs M ref) (s : M.FixedValues) [∀ s' : M.FixedValues, IsFiniteMeasure (M.obsKernel s')] [∀ (k : ℕ) (hk : k < M.observed.card), StandardBorelSpace (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))] [∀ (k : ℕ) (hk : k < M.observed.card), Nonempty (ValuesOn ({(M.observedAt ⟨k, hk⟩).val} : Finset (SWIGNode N)) (swigΩ Ω))] [∀ k : ℕ, CountableOrCountablyGenerated M.FixedValues (ValuesOn (M.prefixNodes k) (swigΩ Ω))] (hstep : ObsStepFiberRN M ref s) : M.obsDensity ref s =ᵐ[jointRef ref M.observed] M.qFactorDensityProduct ref s := by unfold obsDensity rw [obsKernel_eq_chainRuleProduct M s] exact M.qFactorProduct_rnDeriv_eq_qFactorDensityProduct ref hdom s hstep
8 supporting declarations (lemmas, instances)