PO.Core
The graph-free potential-outcome core: systems, variables, finite intervention regimes, and joint counterfactual distributions.
Regime 10 core · 16 supporting This file defines finite intervention regimes for the potential-outcome framework. ★ Regime★ ofList_target
Intervention Regimes
This file defines finite intervention regimes for the potential-outcome framework. A regime records the variables fixed by an intervention and the assigned value for each fixed variable, without assuming a graph or structural causal model.
An intervention regime specifies a finite set of targeted variables together with an assigned value in the corresponding value space for each targeted variable.
Definition (Lean source)
The empty intervention regime fixes no variables and therefore has no assignments.
Definition (Lean source)
Two intervention regimes are disjoint exactly when their target sets have no variable in common.
The left-biased union of two regimes targets their union and uses the first regime's assignment wherever both regimes target the same variable.
Definition (Lean source)
The disjoint union of two compatible intervention regimes targets the union of their target sets and uses the assignment from the unique component regime that targets each variable.
Definition (Lean source)
A singleton intervention regime fixes exactly one variable to the supplied value.
Lookup in a list of variable-value assignments returns the listed value for a variable that appears among the listed labels.
A list of variable-value assignments determines a regime by using the first listed assignment for each targeted variable.
Definition (Lean source)
A duplicate-free list of variable-value assignments determines the intervention regime that targets exactly the listed variables and assigns each target its listed value.
For a duplicate-free list of variable-value assignments l, the target of the regime it determines is exactly the finite set of variables listed in l.
Formal statement
16 supporting declarations (lemmas, instances)
-
sqcup_targetlemma — The target of the disjoint union of two regimes is the union of their target sets.hypothesesr₁ r₂ :Regime V Xh :r₁.Disjoint r₂conclusion(r₁.sqcup r₂ h).target = r₁.target ∪ r₂.targetProof (Lean source)
@[simp] lemma sqcup_target (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) : (r₁.sqcup r₂ h).target = r₁.target ∪ r₂.target := rfl -
sqcup_assign_poslemma — sqcup agrees with r₁ whenever v ∈ r₁.target.hypothesesconclusion(r₁.sqcup r₂ h).assign v (by simp [Regime.sqcup, Regime.leftBiasedUnion, h1])= r₁.assign v h1Proof (Lean source)
lemma sqcup_assign_pos (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) (v : V) (h1 : v ∈ r₁.target) : (r₁.sqcup r₂ h).assign v (by simp [Regime.sqcup, Regime.leftBiasedUnion, h1]) = r₁.assign v h1 := by simp [Regime.sqcup, Regime.leftBiasedUnion, h1] -
sqcup_assign_neglemma — sqcup agrees with r₂ whenever v ∉ r₁.target (and hence v ∈ r₂.target).hypothesesconclusion(r₁.sqcup r₂ h).assign v (by simp [Regime.sqcup, Regime.leftBiasedUnion, h2])= r₂.assign v h2Proof (Lean source)
lemma sqcup_assign_neg (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) (v : V) (h1 : v ∉ r₁.target) (h2 : v ∈ r₂.target) : (r₁.sqcup r₂ h).assign v (by simp [Regime.sqcup, Regime.leftBiasedUnion, h2]) = r₂.assign v h2 := by simp [Regime.sqcup, Regime.leftBiasedUnion, h1] -
exttheorem — Extensionality for Regime: equal targets and pointwise-equal assignments.hypothesesr₁ r₂ :Regime V Xhtgt :r₁.target = r₂.targethassign :∀ v (h₁ : v ∈ r₁.target) (h₂ : v ∈ r₂.target), r₁.assign v h₁ = r₂.assign v h₂conclusionr₁ = r₂ -
single_assign_selftheorem — Evaluating the singleton intervention assignment at its target returns the supplied value.Proof (Lean source)
theorem single_assign_self (v : V) (x : X v) : (single v x : Regime V X).assign v (mem_singleton_self _) = x := rfl -
single_disjoint_singletheorem — Singleton intervention regimes on two distinct variables are disjoint.hypothesesv w :Vhvw :v ≠ wx :X vy :X wProof (Lean source)
theorem single_disjoint_single {v w : V} (hvw : v ≠ w) (x : X v) (y : X w) : (single v x : Regime V X).Disjoint (single w y) := by simp [Disjoint, single, hvw] -
single_disjoint_of_not_memtheorem — A singleton intervention regime is disjoint from any regime that does not target its variable.hypothesesProof (Lean source)
theorem single_disjoint_of_not_mem {v : V} (x : X v) (r : Regime V X) (h : v ∉ r.target) : (single v x : Regime V X).Disjoint r := by simp [Disjoint, single, Finset.disjoint_singleton_left, h] -
disjoint_single_of_not_memtheorem — Any regime that does not target a variable is disjoint from the singleton intervention on that variable.hypothesesconclusionr.Disjoint (single v x : Regime V X)Proof (Lean source)
theorem disjoint_single_of_not_mem {v : V} (x : X v) (r : Regime V X) (h : v ∉ r.target) : r.Disjoint (single v x : Regime V X) := by simp [Disjoint, single, Finset.disjoint_singleton_right, h] -
ofList_cons_targettheorem — The target of a regime built from a nonempty list inserts the head variable into the target from the tail.hypotheses -
listLookup_cons_selftheorem — Looking up the head variable of a dependent assignment list returns the head value.Proof (Lean source)
theorem listLookup_cons_self {v : V} {x : X v} {rest : List ((v : V) × X v)} : listLookup (⟨v, x⟩ :: rest) v (by simp) = x := by simp [listLookup] -
listLookup_cons_of_netheorem — Looking up a different variable skips the head of a dependent assignment list and continues in the tail.hypothesesconclusionlistLookup (⟨w, x⟩ :: rest) v (by simp [hv']) = listLookup rest v hv'Proof (Lean source)
theorem listLookup_cons_of_ne {v w : V} {x : X w} {rest : List ((v : V) × X v)} (hvw : v ≠ w) (hv' : v ∈ rest.map fst) : listLookup (⟨w, x⟩ :: rest) v (by simp [hv']) = listLookup rest v hv' := by simp [listLookup, hvw]
System 5 core · 2 supporting This file defines a graph-free potential-outcome system, its coordinate-level potential outcomes, subset-valued potential outcomes, and the induced pushforward law of a subset under a regime. ★ POSystem★ measurable_component
Potential Outcome Systems
This file defines a graph-free potential-outcome system, its coordinate-level potential outcomes, subset-valued potential outcomes, and the induced pushforward law of a subset under a regime. These are the base objects used by the counterfactual and identification layers of the library.
A potential-outcome system consists of a finite set of variables, a measurable value space for each variable, a measurable sample space carrying a probability measure, and, for every intervention regime and sample point, a jointly measurable assignment of potential-outcome values to all variables.
Definition (Lean source)
A coordinate potential outcome maps each unit to the value a selected variable would take under a selected intervention regime.
Definition (Lean source)
For an intervention regime r and a variable v, the coordinate potential outcome of v under r is a measurable function of the unit.
Formal statement
Proof (Lean source)
A joint potential outcome maps each unit to the vector of values a selected finite set of variables would take under a selected intervention regime.
Definition (Lean source)
A potential-outcome law is the distribution of a selected finite set of variables under a selected intervention regime.
2 supporting declarations (lemmas, instances)
-
measurable_poVariablelemma — The joint potential outcome for any finite set of variables under any intervention regime is measurable.Proof (Lean source)
lemma measurable_poVariable (r : Regime P.V P.X) (Y : Finset P.V) : Measurable (P.poVariable r Y) := by refine measurable_pi_lambda _ ?_ intro v exact (measurable_pi_apply v.val).comp (P.measurable_eval r) -
instIsProbabilityMeasureValuesOnVXPoOperatorinstance — The potential-outcome law of a finite set of variables under a regime is a probability measure.instance (r : Regime P.V P.X) (Y : Finset P.V) : IsProbabilityMeasure (P.poOperator r Y) := by unfold poOperator exact isProbabilityMeasure_map (P.measurable_poVariable r Y).aemeasurable
Counterfactual 3 core · 2 supporting This file constructs finite joint distributions of potential outcomes evaluated under possibly different intervention regimes. ★ counterfactualDist_marginal
Cross-World Counterfactual Distributions
This file constructs finite joint distributions of potential outcomes evaluated under possibly different intervention regimes. It supplies the cross-world evaluation map, its pushforward law, and the basic marginal reading of that law.
For a potential-outcome system, a finite list of queries, and a unit in the sample space, this function returns the tuple whose th component is the potential outcome, for the finite variable set in the th query, under the intervention regime in the th query.
For a potential-outcome system and a finite list of counterfactual queries, the counterfactual distribution is the probability measure obtained by pushing the system's probability measure on the sample space through the cross-world evaluation map for those queries.
For a finite list of counterfactual queries qs and an index i into that list, the i-th coordinate marginal of the joint counterfactual distribution over all queries equals the potential-outcome law for query i alone.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
measurable_crossWorldEvallemma — The cross-world evaluation map for a finite list of counterfactual queries is measurable.Proof (Lean source)
lemma measurable_crossWorldEval (qs : List (Regime P.V P.X × Finset P.V)) : Measurable (P.crossWorldEval qs) := by refine measurable_pi_lambda _ ?_ intro i exact P.measurable_poVariable _ _ -
instIsProbabilityMeasureForallValuesOnVSndRegimeXFinsetGetElemListProdFinLengthLtNatValCounterfactualDistinstance — The finite cross-world counterfactual distribution is a probability measure.instance (qs : List (Regime P.V P.X × Finset P.V)) : IsProbabilityMeasure (P.counterfactualDist qs) := by unfold counterfactualDist exact isProbabilityMeasure_map (P.measurable_crossWorldEval qs).aemeasurable
Variable 11 core · 12 supporting This file packages a variable of a potential-outcome system together with a common measurable value space, so that factual and counterfactual realizations can be handled uniformly. ★ POVar★ indicator_eq_event_indicator★ RegimedVar
Potential-Outcome Variables
This file packages a variable of a potential-outcome system together with a common measurable value space, so that factual and counterfactual realizations can be handled uniformly. It also provides event indicators and variables paired with intervention regimes for counterfactual independence statements.
The main public objects are POVar, its factual and counterfactual value maps
factual, cf, and cfUnder, the factual-event indicator API, and
RegimedVar for bundling a variable with the regime under which it is evaluated.
A potential-outcome variable records a system variable together with a measurable relabeling of its native value space into a chosen analysis scale α.
Definition (Lean source)
A counterfactual value function assigns each unit the value that a selected variable would have under a selected intervention regime, reported on its chosen analysis scale.
A factual value function assigns each unit the observed no-intervention value of a selected variable, reported on its chosen analysis scale.
A factual-value event is the set of units whose observed value of a selected variable equals a selected analysis-scale value.
The potential outcome of variable y when the intervention variable w is set to the value d: the single-variable counterfactual y(w := d). (Binders follow the usual econometric convention — y is the outcome variable and d is the treatment/intervention value; w is the variable being intervened on.)
Definition (Lean source)
A factual-value indicator is the zero-one function that marks units whose observed value of a selected variable equals a selected analysis-scale value.
For a potential-outcome variable a and a value x in its range, the real-valued factual indicator a.indicator x equals the set-indicator of the factual event {a = x}.
Formal statement
Proof (Lean source)
A regimed variable pairs a potential-outcome variable with the intervention regime under which it should be evaluated.
Definition (Lean source)
A regimed variable's value function assigns each unit the counterfactual value implied by the variable-regime pair.
Definition (Lean source)
Factual bundling views a potential-outcome variable as evaluated under the no-intervention regime.
Definition (Lean source)
Single-intervention bundling views a potential-outcome variable as evaluated after fixing one system variable to a chosen native value.
Definition (Lean source)
12 supporting declarations (lemmas, instances)
-
measurable_cflemma — The counterfactual-value function of a potential-outcome variable under any intervention regime is measurable.Proof (Lean source)
lemma measurable_cf (a : POVar P α) (r : Regime P.V P.X) : Measurable (a.cf r) := a.equiv.measurable.comp ((measurable_pi_apply _).comp (P.measurable_eval r)) -
measurable_factuallemma — The factual-value function of a potential-outcome variable is measurable.Proof (Lean source)
-
measurableSet_eventlemma — The event that a potential-outcome variable's factual value equals a given singleton-measurable value is measurable.hypothesesconclusionMeasurableSet (a.event x)Proof (Lean source)
lemma measurableSet_event (a : POVar P α) (x : α) (hx : MeasurableSet ({x} : Set α)) : MeasurableSet (a.event x) := a.measurable_factual hx -
measurable_cfUnderlemma — The single-intervention counterfactual-value function is measurable.hypothesesconclusionMeasurable (y.cfUnder w d)Proof (Lean source)
lemma measurable_cfUnder {β : Type*} [MeasurableSpace β] (y : POVar P α) (w : POVar P β) (d : β) : Measurable (y.cfUnder w d) := y.measurable_cf _ -
indicator_apply_eq_onelemma — Pointwise: a.indicator x ω = 1 on {a = x}.Proof (Lean source)
lemma indicator_apply_eq_one (a : POVar P α) {x : α} {ω : P.Ω} (hω : a.factual ω = x) : a.indicator x ω = 1 := by unfold POVar.indicator exact Set.indicator_of_mem (show ω ∈ a.event x from hω) _ -
indicator_apply_eq_zerolemma — Pointwise: a.indicator x ω = 0 off {a = x}.Proof (Lean source)
lemma indicator_apply_eq_zero (a : POVar P α) {x : α} {ω : P.Ω} (hω : a.factual ω ≠ x) : a.indicator x ω = 0 := by unfold POVar.indicator exact Set.indicator_of_notMem (show ω ∉ a.event x from hω) _ -
measurable_indicatorlemma — a.indicator x is measurable.hypothesesconclusionMeasurable (a.indicator x)Proof (Lean source)
lemma measurable_indicator (a : POVar P α) (x : α) (hx : MeasurableSet ({x} : Set α)) : Measurable (a.indicator x) := by unfold POVar.indicator exact ((measurable_const : Measurable (fun _ : P.Ω => (1 : ℝ)))).indicator (a.measurableSet_event x hx) -
stronglyMeasurable_indicator_comaplemma — a.indicator x is strongly measurable w.r.t. the σ-algebra generated by a.factual.hypothesesconclusionProof (Lean source)
lemma stronglyMeasurable_indicator_comap (a : POVar P α) (x : α) (hx : MeasurableSet ({x} : Set α)) : StronglyMeasurable[MeasurableSpace.comap a.factual inferInstance] (a.indicator x) := by letI : MeasurableSpace P.Ω := MeasurableSpace.comap a.factual inferInstance have hev : MeasurableSet[MeasurableSpace.comap a.factual inferInstance] (a.event x) := ⟨{x}, hx, rfl⟩ have hmeas : Measurable[MeasurableSpace.comap a.factual inferInstance] (a.indicator x) := by unfold POVar.indicator exact (measurable_const).indicator hev exact hmeas.stronglyMeasurable -
integrable_indicatorlemma — a.indicator x is integrable under any finite measure (bounded by 1).hypothesesconclusionIntegrable (a.indicator x) μProof (Lean source)
lemma integrable_indicator {μ : Measure P.Ω} [IsFiniteMeasure μ] (a : POVar P α) (x : α) (hx : MeasurableSet ({x} : Set α)) : Integrable (a.indicator x) μ := by refine MeasureTheory.Integrable.of_bound (a.measurable_indicator x hx).aestronglyMeasurable 1 (Filter.Eventually.of_forall ?_) intro ω unfold POVar.indicator by_cases hω : ω ∈ a.event x · simp [Set.indicator_of_mem hω] · simp [Set.indicator_of_notMem hω] -
indicator_eq_one_or_zerolemma — a.indicator x ω is always 0 or 1.Proof (Lean source)
lemma indicator_eq_one_or_zero (a : POVar P α) (x : α) (ω : P.Ω) : a.indicator x ω = 1 ∨ a.indicator x ω = 0 := by unfold POVar.indicator by_cases hω : ω ∈ a.event x · exact inl (by simp [Set.indicator_of_mem hω]) · exact inr (by simp [Set.indicator_of_notMem hω]) -
indicator_add_indicator_notlemma — Binary case: a.indicator true ω + a.indicator false ω = 1.Proof (Lean source)
lemma indicator_add_indicator_not (a : POVar P Bool) (ω : P.Ω) : a.indicator true ω + a.indicator false ω = 1 := by unfold POVar.indicator by_cases hT : a.factual ω = true · have hT_t : ω ∈ a.event true := hT have hT_f : ω ∉ a.event false := by change a.factual ω ≠ false; rw [hT]; decide simp [Set.indicator_of_mem hT_t, Set.indicator_of_notMem hT_f] · have hF : a.factual ω = false := by cases h : a.factual ω <;> simp_all have hT_t : ω ∉ a.event true := hT have hT_f : ω ∈ a.event false := hF simp [Set.indicator_of_notMem hT_t, Set.indicator_of_mem hT_f] -
measurable_valuelemma — The value function of a regimed variable is measurable.Proof (Lean source)