Motivation
Add the next small potential-outcomes layer after #40 and #41: a unit-level contrast and its average over a finite population. This gives us a useful estimand without adding assignment mechanisms, observed outcomes, probability, identification, estimation, or inference.
Implementation: #44
Proposed Lean API
Create Statlib/Causal/PotentialResponse/Contrast.lean with the following API:
open scoped BigOperators
namespace PotentialResponse
variable {Intervention Unit Value : Type*}
/-- The unit-level contrast between two interventions, first minus second.
The definition needs only `Sub Value`; laws involving zero and negation use `AddGroup Value`.
-/
def contrast [Sub Value]
(response : PotentialResponse Intervention Unit Value)
(intervention₁ intervention₀ : Intervention) :
Unit → Value :=
fun unit ↦ response intervention₁ unit - response intervention₀ unit
@[simp] theorem contrast_apply [Sub Value]
(response : PotentialResponse Intervention Unit Value)
(intervention₁ intervention₀ : Intervention)
(unit : Unit) :
response.contrast intervention₁ intervention₀ unit =
response intervention₁ unit - response intervention₀ unit := rfl
/-- A unit's contrast with itself is zero. -/
theorem contrast_self [AddGroup Value]
(response : PotentialResponse Intervention Unit Value)
(intervention : Intervention) (unit : Unit) :
response.contrast intervention intervention unit = 0 := by
simp
/-- Swapping the interventions negates the unit-level contrast. -/
theorem contrast_swap [AddGroup Value]
(response : PotentialResponse Intervention Unit Value)
(intervention₁ intervention₀ : Intervention) (unit : Unit) :
response.contrast intervention₁ intervention₀ unit =
-response.contrast intervention₀ intervention₁ unit := by
simp only [contrast_apply, neg_sub]
/-- The average unit-level contrast over a finite population.
The elements of `Unit` are the entire finite target population. The notation `𝔼` denotes the
uniform `Finset.expect` over `Finset.univ`, giving every unit equal weight. It introduces no
probability distribution, random sampling, or superpopulation expectation.
For empty `Unit`, this is zero by an algebraic convention of `Finset.expect`, not a substantive
claim about the causal effect in an empty population.
When the interventions encode two unit-level treatments, this is the conventional
finite-population average treatment effect. If they encode complete allocation vectors, it is
instead an average contrast between two allocation regimes; this definition does not assume
noninterference.
-/
def finitePopulationAverageContrast
[Fintype Unit]
[AddCommGroup Value] [Module ℚ≥0 Value]
(response : PotentialResponse Intervention Unit Value)
(intervention₁ intervention₀ : Intervention) :
Value :=
𝔼 unit, response.contrast intervention₁ intervention₀ unit
theorem finitePopulationAverageContrast_eq_sub
[Fintype Unit]
[AddCommGroup Value] [Module ℚ≥0 Value]
(response : PotentialResponse Intervention Unit Value)
(intervention₁ intervention₀ : Intervention) :
response.finitePopulationAverageContrast intervention₁ intervention₀ =
(𝔼 unit, response intervention₁ unit) -
(𝔼 unit, response intervention₀ unit) := by
simp [finitePopulationAverageContrast, Finset.expect_sub_distrib]
end PotentialResponse
The file imports Statlib.Causal.PotentialResponse and Mathlib.Algebra.BigOperators.Expect; Statlib.lean imports the new module.
Mathematical role
- Primitive objects: none; this builds on
PotentialResponse.
- Derived definitions:
contrast and finitePopulationAverageContrast.
- Assumptions: no causal assumptions.
contrast needs only Sub Value; the signed laws use AddGroup Value. The finite average uses Fintype Unit, AddCommGroup Value, and Module ℚ≥0 Value, but no probability measure. Its value for empty Unit is zero by algebraic convention, not a substantive causal claim.
- Estimands: the unit-level contrast and its finite-population average. The latter is the conventional ATE when interventions encode two unit-level treatments; with complete allocation vectors it instead compares regimes and does not assume noninterference.
- Identification theorems: none.
- Estimators and statistical inference: none.
More general or weighted contrasts, averages over an explicit Finset Unit, and superpopulation effects are future extensions for applications that need them, not requirements of #44. Assignment mechanisms, recorded outcomes, consistency, identification, estimators, and inference also remain out of scope.
Textbooks consulted
- Peng Ding, A First Course in Causal Inference
- Guido W. Imbens and Donald B. Rubin, Causal Inference for Statistics, Social, and Biomedical Sciences: An Introduction
Motivation
Add the next small potential-outcomes layer after #40 and #41: a unit-level contrast and its average over a finite population. This gives us a useful estimand without adding assignment mechanisms, observed outcomes, probability, identification, estimation, or inference.
Implementation: #44
Proposed Lean API
Create
Statlib/Causal/PotentialResponse/Contrast.leanwith the following API:The file imports
Statlib.Causal.PotentialResponseandMathlib.Algebra.BigOperators.Expect;Statlib.leanimports the new module.Mathematical role
PotentialResponse.contrastandfinitePopulationAverageContrast.contrastneeds onlySub Value; the signed laws useAddGroup Value. The finite average usesFintype Unit,AddCommGroup Value, andModule ℚ≥0 Value, but no probability measure. Its value for emptyUnitis zero by algebraic convention, not a substantive causal claim.More general or weighted contrasts, averages over an explicit
Finset Unit, and superpopulation effects are future extensions for applications that need them, not requirements of #44. Assignment mechanisms, recorded outcomes, consistency, identification, estimators, and inference also remain out of scope.Textbooks consulted