Panel.PO

Potential-outcome semantics for panels: cell-level systems, exposure mappings, treatment-history responses, and panel consistency.

Cell­PO 8 core · 0 supporting This file defines PanelPOSystem, the bundled finite-panel potential-outcomes system used by panel regression arguments. ★ DSigmaAlg_le

Cell-Level Potential Outcomes

This file defines PanelPOSystem, the bundled finite-panel potential-outcomes system used by panel regression arguments. A system contains observed weighted cells, a treatment-path random variable, cell-specific exposure maps and baseline exposures, potential outcomes, and factual observed outcomes.

The namespace also provides the realized exposure observedExposure, the factual-outcome accessor observedY, the treatment-path sigma algebra DSigmaAlg, the baseline conditional mean m0, the exposure response tau, and the realized response realizedTau.

structure PanelPOSystem reviewed
Causalean.Panel

A panel potential-outcomes system pairs finite unit and time index sets with a finite collection of observed unit-period cells carrying positive normalized weights, a treatment-path-valued random variable D that is measurable in every unit-period coordinate, a cell-specific exposure mapping e together with a baseline exposure e0, a family of potential outcomes Y at each cell and exposure that is measurable and integrable, and a family of factual observed outcomes Yobs stored independently of the potential-outcome schedule that is likewise measurable and integrable.

Definition (Lean source)
Unit index type.
I :
Type*
Time index type.
T :
Type*
fintypeI :
fintypeT :
decI :
decT :
Observed unit-period cells with positive normalized weights.
cells :
Cells I T
Action type for treatment assignments.
A :
Type*
Observed-cell-indexed exposure set `E_r`.
E :
(r : I × T) → r ∈ cells.observed → Type*
Each observed-cell exposure set carries a measurable structure.
measE :
∀ r hr, MeasurableSpace (E r hr)
Exposure mapping `e_r : (I → T → A) → E_r` for observed cells.
e :
∀ r hr
then
E r hr
Baseline exposure `e_r^0 ∈ E_r` for observed cells.
e0 :
∀ r hr, E r hr
Sample space.
Ω :
measA :
Probability measure.
Treatment path random variable `D : Ω → I → T → A`.
D :
Ω → TreatmentPath I T A
`D` is measurable as a map into the function space. Encoded cellwise: each `(D ·) i t : Ω → A` is measurable.
D_meas :
∀ i t, Measurable (fun ω => D ω i t)
Cell-level potential outcome family `Y r e : Ω → ℝ` on observed cells.
Y :
(r : I × T) → (hr : r ∈ cells.observed) → E r hr → Ω → ℝ
Each potential outcome is measurable.
Y_meas :
∀ r hr e, Measurable (Y r hr e)
Each potential outcome is integrable.
Y_integrable :
∀ r hr e, Integrable (Y r hr e) μ
Factual observed outcome family on observed cells.
Yobs :
(r : I × T) → r ∈ cells.observed → Ω → ℝ
Each factual observed outcome is measurable.
Yobs_meas :
∀ r hr, Measurable (Yobs r hr)
Each factual observed outcome is integrable.
Yobs_integrable :
∀ r hr, Integrable (Yobs r hr) μ
Causalean.Panel.PanelPOSystem · Causalean/Panel/PO/CellPO.lean:52
def observedExposure reviewed
Causalean.Panel.PanelPOSystem

The realized exposure at an observed cell r: E_r = e_r(D).

Definition (Lean source)
def observedExposure (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω) : P.E r hr := P.e r hr (P.D ω)
Causalean.Panel.PanelPOSystem.observedExposure · Causalean/Panel/PO/CellPO.lean:116 · uses PanelPOSystem
def observedY reviewed
Causalean.Panel.PanelPOSystem

The factual observed outcome at an observed cell. It is stored independently from the potential-outcome schedule; the consistency assumption relates it to the potential outcome at the realized exposure.

Definition (Lean source)
def observedY (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω) : ℝ := P.Yobs r hr ω
Causalean.Panel.PanelPOSystem.observedY · Causalean/Panel/PO/CellPO.lean:121 · uses PanelPOSystem
def DSigmaAlg reviewed
Causalean.Panel.PanelPOSystem

The σ-algebra generated by the treatment path D. This is the "information of the assignment vector" — the σ-algebra in \bbE[· | D] of Definition 2.4.

Definition (Lean source)
def DSigmaAlg : MeasurableSpace P.Ω := ⨆ (i : P.I) (t : P.T), comap (fun ω => P.D ω i t) inferInstance
Causalean.Panel.PanelPOSystem.DSigmaAlg · Causalean/Panel/PO/CellPO.lean:127 · uses PanelPOSystem
lemma DSigmaAlg_le reviewed
Causalean.Panel.PanelPOSystem

The σ-algebra generated by the treatment path D, σ(D), is a sub-σ-algebra of the ambient σ-algebra on the outcome space Ω.

Formal statement
P.DSigmaAlg ≤ (inferInstance : MeasurableSpace P.Ω)
Proof (Lean source)
lemma DSigmaAlg_le : P.DSigmaAlg ≤ (inferInstance : MeasurableSpace P.Ω) := by rw [DSigmaAlg] exact iSup_le (fun i => iSup_le (fun t => measurable_iff_comap_le.mp (P.D_meas i t)))
Causalean.Panel.PanelPOSystem.DSigmaAlg_le · Causalean/Panel/PO/CellPO.lean:133 · uses PanelPOSystem , DSigmaAlg
def m0 reviewed
Causalean.Panel.PanelPOSystem

Baseline conditional mean m_r^0(D) := E[Y_r(e_r^0) | D].

Definition (Lean source)
noncomputable def m0 (r : P.I × P.T) (hr : r ∈ P.cells.observed) : P.Ω → ℝ := condExp P.DSigmaAlg P.μ (P.Y r hr (P.e0 r hr))
Causalean.Panel.PanelPOSystem.m0 · Causalean/Panel/PO/CellPO.lean:140 · uses PanelPOSystem
def tau reviewed
Causalean.Panel.PanelPOSystem

Cell-level exposure response τ_r(e | D) := E[Y_r(e) − Y_r(e_r^0) | D].

Definition (Lean source)
noncomputable def tau (r : P.I × P.T) (hr : r ∈ P.cells.observed) (e : P.E r hr) : P.Ω → ℝ := condExp P.DSigmaAlg P.μ (fun ω => P.Y r hr e ω - P.Y r hr (P.e0 r hr) ω)
Causalean.Panel.PanelPOSystem.tau · Causalean/Panel/PO/CellPO.lean:144 · uses PanelPOSystem
def realizedTau reviewed
Causalean.Panel.PanelPOSystem

The realized exposure response τ_r(E_r | D), obtained by evaluating tau at the exposure induced by the realized treatment path.

Definition (Lean source)
noncomputable def realizedTau (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω) : ℝ := P.tau r hr (P.observedExposure r hr ω) ω
Causalean.Panel.PanelPOSystem.realizedTau · Causalean/Panel/PO/CellPO.lean:151 · uses PanelPOSystem
Consistency 3 core · 0 supporting This file states the panel consistency property for a PanelPOSystem. ★ panelConsistency_holds

Panel Consistency

This file states the panel consistency property for a PanelPOSystem. The predicate PanelPOSystem.observedY_eq_potentialOutcome is the pointwise observed-cell equality, while PanelConsistency requires it for every observed cell and sample point. The lemma panelConsistency_holds exposes the equality directly from the assumption.

def observedY_eq_potentialOutcome reviewed
Causalean.Panel.PanelPOSystem

Pointwise consistency at a given observed cell is the equality between the factual observed outcome and the potential outcome indexed by the realized exposure.

Definition (Lean source)
def observedY_eq_potentialOutcome (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω) : Prop := P.observedY r hr ω = P.Y r hr (P.observedExposure r hr ω) ω
Causalean.Panel.PanelPOSystem.observedY_eq_potentialOutcome · Causalean/Panel/PO/Consistency.lean:31 · uses PanelPOSystem
def PanelConsistency reviewed
Causalean.Panel

Panel consistency says that on every observed unit-period cell, the factual outcome equals the potential outcome evaluated at the realized exposure.

Definition (Lean source)
def PanelConsistency (P : PanelPOSystem) : Prop := ∀ (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω), P.observedY_eq_potentialOutcome r hr ω
Causalean.Panel.PanelConsistency · Causalean/Panel/PO/Consistency.lean:39 · uses PanelPOSystem
lemma panelConsistency_holds reviewed
Causalean.Panel

If panel consistency holds for the panel potential-outcome system P, then the factual observed outcome equals the potential outcome evaluated at the realized exposure, for every observed unit-period cell and every sample point.

Formal statement
∀ (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω),
P.observedY r hr ω = P.Y r hr (P.observedExposure r hr ω) ω
Proof (Lean source)
lemma panelConsistency_holds (P : PanelPOSystem) (hP : PanelConsistency P) : ∀ (r : P.I × P.T) (hr : r ∈ P.cells.observed) (ω : P.Ω), P.observedY r hr ω = P.Y r hr (P.observedExposure r hr ω) ω := hP
Exposure 2 core · 0 supporting This file defines Exposure, a cell-specific map from a realized TreatmentPath to a cell-dependent exposure type, and BaselineExposure, a distinguished baseline exposure for each cell.

Exposure Mappings

This file defines Exposure, a cell-specific map from a realized TreatmentPath to a cell-dependent exposure type, and BaselineExposure, a distinguished baseline exposure for each cell. These objects are the potential-outcome interface between treatment histories and cell-level responses.

def Exposure reviewed
Causalean.Panel

An exposure mapping: a known function from realized treatment paths to a cell-dependent exposure set E r.

Definition (Lean source)
def Exposure (I T A : Type*) (E : I × T → Type*) : Type _ := (r : I × T) → TreatmentPath I T A → E r
Causalean.Panel.Exposure · Causalean/Panel/PO/Exposure.lean:31
def BaselineExposure reviewed
Causalean.Panel

A baseline exposure: a distinguished element e_r^0 ∈ E r for every cell r. In the binary finite-memory case this is (0, …, 0).

Definition (Lean source)
def BaselineExposure {I T : Type*} (E : I × T → Type*) : Type _ := (r : I × T) → E r
Causalean.Panel.BaselineExposure · Causalean/Panel/PO/Exposure.lean:36
Mobius 3 core · 3 supporting This file proves the inclusion-exclusion expansion of a binary finite-memory treatment-history response. ★ mobius_expansion

Boolean-Cube Mobius Expansion

This file proves the inclusion-exclusion expansion of a binary finite-memory treatment-history response. The definition indicator builds Boolean histories from subsets of lags, delta gives the interaction coefficient for a subset, and mobius_expansion recovers any response normalized to zero at the all-zero history as a sum of nonempty lag interactions.

def indicator reviewed
Causalean.Panel.PO.Mobius

Indicator history 𝟙_A : ι → Fin 2, equal to 1 on A and 0 elsewhere.

Definition (Lean source)
def indicator (A : Finset ι) : ι → Fin 2 := fun k => if k ∈ A then 1 else 0
Causalean.Panel.PO.Mobius.indicator · Causalean/Panel/PO/Mobius.lean:48
def delta reviewed
Causalean.Panel.PO.Mobius

The interaction effect at a subset S. The main lemma uses this only for non-empty S, but the definition is total.

Definition (Lean source)
noncomputable def delta (τ : (ι → Fin 2) → ℝ) (S : Finset ι) : ℝ := ∑ A ∈ S.powerset, (-1 : ℝ) ^ (S.card - A.card) * τ (indicator A)
Causalean.Panel.PO.Mobius.delta · Causalean/Panel/PO/Mobius.lean:59
theorem mobius_expansion reviewed
Causalean.Panel.PO.Mobius

Any binary finite-memory response τ normalized to zero at the all-zero history can be recovered as the sum of its nonempty inclusion-exclusion interaction coefficients, with each interaction contributing only when every one of its lags is active in the history.

Formal statement
τ :
(ι → Fin 2) → ℝ
hτ0 :
τ (fun _ => 0) = 0
h :
ι → Fin 2
τ h
= ∑ S ∈ (((Finset.univ : Finset ι).powerset.filter (·.Nonempty)) : Finset (Finset ι)), delta τ S * prod S (fun k => ((h k).val : ℝ))
Proof (Lean source)
theorem mobius_expansion [Fintype ι] (τ : (ι → Fin 2) → ℝ) (hτ0 : τ (fun _ => 0) = 0) (h : ι → Fin 2) : τ h = ∑ S ∈ (((Finset.univ : Finset ι).powerset.filter (·.Nonempty)) : Finset (Finset ι)), delta τ S * prod S (fun k => ((h k).val : ℝ)) := by classical let B : Finset ι := Finset.univ.filter (fun k => h k = 1) have hBmem : ∀ k, k ∈ B ↔ h k = 1 := by intro k simp [B, mem_filter] have hh_indB : h = indicator B := by funext k by_cases hk : k ∈ B · have hk' := (hBmem k).1 hk simp [indicator, hk, hk'] · have h0 : h k ≠ 1 := by intro hh exact hk ((hBmem k).2 hh) have h2 : h k = 0 := by apply Fin.ext have hval_ne : (h k).val ≠ 1 := by intro hv apply h0 apply Fin.ext simpa using hv omega simp [indicator, hk, h2] let u : Finset (Finset ι) := (Finset.univ : Finset ι).powerset.filter (·.Nonempty) let s : Finset (Finset ι) := B.powerset.filter (·.Nonempty) change τ h = ∑ S ∈ u, delta τ S * prod S (fun k => ((h k).val : ℝ)) have hstep1 : (∑ S ∈ u, delta τ S * prod S (fun k => ((h k).val : ℝ))) = ∑ S ∈ s, delta τ S := by have hmul : ∀ S ∈ u, delta τ S * prod S (fun k => ((h k).val : ℝ)) = if S ⊆ B then delta τ S else 0 := by intro S hS rw [prod_indicator_eq h B hBmem S] by_cases hSB : S ⊆ B <;> simp [hSB] rw [Finset.sum_congr rfl hmul] have hfilter : u.filter (fun S => S ⊆ B) = s := by ext S simp [u, s, and_comm] rw [← Finset.sum_filter] rw [hfilter] have hstep2 : (∑ S ∈ s, delta τ S) = ∑ A ∈ B.powerset, (∑ S ∈ s, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A) := by rw [show s = B.powerset.filter (·.Nonempty) by rfl] calc (∑ S ∈ B.powerset.filter (·.Nonempty), delta τ S) = ∑ S ∈ B.powerset.filter (·.Nonempty), ∑ A ∈ B.powerset, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) * τ (indicator A) else 0 := by refine Finset.sum_congr rfl ?_ intro S hS rw [delta] have hSsub : S ⊆ B := Finset.mem_powerset.mp (Finset.mem_filter.mp hS).1 have hcard : (∑ A ∈ S.powerset, (-1 : ℝ) ^ (S.card - A.card) * τ (indicator A)) = ∑ A ∈ B.powerset, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) * τ (indicator A) else 0 := by rw [← Finset.sum_filter] have hPowEq : S.powerset = B.powerset.filter (fun A => A ⊆ S) := by ext A constructor · intro hAS exact Finset.mem_filter.mpr ⟨Finset.mem_powerset.mpr ((Finset.mem_powerset.mp hAS).trans hSsub), Finset.mem_powerset.mp hAS⟩ · intro hAS exact Finset.mem_powerset.mpr (Finset.mem_filter.mp hAS).2 simp [hPowEq] simp [hcard] _ = ∑ S ∈ B.powerset.filter (·.Nonempty), ∑ A ∈ B.powerset, (if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A) := by simp [ite_mul] _ = ∑ A ∈ B.powerset, ∑ S ∈ B.powerset.filter (·.Nonempty), (if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A) := by rw [Finset.sum_comm] _ = ∑ A ∈ B.powerset, (∑ S ∈ B.powerset.filter (·.Nonempty), if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A) := by simp [Finset.sum_mul] have hstep3 : (∑ A ∈ B.powerset, (∑ S ∈ s, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A)) = τ (indicator B) := by have hterms : ∀ A ∈ B.powerset, (∑ S ∈ s, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A) = if A = B then τ (indicator B) else 0 := by intro A hA by_cases hA0 : A = ∅ · subst hA0 by_cases hB0 : B = ∅ · rw [hB0] simp [hτ0] · have hne : (∅ : Finset ι) ≠ B := by intro h exact hB0 h.symm simp [hτ0, hne] · have hAne : A.Nonempty := Finset.nonempty_iff_ne_empty.mpr hA0 have hAS : A ⊆ B := Finset.mem_powerset.mp hA have hfilter : s.filter (fun S => A ⊆ S) = B.powerset.filter (A ⊆ ·) := by ext S constructor · intro hS rcases Finset.mem_filter.mp hS with ⟨hSs, hSA⟩ exact Finset.mem_filter.mpr ⟨(Finset.mem_filter.mp hSs).1, hSA⟩ · intro hS rcases Finset.mem_filter.mp hS with ⟨hSsub, hSA⟩ exact Finset.mem_filter.mpr ⟨Finset.mem_filter.mpr ⟨hSsub, hAne.mono hSA⟩, hSA⟩ have hinner : (∑ S ∈ s, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) = ∑ S ∈ B.powerset.filter (A ⊆ ·), (-1 : ℝ) ^ (S.card - A.card) := by rw [← Finset.sum_filter] have hEq : s.filter (fun S => A ⊆ S) = B.powerset.filter (A ⊆ ·) := hfilter simp [hEq] rw [hinner] have hcoeff := coeff_sum A B hAS by_cases hABeq : A = B · subst hABeq simp [hcoeff] · simp [hcoeff, hABeq] calc (∑ A ∈ B.powerset, (∑ S ∈ s, if A ⊆ S then (-1 : ℝ) ^ (S.card - A.card) else 0) * τ (indicator A)) = ∑ A ∈ B.powerset, if A = B then τ (indicator B) else 0 := by exact Finset.sum_congr rfl hterms _ = τ (indicator B) := by rw [Finset.sum_eq_single B] · simp · intro A hA hAB simp [hAB] · intro hB simp at hB rw [hstep1, hstep2, hstep3] simp [hh_indB]
Causalean.Panel.PO.Mobius.mobius_expansion · Causalean/Panel/PO/Mobius.lean:173 · uses delta
3 supporting declarations (lemmas, instances)
  • indicator_empty lemma — The indicator history of the empty subset is the all-zero treatment history.
    indicator (∅ : Finset ι) = fun _ => 0
    Proof (Lean source)
    @[simp] lemma indicator_empty : indicator (∅ : Finset ι) = fun _ => 0 := by funext k; simp [indicator]
    Causalean.Panel.PO.Mobius.indicator_empty · Causalean/Panel/PO/Mobius.lean:53
  • prod_indicator_eq lemma — Indicator product: ∏ k ∈ S, ((h k).val : ℝ) equals 1 if S ⊆ B and 0 otherwise, where B = {k : h k = 1}.
    h :
    ι → Fin 2
    B :
    hB :
    ∀ k, k ∈ B ↔ h k = 1
    S :
    prod S (fun k => ((h k).val : ℝ)) = if S ⊆ B then 1 else 0
    Proof (Lean source)
    lemma prod_indicator_eq (h : ι → Fin 2) (B : Finset ι) (hB : ∀ k, k ∈ B ↔ h k = 1) (S : Finset ι) : prod S (fun k => ((h k).val : ℝ)) = if S ⊆ B then 1 else 0 := by classical by_cases hSB : S ⊆ B · rw [if_pos hSB] apply Finset.prod_eq_one intro k hk have hk1 : h k = 1 := (hB k).mp (hSB hk) rw [hk1]; simp · rw [if_neg hSB] rw [Finset.not_subset] at hSB obtain ⟨k, hkS, hkB⟩ := hSB apply Finset.prod_eq_zero hkS have h0 : h k ≠ 1 := fun hh => hkB ((hB k).mpr hh) have h2 : h k = 0 := by apply Fin.ext have hval_ne : (h k).val ≠ 1 := by intro hv apply h0 apply Fin.ext simpa using hv omega rw [h2]; simp
    Causalean.Panel.PO.Mobius.prod_indicator_eq · Causalean/Panel/PO/Mobius.lean:65
  • coeff_sum lemma — Coefficient sum: for A ⊆ B, ∑ S, A ⊆ S ⊆ B, (-1)^(|S|-|A|) = if A = B then 1 else 0.
    A B :
    hAB :
    A ⊆ B
    (∑ S ∈ B.powerset.filter (A ⊆ ·), (-1 : ℝ) ^ (S.card - A.card)) = if A = B then 1 else 0
    Proof (Lean source)
    lemma coeff_sum (A B : Finset ι) (hAB : A ⊆ B) : (∑ S ∈ B.powerset.filter (A ⊆ ·), (-1 : ℝ) ^ (S.card - A.card)) = if A = B then 1 else 0 := by classical set C := B \ A with hCdef have hAdisj : Disjoint A C := Finset.disjoint_sdiff -- Reindex S = A ∪ T with T ⊆ C. have hreindex : (∑ S ∈ B.powerset.filter (A ⊆ ·), (-1 : ℝ) ^ (S.card - A.card)) = ∑ T ∈ C.powerset, (-1 : ℝ) ^ T.card := by refine Finset.sum_nbij' (fun S => S \ A) (fun T => A ∪ T) ?_ ?_ ?_ ?_ ?_ · intro S hS simp only [mem_filter, Finset.mem_powerset] at hS obtain ⟨hSB, _⟩ := hS exact (Finset.mem_powerset.mpr <| by intro x hx simp only [hCdef, mem_sdiff] at hx ⊢ exact ⟨hSB hx.1, hx.2⟩) · intro T hT simp only [Finset.mem_powerset] at hT simp only [mem_filter, Finset.mem_powerset] have hTC : T ⊆ C := hT have hTB : T ⊆ B := hTC.trans sdiff_subset exact ⟨Finset.union_subset hAB hTB, Finset.subset_union_left⟩ · intro S hS simp only [mem_filter, Finset.mem_powerset] at hS obtain ⟨_, hAS⟩ := hS ext x simp only [mem_union, mem_sdiff] constructor · rintro (hxA | ⟨hxS, _⟩) · exact hAS hxA · exact hxS · intro hxS by_cases hxA : x ∈ A · exact inl hxA · exact inr ⟨hxS, hxA⟩ · intro T hT simp only [Finset.mem_powerset] at hT have hTC : T ⊆ C := hT have hTA : Disjoint A T := Finset.disjoint_of_subset_right hTC hAdisj ext x simp only [mem_sdiff, mem_union] constructor · rintro ⟨hxA | hxT, hxnA⟩ · exact (hxnA hxA).elim · exact hxT · intro hxT refine ⟨Or.inr hxT, ?_⟩ intro hxA exact (Finset.disjoint_left.mp hTA hxA) hxT · intro S hS simp only [mem_filter, Finset.mem_powerset] at hS obtain ⟨_, hAS⟩ := hS rw [Finset.card_sdiff_of_subset hAS] rw [hreindex] by_cases hAB' : A = B · subst hAB' have hC0 : C = ∅ := by simp [hCdef] simp [hC0] · have hCne : C ≠ ∅ := by intro hC0 apply hAB' refine le_antisymm hAB ?_ intro x hxB by_contra hxA have hxC : x ∈ C := by simp [hCdef, hxB, hxA] rw [hC0] at hxC exact Finset.notMem_empty _ hxC have hCne' : C.Nonempty := Finset.nonempty_iff_ne_empty.mpr hCne have hint : (∑ T ∈ C.powerset, (-1 : ℤ) ^ T.card) = 0 := Finset.sum_powerset_neg_one_pow_card_of_nonempty (x := C) hCne' have hreal : (∑ T ∈ C.powerset, (-1 : ℝ) ^ T.card) = 0 := by exact_mod_cast hint simpa [hAB'] using hreal
    Causalean.Panel.PO.Mobius.coeff_sum · Causalean/Panel/PO/Mobius.lean:93
Population­Cells 5 core · 10 supporting This file provides the shared finite-cell population substrate on which the panel estimand-characterization population bridges are built: a finite measurable partition of a probability space into positive-mass cells, tog ★ mean_consistency

Population cell partition

This file provides the shared finite-cell population substrate on which the panel estimand-characterization population bridges are built: a finite measurable partition of a probability space into positive-mass cells, together with cell masses, cell-conditional means, and their basic identities.

structure CellPartition reviewed
Causalean.Panel.PO

A finite measurable partition of a probability space (Ω, μ) into positive-mass cells indexed by a finite type ι: an assignment of a cell to each index such that every cell is measurable, distinct cells are pairwise disjoint, the cells cover the whole space, and every cell has strictly positive probability mass.

Definition (Lean source)
μ :
ι :
Type*
The cell assigned to index `i` (e.g. `{ω | G ω = i}`).
cell :
ι → Set Ω
Each cell is measurable.
cell_meas :
∀ i, MeasurableSet (cell i)
Distinct cells are disjoint.
cell_disj :
Pairwise (onFun Disjoint cell)
The cells cover the whole space.
cell_cov :
(⋃ i, cell i) = univ
Every cell has positive real mass.
cell_pos :
∀ i, 0 < (μ (cell i)).toReal
Causalean.Panel.PO.CellPartition · Causalean/Panel/PO/PopulationCells.lean:46
def cellPartitionOfClassifier reviewed
Causalean.Panel.PO

Build a cell partition from a finite classifier g : Ω → ι: the cells are the level sets {ω | g ω = i}. Disjointness and covering are automatic; the caller supplies measurability and positive mass of each level set. This is the common way panel bridges obtain their partition (cohort map, treated/untreated classifier, cohort-period map, …).

Definition (Lean source)
noncomputable def cellPartitionOfClassifier {ι : Type*} [Fintype ι] (μ : Measure Ω) (g : Ω → ι) (hmeas : ∀ i, MeasurableSet (g ⁻¹' {i})) (hpos : ∀ i, 0 < (μ (g ⁻¹' {i})).toReal) : CellPartition μ ι where cell i := g ⁻¹' {i} cell_meas := hmeas cell_disj := fun _a _b hab => Disjoint.preimage g (Set.disjoint_singleton.mpr hab) cell_cov := by ext ω; simp cell_pos := hpos
Causalean.Panel.PO.cellPartitionOfClassifier · Causalean/Panel/PO/PopulationCells.lean:63 · uses CellPartition
def mass reviewed
Causalean.Panel.PO.CellPartition

Cell probability π_i = ℙ(cell i), as a real number.

Definition (Lean source)
def mass (P : CellPartition μ ι) (i : ι) : ℝ := (μ (P.cell i)).toReal
Causalean.Panel.PO.CellPartition.mass · Causalean/Panel/PO/PopulationCells.lean:89 · uses CellPartition
def mean reviewed
Causalean.Panel.PO.CellPartition

Cell-conditional mean E[f ∣ cell i], i.e. the average of f over the cell computed as its integral over the cell divided by the cell's real mass.

Definition (Lean source)
noncomputable def mean (P : CellPartition μ ι) (f : Ω → ℝ) (i : ι) : ℝ := eventCondExp μ (P.cell i) f
Causalean.Panel.PO.CellPartition.mean · Causalean/Panel/PO/PopulationCells.lean:92 · uses CellPartition
theorem mean_consistency reviewed
Causalean.Panel.PO.CellPartition

Cell-mean consistency descent. On a cell where the treatment value d is binary, d ∈ {0,1}, and pointwise potential-outcome consistency Y = Y0 + d·(Y1 − Y0) holds throughout the cell, the cell-conditional means satisfy the same identity: E[Y ∣ cell] = E[Y0 ∣ cell] + d·(E[Y1 ∣ cell] − E[Y0 ∣ cell]).

Formal statement
P :
i :
ι
Y Y0 Y1 :
Ω → ℝ
d :
hd :
d = 0 ∨ d = 1
hcons :
∀ ω ∈ P.cell i, Y ω = Y0 ω + d * (Y1 ω - Y0 ω)
P.mean Y i = P.mean Y0 i + d * (P.mean Y1 i - P.mean Y0 i)
Proof (Lean source)
theorem mean_consistency (P : CellPartition μ ι) (i : ι) (Y Y0 Y1 : Ω → ℝ) {d : ℝ} (hd : d = 0 ∨ d = 1) (hcons : ∀ ω ∈ P.cell i, Y ω = Y0 ω + d * (Y1 ω - Y0 ω)) : P.mean Y i = P.mean Y0 i + d * (P.mean Y1 i - P.mean Y0 i) := by rcases hd with h0 | h1 · subst h0 have hY : P.mean Y i = P.mean Y0 i := P.mean_congr_on i (fun ω hω => by rw [hcons ω hω]; ring) rw [hY]; ring · subst h1 have hY : P.mean Y i = P.mean Y1 i := P.mean_congr_on i (fun ω hω => by rw [hcons ω hω]; ring) rw [hY]; ring
Causalean.Panel.PO.CellPartition.mean_consistency · Causalean/Panel/PO/PopulationCells.lean:157 · uses CellPartition , mean
10 supporting declarations (lemmas, instances)
Treatment­Path 2 core · 2 supporting This file defines TreatmentPath, the assignment of an action to each unit-time pair, and the finite-memory history constructors used by the panel potential-outcomes layer. ★ History_zero

Treatment Paths and Finite-Memory Histories

This file defines TreatmentPath, the assignment of an action to each unit-time pair, and the finite-memory history constructors used by the panel potential-outcomes layer. History uses an explicit boundary treatment for lags before the observed panel starts, HistoryDefault uses the typeclass default boundary value, and BinaryHistory specializes to binary treatment with zero as the boundary value.

def TreatmentPath reviewed
Causalean.Panel

A treatment path: each unit i : I and time index t : T is assigned an action in A, representing the realized assignment D_{it}.

Definition (Lean source)
def TreatmentPath (I T A : Type*) : Type _ := I → T → A
Causalean.Panel.TreatmentPath · Causalean/Panel/PO/TreatmentPath.lean:22
lemma History_zero reviewed
Causalean.Panel.TreatmentPath

Lag 0 of the finite-memory treatment history equals the unit's contemporaneous treatment value.

Formal statement
a0 :
A
p :
D :
TreatmentPath I (Fin T₀) A
i :
I
t :
Fin T₀
History a0 p D i t 0 = D i t
Proof (Lean source)
@[simp] lemma History_zero (a0 : A) (p : ℕ) (D : TreatmentPath I (Fin T₀) A) (i : I) (t : Fin T₀) : History a0 p D i t 0 = D i t := by unfold History simp
Causalean.Panel.TreatmentPath.History_zero · Causalean/Panel/PO/TreatmentPath.lean:60 · uses TreatmentPath , History
2 supporting declarations (lemmas, instances)