PO.ID.Exact.Variable­Intensity­IV

Variable-intensity instrumental variables: Angrist-Imbens average causal response over ordered treatment margins.

Ordered­Treatment 8 core · 3 supporting This file provides algebra for finite ordered treatment or intensity levels: it defines adjacent margins, crossing indicators, and telescoping identities that express a change across ordered levels as the sum of crossed ★ ordered_telescope_identity

Variable-Intensity IV Ordered Treatment

This file provides algebra for finite ordered treatment or intensity levels: it defines adjacent margins, crossing indicators, and telescoping identities that express a change across ordered levels as the sum of crossed marginal increments, and re-exports the generic normalized finite weights. These are used in variable-intensity instrumental-variable characterizations.

def lowerLevel reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Treatment intensity level j, the lower endpoint of margin j → j+1.

Definition (Lean source)
def lowerLevel {J : ℕ} (j : Fin J) : Fin (J + 1) := j.castSucc
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.lowerLevel · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:35
def upperLevel reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Treatment intensity level j+1, the upper endpoint of margin j → j+1.

Definition (Lean source)
def upperLevel {J : ℕ} (j : Fin J) : Fin (J + 1) := j.succ
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.upperLevel · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:39
def intensityValue reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Numeric value of an ordered treatment level.

Definition (Lean source)
def intensityValue {J : ℕ} (d : Fin (J + 1)) : ℝ := d.val
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.intensityValue · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:43
def marginIncrement reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

The margin increment f(j+1) - f(j) for j : Fin J.

Definition (Lean source)
def marginIncrement {J : ℕ} (f : Fin (J + 1) → ℝ) (j : Fin J) : ℝ := f (upperLevel j) - f (lowerLevel j)
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.marginIncrement · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:47
def Crossing reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

A movement from a to b crosses margin j → j+1.

Definition (Lean source)
def Crossing {J : ℕ} (a b : Fin (J + 1)) (j : Fin J) : Prop := upperLevel j ≤ b ∧ a < upperLevel j
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.Crossing · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:51
def crossingIndicator reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Real-valued indicator of Crossing a b j.

Definition (Lean source)
noncomputable def crossingIndicator {J : ℕ} (a b : Fin (J + 1)) (j : Fin J) : ℝ := by classical exact if Crossing a b j then 1 else 0
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.crossingIndicator · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:55
lemma ordered_telescope_identity reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Ordered telescoping for the identity intensity map. For an ordered treatment level a no larger than b among J + 1 ordered intensity levels, the numeric gap b − a equals the number of unit margins j → j+1 that the movement from a to b crosses.

Formal statement
J :
Fin (J + 1)
hab :
a ≤ b
Proof (Lean source)
lemma ordered_telescope_identity {J : ℕ} {a b : Fin (J + 1)} (hab : a ≤ b) : intensityValue b - intensityValue a = ∑ j : Fin J, crossingIndicator a b j := by simpa [intensityValue, marginIncrement, lowerLevel, upperLevel] using (ordered_telescope_indicator (J := J) (fun d : Fin (J + 1) => intensityValue d) hab)
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.ordered_telescope_identity · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:108 · uses crossingIndicator , intensityValue
abbrev normalizedWeight reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment

Generic normalized finite weight a_i / Σ_k a_k.

Definition (Lean source)
noncomputable abbrev normalizedWeight {ι : Type*} [Fintype ι] (a : ι → ℝ) (i : ι) : ℝ := normalizedWeight a i
Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.normalizedWeight · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:117
3 supporting declarations (lemmas, instances)
  • ordered_telescope_indicator lemma — Ordered telescoping across crossed margins for an arbitrary real-valued function on finite ordered levels.
    J :
    f :
    Fin (J + 1) → ℝ
    a b :
    Fin (J + 1)
    hab :
    a ≤ b
    f b - f a = ∑ j : Fin J, marginIncrement f j * crossingIndicator a b j
    Proof (Lean source)
    lemma ordered_telescope_indicator {J : ℕ} (f : Fin (J + 1) → ℝ) {a b : Fin (J + 1)} (hab : a ≤ b) : f b - f a = ∑ j : Fin J, marginIncrement f j * crossingIndicator a b j := by classical let F : ℕ → ℝ := fun n => if h : n < J + 1 then f ⟨n, h⟩ else 0 have hNat : a.val ≤ b.val := (Fin.val_fin_le).2 hab calc f b - f a = F b.val - F a.val := by have haJ : a.val ≤ J := Nat.le_of_lt_succ a.isLt have hbJ : b.val ≤ J := Nat.le_of_lt_succ b.isLt simp [F, haJ, hbJ] _ = ∑ i ∈ Ico a.val b.val, (F (i + 1) - F i) := by rw [Finset.sum_Ico_sub F hNat] _ = ∑ j : Fin J, marginIncrement f j * crossingIndicator a b j := by have hIco : Ico a.val b.val = (range J).filter (fun x => a.val ≤ x ∧ x < b.val) := by ext x simp [Finset.mem_Ico] omega rw [hIco, Finset.sum_filter, Finset.sum_fin_eq_sum_range] apply Finset.sum_congr rfl intro x hx have hxJ : x < J := by simpa using hx have hxleJ : x ≤ J := by omega simp [F, marginIncrement, lowerLevel, upperLevel, crossingIndicator_eq_ite_val, hxJ, hxleJ]
    Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.ordered_telescope_indicator · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:78
  • normalizedWeight_nonneg lemma — Nonnegativity of normalized weights from nonnegative raw weights and a positive normalizing sum.
    ι :
    Type*
    a :
    ι → ℝ
    ha :
    ∀ i, 0 ≤ a i
    hsum :
    0 < ∑ i, a i
    i :
    ι
    0 ≤ normalizedWeight a i
    Proof (Lean source)
    lemma normalizedWeight_nonneg {ι : Type*} [Fintype ι] (a : ι → ℝ) (ha : ∀ i, 0 ≤ a i) (hsum : 0 < ∑ i, a i) (i : ι) : 0 ≤ normalizedWeight a i := by exact normalizedWeight_nonneg a ha hsum i
    Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.normalizedWeight_nonneg · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:121
  • sum_normalizedWeight_eq_one lemma — Normalized finite weights sum to one when the normalizing sum is positive.
    ι :
    Type*
    a :
    ι → ℝ
    hsum :
    0 < ∑ i, a i
    ∑ i, normalizedWeight a i = 1
    Proof (Lean source)
    lemma sum_normalizedWeight_eq_one {ι : Type*} [Fintype ι] (a : ι → ℝ) (hsum : 0 < ∑ i, a i) : ∑ i, normalizedWeight a i = 1 := by exact sum_normalizedWeight_eq_one a hsum.ne'
    Causalean.PO.ID.Exact.VariableIntensityIV.OrderedTreatment.sum_normalizedWeight_eq_one · Causalean/PO/ID/Exact/VariableIntensityIV/OrderedTreatment.lean:128
Variable­Intensity 41 core · 18 supporting This file formalizes a finite ordered-treatment instrumental-variable system for an Angrist-Imbens style directed instrument contrast, inside the potential-outcome framework (POSystem). ★ VariableIntensityIVSystem★ reducedForm_eq_sum_crossingEffects★ indicatorWeightedACR_eq_averageCausalResponse★ wald_eq_averageCausalResponse★ wald_eq_late_of_binaryIntensity★ wald_eq_marginResponseAverage

Variable-Intensity Instrumental Variables

This file formalizes a finite ordered-treatment instrumental-variable system for an Angrist-Imbens style directed instrument contrast, inside the potential-outcome framework (POSystem). The instrument, treatment intensity, and outcome are system variables; potential intensities D(z) and treatment-indexed potential outcomes Y(d) are genuine counterfactuals (POVar.cfUnder), and consistency / instrument-independence are the project's canonical PO assumptions (POSystem.Consistency, POSystem.IndepCF) rather than ad-hoc structure fields.

It defines margin-specific causal responses, crossing events, and the population objects needed to express average causal responses over crossed treatment margins; the directed Wald estimand; the headline average-causal-response characterization; binary-treatment and constant-response specializations; and an interface-only population 2SLS score/decomposition layer.

structure VariableIntensityIVSystem reviewed
Causalean.PO.ID.Exact.VariableIntensityIV

A variable-intensity IV system records an instrument, an ordered treatment intensity, and an outcome inside a potential-outcome system, with the treatment taking at least one margin.

Definition (Lean source)
P :
J :
The ordered treatment has at least one margin.
hJ_pos :
0 < J
Instrument system variable.
Z :
P.V
Treatment-intensity system variable.
D :
P.V
Outcome system variable.
Y :
P.V
The instrument value space is identified with the finite set `𝒵`.
hZ𝒵 :
P.X Z ≃ᵐ 𝒵
The treatment value space is identified with the ordered levels `Fin (J+1)`.
hDintensity :
P.X D ≃ᵐ Fin (J + 1)
The outcome value space is identified with `ℝ`.
hYreal :
P.X Y ≃ᵐ ℝ
Instrument and treatment are distinct variables.
hZD :
Z ≠ D
Treatment and outcome are distinct variables.
hDY :
D ≠ Y
Instrument and outcome are distinct variables.
hZY :
Z ≠ Y
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:43 · uses POSystem
def zVar reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Instrument packaged as a POVar valued in 𝒵.

Definition (Lean source)
def zVar : POVar P 𝒵 := ⟨S.Z, S.hZ𝒵⟩
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.zVar · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:81 · uses VariableIntensityIVSystem , POSystem , POVar
def dVar reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Treatment intensity packaged as a POVar valued in Fin (J+1).

Definition (Lean source)
def dVar : POVar P (Fin (J + 1)) := ⟨S.D, S.hDintensity⟩
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.dVar · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:84 · uses VariableIntensityIVSystem , POSystem , POVar
def yVar reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Outcome packaged as a POVar valued in .

Definition (Lean source)
def yVar : POVar P ℝ := ⟨S.Y, S.hYreal⟩
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.yVar · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:87 · uses VariableIntensityIVSystem , POSystem , POVar
def DofZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Potential treatment intensity D(z): the intensity that would be observed if the instrument were fixed to z. A genuine single-intervention counterfactual.

Definition (Lean source)
def DofZ (z : 𝒵) : P.Ω → Fin (J + 1) := S.dVar.cfUnder S.zVar z
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.DofZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:90 · uses VariableIntensityIVSystem , POSystem
def YofD reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Treatment-indexed potential outcome Y(d): the outcome that would be observed if the treatment intensity were fixed to d. No instrument argument enters, so exclusion is structural.

Definition (Lean source)
def YofD (d : Fin (J + 1)) : P.Ω → ℝ := S.yVar.cfUnder S.dVar d
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.YofD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:94 · uses VariableIntensityIVSystem , POSystem
def factualZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Factual instrument Z.

Definition (Lean source)
def factualZ : P.Ω → 𝒵 := S.zVar.factual
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.factualZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:99 · uses VariableIntensityIVSystem , POSystem
def factualD reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Factual treatment intensity D.

Definition (Lean source)
def factualD : P.Ω → Fin (J + 1) := S.dVar.factual
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.factualD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:102 · uses VariableIntensityIVSystem , POSystem
def factualY reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Factual outcome Y.

Definition (Lean source)
def factualY : P.Ω → ℝ := S.yVar.factual
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.factualY · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:105 · uses VariableIntensityIVSystem , POSystem
def zEvent reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Factual instrument cell {Z = z}.

Definition (Lean source)
def zEvent (z : 𝒵) : Set P.Ω := S.zVar.event z
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.zEvent · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:108 · uses VariableIntensityIVSystem , POSystem
def dUnderZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Regimed variable for D(z) (treatment intensity under instrument set to z).

Definition (Lean source)
def dUnderZ (z : 𝒵) : RegimedVar P (Fin (J + 1)) := ⟨S.dVar, Regime.single S.Z (S.hZ𝒵.symm z)⟩
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.dUnderZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:139 · uses VariableIntensityIVSystem , POSystem , RegimedVar
def yUnderD reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Regimed variable for Y(d) (outcome under treatment intensity set to d).

Definition (Lean source)
def yUnderD (d : Fin (J + 1)) : RegimedVar P ℝ := ⟨S.yVar, Regime.single S.D (S.hDintensity.symm d)⟩
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.yUnderD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:143 · uses VariableIntensityIVSystem , POSystem , RegimedVar
def outcomeBundle reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Homogeneous bundle of the J+1 treatment-indexed potential outcomes Y(0),…,Y(J).

Definition (Lean source)
def outcomeBundle : POCFBundle P where n := J + 1 type := fun _ => ℝ inst := fun _ => inferInstance vars := fun d => S.yUnderD d
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.outcomeBundle · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:147 · uses VariableIntensityIVSystem , POCFBundle , POSystem
def cfContrastBundle reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Counterfactual bundle (D(z0), D(z1), Y(0),…,Y(J)) for the contrast (z0, z1). Index 0 is D(z0), index 1 is D(z1), index d+2 is Y(d).

Definition (Lean source)
def cfContrastBundle (z0 z1 : 𝒵) : POCFBundle P := POCFBundle.cons (S.dUnderZ z0) (POCFBundle.cons (S.dUnderZ z1) S.outcomeBundle)
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.cfContrastBundle · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:155 · uses VariableIntensityIVSystem , POCFBundle , POSystem
def marginResponse reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Unit causal response on margin j → j+1: Δ_jY = Y(j+1) - Y(j).

Definition (Lean source)
def marginResponse (j : Fin J) : P.Ω → ℝ := fun ω => S.YofD (OrderedTreatment.upperLevel j) ω - S.YofD (OrderedTreatment.lowerLevel j) ω
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.marginResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:160 · uses VariableIntensityIVSystem , POSystem
def crossingEvent reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Crossing event C_j(z0,z1) = {D(z1) ≥ j+1 > D(z0)}.

Definition (Lean source)
def crossingEvent (z0 z1 : 𝒵) (j : Fin J) : Set P.Ω := {ω | OrderedTreatment.Crossing (S.DofZ z0 ω) (S.DofZ z1 ω) j}
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.crossingEvent · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:165 · uses VariableIntensityIVSystem , POSystem
def crossingProb reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Crossing probability for a directed instrument contrast and margin.

Definition (Lean source)
def crossingProb (z0 z1 : 𝒵) (j : Fin J) : ℝ := (P.μ (S.crossingEvent z0 z1 j)).toReal
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.crossingProb · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:169 · uses VariableIntensityIVSystem , POSystem
def totalCrossingProb reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Total crossing probability, equivalently the first-stage denominator under directed monotonicity.

Definition (Lean source)
def totalCrossingProb (z0 z1 : 𝒵) : ℝ := ∑ j : Fin J, S.crossingProb z0 z1 j
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.totalCrossingProb · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:231 · uses VariableIntensityIVSystem , POSystem
def crossingWeight reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Normalized Angrist-Imbens margin-crossing weight.

Definition (Lean source)
def crossingWeight (z0 z1 : 𝒵) (j : Fin J) : ℝ := OrderedTreatment.normalizedWeight (S.crossingProb z0 z1) j
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.crossingWeight · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:236 · uses VariableIntensityIVSystem , POSystem
def indicatorWeightedEffect reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Indicator-weighted margin effect E[Δ_jY · 1_{C_j}], represented as a set integral over the crossing event.

Definition (Lean source)
def indicatorWeightedEffect (z0 z1 : 𝒵) (j : Fin J) : ℝ := ∫ ω in S.crossingEvent z0 z1 j, S.marginResponse j ω ∂P.μ
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.indicatorWeightedEffect · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:240 · uses VariableIntensityIVSystem , POSystem
def unnormalizedACRContrast reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Unnormalized sum of indicator-weighted crossing effects.

Definition (Lean source)
def unnormalizedACRContrast (z0 z1 : 𝒵) : ℝ := ∑ j : Fin J, S.indicatorWeightedEffect z0 z1 j
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.unnormalizedACRContrast · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:245 · uses VariableIntensityIVSystem , POSystem
def indicatorWeightedACR reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Indicator-weighted ACR ratio, avoiding partial conditional means in the core algebra.

Definition (Lean source)
def indicatorWeightedACR (z0 z1 : 𝒵) : ℝ := S.unnormalizedACRContrast z0 z1 / S.totalCrossingProb z0 z1
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.indicatorWeightedACR · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:249 · uses VariableIntensityIVSystem , POSystem
def conditionalMarginResponse reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

The conditional margin response is the average unit-level causal response among units whose potential treatment crosses a selected treatment margin when the instrument changes along a selected ordered contrast.

Definition (Lean source)
def conditionalMarginResponse (z0 z1 : 𝒵) (j : Fin J) : ℝ := PO.eventCondExp P.μ (S.crossingEvent z0 z1 j) (S.marginResponse j)
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.conditionalMarginResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:254 · uses VariableIntensityIVSystem , POSystem
def averageCausalResponse reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Angrist-Imbens average causal response: Σ_j ω_j E[Δ_jY | C_j].

Definition (Lean source)
def averageCausalResponse (z0 z1 : 𝒵) : ℝ := ∑ j : Fin J, S.crossingWeight z0 z1 j * S.conditionalMarginResponse z0 z1 j
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.averageCausalResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:262 · uses VariableIntensityIVSystem , POSystem
def YofDofZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Potential outcome Y(D(z)): the outcome if the instrument were set to z. Equals Y(d) at d = D(z)(ω). No direct instrument effect enters because YofD fixes only the treatment intensity d, not z (structural exclusion).

Definition (Lean source)
def YofDofZ (z : 𝒵) : P.Ω → ℝ := fun ω => S.YofD (S.DofZ z ω) ω
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.YofDofZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:267 · uses VariableIntensityIVSystem , POSystem
def firstStageContrast reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Potential first-stage contrast E[D(z1) − D(z0)] using potential treatment intensities.

Definition (Lean source)
def firstStageContrast (z0 z1 : 𝒵) : ℝ := ∫ ω, (OrderedTreatment.intensityValue (S.DofZ z1 ω) - OrderedTreatment.intensityValue (S.DofZ z0 ω)) ∂P.μ
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.firstStageContrast · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:293 · uses VariableIntensityIVSystem , POSystem
def reducedFormContrast reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Potential reduced-form contrast E[Y(D(z1)) − Y(D(z0))].

Definition (Lean source)
def reducedFormContrast (z0 z1 : 𝒵) : ℝ := ∫ ω, (S.YofDofZ z1 ω - S.YofDofZ z0 ω) ∂P.μ
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.reducedFormContrast · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:299 · uses VariableIntensityIVSystem , POSystem
def condExpDZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

E[D | Z = z] — observed first-stage conditional mean at instrument value z, defined via eventCondExp over the cell {Z = z}.

Definition (Lean source)
def condExpDZ (z : 𝒵) : ℝ := PO.eventCondExp P.μ (S.zEvent z) (fun ω => OrderedTreatment.intensityValue (S.factualD ω))
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpDZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:303 · uses VariableIntensityIVSystem , POSystem
def condExpYZ reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

E[Y | Z = z] — observed reduced-form conditional mean at instrument value z, defined via eventCondExp over the cell {Z = z}.

Definition (Lean source)
def condExpYZ (z : 𝒵) : ℝ := PO.eventCondExp P.μ (S.zEvent z) S.factualY
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpYZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:309 · uses VariableIntensityIVSystem , POSystem
def wald reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Directed Wald estimand for two instrument cells.

Definition (Lean source)
def wald (z0 z1 : 𝒵) : ℝ := (S.condExpYZ z1 - S.condExpYZ z0) / (S.condExpDZ z1 - S.condExpDZ z0)
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.wald · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:314 · uses VariableIntensityIVSystem , POSystem
structure ValidContrastAssumptions reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

IV-validity assumptions for a fixed directed contrast (z0,z1).

Definition (Lean source)
z0 z1 :
𝒵
Consistency (SUTVA): observed `D`/`Y` equal the realized potential intensity/outcome, `D = D(Z)`, `Y = Y(D)`.
consistency :
P.Consistency
H1: instrument independence from the contrast-relevant counterfactuals, `Z ⟂ (D(z0), D(z1), Y(0),…,Y(J))`.
hIndependence :
P.IndepCF (RegimedVar.ofFactual S.zVar) (S.cfContrastBundle z0 z1) P.μ
H5: directed monotonicity, `D(z1) ≥ D(z0)`, a.s.
hMonotone :
∀ᵐ ω ∂P.μ, S.DofZ z0 ω ≤ S.DofZ z1 ω
H6: positive first stage.
hRelevance :
0 < S.firstStageContrast z0 z1
H7: treatment-indexed potential outcomes are integrable.
hIntegrableY :
∀ d, Integrable (S.YofD d) P.μ
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.ValidContrastAssumptions · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:319 · uses VariableIntensityIVSystem , POSystem
theorem reducedForm_eq_sum_crossingEffects reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Reduced-form decomposition across crossed margins. Fix a directed instrument contrast (z0, z1). Under the variable-intensity IV validity assumptions — SUTVA consistency of treatment and outcome, instrument independence from the potential treatments and treatment-indexed potential outcomes, almost-sure directed monotonicity of the potential treatment intensity in the instrument, a positive first stage, and integrability of every treatment-indexed potential outcome, the potential reduced-form contrast E[Y(D(z1)) − Y(D(z0))] equals the sum, over treatment-intensity margins, of the expected unit causal response on each margin restricted to the event that the instrument move from z0 to z1 crosses that margin.

Formal statement
z0 z1 :
𝒵
hValid :
S.ValidContrastAssumptions z0 z1
S.reducedFormContrast z0 z1 = ∑ j : Fin J, S.indicatorWeightedEffect z0 z1 j
Proof (Lean source)
theorem reducedForm_eq_sum_crossingEffects {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) : S.reducedFormContrast z0 z1 = ∑ j : Fin J, S.indicatorWeightedEffect z0 z1 j := by unfold reducedFormContrast YofDofZ indicatorWeightedEffect have hpoint : (fun ω => S.YofD (S.DofZ z1 ω) ω - S.YofD (S.DofZ z0 ω) ω) =ᵐ[P.μ] fun ω => ∑ j : Fin J, S.marginResponse j ω * OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j := hValid.hMonotone.mono fun ω hmono => by simpa [OrderedTreatment.marginIncrement, marginResponse] using OrderedTreatment.ordered_telescope_indicator (J := J) (fun d : Fin (J + 1) => S.YofD d ω) hmono calc ∫ ω, (S.YofD (S.DofZ z1 ω) ω - S.YofD (S.DofZ z0 ω) ω) ∂P.μ = ∫ ω, ∑ j : Fin J, S.marginResponse j ω * OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j ∂P.μ := by exact MeasureTheory.integral_congr_ae hpoint _ = ∑ j : Fin J, ∫ ω, S.marginResponse j ω * OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j ∂P.μ := by rw [MeasureTheory.integral_finset_sum] intro i _hi rw [S.marginResponse_mul_crossingIndicator_eq_indicator z0 z1 i] exact (S.integrable_marginResponse hValid i).indicator (S.measurableSet_crossingEvent z0 z1 i) _ = ∑ j : Fin J, ∫ ω in S.crossingEvent z0 z1 j, S.marginResponse j ω ∂P.μ := by refine Finset.sum_congr rfl ?_ intro j _hj rw [S.marginResponse_mul_crossingIndicator_eq_indicator z0 z1 j] rw [MeasureTheory.integral_indicator (S.measurableSet_crossingEvent z0 z1 j)]
theorem indicatorWeightedACR_eq_averageCausalResponse reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Indicator-weighted and conditional-mean ACR forms agree. For any pair of instrument values z0 and z1, the indicator-weighted average causal response — the ratio of the summed crossing-indicator-weighted outcome contrasts to the summed crossing probabilities — equals the crossing-probability- weighted average of the conditional-mean margin responses.

Formal statement
z0 z1 :
𝒵
S.indicatorWeightedACR z0 z1 = S.averageCausalResponse z0 z1
Proof (Lean source)
theorem indicatorWeightedACR_eq_averageCausalResponse {z0 z1 : 𝒵} : S.indicatorWeightedACR z0 z1 = S.averageCausalResponse z0 z1 := by simp only [indicatorWeightedACR, averageCausalResponse, crossingWeight, OrderedTreatment.normalizedWeight, normalizedWeight, totalCrossingProb, conditionalMarginResponse, unnormalizedACRContrast, indicatorWeightedEffect, crossingProb] rw [Finset.sum_div] apply Finset.sum_congr rfl intro j _hj rw [← PO.eventCondExp_mul_measure_toReal P.μ (S.crossingEvent z0 z1 j) (measure_ne_top _ _) (S.marginResponse j)] ring_nf
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.indicatorWeightedACR_eq_averageCausalResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:726 · uses VariableIntensityIVSystem , averageCausalResponse , indicatorWeightedACR , POSystem
theorem wald_eq_averageCausalResponse reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Angrist-Imbens average-causal-response characterization. Under the variable-intensity IV validity assumptions, with the instrument cell Z = z0 having positive probability and the instrument cell Z = z1 having positive probability, the directed Wald estimand — the ratio of the reduced-form to first-stage conditional-mean contrasts across the two instrument cells — equals the Angrist-Imbens average causal response: the crossing-probability-weighted average, over treatment-intensity margins, of the conditional mean causal response given that the instrument move from z0 to z1 crosses that margin.

Formal statement
z0 z1 :
𝒵
hValid :
S.ValidContrastAssumptions z0 z1
hCell0 :
0 < (P.μ (S.zEvent z0)).toReal
hCell1 :
0 < (P.μ (S.zEvent z1)).toReal
S.wald z0 z1 = S.averageCausalResponse z0 z1
Proof (Lean source)
theorem wald_eq_averageCausalResponse {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) : S.wald z0 z1 = S.averageCausalResponse z0 z1 := by have hDZ0 := S.condExpDZ_left_eq_integral hValid hCell0 have hDZ1 := S.condExpDZ_right_eq_integral hValid hCell1 have hYZ0 := S.condExpYZ_left_eq_integral hValid hCell0 have hYZ1 := S.condExpYZ_right_eq_integral hValid hCell1 have hDint0 := S.integrable_intensityValue_DofZ z0 have hDint1 := S.integrable_intensityValue_DofZ z1 have hYint0 := S.integrable_YofDofZ hValid z0 have hYint1 := S.integrable_YofDofZ hValid z1 unfold wald rw [hYZ1, hYZ0, hDZ1, hDZ0] rw [← MeasureTheory.integral_sub hYint1 hYint0, ← MeasureTheory.integral_sub hDint1 hDint0] change S.reducedFormContrast z0 z1 / S.firstStageContrast z0 z1 = S.averageCausalResponse z0 z1 rw [← S.indicatorWeightedACR_eq_averageCausalResponse] simp [indicatorWeightedACR, unnormalizedACRContrast, totalCrossingProb, S.reducedForm_eq_sum_crossingEffects hValid, S.firstStage_eq_sum_crossingProb hValid]
def binaryMargin reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases

Canonical single treatment margin transported from Fin 1 under J = 1.

Definition (Lean source)
def binaryMargin (hBinaryIntensity : J = 1) : Fin J := hBinaryIntensity.symm ▸ (0 : Fin 1)
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases.binaryMargin · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:781
theorem wald_eq_late_of_binaryIntensity reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases

Binary-intensity specialization: Wald recovers LATE. Under the variable-intensity IV validity assumptions, with positive probability of the instrument cell Z = z0, positive probability of the instrument cell Z = z1, and a single treatment margin, J = 1, the directed Wald estimand equals the conditional mean unit causal response given the unique crossing event — the classical binary-treatment local average treatment effect.

Formal statement
z0 z1 :
𝒵
hValid :
S.ValidContrastAssumptions z0 z1
hCell0 :
0 < (P.μ (S.zEvent z0)).toReal
hCell1 :
0 < (P.μ (S.zEvent z1)).toReal
hBinaryIntensity :
J = 1
S.wald z0 z1
= PO.eventCondExp P.μ (S.crossingEvent z0 z1 (binaryMargin hBinaryIntensity)) (S.marginResponse (binaryMargin hBinaryIntensity))
Proof (Lean source)
theorem wald_eq_late_of_binaryIntensity {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) (hBinaryIntensity : J = 1) : S.wald z0 z1 = PO.eventCondExp P.μ (S.crossingEvent z0 z1 (binaryMargin hBinaryIntensity)) (S.marginResponse (binaryMargin hBinaryIntensity)) := by subst hBinaryIntensity rw [S.wald_eq_averageCausalResponse hValid hCell0 hCell1] have hweight : S.crossingWeight z0 z1 0 = 1 := by simpa using S.sum_crossingWeight_eq_one hValid simp [averageCausalResponse, binaryMargin, conditionalMarginResponse, hweight]
theorem wald_eq_marginResponseAverage reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases

Margin-specific response average specialization. Under the variable-intensity IV validity assumptions, with positive probability of the instrument cell Z = z0, positive probability of the instrument cell Z = z1, and a candidate margin-response function m that agrees, on each treatment-intensity margin, with the conditional mean causal response given that margin's crossing event, the directed Wald estimand equals the crossing-probability-weighted average of m across margins.

Formal statement
z0 z1 :
𝒵
m :
Fin J → ℝ
hValid :
S.ValidContrastAssumptions z0 z1
hCell0 :
0 < (P.μ (S.zEvent z0)).toReal
hCell1 :
0 < (P.μ (S.zEvent z1)).toReal
hMarginResponse :
∀ j : Fin J, m j = S.conditionalMarginResponse z0 z1 j
S.wald z0 z1 = ∑ j : Fin J, S.crossingWeight z0 z1 j * m j
Proof (Lean source)
theorem wald_eq_marginResponseAverage {z0 z1 : 𝒵} (m : Fin J → ℝ) (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) (hMarginResponse : ∀ j : Fin J, m j = S.conditionalMarginResponse z0 z1 j) : S.wald z0 z1 = ∑ j : Fin J, S.crossingWeight z0 z1 j * m j := by rw [S.wald_eq_averageCausalResponse hValid hCell0 hCell1] simp [averageCausalResponse, hMarginResponse]
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases.wald_eq_marginResponseAverage · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:863 · uses VariableIntensityIVSystem , ValidContrastAssumptions , conditionalMarginResponse , crossingWeight , wald , zEvent , POSystem
structure PopulationTwoSLSScore reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Centered finite instrument score used to define an interface-only population 2SLS estimand for multivalued instruments.

Definition (Lean source)
k :
Instrument score `S(z) ∈ ℝ^k`.
score :
𝒵 → Fin k → ℝ
Population first-stage projection coefficient.
gammaD :
Fin k → ℝ
Centering of each score coordinate.
centered :
∀ r : Fin k, ∫ ω, score (S.factualZ ω) r ∂P.μ = 0
Nonzero one-endogenous-regressor denominator.
denom_nonzero :
∫ ω, (∑ r : Fin k, gammaD r * score (S.factualZ ω) r) * OrderedTreatment.intensityValue (S.factualD ω) ∂P.μ
≠ 0
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.PopulationTwoSLSScore · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:881 · uses VariableIntensityIVSystem , POSystem
def fittedTreatment reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.PopulationTwoSLSScore

First-stage fitted treatment D_S(ω) = γ_D^T S(Z(ω)); the linear projection of D onto the instrument score.

Definition (Lean source)
def fittedTreatment : P.Ω → ℝ := fun ω => ∑ r : Fin k, T.gammaD r * T.score (S.factualZ ω) r
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.PopulationTwoSLSScore.fittedTreatment · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:899 · uses VariableIntensityIVSystem , PopulationTwoSLSScore , POSystem
def beta2SLS reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.PopulationTwoSLSScore

Population 2SLS estimand β_2SLS(S) = E[D_S Y] / E[D_S D]. This declaration is only the population ratio interface: the file does not derive the binary-instrument bridge beta2SLS T = wald z0 z1. Such a bridge would require centering algebra and the scalar FWL identity for a score of the form S(Z) = Z - E[Z].

Definition (Lean source)
def beta2SLS : ℝ := (∫ ω, T.fittedTreatment ω * S.factualY ω ∂P.μ) / (∫ ω, T.fittedTreatment ω * OrderedTreatment.intensityValue (S.factualD ω) ∂P.μ)
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.PopulationTwoSLSScore.beta2SLS · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:904 · uses VariableIntensityIVSystem , PopulationTwoSLSScore , POSystem
structure TwoSLSContrastDecomposition reviewed
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem

Deferred interface for expanding a multivalued-instrument 2SLS estimand into finite directed contrasts. A later theorem can add sign-alignment assumptions to turn this signed decomposition into a convex ACR average.

Definition (Lean source)
k :
T :
S.PopulationTwoSLSScore k
Signed weight on an ordered instrument-cell contrast.
contrastWeight :
𝒵 × 𝒵 → ℝ
First-stage contribution attached to each ordered contrast.
pairFirstStage :
𝒵 × 𝒵 → ℝ
Reduced-form contribution attached to each ordered contrast.
pairReducedForm :
𝒵 × 𝒵 → ℝ
Reduced-form expansion into finite ordered contrasts, carried as a field of the decomposition interface.
reducedForm_decomp :
∫ ω, T.fittedTreatment ω * S.factualY ω ∂P.μ
= ∑ p : 𝒵 × 𝒵, contrastWeight p * pairReducedForm p
First-stage expansion into finite ordered contrasts, carried as a field of the decomposition interface.
firstStage_decomp :
∫ ω, T.fittedTreatment ω * OrderedTreatment.intensityValue (S.factualD ω) ∂P.μ
= ∑ p : 𝒵 × 𝒵, contrastWeight p * pairFirstStage p
Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.TwoSLSContrastDecomposition · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:915 · uses VariableIntensityIVSystem , PopulationTwoSLSScore , POSystem
18 supporting declarations (lemmas, instances)
  • measurable_DofZ lemma — The potential treatment under a fixed instrument value is measurable.
    z :
    𝒵
    Measurable (S.DofZ z)
    Proof (Lean source)
    lemma measurable_DofZ (z : 𝒵) : Measurable (S.DofZ z) := S.dVar.measurable_cfUnder S.zVar z
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurable_DofZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:111
  • measurable_YofD lemma — The potential outcome under a fixed treatment value is measurable.
    d :
    Fin (J + 1)
    Measurable (S.YofD d)
    Proof (Lean source)
    lemma measurable_YofD (d : Fin (J + 1)) : Measurable (S.YofD d) := S.yVar.measurable_cfUnder S.dVar d
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurable_YofD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:115
  • measurable_factualZ lemma — The factual instrument is measurable.
    Measurable S.factualZ
    Proof (Lean source)
    lemma measurable_factualZ : Measurable S.factualZ := S.zVar.measurable_factual
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurable_factualZ · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:119
  • measurable_factualD lemma — The factual treatment is measurable.
    Measurable S.factualD
    Proof (Lean source)
    lemma measurable_factualD : Measurable S.factualD := S.dVar.measurable_factual
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurable_factualD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:122
  • measurable_factualY lemma — The factual outcome is measurable.
    Measurable S.factualY
    Proof (Lean source)
    lemma measurable_factualY : Measurable S.factualY := S.yVar.measurable_factual
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurable_factualY · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:125
  • measurableSet_zEvent lemma — The factual instrument cell is measurable.
    z :
    𝒵
    MeasurableSet (S.zEvent z)
    Proof (Lean source)
    lemma measurableSet_zEvent (z : 𝒵) : MeasurableSet (S.zEvent z) := S.zVar.measurableSet_event z (MeasurableSet.singleton z)
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.measurableSet_zEvent · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:128
  • integrable_marginResponse lemma — Integrability of a margin response, derived from H7.
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    j :
    Fin J
    Integrable (S.marginResponse j) P.μ
    Proof (Lean source)
    lemma integrable_marginResponse {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (j : Fin J) : Integrable (S.marginResponse j) P.μ := by exact (hValid.hIntegrableY (OrderedTreatment.upperLevel j)).sub (hValid.hIntegrableY (OrderedTreatment.lowerLevel j))
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.integrable_marginResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:343
  • DofZ_eq_factualD_on_zEvent lemma — On zEvent z, the counterfactual intensity D(z) equals the factual D.
    hC :
    P.Consistency
    z :
    𝒵
    ω :
    P.Ω
    :
    ω ∈ S.zEvent z
    S.DofZ z ω = S.factualD ω
    Proof (Lean source)
    lemma DofZ_eq_factualD_on_zEvent (hC : P.Consistency) (z : 𝒵) {ω : P.Ω} (hω : ω ∈ S.zEvent z) : S.DofZ z ω = S.factualD ω := POVar.cf_eq_factual_on_event hC S.dVar S.zVar z S.hZD.symm hω
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.DofZ_eq_factualD_on_zEvent · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:377
  • factualY_eq_YofD_factualD lemma — Factual Y equals the counterfactual Y(factualD ω).
    hC :
    P.Consistency
    ω :
    P.Ω
    S.factualY ω = S.YofD (S.factualD ω) ω
    Proof (Lean source)
    lemma factualY_eq_YofD_factualD (hC : P.Consistency) (ω : P.Ω) : S.factualY ω = S.YofD (S.factualD ω) ω := POVar.factual_eq_cfUnder_self_selected hC S.yVar S.dVar S.hDY.symm ω
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.factualY_eq_YofD_factualD · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:383
  • condExpDZ_left_eq_integral lemma — First-stage bridge (left cell z0): the observed first-stage conditional mean equals the unconditional expectation of the potential intensity D(z0).
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    hCell0 :
    0 < (P.μ (S.zEvent z0)).toReal
    S.condExpDZ z0 = ∫ ω, OrderedTreatment.intensityValue (S.DofZ z0 ω) ∂P.μ
    Proof (Lean source)
    lemma condExpDZ_left_eq_integral {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) : S.condExpDZ z0 = ∫ ω, OrderedTreatment.intensityValue (S.DofZ z0 ω) ∂P.μ := by have hμne_zero : P.μ (S.zVar.event z0) ≠ 0 := fun h => absurd hCell0 (by simp [show S.zEvent z0 = S.zVar.event z0 from rfl, h]) have hμne_top : P.μ (S.zVar.event z0) ≠ ⊤ := measure_ne_top _ _ let idx0 : Fin (S.cfContrastBundle z0 z1).n := ⟨0, by simp [cfContrastBundle, outcomeBundle, POCFBundle.cons]⟩ let hproj : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) → ℝ := fun f => OrderedTreatment.intensityValue (f idx0) have hh_meas : Measurable hproj := by change Measurable fun f : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) => OrderedTreatment.intensityValue (f idx0) exact (measurable_intensityValue (J := J)).comp (measurable_pi_apply idx0) have h_cons : ∀ ω ∈ S.zVar.event z0, OrderedTreatment.intensityValue (S.factualD ω) = hproj ((S.cfContrastBundle z0 z1).jointValue ω) := by intro ω hω rw [← S.DofZ_eq_factualD_on_zEvent hValid.consistency z0 hω] change OrderedTreatment.intensityValue (S.DofZ z0 ω) = OrderedTreatment.intensityValue ((S.cfContrastBundle z0 z1).jointValue ω idx0) rfl have hbridge : S.condExpDZ z0 = eventCondExp P.μ (S.zVar.event z0) (fun ω => OrderedTreatment.intensityValue (S.factualD ω)) := rfl rw [hbridge, POSystem.eventCondExp_of_consistency_IndepCF hValid.hIndependence (a := S.zVar) hh_meas (MeasurableSet.singleton z0) (ae_restrict_of_forall_mem (S.measurableSet_zEvent z0) h_cons) hμne_zero hμne_top] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω change OrderedTreatment.intensityValue ((S.cfContrastBundle z0 z1).jointValue ω idx0) = OrderedTreatment.intensityValue (S.DofZ z0 ω) rfl
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpDZ_left_eq_integral · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:388
  • condExpDZ_right_eq_integral lemma — First-stage bridge (right cell z1).
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    hCell1 :
    0 < (P.μ (S.zEvent z1)).toReal
    S.condExpDZ z1 = ∫ ω, OrderedTreatment.intensityValue (S.DofZ z1 ω) ∂P.μ
    Proof (Lean source)
    lemma condExpDZ_right_eq_integral {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) : S.condExpDZ z1 = ∫ ω, OrderedTreatment.intensityValue (S.DofZ z1 ω) ∂P.μ := by have hμne_zero : P.μ (S.zVar.event z1) ≠ 0 := fun h => absurd hCell1 (by simp [show S.zEvent z1 = S.zVar.event z1 from rfl, h]) have hμne_top : P.μ (S.zVar.event z1) ≠ ⊤ := measure_ne_top _ _ let idx1 : Fin (S.cfContrastBundle z0 z1).n := ⟨1, by simp [cfContrastBundle, outcomeBundle, POCFBundle.cons]⟩ let hproj : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) → ℝ := fun f => OrderedTreatment.intensityValue (f idx1) have hh_meas : Measurable hproj := by change Measurable fun f : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) => OrderedTreatment.intensityValue (f idx1) exact (measurable_intensityValue (J := J)).comp (measurable_pi_apply idx1) have h_cons : ∀ ω ∈ S.zVar.event z1, OrderedTreatment.intensityValue (S.factualD ω) = hproj ((S.cfContrastBundle z0 z1).jointValue ω) := by intro ω hω rw [← S.DofZ_eq_factualD_on_zEvent hValid.consistency z1 hω] change OrderedTreatment.intensityValue (S.DofZ z1 ω) = OrderedTreatment.intensityValue ((S.cfContrastBundle z0 z1).jointValue ω idx1) rfl have hbridge : S.condExpDZ z1 = eventCondExp P.μ (S.zVar.event z1) (fun ω => OrderedTreatment.intensityValue (S.factualD ω)) := rfl rw [hbridge, POSystem.eventCondExp_of_consistency_IndepCF hValid.hIndependence (a := S.zVar) hh_meas (MeasurableSet.singleton z1) (ae_restrict_of_forall_mem (S.measurableSet_zEvent z1) h_cons) hμne_zero hμne_top] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω change OrderedTreatment.intensityValue ((S.cfContrastBundle z0 z1).jointValue ω idx1) = OrderedTreatment.intensityValue (S.DofZ z1 ω) rfl
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpDZ_right_eq_integral · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:431
  • condExpYZ_left_eq_integral lemma — Reduced-form bridge (left cell z0): the observed reduced-form conditional mean equals the unconditional expectation of Y(D(z0)).
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    hCell0 :
    0 < (P.μ (S.zEvent z0)).toReal
    S.condExpYZ z0 = ∫ ω, S.YofDofZ z0 ω ∂P.μ
    Proof (Lean source)
    lemma condExpYZ_left_eq_integral {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) : S.condExpYZ z0 = ∫ ω, S.YofDofZ z0 ω ∂P.μ := by classical have hμne_zero : P.μ (S.zVar.event z0) ≠ 0 := fun h => absurd hCell0 (by simp [show S.zEvent z0 = S.zVar.event z0 from rfl, h]) have hμne_top : P.μ (S.zVar.event z0) ≠ ⊤ := measure_ne_top _ _ let idx0 : Fin (S.cfContrastBundle z0 z1).n := ⟨0, by simp [cfContrastBundle, outcomeBundle, POCFBundle.cons]⟩ let idxY (i : Fin (J + 1)) : Fin (S.cfContrastBundle z0 z1).n := Fin.succ (Fin.succ i) let hproj : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) → ℝ := fun f => ∑ i : Fin (J + 1), if f idx0 = i then f (idxY i) else 0 have hh_meas : Measurable hproj := by change Measurable fun f : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) => ∑ i : Fin (J + 1), if f idx0 = i then f (idxY i) else 0 refine measurable_sum _ ?_ intro i _hi refine Measurable.ite ?_ (measurable_pi_apply (idxY i)) measurable_const exact (MeasurableSet.singleton i).preimage (measurable_pi_apply idx0) have h_cons : ∀ ω ∈ S.zVar.event z0, S.factualY ω = hproj ((S.cfContrastBundle z0 z1).jointValue ω) := by intro ω hω rw [S.factualY_eq_YofD_factualD hValid.consistency ω, ← S.DofZ_eq_factualD_on_zEvent hValid.consistency z0 hω] have hJV0 : (S.cfContrastBundle z0 z1).jointValue ω idx0 = S.DofZ z0 ω := rfl have hJVY : ∀ i : Fin (J + 1), (S.cfContrastBundle z0 z1).jointValue ω (idxY i) = S.YofD i ω := by intro i rfl change S.YofD (S.DofZ z0 ω) ω = ∑ i : Fin (J + 1), if (S.cfContrastBundle z0 z1).jointValue ω idx0 = i then (S.cfContrastBundle z0 z1).jointValue ω (idxY i) else 0 rw [hJV0] rw [Finset.sum_eq_single (S.DofZ z0 ω)] · exact (hJVY _).symm.trans (if_pos rfl).symm · intro i _hi hi by_cases hEq : S.DofZ z0 ω = i · exact elim (hi hEq.symm) · exact if_neg hEq · intro h simp at h have hbridge : S.condExpYZ z0 = eventCondExp P.μ (S.zVar.event z0) S.factualY := rfl rw [hbridge, POSystem.eventCondExp_of_consistency_IndepCF hValid.hIndependence (a := S.zVar) hh_meas (MeasurableSet.singleton z0) (ae_restrict_of_forall_mem (S.measurableSet_zEvent z0) h_cons) hμne_zero hμne_top] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω have hJV0 : (S.cfContrastBundle z0 z1).jointValue ω idx0 = S.DofZ z0 ω := rfl have hJVY : ∀ i : Fin (J + 1), (S.cfContrastBundle z0 z1).jointValue ω (idxY i) = S.YofD i ω := by intro i rfl change (∑ i : Fin (J + 1), if (S.cfContrastBundle z0 z1).jointValue ω idx0 = i then (S.cfContrastBundle z0 z1).jointValue ω (idxY i) else 0) = S.YofDofZ z0 ω unfold YofDofZ rw [hJV0] rw [Finset.sum_eq_single (S.DofZ z0 ω)] · exact (if_pos rfl).trans (hJVY _) · intro i _hi hi by_cases hEq : S.DofZ z0 ω = i · exact elim (hi hEq.symm) · exact if_neg hEq · intro h simp at h
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpYZ_left_eq_integral · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:475
  • condExpYZ_right_eq_integral lemma — Reduced-form bridge (right cell z1).
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    hCell1 :
    0 < (P.μ (S.zEvent z1)).toReal
    S.condExpYZ z1 = ∫ ω, S.YofDofZ z1 ω ∂P.μ
    Proof (Lean source)
    lemma condExpYZ_right_eq_integral {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) : S.condExpYZ z1 = ∫ ω, S.YofDofZ z1 ω ∂P.μ := by classical have hμne_zero : P.μ (S.zVar.event z1) ≠ 0 := fun h => absurd hCell1 (by simp [show S.zEvent z1 = S.zVar.event z1 from rfl, h]) have hμne_top : P.μ (S.zVar.event z1) ≠ ⊤ := measure_ne_top _ _ let idx1 : Fin (S.cfContrastBundle z0 z1).n := ⟨1, by simp [cfContrastBundle, outcomeBundle, POCFBundle.cons]⟩ let idxY (i : Fin (J + 1)) : Fin (S.cfContrastBundle z0 z1).n := Fin.succ (Fin.succ i) let hproj : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) → ℝ := fun f => ∑ i : Fin (J + 1), if f idx1 = i then f (idxY i) else 0 have hh_meas : Measurable hproj := by change Measurable fun f : (∀ i : Fin (S.cfContrastBundle z0 z1).n, (S.cfContrastBundle z0 z1).type i) => ∑ i : Fin (J + 1), if f idx1 = i then f (idxY i) else 0 refine measurable_sum _ ?_ intro i _hi refine Measurable.ite ?_ (measurable_pi_apply (idxY i)) measurable_const exact (MeasurableSet.singleton i).preimage (measurable_pi_apply idx1) have h_cons : ∀ ω ∈ S.zVar.event z1, S.factualY ω = hproj ((S.cfContrastBundle z0 z1).jointValue ω) := by intro ω hω rw [S.factualY_eq_YofD_factualD hValid.consistency ω, ← S.DofZ_eq_factualD_on_zEvent hValid.consistency z1 hω] have hJV1 : (S.cfContrastBundle z0 z1).jointValue ω idx1 = S.DofZ z1 ω := rfl have hJVY : ∀ i : Fin (J + 1), (S.cfContrastBundle z0 z1).jointValue ω (idxY i) = S.YofD i ω := by intro i rfl change S.YofD (S.DofZ z1 ω) ω = ∑ i : Fin (J + 1), if (S.cfContrastBundle z0 z1).jointValue ω idx1 = i then (S.cfContrastBundle z0 z1).jointValue ω (idxY i) else 0 rw [hJV1] rw [Finset.sum_eq_single (S.DofZ z1 ω)] · exact (hJVY _).symm.trans (if_pos rfl).symm · intro i _hi hi by_cases hEq : S.DofZ z1 ω = i · exact elim (hi hEq.symm) · exact if_neg hEq · intro h simp at h have hbridge : S.condExpYZ z1 = eventCondExp P.μ (S.zVar.event z1) S.factualY := rfl rw [hbridge, POSystem.eventCondExp_of_consistency_IndepCF hValid.hIndependence (a := S.zVar) hh_meas (MeasurableSet.singleton z1) (ae_restrict_of_forall_mem (S.measurableSet_zEvent z1) h_cons) hμne_zero hμne_top] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω have hJV1 : (S.cfContrastBundle z0 z1).jointValue ω idx1 = S.DofZ z1 ω := rfl have hJVY : ∀ i : Fin (J + 1), (S.cfContrastBundle z0 z1).jointValue ω (idxY i) = S.YofD i ω := by intro i rfl change (∑ i : Fin (J + 1), if (S.cfContrastBundle z0 z1).jointValue ω idx1 = i then (S.cfContrastBundle z0 z1).jointValue ω (idxY i) else 0) = S.YofDofZ z1 ω unfold YofDofZ rw [hJV1] rw [Finset.sum_eq_single (S.DofZ z1 ω)] · exact (if_pos rfl).trans (hJVY _) · intro i _hi hi by_cases hEq : S.DofZ z1 ω = i · exact elim (hi hEq.symm) · exact if_neg hEq · intro h simp at h
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.condExpYZ_right_eq_integral · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:554
  • firstStage_eq_sum_crossingProb theorem — First-stage denominator equals the sum of crossing probabilities.
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    S.firstStageContrast z0 z1 = ∑ j : Fin J, S.crossingProb z0 z1 j
    Proof (Lean source)
    theorem firstStage_eq_sum_crossingProb {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) : S.firstStageContrast z0 z1 = ∑ j : Fin J, S.crossingProb z0 z1 j := by unfold firstStageContrast crossingProb have hpoint : (fun ω => OrderedTreatment.intensityValue (S.DofZ z1 ω) - OrderedTreatment.intensityValue (S.DofZ z0 ω)) =ᵐ[P.μ] fun ω => ∑ j : Fin J, OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j := hValid.hMonotone.mono fun _ hmono => OrderedTreatment.ordered_telescope_identity hmono calc ∫ ω, (OrderedTreatment.intensityValue (S.DofZ z1 ω) - OrderedTreatment.intensityValue (S.DofZ z0 ω)) ∂P.μ = ∫ ω, ∑ j : Fin J, OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j ∂P.μ := by exact MeasureTheory.integral_congr_ae hpoint _ = ∑ j : Fin J, ∫ ω, OrderedTreatment.crossingIndicator (S.DofZ z0 ω) (S.DofZ z1 ω) j ∂P.μ := by rw [MeasureTheory.integral_finset_sum] intro i _hi rw [S.crossingIndicator_fun_eq_indicator z0 z1 i] exact (MeasureTheory.integrable_const (μ := P.μ) (1 : ℝ)).indicator (S.measurableSet_crossingEvent z0 z1 i) _ = ∑ j : Fin J, (P.μ (S.crossingEvent z0 z1 j)).toReal := by refine Finset.sum_congr rfl ?_ intro j _hj rw [S.crossingIndicator_fun_eq_indicator z0 z1 j] exact MeasureTheory.integral_indicator_one (S.measurableSet_crossingEvent z0 z1 j)
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.firstStage_eq_sum_crossingProb · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:632
  • crossingWeight_nonneg lemma — Crossing weights are nonnegative for a valid directed contrast.
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    j :
    Fin J
    0 ≤ S.crossingWeight z0 z1 j
    Proof (Lean source)
    lemma crossingWeight_nonneg {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) (j : Fin J) : 0 ≤ S.crossingWeight z0 z1 j := by have hProb : ∀ i : Fin J, 0 ≤ S.crossingProb z0 z1 i := by intro i exact ENNReal.toReal_nonneg have hSum : 0 < ∑ i : Fin J, S.crossingProb z0 z1 i := by rw [← S.firstStage_eq_sum_crossingProb hValid] exact hValid.hRelevance exact OrderedTreatment.normalizedWeight_nonneg (S.crossingProb z0 z1) hProb hSum j
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.crossingWeight_nonneg · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:664
  • sum_crossingWeight_eq_one lemma — Crossing weights sum to one for a valid directed contrast.
    z0 z1 :
    𝒵
    hValid :
    S.ValidContrastAssumptions z0 z1
    ∑ j : Fin J, S.crossingWeight z0 z1 j = 1
    Proof (Lean source)
    lemma sum_crossingWeight_eq_one {z0 z1 : 𝒵} (hValid : S.ValidContrastAssumptions z0 z1) : ∑ j : Fin J, S.crossingWeight z0 z1 j = 1 := by have hSum : 0 < ∑ i : Fin J, S.crossingProb z0 z1 i := by rw [← S.firstStage_eq_sum_crossingProb hValid] exact hValid.hRelevance exact OrderedTreatment.sum_normalizedWeight_eq_one (S.crossingProb z0 z1) hSum
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.sum_crossingWeight_eq_one · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:676
  • crossingEvent_eq_complianceEvent lemma — Under J = 1, the unique crossing event coincides with the complier event {D(z1) = Fin.last J ∧ D(z0) = 0}, i.e. the unit jump from level 0 to the maximum level. When J = 1, Fin.last 1 = 1 : Fin 2, so this recovers exactly the binary-treatment LATE complier event {D(z1) = 1 ∧ D(z0) = 0} of Imbens-Angrist (1994): β_Wald(z0,z1) = E[Y(1) − Y(0) | D(z1) = Fin.last J ∧ D(z0) = 0].
    z0 z1 :
    𝒵
    hJ :
    J = 1
    S.crossingEvent z0 z1 (binaryMargin hJ)
    = {ω | S.DofZ z1 ω = last J ∧ S.DofZ z0 ω = (0 : Fin (J + 1))}
    Proof (Lean source)
    lemma crossingEvent_eq_complianceEvent (z0 z1 : 𝒵) (hJ : J = 1) : S.crossingEvent z0 z1 (binaryMargin hJ) = {ω | S.DofZ z1 ω = last J ∧ S.DofZ z0 ω = (0 : Fin (J + 1))} := by subst hJ ext ω simp only [binaryMargin, crossingEvent, OrderedTreatment.Crossing, OrderedTreatment.upperLevel, Set.mem_setOf_eq, last] have hone : (Fin.succ (0 : Fin 1)) = (⟨1, by omega⟩ : Fin 2) := by decide rw [hone] have hone_val : (⟨1, by omega⟩ : Fin 2).val = 1 := rfl constructor · rintro ⟨h1, h2⟩ refine ⟨le_antisymm (Fin.le_last _) h1, Fin.ext ?_⟩ have hv2 : (S.DofZ z0 ω).val < (⟨1, by omega⟩ : Fin 2).val := Fin.val_fin_lt.mpr h2 rw [hone_val] at hv2 have hge : 0 ≤ (S.DofZ z0 ω).val := zero_le _ simp only [Fin.val_zero] omega · rintro ⟨h1, h2⟩ refine ⟨h1 ▸ le_refl _, Fin.val_fin_lt.mp ?_⟩ rw [hone_val] have hv2 : (S.DofZ z0 ω).val = (0 : Fin 2).val := congr_arg val h2 simp only [Fin.val_zero] at hv2 omega
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases.crossingEvent_eq_complianceEvent · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:805
  • wald_eq_constantResponse theorem — Constant marginal response specialization.
    z0 z1 :
    𝒵
    τ :
    hValid :
    S.ValidContrastAssumptions z0 z1
    hCell0 :
    0 < (P.μ (S.zEvent z0)).toReal
    hCell1 :
    0 < (P.μ (S.zEvent z1)).toReal
    hConstantResponse :
    ∀ j : Fin J, S.marginResponse j =ᵐ[P.μ] fun _ => τ
    S.wald z0 z1 = τ
    Proof (Lean source)
    theorem wald_eq_constantResponse {z0 z1 : 𝒵} {τ : ℝ} (hValid : S.ValidContrastAssumptions z0 z1) (hCell0 : 0 < (P.μ (S.zEvent z0)).toReal) (hCell1 : 0 < (P.μ (S.zEvent z1)).toReal) (hConstantResponse : ∀ j : Fin J, S.marginResponse j =ᵐ[P.μ] fun _ => τ) : S.wald z0 z1 = τ := by rw [S.wald_eq_averageCausalResponse hValid hCell0 hCell1] rw [← S.indicatorWeightedACR_eq_averageCausalResponse] unfold indicatorWeightedACR unnormalizedACRContrast totalCrossingProb indicatorWeightedEffect crossingProb have hterm : ∀ j : Fin J, (∫ ω in S.crossingEvent z0 z1 j, S.marginResponse j ω ∂P.μ) = τ * (P.μ (S.crossingEvent z0 z1 j)).toReal := by intro j rw [MeasureTheory.setIntegral_congr_ae (S.measurableSet_crossingEvent z0 z1 j) ((hConstantResponse j).mono fun _ hx _ => hx)] rw [MeasureTheory.setIntegral_const, MeasureTheory.Measure.real_def] exact smul_eq_mul _ _ |>.trans (mul_comm _ _) rw [Finset.sum_congr rfl (fun j _ => hterm j), ← Finset.mul_sum] have hpos : 0 < ∑ j : Fin J, (P.μ (S.crossingEvent z0 z1 j)).toReal := by simpa [crossingProb] using (by rw [← S.firstStage_eq_sum_crossingProb hValid] exact hValid.hRelevance : 0 < ∑ j : Fin J, S.crossingProb z0 z1 j) field_simp [ne_of_gt hpos]
    Causalean.PO.ID.Exact.VariableIntensityIV.VariableIntensityIVSystem.SpecialCases.wald_eq_constantResponse · Causalean/PO/ID/Exact/VariableIntensityIV/VariableIntensity.lean:837