PO.ID.Partial.BalkePearl.Sharp
The Balke–Pearl identified set for the average treatment effect is sharp on the model side: for a binary instrument, treatment and outcome, every latent response-type table that is feasible for the Balke–Pearl linear pro
CanonicalModel 14 core · 15 supporting This part defines the finite canonical response-type model, its probability measure and potential-outcome system, and verifies consistency of its intervention evaluator. ★ canonical_consistency
Canonical Balke-Pearl model
This part defines the finite canonical response-type model, its probability measure and potential-outcome system, and verifies consistency of its intervention evaluator.
The canonical sample space consists of one observed binary instrument value together with four binary latent response values: treatment under each instrument value and outcome under each treatment value.
The canonical variable-index set has exactly three elements, representing respectively the instrument, treatment, and outcome.
Definition (Lean source)
The canonical measurement-scale assignment assigns the binary scale to each of the three canonical variables.
For a binary instrument value and a canonical sample-space point, the latent treatment response is that point's treatment response under the specified instrument value.
For a binary treatment value and a canonical sample-space point, the latent outcome response is that point's outcome response under the specified treatment value.
For an intervention regime on the canonical instrument, treatment, and outcome variables, a canonical sample-space point, and one of those variables, the canonical evaluator returns the variable's assigned value when the regime intervenes on it; otherwise it returns the point's instrument value, its treatment response to the resulting instrument value, or its outcome response to the resulting treatment value, respectively. For an intervened variable, the assigned value is used; for the instrument, the observed coordinate is used; for the treatment, the treatment response is used; and for the outcome, the outcome response is used.
Definition (Lean source)
For a potential-outcomes system and a binary Balke--Pearl system on it, the canonical instrument marginal measure assigns to each binary instrument value the probability of that system's corresponding factual instrument event.
Definition (Lean source)
For a table of real weights indexed by the four binary latent response values, the latent-table measure is the discrete measure that places at each response type the nonnegative extended-real part of its table weight.
For a potential-outcomes system, a binary Balke--Pearl system on it, and a table of real weights indexed by the four binary latent response values, the canonical product measure is the product of the system's instrument marginal measure and the latent-table measure.
For a potential-outcomes system, a binary Balke--Pearl system on it, a table of real weights indexed by the four binary latent response values, the condition that every table entry is nonnegative, and the condition that all table entries sum to one, the canonical potential-outcomes system has the canonical variables, binary measurement scales, canonical sample space, canonical product probability measure, and canonical evaluator. Its probability-measure property follows from the two conditions on the latent table.
Definition (Lean source)
For a potential-outcomes system, a binary Balke--Pearl system on it, a table of real weights indexed by the four binary latent response values, the condition that every table entry is nonnegative, and the condition that all table entries sum to one, the canonical Balke--Pearl system designates the first, second, and third canonical variables as instrument, treatment, and outcome, respectively.
Definition (Lean source)
The canonical potential-outcomes system is the model built from the given nonnegative latent response-type probabilities that sum to one. It is the constructed system used to realize a feasible Balke--Pearl table.
Definition (Lean source)
The canonical Balke--Pearl system equips the constructed potential-outcomes system with its instrument, treatment, and outcome roles. It is used to verify that every feasible latent response-type table is realized by a Balke--Pearl model.
Definition (Lean source)
For a potential-outcome system, a binary Balke–Pearl system, a canonical latent response-type table, nonnegativity of every table entry, and unit total table mass, the canonical potential-outcome construction satisfies factual consistency.
Formal statement
Proof (Lean source)
15 supporting declarations (lemmas, instances)
-
measurable_evallemma — The canonical evaluator is measurable under every intervention regime.Proof (Lean source)
@[fun_prop] lemma measurable_eval (r : Regime SV SX) : Measurable (eval r) := by exact measurable_of_finite _ -
eval_zerolemma — The Z-coordinate eval r ω 0: assignment if intervened on, else ω.1.hypothesesconclusioneval r ω ⟨0, by decide⟩= (if h : (⟨0, by decide⟩ : SV) ∈ r.target then r.assign _ h else ω.1) -
eval_one_rawlemma — The D-coordinate (raw).hypotheses -
eval_two_rawlemma — The Y-coordinate (raw).hypothesesProof (Lean source)
lemma eval_two_raw (r : Regime SV SX) (ω : SOmega) : eval r ω ⟨2, by decide⟩ = (if h : (⟨2, by decide⟩ : SV) ∈ r.target then r.assign _ h else yArmω (if h1 : (⟨1, by decide⟩ : SV) ∈ r.target then r.assign _ h1 else dArmω (if h0 : (⟨0, by decide⟩ : SV) ∈ r.target then r.assign _ h0 else ω.1) ω) ω) := rfl -
eval_onelemma — The D-coordinate folded via eval_zero.hypotheses -
eval_twolemma — The Y-coordinate folded via eval_one.hypotheses -
eval_one_of_memlemma — Given a regime and canonical state, if the first variable is intervened on, then the canonical evaluator returns that variable's assigned intervention value.hypothesesconclusioneval r ω ⟨1, by decide⟩ = r.assign _ h -
eval_two_of_not_memlemma — Given a regime and canonical state, if the second variable is not intervened on, then the canonical evaluator returns the state's outcome arm indexed by the evaluated first variable.hypothesesconclusioneval r ω ⟨2, by decide⟩ = yArmω (eval r ω ⟨1, by decide⟩) ω -
zMeasure_univlemma — zMeasure S has total mass 1.Proof (Lean source)
lemma zMeasure_univ : (zMeasure S) univ = 1 := by unfold zMeasure rw [Measure.coe_finset_sum] simp only [Finset.sum_apply, Measure.coe_smul, Pi.smul_apply, smul_eq_mul] simp only [Measure.dirac_apply' _ MeasurableSet.univ, Set.indicator_univ, Pi.one_apply, mul_one] have hpart : (S.zEvent false) ∪ (S.zEvent true) = univ := by ext ω refine ⟨fun _ => trivial, fun _ => ?_⟩ cases h : S.zVar.factual ω · exact Or.inl h · exact Or.inr h have hdisj : Disjoint (S.zEvent false) (S.zEvent true) := by rw [Set.disjoint_left]; intro ω h1 h2 have h1' : S.zVar.factual ω = false := h1 have h2' : S.zVar.factual ω = true := h2 rw [h1'] at h2'; exact Bool.false_ne_true h2' have hmeas_t : MeasurableSet (S.zEvent true) := S.measurableSet_zEvent _ have hadd : P.μ (S.zEvent false) + P.μ (S.zEvent true) = P.μ univ := by rw [← measure_union hdisj hmeas_t, hpart] rw [Fintype.sum_bool, add_comm, hadd, measure_univ] -
instIsProbZMeasureinstance — For a potential-outcomes system and a binary Balke--Pearl system on that system, the canonical marginal distribution of the binary instrument is a probability measure.parametersinstancegiven by⟨zMeasure_univ S⟩ -
piMeasure_univ_of_feasiblelemma — piMeasure π has total mass 1 when π has nonneg entries summing to 1.hypotheseshπ_nn :∀ d0 d1 y0 y1, 0 ≤ π d0 d1 y0 y1Proof (Lean source)
lemma piMeasure_univ_of_feasible {π : Bool → Bool → Bool → Bool → ℝ} (hπ_nn : ∀ d0 d1 y0 y1, 0 ≤ π d0 d1 y0 y1) (hπ_sum : ∑ d0 : Bool, ∑ d1 : Bool, ∑ y0 : Bool, ∑ y1 : Bool, π d0 d1 y0 y1 = 1) : (piMeasure π) univ = 1 := by unfold piMeasure -- Reduce iterated sum measure applied to univ to iterated sum of weights. simp only [Measure.coe_finset_sum, Finset.sum_apply, Measure.coe_smul, Pi.smul_apply, smul_eq_mul, Measure.dirac_apply' _ MeasurableSet.univ, Set.indicator_univ, Pi.one_apply, mul_one] -- Now goal: ∑ d0 ∑ d1 ∑ y0 ∑ y1, ofReal (π d0 d1 y0 y1) = 1 have h1 : ∀ d0 d1 y0, ∑ y1 : Bool, ofReal (π d0 d1 y0 y1) = ofReal (∑ y1 : Bool, π d0 d1 y0 y1) := by intros d0 d1 y0 rw [ENNReal.ofReal_sum_of_nonneg] intro y1 _; exact hπ_nn _ _ _ _ have h2 : ∀ d0 d1, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (π d0 d1 y0 y1) = ofReal (∑ y0 : Bool, ∑ y1 : Bool, π d0 d1 y0 y1) := by intros d0 d1 simp_rw [h1] rw [ENNReal.ofReal_sum_of_nonneg] intro y0 _; exact Finset.sum_nonneg fun y1 _ => hπ_nn _ _ _ _ have h3 : ∀ d0, ∑ d1 : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (π d0 d1 y0 y1) = ofReal (∑ d1 : Bool, ∑ y0 : Bool, ∑ y1 : Bool, π d0 d1 y0 y1) := by intros d0 simp_rw [h2] rw [ENNReal.ofReal_sum_of_nonneg] intro d1 _ exact Finset.sum_nonneg fun y0 _ => Finset.sum_nonneg fun y1 _ => hπ_nn _ _ _ _ have h4 : ∑ d0 : Bool, ∑ d1 : Bool, ∑ y0 : Bool, ∑ y1 : Bool, ofReal (π d0 d1 y0 y1) = ofReal (∑ d0 : Bool, ∑ d1 : Bool, ∑ y0 : Bool, ∑ y1 : Bool, π d0 d1 y0 y1) := by simp_rw [h3] rw [ENNReal.ofReal_sum_of_nonneg] intro d0 _ exact Finset.sum_nonneg fun d1 _ => Finset.sum_nonneg fun y0 _ => Finset.sum_nonneg fun y1 _ => hπ_nn _ _ _ _ rw [h4, hπ_sum] simp -
instIsProbPiMeasurelemma — A nonnegative latent table that sums to one induces a probability measure.hypotheseshπ_nn :∀ d0 d1 y0 y1, 0 ≤ π d0 d1 y0 y1conclusion -
instIsProbCanonicalMeasureinstance — For a potential-outcomes system, a binary Balke--Pearl system on that system, and a table of real weights indexed by the four binary latent response values, if the probability measure induced by that latent table is a probability measure, then the canonical product measure combining the instrument marginal and latent-table measure is a probability measure. -
sqcup_assign_rightlemma — Given two disjoint regimes over a family of variable spaces, for a variable outside the first regime but inside the second, and a proof that it lies in their union, the union regime assigns the second regime's value.hypothesesV :∀ v, MeasurableSpace (X v)r₁ r₂ :Regime V Xh :r₁.Disjoint r₂v :Vhnin :v ∉ r₁.targethin :v ∈ r₂.targethsq :v ∈ (r₁.sqcup r₂ h).targetconclusion(r₁.sqcup r₂ h).assign v hsq = r₂.assign v hinProof (Lean source)
lemma sqcup_assign_right {V : Type*} [DecidableEq V] {X : V → Type*} [∀ v, MeasurableSpace (X v)] (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) (v : V) (hnin : v ∉ r₁.target) (hin : v ∈ r₂.target) (hsq : v ∈ (r₁.sqcup r₂ h).target) : (r₁.sqcup r₂ h).assign v hsq = r₂.assign v hin := by exact Regime.sqcup_assign_neg r₁ r₂ h v hnin hin -
canonical_compositionConsistencylemma — For a potential-outcome system, a binary Balke–Pearl system, a canonical latent response-type table, nonnegativity of every table entry, and unit total table mass, the canonical potential-outcome construction satisfies composition consistency.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1conclusion(P' S π hπ_nn hπ_sum).CompositionConsistencyProof (Lean source)
lemma canonical_compositionConsistency : (P' S π hπ_nn hπ_sum).CompositionConsistency := by refine ⟨?_⟩ intro r₁ r₂ hd Y hY ω hIA -- Helper: agreement of `eval (r₁⊔r₂) ω` with `eval r₁ ω` at the Z-coord. have hzEq : eval (r₁.sqcup r₂ hd) ω ⟨0, by decide⟩ = eval r₁ ω ⟨0, by decide⟩ := by by_cases h01 : (⟨0, by decide⟩ : SV) ∈ r₁.target · have h0sq : (⟨0, by decide⟩ : SV) ∈ (r₁.sqcup r₂ hd).target := mem_union_left _ h01 exact (eval_zero_of_mem (r₁.sqcup r₂ hd) ω h0sq).trans ((sqcup_assign_left r₁ r₂ hd _ h01 h0sq).trans (eval_zero_of_mem r₁ ω h01).symm) · by_cases h02 : (⟨0, by decide⟩ : SV) ∈ r₂.target · have h0sq : (⟨0, by decide⟩ : SV) ∈ (r₁.sqcup r₂ hd).target := mem_union_right _ h02 exact (eval_zero_of_mem (r₁.sqcup r₂ hd) ω h0sq).trans ((sqcup_assign_right r₁ r₂ hd _ h01 h02 h0sq).trans (hIA _ h02).symm) · have h0sq : (⟨0, by decide⟩ : SV) ∉ (r₁.sqcup r₂ hd).target := by rw [Regime.sqcup_target]; intro h rcases Finset.mem_union.mp h with h | h · exact h01 h · exact h02 h rw [eval_zero_of_not_mem (r₁.sqcup r₂ hd) ω h0sq, eval_zero_of_not_mem r₁ ω h01] -- Helper: agreement at the D-coord. have hdEq : eval (r₁.sqcup r₂ hd) ω ⟨1, by decide⟩ = eval r₁ ω ⟨1, by decide⟩ := by by_cases h11 : (⟨1, by decide⟩ : SV) ∈ r₁.target · have h1sq : (⟨1, by decide⟩ : SV) ∈ (r₁.sqcup r₂ hd).target := mem_union_left _ h11 exact (eval_one_of_mem (r₁.sqcup r₂ hd) ω h1sq).trans ((sqcup_assign_left r₁ r₂ hd _ h11 h1sq).trans (eval_one_of_mem r₁ ω h11).symm) · by_cases h12 : (⟨1, by decide⟩ : SV) ∈ r₂.target · have h1sq : (⟨1, by decide⟩ : SV) ∈ (r₁.sqcup r₂ hd).target := mem_union_right _ h12 exact (eval_one_of_mem (r₁.sqcup r₂ hd) ω h1sq).trans ((sqcup_assign_right r₁ r₂ hd _ h11 h12 h1sq).trans (hIA _ h12).symm) · have h1sq : (⟨1, by decide⟩ : SV) ∉ (r₁.sqcup r₂ hd).target := by rw [Regime.sqcup_target]; intro h rcases Finset.mem_union.mp h with h | h · exact h11 h · exact h12 h rw [eval_one_of_not_mem (r₁.sqcup r₂ hd) ω h1sq, eval_one_of_not_mem r₁ ω h11] exact congrArg (fun z => dArmω z ω) hzEq funext v rcases v with ⟨v, hvY⟩ have hv_notr : v ∉ r₁.target ∪ r₂.target := Finset.disjoint_left.mp hY hvY have hv_notr1 : v ∉ r₁.target := fun h => hv_notr (mem_union_left _ h) have hv_not_sqcup : v ∉ (r₁.sqcup r₂ hd).target := by rw [Regime.sqcup_target]; exact hv_notr change eval (r₁.sqcup r₂ hd) ω v = eval r₁ ω v fin_cases v · exact hzEq · have hv1_not_sqcup : (⟨1, by decide⟩ : SV) ∉ (r₁.sqcup r₂ hd).target := hv_not_sqcup have hv1_notr1 : (⟨1, by decide⟩ : SV) ∉ r₁.target := hv_notr1 rw [eval_one_of_not_mem (r₁.sqcup r₂ hd) ω hv1_not_sqcup, eval_one_of_not_mem r₁ ω hv1_notr1] exact congrArg (fun z => dArmω z ω) hzEq · have hv2_not_sqcup : (⟨2, by decide⟩ : SV) ∉ (r₁.sqcup r₂ hd).target := hv_not_sqcup have hv2_notr1 : (⟨2, by decide⟩ : SV) ∉ r₁.target := hv_notr1 rw [eval_two_of_not_mem (r₁.sqcup r₂ hd) ω hv2_not_sqcup, eval_two_of_not_mem r₁ ω hv2_notr1] exact congrArg (fun d => yArmω d ω) hdEq
Sharpness 2 core · 20 supporting This part verifies factual values, exclusion, exogeneity, and marginal identities for the canonical model, then proves realization of every feasible table and interval value. ★ balkePearl_sharp★ balkePearl_sharp_of_mem
Canonical identities and Balke-Pearl sharpness
This part verifies factual values, exclusion, exogeneity, and marginal identities for the canonical model, then proves realization of every feasible table and interval value.
Sharpness. Under the Balke-Pearl IV base assumptions, for a latent treatment-response table π that is feasible for the linear program — nonnegative, summing to one, and reproducing the observed cell probabilities as its marginals, there exists another potential-outcome system, satisfying the same base assumptions, whose observed cell probabilities agree with the original system's and whose average treatment effect equals the LP objective value of π: every feasible latent table is realised by some potential-outcome model.
Formal statement
Proof (Lean source)
Corollary of sharpness. Under the Balke-Pearl IV base assumptions, for a real number τ lying in the Balke-Pearl identified interval, there exists another potential-outcome system, satisfying the same base assumptions, whose observed cell probabilities agree with the original system's and whose average treatment effect equals τ: every value in the identified interval is the ATE of some BP-feasible model with matching observed cell probabilities.
Formal statement
Proof (Lean source)
20 supporting declarations (lemmas, instances)
-
canonical_factualZlemma — S'.factualZ ω = ω.1.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1ω :conclusion(S' S π hπ_nn hπ_sum).factualZ ω = ω.1Proof (Lean source)
lemma canonical_factualZ (ω : SOmega) : (S' S π hπ_nn hπ_sum).factualZ ω = ω.1 := by change (eval Regime.empty ω ⟨0, by decide⟩) = ω.1 rw [eval_zero] have : (⟨0, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact notMem_empty _ rw [dif_neg this] -
canonical_factualDlemma — S'.factualD ω = D(ω.1).hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1ω :Proof (Lean source)
lemma canonical_factualD (ω : SOmega) : (S' S π hπ_nn hπ_sum).factualD ω = dArmω ω.1 ω := by change (eval Regime.empty ω ⟨1, by decide⟩) = dArmω ω.1 ω rw [eval_one] have h1nin : (⟨1, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact notMem_empty _ rw [dif_neg h1nin] have h0nin : (⟨0, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact notMem_empty _ rw [eval_zero, dif_neg h0nin] -
canonical_factualYlemma — S'.factualY ω = Y(D(ω.1)).hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1ω :Proof (Lean source)
lemma canonical_factualY (ω : SOmega) : (S' S π hπ_nn hπ_sum).factualY ω = yArmω (dArmω ω.1 ω) ω := by change (eval Regime.empty ω ⟨2, by decide⟩) = yArmω (dArmω ω.1 ω) ω rw [eval_two] have h2nin : (⟨2, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact Finset.notMem_empty _ rw [dif_neg h2nin] have h0nin : (⟨0, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact Finset.notMem_empty _ have h1nin : (⟨1, by decide⟩ : SV) ∉ (Regime.empty : Regime SV SX).target := by rw [Regime.empty_target]; exact Finset.notMem_empty _ rw [eval_one, dif_neg h1nin, eval_zero, dif_neg h0nin] -
canonical_DofZlemma — S'.DofZ z ω = (POBalkePearlSystem.dArm) z ω.2.1 ω.2.2.1.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1z :ω :conclusion(S' S π hπ_nn hπ_sum).DofZ z ω = POBalkePearlSystem.dArm z ω.2.1 ω.2.2.1Proof (Lean source)
lemma canonical_DofZ (z : Bool) (ω : SOmega) : (S' S π hπ_nn hπ_sum).DofZ z ω = POBalkePearlSystem.dArm z ω.2.1 ω.2.2.1 := by change (eval (Regime.single (X := SX) ⟨0, by decide⟩ z) ω ⟨1, by decide⟩) = _ rw [eval_one] have h1nin : (⟨1, by decide⟩ : SV) ∉ (Regime.single (X := SX) (⟨0, by decide⟩ : SV) z).target := by rw [Regime.single_target]; intro h exact absurd (Finset.mem_singleton.mp h) (by decide) have h0in : (⟨0, by decide⟩ : SV) ∈ (Regime.single (X := SX) (⟨0, by decide⟩ : SV) z).target := by rw [Regime.single_target]; exact mem_singleton_self _ rw [dif_neg h1nin, eval_zero, dif_pos h0in, Regime.single_assign_self] unfold dArmω POBalkePearlSystem.dArm cases z <;> rfl -
canonical_YofDlemma — S'.YofD d ω = (POBalkePearlSystem.yArm) d ω.2.2.2.1 ω.2.2.2.2.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1d :ω :conclusion(S' S π hπ_nn hπ_sum).YofD d ω = POBalkePearlSystem.yArm d ω.2.2.2.1 ω.2.2.2.2Proof (Lean source)
lemma canonical_YofD (d : Bool) (ω : SOmega) : (S' S π hπ_nn hπ_sum).YofD d ω = POBalkePearlSystem.yArm d ω.2.2.2.1 ω.2.2.2.2 := by change (eval (Regime.single (X := SX) ⟨1, by decide⟩ d) ω ⟨2, by decide⟩) = _ rw [eval_two] have h2nin : (⟨2, by decide⟩ : SV) ∉ (Regime.single (X := SX) (⟨1, by decide⟩ : SV) d).target := by rw [Regime.single_target]; intro h exact absurd (Finset.mem_singleton.mp h) (by decide) have h1in : (⟨1, by decide⟩ : SV) ∈ (Regime.single (X := SX) (⟨1, by decide⟩ : SV) d).target := by rw [Regime.single_target]; exact mem_singleton_self _ rw [dif_neg h2nin, eval_one, dif_pos h1in, Regime.single_assign_self] unfold yArmω POBalkePearlSystem.yArm cases d <;> rfl -
canonical_YofZDlemma — S'.YofZD z d ω = (POBalkePearlSystem.yArm) d ω.2.2.2.1 ω.2.2.2.2.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1z d :ω :Proof (Lean source)
lemma canonical_YofZD (z d : Bool) (ω : SOmega) : (S' S π hπ_nn hπ_sum).YofZD z d ω = POBalkePearlSystem.yArm d ω.2.2.2.1 ω.2.2.2.2 := by -- Unfold YofZD to show eval at the regimeZD. have hZ_eq : (S' S π hπ_nn hπ_sum).Z = (⟨0, by decide⟩ : SV) := rfl have hD_eq : (S' S π hπ_nn hπ_sum).D = (⟨1, by decide⟩ : SV) := rfl have h2nin : (⟨2, by decide⟩ : SV) ∉ ((S' S π hπ_nn hπ_sum).regimeZD z d).target := by unfold POBalkePearlSystem.regimeZD rw [Regime.sqcup_target, Regime.single_target, Regime.single_target, hZ_eq, hD_eq] intro h rcases Finset.mem_union.mp h with h | h · exact absurd (Finset.mem_singleton.mp h) (by decide) · exact absurd (Finset.mem_singleton.mp h) (by decide) have h1in : (⟨1, by decide⟩ : SV) ∈ ((S' S π hπ_nn hπ_sum).regimeZD z d).target := by unfold POBalkePearlSystem.regimeZD rw [Regime.sqcup_target] refine mem_union_right _ ?_ rw [Regime.single_target, hD_eq] exact Finset.mem_singleton_self _ -- The assign for D is `d`. have h11 : (⟨1, by decide⟩ : SV) ∉ (Regime.single (X := SX) (⟨0, by decide⟩ : SV) z).target := by rw [Regime.single_target]; intro h exact absurd (Finset.mem_singleton.mp h) (by decide) have h12 : (⟨1, by decide⟩ : SV) ∈ (Regime.single (X := SX) (⟨1, by decide⟩ : SV) d).target := Finset.mem_singleton_self _ have hAssignD : ((S' S π hπ_nn hπ_sum).regimeZD z d).assign ⟨1, by decide⟩ h1in = d := by change ((Regime.single (X := SX) (⟨0, by decide⟩ : SV) z).sqcup (Regime.single (X := SX) (⟨1, by decide⟩ : SV) d) _).assign _ h1in = d rw [sqcup_assign_right _ _ _ _ h11 h12 h1in, Regime.single_assign_self] change (eval ((S' S π hπ_nn hπ_sum).regimeZD z d) ω ⟨2, by decide⟩) = _ rw [eval_two_of_not_mem _ _ h2nin, eval_one_of_mem _ _ h1in, hAssignD] unfold yArmω POBalkePearlSystem.yArm cases d <;> rfl -
canonical_exclusionlemma — Exclusion: Y(z,d) = Y(d) pointwise (and so a.e.).hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1z d :Proof (Lean source)
lemma canonical_exclusion (z d : Bool) : (S' S π hπ_nn hπ_sum).YofZD z d = (S' S π hπ_nn hπ_sum).YofD d := by funext ω exact (canonical_YofZD S π hπ_nn hπ_sum z d ω).trans (canonical_YofD S π hπ_nn hπ_sum d ω).symm -
canonical_zEventlemma — The Z-event in the canonical model is {ω | ω.1 = z}.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1z :Proof (Lean source)
lemma canonical_zEvent (z : Bool) : (S' S π hπ_nn hπ_sum).zEvent z = {ω : SOmega | ω.1 = z} := by ext ω change (S' S π hπ_nn hπ_sum).factualZ ω = z ↔ ω.1 = z exact Iff.of_eq (congrArg (fun t => t = z) (canonical_factualZ S π hπ_nn hπ_sum ω)) -
canonical_zEvent_measurelemma — μ' (S'.zEvent z) = P.μ (S.zEvent z).hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1z :Proof (Lean source)
lemma canonical_zEvent_measure (z : Bool) : (P' S π hπ_nn hπ_sum).μ ((S' S π hπ_nn hπ_sum).zEvent z) = P.μ (S.zEvent z) := by rw [canonical_zEvent] change (canonicalMeasure S π) {ω : SOmega | ω.1 = z} = P.μ (S.zEvent z) unfold canonicalMeasure -- Use Measure.prod_apply for {ω | ω.1 = z} = {z} ×ˢ Set.univ. have hsetEq : {ω : SOmega | ω.1 = z} = {z} ×ˢ (Set.univ : Set (Bool × Bool × Bool × Bool)) := by ext ω; simp [Set.mem_prod, Set.mem_singleton_iff] letI : IsProbabilityMeasure (piMeasure π) := instIsProbPiMeasure hπ_nn hπ_sum rw [hsetEq, Measure.prod_prod] -- piMeasure univ = 1 rw [piMeasure_univ_of_feasible hπ_nn hπ_sum, mul_one] -- zMeasure {z} = P.μ (S.zEvent z) unfold zMeasure rw [Measure.coe_finset_sum] simp only [Finset.sum_apply, Measure.coe_smul, Pi.smul_apply, smul_eq_mul] -- ∑ z' : Bool, P.μ (S.zEvent z') * Measure.dirac z' {z} rw [Fintype.sum_bool] -- Cases on z. cases z · simp [Measure.dirac_apply' _ (MeasurableSet.singleton false)] · simp [Measure.dirac_apply' _ (MeasurableSet.singleton true)] -
canonical_posZlemma — Positive Z probability.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1hA :S.BaseAssumptionsz :Proof (Lean source)
lemma canonical_posZ (hA : S.BaseAssumptions) (z : Bool) : 0 < (P' S π hπ_nn hπ_sum).μ ((S' S π hπ_nn hπ_sum).zVar.event z) := by change 0 < (P' S π hπ_nn hπ_sum).μ ((S' S π hπ_nn hπ_sum).zEvent z) rw [canonical_zEvent_measure] exact hA.posZ z -
canonical_factualZ_eq_fstlemma — The factualZ on the canonical model factors through Prod.fst.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1Proof (Lean source)
lemma canonical_factualZ_eq_fst : (S' S π hπ_nn hπ_sum).factualZ = fun ω : SOmega => ω.1 := by funext ω; exact canonical_factualZ S π hπ_nn hπ_sum ω -
canonical_cfBundle_factors_through_sndlemma — The cfBundle's jointValue factors through Prod.snd: it depends only on the latent factor.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1Proof (Lean source)
lemma canonical_cfBundle_factors_through_snd : ∃ g : (Bool × Bool × Bool × Bool) → (∀ i : Fin (S' S π hπ_nn hπ_sum).cfBundle.n, (S' S π hπ_nn hπ_sum).cfBundle.type i), Measurable g ∧ (S' S π hπ_nn hπ_sum).cfBundle.jointValue = (fun ω : SOmega => g ω.2) := by refine ⟨fun p i => ?_, ?_, ?_⟩ · -- The bundle has 4 components: (D(false), D(true), Y(false), Y(true)). -- D(z) ω = dArm z ω.2.1 ω.2.2.1; Y(d) ω = yArm d ω.2.2.2.1 ω.2.2.2.2. -- We can express the value purely from p = ω.2. refine i.cases (motive := fun i => (S' S π hπ_nn hπ_sum).cfBundle.type i) (POBalkePearlSystem.dArm false p.1 p.2.1) ?_ intro j refine j.cases (motive := fun j => (S' S π hπ_nn hπ_sum).cfBundle.type j.succ) (POBalkePearlSystem.dArm true p.1 p.2.1) ?_ intro k refine k.cases (motive := fun k => (S' S π hπ_nn hπ_sum).cfBundle.type k.succ.succ) (POBalkePearlSystem.yArm false p.2.2.1 p.2.2.2) ?_ intro l refine l.cases (motive := fun l => (S' S π hπ_nn hπ_sum).cfBundle.type l.succ.succ.succ) (POBalkePearlSystem.yArm true p.2.2.1 p.2.2.2) ?_ exact fun m => elim0 m · exact measurable_of_finite _ · funext ω i change (S' S π hπ_nn hπ_sum).cfBundle.jointValue ω i = _ -- Case split on i : Fin 4. fin_cases i · -- D(false) ω = dArm false ω.2.1 ω.2.2.1 exact (canonical_DofZ S π hπ_nn hπ_sum false ω).trans rfl · -- D(true) ω = dArm true ω.2.1 ω.2.2.1 exact (canonical_DofZ S π hπ_nn hπ_sum true ω).trans rfl · -- Y(false) ω = yArm false ω.2.2.2.1 ω.2.2.2.2 exact (canonical_YofD S π hπ_nn hπ_sum false ω).trans rfl · -- Y(true) ω = yArm true ω.2.2.2.1 ω.2.2.2.2 exact (canonical_YofD S π hπ_nn hπ_sum true ω).trans rfl -
canonical_exogeneitylemma — Exogeneity: Z ⊥ cfBundle under the canonical product measure.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1Proof (Lean source)
lemma canonical_exogeneity : (P' S π hπ_nn hπ_sum).IndepCF (.ofFactual (S' S π hπ_nn hπ_sum).zVar) (S' S π hπ_nn hπ_sum).cfBundle (P' S π hπ_nn hπ_sum).μ := by -- Unfold IndepCF to IndepFun. unfold POSystem.IndepCF -- Pick X = id : Bool → Bool, Y = g (above). obtain ⟨g, hg_meas, hg⟩ := canonical_cfBundle_factors_through_snd S π hπ_nn hπ_sum -- factualZ = ω.1, cfBundle.jointValue = g ∘ ω.2. have hZeq : (RegimedVar.ofFactual (S' S π hπ_nn hπ_sum).zVar).value = fun ω : SOmega => ω.1 := by funext ω change (S' S π hπ_nn hπ_sum).zVar.factual ω = ω.1 exact canonical_factualZ S π hπ_nn hπ_sum ω rw [hZeq, hg] -- The product measure independence theorem. letI : IsProbabilityMeasure (piMeasure π) := instIsProbPiMeasure hπ_nn hπ_sum change IndepFun (fun ω : SOmega => ω.1) (fun ω : SOmega => g ω.2) ((zMeasure S).prod (piMeasure π)) exact ProbabilityTheory.indepFun_prod measurable_id hg_meas -
canonical_baseAssumptionslemma — Bundle the canonical model's BaseAssumptions.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1hA :S.BaseAssumptionsconclusion(S' S π hπ_nn hπ_sum).BaseAssumptions where consistency_DProof (Lean source)
lemma canonical_baseAssumptions (hA : S.BaseAssumptions) : (S' S π hπ_nn hπ_sum).BaseAssumptions where consistency_D := by intro z ω hω rw [canonical_DofZ S π hπ_nn hπ_sum z ω, canonical_factualD S π hπ_nn hπ_sum ω] have hz : ω.1 = z := by have hset := canonical_zEvent S π hπ_nn hπ_sum z change ω ∈ (S' S π hπ_nn hπ_sum).zEvent z at hω rw [hset] at hω exact hω rw [hz] unfold dArmω POBalkePearlSystem.dArm rfl consistency_Y := by intro d ω hω rw [canonical_YofD S π hπ_nn hπ_sum d ω, canonical_factualY S π hπ_nn hπ_sum ω] have hd : dArmω ω.1 ω = d := by change (S' S π hπ_nn hπ_sum).factualD ω = d at hω rw [canonical_factualD S π hπ_nn hπ_sum ω] at hω exact hω rw [hd] unfold yArmω POBalkePearlSystem.yArm rfl exclusion := fun z d => by rw [canonical_exclusion] exogeneity := canonical_exogeneity S π hπ_nn hπ_sum posZ := canonical_posZ S π hπ_nn hπ_sum hA -
piMeasure_singletonlemma — piMeasure π {(d0, d1, y0, y1)} = ENNReal.ofReal (π d0 d1 y0 y1).hypothesesProof (Lean source)
lemma piMeasure_singleton (d0 d1 y0 y1 : Bool) : piMeasure π {(d0, d1, y0, y1)} = ofReal (π d0 d1 y0 y1) := by unfold piMeasure simp only [Measure.coe_finset_sum, Finset.sum_apply] have hSing : MeasurableSet ({(d0, d1, y0, y1)} : Set (Bool × Bool × Bool × Bool)) := MeasurableSet.singleton _ -- Compute each summand: it's the dirac measure scaled by π. -- The summand at (d0', d1', y0', y1') = ofReal(π d0' d1' y0' y1') if matches, else 0. have hsummand : ∀ (d0' d1' y0' y1' : Bool), ((ofReal (π d0' d1' y0' y1') • Measure.dirac (d0', d1', y0', y1') : Measure (Bool × Bool × Bool × Bool)) {(d0, d1, y0, y1)}) = if (d0', d1', y0', y1') = (d0, d1, y0, y1) then ofReal (π d0' d1' y0' y1') else 0 := by intros d0' d1' y0' y1' rw [Measure.smul_apply, Measure.dirac_apply' _ hSing, smul_eq_mul] by_cases h : (d0', d1', y0', y1') = (d0, d1, y0, y1) · rw [Set.indicator_of_mem (Set.mem_singleton_iff.mpr h), if_pos h, Pi.one_apply, mul_one] · rw [Set.indicator_of_notMem (by rw [Set.mem_singleton_iff]; exact h), if_neg h, mul_zero] simp_rw [hsummand] -- Now isolate the unique nonzero term. rw [Finset.sum_eq_single d0 (fun d0' _ hne => ?_) (fun h => absurd (Finset.mem_univ _) h)] · rw [Finset.sum_eq_single d1 (fun d1' _ hne => ?_) (fun h => absurd (Finset.mem_univ _) h)] · rw [Finset.sum_eq_single y0 (fun y0' _ hne => ?_) (fun h => absurd (Finset.mem_univ _) h)] · rw [Finset.sum_eq_single y1 (fun y1' _ hne => ?_) (fun h => absurd (Finset.mem_univ _) h)] · simp · simp [hne] · refine Finset.sum_eq_zero (fun y1' _ => ?_) simp [hne] · refine Finset.sum_eq_zero (fun y0' _ => ?_) refine Finset.sum_eq_zero (fun y1' _ => ?_) simp [hne] · refine Finset.sum_eq_zero (fun d1' _ => ?_) refine Finset.sum_eq_zero (fun y0' _ => ?_) refine Finset.sum_eq_zero (fun y1' _ => ?_) simp [hne] -
canonical_latentSetlemma — The canonical latent set is Set.univ ×ˢ {(d0, d1, y0, y1)}.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1d0 d1 y0 y1 :Proof (Lean source)
lemma canonical_latentSet (d0 d1 y0 y1 : Bool) : (S' S π hπ_nn hπ_sum).latentSet d0 d1 y0 y1 = (univ ×ˢ {(d0, d1, y0, y1)} : Set SOmega) := by ext ω rcases ω with ⟨z, d0', d1', y0', y1'⟩ change ((S' S π hπ_nn hπ_sum).DofZ false (z, d0', d1', y0', y1') = d0 ∧ (S' S π hπ_nn hπ_sum).DofZ true (z, d0', d1', y0', y1') = d1 ∧ (S' S π hπ_nn hπ_sum).YofD false (z, d0', d1', y0', y1') = y0 ∧ (S' S π hπ_nn hπ_sum).YofD true (z, d0', d1', y0', y1') = y1) ↔ _ rw [canonical_DofZ, canonical_DofZ, canonical_YofD, canonical_YofD] change ((POBalkePearlSystem.dArm false d0' d1' = d0) ∧ (POBalkePearlSystem.dArm true d0' d1' = d1) ∧ (POBalkePearlSystem.yArm false y0' y1' = y0) ∧ (POBalkePearlSystem.yArm true y0' y1' = y1)) ↔ (z, d0', d1', y0', y1') ∈ (univ ×ˢ {(d0, d1, y0, y1)} : Set SOmega) unfold POBalkePearlSystem.dArm POBalkePearlSystem.yArm simp only [Bool.false_eq_true, if_false, if_true] refine ⟨?_, ?_⟩ · rintro ⟨rfl, rfl, rfl, rfl⟩ exact Set.mk_mem_prod (Set.mem_univ _) rfl · rintro ⟨_, h2⟩ rw [Set.mem_singleton_iff] at h2 -- h2 : (z, d0', d1', y0', y1').2 = (d0, d1, y0, y1) -- Need: conjunction of equalities. simp only [Prod.mk.injEq] at h2 exact h2 -
canonical_latentSet_measurelemma — μ'(latentSet) = ENNReal.ofReal (π d0 d1 y0 y1).hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1d0 d1 y0 y1 :Proof (Lean source)
lemma canonical_latentSet_measure (d0 d1 y0 y1 : Bool) : (P' S π hπ_nn hπ_sum).μ ((S' S π hπ_nn hπ_sum).latentSet d0 d1 y0 y1) = ofReal (π d0 d1 y0 y1) := by rw [canonical_latentSet] change (canonicalMeasure S π) (univ ×ˢ {(d0, d1, y0, y1)}) = _ unfold canonicalMeasure letI : IsProbabilityMeasure (piMeasure π) := instIsProbPiMeasure hπ_nn hπ_sum rw [Measure.prod_prod, zMeasure_univ, one_mul, piMeasure_singleton] -
canonical_latentProb_eqlemma — S'.latentProb = π.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1d0 d1 y0 y1 :conclusion(S' S π hπ_nn hπ_sum).latentProb d0 d1 y0 y1 = π d0 d1 y0 y1Proof (Lean source)
lemma canonical_latentProb_eq (d0 d1 y0 y1 : Bool) : (S' S π hπ_nn hπ_sum).latentProb d0 d1 y0 y1 = π d0 d1 y0 y1 := by unfold POBalkePearlSystem.latentProb rw [canonical_latentSet_measure] exact ENNReal.toReal_ofReal (hπ_nn _ _ _ _) -
canonical_cellProb_eqlemma — S'.cellProb y d z = S.cellProb y d z for any feasible π.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1hA :S.BaseAssumptionshπ :POBalkePearlSystem.BPFeasible S hA πy d z :Proof (Lean source)
lemma canonical_cellProb_eq (hA : S.BaseAssumptions) (hπ : POBalkePearlSystem.BPFeasible S hA π) (y d z : Bool) : (S' S π hπ_nn hπ_sum).cellProb y d z = S.cellProb y d z := by rw [(S' S π hπ_nn hπ_sum).cellProb_eq_sum_latent (canonical_baseAssumptions S π hπ_nn hπ_sum hA) y d z, hπ.marginal y d z] refine Finset.sum_congr rfl (fun d0 _ => ?_) refine Finset.sum_congr rfl (fun d1 _ => ?_) refine Finset.sum_congr rfl (fun y0 _ => ?_) refine Finset.sum_congr rfl (fun y1 _ => ?_) rw [canonical_latentProb_eq] -
canonical_ATE_eqlemma — S'.ATE = BPObjective π.hypotheseshπ_sum :shared∑ d0, ∑ d1, ∑ y0, ∑ y1, π d0 d1 y0 y1 = 1conclusion(S' S π hπ_nn hπ_sum).ATE = POBalkePearlSystem.BPObjective πProof (Lean source)
lemma canonical_ATE_eq : (S' S π hπ_nn hπ_sum).ATE = POBalkePearlSystem.BPObjective π := by rw [(S' S π hπ_nn hπ_sum).ATE_eq_BPObjective] unfold POBalkePearlSystem.BPObjective refine Finset.sum_congr rfl (fun d0 _ => ?_) refine Finset.sum_congr rfl (fun d1 _ => ?_) refine Finset.sum_congr rfl (fun y0 _ => ?_) refine Finset.sum_congr rfl (fun y1 _ => ?_) rw [canonical_latentProb_eq]