Panel.Estimand­Characterization.Imputation­Event­Study

Borusyak-Jaravel-Spiess: the imputation estimator and the efficiency/characterization results for staggered adoption.

Imputation 16 core · 4 supporting This file gives a finite-cell population formulation of the Borusyak-Jaravel-Spiess imputation functional. ★ bjs_imputation_identification

Borusyak-Jaravel-Spiess Imputation

This file gives a finite-cell population formulation of the Borusyak-Jaravel-Spiess imputation functional. The core structure BJSPanel stores treated and untreated cell rows, target weights, observed and untreated cell means, the untreated-outcome nuisance vector, and treated-cell effects. It defines the target theta, prediction-span witnesses ImputationWeights, the observed imputation functional psiImp, and the identification theorem bjs_imputation_identification. It also defines the finite linear-estimator API and the witness lemma linear_unbiased_of_imputation_representation; the substrate-based construction of those witnesses lives in PanelBridge.lean.

def dot reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For a finite regressor index set, a regressor row, and a nuisance coefficient vector, the finite dot product is the sum, over regressors, of their coordinatewise products.

Definition (Lean source)
Regressor :
Type u_3
shared
x beta :
Regressor → ℝ
dot x beta :
∑ r : Regressor, x r * beta r
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.dot · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:42
structure BJSPanel reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

A finite treated/untreated cell design for the BJS imputation decomposition, storing treated cells' regressor rows and untreated cells' regressor rows, an arbitrary — possibly signed and non-normalized — target weight on treated cells, the observed-law means on treated and untreated cells, the untreated-potential-outcome means on treated and untreated cells, a nuisance vector for the untreated-outcome model, and treated-cell causal effects.

Definition (Lean source)
Treated Untreated Regressor :
Type*
Fintype Treated
Fintype Untreated
Fintype Regressor
Regressor row for a treated cell.
qT :
Treated → Regressor → ℝ
Regressor row for an untreated cell.
qU :
Untreated → Regressor → ℝ
Arbitrary target weight on treated cells.
a :
Treated → ℝ
Observed-law mean for treated cells.
EY_T :
Treated → ℝ
Observed-law mean for untreated cells.
EY_U :
Untreated → ℝ
Untreated potential-outcome mean for treated cells.
EY0_T :
Treated → ℝ
Untreated potential-outcome mean for untreated cells.
EY0_U :
Untreated → ℝ
Nuisance vector in the untreated outcome model.
beta0 :
Regressor → ℝ
Treated-cell causal effects.
tau :
Treated → ℝ
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:48
def theta reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, the target estimand is the finite sum of each treated cell's causal effect multiplied by its supplied target weight; the weights need not be positive or sum to one.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
theta P :
∑ c : Treated, P.a c * P.tau c
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.theta · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:85 · uses BJSPanel
def targetForTau reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel and an arbitrary treated-cell effect vector, the corresponding target value is the finite sum of that vector weighted by the panel's target weights.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
tau' :
Treated → ℝ
targetForTau P tau' :
∑ c : Treated, P.a c * tau' c
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.targetForTau · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:94 · uses BJSPanel
def UntreatedOutcomeModel reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, the untreated-outcome model condition requires that every treated cell's untreated potential-outcome mean equals its regressor-row dot product with the nuisance vector, every untreated cell's untreated potential-outcome mean equals its regressor-row dot product with that vector, and every untreated cell's observed mean equals its untreated potential-outcome mean.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
UntreatedOutcomeModel P :
Prop
clause 1
c :
Treated
P.EY0_T c = dot (P.qT c) P.beta0
clause 2
u :
Untreated
P.EY0_U u = dot (P.qU u) P.beta0
clause 3
u :
Untreated
P.EY_U u = P.EY0_U u
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.UntreatedOutcomeModel · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:100 · uses BJSPanel
def TreatmentEffectFixed reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, the fixed-treatment-effect condition requires that in every treated cell the observed mean equals the untreated potential-outcome mean plus that cell's stored treatment effect.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
c :
Treated
TreatmentEffectFixed P :
Prop
P.EY_T c = P.EY0_T c + P.tau c
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.TreatmentEffectFixed · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:106 · uses BJSPanel
structure ImputationWeights reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

Witness-form prediction span / imputation weights.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
Weight assigned to untreated cell `u` when imputing treated cell `c`.
weight :
Treated → Untreated → ℝ
Target-relevant treated rows are linear combinations of untreated rows.
row_identity :
∀ c : Treated
if
P.a c ≠ 0
then
∀ r : Regressor, ∑ u : Untreated, weight c u * P.qU u r = P.qT c r
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.ImputationWeights · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:112 · uses BJSPanel
def PredictionIdentified reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, the target-relevant prediction-identification condition holds exactly when at least one imputation-weight system represents every treated regressor row with nonzero target weight as a weighted combination of untreated regressor rows.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
PredictionIdentified P :
Prop
Nonempty P.ImputationWeights
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.PredictionIdentified · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:125 · uses BJSPanel
def psiImp reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel and an array of imputation weights from treated to untreated cells, the observed-law imputation functional is the target-weighted sum of each treated observed mean less its imputed untreated observed mean.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
h :
Treated → Untreated → ℝ
psiImp P h :
∑ c : Treated, P.a c * (P.EY_T c - ∑ u : Untreated, h c u * P.EY_U u)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.psiImp · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:131 · uses BJSPanel
theorem bjs_imputation_identification reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

Population BJS imputation identification. Suppose the untreated outcome mean follows a deterministic linear model in the regressors, and each untreated cell's observed mean equals that untreated model mean (untreated outcome model), there exist imputation weights whose row identity expresses every target-relevant treated cell's regressor row as a weighted combination of untreated-cell rows (target-relevant prediction span), and each treated cell's observed mean equals its untreated potential-outcome mean plus its treatment effect (treatment effect fixed). Then there is an imputation-weight witness for which the observed-law imputation functional psiImp equals the target weighted sum of treatment effects theta.

Formal statement
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
hUntreatedModel :
P.UntreatedOutcomeModel
hPredictionSpan :
P.PredictionIdentified
hTreatmentEffectFixed :
P.TreatmentEffectFixed
∃ h : P.ImputationWeights, P.psiImp h.weight = P.theta
Proof (Lean source)
theorem bjs_imputation_identification (hUntreatedModel : P.UntreatedOutcomeModel) (hPredictionSpan : P.PredictionIdentified) (hTreatmentEffectFixed : P.TreatmentEffectFixed) : ∃ h : P.ImputationWeights, P.psiImp h.weight = P.theta := by classical let H : P.ImputationWeights := choice hPredictionSpan refine ⟨H, ?_⟩ unfold psiImp theta refine Finset.sum_congr rfl ?_ intro c hc by_cases hA : P.a c = 0 · simp [hA] · have hEYU : ∀ u : Untreated, P.EY_U u = dot (P.qU u) P.beta0 := by intro u rw [hUntreatedModel.2.2 u, hUntreatedModel.2.1 u] have hImpute : (∑ u : Untreated, H.weight c u * P.EY_U u) = dot (P.qT c) P.beta0 := by unfold dot calc (∑ u : Untreated, H.weight c u * P.EY_U u) = ∑ u : Untreated, H.weight c u * ∑ r : Regressor, P.qU u r * P.beta0 r := by apply Finset.sum_congr rfl intro u hu rw [hEYU u] rfl _ = ∑ u : Untreated, ∑ r : Regressor, (H.weight c u * P.qU u r) * P.beta0 r := by apply Finset.sum_congr rfl intro u hu rw [Finset.mul_sum] apply Finset.sum_congr rfl intro r hr rw [mul_assoc] _ = ∑ r : Regressor, ∑ u : Untreated, (H.weight c u * P.qU u r) * P.beta0 r := by rw [Finset.sum_comm] _ = ∑ r : Regressor, (∑ u : Untreated, H.weight c u * P.qU u r) * P.beta0 r := by apply Finset.sum_congr rfl intro r hr rw [Finset.sum_mul] _ = ∑ r : Regressor, P.qT c r * P.beta0 r := by apply Finset.sum_congr rfl intro r hr rw [H.row_identity c hA r] have hYT : P.EY_T c = dot (P.qT c) P.beta0 + P.tau c := by rw [hTreatmentEffectFixed c, hUntreatedModel.1 c] rw [hYT, hImpute] simp [add_sub_cancel_left]
structure LinearEstimator reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

A linear functional of treated and untreated observed cell outcomes.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
Coefficients on treated observed means.
vT :
Treated → ℝ
Coefficients on untreated observed means.
vU :
Untreated → ℝ
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:213 · uses BJSPanel
def value reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, a linear estimator, an arbitrary array of treated cell outcomes, and an arbitrary array of untreated cell outcomes, the linear-estimator value is the sum of treated outcomes weighted by treated coefficients plus untreated outcomes weighted by untreated coefficients.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
YT :
Treated → ℝ
YU :
Untreated → ℝ
value L YT YU :
(∑ c : Treated, L.vT c * YT c) + ∑ u : Untreated, L.vU u * YU u
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.value · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:224 · uses BJSPanel , LinearEstimator
def observedValue reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel and a linear estimator, the observed-law linear-estimator value is its value at the panel's treated and untreated observed means.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
observedValue L :
L.value P.EY_T P.EY_U
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.observedValue · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:231 · uses BJSPanel , LinearEstimator
def modelValue reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel, a linear estimator, a nuisance coefficient vector, and an arbitrary treated-effect vector, the model-implied linear-estimator value is its value when treated outcomes equal the regressor prediction plus the effect and untreated outcomes equal the regressor prediction.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
beta :
Regressor → ℝ
tau' :
Treated → ℝ
modelValue L beta tau' :
L.value (fun c : Treated => dot (P.qT c) beta + tau' c) (fun u : Untreated => dot (P.qU u) beta)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.modelValue · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:236 · uses BJSPanel , LinearEstimator
def unbiasedForAllTau reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator

For finite treated-cell, untreated-cell, and regressor sets and a BJS panel and a linear estimator, the unbiasedness condition for all treated effects requires that, for every nuisance coefficient vector and every treated-effect vector, the estimator's model-implied value equals the corresponding target value.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
beta :
Regressor → ℝ
tau' :
Treated → ℝ
unbiasedForAllTau L :
Prop
L.modelValue beta tau' = P.targetForTau tau'
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.unbiasedForAllTau · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:246 · uses BJSPanel , LinearEstimator
structure HasImputationRepresentation reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator

Explicit imputation representation witness for the linear-unbiased representation helper.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
Valid target-relevant imputation weights.
weights :
P.ImputationWeights
Untreated coefficients equal the negative target-weighted imputation weights.
untreated_weight_representation :
∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * weights.weight c u
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.HasImputationRepresentation · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:273 · uses BJSPanel , LinearEstimator
4 supporting declarations (lemmas, instances)
  • vT_eq_a lemma — Unrestricted treatment-effect heterogeneity forces the treated-cell weights to equal the target weights (vT = a). Proved by an indicator-tau test. Hoisted here so the efficiency layer can reuse it without re-running the argument.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    BJSPanel Treated Untreated Regressor
    shared
    L :
    P.LinearEstimator
    h :
    L.unbiasedForAllTau
    c :
    Treated
    L.vT c = P.a c
    Proof (Lean source)
    lemma vT_eq_a (L : P.LinearEstimator) (h : L.unbiasedForAllTau) (c : Treated) : L.vT c = P.a c := by classical have hh := h (fun _ : Regressor => 0) (fun d : Treated => if d = c then (1 : ℝ) else 0) simpa [LinearEstimator.modelValue, LinearEstimator.value, targetForTau, dot] using hh
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.vT_eq_a · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:253
  • nuisance_coord lemma — Nuisance unbiasedness for every beta gives the BJS left-null-space coordinate constraint aᵀ Q_T + vUᵀ Q_U = 0 (row by row). Hoisted for the efficiency layer.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    BJSPanel Treated Untreated Regressor
    shared
    L :
    P.LinearEstimator
    h :
    L.unbiasedForAllTau
    r :
    Regressor
    (∑ c : Treated, P.a c * P.qT c r) + ∑ u : Untreated, L.vU u * P.qU u r = 0
    Proof (Lean source)
    lemma nuisance_coord (L : P.LinearEstimator) (h : L.unbiasedForAllTau) (r : Regressor) : (∑ c : Treated, P.a c * P.qT c r) + ∑ u : Untreated, L.vU u * P.qU u r = 0 := by classical have hh := h (fun r' : Regressor => if r' = r then (1 : ℝ) else 0) (fun _ : Treated => 0) simpa [LinearEstimator.modelValue, LinearEstimator.value, targetForTau, dot, L.vT_eq_a h] using hh
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.LinearEstimator.nuisance_coord · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:263
  • linear_unbiased_of_imputation_representation_of_vT_eq_a theorem — Witness-based BJS linear-estimator representation from its treated coefficients and an imputation witness, exposed as an estimator identity for arbitrary outcome arrays.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    L :
    P.LinearEstimator
    hVT :
    ∀ c : Treated, L.vT c = P.a c
    hImputationWitness :
    L.HasImputationRepresentation
    ∃ H : P.ImputationWeights,
    conclusion 1
    c :
    Treated
    L.vT c = P.a c
    conclusion 2
    u :
    Untreated
    L.vU u = - ∑ c : Treated, P.a c * H.weight c u
    conclusion 3
    YT :
    Treated → ℝ
    YU :
    Untreated → ℝ
    L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)
    conclusion 4
    L.observedValue = P.psiImp H.weight
    Proof (Lean source)
    theorem linear_unbiased_of_imputation_representation_of_vT_eq_a (L : P.LinearEstimator) (hVT : ∀ c : Treated, L.vT c = P.a c) (hImputationWitness : L.HasImputationRepresentation) : ∃ H : P.ImputationWeights, (∀ c : Treated, L.vT c = P.a c) ∧ (∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u) ∧ (∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)) ∧ L.observedValue = P.psiImp H.weight := by classical let H : P.ImputationWeights := hImputationWitness.weights have hVU : ∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u := by intro u exact hImputationWitness.untreated_weight_representation u have hValue : ∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u) := by intro YT YU unfold LinearEstimator.value rw [show (∑ c : Treated, L.vT c * YT c) = ∑ c : Treated, P.a c * YT c from by apply Finset.sum_congr rfl intro c hc rw [hVT c]] rw [show (∑ u : Untreated, L.vU u * YU u) = ∑ u : Untreated, (-(∑ c : Treated, P.a c * H.weight c u)) * YU u from by apply Finset.sum_congr rfl intro u hu rw [hVU u]] have hNeg : (∑ u : Untreated, (-(∑ c : Treated, P.a c * H.weight c u)) * YU u) = -∑ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) * YU u := by calc (∑ u : Untreated, (-(∑ c : Treated, P.a c * H.weight c u)) * YU u) = ∑ u : Untreated, -((∑ c : Treated, P.a c * H.weight c u) * YU u) := by apply Finset.sum_congr rfl intro u hu rw [neg_mul] _ = -∑ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) * YU u := by rw [Finset.sum_neg_distrib] have hReindex : (∑ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) * YU u) = ∑ c : Treated, ∑ u : Untreated, (P.a c * H.weight c u) * YU u := by calc (∑ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) * YU u) = ∑ u : Untreated, ∑ c : Treated, (P.a c * H.weight c u) * YU u := by apply Finset.sum_congr rfl intro u hu rw [Finset.sum_mul] _ = ∑ c : Treated, ∑ u : Untreated, (P.a c * H.weight c u) * YU u := by rw [Finset.sum_comm] calc (∑ c : Treated, P.a c * YT c) + ∑ u : Untreated, (-(∑ c : Treated, P.a c * H.weight c u)) * YU u = (∑ c : Treated, P.a c * YT c) - ∑ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) * YU u := by rw [hNeg, sub_eq_add_neg] _ = (∑ c : Treated, P.a c * YT c) - ∑ c : Treated, ∑ u : Untreated, (P.a c * H.weight c u) * YU u := by rw [hReindex] _ = ∑ c : Treated, (P.a c * YT c - ∑ u : Untreated, (P.a c * H.weight c u) * YU u) := by rw [Finset.sum_sub_distrib] _ = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u) := by apply Finset.sum_congr rfl intro c hc rw [mul_sub] congr rw [Finset.mul_sum] apply Finset.sum_congr rfl intro u hu rw [mul_assoc] refine ⟨H, hVT, hVU, hValue, ?_⟩ unfold LinearEstimator.observedValue psiImp exact hValue P.EY_T P.EY_U
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.linear_unbiased_of_imputation_representation_of_vT_eq_a · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:291
  • linear_unbiased_of_imputation_representation theorem — Universal unbiasedness supplies the treated-coefficient identity required by linear_unbiased_of_imputation_representation_of_vT_eq_a.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    L :
    P.LinearEstimator
    hUnbiasedForAllTau :
    L.unbiasedForAllTau
    hImputationWitness :
    L.HasImputationRepresentation
    ∃ H : P.ImputationWeights,
    conclusion 1
    c :
    Treated
    L.vT c = P.a c
    conclusion 2
    u :
    Untreated
    L.vU u = - ∑ c : Treated, P.a c * H.weight c u
    conclusion 3
    YT :
    Treated → ℝ
    YU :
    Untreated → ℝ
    L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)
    conclusion 4
    L.observedValue = P.psiImp H.weight
    Proof (Lean source)
    theorem linear_unbiased_of_imputation_representation (L : P.LinearEstimator) (hUnbiasedForAllTau : L.unbiasedForAllTau) (hImputationWitness : L.HasImputationRepresentation) : ∃ H : P.ImputationWeights, (∀ c : Treated, L.vT c = P.a c) ∧ (∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u) ∧ (∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)) ∧ L.observedValue = P.psiImp H.weight := by classical apply linear_unbiased_of_imputation_representation_of_vT_eq_a P L ?_ hImputationWitness intro c have h := hUnbiasedForAllTau (fun _ : Regressor => 0) (fun d : Treated => if d = c then (1 : ℝ) else 0) simpa [LinearEstimator.modelValue, LinearEstimator.value, targetForTau, dot] using h
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.linear_unbiased_of_imputation_representation · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Imputation.lean:397
Efficiency 5 core · 3 supporting This file connects the finite BJS imputation design to Gauss-Markov efficiency. ★ bjs_ols_imputation_min_variance_spherical

Borusyak-Jaravel-Spiess Efficiency

This file connects the finite BJS imputation design to Gauss-Markov efficiency. It builds the full event-study design matrix and proves that the OLS imputation weights attain no larger variance than any linear unbiased estimator under spherical cell-outcome errors.

def designFull reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For a BJS event-study panel with finite treated cells, untreated cells, and regressors, the full event-study design matrix has one row for each treated or untreated observed cell and one column for each treated-cell effect or regressor. A treated-cell row has its own effect indicator and its treated-cell regressor row, whereas an untreated-cell row has zero effect indicators and its untreated-cell regressor row.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
designFull P :
Matrix (Treated ⊕ Untreated) (Treated ⊕ Regressor) ℝ
of (elim (fun c => elim (fun d => if c = d then (1 : ℝ) else 0) (fun r => P.qT c r)) (fun u => elim (fun _ => (0 : ℝ)) (fun r => P.qU u r)))
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.designFull · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Efficiency.lean:37 · uses BJSPanel
def cFull reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For a BJS event-study panel with finite treated cells, untreated cells, and regressors, the target functional in full-design coordinates assigns the panel's target weight to each treated-cell-effect coordinate and zero to every regressor coordinate.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
cFull P :
Treated ⊕ Regressor → ℝ
elim P.a (fun _ => 0)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.cFull · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Efficiency.lean:46 · uses BJSPanel
def weightOf reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For a linear estimator of a BJS event-study panel with finite cell sets, the weight vector over all observed cells equals its treated-cell weights on treated cells and its untreated-cell weights on untreated cells.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
weightOf L :
Treated ⊕ Untreated → ℝ
elim L.vT L.vU
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.weightOf · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Efficiency.lean:52 · uses BJSPanel , LinearEstimator
theorem bjs_ols_imputation_min_variance_spherical reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

BJS efficiency: OLS imputation is BLUE under spherical errors. For a BJS event-study panel P and a family of cell outcomes Y on a probability space, suppose each cell outcome is square-integrable, the cell outcomes form a spherical family with common variance σ² — equal variances and zero cross-covariances, and the full event-study design matrix designFull P has full column rank. Then for any linear estimator L unbiased for every value of the treatment-effect vector, the variance of the OLS imputation estimator built from designFull P and the target functional cFull P is no larger than the variance of L.

Formal statement
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
BJSPanel Treated Untreated Regressor
shared
Ω :
Y :
Treated ⊕ Untreated → Ω → ℝ
hY :
∀ i, MemLp (Y i) 2 μ
σ :
hsph :
hRank :
L :
P.LinearEstimator
hL :
L.unbiasedForAllTau
Var[fun ω => ∑ i, olsWeight (designFull P) (cFull P) i * Y i ω; μ]
Var[fun ω => ∑ i, weightOf L i * Y i ω; μ]
Proof (Lean source)
theorem bjs_ols_imputation_min_variance_spherical {P : BJSPanel Treated Untreated Regressor} {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ] (Y : Treated ⊕ Untreated → Ω → ℝ) (hY : ∀ i, MemLp (Y i) 2 μ) {σ : ℝ} (hsph : SphericalFamily Y μ σ) (hRank : IsUnit ((designFull P)ᵀ * designFull P).det) (L : P.LinearEstimator) (hL : L.unbiasedForAllTau) : Var[fun ω => ∑ i, olsWeight (designFull P) (cFull P) i * Y i ω; μ] ≤ Var[fun ω => ∑ i, weightOf L i * Y i ω; μ] := by exact variance_blue_spherical Y hY hsph (olsWeight_mem_colSpan (designFull P) (cFull P)) (olsWeight_unbiased (cFull P) hRank) (weightOf_vecMul_designFull L hL)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.bjs_ols_imputation_min_variance_spherical · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Efficiency.lean:85 · uses SphericalFamily , olsWeight , BJSPanel , LinearEstimator , unbiasedForAllTau , cFull , designFull , weightOf
def treatedClassifier reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

The treated-cell classifier maps each treated observed cell to its own treated-cell label and maps every untreated observed cell to no label.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
treatedClassifier :
(Treated ⊕ Untreated) → Option Treated
elim (fun c => some c) (fun _ => none)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.treatedClassifier · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/Efficiency.lean:119
3 supporting declarations (lemmas, instances)
Panel­Bridge 4 core · 5 supporting This file connects the finite imputation event-study construction to the library's weighted-panel linear algebra. ★ bjs_linear_unbiased_iff_imputation_form

Imputation event-study linear-algebra bridge

This file connects the finite imputation event-study construction to the library's weighted-panel linear algebra. It equips untreated cells with uniform weights, forms the span of their regressor columns, identifies the usual left-null-space restriction with orthogonality to that span, and derives the corresponding linear-unbiasedness characterizations.

def untreatedSupport reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For a nonempty finite collection of untreated cells, the uniform untreated-cell weighted support assigns every untreated cell weight 1/U1/|U| and regards every such cell as observed.

Definition (Lean source)
Untreated :
Type*
Fintype Untreated
DecidableEq Untreated
Nonempty Untreated
untreatedSupport Untreated :
WeightedSupport Untreated
clause 1
clause 2
observed_nonempty := Finset.univ_nonempty
clause 3
weight := fun _ => (Fintype.card Untreated : ℝ)⁻¹
clause 4
weight_pos := by intro u _ positivity
clause 5
weight_zero_off := by intro u hu exact absurd (Finset.mem_univ u) hu
clause 6
weight_sum_one := by rw [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] exact mul_inv_cancel₀ (by exact_mod_cast Fintype.card_ne_zero)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.untreatedSupport · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:45 · uses WeightedSupport
def regressorColumn reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For a BJS event-study panel with finite treated cells, untreated cells, and regressors and a regressor, the corresponding untreated-cell regressor column assigns to each untreated cell its entry in that regressor's panel row.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
r :
Regressor
regressorColumn P r :
Untreated → ℝ
fun u => P.qU u r
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.regressorColumn · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:67 · uses BJSPanel
def columnSpan reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

For a BJS event-study panel with finite treated cells, untreated cells, and regressors, the untreated-cell regressor column span is the real linear span of all vectors of untreated-cell regressor values, one vector for each regressor.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
columnSpan P :
Submodule ℝ (Untreated → ℝ)
span ℝ (range P.regressorColumn)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.columnSpan · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:70 · uses BJSPanel
theorem bjs_linear_unbiased_iff_imputation_form reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel

Combined iff characterization of the BJS linear-unbiased imputation class. Given a target-relevant prediction-span witness and at least one treated cell with nonzero target weight, a linear estimator L is unbiased for every value of the treatment-effect vector if and only if it admits a BJS imputation-weight representation: its treated coefficients match the target weights, its untreated coefficients equal the negative weighted imputation sum, its value equals the imputation contrast for every pair of treated/untreated observed outcomes, and its observed value equals the population imputation functional psiImp.

Formal statement
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
P :
BJSPanel Treated Untreated Regressor
shared
L :
P.LinearEstimator
hPredictionSpan :
P.PredictionIdentified
hNonzeroTargetWeight :
∃ c : Treated, P.a c ≠ 0
L.unbiasedForAllTau
↔ ∃ H : P.ImputationWeights, (∀ c : Treated, L.vT c = P.a c) ∧ (∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u) ∧ (∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)) ∧ L.observedValue = P.psiImp H.weight
Proof (Lean source)
theorem bjs_linear_unbiased_iff_imputation_form (L : P.LinearEstimator) (hPredictionSpan : P.PredictionIdentified) (hNonzeroTargetWeight : ∃ c : Treated, P.a c ≠ 0) : L.unbiasedForAllTau ↔ ∃ H : P.ImputationWeights, (∀ c : Treated, L.vT c = P.a c) ∧ (∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u) ∧ (∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)) ∧ L.observedValue = P.psiImp H.weight := by constructor · -- (⟹) linear unbiasedness ⟹ imputation form intro hUnbiased exact linear_unbiased_of_prediction_identified P L hUnbiased hPredictionSpan hNonzeroTargetWeight · -- (⟸) imputation form ⟹ linear unbiasedness for every (beta, tau') intro ⟨H, hVT, hVU, hValue, _⟩ beta tau' simp only [LinearEstimator.modelValue] rw [hValue] unfold targetForTau apply Finset.sum_congr rfl intro c _ by_cases hA : P.a c = 0 · simp [hA] · have hRowId : ∀ r : Regressor, ∑ u : Untreated, H.weight c u * P.qU u r = P.qT c r := H.row_identity c hA have hImpute : (∑ u : Untreated, H.weight c u * dot (P.qU u) beta) = dot (P.qT c) beta := by unfold dot calc (∑ u : Untreated, H.weight c u * ∑ r : Regressor, P.qU u r * beta r) = ∑ u : Untreated, ∑ r : Regressor, (H.weight c u * P.qU u r) * beta r := by apply Finset.sum_congr rfl intro u _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro r _ rw [mul_assoc] _ = ∑ r : Regressor, ∑ u : Untreated, (H.weight c u * P.qU u r) * beta r := by rw [Finset.sum_comm] _ = ∑ r : Regressor, (∑ u : Untreated, H.weight c u * P.qU u r) * beta r := by apply Finset.sum_congr rfl intro r _ rw [Finset.sum_mul] _ = ∑ r : Regressor, P.qT c r * beta r := by apply Finset.sum_congr rfl intro r _ rw [hRowId r] rw [hImpute] ring
5 supporting declarations (lemmas, instances)
  • ip_untreatedSupport_regressorColumn lemma — The panel inner product of an untreated-cell vector v with a regressor column is the BJS left-null-space sum, rescaled by the uniform weight.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    v :
    Untreated → ℝ
    r :
    Regressor
    (untreatedSupport Untreated).ip v (P.regressorColumn r)
    = (Fintype.card Untreated : ℝ)⁻¹ * ∑ u : Untreated, v u * P.qU u r
    Proof (Lean source)
    lemma ip_untreatedSupport_regressorColumn (v : Untreated → ℝ) (r : Regressor) : (untreatedSupport Untreated).ip v (P.regressorColumn r) = (Fintype.card Untreated : ℝ)⁻¹ * ∑ u : Untreated, v u * P.qU u r := by rw [WeightedSupport.ip_def, Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro u _ simp only [untreatedSupport, regressorColumn] ring
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.ip_untreatedSupport_regressorColumn · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:78
  • ip_regressorColumn_eq_zero_iff lemma — ip-orthogonality to a single regressor column ⟺ that column's BJS left-null-space coordinate vanishes.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    v :
    Untreated → ℝ
    r :
    Regressor
    (untreatedSupport Untreated).ip v (P.regressorColumn r)
    = 0 ↔ ∑ u : Untreated, v u * P.qU u r = 0
    Proof (Lean source)
    lemma ip_regressorColumn_eq_zero_iff (v : Untreated → ℝ) (r : Regressor) : (untreatedSupport Untreated).ip v (P.regressorColumn r) = 0 ↔ ∑ u : Untreated, v u * P.qU u r = 0 := by rw [ip_untreatedSupport_regressorColumn] rw [mul_eq_zero] have hne : (Fintype.card Untreated : ℝ)⁻¹ ≠ 0 := by simp [Fintype.card_ne_zero] constructor · rintro (h | h) · exact absurd h hne · exact h · intro h; exact inr h
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.ip_regressorColumn_eq_zero_iff · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:89
  • columnSpan_ip_orthogonal_iff lemma — Keystone bridge. A vector over the untreated cells is ip-orthogonal to the whole regressor column span iff it satisfies the BJS left-null-space condition ∀ r, ∑_u v_u q_{ur} = 0. This is the panel-substrate restatement of "v lies in the left null space of Q_U".
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    v :
    Untreated → ℝ
    (∀ h ∈ P.columnSpan, (untreatedSupport Untreated).ip v h = 0)
    ↔ ∀ r : Regressor, ∑ u : Untreated, v u * P.qU u r = 0
    Proof (Lean source)
    lemma columnSpan_ip_orthogonal_iff (v : Untreated → ℝ) : (∀ h ∈ P.columnSpan, (untreatedSupport Untreated).ip v h = 0) ↔ ∀ r : Regressor, ∑ u : Untreated, v u * P.qU u r = 0 := by constructor · intro h r rw [← ip_regressorColumn_eq_zero_iff] exact h (P.regressorColumn r) (Submodule.subset_span ⟨r, rfl⟩) · intro h have hcol : ∀ r : Regressor, (untreatedSupport Untreated).ip v (P.regressorColumn r) = 0 := by intro r; rw [ip_regressorColumn_eq_zero_iff]; exact h r -- The set of `w` with `ip v w = 0` is a submodule containing every column, -- hence contains the whole span. intro w hw refine Submodule.span_induction ?_ ?_ ?_ ?_ hw · rintro x ⟨r, rfl⟩; exact hcol r · simp [WeightedSupport.ip] · intro x y _ _ hx hy rw [WeightedSupport.ip_add_right, hx, hy, add_zero] · intro s x _ hx rw [WeightedSupport.ip_smul_right, hx, mul_zero]
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.columnSpan_ip_orthogonal_iff · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:104
  • exists_imputationWeights_of_gap_orthogonal theorem — Left-null-space row adjustment (audit M3), phrased through the panel substrate. Given base imputation weights H0, a nonzero target weight at c0, and a target untreated-coefficient vector vU whose gap gap u = vU u + ∑_c a_c · H0.weight c u is ip-orthogonal to the regressor column span (equivalently: gap lies in the left null space of Q_U), one nonzero target row of H0 can absorb the gap without disturbing any target-relevant row identity. The resulting imputation weights H represent the untreated coefficients: ∑_c a_c · H.weight c u = - vU u for every u.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    vU :
    Untreated → ℝ
    c0 :
    Treated
    hc0 :
    P.a c0 ≠ 0
    H0 :
    P.ImputationWeights
    hgap :
    ∀ h ∈ P.columnSpan,
    (untreatedSupport Untreated).ip (fun u => vU u + ∑ c : Treated, P.a c * H0.weight c u) h
    = 0
    ∃ H : P.ImputationWeights, ∀ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) = - vU u
    Proof (Lean source)
    theorem exists_imputationWeights_of_gap_orthogonal (vU : Untreated → ℝ) {c0 : Treated} (hc0 : P.a c0 ≠ 0) (H0 : P.ImputationWeights) (hgap : ∀ h ∈ P.columnSpan, (untreatedSupport Untreated).ip (fun u => vU u + ∑ c : Treated, P.a c * H0.weight c u) h = 0) : ∃ H : P.ImputationWeights, ∀ u : Untreated, (∑ c : Treated, P.a c * H.weight c u) = - vU u := by classical let weightedUntreated : Untreated → ℝ := fun u => ∑ c : Treated, P.a c * H0.weight c u let correction : Untreated → ℝ := fun u => (P.a c0)⁻¹ * (-vU u - weightedUntreated u) -- The panel-substrate orthogonality hypothesis unpacks (via the keystone -- bridge) to the BJS left-null-space coordinate condition on the gap. have hWeightedCombined : ∀ r : Regressor, ∑ u : Untreated, (vU u + weightedUntreated u) * P.qU u r = 0 := (P.columnSpan_ip_orthogonal_iff _).mp hgap have hCorrectionNull : ∀ r : Regressor, ∑ u : Untreated, correction u * P.qU u r = 0 := by intro r have hNeg : ∑ u : Untreated, (-vU u - weightedUntreated u) * P.qU u r = 0 := by calc (∑ u : Untreated, (-vU u - weightedUntreated u) * P.qU u r) = -∑ u : Untreated, (vU u + weightedUntreated u) * P.qU u r := by rw [← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro u _ ring _ = 0 := by rw [hWeightedCombined r, neg_zero] calc (∑ u : Untreated, correction u * P.qU u r) = (P.a c0)⁻¹ * ∑ u : Untreated, (-vU u - weightedUntreated u) * P.qU u r := by simp only [correction] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro u _ rw [mul_assoc] _ = 0 := by rw [hNeg, mul_zero] let HWeight : Treated → Untreated → ℝ := fun c u => if c = c0 then H0.weight c u + correction u else H0.weight c u have hHWeightSum : ∀ u : Untreated, (∑ c : Treated, P.a c * HWeight c u) = -vU u := by intro u have hUpdate : (∑ c : Treated, P.a c * HWeight c u) = (∑ c : Treated, P.a c * H0.weight c u) + P.a c0 * correction u := by calc (∑ c : Treated, P.a c * HWeight c u) = ∑ c : Treated, (P.a c * H0.weight c u + if c = c0 then P.a c * correction u else 0) := by apply Finset.sum_congr rfl intro c _ by_cases hC : c = c0 · subst c; simp [HWeight]; ring · simp [HWeight, hC] _ = (∑ c : Treated, P.a c * H0.weight c u) + ∑ c : Treated, (if c = c0 then P.a c * correction u else 0) := by rw [Finset.sum_add_distrib] _ = (∑ c : Treated, P.a c * H0.weight c u) + P.a c0 * correction u := by simp calc (∑ c : Treated, P.a c * HWeight c u) = weightedUntreated u + P.a c0 * correction u := by rw [hUpdate] _ = weightedUntreated u + P.a c0 * ((P.a c0)⁻¹ * (-vU u - weightedUntreated u)) := rfl _ = -vU u := by rw [← mul_assoc, mul_inv_cancel₀ hc0, one_mul]; ring refine ⟨{ weight := HWeight, row_identity := ?_ }, hHWeightSum⟩ intro c hA r by_cases hC : c = c0 · subst c calc (∑ u : Untreated, HWeight c0 u * P.qU u r) = ∑ u : Untreated, (H0.weight c0 u + correction u) * P.qU u r := by simp [HWeight] _ = (∑ u : Untreated, H0.weight c0 u * P.qU u r) + ∑ u : Untreated, correction u * P.qU u r := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro u _; rw [add_mul] _ = P.qT c0 r := by rw [H0.row_identity c0 hc0 r, hCorrectionNull r, add_zero] · simpa [HWeight, hC] using H0.row_identity c hA r
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.exists_imputationWeights_of_gap_orthogonal · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:130
  • linear_unbiased_of_prediction_identified theorem — BJS linear-unbiased representation from the primitive prediction-span condition.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    P :
    BJSPanel Treated Untreated Regressor
    shared
    L :
    P.LinearEstimator
    hUnbiasedForAllTau :
    L.unbiasedForAllTau
    hPredictionSpan :
    P.PredictionIdentified
    hNonzeroTargetWeight :
    ∃ c : Treated, P.a c ≠ 0
    ∃ H : P.ImputationWeights,
    conclusion 1
    c :
    Treated
    L.vT c = P.a c
    conclusion 2
    u :
    Untreated
    L.vU u = - ∑ c : Treated, P.a c * H.weight c u
    conclusion 3
    YT :
    Treated → ℝ
    YU :
    Untreated → ℝ
    L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)
    conclusion 4
    L.observedValue = P.psiImp H.weight
    Proof (Lean source)
    theorem linear_unbiased_of_prediction_identified (L : P.LinearEstimator) (hUnbiasedForAllTau : L.unbiasedForAllTau) (hPredictionSpan : P.PredictionIdentified) (hNonzeroTargetWeight : ∃ c : Treated, P.a c ≠ 0) : ∃ H : P.ImputationWeights, (∀ c : Treated, L.vT c = P.a c) ∧ (∀ u : Untreated, L.vU u = - ∑ c : Treated, P.a c * H.weight c u) ∧ (∀ (YT : Treated → ℝ) (YU : Untreated → ℝ), L.value YT YU = ∑ c : Treated, P.a c * (YT c - ∑ u : Untreated, H.weight c u * YU u)) ∧ L.observedValue = P.psiImp H.weight := by classical haveI : DecidableEq Untreated := Classical.decEq Untreated let H0 : P.ImputationWeights := choice hPredictionSpan rcases hNonzeroTargetWeight with ⟨c0, hc0⟩ have hVT : ∀ c : Treated, L.vT c = P.a c := by intro c have h := hUnbiasedForAllTau (fun _ : Regressor => 0) (fun d : Treated => if d = c then (1 : ℝ) else 0) simpa [LinearEstimator.modelValue, LinearEstimator.value, targetForTau, dot] using h let weightedUntreated : Untreated → ℝ := fun u => ∑ c : Treated, P.a c * H0.weight c u have hNuisanceCoord : ∀ r : Regressor, (∑ c : Treated, P.a c * P.qT c r) + ∑ u : Untreated, L.vU u * P.qU u r = 0 := by intro r let beta : Regressor → ℝ := fun r' => if r' = r then (1 : ℝ) else 0 have h := hUnbiasedForAllTau beta (fun _ : Treated => 0) simpa [LinearEstimator.modelValue, LinearEstimator.value, targetForTau, dot, beta, hVT] using h have hH0Aggregate : ∀ r : Regressor, (∑ c : Treated, P.a c * P.qT c r) = ∑ u : Untreated, weightedUntreated u * P.qU u r := by intro r calc (∑ c : Treated, P.a c * P.qT c r) = ∑ c : Treated, P.a c * ∑ u : Untreated, H0.weight c u * P.qU u r := by apply Finset.sum_congr rfl intro c hc by_cases hA : P.a c = 0 · simp [hA] · rw [H0.row_identity c hA r] _ = ∑ c : Treated, ∑ u : Untreated, P.a c * (H0.weight c u * P.qU u r) := by apply Finset.sum_congr rfl intro c hc rw [Finset.mul_sum] _ = ∑ u : Untreated, ∑ c : Treated, P.a c * (H0.weight c u * P.qU u r) := by rw [Finset.sum_comm] _ = ∑ u : Untreated, weightedUntreated u * P.qU u r := by apply Finset.sum_congr rfl intro u hu unfold weightedUntreated rw [Finset.sum_mul] apply Finset.sum_congr rfl intro c hc rw [mul_assoc] have hWeightedCombined : ∀ r : Regressor, ∑ u : Untreated, (L.vU u + weightedUntreated u) * P.qU u r = 0 := by intro r have hN := hNuisanceCoord r rw [hH0Aggregate r] at hN calc (∑ u : Untreated, (L.vU u + weightedUntreated u) * P.qU u r) = (∑ u : Untreated, L.vU u * P.qU u r) + ∑ u : Untreated, weightedUntreated u * P.qU u r := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro u hu rw [add_mul] _ = (∑ u : Untreated, weightedUntreated u * P.qU u r) + ∑ u : Untreated, L.vU u * P.qU u r := by rw [add_comm] _ = 0 := hN -- With no untreated cells the imputation representation is vacuous on the -- untreated coordinates; otherwise route the gap through the panel substrate. rcases isEmpty_or_nonempty Untreated with hEmpty | hNE · have hWitness : L.HasImputationRepresentation := { weights := H0 untreated_weight_representation := by intro u; exact (hEmpty.false u).elim } exact linear_unbiased_of_imputation_representation P L hUnbiasedForAllTau hWitness · have hgap : ∀ h ∈ P.columnSpan, (untreatedSupport Untreated).ip (fun u => L.vU u + ∑ c : Treated, P.a c * H0.weight c u) h = 0 := by rw [P.columnSpan_ip_orthogonal_iff] intro r exact hWeightedCombined r obtain ⟨H, hHsum⟩ := P.exists_imputationWeights_of_gap_orthogonal L.vU hc0 H0 hgap have hWitness : L.HasImputationRepresentation := { weights := H untreated_weight_representation := by intro u; rw [hHsum u]; ring } exact linear_unbiased_of_imputation_representation P L hUnbiasedForAllTau hWitness
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPanel.linear_unbiased_of_prediction_identified · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelBridge.lean:247
Panel­Grounding 5 core · 8 supporting Builds a BJSPanel from an adoption path and two-way fixed effects, and proves the untreated-outcome model and fixed-effect hypotheses hold for it. ★ ofStaggeredTWFE_untreatedModel

BJS staggered-adoption grounding

Builds a BJSPanel from an adoption path and two-way fixed effects, and proves the untreated-outcome model and fixed-effect hypotheses hold for it. Treated cells are the cells whose treatment has switched on, untreated cells include never-treated cells and pre-adoption cells, and the canonical two-way fixed-effect design discharges the BJS hypotheses in a concrete panel. The main definitions are TreatedCell, UntreatedCell, feRow, and ofStaggeredTWFE; the main theorem bridges are ofStaggeredTWFE_untreatedModel and ofStaggeredTWFE_treatmentFixed.

def TreatedCell reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For an adoption-time path for the units over a finite number of periods, the treated cells are precisely the unit-period pairs for which the unit's adoption time is no later than the period.

Definition (Lean source)
I :
Type u_1
shared
T :
shared
g :
I → WithTop (Fin T)
shared
TreatedCell g :
Type _
{ c : I × Fin T // AdoptionPath.le (g c.1) c.2 }
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.TreatedCell · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelGrounding.lean:48
def UntreatedCell reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For an adoption-time path for the units over a finite number of periods, the untreated cells are precisely the unit-period pairs whose period is strictly before the unit's adoption time. They include every period of a never-treated unit and every pre-adoption period of a treated unit.

Definition (Lean source)
I :
Type u_1
shared
T :
shared
g :
I → WithTop (Fin T)
shared
UntreatedCell g :
Type _
{ c : I × Fin T // AdoptionPath.lt (g c.1) c.2 }
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.UntreatedCell · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelGrounding.lean:52
def feRow reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For a unit-period cell with a finite number of periods and equality-comparable unit labels, the two-way fixed-effect design row assigns one to that cell's unit coordinate and period coordinate, and zero to all other unit and period coordinates.

Definition (Lean source)
I :
Type u_1
shared
T :
shared
c :
I × Fin T
feRow c :
(I ⊕ Fin T) → ℝ
elim (fun i' => if i' = c.1 then (1 : ℝ) else 0) (fun t' => if t' = c.2 then (1 : ℝ) else 0)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.feRow · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PanelGrounding.lean:86
def ofStaggeredTWFE reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

For an adoption-time path for finitely many equality-comparable units over a finite number of periods, unit effects, period effects, target weights, and treated-cell effects, the staggered-adoption two-way-fixed-effects BJS panel has treated and untreated cells given by that path and regressors given by the unit and period indicators. Its untreated potential-outcome mean is the sum of the relevant unit and period effects, and its treated observed mean adds the treated-cell effect.

Definition (Lean source)
I :
Type u_1
shared
T :
shared
g :
I → WithTop (Fin T)
shared
α :
I → ℝ
lam :
Fin T → ℝ
a tau :
TreatedCell g → ℝ
ofStaggeredTWFE g α lam a tau :
clause 1
qT := fun c => feRow c.val
clause 2
qU := fun u => feRow u.val
clause 3
a := a
clause 4
EY_T := fun c => (α c.val.1 + lam c.val.2) + tau c
clause 5
EY_U := fun u => α u.val.1 + lam u.val.2
clause 6
EY0_T := fun c => α c.val.1 + lam c.val.2
clause 7
EY0_U := fun u => α u.val.1 + lam u.val.2
clause 8
beta0 := elim α lam
clause 9
tau := tau
theorem ofStaggeredTWFE_untreatedModel reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

Untreated-outcome model holds by construction. For unit fixed effects α, period fixed effects lam, and target weights and treated-cell effects a, tau, the staggered-adoption grounded panel ofStaggeredTWFE g α lam a tau satisfies the BJS untreated-outcome model: treated and untreated cell means both equal the two-way fixed-effect model α_i + λ_t, and untreated cells exhibit no anticipation.

Formal statement
I :
Type u_1
shared
T :
shared
g :
I → WithTop (Fin T)
shared
α :
I → ℝ
lam :
Fin T → ℝ
a tau :
TreatedCell g → ℝ
Proof (Lean source)
theorem ofStaggeredTWFE_untreatedModel (α : I → ℝ) (lam : Fin T → ℝ) (a tau : TreatedCell g → ℝ) : (ofStaggeredTWFE g α lam a tau).UntreatedOutcomeModel := by refine ⟨fun c => ?_, fun u => ?_, fun _ => rfl⟩ · change α c.val.1 + lam c.val.2 = dot (feRow c.val) (elim α lam) rw [dot_feRow] · change α u.val.1 + lam u.val.2 = dot (feRow u.val) (elim α lam) rw [dot_feRow]
8 supporting declarations (lemmas, instances)
Population­Bridge 4 core · 5 supporting This file constructs a finite BJSPanel from a probability space with treated and untreated potential outcomes, defining its mean fields as treated/untreated cell conditional means and deriving the untreated-consistency a ★ bjs_imputation_identification_population

Borusyak-Jaravel-Spiess imputation population bridge

This file constructs a finite BJSPanel from a probability space with treated and untreated potential outcomes, defining its mean fields as treated/untreated cell conditional means and deriving the untreated-consistency and fixed-effect restrictions from cell-level potential-outcome consistency.

structure BJSPopulation reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy

A population for the BJS imputation design: a probability space with a treated/untreated cell classifier and potential outcomes Y0 (untreated), Y1 (treated), and observed Yobs, related by cell-level consistency. The design rows qT, qU, target weights a, and nuisance vector beta0 are carried through to the induced panel unchanged.

Definition (Lean source)
Treated Untreated Regressor :
Type*
Fintype Treated
Fintype Untreated
Fintype Regressor
Unit sample space.
Ω :
Type*
Measurable-space structure on `Ω`.
measΩ :
Population measure.
μ :
`μ` is a probability measure.
probμ :
Treated/untreated cell classifier.
cellOf :
Ω → Treated ⊕ Untreated
Each cell is measurable.
cell_meas :
∀ i, MeasurableSet (cellOf ⁻¹' {i})
Each cell has positive mass.
cell_pos :
∀ i, 0 < (μ (cellOf ⁻¹' {i})).toReal
Untreated potential outcome.
Y0 :
Ω → ℝ
Treated potential outcome.
Y1 :
Ω → ℝ
Observed outcome.
Yobs :
Ω → ℝ
Consistency on treated cells: the observed outcome is the treated potential outcome.
hTreatedCons :
∀ (c : Treated) (ω : Ω)
if
cellOf ω = inl c
then
Yobs ω = Y1 ω
Consistency on untreated cells: the observed outcome is the untreated potential outcome.
hUntreatedCons :
∀ (u : Untreated) (ω : Ω)
if
cellOf ω = inr u
then
Yobs ω = Y0 ω
Regressor row for a treated cell.
qT :
Treated → Regressor → ℝ
Regressor row for an untreated cell.
qU :
Untreated → Regressor → ℝ
Target weight on treated cells.
a :
Treated → ℝ
Nuisance vector in the untreated outcome model.
beta0 :
Regressor → ℝ
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:48
def cells reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation

For a BJS population with finite treated-cell, untreated-cell, and regressor collections, the treated-and-untreated cell partition partitions its sample space according to the population's treated/untreated cell classifier, using the population probability measure.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
E :
BJSPopulation Treated Untreated Regressor
shared
cells E :
CellPartition E.μ (Treated ⊕ Untreated)
cellPartitionOfClassifier E.μ E.cellOf E.cell_meas E.cell_pos
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.cells · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:98 · uses BJSPopulation , CellPartition
def toPanel reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation

For a BJS population with finite treated-cell, untreated-cell, and regressor collections, the induced BJS panel retains its regressor rows, target weights, and nuisance vector, and defines each outcome mean as the corresponding treated- or untreated-cell conditional mean. For every treated cell, its treatment effect is the conditional mean of the treated potential outcome minus that of the untreated potential outcome.

Definition (Lean source)
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
E :
BJSPopulation Treated Untreated Regressor
shared
toPanel E :
BJSPanel Treated Untreated Regressor
clause 1
qT := E.qT
clause 2
qU := E.qU
clause 3
a := E.a
clause 4
beta0 := E.beta0
clause 5
EY_T c := E.cells.mean E.Yobs (inl c)
clause 6
EY_U u := E.cells.mean E.Yobs (inr u)
clause 7
EY0_T c := E.cells.mean E.Y0 (inl c)
clause 8
EY0_U u := E.cells.mean E.Y0 (inr u)
clause 9
tau c := E.cells.mean E.Y1 (inl c) - E.cells.mean E.Y0 (inl c)
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:102 · uses BJSPanel , BJSPopulation
theorem bjs_imputation_identification_population reviewed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation

Population BJS imputation identification (headline). For a population BJS design E, suppose the conditional mean of the untreated potential outcome on each treated cell equals a linear function q_T · β₀ of the treated-cell regressors and likewise, on each untreated cell, the conditional mean of the untreated potential outcome equals q_U · β₀ — jointly the additive untreated-outcome (parallel-trends) model — together with a target-relevant prediction-span witness for the induced panel. Then the observed-law imputation functional identifies the target ∑ a_c · (E[Y(1) ∣ cell c] − E[Y(0) ∣ cell c]): there is an imputation-weight witness for which the population imputation functional psiImp equals the target theta.

Formal statement
Treated :
Type u_1
shared
Untreated :
Type u_2
shared
Regressor :
Type u_3
shared
E :
BJSPopulation Treated Untreated Regressor
shared
hLinT :
∀ c : Treated, E.cells.mean E.Y0 (inl c) = dot (E.qT c) E.beta0
hLinU :
∀ u : Untreated, E.cells.mean E.Y0 (inr u) = dot (E.qU u) E.beta0
hPred :
∃ h : (E.toPanel).ImputationWeights, (E.toPanel).psiImp h.weight = (E.toPanel).theta
Proof (Lean source)
theorem bjs_imputation_identification_population (hLinT : ∀ c : Treated, E.cells.mean E.Y0 (inl c) = dot (E.qT c) E.beta0) (hLinU : ∀ u : Untreated, E.cells.mean E.Y0 (inr u) = dot (E.qU u) E.beta0) (hPred : (E.toPanel).PredictionIdentified) : ∃ h : (E.toPanel).ImputationWeights, (E.toPanel).psiImp h.weight = (E.toPanel).theta := (E.toPanel).bjs_imputation_identification (E.toPanel_untreatedModel hLinT hLinU) hPred E.toPanel_treatmentEffectFixed
Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.bjs_imputation_identification_population · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:164 · uses ImputationWeights , PredictionIdentified , psiImp , theta , BJSPopulation , cells , toPanel , dot , mean
5 supporting declarations (lemmas, instances)
  • toPanel_EY_T_eq_mean_Y1 theorem — On a treated cell the observed mean equals the treated potential-outcome mean.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    E :
    BJSPopulation Treated Untreated Regressor
    shared
    c :
    Treated
    (E.toPanel).EY_T c = E.cells.mean E.Y1 (inl c)
    Proof (Lean source)
    theorem toPanel_EY_T_eq_mean_Y1 (c : Treated) : (E.toPanel).EY_T c = E.cells.mean E.Y1 (inl c) := by refine (E.cells).mean_congr_on (inl c) ?_ intro ω hω have hcell : E.cellOf ω = inl c := by simpa [cells] using hω exact E.hTreatedCons c ω hcell
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel_EY_T_eq_mean_Y1 · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:114
  • toPanel_EY_U_eq_mean_Y0 theorem — On an untreated cell the observed mean equals the untreated potential-outcome mean.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    E :
    BJSPopulation Treated Untreated Regressor
    shared
    u :
    Untreated
    (E.toPanel).EY_U u = E.cells.mean E.Y0 (inr u)
    Proof (Lean source)
    theorem toPanel_EY_U_eq_mean_Y0 (u : Untreated) : (E.toPanel).EY_U u = E.cells.mean E.Y0 (inr u) := by refine (E.cells).mean_congr_on (inr u) ?_ intro ω hω have hcell : E.cellOf ω = inr u := by simpa [cells] using hω exact E.hUntreatedCons u ω hcell
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel_EY_U_eq_mean_Y0 · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:123
  • toPanel_tau_eq_po_contrast theorem — Causal-meaning certificate. In the induced panel, tau c is literally the population treatment-effect contrast E[Y(1) ∣ cell c] − E[Y(0) ∣ cell c], so the estimand carries genuine causal content.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    E :
    BJSPopulation Treated Untreated Regressor
    shared
    c :
    Treated
    (E.toPanel).tau c = E.cells.mean E.Y1 (inl c) - E.cells.mean E.Y0 (inl c)
    Proof (Lean source)
    theorem toPanel_tau_eq_po_contrast (c : Treated) : (E.toPanel).tau c = E.cells.mean E.Y1 (inl c) - E.cells.mean E.Y0 (inl c) := rfl
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel_tau_eq_po_contrast · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:132
  • toPanel_treatmentEffectFixed theorem — Treatment-effect-fixed is derived. EY_T = EY0_T + tau holds because on treated cells the observed mean is the treated potential-outcome mean and tau is the treated-minus-untreated contrast.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    E :
    BJSPopulation Treated Untreated Regressor
    shared
    Proof (Lean source)
    theorem toPanel_treatmentEffectFixed : (E.toPanel).TreatmentEffectFixed := by intro c have h := E.toPanel_EY_T_eq_mean_Y1 c simp only [toPanel] at h ⊢ rw [h]; ring
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel_treatmentEffectFixed · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:139
  • toPanel_untreatedModel theorem — Untreated-outcome model is derived from the linear untreated-mean hypotheses plus consistency. The two linear-model conjuncts E[Y(0) ∣ cell] = q · β₀ are the genuine modeling hypotheses hLinT/hLinU (additive fixed-effect / parallel-trends form); the observed-equals-untreated conjunct is derived from untreated-cell consistency.
    Treated :
    Type u_1
    shared
    Untreated :
    Type u_2
    shared
    Regressor :
    Type u_3
    shared
    E :
    BJSPopulation Treated Untreated Regressor
    shared
    hLinT :
    ∀ c : Treated, E.cells.mean E.Y0 (inl c) = dot (E.qT c) E.beta0
    hLinU :
    ∀ u : Untreated, E.cells.mean E.Y0 (inr u) = dot (E.qU u) E.beta0
    Proof (Lean source)
    theorem toPanel_untreatedModel (hLinT : ∀ c : Treated, E.cells.mean E.Y0 (inl c) = dot (E.qT c) E.beta0) (hLinU : ∀ u : Untreated, E.cells.mean E.Y0 (inr u) = dot (E.qU u) E.beta0) : (E.toPanel).UntreatedOutcomeModel := by refine ⟨?_, ?_, ?_⟩ · intro c; simpa [toPanel] using hLinT c · intro u; simpa [toPanel] using hLinU u · intro u rw [E.toPanel_EY_U_eq_mean_Y0 u] simp [toPanel]
    Causalean.Panel.EstimandCharacterization.ImputationEventStudy.BJSPopulation.toPanel_untreatedModel · Causalean/Panel/EstimandCharacterization/ImputationEventStudy/PopulationBridge.lean:148