PO.ID.Exact.MultipleInstrumentIV
Multiple-instrument IV: Mogstad-Torgovitsky-Walters finite-support 2SLS response-type algebra and sign-alignment results.
FiniteIndex 18 core · 5 supporting This file develops the finite ordered-index algebra used in the Mogstad-Torgovitsky-Walters multiple-instrument characterization. ★ tailCoeff_nonneg★ tailCoeff_eq_cov
Multiple-Instrument IV Finite Index Algebra
This file develops the finite ordered-index algebra used in the Mogstad-Torgovitsky-Walters multiple-instrument characterization. It defines support masses, ordered first-stage indices, centered instruments, tail coefficients, and the finite matrix identities that underlie the signed decomposition.
For a finite ordered support with points, the adjacent-threshold set consists of every strictly positive support position, each representing the boundary between its immediately preceding position and itself.
Definition (Lean source)
Lower endpoint j-1 of an adjacent threshold.
Upper endpoint j of an adjacent threshold.
A finite ordered first-stage index for the saturated multiple-instrument characterization: instrument support masses that are nonnegative and sum to one, together with a first-stage index that is weakly increasing in the displayed support order.
Definition (Lean source)
Given a sample space equipped with a σ-algebra, a finite instrument support of size , a measure on that sample space, an instrument taking values in that support, and a support point, the support mass is the real-valued measure of the event that the instrument equals that point.
Definition (Lean source)
Given a measurable sample space, a finite support of size , a probability measure, a measurable instrument with that support, a real first-stage score at each support point, and the condition that this score is weakly increasing in support order, the ordered finite first-stage index has support masses equal to the instrument probabilities and the supplied score.
Definition (Lean source)
For an ordered finite first-stage index, the mean first-stage index is the support-mass-weighted average .
Definition (Lean source)
For an ordered finite first-stage index and a support point, the centered first-stage index at that point is its first-stage score minus the support-mass-weighted mean score.
Definition (Lean source)
For a finite ordered support of size and an adjacent threshold, the upper-tail set contains exactly the support points at or above that threshold.
For an ordered finite first-stage index and an adjacent threshold, the MTW tail coefficient is the sum, over the corresponding upper tail, of each support mass times its centered first-stage index.
Definition (Lean source)
For an adjacent threshold j with the support ordered by the first-stage index, the MTW tail coefficient B_j is nonnegative (def:po-estimand-mtw-tail-coefficients).
Formal statement
Proof (Lean source)
Covariance identity. For an adjacent threshold j, the MTW tail coefficient B_j equals the finite-support covariance between the first-stage index dhat(Z) and the upper-tail indicator 1_{Z ∈ T_j} under the instrument distribution ρ.
Formal statement
Proof (Lean source)
Given a finite instrument support of size , a score-vector dimension , a real mass assigned to each support point, and a real score vector at each support point, the first-stage Gram matrix has entry equal to the mass-weighted sum of the products of score coordinates and .
Finite-support matrix first stage for the source population-2SLS definition. The score vector q, support masses rho, reduced-form first-stage moments firstStageMoment, and invertible Gram matrix determine the projection coefficient by the displayed matrix inverse. The resulting fitted values are required to be in the displayed weakly increasing order so they can feed the MTW tail-coefficient algebra.
Definition (Lean source)
For a finite matrix first-stage specification, the Gram matrix is its mass-weighted second-moment matrix of instrument score vectors.
Definition (Lean source)
For a finite matrix first-stage specification and a score-coordinate index, the population first-stage projection coefficient at that coordinate is the corresponding entry of the inverse Gram matrix times the vector of first-stage moments.
Definition (Lean source)
For a finite matrix first-stage specification and an instrument support point, the fitted first-stage value is the inner product of that point's score vector and the population first-stage projection coefficients.
Definition (Lean source)
For a finite matrix first-stage specification, the ordered finite first-stage index retains its support masses and uses its fitted first-stage values as the ordered score.
Definition (Lean source)
5 supporting declarations (lemmas, instances)
-
supportMass_nonnegtheorem — Support masses obtained from a measure are nonnegative.hypothesesconclusion0 ≤ supportMass μ Z kProof (Lean source)
theorem supportMass_nonneg {Ω : Type*} [MeasurableSpace Ω] {K : ℕ} (μ : Measure Ω) (Z : Ω → Fin K) (k : Fin K) : 0 ≤ supportMass μ Z k := by exact ENNReal.toReal_nonneg -
supportMass_sum_eq_onetheorem — For a probability measure, the finite support masses induced by Z sum to one.Proof (Lean source)
theorem supportMass_sum_eq_one {Ω : Type*} [MeasurableSpace Ω] {K : ℕ} (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Ω → Fin K) (hZ : Measurable Z) : ∑ k : Fin K, supportMass μ Z k = 1 := by have hsum : (Finset.univ).sum (fun k : Fin K => (μ (Z ⁻¹' ({k} : Set (Fin K)))).toReal) = (μ (Z ⁻¹' (Set.univ : Set (Fin K)))).toReal := by simpa [Measure.real] using (MeasureTheory.sum_measureReal_preimage_singleton (μ := μ) (s := (Finset.univ : Finset (Fin K))) (f := Z) (hf := by intro k _hk exact hZ (measurableSet_singleton k)) (h := by intro k _hk exact ne_of_lt <| lt_of_le_of_lt (measure_mono (Set.subset_univ _)) (by simp [IsProbabilityMeasure.measure_univ]))) have hpre : ∀ k : Fin K, ({ω | Z ω = k} : Set Ω) = Z ⁻¹' ({k} : Set (Fin K)) := fun _ => rfl simpa [supportMass, hpre, Set.preimage_univ] using hsum -
centered_weight_sum_zerotheorem — Centering identity Σ_k ρ_k (dhat_k - dbar) = 0.Proof (Lean source)
theorem centered_weight_sum_zero : ∑ k, I.rho k * I.centeredIndex k = 0 := by calc ∑ k, I.rho k * I.centeredIndex k = ∑ k, (I.rho k * I.dhat k - I.rho k * I.meanIndex) := by simp [centeredIndex, sub_eq_add_neg, mul_add] _ = ∑ k, I.rho k * I.dhat k - ∑ k, I.rho k * I.meanIndex := by rw [Finset.sum_sub_distrib] _ = I.meanIndex - I.meanIndex * ∑ k, I.rho k := by simp [meanIndex, Finset.sum_mul, mul_comm] _ = 0 := by simp [I.rho_sum_one] -
tail_sum_interchangetheorem — Finite upper-tail interchange identity used by the signed decomposition. It is the algebraic form of moving from Σ_k ρ_k a_k Σ_{j≤k} x_j to Σ_j B_j x_j.hypothesesProof (Lean source)
theorem tail_sum_interchange (x : Adj K → ℝ) : (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ j : Adj K, if j.1.val ≤ k.val then x j else 0)) = ∑ j : Adj K, I.tailCoeff j * x j := by simp only [tailCoeff, upperTail] calc (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ j : Adj K, if j.1.val ≤ k.val then x j else 0)) = ∑ k : Fin K, ∑ j : Adj K, if j.1.val ≤ k.val then (I.rho k * I.centeredIndex k) * x j else 0 := by simp [Finset.mul_sum, mul_ite, mul_zero, mul_assoc] _ = ∑ j : Adj K, ∑ k : Fin K, if j.1.val ≤ k.val then (I.rho k * I.centeredIndex k) * x j else 0 := by rw [Finset.sum_comm] _ = ∑ j : Adj K, x j * ∑ k : Fin K, if j.1.val ≤ k.val then I.rho k * I.centeredIndex k else 0 := by apply Finset.sum_congr rfl intro j _hj rw [Finset.mul_sum] apply Finset.sum_congr rfl intro k _hk by_cases h : j.1.val ≤ k.val · simp [h, mul_comm] · simp [h] _ = ∑ j : Adj K, (∑ k ∈ Finset.univ.filter fun k => j.1.val ≤ k.val, I.rho k * I.centeredIndex k) * x j := by simp [Finset.sum_filter, mul_comm] -
instInvertibleGraminstance — For a finite matrix first-stage specification, the assertion that its mass-weighted second-moment (Gram) matrix is invertible holds.parametersinstancegiven byby change Invertible (firstStageGram S.rho S.score) exact S.gram_invertible
ResponseTypes 22 core · 6 supporting This file formalizes the finite response-type algebra used in the Mogstad-Torgovitsky-Walters multiple-instrument IV decomposition. ★ beta2SLSPopulationBridge_eq_beta2SLSFiniteAlgebra★ beta2SLSFiniteAlgebra_eq_responseTypeWeightedSum★ beta2SLSFiniteAlgebra_eq_positiveResponseTypeAverage★ exists_negativeNormalizedTypeWeight
Multiple-Instrument IV Response Types
This file formalizes the finite response-type algebra used in the
Mogstad-Torgovitsky-Walters multiple-instrument IV decomposition. The basic
objects are ResponseType, typeStep, ResponseTypeStats, the unnormalized
and normalized weights unnormTypeWeight and normalizedTypeWeight, and the
finite ratio beta2SLSFiniteAlgebra.
The nested PopulationBridge structure gives a saturated finite-support
bridge from support-point outcome and treatment expansions to the response-type
ratio. Theorems firstStageMoment_eq_typeWeightDenom,
reducedFormMoment_eq_typeWeightNumerator, and
beta2SLSPopulationBridge_eq_beta2SLSFiniteAlgebra prove the algebraic
identification step. The sign-alignment results
normalizedTypeWeight_nonneg_of_signAligned,
normalizedTypeWeight_sum_eq_one_of_pos, and
beta2SLSFiniteAlgebra_eq_positiveResponseTypeAverage explain when the ratio
is a convex response-type average, while exists_negativeNormalizedTypeWeight
gives a concrete two-support-point counterexample with a negative normalized
weight.
The ComponentwiseMonotoneRestriction structure is intentionally documented as
an opaque interface, not a faithful formalization of MTW partial monotonicity.
For a finite instrument support of size , a response type is a binary treatment response specified for every instrument support point.
For a binary treatment indicator, the real-valued treatment indicator equals one for treatment and zero otherwise.
Definition (Lean source)
For a finite instrument support of size , a response type, and an adjacent threshold, the adjacent treatment-response increment is the real-valued treatment response at the upper support point minus that at the preceding point.
Definition (Lean source)
Finite response-type statistics. For a finite family of latent response types, this records the probability mass of each type and the type-specific average causal effect Δ_g, subject to every mass being nonnegative and the masses summing to one, so together they form a probability vector over response types.
Definition (Lean source)
For an ordered finite first-stage index, finite response-type statistics, and a response type, the unnormalized MTW response-type weight is that type's mass times the sum of each tail coefficient times its adjacent treatment-response increment.
Definition (Lean source)
For an ordered finite first-stage index and finite response-type statistics, the response-type weight denominator is the sum of the unnormalized weights over all response types.
Definition (Lean source)
For an ordered finite first-stage index, finite response-type statistics, and a response type, the normalized response-type weight is that type's unnormalized weight divided by the sum of all unnormalized weights.
Definition (Lean source)
For an ordered finite first-stage index and finite response-type statistics, the response-type estimand is the sum of each within-type causal effect weighted by its normalized response-type weight.
Definition (Lean source)
For an ordered finite first-stage index and finite response-type statistics, the finite-algebra 2SLS estimand is the unnormalized response-type-weighted sum of causal effects divided by the sum of unnormalized response-type weights.
Definition (Lean source)
Saturated finite-support population bridge for the MTW identification step. Bundles a finite response-type statistics record supplying the type masses and type-specific effects together with a response-type-specific baseline outcome mean, the term the centered first-stage index cancels, leaving the telescoped adjacent treatment increments used by the finite algebra.
Definition (Lean source)
For a finite instrument support of size , a response type, and a support point, the telescoped adjacent treatment response is the sum of that type's adjacent treatment-response increments from the first support point through that point.
Definition (Lean source)
For a finite instrument support of size , a saturated finite-support population bridge, and a support point, the response-type outcome expansion is the baseline outcome plus the response-type-mass-weighted sum of within-type effects times telescoped treatment responses.
Definition (Lean source)
For a finite instrument support of size , a saturated finite-support population bridge, and a support point, the response-type treatment expansion is the response-type-mass-weighted sum of telescoped treatment responses at that point.
Definition (Lean source)
For a finite instrument support of size , a saturated finite-support population bridge, and an ordered finite first-stage index, the population reduced-form moment is the support-mass-weighted sum of centered first-stage indices times response-type outcome expansions.
Definition (Lean source)
For a finite instrument support of size , a saturated finite-support population bridge, and an ordered finite first-stage index, the population first-stage moment is the support-mass-weighted sum of centered first-stage indices times response-type treatment expansions.
Definition (Lean source)
For a finite instrument support of size , a saturated finite-support population bridge, and an ordered finite first-stage index, the population multiple-IV 2SLS ratio is its reduced-form moment divided by its first-stage moment.
Definition (Lean source)
Saturated finite-support MTW identification. The population 2SLS ratio E[h(Z)Y] / E[h(Z)D], after consistency, exogeneity, exclusion, and telescoping, is exactly the finite response-type ratio.
Formal statement
Proof (Lean source)
For an ordered finite first-stage index and finite response-type statistics, sign alignment means that every response type with strictly positive mass has a nonnegative tail-coefficient-weighted sum of adjacent treatment-response increments.
Definition (Lean source)
Opaque response-type restriction interface.
Definition (Lean source)
Response-type form of the finite MTW ratio (prop:po-estimand-mtw-response-type-form). Provided the first-stage type-weight denominator is nonzero, the finite-algebra 2SLS estimand equals the response-type-weighted sum of within-type causal effects.
Formal statement
Proof (Lean source)
Positive-weight response-type characterization. When the response types are sign-aligned with the instrument order and the first-stage type-weight denominator is strictly positive, the finite-algebra 2SLS estimand equals the response-type estimand, every normalized response-type weight is nonnegative, and the weights sum to one.
Formal statement
Proof (Lean source)
Negative-weights theorem. There exists a finite-support instrument index, a response-type population, and a response type such that, with two support points and a 3/4-defier population, that type has positive mass yet a negative normalized response-type weight (equal to −1/2).
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
baselineMoment_eq_zerotheorem — The baseline outcome component vanishes because the first-stage index is centered.hypothesesconclusion(∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * P.baseOutcome g))= 0Proof (Lean source)
theorem baselineMoment_eq_zero : (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * P.baseOutcome g)) = 0 := by calc (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * P.baseOutcome g)) = (∑ k : Fin K, I.rho k * I.centeredIndex k) * (∑ g : ResponseType K, P.stats.mass g * P.baseOutcome g) := by rw [Finset.sum_mul] _ = 0 := by rw [I.centered_weight_sum_zero] simp -
firstStageMoment_eq_typeWeightDenomtheorem — The finite-support first-stage moment is the response-type denominator. This is the denominator half of the MTW identification step.hypothesesconclusionP.firstStageMoment I = P.stats.typeWeightDenom IProof (Lean source)
theorem firstStageMoment_eq_typeWeightDenom : P.firstStageMoment I = P.stats.typeWeightDenom I := by classical unfold firstStageMoment treatmentAtSupport telescopedTypeStep ResponseTypeStats.typeWeightDenom ResponseTypeStats.unnormTypeWeight calc (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0))) = ∑ k : Fin K, ∑ g : ResponseType K, I.rho k * I.centeredIndex k * (P.stats.mass g * (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0)) := by apply Finset.sum_congr rfl intro k _hk rw [Finset.mul_sum] _ = ∑ g : ResponseType K, ∑ k : Fin K, I.rho k * I.centeredIndex k * (P.stats.mass g * (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0)) := by rw [Finset.sum_comm] _ = ∑ g : ResponseType K, P.stats.mass g * (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0)) := by apply Finset.sum_congr rfl intro g _hg rw [Finset.mul_sum] apply Finset.sum_congr rfl intro k _hk ring _ = ∑ g : ResponseType K, P.stats.mass g * (∑ j : Adj K, I.tailCoeff j * typeStep g j) := by apply Finset.sum_congr rfl intro g _hg rw [I.tail_sum_interchange (fun j => typeStep g j)] -
reducedFormMoment_eq_typeWeightNumeratortheorem — The finite-support reduced-form moment is the response-type numerator. This is the numerator half of the MTW identification step.hypothesesconclusionP.reducedFormMoment I= ∑ g : ResponseType K, P.stats.unnormTypeWeight I g * P.stats.effect gProof (Lean source)
theorem reducedFormMoment_eq_typeWeightNumerator : P.reducedFormMoment I = ∑ g : ResponseType K, P.stats.unnormTypeWeight I g * P.stats.effect g := by classical unfold reducedFormMoment outcomeAtSupport telescopedTypeStep ResponseTypeStats.unnormTypeWeight calc (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * (P.baseOutcome g + (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0) * P.stats.effect g))) = (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * P.baseOutcome g)) + ∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * ((∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0) * P.stats.effect g)) := by simp only [mul_add, Finset.sum_add_distrib] _ = ∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ g : ResponseType K, P.stats.mass g * ((∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0) * P.stats.effect g)) := by rw [P.baselineMoment_eq_zero I] simp _ = ∑ k : Fin K, ∑ g : ResponseType K, I.rho k * I.centeredIndex k * (P.stats.mass g * ((∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0) * P.stats.effect g)) := by apply Finset.sum_congr rfl intro k _hk rw [Finset.mul_sum] _ = ∑ g : ResponseType K, ∑ k : Fin K, I.rho k * I.centeredIndex k * (P.stats.mass g * ((∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0) * P.stats.effect g)) := by rw [Finset.sum_comm] _ = ∑ g : ResponseType K, P.stats.mass g * (∑ k : Fin K, I.rho k * I.centeredIndex k * (∑ j : Adj K, if j.1.val ≤ k.val then typeStep g j else 0)) * P.stats.effect g := by apply Finset.sum_congr rfl intro g _hg simp [Finset.mul_sum, mul_assoc, mul_comm, mul_left_comm] _ = ∑ g : ResponseType K, (P.stats.mass g * (∑ j : Adj K, I.tailCoeff j * typeStep g j)) * P.stats.effect g := by apply Finset.sum_congr rfl intro g _hg rw [I.tail_sum_interchange (fun j => typeStep g j)] -
unnormTypeWeight_nonneg_of_signAlignedtheorem — Sign alignment and nonnegative type masses imply nonnegative unnormalized response-type weights.hypothesesK :sharedℕhAlign :R.SignAligned Ig :conclusion0 ≤ R.unnormTypeWeight I gProof (Lean source)
theorem unnormTypeWeight_nonneg_of_signAligned (hAlign : R.SignAligned I) (g : ResponseType K) : 0 ≤ R.unnormTypeWeight I g := by unfold unnormTypeWeight by_cases hpos : 0 < R.mass g · exact mul_nonneg (R.mass_nonneg g) (hAlign g hpos) · have hle : R.mass g ≤ 0 := le_of_not_gt hpos have hmass : R.mass g = 0 := le_antisymm hle (R.mass_nonneg g) simp [hmass] -
normalizedTypeWeight_nonneg_of_signAlignedtheorem — Normalized response-type weights are nonnegative when sign alignment holds and the denominator is positive (prop:po-estimand-mtw-positive-weights).hypothesesK :sharedℕhAlign :R.SignAligned Ihden :0 < R.typeWeightDenom Ig :conclusion0 ≤ R.normalizedTypeWeight I gProof (Lean source)
theorem normalizedTypeWeight_nonneg_of_signAligned (hAlign : R.SignAligned I) (hden : 0 < R.typeWeightDenom I) (g : ResponseType K) : 0 ≤ R.normalizedTypeWeight I g := by exact normalizedWeight_nonneg (R.unnormTypeWeight I) (R.unnormTypeWeight_nonneg_of_signAligned I hAlign) hden g -
normalizedTypeWeight_sum_eq_one_of_postheorem — Normalized response-type weights sum to one when the first-stage denominator is positive.hypothesesconclusion∑ g : ResponseType K, R.normalizedTypeWeight I g = 1Proof (Lean source)
theorem normalizedTypeWeight_sum_eq_one_of_pos (hden : 0 < R.typeWeightDenom I) : ∑ g : ResponseType K, R.normalizedTypeWeight I g = 1 := by exact sum_normalizedWeight_eq_one (R.unnormTypeWeight I) hden.ne'
Population 6 core · 5 supporting This file connects the observed population two-stage least squares moment ratio for a finite instrument to the response-type finite algebra. ★ observedBeta2SLS_eq_beta2SLSFiniteAlgebra
Multiple-Instrument IV Population Bridge
This file connects the observed population two-stage least squares moment
ratio for a finite instrument to the response-type finite algebra. It defines
the observed moments observedReducedFormMoment, observedFirstStageMoment,
and observedBeta2SLS; rewrites the first two as finite sums over instrument
cells; and packages the assumptions needed for the measure-backed bridge in
ObservedBridge.
The main results are ObservedBridge.observedReducedFormMoment_eq_reducedFormMoment,
ObservedBridge.observedFirstStageMoment_eq_firstStageMoment,
ObservedBridge.observedBeta2SLS_eq_beta2SLSPopulationBridge, and the
end-to-end theorem ObservedBridge.observedBeta2SLS_eq_beta2SLSFiniteAlgebra.
They show that the observable population ratio E[h(Z)Y] / E[h(Z)D] agrees
with the saturated response-type algebra once the observed conditional means
are linked to the finite response-type bridge.
For a sample space, a finite instrument support of size , an instrument on that sample space, and a support point, the instrument cell is the set of units whose instrument equals that point.
Given a measurable sample space, a finite instrument support of size , a measure, an instrument, a real outcome, and an ordered finite first-stage index, the observed reduced-form moment is the integral of the centered first-stage index evaluated at the instrument times the outcome.
Definition (Lean source)
Given a measurable sample space, a finite instrument support of size , a measure, an instrument, a binary treatment, and an ordered finite first-stage index, the observed first-stage moment is the integral of the centered first-stage index evaluated at the instrument times the zero-one treatment indicator.
Definition (Lean source)
Given a measurable sample space, a finite instrument support of size , a measure, an instrument, a binary treatment, a real outcome, and an ordered finite first-stage index, the observed population 2SLS ratio is the observed reduced-form moment divided by the observed first-stage moment.
Definition (Lean source)
Bridge from an observed finite-instrument population to the response-type algebra. Given an instrument, a binary treatment, an outcome, a finite index, and a saturated response-type population P, this bundles the underlying law being a probability measure, the finite-index masses reproducing the probabilities of the observed instrument cells, the observed conditional mean of the outcome on each instrument cell equaling the response-type expansion P.outcomeAtSupport, a baseline treatment mean common across cells after exogeneity, and the observed conditional mean of the treatment on each instrument cell equaling that common baseline plus the response-type expansion P.treatmentAtSupport.
Definition (Lean source)
End-to-end bridge to the finite response-type algebra. Given a bridge B linking the observed data to the response-type population, provided the instrument is measurable, the centered-instrument-weighted outcome is integrable, and the centered-instrument-weighted treatment is integrable, the observed population 2SLS ratio E[h(Z)Y] / E[h(Z)D] equals the finite response-type algebra estimand beta2SLSFiniteAlgebra.
Formal statement
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
observedReducedFormMoment_eq_sum_eventCondExptheorem — Finite-support total-law rewrite of E[h(Z)Y] into instrument-cell conditional expectations.hypothesesΩ :sharedType u_1K :sharedℕμ :Z :Ω → Fin KhZ :Y :Ω → ℝI :hInt :Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μconclusionobservedReducedFormMoment μ Z Y IProof (Lean source)
theorem observedReducedFormMoment_eq_sum_eventCondExp (μ : Measure Ω) [IsFiniteMeasure μ] (Z : Ω → Fin K) (hZ : Measurable Z) (Y : Ω → ℝ) (I : FiniteIndex K) (hInt : Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μ) : observedReducedFormMoment μ Z Y I = ∑ k : Fin K, (μ (zEvent Z k)).toReal * I.centeredIndex k * PO.eventCondExp μ (zEvent Z k) Y := by unfold observedReducedFormMoment rw [PO.integral_eq_sum_measure_mul_eventCondExp (μ := μ) (A := zEvent Z) (hmeas := zEvent_measurable Z hZ) (hdisj := zEvent_pairwise_disjoint Z) (hcov := zEvent_iUnion Z) (f := fun ω => I.centeredIndex (Z ω) * Y ω) hInt] refine Finset.sum_congr rfl ?_ intro k _hk rw [eventCondExp_centered_mul_eq μ Z hZ Y I k] ring -
observedFirstStageMoment_eq_sum_eventCondExptheorem — Finite-support total-law rewrite of E[h(Z)D] into instrument-cell conditional expectations.hypothesesΩ :sharedType u_1K :sharedℕμ :Z :Ω → Fin KhZ :D :Ω → BoolI :hInt :Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μconclusionobservedFirstStageMoment μ Z D IProof (Lean source)
theorem observedFirstStageMoment_eq_sum_eventCondExp (μ : Measure Ω) [IsFiniteMeasure μ] (Z : Ω → Fin K) (hZ : Measurable Z) (D : Ω → Bool) (I : FiniteIndex K) (hInt : Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μ) : observedFirstStageMoment μ Z D I = ∑ k : Fin K, (μ (zEvent Z k)).toReal * I.centeredIndex k * PO.eventCondExp μ (zEvent Z k) (fun ω => boolToReal (D ω)) := by exact observedReducedFormMoment_eq_sum_eventCondExp (μ := μ) (Z := Z) hZ (Y := fun ω => boolToReal (D ω)) I hInt -
observedReducedFormMoment_eq_reducedFormMomenttheorem — The observed reduced-form moment equals the finite response-type reduced-form moment.hypothesesΩ :sharedType u_1K :sharedℕY :sharedΩ → ℝB :ObservedBridge μ Z D Y I PhZ :hInt :Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μconclusionobservedReducedFormMoment μ Z Y I = P.reducedFormMoment IProof (Lean source)
theorem observedReducedFormMoment_eq_reducedFormMoment (B : ObservedBridge μ Z D Y I P) [IsFiniteMeasure μ] (hZ : Measurable Z) (hInt : Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μ) : observedReducedFormMoment μ Z Y I = P.reducedFormMoment I := by rw [observedReducedFormMoment_eq_sum_eventCondExp μ Z hZ Y I hInt] unfold reducedFormMoment refine Finset.sum_congr rfl ?_ intro k _hk rw [← B.rho_eq_zMass k, B.outcome_cell k] -
observedFirstStageMoment_eq_firstStageMomenttheorem — The observed first-stage moment equals the finite response-type first-stage moment.hypothesesΩ :sharedType u_1K :sharedℕY :sharedΩ → ℝB :ObservedBridge μ Z D Y I PhZ :hInt :Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μconclusionobservedFirstStageMoment μ Z D I = P.firstStageMoment IProof (Lean source)
theorem observedFirstStageMoment_eq_firstStageMoment (B : ObservedBridge μ Z D Y I P) [IsFiniteMeasure μ] (hZ : Measurable Z) (hInt : Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μ) : observedFirstStageMoment μ Z D I = P.firstStageMoment I := by rw [observedFirstStageMoment_eq_sum_eventCondExp μ Z hZ D I hInt] unfold firstStageMoment calc (∑ k : Fin K, (μ (zEvent Z k)).toReal * I.centeredIndex k * PO.eventCondExp μ (zEvent Z k) (fun ω => boolToReal (D ω))) = ∑ k : Fin K, I.rho k * I.centeredIndex k * (B.baseTreatment + P.treatmentAtSupport k) := by refine Finset.sum_congr rfl ?_ intro k _hk rw [← B.rho_eq_zMass k, B.treatment_cell k] _ = (∑ k : Fin K, I.rho k * I.centeredIndex k) * B.baseTreatment + ∑ k : Fin K, I.rho k * I.centeredIndex k * P.treatmentAtSupport k := by calc (∑ k : Fin K, I.rho k * I.centeredIndex k * (B.baseTreatment + P.treatmentAtSupport k)) = ∑ k : Fin K, (I.rho k * I.centeredIndex k * B.baseTreatment + I.rho k * I.centeredIndex k * P.treatmentAtSupport k) := by refine Finset.sum_congr rfl ?_ intro k _hk ring _ = (∑ k : Fin K, I.rho k * I.centeredIndex k * B.baseTreatment) + ∑ k : Fin K, I.rho k * I.centeredIndex k * P.treatmentAtSupport k := by rw [Finset.sum_add_distrib] _ = (∑ k : Fin K, I.rho k * I.centeredIndex k) * B.baseTreatment + ∑ k : Fin K, I.rho k * I.centeredIndex k * P.treatmentAtSupport k := by rw [Finset.sum_mul] _ = ∑ k : Fin K, I.rho k * I.centeredIndex k * P.treatmentAtSupport k := by rw [I.centered_weight_sum_zero] simp -
observedBeta2SLS_eq_beta2SLSPopulationBridgetheorem — Observed population 2SLS, written as E[h(Z)Y]/E[h(Z)D], equals the saturated finite-support population bridge ratio.hypothesesΩ :sharedType u_1K :sharedℕY :sharedΩ → ℝB :ObservedBridge μ Z D Y I PhZ :hYInt :Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μhDInt :Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μconclusionobservedBeta2SLS μ Z D Y I = P.beta2SLSPopulationBridge IProof (Lean source)
theorem observedBeta2SLS_eq_beta2SLSPopulationBridge (B : ObservedBridge μ Z D Y I P) [IsFiniteMeasure μ] (hZ : Measurable Z) (hYInt : Integrable (fun ω => I.centeredIndex (Z ω) * Y ω) μ) (hDInt : Integrable (fun ω => I.centeredIndex (Z ω) * boolToReal (D ω)) μ) : observedBeta2SLS μ Z D Y I = P.beta2SLSPopulationBridge I := by unfold observedBeta2SLS beta2SLSPopulationBridge rw [B.observedReducedFormMoment_eq_reducedFormMoment hZ hYInt, B.observedFirstStageMoment_eq_firstStageMoment hZ hDInt]
Main 7 core · 2 supporting This file provides the public finite-support facade for the Mogstad-Torgovitsky-Walters multiple-instrument characterization. ★ beta2SLSFiniteAlgebra_eq_signedAdjacentRatio★ beta2SLSPopulationBridge_eq_signedAdjacentRatio★ beta2SLSPopulationBridge_eq_responseTypeWeightedSum★ beta2SLSPopulationBridge_eq_positiveResponseTypeAverage★ observedBeta2SLS_eq_responseTypeWeightedSum
Multiple-Instrument IV Main Facade
This file provides the public finite-support facade for the Mogstad-Torgovitsky-Walters multiple-instrument characterization. It exposes the signed adjacent ratio, the response-type weighted-sum form, positivity under sign alignment, and the corresponding population bridge statements.
For an ordered finite first-stage index and finite response-type statistics, the signed adjacent reduced-form numerator is the sum of each within-type causal effect multiplied by its unnormalized response-type weight.
Definition (Lean source)
For an ordered finite first-stage index and finite response-type statistics, the signed adjacent first-stage denominator is the sum of all unnormalized response-type weights.
Definition (Lean source)
Finite response-type ratio as signed adjacent ratio. Provided the signed adjacent first-stage denominator is nonzero, the finite-algebra MTW estimand beta2SLSFiniteAlgebra equals the signed adjacent numerator Σ_g λ_g Δ_g divided by the signed adjacent denominator Σ_g λ_g.
Formal statement
Proof (Lean source)
Signed adjacent ratio form (population bridge). Provided the signed adjacent first-stage denominator is nonzero, the population- bridge 2SLS estimand equals the signed adjacent numerator divided by the signed adjacent denominator.
Formal statement
Proof (Lean source)
Response-type weighted-sum form (population bridge). Provided the first-stage type-weight denominator is nonzero, the population- bridge 2SLS estimand equals the response-type-weighted sum Σ_g ω_g Δ_g of within-type causal effects.
Formal statement
Proof (Lean source)
Positive response-type average (population bridge). When the response types are sign-aligned with the instrument order and the first-stage type-weight denominator is strictly positive, the population-bridge 2SLS estimand beta2SLSPopulationBridge equals the response-type estimand, its normalized response-type weights are all nonnegative, and those weights sum to one.
Formal statement
Proof (Lean source)
End-to-end corollary (prop:po-estimand-mtw-response-type-form, observed level). Given a bridge B linking the data-generating instrument, treatment, and outcome to the response-type population, provided the instrument is measurable, the centered-instrument-weighted outcome is integrable, the centered-instrument-weighted treatment is integrable, and the observed first-stage moment observedFirstStageMoment μ Z D I is nonzero, the observed population 2SLS ratio equals the response-type weighted sum of within-type causal effects.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
beta2SLSFiniteAlgebra_eq_responseTypeWeightedSum'theorem — Response-type weighted-sum form of the finite MTW algebra (prop:po-estimand-mtw-response-type-form, finite algebra layer).hypothesesconclusionR.beta2SLSFiniteAlgebra I = R.responseTypeEstimand IProof (Lean source)
theorem beta2SLSFiniteAlgebra_eq_responseTypeWeightedSum' (hden : R.typeWeightDenom I ≠ 0) : R.beta2SLSFiniteAlgebra I = R.responseTypeEstimand I := by exact R.beta2SLSFiniteAlgebra_eq_responseTypeWeightedSum I hden -
beta2SLSFiniteAlgebra_eq_positiveResponseTypeAverage'theorem — Positive response-type average under MTW sign alignment and a positive finite first-stage denominator (prop:po-estimand-mtw-positive-weights, finite algebra layer).hypothesesK :sharedℕhAlign :R.SignAligned Ihden :0 < R.typeWeightDenom Iconclusionconclusion 1R.beta2SLSFiniteAlgebra I = R.responseTypeEstimand Iconclusion 3∑ g : ResponseType K, R.normalizedTypeWeight I g = 1Proof (Lean source)
theorem beta2SLSFiniteAlgebra_eq_positiveResponseTypeAverage' (hAlign : R.SignAligned I) (hden : 0 < R.typeWeightDenom I) : R.beta2SLSFiniteAlgebra I = R.responseTypeEstimand I ∧ (∀ g : ResponseType K, 0 ≤ R.normalizedTypeWeight I g) ∧ (∑ g : ResponseType K, R.normalizedTypeWeight I g = 1) := by exact R.beta2SLSFiniteAlgebra_eq_positiveResponseTypeAverage I hAlign hden
POBridge 27 core · 24 supporting This file grounds the MTW multiple-instrument finite algebra in a potential-outcome system. ★ POMultipleIVSystem★ observedBeta2SLS_eq_responseTypeWeightedSum
Multiple-Instrument IV Potential-Outcome Bridge
This file grounds the MTW multiple-instrument finite algebra in a
potential-outcome system. The structure POMultipleIVSystem records a finite
instrument, binary treatment, and real outcome; responseType, mass,
effect, toStats, and toPopulationBridge turn its counterfactual response
types into the finite response-type algebra.
The bridge lemmas treatmentDrop and outcomeDrop derive instrument-cell
conditional means from consistency and instrument independence. The definitions
toObservedBridge and theorem
observedBeta2SLS_eq_responseTypeWeightedSum assemble those derived cell
identities into the observed MTW 2SLS characterization.
Multiple-instrument IV potential-outcome subsystem. Inside a potential-outcome system, this bundles a node serving as the instrument, taking values in a finite support of size K, a node serving as the binary treatment, and a node serving as the real-valued outcome, subject to the instrument, treatment, and outcome being pairwise distinct nodes. This is the Fin K generalization of PO.POIVSystem.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the instrument variable is that subsystem's instrument represented as a potential-outcome variable with the stated finite support.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the treatment variable is that subsystem's binary treatment represented as a potential-outcome variable.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the outcome variable is that subsystem's real-valued outcome represented as a potential-outcome variable.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and an instrument support point, the potential treatment maps each unit to its binary treatment were the instrument fixed at that point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and a binary treatment value, the potential outcome maps each unit to its real outcome were treatment fixed at that value.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the factual instrument maps each unit to its observed instrument value.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the factual treatment maps each unit to its observed binary treatment.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the factual outcome maps each unit to its observed real-valued outcome.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the response-type map assigns each unit the binary vector of its potential treatments at every instrument support point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and a response type, the response-type event is the set of units whose vector of potential treatments equals that response type.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and an instrument support point, the instrument cell is the set of units whose factual instrument equals that point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and an instrument support point, the potential outcome under the induced treatment gives each unit's treated potential outcome if that instrument point induces treatment and its untreated potential outcome otherwise.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and an instrument support point, the regimed treatment variable represents treatment under an intervention fixing the instrument at that point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and a binary treatment value, the regimed outcome variable represents outcome under an intervention fixing treatment at that value.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and an instrument support point, the counterfactual cell bundles the potential treatment at that point with the treated and untreated potential outcomes.
Definition (Lean source)
Classical multi-instrument IV assumption bundle (ass:po-estimand-mtw-iv-validity). For a multiple-instrument potential-outcome subsystem, this packages the observed treatment and outcome equaling the potential treatment and outcome realized under the actual instrument value (SUTVA), and at each instrument support point, the instrument being independent of the counterfactual triple consisting of the potential treatment under that instrument value together with the two treatment-arm potential outcomes (IV exogeneity).
Definition (Lean source)
Consistency (SUTVA): observed D/Y equal the realized potential
treatment/outcome.
Instrument independence (IV exogeneity): for each support point, the
instrument is independent of the counterfactual cell (D(zᵏ), Y(1), Y(0)).
This is implied by (and weaker than) full joint independence of Z from all
potential outcomes; it is exactly what the cell-conditional-mean derivations
below consume.
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and a response type, the response-type mass is the probability that a unit has that response type.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, and a response type, the within-type causal effect is the conditional expectation of the treated-minus-untreated potential outcome among units of that type.
Definition (Lean source)
For a potential-outcome system, a finite instrument support size , a multiple-instrument IV subsystem, and the condition , the reference support point is the first point of the support.
Definition (Lean source)
For a potential-outcome system, a finite instrument support size , a multiple-instrument IV subsystem, the condition , and a response type, the baseline response-type outcome is the conditional expectation, within that type, of the potential outcome under treatment induced by the first instrument support point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support size , a multiple-instrument IV subsystem, and the condition , the baseline treatment mean is the expectation of treatment induced by the first instrument support point.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , and a multiple-instrument IV subsystem, the finite response-type statistics consist of the subsystem's response-type masses and within-type causal effects.
Definition (Lean source)
For a potential-outcome system, a finite instrument support size , a multiple-instrument IV subsystem, and the condition , the saturated finite-support population bridge is assembled from its response-type statistics and baseline quantities.
Definition (Lean source)
For a potential-outcome system, a finite instrument support of size , a multiple-instrument IV subsystem, a real first-stage score at each support point, and the condition that this score is weakly increasing in support order, the ordered finite first-stage index has the subsystem's instrument probabilities and the supplied score.
For a potential-outcome system, a finite instrument support size , a multiple-instrument IV subsystem, the condition , its IV assumptions, a real first-stage score, weak monotonicity of that score in support order, positive probability for every instrument cell, and integrable treated and untreated potential outcomes, the observed population bridge links factual variables to the finite response-type representation.
Definition (Lean source)
Potential-outcome multiple-IV 2SLS characterization (prop:po-estimand-mtw-response-type-form, PO level). Consider a finite instrument support of positive size K together with weights dhat that are weakly increasing in the support order, under the potential-outcome identifying assumption bundle. If every instrument-support cell has positive probability, the potential outcome under treatment and under control are integrable, the centered-instrument-weighted outcome and treatment are integrable, and the observed first-stage moment is nonzero, then the observed population 2SLS ratio E[h(Z)Y] / E[h(Z)D] equals the response-type weighted sum Σ_g ω_g Δ_g of within-type conditional causal effects Δ_g = E[Y(1) - Y(0) | G = g].
Formal statement
Proof (Lean source)
24 supporting declarations (lemmas, instances)
-
YofDofZ_deflemma — The potential outcome under the treatment that an instrument value induces sends a unit to that unit's treated potential outcome when the induced treatment is one, and to its untreated potential outcome otherwise.hypotheses -
measurable_DofZlemma — The potential treatment under any instrument support point is measurable.hypothesesconclusionMeasurable (S.DofZ k)Proof (Lean source)
@[fun_prop] lemma measurable_DofZ (k : Fin K) : Measurable (S.DofZ k) := S.dVar.measurable_cfUnder S.zVar k -
measurable_YofDlemma — The potential outcome under either treatment arm is measurable.hypothesesconclusionMeasurable (S.YofD d)Proof (Lean source)
@[fun_prop] lemma measurable_YofD (d : Bool) : Measurable (S.YofD d) := S.yVar.measurable_cfUnder S.dVar d -
measurable_factualZlemma — The factual instrument value is measurable.hypothesesconclusionMeasurable S.factualZProof (Lean source)
@[fun_prop] lemma measurable_factualZ : Measurable S.factualZ := S.zVar.measurable_factual -
measurable_factualDlemma — The factual treatment value is measurable.hypothesesconclusionMeasurable S.factualDProof (Lean source)
@[fun_prop] lemma measurable_factualD : Measurable S.factualD := S.dVar.measurable_factual -
measurable_factualYlemma — The factual outcome value is measurable.hypothesesconclusionMeasurable S.factualYProof (Lean source)
@[fun_prop] lemma measurable_factualY : Measurable S.factualY := S.yVar.measurable_factual -
measurable_responseTypelemma — The response-type map collecting all treatment responses is measurable.hypothesesconclusionMeasurable S.responseTypeProof (Lean source)
@[fun_prop] lemma measurable_responseType : Measurable S.responseType := measurable_pi_lambda _ (fun k => S.measurable_DofZ k) -
measurableSet_gEventlemma — Each response-type cell is measurable.hypothesesconclusionMeasurableSet (S.gEvent g)Proof (Lean source)
lemma measurableSet_gEvent (g : ResponseType K) : MeasurableSet (S.gEvent g) := S.measurable_responseType (measurableSet_singleton g) -
measurableSet_zEventlemma — Each instrument support cell is measurable.hypothesesconclusionMeasurableSet (S.zEvent k)Proof (Lean source)
lemma measurableSet_zEvent (k : Fin K) : MeasurableSet (S.zEvent k) := S.zVar.measurableSet_event k (measurableSet_singleton k) -
measurable_YofDofZlemma — The outcome under the treatment induced by an instrument support point is measurable.hypothesesconclusionMeasurable (S.YofDofZ k)Proof (Lean source)
@[fun_prop] lemma measurable_YofDofZ (k : Fin K) : Measurable (S.YofDofZ k) := by unfold YofDofZ exact Measurable.ite (S.measurable_DofZ k (MeasurableSet.singleton true)) (S.measurable_YofD true) (S.measurable_YofD false) -
DofZ_eq_factualD_on_zEventlemma — On {Z = zᵏ}, the counterfactual treatment D(zᵏ) equals the factual D.hypothesesconclusionS.DofZ k ω = S.factualD ωProof (Lean source)
lemma DofZ_eq_factualD_on_zEvent (hA : S.Assumptions) (k : Fin K) {ω : P.Ω} (hω : ω ∈ S.zEvent k) : S.DofZ k ω = S.factualD ω := POVar.cf_eq_factual_on_event hA.consistency S.dVar S.zVar k S.hZD.symm hω -
factualY_eq_YofD_factualDlemma — Factual Y equals Y(factualD) pointwise.hypothesesconclusionS.factualY ω = S.YofD (S.factualD ω) ωProof (Lean source)
lemma factualY_eq_YofD_factualD (hA : S.Assumptions) (ω : P.Ω) : S.factualY ω = S.YofD (S.factualD ω) ω := POVar.factual_eq_cfUnder_self_selected hA.consistency S.yVar S.dVar S.hDY.symm ω -
DofZ_eq_on_gEventlemma — On {G = g}, the potential treatment D(zᵏ) is the constant g k.Proof (Lean source)
lemma DofZ_eq_on_gEvent (g : ResponseType K) (k : Fin K) {ω : P.Ω} (hω : ω ∈ S.gEvent g) : S.DofZ k ω = g k := by have : S.responseType ω = g := hω calc S.DofZ k ω = S.responseType ω k := rfl _ = g k := by rw [this] -
treatmentDroptheorem — E[D | Z = zᵏ] = E[D(zᵏ)] (0/1-coded).hypothesesconclusioneventCondExp P.μ (S.zEvent k) (fun ω => boolToReal (S.factualD ω))= ∫ ω, boolToReal (S.DofZ k ω) ∂P.μProof (Lean source)
theorem treatmentDrop [IsFiniteMeasure P.μ] (hA : S.Assumptions) (k : Fin K) (hZk : P.μ (S.zEvent k) ≠ 0) : eventCondExp P.μ (S.zEvent k) (fun ω => boolToReal (S.factualD ω)) = ∫ ω, boolToReal (S.DofZ k ω) ∂P.μ := by let h_proj : (∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i) → ℝ := fun f => boolToReal ((f (0 : Fin 3)) : Bool) have hh_meas : Measurable h_proj := by -- Instance search no longer unfolds `cfCell` to see `n = 3`, so supply the -- coordinate measurable-space family at index type `Fin 3` directly. let _ : ∀ i : Fin 3, MeasurableSpace ((S.cfCell k).type i) := fun i => (S.cfCell k).inst i change Measurable fun f : ∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i => boolToReal ((f (0 : Fin 3)) : Bool) exact (by fun_prop : Measurable fun b : Bool => boolToReal b).comp (measurable_pi_apply (0 : Fin 3)) have hF_eq : ∀ ω ∈ S.zVar.event k, boolToReal (S.factualD ω) = h_proj ((S.cfCell k).jointValue ω) := by intro ω hω rw [← S.DofZ_eq_factualD_on_zEvent hA k hω] dsimp [h_proj] have hJV0 : ((S.cfCell k).jointValue ω (0 : Fin 3) : Bool) = S.DofZ k ω := rfl rw [hJV0] change eventCondExp P.μ (S.zVar.event k) (fun ω => boolToReal (S.factualD ω)) = ∫ ω, boolToReal (S.DofZ k ω) ∂P.μ rw [POSystem.eventCondExp_of_consistency_IndepCF (hA.instrumentIndep k) (a := S.zVar) hh_meas (measurableSet_singleton k) (ae_restrict_of_forall_mem (μ := P.μ) (S.measurableSet_zEvent k) hF_eq) hZk (measure_ne_top _ _)] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω dsimp [h_proj] have hJV0 : ((S.cfCell k).jointValue ω (0 : Fin 3) : Bool) = S.DofZ k ω := rfl rw [hJV0] -
outcomeDroptheorem — E[Y | Z = zᵏ] = E[Y(D(zᵏ))].hypothesesK :sharedℕIsFiniteMeasure P.μhA :S.Assumptionsk :Fin KhZk :P.μ (S.zEvent k) ≠ 0hY1 :Integrable (S.YofD true) P.μhY0 :Integrable (S.YofD false) P.μconclusioneventCondExp P.μ (S.zEvent k) S.factualY = ∫ ω, S.YofDofZ k ω ∂P.μProof (Lean source)
theorem outcomeDrop [IsFiniteMeasure P.μ] (hA : S.Assumptions) (k : Fin K) (hZk : P.μ (S.zEvent k) ≠ 0) (hY1 : Integrable (S.YofD true) P.μ) (hY0 : Integrable (S.YofD false) P.μ) : eventCondExp P.μ (S.zEvent k) S.factualY = ∫ ω, S.YofDofZ k ω ∂P.μ := by have _hY1 : Integrable (S.YofD true) P.μ := hY1 have _hY0 : Integrable (S.YofD false) P.μ := hY0 let getD : (∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i) → Bool := fun f => ((f (0 : Fin 3)) : Bool) let getY1 : (∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i) → ℝ := fun f => ((f (1 : Fin 3)) : ℝ) let getY0 : (∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i) → ℝ := fun f => ((f (2 : Fin 3)) : ℝ) let h_proj : (∀ i : Fin (S.cfCell k).n, (S.cfCell k).type i) → ℝ := fun f => cond (getD f) (getY1 f) (getY0 f) have hh_meas : Measurable h_proj := by -- Instance search no longer unfolds `cfCell` to see `n = 3`, so supply the -- coordinate measurable-space family at index type `Fin 3` directly. let _ : ∀ i : Fin 3, MeasurableSpace ((S.cfCell k).type i) := fun i => (S.cfCell k).inst i have hD_meas : Measurable getD := by dsimp [getD] exact measurable_pi_apply (0 : Fin 3) have hY1_meas : Measurable getY1 := by dsimp [getY1] exact measurable_pi_apply (1 : Fin 3) have hY0_meas : Measurable getY0 := by dsimp [getY0] exact measurable_pi_apply (2 : Fin 3) have hif : Measurable fun f => if getD f = true then getY1 f else getY0 f := by refine Measurable.ite ?_ ?_ ?_ · exact hD_meas (MeasurableSet.singleton true) · exact hY1_meas · exact hY0_meas simpa [h_proj, Bool.cond_eq_ite] using hif have hF_eq : ∀ ω ∈ S.zVar.event k, S.factualY ω = h_proj ((S.cfCell k).jointValue ω) := by intro ω hω rw [S.factualY_eq_YofD_factualD hA ω, ← S.DofZ_eq_factualD_on_zEvent hA k hω] dsimp [h_proj, getD, getY1, getY0] have hJV0 : ((S.cfCell k).jointValue ω (0 : Fin 3) : Bool) = S.DofZ k ω := rfl have hJV1 : ((S.cfCell k).jointValue ω (1 : Fin 3) : ℝ) = S.YofD true ω := rfl have hJV2 : ((S.cfCell k).jointValue ω (2 : Fin 3) : ℝ) = S.YofD false ω := rfl rw [hJV0, hJV1, hJV2] cases S.DofZ k ω <;> simp change eventCondExp P.μ (S.zVar.event k) S.factualY = ∫ ω, S.YofDofZ k ω ∂P.μ rw [POSystem.eventCondExp_of_consistency_IndepCF (hA.instrumentIndep k) (a := S.zVar) hh_meas (measurableSet_singleton k) (ae_restrict_of_forall_mem (μ := P.μ) (S.measurableSet_zEvent k) hF_eq) hZk (measure_ne_top _ _)] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω dsimp [h_proj, getD, getY1, getY0] have hJV0 : ((S.cfCell k).jointValue ω (0 : Fin 3) : Bool) = S.DofZ k ω := rfl have hJV1 : ((S.cfCell k).jointValue ω (1 : Fin 3) : ℝ) = S.YofD true ω := rfl have hJV2 : ((S.cfCell k).jointValue ω (2 : Fin 3) : ℝ) = S.YofD false ω := rfl rw [hJV0, hJV1, hJV2] unfold YofDofZ cases S.DofZ k ω <;> simp -
gEvent_pairwise_disjointlemma — The response-type events are pairwise disjoint.hypotheses -
gEvent_iUnionlemma — The response-type events cover the sample space.hypothesesconclusion(⋃ g : ResponseType K, S.gEvent g) = univProof (Lean source)
-
integral_partitionlemma — Total law over response types for an integrable integrand.hypothesesconclusion∫ ω, f ω ∂P.μProof (Lean source)
lemma integral_partition [IsFiniteMeasure P.μ] {f : P.Ω → ℝ} (hf : Integrable f P.μ) : ∫ ω, f ω ∂P.μ = ∑ g : ResponseType K, (P.μ (S.gEvent g)).toReal * eventCondExp P.μ (S.gEvent g) f := integral_eq_sum_measure_mul_eventCondExp P.μ S.gEvent S.measurableSet_gEvent S.gEvent_pairwise_disjoint S.gEvent_iUnion f hf -
mass_nonneglemma — Response-type masses are nonnegative because they are real-valued probabilities.hypothesesconclusion0 ≤ S.mass gProof (Lean source)
lemma mass_nonneg (g : ResponseType K) : 0 ≤ S.mass g := ENNReal.toReal_nonneg -
mass_sum_onelemma — Response-type masses sum to one.hypothesesconclusion∑ g : ResponseType K, S.mass g = 1Proof (Lean source)
lemma mass_sum_one : ∑ g : ResponseType K, S.mass g = 1 := by have hsum : (Finset.univ).sum (fun g : ResponseType K => (P.μ (S.responseType ⁻¹' ({g} : Set (ResponseType K)))).toReal) = (P.μ (S.responseType ⁻¹' (Set.univ : Set (ResponseType K)))).toReal := by simpa [Measure.real] using (MeasureTheory.sum_measureReal_preimage_singleton (μ := P.μ) (s := (Finset.univ : Finset (ResponseType K))) (f := S.responseType) (hf := by intro g _hg exact S.measurable_responseType (measurableSet_singleton g)) (h := by intro g _hg exact measure_ne_top _ _)) simpa [mass, gEvent, Set.preimage_univ, IsProbabilityMeasure.measure_univ] using hsum -
telescoped_eqlemma — The telescoped adjacent step at support point k collapses to the difference of endpoint treatments: Σ_{j≤k}(d_j - d_{j-1}) = g k - g 0.hypothesesconclusionResponseTypeStats.PopulationBridge.telescopedTypeStep g k= boolToReal (g k) - boolToReal (g (S.z0 hK))Proof (Lean source)
lemma telescoped_eq (hK : 0 < K) (g : ResponseType K) (k : Fin K) : ResponseTypeStats.PopulationBridge.telescopedTypeStep g k = boolToReal (g k) - boolToReal (g (S.z0 hK)) := by classical let a : ℕ → ℝ := fun n => if h : n < K then boolToReal (g ⟨n, h⟩) else 0 have htel : ∀ n : ℕ, (∑ r ∈ range n, (a (r + 1) - a r)) = a n - a 0 := by intro n induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih] ring have hsum : (∑ j ∈ (Finset.univ.filter fun j : Adj K => j.1.val ≤ k.val), typeStep g j) = ∑ r ∈ range k.val, (a (r + 1) - a r) := by refine Finset.sum_nbij (fun j : Adj K => j.1.val - 1) ?_ ?_ ?_ ?_ · intro j hj have hjle : j.1.val ≤ k.val := by simpa using hj rw [Finset.mem_range] have hpos : 0 < j.1.val := j.2 omega · intro j1 hj1 j2 hj2 h apply Subtype.ext apply Fin.ext have hj1le : j1.1.val ≤ k.val := by simpa using hj1 have hj2le : j2.1.val ≤ k.val := by simpa using hj2 have hpos1 : 0 < j1.1.val := j1.2 have hpos2 : 0 < j2.1.val := j2.2 change j1.1.val - 1 = j2.1.val - 1 at h omega · intro r hr have hrlt : r < k.val := by simpa using hr refine ⟨⟨⟨r + 1, ?_⟩, ?_⟩, ?_, ?_⟩ · exact Nat.lt_of_le_of_lt (Nat.succ_le_of_lt hrlt) k.isLt · exact Nat.succ_pos r · refine Finset.mem_filter.mpr ⟨Finset.mem_univ _, ?_⟩ show r + 1 ≤ k.val omega · change r + 1 - 1 = r omega · intro j hj have hjle : j.1.val ≤ k.val := by simpa using hj have hsucc : j.1.val - 1 + 1 = j.1.val := Nat.sub_add_cancel (Nat.succ_le_of_lt j.2) have hpred_lt : j.1.val - 1 < K := Nat.lt_of_le_of_lt (Nat.sub_le _ _) j.1.isLt simp [typeStep, Adj.upper, Adj.lower, a, hpred_lt, hsucc] unfold ResponseTypeStats.PopulationBridge.telescopedTypeStep rw [Finset.sum_ite] simp only [Finset.sum_const_zero, add_zero] rw [hsum, htel] have hak : a k.val = boolToReal (g k) := by simp [a, k.isLt] have ha0 : a 0 = boolToReal (g (S.z0 hK)) := by simp [a, hK, z0] rw [hak, ha0] -
treatment_cell_eqtheorem — Treatment cell identity: E[D | Z = zᵏ] = baseTreatment + treatmentAtSupport k.hypothesesconclusioneventCondExp P.μ (S.zEvent k) (fun ω => boolToReal (S.factualD ω))= S.baseTreatment hK + (S.toPopulationBridge hK).treatmentAtSupport kProof (Lean source)
theorem treatment_cell_eq [IsFiniteMeasure P.μ] (hK : 0 < K) (hA : S.Assumptions) (k : Fin K) (hZk : P.μ (S.zEvent k) ≠ 0) : eventCondExp P.μ (S.zEvent k) (fun ω => boolToReal (S.factualD ω)) = S.baseTreatment hK + (S.toPopulationBridge hK).treatmentAtSupport k := by have hDint : ∀ q : Fin K, Integrable (fun ω => boolToReal (S.DofZ q ω)) P.μ := by intro q have hbdd : ∀ ω, |boolToReal (S.DofZ q ω)| ≤ (1 : ℝ) := by intro ω cases S.DofZ q ω <;> simp [boolToReal] exact (MeasureTheory.integrable_const (1 : ℝ)).mono' (((by fun_prop : Measurable fun b : Bool => boolToReal b).comp (S.measurable_DofZ q)).aestronglyMeasurable) (Filter.Eventually.of_forall hbdd) have hCell : ∀ (q : Fin K) (g : ResponseType K), S.mass g * eventCondExp P.μ (S.gEvent g) (fun ω => boolToReal (S.DofZ q ω)) = S.mass g * boolToReal (g q) := by intro q g calc S.mass g * eventCondExp P.μ (S.gEvent g) (fun ω => boolToReal (S.DofZ q ω)) = eventCondExp P.μ (S.gEvent g) (fun ω => boolToReal (S.DofZ q ω)) * S.mass g := by ring _ = ∫ ω in S.gEvent g, boolToReal (S.DofZ q ω) ∂P.μ := by rw [mass, eventCondExp_mul_measure_toReal _ _ (measure_ne_top _ _)] _ = ∫ ω in S.gEvent g, boolToReal (g q) ∂P.μ := by refine MeasureTheory.setIntegral_congr_fun (S.measurableSet_gEvent g) ?_ intro ω hω dsimp rw [S.DofZ_eq_on_gEvent g q hω] _ = boolToReal (g q) * S.mass g := by simp [mass, Measure.real, mul_comm] _ = S.mass g * boolToReal (g q) := by ring have hInt : ∫ ω, boolToReal (S.DofZ k ω) ∂P.μ = ∑ g : ResponseType K, S.mass g * boolToReal (g k) := by rw [S.integral_partition (hDint k)] refine Finset.sum_congr rfl ?_ intro g _ simpa [mass] using hCell k g have hBase : S.baseTreatment hK = ∑ g : ResponseType K, S.mass g * boolToReal (g (S.z0 hK)) := by unfold baseTreatment rw [S.integral_partition (hDint (S.z0 hK))] refine Finset.sum_congr rfl ?_ intro g _ simpa [mass] using hCell (S.z0 hK) g have hTreat : (S.toPopulationBridge hK).treatmentAtSupport k = ∑ g : ResponseType K, S.mass g * (boolToReal (g k) - boolToReal (g (S.z0 hK))) := by unfold ResponseTypeStats.PopulationBridge.treatmentAtSupport toPopulationBridge toStats refine Finset.sum_congr rfl ?_ intro g _ rw [S.telescoped_eq hK g k] rw [S.treatmentDrop hA k hZk, hInt, hBase, hTreat] rw [← Finset.sum_add_distrib] refine Finset.sum_congr rfl ?_ intro g _ ring -
outcome_cell_eqtheorem — Outcome cell identity: E[Y | Z = zᵏ] = outcomeAtSupport k.hypothesesK :sharedℕIsFiniteMeasure P.μhK :0 < KhA :S.Assumptionsk :Fin KhZk :P.μ (S.zEvent k) ≠ 0hY1 :Integrable (S.YofD true) P.μhY0 :Integrable (S.YofD false) P.μconclusioneventCondExp P.μ (S.zEvent k) S.factualY = (S.toPopulationBridge hK).outcomeAtSupport kProof (Lean source)
theorem outcome_cell_eq [IsFiniteMeasure P.μ] (hK : 0 < K) (hA : S.Assumptions) (k : Fin K) (hZk : P.μ (S.zEvent k) ≠ 0) (hY1 : Integrable (S.YofD true) P.μ) (hY0 : Integrable (S.YofD false) P.μ) : eventCondExp P.μ (S.zEvent k) S.factualY = (S.toPopulationBridge hK).outcomeAtSupport k := by have hYDZ_bdd : ∀ q : Fin K, ∀ ω, |S.YofDofZ q ω| ≤ |S.YofD true ω| + |S.YofD false ω| := by intro q ω have h1 := abs_nonneg (S.YofD true ω) have h0 := abs_nonneg (S.YofD false ω) unfold YofDofZ cases S.DofZ q ω <;> simp [h1, h0] have hYDZ_int : ∀ q : Fin K, Integrable (S.YofDofZ q) P.μ := by intro q exact (hY1.norm.add hY0.norm).mono' (S.measurable_YofDofZ q).aestronglyMeasurable (Filter.Eventually.of_forall (hYDZ_bdd q)) have hCE : ∀ (q : Fin K) (g : ResponseType K), eventCondExp P.μ (S.gEvent g) (S.YofDofZ q) = eventCondExp P.μ (S.gEvent g) (S.YofD false) + boolToReal (g q) * S.effect g := by intro q g let c : ℝ := boolToReal (g q) have hcongr : eventCondExp P.μ (S.gEvent g) (S.YofDofZ q) = eventCondExp P.μ (S.gEvent g) (fun ω => S.YofD false ω + c * (S.YofD true ω - S.YofD false ω)) := by apply eventCondExp_congr_on P.μ (S.measurableSet_gEvent g) intro ω hω unfold YofDofZ rw [S.DofZ_eq_on_gEvent g q hω] dsimp [c] cases g q <;> simp [boolToReal] calc eventCondExp P.μ (S.gEvent g) (S.YofDofZ q) = eventCondExp P.μ (S.gEvent g) (fun ω => S.YofD false ω + c * (S.YofD true ω - S.YofD false ω)) := hcongr _ = eventCondExp P.μ (S.gEvent g) (S.YofD false) + eventCondExp P.μ (S.gEvent g) (fun ω => c * (S.YofD true ω - S.YofD false ω)) := by change eventCondExp P.μ (S.gEvent g) ((S.YofD false) + fun ω => c * (S.YofD true ω - S.YofD false ω)) = eventCondExp P.μ (S.gEvent g) (S.YofD false) + eventCondExp P.μ (S.gEvent g) (fun ω => c * (S.YofD true ω - S.YofD false ω)) rw [eventCondExp_add] · exact hY0.integrableOn · exact (hY1.integrableOn.sub hY0.integrableOn).const_mul c _ = eventCondExp P.μ (S.gEvent g) (S.YofD false) + c * eventCondExp P.μ (S.gEvent g) (fun ω => S.YofD true ω - S.YofD false ω) := by rw [eventCondExp_smul] _ = eventCondExp P.μ (S.gEvent g) (S.YofD false) + boolToReal (g q) * S.effect g := by rfl have hTerm : ∀ g : ResponseType K, eventCondExp P.μ (S.gEvent g) (S.YofDofZ k) = S.baseOutcome hK g + ResponseTypeStats.PopulationBridge.telescopedTypeStep g k * S.effect g := by intro g unfold baseOutcome rw [hCE k g, hCE (S.z0 hK) g, S.telescoped_eq hK g k] ring have hInt : ∫ ω, S.YofDofZ k ω ∂P.μ = ∑ g : ResponseType K, S.mass g * eventCondExp P.μ (S.gEvent g) (S.YofDofZ k) := by rw [S.integral_partition (hYDZ_int k)] refine Finset.sum_congr rfl ?_ intro g _ rfl rw [S.outcomeDrop hA k hZk hY1 hY0, hInt] unfold ResponseTypeStats.PopulationBridge.outcomeAtSupport toPopulationBridge toStats refine Finset.sum_congr rfl ?_ intro g _ rw [hTerm g]