Panel.Estimand­Characterization.OLSWeight­Decomposition.Support

Per-cell measure-theoretic machinery supporting Sloczynski's weighting result in the project's regression substrate.

Basic 7 core · 8 supporting This file sets up the saturated finite-cell control class and the basic cell statistics for Słoczyński's probability-space bridge. ★ cellMean_eq_eventCondExp

Słoczyński bridge basics

This file sets up the saturated finite-cell control class and the basic cell statistics for Słoczyński's probability-space bridge. It defines saturatedClass, cellMass, cellShare, cellTau, propensity, and meanReg; relates cellShare and cellTau to the shared eventCondExp population-cell operator; and proves the elementary bounds cellMass_nonneg, cellMass_sum_eq_one, cellShare_nonneg, and cellShare_le_one. The membership lemmas propensity_mem_saturatedClass and meanReg_mem_saturatedClass supply the saturated-control pieces used by the residualization witnesses.

def saturatedClass reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Linear control class spanned, up to almost-everywhere equality, by the finite family of cell indicators 𝟙{G = g} for g : 𝒢.

Definition (Lean source)
noncomputable def saturatedClass {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsFiniteMeasure μ] (G : Ω → 𝒢) (G_meas : Measurable G) : LinearL2Class μ := CellBridge.indicatorSpan μ G G_meas
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.saturatedClass · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:34 · uses LinearL2Class
def cellMass reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Cell mass (μ {G = g}).toReal, the probability weight of covariate cell g.

Definition (Lean source)
def cellMass {Ω 𝒢 : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (G : Ω → 𝒢) (g : 𝒢) : ℝ := CellBridge.cellMass μ G g
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.cellMass · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:52
def cellShare reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Cell-wise treated share, defined as the indicator-weighted integral of D on covariate cell g, divided by cellMass μ G g. On zero-mass cells, the value is 0 by Mathlib's 0/0 = 0 convention.

Definition (Lean source)
noncomputable def cellShare {Ω 𝒢 : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (D : Ω → ℝ) (G : Ω → 𝒢) (g : 𝒢) : ℝ := CellBridge.cellMean μ D G g
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.cellShare · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:57
def cellTau reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Cell-wise treatment effect E[Y(1) − Y(0) | G = g] in the shared indicator-weighted cell-mean convention. Like cellShare, zero-mass cells collapse to 0.

Definition (Lean source)
noncomputable def cellTau {Ω 𝒢 : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (Y0 Y1 : Ω → ℝ) (G : Ω → 𝒢) (g : 𝒢) : ℝ := CellBridge.cellMean μ (fun ω => Y1 ω - Y0 ω) G g
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.cellTau · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:64
theorem cellMean_eq_eventCondExp reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

For an ambient probability space and covariate space, a probability measure μ on Ω, an integrand F, a measurable covariate map G, and a covariate cell g, the CellBridge indicator-weighted cell mean of F on {G = g} equals the shared event-level conditional expectation of F given {G = g}.

Formal statement
μ :
F :
Ω → ℝ
G :
Ω → 𝒢
G_meas :
g :
𝒢
CellBridge.cellMean μ F G g = eventCondExp μ {ω | G ω = g} F
Proof (Lean source)
theorem cellMean_eq_eventCondExp {Ω 𝒢 : Type*} [MeasurableSpace Ω] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) (F : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (g : 𝒢) : CellBridge.cellMean μ F G g = eventCondExp μ {ω | G ω = g} F := by have hA : MeasurableSet {ω | G ω = g} := G_meas (measurableSet_singleton g) unfold CellBridge.cellMean eventCondExp CellBridge.cellMass congr 1 rw [← MeasureTheory.integral_indicator hA] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall (fun ω => ?_)) by_cases hω : ω ∈ {ω | G ω = g} · simp [Set.indicator_of_mem hω] · simp [Set.indicator_of_notMem hω]
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.cellMean_eq_eventCondExp · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:83 · uses eventCondExp , cellMean
def propensity reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Saturated propensity propensity μ D G ω = cellShare μ D G (G ω) (pointwise, by disjointness of the {G = g} family). Plays the role of p(G(·)) and lies in saturatedClass μ G G_meas.

Definition (Lean source)
noncomputable def propensity {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] (μ : Measure Ω) (D : Ω → ℝ) (G : Ω → 𝒢) : Ω → ℝ := fun ω => ∑ g, cellShare μ D G g * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.propensity · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:119
def meanReg reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Saturated mean regression meanReg μ Y G ω is the cell-wise average of Y, evaluated at G ω. Plays the role of m(G(·)) for the outcome Y. Lies in saturatedClass μ G G_meas.

Definition (Lean source)
noncomputable def meanReg {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] (μ : Measure Ω) (Y : Ω → ℝ) (G : Ω → 𝒢) : Ω → ℝ := fun ω => ∑ g, ((∫ ω', Y ω' * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω' ∂μ) / cellMass μ G g) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.meanReg · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Basic.lean:127
8 supporting declarations (lemmas, instances)
Integrals 1 core · 8 supporting This file proves reusable integral identities for finite covariate cells in the Słoczyński bridge. ★ integral_eq_sum_cell

Słoczyński cell integral identities

This file proves reusable integral identities for finite covariate cells in the Słoczyński bridge. The results convert indicator-weighted integrals into cell masses and cell means, provide integrability facts for products with treatment and cell indicators, and reduce saturated linear-combination orthogonality to per-cell orthogonality. The central declarations are indicator_cell_memLp, integral_cell_indicator_one_eq_cellMass, cell_integral_div_mul_cellMass, cellTau_mul_cellMass, integrable_mul_indicator_D_G, propensity_eq_cellShare_of_mem, meanReg_eq_cellMean_of_mem, integral_mul_saturated_eq_zero_of_cell, and integral_eq_sum_cell.

theorem integral_eq_sum_cell reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

For an ambient probability space and finite covariate space, a measure μ, a measurable covariate map G, and an integrable function F, the integral of F against μ equals the sum, over covariate cells g, of the integral of F restricted to the cell {G = g}.

Formal statement
μ :
F :
Ω → ℝ
G :
Ω → 𝒢
G_meas :
F_int :
∫ ω, F ω ∂μ = ∑ g, ∫ ω, F ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ
Proof (Lean source)
theorem integral_eq_sum_cell {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) (F : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (F_int : Integrable F μ) : ∫ ω, F ω ∂μ = ∑ g, ∫ ω, F ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ := by classical exact CellBridge.integral_eq_sum_cell μ F G G_meas F_int
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.integral_eq_sum_cell · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Integrals.lean:162
8 supporting declarations (lemmas, instances)
Orthogonality 1 core · 2 supporting This file proves the cell-level orthogonality statements needed for the Słoczyński finite-cell bridge. ★ residY_cell_orthogonal

Słoczyński orthogonality helpers

This file proves the cell-level orthogonality statements needed for the Słoczyński finite-cell bridge. It shows that treatment and outcome residuals are orthogonal to saturated cell indicators through residD_cell_orthogonal and residY_cell_orthogonal. It also proves Y_memLp_of_consistency, deriving observed-outcome square-integrability from binary treatment, consistency, and square-integrability of the two potential outcomes.

theorem residY_cell_orthogonal reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

For an ambient probability space and finite covariate space, a square-integrable outcome Y, a measurable covariate map G, and a covariate cell g, the regression residual of Y on the saturated cell-mean model is orthogonal to the indicator of cell {G = g}.

Formal statement
Y :
Ω → ℝ
G :
Ω → 𝒢
G_meas :
Y_memLp :
MemLp Y 2 μ
g :
𝒢
∫ ω, (Y ω - meanReg μ Y G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = 0
Proof (Lean source)
theorem residY_cell_orthogonal {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsFiniteMeasure μ] (Y : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (Y_memLp : MemLp Y 2 μ) (g : 𝒢) : ∫ ω, (Y ω - meanReg μ Y G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = 0 := by classical let s : Set Ω := {ω | G ω = g} let I : Ω → ℝ := fun ω => indicator s (fun _ => (1 : ℝ)) ω let m : ℝ := (∫ ω, Y ω * I ω ∂μ) / cellMass μ G g have hI_mem : MemLp I 2 μ := by simpa [I, s] using indicator_cell_memLp μ G G_meas g have hYInt : Integrable (fun ω => Y ω * I ω) μ := Y_memLp.integrable_mul hI_mem have hmIInt : Integrable (fun ω => m * I ω) μ := (hI_mem.const_mul m).integrable (by norm_num : (1 : ENNReal) ≤ 2) have h_ae : (fun ω => (Y ω - meanReg μ Y G ω) * I ω) =ᵐ[μ] (fun ω => Y ω * I ω - m * I ω) := by filter_upwards [] with ω by_cases hω : ω ∈ s · have hm : meanReg μ Y G ω = m := by simpa [m, I, s] using meanReg_eq_cellMean_of_mem μ Y G hω simp [I, indicator, hω, hm, m] · simp [I, indicator, hω] have hInt : ∫ ω, (Y ω - meanReg μ Y G ω) * I ω ∂μ = ∫ ω, Y ω * I ω ∂μ - ∫ ω, m * I ω ∂μ := by calc ∫ ω, (Y ω - meanReg μ Y G ω) * I ω ∂μ = ∫ ω, Y ω * I ω - m * I ω ∂μ := integral_congr_ae h_ae _ = ∫ ω, Y ω * I ω ∂μ - ∫ ω, m * I ω ∂μ := integral_sub hYInt hmIInt have hIint : ∫ ω, I ω ∂μ = cellMass μ G g := by simpa [I, s] using integral_cell_indicator_one_eq_cellMass μ G G_meas g have hmInt : ∫ ω, m * I ω ∂μ = m * cellMass μ G g := by calc ∫ ω, m * I ω ∂μ = m * ∫ ω, I ω ∂μ := integral_const_mul m I _ = m * cellMass μ G g := by rw [hIint] have hmean : m * cellMass μ G g = ∫ ω, Y ω * I ω ∂μ := by simpa [m, I, s, cellMass, CellBridge.cellMean] using (CellBridge.cellMean_mul_cellMass μ Y G g) change ∫ ω, (Y ω - meanReg μ Y G ω) * I ω ∂μ = 0 rw [hInt, hmInt, hmean] ring
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.residY_cell_orthogonal · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Orthogonality.lean:87 · uses meanReg
2 supporting declarations (lemmas, instances)
  • residD_cell_orthogonal theorem — The treatment residual is orthogonal to each saturated cell indicator.
    D :
    Ω → ℝ
    G :
    Ω → 𝒢
    G_meas :
    D_meas :
    D_binary :
    ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1
    g :
    𝒢
    ∫ ω, (D ω - propensity μ D G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ
    = 0
    Proof (Lean source)
    theorem residD_cell_orthogonal {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsFiniteMeasure μ] (D : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_meas : Measurable D) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (g : 𝒢) : ∫ ω, (D ω - propensity μ D G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = 0 := by classical let s : Set Ω := {ω | G ω = g} let I : Ω → ℝ := fun ω => indicator s (fun _ => (1 : ℝ)) ω let p : ℝ := cellShare μ D G g have hD_mem : MemLp D 2 μ := by have hD_bounded : ∀ᵐ ω ∂μ, D ω ∈ Icc (-1 : ℝ) 1 := by filter_upwards [D_binary] with ω hD rcases hD with hD0 | hD1 · simp [hD0] · simp [hD1] exact memLp_of_bounded (f := D) hD_bounded (D_meas.aestronglyMeasurable) (2 : ENNReal) have hI_mem : MemLp I 2 μ := by simpa [I, s] using indicator_cell_memLp μ G G_meas g have hDInt : Integrable (fun ω => D ω * I ω) μ := hD_mem.integrable_mul hI_mem have hpIInt : Integrable (fun ω => p * I ω) μ := (hI_mem.const_mul p).integrable (by norm_num : (1 : ENNReal) ≤ 2) have h_ae : (fun ω => (D ω - propensity μ D G ω) * I ω) =ᵐ[μ] (fun ω => D ω * I ω - p * I ω) := by filter_upwards [] with ω by_cases hω : ω ∈ s · have hp : propensity μ D G ω = p := propensity_eq_cellShare_of_mem μ D G hω simp [I, indicator, hω, hp, p] · simp [I, indicator, hω] have hInt : ∫ ω, (D ω - propensity μ D G ω) * I ω ∂μ = ∫ ω, D ω * I ω ∂μ - ∫ ω, p * I ω ∂μ := by calc ∫ ω, (D ω - propensity μ D G ω) * I ω ∂μ = ∫ ω, D ω * I ω - p * I ω ∂μ := integral_congr_ae h_ae _ = ∫ ω, D ω * I ω ∂μ - ∫ ω, p * I ω ∂μ := integral_sub hDInt hpIInt have hIint : ∫ ω, I ω ∂μ = cellMass μ G g := by simpa [I, s] using integral_cell_indicator_one_eq_cellMass μ G G_meas g have hpInt : ∫ ω, p * I ω ∂μ = p * cellMass μ G g := by calc ∫ ω, p * I ω ∂μ = p * ∫ ω, I ω ∂μ := integral_const_mul p I _ = p * cellMass μ G g := by rw [hIint] have hshare : p * cellMass μ G g = ∫ ω, D ω * I ω ∂μ := by simpa [p, I, s, cellShare, cellMass] using (CellBridge.cellMean_mul_cellMass μ D G g) change ∫ ω, (D ω - propensity μ D G ω) * I ω ∂μ = 0 rw [hInt, hpInt, hshare] ring
    Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.residD_cell_orthogonal · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Orthogonality.lean:29
  • Y_memLp_of_consistency theorem — The observed outcome Y = D · Y1 + (1 − D) · Y0 is in MemLp 2 μ under consistency, binary treatment, and MemLp 2 μ assumptions for both potential outcomes. The pointwise bound |Y| ≤ |Y0| + |Y1| (a.e.) plus closure of MemLp 2 under sums gives the result. Stated separately because the bridge theorem takes Y_memLp as a hypothesis but downstream consumers (e.g. tests) may need to derive it.
    Ω :
    μ :
    D Y Y0 Y1 :
    Ω → ℝ
    D_meas :
    D_binary :
    ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1
    Y0_memLp :
    MemLp Y0 2 μ
    Y1_memLp :
    MemLp Y1 2 μ
    consis :
    Y =ᵐ[μ] fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω
    MemLp Y 2 μ
    Proof (Lean source)
    theorem Y_memLp_of_consistency {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) {D Y Y0 Y1 : Ω → ℝ} (D_meas : Measurable D) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (Y0_memLp : MemLp Y0 2 μ) (Y1_memLp : MemLp Y1 2 μ) (consis : Y =ᵐ[μ] fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω) : MemLp Y 2 μ := by let s1 : Set Ω := D ⁻¹' ({(1 : ℝ)} : Set ℝ) let s0 : Set Ω := D ⁻¹' ({(0 : ℝ)} : Set ℝ) have hYeq : (fun ω => indicator s1 Y1 ω + indicator s0 Y0 ω) =ᵐ[μ] (fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω) := by filter_upwards [D_binary] with ω hD rcases hD with hD0 | hD1 · simp [s1, s0, hD0] · simp [s1, s0, hD1] have h_mem : MemLp (fun ω => indicator s1 Y1 ω + indicator s0 Y0 ω) 2 μ := by have hD1_meas : MeasurableSet s1 := by simpa [s1] using D_meas (measurableSet_singleton (1 : ℝ)) have hD0_meas : MeasurableSet s0 := by simpa [s0] using D_meas (measurableSet_singleton (0 : ℝ)) exact (Y1_memLp.indicator hD1_meas).add (Y0_memLp.indicator hD0_meas) have h_mem' : MemLp (fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω) 2 μ := by exact (memLp_congr_ae hYeq).1 h_mem exact (memLp_congr_ae consis).2 h_mem'
    Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.Y_memLp_of_consistency · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Orthogonality.lean:139
Partition 4 core · 1 supporting This file constructs the finite partition and residualization witnesses used to connect saturated-control population objects with Słoczyński's finite-partition OLS weight algebra. ★ partitionOf_p_eq_eventCondExp

Słoczyński partition bridge

This file constructs the finite partition and residualization witnesses used to connect saturated-control population objects with Słoczyński's finite-partition OLS weight algebra. The definition partitionOf packages measurable binary treatment and a finite cell classifier into the FinitePartition consumed by the algebraic theorems, while partitionOf_p_eq_eventCondExp and partitionOf_tau_eq_eventCondExp certify that its treated shares and treatment effects are shared population cell means. The definitions residWitnessD and residWitnessY build the residualization witnesses for the treatment and observed outcome variables against the saturated control class.

def partitionOf reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Measurable binary treatment data with a finite cell classifier and positive saturated-overlap denominator determine the finite Słoczyński partition of cell masses, treated shares, and within-cell treatment effects.

Definition (Lean source)
noncomputable def partitionOf {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsProbabilityMeasure μ] (D Y0 Y1 : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (overlap : 0 < ∑ g, cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g))) : FinitePartition 𝒢 := ⟨ cellMass μ G , cellShare μ D G , cellTau μ Y0 Y1 G , fun g => cellMass_nonneg μ G g , cellMass_sum_eq_one μ G G_meas , fun g => cellShare_nonneg μ D G (by filter_upwards [D_binary] with ω hD rcases hD with hD | hD <;> simp [hD]) g , fun g => cellShare_le_one μ D G G_meas (by filter_upwards [D_binary] with ω hD rcases hD with hD | hD <;> simp [hD]) g , overlap ⟩
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.partitionOf · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Partition.lean:32 · uses FinitePartition , cellMass , cellShare
theorem partitionOf_p_eq_eventCondExp reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Population-cell certificate for partitionOf. For a probability space (Ω, μ) with a measurable finite covariate G and treatment/potential-outcome data D, Y0, Y1, suppose treatment is binary almost everywhere and the covariate cells have nondegenerate treatment overlap. Then, for any cell g, the treated share p_g of the Słoczyński partition partitionOf equals the shared population cell mean E[D ∣ G = g] (via eventCondExp).

Formal statement
D Y0 Y1 :
Ω → ℝ
G :
Ω → 𝒢
G_meas :
D_binary :
∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1
overlap :
0 < ∑ g, cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g))
g :
𝒢
(partitionOf μ D Y0 Y1 G G_meas D_binary overlap).p g
= eventCondExp μ {ω | G ω = g} D
Proof (Lean source)
theorem partitionOf_p_eq_eventCondExp {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsProbabilityMeasure μ] (D Y0 Y1 : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (overlap : 0 < ∑ g, cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g))) (g : 𝒢) : (partitionOf μ D Y0 Y1 G G_meas D_binary overlap).p g = eventCondExp μ {ω | G ω = g} D := cellShare_eq_eventCondExp μ D G G_meas g
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.partitionOf_p_eq_eventCondExp · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Partition.lean:61 · uses eventCondExp , cellMass , cellShare , partitionOf
def residWitnessD reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Residualization witness for the treatment variable D.

Definition (Lean source)
noncomputable def residWitnessD {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsProbabilityMeasure μ] (D : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_meas : Measurable D) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) : ResidualizationWitness μ (saturatedClass μ G G_meas) D := by refine { VH := propensity μ D G , Vtilde := fun ω => D ω - propensity μ D G ω , VH_mem := propensity_mem_saturatedClass μ D G G_meas , Vtilde_memLp := by have hD_mem : MemLp D 2 μ := by have hD_bounded : ∀ᵐ ω ∂μ, D ω ∈ Icc (-1 : ℝ) 1 := by filter_upwards [D_binary] with ω hD rcases hD with hD0 | hD1 · simp [hD0] · simp [hD1] exact memLp_of_bounded (f := D) hD_bounded (D_meas.aestronglyMeasurable) (2 : ENNReal) exact hD_mem.sub ((saturatedClass μ G G_meas).memLp (propensity_mem_saturatedClass μ D G G_meas)) , decomp := by filter_upwards [] with ω simp [sub_eq_add_neg, add_left_comm] , orthogonal := by intro h hh rcases hh with ⟨c, hc⟩ have hD_mem : MemLp D 2 μ := by have hD_bounded : ∀ᵐ ω ∂μ, D ω ∈ Icc (-1 : ℝ) 1 := by filter_upwards [D_binary] with ω hD rcases hD with hD0 | hD1 · simp [hD0] · simp [hD1] exact memLp_of_bounded (f := D) hD_bounded (D_meas.aestronglyMeasurable) (2 : ENNReal) have hV_mem : MemLp (fun ω => D ω - propensity μ D G ω) 2 μ := hD_mem.sub ((saturatedClass μ G G_meas).memLp (propensity_mem_saturatedClass μ D G G_meas)) calc ∫ ω, (D ω - propensity μ D G ω) * h ω ∂μ = ∫ ω, (D ω - propensity μ D G ω) * (∑ g, c g * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω) ∂μ := by refine integral_congr_ae ?_ filter_upwards [hc] with ω hω rw [hω] _ = 0 := integral_mul_saturated_eq_zero_of_cell μ (fun ω => D ω - propensity μ D G ω) G G_meas hV_mem c (fun g => residD_cell_orthogonal μ D G G_meas D_meas D_binary g) }
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.residWitnessD · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Partition.lean:94 · uses saturatedClass , ResidualizationWitness
def residWitnessY reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Residualization witness for the outcome variable Y.

Definition (Lean source)
noncomputable def residWitnessY {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsProbabilityMeasure μ] (Y : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (Y_memLp : MemLp Y 2 μ) : ResidualizationWitness μ (saturatedClass μ G G_meas) Y := by refine { VH := meanReg μ Y G , Vtilde := fun ω => Y ω - meanReg μ Y G ω , VH_mem := meanReg_mem_saturatedClass μ Y G G_meas , Vtilde_memLp := by exact Y_memLp.sub ((saturatedClass μ G G_meas).memLp (meanReg_mem_saturatedClass μ Y G G_meas)) , decomp := by filter_upwards [] with ω simp [sub_eq_add_neg, add_left_comm] , orthogonal := by intro h hh rcases hh with ⟨c, hc⟩ have hV_mem : MemLp (fun ω => Y ω - meanReg μ Y G ω) 2 μ := Y_memLp.sub ((saturatedClass μ G G_meas).memLp (meanReg_mem_saturatedClass μ Y G G_meas)) calc ∫ ω, (Y ω - meanReg μ Y G ω) * h ω ∂μ = ∫ ω, (Y ω - meanReg μ Y G ω) * (∑ g, c g * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω) ∂μ := by refine integral_congr_ae ?_ filter_upwards [hc] with ω hω rw [hω] _ = 0 := integral_mul_saturated_eq_zero_of_cell μ (fun ω => Y ω - meanReg μ Y G ω) G G_meas hV_mem c (fun g => residY_cell_orthogonal μ Y G G_meas Y_memLp g) }
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.residWitnessY · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/Partition.lean:164 · uses saturatedClass , ResidualizationWitness
1 supporting declaration (lemmas, instances)
Per­Cell 1 core · 1 supporting This file proves the per-cell denominator and numerator identities used in the Słoczyński finite-cell bridge. ★ num_per_cell

Słoczyński per-cell bridge identities

This file proves the per-cell denominator and numerator identities used in the Słoczyński finite-cell bridge. These identities reduce the Frisch-Waugh-Lovell denominator and numerator to cell masses, treated shares, and cell-specific treatment effects before summing over the finite partition. The theorem denom_per_cell identifies the residualized-treatment second moment on one cell, and num_per_cell identifies the residualized treatment-outcome covariance on one cell under consistency and the finite-cell conditional-mean-independence bridge condition.

theorem num_per_cell reviewed
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition

Per-cell numerator identity. For a probability space (Ω, μ) with measurable treatment D, an outcome Y, square-integrable potential outcomes Y0, Y1, and a measurable finite covariate G, suppose treatment is binary almost everywhere, the observed outcome is consistent — Y equals D·Y1 + (1−D)·Y0 almost everywhere, and the finite-cell conditional-mean-independence bridge condition holds, the integrated finite-cell substitute for E[Y(d) ∣ D, G] = E[Y(d) ∣ G]. Then, for any cell g, the propensity-residual-weighted, cell-indicator-integrated outcome ∫ (D − propensity) · Y · 𝟙{G = g} dμ equals cellMass g · cellShare g · (1 − cellShare g) · cellTau g.

Formal statement
D Y Y0 Y1 :
Ω → ℝ
G :
Ω → 𝒢
G_meas :
D_meas :
D_binary :
∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1
Y0_memLp :
MemLp Y0 2 μ
Y1_memLp :
MemLp Y1 2 μ
consis :
Y =ᵐ[μ] fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω
CMI :
∀ (d : ℝ) (g : 𝒢)
if
d = 0 ∨ d = 1
then
∫ ω, (if d = 1 then Y1 ω else Y0 ω) * indicator {ω' | D ω' = d} (fun _ => (1 : ℝ)) ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ
= (∫ ω, (if d = 1 then Y1 ω else Y0 ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ) * (if d = 1 then cellShare μ D G g else 1 - cellShare μ D G g)
g :
𝒢
∫ ω, (D ω - propensity μ D G ω) * Y ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ
= cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g)) * cellTau μ Y0 Y1 G g
Proof (Lean source)
theorem num_per_cell {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsProbabilityMeasure μ] (D Y Y0 Y1 : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_meas : Measurable D) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (Y0_memLp : MemLp Y0 2 μ) (Y1_memLp : MemLp Y1 2 μ) (consis : Y =ᵐ[μ] fun ω => D ω * Y1 ω + (1 - D ω) * Y0 ω) (CMI : ∀ (d : ℝ) (g : 𝒢), d = 0 ∨ d = 1 → ∫ ω, (if d = 1 then Y1 ω else Y0 ω) * indicator {ω' | D ω' = d} (fun _ => (1 : ℝ)) ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = (∫ ω, (if d = 1 then Y1 ω else Y0 ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ) * (if d = 1 then cellShare μ D G g else 1 - cellShare μ D G g)) (g : 𝒢) : ∫ ω, (D ω - propensity μ D G ω) * Y ω * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g)) * cellTau μ Y0 Y1 G g := by let s : Set Ω := {ω | G ω = g} let I : Ω → ℝ := fun ω => indicator s (fun _ => (1 : ℝ)) ω let J1 : Ω → ℝ := fun ω => indicator {ω' | D ω' = (1 : ℝ)} (fun _ => (1 : ℝ)) ω let J0 : Ω → ℝ := fun ω => indicator {ω' | D ω' = (0 : ℝ)} (fun _ => (1 : ℝ)) ω let p : ℝ := cellShare μ D G g let M : ℝ := cellMass μ G g let τ : ℝ := cellTau μ Y0 Y1 G g let B1 : ℝ := ∫ ω, Y1 ω * I ω ∂μ let B0 : ℝ := ∫ ω, Y0 ω * I ω ∂μ have hI_mem : MemLp I 2 μ := by simpa [I, s] using indicator_cell_memLp μ G G_meas g have hY1IInt : Integrable (fun ω => Y1 ω * I ω) μ := Y1_memLp.integrable_mul hI_mem have hY0IInt : Integrable (fun ω => Y0 ω * I ω) μ := Y0_memLp.integrable_mul hI_mem have hY1J1IInt : Integrable (fun ω => Y1 ω * J1 ω * I ω) μ := by simpa [J1, I, s] using integrable_mul_indicator_D_G μ Y1 D G D_meas G_meas Y1_memLp (1 : ℝ) g have hY0J0IInt : Integrable (fun ω => Y0 ω * J0 ω * I ω) μ := by simpa [J0, I, s] using integrable_mul_indicator_D_G μ Y0 D G D_meas G_meas Y0_memLp (0 : ℝ) g have hTerm1Int : Integrable (fun ω => (1 - p) * (Y1 ω * J1 ω * I ω)) μ := hY1J1IInt.const_mul (1 - p) have hTerm0Int : Integrable (fun ω => p * (Y0 ω * J0 ω * I ω)) μ := hY0J0IInt.const_mul p have h_ae : (fun ω => (D ω - propensity μ D G ω) * Y ω * I ω) =ᵐ[μ] (fun ω => (1 - p) * (Y1 ω * J1 ω * I ω) - p * (Y0 ω * J0 ω * I ω)) := by filter_upwards [D_binary, consis] with ω hD hY by_cases hω : ω ∈ s · have hp : propensity μ D G ω = p := propensity_eq_cellShare_of_mem μ D G hω have hGω : G ω = g := hω rcases hD with hD0 | hD1 · have hY0 : Y ω = Y0 ω := by simpa [hD0] using hY simp [I, J1, J0, s, indicator, hGω, hp, p, hD0, hY0] · have hY1 : Y ω = Y1 ω := by simpa [hD1] using hY simp [I, J1, J0, s, indicator, hGω, hp, p, hD1, hY1] · have hGne : G ω ≠ g := by simpa [s] using hω simp [I, s, indicator, hGne] have hInt : ∫ ω, (D ω - propensity μ D G ω) * Y ω * I ω ∂μ = (1 - p) * (∫ ω, Y1 ω * J1 ω * I ω ∂μ) - p * (∫ ω, Y0 ω * J0 ω * I ω ∂μ) := by calc ∫ ω, (D ω - propensity μ D G ω) * Y ω * I ω ∂μ = ∫ ω, (1 - p) * (Y1 ω * J1 ω * I ω) - p * (Y0 ω * J0 ω * I ω) ∂μ := integral_congr_ae h_ae _ = ∫ ω, (1 - p) * (Y1 ω * J1 ω * I ω) ∂μ - ∫ ω, p * (Y0 ω * J0 ω * I ω) ∂μ := integral_sub hTerm1Int hTerm0Int _ = (1 - p) * (∫ ω, Y1 ω * J1 ω * I ω ∂μ) - p * (∫ ω, Y0 ω * J0 ω * I ω ∂μ) := by rw [integral_const_mul, integral_const_mul] have hA1 : ∫ ω, Y1 ω * J1 ω * I ω ∂μ = B1 * p := by simpa [J1, I, s, B1, p] using CMI (1 : ℝ) g (inr rfl) have hA0 : ∫ ω, Y0 ω * J0 ω * I ω ∂μ = B0 * (1 - p) := by simpa [J0, I, s, B0, p] using CMI (0 : ℝ) g (inl rfl) have hdiff : ∫ ω, (Y1 ω - Y0 ω) * I ω ∂μ = B1 - B0 := by calc ∫ ω, (Y1 ω - Y0 ω) * I ω ∂μ = ∫ ω, Y1 ω * I ω - Y0 ω * I ω ∂μ := by refine integral_congr_ae ?_ filter_upwards [] with ω ring _ = B1 - B0 := by simpa [B1, B0] using integral_sub hY1IInt hY0IInt have hTauM : τ * M = B1 - B0 := by calc τ * M = ∫ ω, (Y1 ω - Y0 ω) * I ω ∂μ := by simpa [τ, M, I, s, cellTau, cellMass] using (CellBridge.cellMean_mul_cellMass μ (fun ω => Y1 ω - Y0 ω) G g) _ = B1 - B0 := hdiff change ∫ ω, (D ω - propensity μ D G ω) * Y ω * I ω ∂μ = M * (p * (1 - p)) * τ calc ∫ ω, (D ω - propensity μ D G ω) * Y ω * I ω ∂μ = (1 - p) * (B1 * p) - p * (B0 * (1 - p)) := by rw [hInt, hA1, hA0] _ = p * (1 - p) * (B1 - B0) := by ring _ = M * (p * (1 - p)) * τ := by rw [← hTauM] ring
Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.num_per_cell · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/PerCell.lean:110 · uses cellMass , cellShare , cellTau , propensity
1 supporting declaration (lemmas, instances)
  • denom_per_cell theorem — Per-cell denominator identity. On the cell {G = g}, (D − propensity)(ω) = D ω − cellShare μ D G g; squaring and using D ∈ {0, 1} plus the defining identity of cellShare gives
    D :
    Ω → ℝ
    G :
    Ω → 𝒢
    G_meas :
    D_meas :
    D_binary :
    ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1
    g :
    𝒢
    ∫ ω, (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ
    = cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g))
    Proof (Lean source)
    theorem denom_per_cell {Ω 𝒢 : Type*} [MeasurableSpace Ω] [Fintype 𝒢] [DecidableEq 𝒢] [MeasurableSpace 𝒢] [MeasurableSingletonClass 𝒢] (μ : Measure Ω) [IsFiniteMeasure μ] (D : Ω → ℝ) (G : Ω → 𝒢) (G_meas : Measurable G) (D_meas : Measurable D) (D_binary : ∀ᵐ ω ∂μ, D ω = 0 ∨ D ω = 1) (g : 𝒢) : ∫ ω, (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * indicator {ω' | G ω' = g} (fun _ => (1 : ℝ)) ω ∂μ = cellMass μ G g * (cellShare μ D G g * (1 - cellShare μ D G g)) := by let s : Set Ω := {ω | G ω = g} let I : Ω → ℝ := fun ω => indicator s (fun _ => (1 : ℝ)) ω let p : ℝ := cellShare μ D G g let A : ℝ := ∫ ω, D ω * I ω ∂μ let M : ℝ := cellMass μ G g have hD_mem : MemLp D 2 μ := by have hD_bounded : ∀ᵐ ω ∂μ, D ω ∈ Icc (-1 : ℝ) 1 := by filter_upwards [D_binary] with ω hD rcases hD with hD0 | hD1 · simp [hD0] · simp [hD1] exact memLp_of_bounded (f := D) hD_bounded (D_meas.aestronglyMeasurable) (2 : ENNReal) have hI_mem : MemLp I 2 μ := by simpa [I, s] using indicator_cell_memLp μ G G_meas g have hDInt : Integrable (fun ω => D ω * I ω) μ := hD_mem.integrable_mul hI_mem have hconstIInt : Integrable (fun ω => (p * p) * I ω) μ := (hI_mem.const_mul (p * p)).integrable (by norm_num : (1 : ENNReal) ≤ 2) have hlinInt : Integrable (fun ω => (1 - 2 * p) * (D ω * I ω)) μ := hDInt.const_mul (1 - 2 * p) have h_ae : (fun ω => (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * I ω) =ᵐ[μ] (fun ω => (1 - 2 * p) * (D ω * I ω) + (p * p) * I ω) := by filter_upwards [D_binary] with ω hD by_cases hω : ω ∈ s · have hp : propensity μ D G ω = p := propensity_eq_cellShare_of_mem μ D G hω rcases hD with hD0 | hD1 · simp [I, indicator, hω, hp, p, hD0] · simp [I, indicator, hω, hp, p, hD1] ring · simp [I, indicator, hω] have hmain : ∫ ω, (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * I ω ∂μ = (1 - 2 * p) * A + (p * p) * M := by calc ∫ ω, (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * I ω ∂μ = ∫ ω, (1 - 2 * p) * (D ω * I ω) + (p * p) * I ω ∂μ := integral_congr_ae h_ae _ = ∫ ω, (1 - 2 * p) * (D ω * I ω) ∂μ + ∫ ω, (p * p) * I ω ∂μ := integral_add hlinInt hconstIInt _ = (1 - 2 * p) * A + (p * p) * M := by rw [integral_const_mul, integral_const_mul] have hIint : ∫ ω, I ω ∂μ = M := by simpa [I, s, M] using integral_cell_indicator_one_eq_cellMass μ G G_meas g simp [A, M, hIint] have hshare : p * M = A := by simpa [p, M, A, I, s, cellShare, cellMass] using (CellBridge.cellMean_mul_cellMass μ D G g) change ∫ ω, (D ω - propensity μ D G ω) * (D ω - propensity μ D G ω) * I ω ∂μ = M * (p * (1 - p)) rw [hmain] rw [← hshare] ring
    Causalean.Panel.EstimandCharacterization.OLSWeightDecomposition.denom_per_cell · Causalean/Panel/EstimandCharacterization/OLSWeightDecomposition/Support/PerCell.lean:31