Motivation
Introduce a deliberately small potential-outcomes foundation for shared use in results about randomized experiments, observational studies, instrumental variables, regression discontinuity, principal stratification, mediation, longitudinal treatment, and related designs.
Proposed declarations
Add one generic representation of potential responses:
abbrev PotentialResponse
(Intervention : Type*) (Unit : Type*) (Value : Type*) :=
Intervention → Unit → Value
Here Intervention is deliberately arbitrary. It may be a treatment value, complete allocation vector, instrument–treatment pair, treatment history, or policy. Unit may represent a finite-population unit or a superpopulation state.
Add two pointwise operations:
namespace PotentialResponse
variable {Intervention : Type*} {Unit : Type*} {Value : Type*}
{Index : Type*} {Source : Type*}
def select
(response : PotentialResponse Intervention Unit Value)
(intervention : Unit → Intervention) :
Unit → Value :=
fun u ↦ response (intervention u) u
select evaluates each unit's response at a supplied intervention. It is only the theoretical map u ↦ response (intervention u) u; it neither introduces a recorded observed-outcome variable nor asserts consistency. If intervention is the realized treatment assignment, identifying this map with a recorded outcome requires a separate consistency assumption such as $Y^{\mathrm{obs}}(u)=response,(intervention,u),u$.
def comp
(response : PotentialResponse Intervention Unit Value)
(intervention :
PotentialResponse Index Unit Intervention) :
PotentialResponse Index Unit Value :=
fun index u ↦ response (intervention index u) u
comp performs same-unit substitution, not ordinary function composition. In response.comp intervention index u, the outer response and the substituted intervention response are evaluated using the same unit u. It will later support constructions such as Y(z, D(z)) in IV and Y(a, M(a′)) in mediation.
Add the corresponding application lemmas and the elementary identity and associativity laws for same-unit substitution:
@[simp] theorem select_apply
(response : PotentialResponse Intervention Unit Value)
(intervention : Unit → Intervention)
(u : Unit) :
response.select intervention u =
response (intervention u) u := rfl
@[simp] theorem comp_apply
(response : PotentialResponse Intervention Unit Value)
(intervention :
PotentialResponse Index Unit Intervention)
(index : Index)
(u : Unit) :
response.comp intervention index u =
response (intervention index u) u := rfl
@[simp] theorem comp_id
(response : PotentialResponse Intervention Unit Value) :
response.comp (fun intervention _ ↦ intervention) = response := rfl
@[simp] theorem id_comp
(response : PotentialResponse Intervention Unit Value) :
comp (fun value _ ↦ value) response = response := rfl
theorem comp_assoc
(response : PotentialResponse Intervention Unit Value)
(intervention : PotentialResponse Index Unit Intervention)
(source : PotentialResponse Source Unit Index) :
(response.comp intervention).comp source =
response.comp (intervention.comp source) := rfl
end PotentialResponse
Implementation
Create Statlib/Causal/PotentialResponse.lean containing these declarations and module documentation, and import it from Statlib.lean. The new module must pass the project build and linter.
Scope
No new structure or causal-assumption predicate is needed in this PR. In particular, it will not require measurable-space instances or add probability measures, measurability or integrability predicates, assignment mechanisms, covariates, recorded observed outcomes, consistency, no-interference, ignorability, positivity, exclusion, monotonicity, estimands, identification theorems, estimators, or inference.
Using a full allocation vector as Intervention permits interference; using an individual treatment value is a later specialization. Thus the core does not silently assume SUTVA.
Longitudinal treatments
For a fixed time horizon, the type of complete treatment paths can be used as Intervention. A later dynamic-regime layer may define time-indexed histories and policies mapping available past histories to actions, then recursively construct counterfactual paths under a policy. Adaptivity, nonanticipation, and related conditions belong in that later layer rather than in PotentialResponse.
Relationship to structural and graphical models
This issue defines only the potential-response layer; it does not propose a single foundation subsuming potential outcomes, structural equation models, and causal DAGs. The potential-response core should not depend on a structural or graphical API, and structural or graphical development is not a prerequisite for this PR. Each base API should remain usable without importing an optional bridge.
A node's one-step-ahead counterfactual can later be represented as a potential response indexed by assignments to its parents, with Unit carrying the unit or exogenous state. comp provides the same-unit recursive substitution needed to construct downstream and nested counterfactuals.
Depending on the intended theorem, a future bridge may require independently defined graph and parent structure, structural assignments or stochastic kernels, intervention semantics, exogenous-state or probability structure, and explicit assumptions such as autonomy, Markov conditions, independent errors, or cross-world restrictions. If concrete applications later motivate such translations, separate bridge modules may state the corresponding constructions or theorems. Such bridges are neither part of this PR nor a prerequisite or required stage of the potential-outcomes roadmap.
Textbooks and papers consulted
- Peng Ding, A First Course in Causal Inference
- Guido Imbens and Donald Rubin, Causal Inference for Statistics, Social, and Biomedical Sciences
- Linbo Wang, Thomas Richardson, and James Robins, Causal Inference: A Tale of Three Frameworks, arXiv:2511.21516
Direction for the second PR
Add generic definitions for comparing responses under two interventions and averaging that comparison over a finite target population. The second PR should define unit-level contrasts and finite-population average treatment effects. It should not yet introduce assumptions connecting potential responses to recorded data, identification theorems, estimators, or statistical inference.
Probability-distributed superpopulation estimands should follow in a separate measurable and probabilistic layer. That layer should take measurable structures and probability measures explicitly and keep measurability and integrability conditions separate from PotentialResponse. Its design must distinguish sectionwise from joint measurability. Joint measurability of the response together with measurability of the intervention map gives a natural sufficient condition for select to be measurable; the exact predicate API is deferred.
General roadmap
- Potential-response representation, selection, and same-unit-substitution laws (this PR).
- Contrasts and finite-population estimands.
- Measurability, integrability, and probability-distributed superpopulation estimands.
- Allocations, assignment mechanisms, recorded outcomes, and consistency.
- Causal assumptions and identification theorems.
- Estimators and statistical inference.
Dynamic treatment regimes are a later domain layer. Structural and graphical base APIs may proceed independently; optional bridge modules may be added in response to concrete applications.
Motivation
Introduce a deliberately small potential-outcomes foundation for shared use in results about randomized experiments, observational studies, instrumental variables, regression discontinuity, principal stratification, mediation, longitudinal treatment, and related designs.
Proposed declarations
Add one generic representation of potential responses:
abbrev PotentialResponse (Intervention : Type*) (Unit : Type*) (Value : Type*) := Intervention → Unit → ValueHere
Interventionis deliberately arbitrary. It may be a treatment value, complete allocation vector, instrument–treatment pair, treatment history, or policy.Unitmay represent a finite-population unit or a superpopulation state.Add two pointwise operations:
selectevaluates each unit's response at a supplied intervention. It is only the theoretical mapu ↦ response (intervention u) u; it neither introduces a recorded observed-outcome variable nor asserts consistency. Ifinterventionis the realized treatment assignment, identifying this map with a recorded outcome requires a separate consistency assumption such ascompperforms same-unit substitution, not ordinary function composition. Inresponse.comp intervention index u, the outer response and the substituted intervention response are evaluated using the same unitu. It will later support constructions such asY(z, D(z))in IV andY(a, M(a′))in mediation.Add the corresponding application lemmas and the elementary identity and associativity laws for same-unit substitution:
Implementation
Create
Statlib/Causal/PotentialResponse.leancontaining these declarations and module documentation, and import it fromStatlib.lean. The new module must pass the project build and linter.Scope
No new structure or causal-assumption predicate is needed in this PR. In particular, it will not require measurable-space instances or add probability measures, measurability or integrability predicates, assignment mechanisms, covariates, recorded observed outcomes, consistency, no-interference, ignorability, positivity, exclusion, monotonicity, estimands, identification theorems, estimators, or inference.
Using a full allocation vector as
Interventionpermits interference; using an individual treatment value is a later specialization. Thus the core does not silently assume SUTVA.Longitudinal treatments
For a fixed time horizon, the type of complete treatment paths can be used as
Intervention. A later dynamic-regime layer may define time-indexed histories and policies mapping available past histories to actions, then recursively construct counterfactual paths under a policy. Adaptivity, nonanticipation, and related conditions belong in that later layer rather than inPotentialResponse.Relationship to structural and graphical models
This issue defines only the potential-response layer; it does not propose a single foundation subsuming potential outcomes, structural equation models, and causal DAGs. The potential-response core should not depend on a structural or graphical API, and structural or graphical development is not a prerequisite for this PR. Each base API should remain usable without importing an optional bridge.
A node's one-step-ahead counterfactual can later be represented as a potential response indexed by assignments to its parents, with
Unitcarrying the unit or exogenous state.compprovides the same-unit recursive substitution needed to construct downstream and nested counterfactuals.Depending on the intended theorem, a future bridge may require independently defined graph and parent structure, structural assignments or stochastic kernels, intervention semantics, exogenous-state or probability structure, and explicit assumptions such as autonomy, Markov conditions, independent errors, or cross-world restrictions. If concrete applications later motivate such translations, separate bridge modules may state the corresponding constructions or theorems. Such bridges are neither part of this PR nor a prerequisite or required stage of the potential-outcomes roadmap.
Textbooks and papers consulted
Direction for the second PR
Add generic definitions for comparing responses under two interventions and averaging that comparison over a finite target population. The second PR should define unit-level contrasts and finite-population average treatment effects. It should not yet introduce assumptions connecting potential responses to recorded data, identification theorems, estimators, or statistical inference.
Probability-distributed superpopulation estimands should follow in a separate measurable and probabilistic layer. That layer should take measurable structures and probability measures explicitly and keep measurability and integrability conditions separate from
PotentialResponse. Its design must distinguish sectionwise from joint measurability. Joint measurability of the response together with measurability of the intervention map gives a natural sufficient condition forselectto be measurable; the exact predicate API is deferred.General roadmap
Dynamic treatment regimes are a later domain layer. Structural and graphical base APIs may proceed independently; optional bridge modules may be added in response to concrete applications.