Formalization: Assignment Probabilities Without Row-level Links: Identification, Label Design, and Inference in Randomized Trials

The complete Lean development behind this paper — every definition, lemma, and theorem of its module, including helpers the paper text never cites. Identifiers link within this page, into the Causalean library, or out to the official Mathlib docs. Note: this index was generated at a different commit than the paper's audited pin (9135ac1) — statements may have moved since the audit.

CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Basic 53 declarations Law-level primitives for the unlinked propensity-score ATE problem.

Law-level primitives for the unlinked propensity-score ATE problem.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
ScoreSpace ε :
Set ℝ
Icc ε (1 - ε)
CausalSmith.PartialID.UnlinkedPropensityAte.ScoreSpace · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:25
def OutcomeSpace

This definition introduces the corresponding mathematical object.

Definition (Lean source)
OutcomeSpace :
Set ℝ
Icc (0 : ℝ) 1
CausalSmith.PartialID.UnlinkedPropensityAte.OutcomeSpace · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:27
def ArmSpace

This definition introduces the corresponding mathematical object.

Definition (Lean source)
ArmSpace :
Type
CausalSmith.PartialID.UnlinkedPropensityAte.ArmSpace · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:29

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
LabelSpace J :
Type
Fin J
CausalSmith.PartialID.UnlinkedPropensityAte.LabelSpace · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:31

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
FullRow ε J :
Type
CausalSmith.PartialID.UnlinkedPropensityAte.FullRow · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:33
def Observation

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
Observation J :
Type
CausalSmith.PartialID.UnlinkedPropensityAte.Observation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:37
def score

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
score ω :
ω.1
CausalSmith.PartialID.UnlinkedPropensityAte.score · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:40
def outcome0

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
outcome0 ω :
ω.2.1
CausalSmith.PartialID.UnlinkedPropensityAte.outcome0 · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:42
def outcome1

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
outcome1 ω :
ω.2.2.1
CausalSmith.PartialID.UnlinkedPropensityAte.outcome1 · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:44
def arm

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
arm ω :
ω.2.2.2.1
CausalSmith.PartialID.UnlinkedPropensityAte.arm · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:46
def observed

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
observed ω :
ω.2.2.2.2.1
CausalSmith.PartialID.UnlinkedPropensityAte.observed · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:48

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
label ω :
ω.2.2.2.2.2
CausalSmith.PartialID.UnlinkedPropensityAte.label · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:50
def releasedRecord

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
ω :
FullRow ε J
releasedRecord ω :
(label ω, arm ω, observed ω)
CausalSmith.PartialID.UnlinkedPropensityAte.releasedRecord · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:52

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
releasedLaw P :
CausalSmith.PartialID.UnlinkedPropensityAte.releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:55

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
ate P :
ℝ
∫ ω, ((outcome1 ω : ℝ) - (outcome0 ω : ℝ)) ∂P
CausalSmith.PartialID.UnlinkedPropensityAte.ate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:59

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
Overlap ε :
Prop
clause 1
0 < ε
clause 2
ε < 1 / 2
CausalSmith.PartialID.UnlinkedPropensityAte.Overlap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:65
def ScoreMarginal

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
H :
ScoreMarginal P H :
Prop
P.map score = H
CausalSmith.PartialID.UnlinkedPropensityAte.ScoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:70
def RandomizedAssignment

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
RandomizedAssignment P :
Prop
P.real {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B}
= ∫ ω in {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B}, (score ω : ℝ) ∂P
CausalSmith.PartialID.UnlinkedPropensityAte.RandomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:75
def Consistency

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
Consistency P :
Prop
∀ᵐ ω ∂P, observed ω = if arm ω then outcome1 ω else outcome0 ω
CausalSmith.PartialID.UnlinkedPropensityAte.Consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:83
def DeterministicRelease

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
g :
P :
DeterministicRelease g P :
Prop
∀ᵐ ω ∂P, label ω = g (score ω)
CausalSmith.PartialID.UnlinkedPropensityAte.DeterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:88
def ReleasedLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
P :
Prel :
ReleasedLaw P Prel :
Prop
releasedLaw P = Prel
CausalSmith.PartialID.UnlinkedPropensityAte.ReleasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:95
structure RandomizedCausalLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
P :
probability :
measurableRelease :
scoreMarginal :
randomizedAssignment :
consistency :
Consistency P
deterministicRelease :
CausalSmith.PartialID.UnlinkedPropensityAte.RandomizedCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:101
structure CompatibleCausalLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
P :
probability :
measurableRelease :
scoreMarginal :
randomizedAssignment :
consistency :
Consistency P
deterministicRelease :
releasedLaw :
CausalSmith.PartialID.UnlinkedPropensityAte.CompatibleCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:113

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
CausalLaws H g :
CausalSmith.PartialID.UnlinkedPropensityAte.CausalLaws · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:125
def CompatibleLaws

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
CompatibleLaws H g Prel :
CausalSmith.PartialID.UnlinkedPropensityAte.CompatibleLaws · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:130
def DensityLower

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
H :
f :
ScoreSpace ε → ℝ
mf :
ℝ
DensityLower H f mf :
Prop
clause 1
clause 2
H
= ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)).withDensity (fun e => ofReal (f e))
clause 3
∀ᵐ e ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)), mf ≤ f e
CausalSmith.PartialID.UnlinkedPropensityAte.DensityLower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:137
def DensityUpper

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
f :
ScoreSpace ε → ℝ
Mf :
ℝ
DensityUpper f Mf :
Prop
∀ᵐ e ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)), f e ≤ Mf
CausalSmith.PartialID.UnlinkedPropensityAte.DensityUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:146
structure LowerScoreDensity

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
H :
f :
ScoreSpace ε → ℝ
mf :
ℝ
probability :
densityLower :
CausalSmith.PartialID.UnlinkedPropensityAte.LowerScoreDensity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:151
structure BoundedScoreDensity

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
H :
f :
ScoreSpace ε → ℝ
mf Mf :
ℝ
probability :
densityLower :
densityUpper :
CausalSmith.PartialID.UnlinkedPropensityAte.BoundedScoreDensity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:157
def armProb

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
a :
e :
armProb a e :
ℝ
if a then (e : ℝ) else 1 - (e : ℝ)
CausalSmith.PartialID.UnlinkedPropensityAte.armProb · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:163

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
g :
r :
cell g r :
{e | g e = r}
CausalSmith.PartialID.UnlinkedPropensityAte.cell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:166
def armCellMass

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
a :
r :
armCellMass H g a r :
ℝ
∫ e in cell g r, armProb a e ∂H
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:169

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
CompatibleCellMasses H g Prel :
Prop
clause 3
clause 4
a r :
Prel.real {z | z.1 = r ∧ z.2.1 = a} = armCellMass H g a r
CausalSmith.PartialID.UnlinkedPropensityAte.CompatibleCellMasses · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:174
theorem compatibleCellMasses_of_randomizedCausalLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
P :
hP :
Proof (Lean source)
lemma compatibleCellMasses_of_randomizedCausalLaw (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (P : Measure (FullRow ε J)) (hP : RandomizedCausalLaw H g P) : CompatibleCellMasses H g (releasedLaw P) := by have hH : IsProbabilityMeasure H := by rw [← hP.scoreMarginal] exact @Measure.isProbabilityMeasure_map _ _ _ _ P hP.probability _ (by unfold score; fun_prop : Measurable (score (ε := ε) (J := J))).aemeasurable have hRel : IsProbabilityMeasure (releasedLaw P) := by unfold releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ P hP.probability _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable refine ⟨hH, hRel, hP.measurableRelease, ?_⟩ intro a r let B : Set (ScoreSpace ε × OutcomeSpace × OutcomeSpace) := {x | g x.1 = r} have hB : MeasurableSet B := by dsimp [B] exact measurableSet_eq_fun (hP.measurableRelease.comp measurable_fst) measurable_const have hscore : Measurable (score (ε := ε) (J := J)) := by unfold score fun_prop have hrecord : Measurable (releasedRecord (ε := ε) (J := J)) := by unfold releasedRecord label arm observed fun_prop have hrel : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = a} := by exact (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) have hlabel : ∀ᵐ ω ∂P, label ω = g (score ω) := hP.deterministicRelease have htreated : (releasedLaw P).real {z | z.1 = r ∧ z.2.1 = true} = ∫ e in cell g r, (e : ℝ) ∂H := by have hrand := hP.randomizedAssignment B hB have hsetRel : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = true} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) have hmap := MeasureTheory.map_measureReal_apply (μ := P) hrecord hsetRel change (P.map releasedRecord).real _ = _ rw [hmap] have hset : P.real (releasedRecord ⁻¹' {z : Observation J | z.1 = r ∧ z.2.1 = true}) = P.real {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} := by apply measureReal_congr filter_upwards [hlabel] with ω hω change (label ω = r ∧ arm ω = true) = (arm ω = true ∧ g (score ω) = r) simp [hω, and_comm] rw [hset, hrand] rw [← hP.scoreMarginal] have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hP.measurableRelease measurable_const have hmap := MeasureTheory.setIntegral_map (μ := P) (g := score) (f := fun e : ScoreSpace ε => (e : ℝ)) hcell (by fun_prop : AEStronglyMeasurable (fun e : ScoreSpace ε => (e : ℝ)) (P.map score)) hscore.aemeasurable have hpre : {ω : FullRow ε J | (score ω, outcome0 ω, outcome1 ω) ∈ B} = (score (ε := ε) (J := J)) ⁻¹' cell g r := by ext ω rfl rw [hpre] exact hmap.symm cases a · letI : IsProbabilityMeasure P := hP.probability let C : Set (FullRow ε J) := score ⁻¹' cell g r let T : Set (FullRow ε J) := {ω | ω ∈ C ∧ arm ω = true} have hC : MeasurableSet C := (measurableSet_eq_fun hP.measurableRelease measurable_const).preimage hscore have hT : MeasurableSet T := hC.inter (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const) have hTmass : P.real T = ∫ e in cell g r, (e : ℝ) ∂H := by rw [← htreated] have hsetRel : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = true} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) have hmap := MeasureTheory.map_measureReal_apply (μ := P) hrecord hsetRel rw [show releasedLaw P = P.map releasedRecord from rfl, hmap] apply measureReal_congr filter_upwards [hlabel] with ω hω change (ω ∈ C ∧ arm ω = true) = (label ω = r ∧ arm ω = true) simp [C, cell, hω] have hCmass : P.real C = H.real (cell g r) := by rw [← hP.scoreMarginal] exact (MeasureTheory.map_measureReal_apply hscore (measurableSet_eq_fun hP.measurableRelease measurable_const)).symm have hFmass : (releasedLaw P).real {z | z.1 = r ∧ z.2.1 = false} = P.real (C \ T) := by have hsetRel : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = false} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) have hmap := MeasureTheory.map_measureReal_apply (μ := P) hrecord hsetRel rw [show releasedLaw P = P.map releasedRecord from rfl, hmap] apply measureReal_congr filter_upwards [hlabel] with ω hω change (label ω = r ∧ arm ω = false) = (ω ∈ C ∧ ω ∉ T) cases hArm : arm ω <;> simp [C, T, cell, hω, hArm] rw [hFmass, measureReal_sdiff (show T ⊆ C from fun _ h => h.1) hT, hCmass, hTmass] letI : IsProbabilityMeasure H := hH have hint : IntegrableOn (fun e : ScoreSpace ε => (e : ℝ)) (cell g r) H := by apply Integrable.of_bound (by fun_prop) (|ε| + |1 - ε| + 1) filter_upwards [] with e change |(e : ℝ)| ≤ |ε| + |1 - ε| + 1 rcases e.property with ⟨he₁, he₂⟩ have h₁ := neg_le_abs ε have h₂ := le_abs_self (1 - ε) have h₃ := neg_le_abs (1 - ε) have h₄ := le_abs_self ε exact abs_le.mpr ⟨by linarith, by linarith⟩ rw [armCellMass] simp only [armProb, Bool.false_eq_true, ↓reduceIte] rw [integral_sub (integrable_const 1) hint] simp · simpa [armCellMass, armProb] using htreated
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleCellMasses_of_randomizedCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:184
theorem compatibleCellMasses_of_compatibleCausalLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
P :
hP :
Proof (Lean source)
lemma compatibleCellMasses_of_compatibleCausalLaw (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) : CompatibleCellMasses H g Prel := by have hRandom : RandomizedCausalLaw H g P := ⟨hP.probability, hP.measurableRelease, hP.scoreMarginal, hP.randomizedAssignment, hP.consistency, hP.deterministicRelease⟩ rw [← hP.releasedLaw] exact compatibleCellMasses_of_randomizedCausalLaw H g P hRandom
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleCellMasses_of_compatibleCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:301
theorem compatibleCellMasses_of_nonempty

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hcomp :
(CompatibleLaws H g Prel).Nonempty
Proof (Lean source)
lemma compatibleCellMasses_of_nonempty (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hcomp : (CompatibleLaws H g Prel).Nonempty) : CompatibleCellMasses H g Prel := by obtain ⟨P, hP⟩ := hcomp exact compatibleCellMasses_of_compatibleCausalLaw H g Prel P hP.2
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleCellMasses_of_nonempty · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:313
def armCellOutcomeLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
shared
Prel :
_hPrel :
a :
r :
_hpos :
0 < Prel.real {z | z.1 = r ∧ z.2.1 = a}
armCellOutcomeLaw Prel _hPrel a r _hpos :
(Prel {z | z.1 = r ∧ z.2.1 = a})⁻¹ • ((Prel.restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => (z.2.2 : ℝ)))
CausalSmith.PartialID.UnlinkedPropensityAte.armCellOutcomeLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:321
def armCellScoreLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
_hg :
a :
r :
_hq :
0 < armCellMass H g a r
armCellScoreLaw H _hH g _hg a r _hq :
(ofReal (armCellMass H g a r))⁻¹ • ((H.withDensity (fun e => ofReal (armProb a e))).restrict (cell g r))
CausalSmith.PartialID.UnlinkedPropensityAte.armCellScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:329
def armCellWeightLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
hg :
a :
r :
hq :
0 < armCellMass H g a r
armCellWeightLaw H hH g hg a r hq :
(armCellScoreLaw H hH g hg a r hq).map (fun e => (armProb a e)⁻¹)
CausalSmith.PartialID.UnlinkedPropensityAte.armCellWeightLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:339
def generalizedQuantile

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
μ :
u :
ℝ
generalizedQuantile μ u :
ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.generalizedQuantile · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:348
def armCell

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
a :
r :
hg :
hPrel :
armCell H g Prel a r hH hg hPrel :
ℝ × (0 < Prel.real {z | z.1 = r ∧ z.2.1 = a} → Measure ℝ) × (0 < armCellMass H g a r → Measure (ScoreSpace ε)) × (0 < armCellMass H g a r → Measure ℝ)
(armCellMass H g a r, armCellOutcomeLaw Prel hPrel a r, armCellScoreLaw H hH g hg a r, armCellWeightLaw H hH g hg a r)
CausalSmith.PartialID.UnlinkedPropensityAte.armCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:353

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hMass :
a :
muLower H g Prel hMass a :
ℝ
∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u) else 0
CausalSmith.PartialID.UnlinkedPropensityAte.muLower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:366

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hMass :
a :
muUpper H g Prel hMass a :
ℝ
∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u else 0
CausalSmith.PartialID.UnlinkedPropensityAte.muUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:381
def armMeanEndpoints

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hMass :
a :
armMeanEndpoints H g Prel hMass a :
ℝ × ℝ
(muLower H g Prel hMass a, muUpper H g Prel hMass a)
CausalSmith.PartialID.UnlinkedPropensityAte.armMeanEndpoints · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:398
def sharpATESet

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hMass :
sharpATESet H g Prel hMass :
Set ℝ
Icc (muLower H g Prel hMass true - muUpper H g Prel hMass false) (muUpper H g Prel hMass true - muLower H g Prel hMass false)
CausalSmith.PartialID.UnlinkedPropensityAte.sharpATESet · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:405

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
Prel :
hMass :
sharpATELength H g Prel hMass :
ℝ
(muUpper H g Prel hMass true - muLower H g Prel hMass false)
- (muLower H g Prel hMass true - muUpper H g Prel hMass false)
CausalSmith.PartialID.UnlinkedPropensityAte.sharpATELength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:412
def worstCaseAmbiguity

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
H :
g :
worstCaseAmbiguity H g :
ℝ
sSup {d : ℝ | ∃ P : Measure (FullRow ε J), ∃ (_hprob : IsProbabilityMeasure P), ∃ hP : RandomizedCausalLaw H g P, d = sharpATELength H g (releasedLaw P) (compatibleCellMasses_of_randomizedCausalLaw H g P hP)}
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:420
def kLabelReleases

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
kLabelReleases ε K :
{g | Measurable g}
CausalSmith.PartialID.UnlinkedPropensityAte.kLabelReleases · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:430
def optimalKAmbiguity

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
H :
optimalKAmbiguity ε K H :
ℝ
sInf {d : ℝ | ∃ g ∈ kLabelReleases ε K, d = worstCaseAmbiguity H g}
CausalSmith.PartialID.UnlinkedPropensityAte.optimalKAmbiguity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:436

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
f :
ScoreSpace ε → ℝ
t :
ℝ
densityExtension f t :
ℝ
if ht : t ∈ Icc ε (1 - ε) then f ⟨t, ht⟩ else 0
CausalSmith.PartialID.UnlinkedPropensityAte.densityExtension · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:441
def compandingMass

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
f :
ScoreSpace ε → ℝ
x :
compandingMass f x :
ℝ
∫ t in ε..(x : ℝ), sqrt (densityExtension f t / (t * (1 - t)))
CausalSmith.PartialID.UnlinkedPropensityAte.compandingMass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:444
def compandingRelease

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
f :
ScoreSpace ε → ℝ
K :
ℕ
hK :
0 < K
e :
compandingRelease f K hK e :
⟨min (Nat.floor ((K : ℝ) * compandingMass f e / (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))))) (K - 1), by omega⟩
CausalSmith.PartialID.UnlinkedPropensityAte.compandingRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:447
def highResolutionHandle

This definition introduces the corresponding mathematical object.

Definition (Lean source)
highResolutionHandle :
"Proof strategy: uncross arbitrary measurable release cells for the paired \ reciprocal-score absolute-deviation objective D_H(g); then use local scalar \ quantization on ordered cells to derive matching lower and upper limits for \ K Δ_K(H), with an ordered attaining sequence. Inputs: H, its density f, \ measurable releases g, D_H(g), and Δ_K(H)."
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionHandle · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Basic.lean:455
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelAmbiguityBridge 1 declarations Structural endpoint bridge for all-label ambiguity.

Structural endpoint bridge for all-label ambiguity.

theorem compatible_endpointGap_eq_sharpATELength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
conclusion 1
∃ P : Measure (FullRow ε J),
conclusion 2
∃ Pminus Pplus : Measure (FullRow ε J),
CompatibleCausalLaw H g Prel Pminus
CompatibleCausalLaw H g Prel Pplus
ate Pminus = muLower H g Prel hMass true - muUpper H g Prel hMass false
ate Pplus = muUpper H g Prel hMass true - muLower H g Prel hMass false
ate Pplus - ate Pminus = sharpATELength H g Prel hMass
Proof (Lean source)
lemma compatible_endpointGap_eq_sharpATELength {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : (∃ P : Measure (FullRow ε J), IsProbabilityMeasure P ∧ CompatibleCausalLaw H g Prel P) ∧ (∃ Pminus Pplus : Measure (FullRow ε J), IsProbabilityMeasure Pminus ∧ IsProbabilityMeasure Pplus ∧ CompatibleCausalLaw H g Prel Pminus ∧ CompatibleCausalLaw H g Prel Pplus ∧ ate Pminus = muLower H g Prel hMass true - muUpper H g Prel hMass false ∧ ate Pplus = muUpper H g Prel hMass true - muLower H g Prel hMass false ∧ ate Pplus - ate Pminus = sharpATELength H g Prel hMass) := by let Pminus := endpointFullLaw H g Prel hMass hOverlap true false let Pplus := endpointFullLaw H g Prel hMass hOverlap false true have hminus : CompatibleCausalLaw H g Prel Pminus := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap true false have hplus : CompatibleCausalLaw H g Prel Pplus := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap false true have hminusAte : ate Pminus = muLower H g Prel hMass true - muUpper H g Prel hMass false := by letI : IsProbabilityMeasure Pminus := hminus.probability rw [ate_eq_potentialOutcomeMeans_sub] have h1 := endpointFullLaw_armMean H g Prel hMass hOverlap true false true have h0 := endpointFullLaw_armMean H g Prel hMass hOverlap true false false simpa [Pminus] using congrArg₂ (· - ·) h1 h0 have hplusAte : ate Pplus = muUpper H g Prel hMass true - muLower H g Prel hMass false := by letI : IsProbabilityMeasure Pplus := hplus.probability rw [ate_eq_potentialOutcomeMeans_sub] have h1 := endpointFullLaw_armMean H g Prel hMass hOverlap false true true have h0 := endpointFullLaw_armMean H g Prel hMass hOverlap false true false simpa [Pplus] using congrArg₂ (· - ·) h1 h0 refine ⟨⟨Pminus, hminus.probability, hminus⟩, Pminus, Pplus, hminus.probability, hplus.probability, hminus, hplus, hminusAte, hplusAte, ?_⟩ rw [hminusAte, hplusAte] unfold sharpATELength ring
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_endpointGap_eq_sharpATELength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelAmbiguityBridge.lean:13
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelCellScaling 1 declarations Scaling identity for normalized inverse propensity cell laws.

Scaling identity for normalized inverse propensity cell laws.

theorem armCellWeightLaw_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
c :
ℝ
armCellMass H g a r * (∫ w, |w - c| ∂(armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq))
= ∫ e in cell g r, |1 - c * armProb a e| ∂H
Proof (Lean source)
lemma armCellWeightLaw_absoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (c : ℝ) : armCellMass H g a r * (∫ w, |w - c| ∂(armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) = ∫ e in cell g r, |1 - c * armProb a e| ∂H := by unfold armCellWeightLaw armCellScoreLaw rw [MeasureTheory.integral_map] · rw [integral_smul_measure] rw [ENNReal.toReal_inv, ENNReal.toReal_ofReal hq.le] simp only [smul_eq_mul] rw [← mul_assoc, mul_inv_cancel₀ (ne_of_gt hq), one_mul] unfold cell rw [setIntegral_withDensity_eq_setIntegral_toReal_smul (by cases a <;> simp [armProb] <;> fun_prop) (Filter.Eventually.of_forall fun _ => by finiteness) _ (measurableSet_eq_fun hMass.2.2.1 measurable_const)] apply integral_congr_ae filter_upwards [] with e have hp : 0 < armProb a e := by rcases e.property with ⟨he0, he1⟩ cases a <;> simp [armProb] <;> linarith [hOverlap.1] rw [ENNReal.toReal_ofReal hp.le] simp only [smul_eq_mul] rw [abs_sub_comm] calc armProb a e * |c - (armProb a e)⁻¹| = |armProb a e| * |c - (armProb a e)⁻¹| := by rw [abs_of_pos hp] _ = |armProb a e * (c - (armProb a e)⁻¹)| := by rw [abs_mul] _ = |c * armProb a e - 1| := by congr 1 field_simp _ = |1 - c * armProb a e| := abs_sub_comm _ _ · exact (by cases a <;> simp [armProb] <;> fun_prop) · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.armCellWeightLaw_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCellScaling.lean:13
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelCouplingRange 8 declarations This file isolates the analytic cell inequality used by the all-label ambiguity calculation.

A coupling range bound for bounded outcomes

This file isolates the analytic cell inequality used by the all-label ambiguity calculation. If the first marginal is supported on [0,1], the difference between product expectations under any two couplings is controlled by the absolute deviation of the second marginal about every fixed center.

def fairBernoulliLaw

This definition introduces the corresponding mathematical object.

Definition (Lean source)
fairBernoulliLaw :
(1 / 2 : ENNReal) • (Measure.dirac 0 + Measure.dirac 1)
CausalSmith.PartialID.UnlinkedPropensityAte.fairBernoulliLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:22
instance fairBernoulliLaw_isProbabilityMeasure

This definition introduces the corresponding mathematical object.

Definition (Lean source)
instance fairBernoulliLaw_isProbabilityMeasure : IsProbabilityMeasure fairBernoulliLaw := by refine ⟨?_⟩ simp [fairBernoulliLaw, smul_eq_mul] exact ENNReal.inv_two_add_inv_two
CausalSmith.PartialID.UnlinkedPropensityAte.fairBernoulliLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:26
theorem fairBernoulliLaw_quantile

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
u :
ℝ
hu0 :
0 < u
hu1 :
u < 1
quantile fairBernoulliLaw u = if u ≤ 1 / 2 then 0 else 1
Proof (Lean source)
lemma fairBernoulliLaw_quantile (u : ℝ) (hu0 : 0 < u) (hu1 : u < 1) : quantile fairBernoulliLaw u = if u ≤ 1 / 2 then 0 else 1 := by split_ifs with hu · apply le_antisymm · apply quantile_le_of_le_cdf hu0 rw [fairBernoulliLaw_cdf_between 0 (le_refl 0) (by norm_num)] exact hu · by_contra hn have hneg : quantile fairBernoulliLaw u < 0 := lt_of_not_ge hn have hle := (quantile_le_iff hu0 hu1).mp (le_refl (quantile fairBernoulliLaw u)) rw [fairBernoulliLaw_cdf_of_lt_zero _ hneg] at hle linarith · apply le_antisymm · apply quantile_le_of_le_cdf hu0 rw [fairBernoulliLaw_cdf_one] exact hu1.le · by_contra hn have hlt : quantile fairBernoulliLaw u < 1 := lt_of_not_ge hn let x := (quantile fairBernoulliLaw u + 1) / 2 have hqx : quantile fairBernoulliLaw u ≤ x := by dsimp [x] linarith have hx0 : 0 ≤ x := by have hq0 : 0 ≤ quantile fairBernoulliLaw u := by by_contra hn0 have hqneg : quantile fairBernoulliLaw u < 0 := lt_of_not_ge hn0 have hle := (quantile_le_iff hu0 hu1).mp (le_refl (quantile fairBernoulliLaw u)) rw [fairBernoulliLaw_cdf_of_lt_zero _ hqneg] at hle linarith dsimp [x] linarith have hx1 : x < 1 := by dsimp [x]; linarith have hle := (quantile_le_iff hu0 hu1).mp hqx rw [fairBernoulliLaw_cdf_between x hx0 hx1] at hle exact hu hle
CausalSmith.PartialID.UnlinkedPropensityAte.fairBernoulliLaw_quantile · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:51
theorem coupling_product_gap_le_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
πminus πplus :
Measure (ℝ × ℝ)
hminus :
IsCoupling πminus Y W
hplus :
IsCoupling πplus Y W
hYsupport :
Y (Icc (0 : ℝ) 1)ᶜ = 0
hY2 :
MemLp (fun y : ℝ => y) 2 Y
hW2 :
MemLp (fun w : ℝ => w) 2 W
c :
ℝ
(∫ p, p.1 * p.2 ∂πplus) - (∫ p, p.1 * p.2 ∂πminus) ≤ ∫ w, |w - c| ∂W
Proof (Lean source)
lemma coupling_product_gap_le_absoluteDeviation {Y W : Measure ℝ} [IsProbabilityMeasure Y] [IsProbabilityMeasure W] {πminus πplus : Measure (ℝ × ℝ)} (hminus : IsCoupling πminus Y W) (hplus : IsCoupling πplus Y W) (hYsupport : Y (Icc (0 : ℝ) 1)ᶜ = 0) (hY2 : MemLp (fun y : ℝ => y) 2 Y) (hW2 : MemLp (fun w : ℝ => w) 2 W) (c : ℝ) : (∫ p, p.1 * p.2 ∂πplus) - (∫ p, p.1 * p.2 ∂πminus) ≤ ∫ w, |w - c| ∂W := by letI : IsProbabilityMeasure πminus := hminus.isProbabilityMeasure letI : IsProbabilityMeasure πplus := hplus.isProbabilityMeasure let pos : ℝ → ℝ := fun x => (x + |x|) / 2 let neg : ℝ → ℝ := fun x => (-x + |x|) / 2 have hYae (π : Measure (ℝ × ℝ)) (hπ : IsCoupling π Y W) : ∀ᵐ p ∂π, p.1 ∈ Icc (0 : ℝ) 1 := by have hh : ∀ᵐ y ∂Y, y ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] exact hYsupport rw [← hπ.map_fst] at hh exact (ae_map_iff measurable_fst.aemeasurable measurableSet_Icc).mp hh have hposInt : Integrable (fun w : ℝ => pos (w - c)) W := by apply Integrable.div_const apply Integrable.add · exact (hW2.integrable (by norm_num)).sub (integrable_const c) · exact ((hW2.integrable (by norm_num)).sub (integrable_const c)).abs have hnegInt : Integrable (fun w : ℝ => neg (w - c)) W := by apply Integrable.div_const apply Integrable.add · exact ((hW2.integrable (by norm_num)).sub (integrable_const c)).neg · exact ((hW2.integrable (by norm_num)).sub (integrable_const c)).abs have hposMap (π : Measure (ℝ × ℝ)) (hπ : IsCoupling π Y W) : (∫ p, pos (p.2 - c) ∂π) = ∫ w, pos (w - c) ∂W := by calc (∫ p, pos (p.2 - c) ∂π) = ∫ w, pos (w - c) ∂(π.map snd) := by rw [integral_map measurable_snd.aemeasurable] fun_prop _ = ∫ w, pos (w - c) ∂W := by rw [hπ.map_snd] have hnegMap (π : Measure (ℝ × ℝ)) (hπ : IsCoupling π Y W) : (∫ p, neg (p.2 - c) ∂π) = ∫ w, neg (w - c) ∂W := by calc (∫ p, neg (p.2 - c) ∂π) = ∫ w, neg (w - c) ∂(π.map snd) := by rw [integral_map measurable_snd.aemeasurable] fun_prop _ = ∫ w, neg (w - c) ∂W := by rw [hπ.map_snd] have hplusProd := coupling_integrable_mul hplus hY2 hW2 have hminusProd := coupling_integrable_mul hminus hY2 hW2 have hplusFst : Integrable (fun p : ℝ × ℝ => p.1) πplus := (coupling_fst_memLp hplus hY2).integrable (by norm_num) have hminusFst : Integrable (fun p : ℝ × ℝ => p.1) πminus := (coupling_fst_memLp hminus hY2).integrable (by norm_num) have hplusPos : Integrable (fun p : ℝ × ℝ => pos (p.2 - c)) πplus := by apply Integrable.div_const apply Integrable.add · exact ((coupling_snd_memLp hplus hW2).integrable (by norm_num)).sub (integrable_const c) · exact (((coupling_snd_memLp hplus hW2).integrable (by norm_num)).sub (integrable_const c)).abs have hminusNeg : Integrable (fun p : ℝ × ℝ => neg (p.2 - c)) πminus := by apply Integrable.div_const apply Integrable.add · exact (((coupling_snd_memLp hminus hW2).integrable (by norm_num)).sub (integrable_const c)).neg · exact (((coupling_snd_memLp hminus hW2).integrable (by norm_num)).sub (integrable_const c)).abs have hu : (∫ p, p.1 * p.2 ∂πplus) ≤ c * (∫ y, y ∂Y) + ∫ w, pos (w - c) ∂W := by rw [← coupling_integral_fst hplus hY2, ← hposMap πplus hplus, ← integral_const_mul, ← integral_add (hplusFst.const_mul c) hplusPos] apply integral_mono_ae hplusProd ((hplusFst.const_mul c).add hplusPos) filter_upwards [hYae πplus hplus] with p hp dsimp [pos] have habs : -(p.2 - c) ≤ |p.2 - c| := neg_le_abs (p.2 - c) have habs' : p.2 - c ≤ |p.2 - c| := le_abs_self (p.2 - c) by_cases hw : 0 ≤ p.2 - c · rw [abs_of_nonneg hw] nlinarith [hp.2] · rw [abs_of_nonpos (le_of_not_ge hw)] nlinarith [hp.1] have hl : c * (∫ y, y ∂Y) - ∫ w, neg (w - c) ∂W ≤ ∫ p, p.1 * p.2 ∂πminus := by rw [← coupling_integral_fst hminus hY2, ← hnegMap πminus hminus, ← integral_const_mul, ← integral_sub (hminusFst.const_mul c) hminusNeg] apply integral_mono_ae ((hminusFst.const_mul c).sub hminusNeg) hminusProd filter_upwards [hYae πminus hminus] with p hp dsimp [neg] by_cases hw : 0 ≤ p.2 - c · rw [abs_of_nonneg hw] nlinarith [hp.1] · rw [abs_of_nonpos (le_of_not_ge hw)] nlinarith [hp.2] have hsplit : (∫ w, pos (w - c) ∂W) + (∫ w, neg (w - c) ∂W) = ∫ w, |w - c| ∂W := by rw [← integral_add hposInt hnegInt] apply integral_congr_ae filter_upwards with w dsimp [pos, neg] ring linarith
CausalSmith.PartialID.UnlinkedPropensityAte.coupling_product_gap_le_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:90
theorem coupling_product_gap_eq_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
πminus πplus :
Measure (ℝ × ℝ)
hminus :
IsCoupling πminus Y W
hplus :
IsCoupling πplus Y W
hY2 :
MemLp (fun y : ℝ => y) 2 Y
hW2 :
MemLp (fun w : ℝ => w) 2 W
c :
ℝ
hupper :
∀ᵐ p ∂πplus, p.1 * p.2 = c * p.1 + ((p.2 - c) + |p.2 - c|) / 2
hlower :
∀ᵐ p ∂πminus, p.1 * p.2 = c * p.1 - (-(p.2 - c) + |p.2 - c|) / 2
(∫ p, p.1 * p.2 ∂πplus) - (∫ p, p.1 * p.2 ∂πminus) = ∫ w, |w - c| ∂W
Proof (Lean source)
lemma coupling_product_gap_eq_absoluteDeviation {Y W : Measure ℝ} [IsProbabilityMeasure Y] [IsProbabilityMeasure W] {πminus πplus : Measure (ℝ × ℝ)} (hminus : IsCoupling πminus Y W) (hplus : IsCoupling πplus Y W) (hY2 : MemLp (fun y : ℝ => y) 2 Y) (hW2 : MemLp (fun w : ℝ => w) 2 W) (c : ℝ) (hupper : ∀ᵐ p ∂πplus, p.1 * p.2 = c * p.1 + ((p.2 - c) + |p.2 - c|) / 2) (hlower : ∀ᵐ p ∂πminus, p.1 * p.2 = c * p.1 - (-(p.2 - c) + |p.2 - c|) / 2) : (∫ p, p.1 * p.2 ∂πplus) - (∫ p, p.1 * p.2 ∂πminus) = ∫ w, |w - c| ∂W := by letI : IsProbabilityMeasure πminus := hminus.isProbabilityMeasure letI : IsProbabilityMeasure πplus := hplus.isProbabilityMeasure let pos : ℝ → ℝ := fun x => (x + |x|) / 2 let neg : ℝ → ℝ := fun x => (-x + |x|) / 2 have hposInt : Integrable (fun w : ℝ => pos (w - c)) W := by exact (((hW2.integrable (by norm_num)).sub (integrable_const c)).add ((hW2.integrable (by norm_num)).sub (integrable_const c)).abs).div_const 2 have hnegInt : Integrable (fun w : ℝ => neg (w - c)) W := by exact ((((hW2.integrable (by norm_num)).sub (integrable_const c)).neg).add ((hW2.integrable (by norm_num)).sub (integrable_const c)).abs).div_const 2 have hposMap : (∫ p, pos (p.2 - c) ∂πplus) = ∫ w, pos (w - c) ∂W := by calc _ = ∫ w, pos (w - c) ∂(πplus.map snd) := by rw [integral_map measurable_snd.aemeasurable] fun_prop _ = _ := by rw [hplus.map_snd] have hnegMap : (∫ p, neg (p.2 - c) ∂πminus) = ∫ w, neg (w - c) ∂W := by calc _ = ∫ w, neg (w - c) ∂(πminus.map snd) := by rw [integral_map measurable_snd.aemeasurable] fun_prop _ = _ := by rw [hminus.map_snd] have hplusFst : Integrable (fun p : ℝ × ℝ => p.1) πplus := (coupling_fst_memLp hplus hY2).integrable (by norm_num) have hminusFst : Integrable (fun p : ℝ × ℝ => p.1) πminus := (coupling_fst_memLp hminus hY2).integrable (by norm_num) have hplusPos : Integrable (fun p : ℝ × ℝ => pos (p.2 - c)) πplus := by apply Integrable.div_const apply Integrable.add · exact ((coupling_snd_memLp hplus hW2).integrable (by norm_num)).sub (integrable_const c) · exact (((coupling_snd_memLp hplus hW2).integrable (by norm_num)).sub (integrable_const c)).abs have hminusNeg : Integrable (fun p : ℝ × ℝ => neg (p.2 - c)) πminus := by apply Integrable.div_const apply Integrable.add · exact (((coupling_snd_memLp hminus hW2).integrable (by norm_num)).sub (integrable_const c)).neg · exact (((coupling_snd_memLp hminus hW2).integrable (by norm_num)).sub (integrable_const c)).abs have hu : (∫ p, p.1 * p.2 ∂πplus) = c * (∫ y, y ∂Y) + ∫ w, pos (w - c) ∂W := by rw [← coupling_integral_fst hplus hY2, ← hposMap, ← integral_const_mul, ← integral_add (hplusFst.const_mul c) hplusPos] exact integral_congr_ae (hupper.mono fun p hp => by simpa [pos] using hp) have hl : (∫ p, p.1 * p.2 ∂πminus) = c * (∫ y, y ∂Y) - ∫ w, neg (w - c) ∂W := by rw [← coupling_integral_fst hminus hY2, ← hnegMap, ← integral_const_mul, ← integral_sub (hminusFst.const_mul c) hminusNeg] exact integral_congr_ae (hlower.mono fun p hp => by simpa [neg] using hp) have hsplit : (∫ w, pos (w - c) ∂W) + (∫ w, neg (w - c) ∂W) = ∫ w, |w - c| ∂W := by rw [← integral_add hposInt hnegInt] apply integral_congr_ae filter_upwards with w dsimp [pos, neg] ring rw [hu, hl] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.coupling_product_gap_eq_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:195
theorem fairBernoulli_monotoneCoupling_gap_eq_medianAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
hW2 :
MemLp (fun w : ℝ => w) 2 W
(∫ p, p.1 * p.2 ∂ (comonotoneCoupling fairBernoulliLaw W))
- (∫ p, p.1 * p.2 ∂ (countermonotoneCoupling fairBernoulliLaw W))
= ∫ w, |w - quantile W (1 / 2)| ∂W
Proof (Lean source)
lemma fairBernoulli_monotoneCoupling_gap_eq_medianAbsoluteDeviation (W : Measure ℝ) [IsProbabilityMeasure W] (hW2 : MemLp (fun w : ℝ => w) 2 W) : (∫ p, p.1 * p.2 ∂ (Causalean.Stat.comonotoneCoupling fairBernoulliLaw W)) - (∫ p, p.1 * p.2 ∂ (Causalean.Stat.countermonotoneCoupling fairBernoulliLaw W)) = ∫ w, |w - quantile W (1 / 2)| ∂W := by let m := quantile W (1 / 2) have hYae : ∀ᵐ y ∂fairBernoulliLaw, y ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] simp [fairBernoulliLaw] have hY2 : MemLp (fun y : ℝ => y) 2 fairBernoulliLaw := by apply memLp_of_bounded · filter_upwards [hYae] with y hy exact hy · fun_prop have hupper : ∀ᵐ p ∂(Causalean.Stat.comonotoneCoupling fairBernoulliLaw W), p.1 * p.2 = m * p.1 + ((p.2 - m) + |p.2 - m|) / 2 := by unfold Causalean.Stat.comonotoneCoupling let φ : ℝ → ℝ × ℝ := fun u => (quantile fairBernoulliLaw u, quantile W u) have hφ : AEMeasurable φ unifOI := (aemeasurable_quantile_unifOI fairBernoulliLaw).prodMk (aemeasurable_quantile_unifOI W) apply (ae_map_iff hφ (by exact measurableSet_eq_fun (by fun_prop) (by fun_prop))).2 filter_upwards [ae_restrict_mem measurableSet_Ioo] with u hu change quantile fairBernoulliLaw u * quantile W u = m * quantile fairBernoulliLaw u + ((quantile W u - m) + |quantile W u - m|) / 2 rw [fairBernoulliLaw_quantile u hu.1 hu.2] by_cases huh : u ≤ 1 / 2 · have hqm : quantile W u ≤ m := by dsimp [m] exact quantile_mono hu.1 (by norm_num) huh norm_num [div_eq_mul_inv] at huh ⊢ have hstep : u ≤ (2 : ℝ)⁻¹ := by convert huh using 1 <;> norm_num simp [hstep, abs_of_nonpos (sub_nonpos.mpr hqm)] · have hmq : m ≤ quantile W u := by dsimp [m] exact quantile_mono (by norm_num) hu.2 (le_of_not_ge huh) norm_num [div_eq_mul_inv] at huh ⊢ have hstep : ¬u ≤ (1 / 2 : ℝ) := not_le_of_gt huh rw [if_neg hstep, if_neg hstep, abs_of_nonneg (sub_nonneg.mpr hmq)] ring have hlower : ∀ᵐ p ∂(Causalean.Stat.countermonotoneCoupling fairBernoulliLaw W), p.1 * p.2 = m * p.1 - (-(p.2 - m) + |p.2 - m|) / 2 := by unfold Causalean.Stat.countermonotoneCoupling let r : ℝ → ℝ := fun u => 1 - u have hr : Measurable r := by fun_prop have hWmap : AEMeasurable (quantile W) (Causalean.Stat.unifOI.map r) := by simpa [r, map_one_sub_unifOI] using (aemeasurable_quantile_unifOI W) have hWr : AEMeasurable (fun u : ℝ => quantile W (1 - u)) unifOI := by simpa [r, Function.comp_def] using hWmap.comp_measurable hr let φ : ℝ → ℝ × ℝ := fun u => (quantile fairBernoulliLaw u, quantile W (1 - u)) have hφ : AEMeasurable φ unifOI := (aemeasurable_quantile_unifOI fairBernoulliLaw).prodMk hWr apply (ae_map_iff hφ (by exact measurableSet_eq_fun (by fun_prop) (by fun_prop))).2 filter_upwards [ae_restrict_mem measurableSet_Ioo] with u hu have hv0 : 0 < 1 - u := by linarith [hu.2] have hv1 : 1 - u < 1 := by linarith [hu.1] change quantile fairBernoulliLaw u * quantile W (1 - u) = m * quantile fairBernoulliLaw u - (-(quantile W (1 - u) - m) + |quantile W (1 - u) - m|) / 2 rw [fairBernoulliLaw_quantile u hu.1 hu.2] by_cases huh : u ≤ 1 / 2 · have hmq : m ≤ quantile W (1 - u) := by dsimp [m] apply quantile_mono (by norm_num) hv1 linarith norm_num [div_eq_mul_inv] at huh ⊢ have hstep : u ≤ (2 : ℝ)⁻¹ := by convert huh using 1 <;> norm_num simp [hstep, abs_of_nonneg (sub_nonneg.mpr hmq)] · have hqm : quantile W (1 - u) ≤ m := by dsimp [m] apply quantile_mono hv0 (by norm_num) linarith norm_num [div_eq_mul_inv] at huh ⊢ have hstep : ¬u ≤ (1 / 2 : ℝ) := not_le_of_gt huh rw [if_neg hstep, if_neg hstep, abs_of_nonpos (sub_nonpos.mpr hqm)] ring simpa [m] using coupling_product_gap_eq_absoluteDeviation (isCoupling_countermonotoneCoupling fairBernoulliLaw W) (isCoupling_comonotoneCoupling fairBernoulliLaw W) hY2 hW2 m hupper hlower
CausalSmith.PartialID.UnlinkedPropensityAte.fairBernoulli_monotoneCoupling_gap_eq_medianAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:273
theorem fairBernoulli_monotoneCoupling_gap_eq_sInf_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
hW2 :
MemLp (fun w : ℝ => w) 2 W
C :
Set ℝ
hC :
C.Nonempty
hmedian :
quantile W (1 / 2) ∈ C
(∫ p, p.1 * p.2 ∂ (comonotoneCoupling fairBernoulliLaw W))
- (∫ p, p.1 * p.2 ∂ (countermonotoneCoupling fairBernoulliLaw W))
= sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W}
Proof (Lean source)
lemma fairBernoulli_monotoneCoupling_gap_eq_sInf_absoluteDeviation (W : Measure ℝ) [IsProbabilityMeasure W] (hW2 : MemLp (fun w : ℝ => w) 2 W) (C : Set ℝ) (hC : C.Nonempty) (hmedian : quantile W (1 / 2) ∈ C) : (∫ p, p.1 * p.2 ∂ (comonotoneCoupling fairBernoulliLaw W)) - (∫ p, p.1 * p.2 ∂ (countermonotoneCoupling fairBernoulliLaw W)) = sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} := by have hYsupport : fairBernoulliLaw (Icc (0 : ℝ) 1)ᶜ = 0 := by simp [fairBernoulliLaw] have hYae : ∀ᵐ y ∂fairBernoulliLaw, y ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] exact hYsupport have hY2 : MemLp (fun y : ℝ => y) 2 fairBernoulliLaw := by apply memLp_of_bounded · filter_upwards [hYae] with y hy exact hy · fun_prop have hle : (∫ p, p.1 * p.2 ∂ (comonotoneCoupling fairBernoulliLaw W)) - (∫ p, p.1 * p.2 ∂ (countermonotoneCoupling fairBernoulliLaw W)) ≤ sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} := by apply le_csInf · rcases hC with ⟨c, hc⟩ exact ⟨∫ w, |w - c| ∂W, c, hc, rfl⟩ · intro v hv rcases hv with ⟨c, hc, rfl⟩ exact coupling_product_gap_le_absoluteDeviation (isCoupling_countermonotoneCoupling fairBernoulliLaw W) (isCoupling_comonotoneCoupling fairBernoulliLaw W) hYsupport hY2 hW2 c have heq := fairBernoulli_monotoneCoupling_gap_eq_medianAbsoluteDeviation W hW2 have hbelow : BddBelow {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} := by refine ⟨0, ?_⟩ intro v hv rcases hv with ⟨c, hc, rfl⟩ exact integral_nonneg fun w => abs_nonneg _ have hinf : sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} ≤ ∫ w, |w - quantile W (1 / 2)| ∂W := csInf_le hbelow ⟨quantile W (1 / 2), hmedian, rfl⟩ exact le_antisymm hle (heq.symm ▸ hinf)
CausalSmith.PartialID.UnlinkedPropensityAte.fairBernoulli_monotoneCoupling_gap_eq_sInf_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:373
theorem monotoneCoupling_product_gap_le_sInf_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
hYsupport :
Y (Icc (0 : ℝ) 1)ᶜ = 0
hY2 :
MemLp (fun y : ℝ => y) 2 Y
hW2 :
MemLp (fun w : ℝ => w) 2 W
C :
Set ℝ
hC :
C.Nonempty
(∫ p, p.1 * p.2 ∂(comonotoneCoupling Y W))
- (∫ p, p.1 * p.2 ∂(countermonotoneCoupling Y W))
≤ sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W}
Proof (Lean source)
lemma monotoneCoupling_product_gap_le_sInf_absoluteDeviation (Y W : Measure ℝ) [IsProbabilityMeasure Y] [IsProbabilityMeasure W] (hYsupport : Y (Icc (0 : ℝ) 1)ᶜ = 0) (hY2 : MemLp (fun y : ℝ => y) 2 Y) (hW2 : MemLp (fun w : ℝ => w) 2 W) (C : Set ℝ) (hC : C.Nonempty) : (∫ p, p.1 * p.2 ∂(comonotoneCoupling Y W)) - (∫ p, p.1 * p.2 ∂(countermonotoneCoupling Y W)) ≤ sInf {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} := by apply le_csInf · rcases hC with ⟨c, hc⟩ exact ⟨∫ w, |w - c| ∂W, c, hc, rfl⟩ · intro v hv rcases hv with ⟨c, hc, rfl⟩ exact coupling_product_gap_le_absoluteDeviation (isCoupling_countermonotoneCoupling Y W) (isCoupling_comonotoneCoupling Y W) hYsupport hY2 hW2 c
CausalSmith.PartialID.UnlinkedPropensityAte.monotoneCoupling_product_gap_le_sInf_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelCouplingRange.lean:421
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelDefinitions 6 declarations Definitions shared by the all-label ambiguity proof leaves.

Definitions shared by the all-label ambiguity proof leaves.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
a :
r :
cellAbsoluteDeviation H g a r :
ℝ
sInf {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ e in cell g r, |1 - c * armProb a e| ∂H}
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:14

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
halfOutcomeReleasedLaw H g :
∑ r : LabelSpace J, ∑ a : ArmSpace, ((ofReal (armCellMass H g a r)) / 2) • (Measure.dirac (r, a, (⟨0, by norm_num⟩ : OutcomeSpace)) + Measure.dirac (r, a, (⟨1, by norm_num⟩ : OutcomeSpace)))
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:21
theorem armCellMass_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
0 ≤ armCellMass H g a r
Proof (Lean source)
lemma armCellMass_nonneg {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : 0 ≤ armCellMass H g a r := by unfold armCellMass apply integral_nonneg intro e rcases e.property with ⟨he₁, he₂⟩ rcases hOverlap with ⟨hε, _⟩ cases a <;> simp [armProb] <;> linarith
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:31
theorem armCellMass_sum_arms

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
r :
(∑ a : ArmSpace, armCellMass H g a r) = H.real (cell g r)
Proof (Lean source)
lemma armCellMass_sum_arms {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (r : LabelSpace J) : (∑ a : ArmSpace, armCellMass H g a r) = H.real (cell g r) := by have hint : IntegrableOn (fun e : ScoreSpace ε => (e : ℝ)) (cell g r) H := by apply Integrable.of_bound (by fun_prop) (|ε| + |1 - ε| + 1) filter_upwards [] with e change |(e : ℝ)| ≤ |ε| + |1 - ε| + 1 rcases e.property with ⟨he₁, he₂⟩ have h₁ := neg_le_abs ε have h₂ := le_abs_self (1 - ε) have h₃ := neg_le_abs (1 - ε) have h₄ := le_abs_self ε exact abs_le.mpr ⟨by linarith, by linarith⟩ simp only [Fintype.sum_bool, armCellMass, armProb, Bool.false_eq_true, ↓reduceIte] rw [integral_sub (integrable_const 1) hint] simp
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_sum_arms · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:44
theorem armCellMass_total

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hg :
(∑ r : LabelSpace J, ∑ a : ArmSpace, armCellMass H g a r) = 1
Proof (Lean source)
lemma armCellMass_total {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hg : Measurable g) : (∑ r : LabelSpace J, ∑ a : ArmSpace, armCellMass H g a r) = 1 := by simp_rw [armCellMass_sum_arms H g] have h := MeasureTheory.sum_measureReal_preimage_singleton (μ := H) (s := univ) (f := g) (by intro r hr; exact measurableSet_eq_fun hg measurable_const) simpa [cell, preimage, Set.mem_singleton_iff] using h
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_total · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:65
theorem halfOutcomeReleasedLaw_cellMasses

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
Proof (Lean source)
lemma halfOutcomeReleasedLaw_cellMasses {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : CompatibleCellMasses H g (halfOutcomeReleasedLaw H g) := by unfold CompatibleCellMasses refine ⟨inferInstance, ?_, hg, ?_⟩ · let t (a : ArmSpace) : ENNReal := ∑ r : LabelSpace J, ofReal (armCellMass H g a r) / 2 have htfinite (a : ArmSpace) : t a ≠ ⊤ := by dsimp [t] apply ENNReal.sum_ne_top.mpr intro r hr exact ENNReal.div_ne_top ENNReal.ofReal_ne_top (by norm_num) have htReal (a : ArmSpace) : (t a).toReal = (∑ r : LabelSpace J, armCellMass H g a r) / 2 := by dsimp [t] rw [ENNReal.toReal_sum] · simp_rw [ENNReal.toReal_div, ENNReal.toReal_ofReal (armCellMass_nonneg H g hOverlap a _)] simp [← Finset.sum_div] · intro r hr exact ENNReal.div_ne_top ENNReal.ofReal_ne_top (by norm_num) apply isProbabilityMeasure_iff_real.mpr simp [halfOutcomeReleasedLaw, Measure.real_def, Finset.sum_add_distrib] change (t true + t false + (t true + t false)).toReal = 1 have htf : t true + t false ≠ ⊤ := ENNReal.add_ne_top.mpr ⟨htfinite true, htfinite false⟩ rw [ENNReal.toReal_add htf htf, ENNReal.toReal_add (htfinite true) (htfinite false), htReal true, htReal false] have htotal := armCellMass_total H g hg simp only [Fintype.sum_bool, Finset.sum_add_distrib] at htotal linarith · intro a r simp [halfOutcomeReleasedLaw, Measure.real_def, indicator] cases a <;> simp [Finset.sum_add_distrib] all_goals exact armCellMass_nonneg H g hOverlap _ r
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw_cellMasses · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelDefinitions.lean:76
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelFairCell 14 declarations Fair-outcome cell identities for the all-label ambiguity witness.

Fair-outcome cell identities for the all-label ambiguity witness.

theorem halfOutcomeReleasedLaw_restrictedOutcomeMap

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
((halfOutcomeReleasedLaw H g).restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => (z.2.2 : ℝ))
= (ofReal (armCellMass H g a r) / 2) • (Measure.dirac 0 + Measure.dirac 1)
Proof (Lean source)
lemma halfOutcomeReleasedLaw_restrictedOutcomeMap {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) : ((halfOutcomeReleasedLaw H g).restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => (z.2.2 : ℝ)) = (ofReal (armCellMass H g a r) / 2) • (Measure.dirac 0 + Measure.dirac 1) := by classical ext B hB rw [Measure.map_apply (by fun_prop) hB] rw [Measure.restrict_apply (hB.preimage (by fun_prop))] simp [halfOutcomeReleasedLaw, hB] rw [Finset.sum_eq_single r] · cases a <;> by_cases h0 : (0 : ℝ) ∈ B <;> by_cases h1 : (1 : ℝ) ∈ B <;> simp [indicator, h0, h1] · intro b hb hbr simp [hbr] · simp
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw_restrictedOutcomeMap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:18
theorem halfOutcomeReleasedLaw_armCellOutcomeLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
armCellOutcomeLaw (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg).2.1 a r (by rw [(halfOutcomeReleasedLaw_cellMasses H g hOverlap hg).2.2.2 a r] exact hq)
Proof (Lean source)
lemma halfOutcomeReleasedLaw_armCellOutcomeLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : armCellOutcomeLaw (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg).2.1 a r (by rw [(halfOutcomeReleasedLaw_cellMasses H g hOverlap hg).2.2.2 a r] exact hq) = fairBernoulliLaw := by let Prel := halfOutcomeReleasedLaw H g let hMass := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg letI : IsProbabilityMeasure Prel := hMass.2.1 have hmassReal : Prel.real {z | z.1 = r ∧ z.2.1 = a} = armCellMass H g a r := hMass.2.2.2 a r have hmass : Prel {z | z.1 = r ∧ z.2.1 = a} = ofReal (armCellMass H g a r) := by calc _ = ofReal (Prel.real {z | z.1 = r ∧ z.2.1 = a}) := (ENNReal.ofReal_toReal (measure_ne_top _ _)).symm _ = _ := by rw [hmassReal] have hq0 : ofReal (armCellMass H g a r) ≠ 0 := by simp [ENNReal.ofReal_eq_zero, not_le.mpr hq] unfold armCellOutcomeLaw rw [halfOutcomeReleasedLaw_restrictedOutcomeMap H g hOverlap hg a r] rw [show (halfOutcomeReleasedLaw H g) {z | z.1 = r ∧ z.2.1 = a} = ofReal (armCellMass H g a r) by exact hmass] rw [smul_smul] unfold fairBernoulliLaw congr 1 rw [div_eq_mul_inv] rw [← mul_assoc, ENNReal.inv_mul_cancel hq0 ENNReal.ofReal_ne_top] simp
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw_armCellOutcomeLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:41
theorem inverseArmProb_mem_admissibleCenters

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
e :
(armProb a e)⁻¹ ∈ Icc ((1 - ε)⁻¹) ε⁻¹
Proof (Lean source)
lemma inverseArmProb_mem_admissibleCenters {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (e : ScoreSpace ε) : (armProb a e)⁻¹ ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := by have hb := projectionArmProb_bounds hOverlap a e have hp : 0 < armProb a e := lt_of_lt_of_le hOverlap.1 hb.1 have hOne : 0 < 1 - ε := by linarith [hOverlap.1, hOverlap.2] have hpUpper : armProb a e ≤ 1 - ε := by rcases e.property with ⟨he0, he1⟩ cases a <;> simp [armProb] <;> linarith exact ⟨(inv_le_inv₀ hOne hp).2 hpUpper, (inv_le_inv₀ hp hOverlap.1).2 hb.1⟩
CausalSmith.PartialID.UnlinkedPropensityAte.inverseArmProb_mem_admissibleCenters · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:80
theorem armCellWeightLaw_support_admissibleCenters

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
(armCellWeightLaw H inferInstance g hg a r hq) (Icc ((1 - ε)⁻¹) ε⁻¹)ᶜ = 0
Proof (Lean source)
lemma armCellWeightLaw_support_admissibleCenters {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : (armCellWeightLaw H inferInstance g hg a r hq) (Icc ((1 - ε)⁻¹) ε⁻¹)ᶜ = 0 := by let G := armCellScoreLaw H inferInstance g hg a r hq letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hg hOverlap a r hq unfold armCellWeightLaw rw [Measure.map_apply (measurable_inverseArmProb a) measurableSet_Icc.compl] have hpre : (fun e : ScoreSpace ε => (armProb a e)⁻¹) ⁻¹' (Icc ((1 - ε)⁻¹) ε⁻¹)ᶜ = ∅ := by ext e simp only [mem_preimage, mem_compl_iff, mem_Icc, mem_empty_iff_false, iff_false] exact fun he => he (inverseArmProb_mem_admissibleCenters hOverlap a e) rw [hpre] simp
CausalSmith.PartialID.UnlinkedPropensityAte.armCellWeightLaw_support_admissibleCenters · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:93
theorem quantile_mem_Icc_of_support

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b τ :
ℝ
hμ :
μ (Icc a b)ᶜ = 0
hτ0 :
0 < τ
hτ1 :
τ < 1
quantile μ τ ∈ Icc a b
Proof (Lean source)
lemma quantile_mem_Icc_of_support (μ : Measure ℝ) [IsProbabilityMeasure μ] {a b τ : ℝ} (hμ : μ (Icc a b)ᶜ = 0) (hτ0 : 0 < τ) (hτ1 : τ < 1) : quantile μ τ ∈ Icc a b := by have hcompb : μ (Iic b)ᶜ = 0 := measure_mono_null (by intro x hx hxab exact hx hxab.2) hμ have hmu_b : μ (Iic b) = 1 := by have hh := measure_compl (μ := μ) (s := (Iic b)ᶜ) (by measurability) (by simp) simpa only [compl_compl, hcompb, tsub_zero, measure_univ] using hh have hcdfb : cdf μ b = 1 := by rw [cdf_eq_real, measureReal_def, hmu_b] norm_num have hlow (t : ℝ) (ht : t < a) : cdf μ t = 0 := by have hh : μ (Iic t) = 0 := measure_mono_null (by intro x hx hxab exact (not_le_of_gt (lt_of_le_of_lt hx ht)) hxab.1) hμ rw [cdf_eq_real, measureReal_def, hh] norm_num constructor · by_contra hn have hqa : quantile μ τ < a := lt_of_not_ge hn have hle := le_cdf_quantile (μ := μ) hτ1 rw [hlow _ hqa] at hle linarith · exact (quantile_le_iff hτ0 hτ1).mpr (by rw [hcdfb]; exact hτ1.le)
CausalSmith.PartialID.UnlinkedPropensityAte.quantile_mem_Icc_of_support · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:116
theorem armCellWeightLaw_median_mem_admissibleCenters

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
quantile (armCellWeightLaw H inferInstance g hg a r hq) (1 / 2) ∈ Icc ((1 - ε)⁻¹) ε⁻¹
Proof (Lean source)
lemma armCellWeightLaw_median_mem_admissibleCenters {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : quantile (armCellWeightLaw H inferInstance g hg a r hq) (1 / 2) ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := by let G := armCellScoreLaw H inferInstance g hg a r hq letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hg hOverlap a r hq letI : IsProbabilityMeasure (armCellWeightLaw H inferInstance g hg a r hq) := Measure.isProbabilityMeasure_map (measurable_inverseArmProb a).aemeasurable exact quantile_mem_Icc_of_support _ (armCellWeightLaw_support_admissibleCenters H g hOverlap hg a r hq) (by norm_num) (by norm_num)
CausalSmith.PartialID.UnlinkedPropensityAte.armCellWeightLaw_median_mem_admissibleCenters · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:146
theorem armCellWeightLaw_memLp_two

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
MemLp (fun w : ℝ => w) 2 (armCellWeightLaw H inferInstance g hg a r hq)
Proof (Lean source)
lemma armCellWeightLaw_memLp_two {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : MemLp (fun w : ℝ => w) 2 (armCellWeightLaw H inferInstance g hg a r hq) := by let G := armCellScoreLaw H inferInstance g hg a r hq letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hg hOverlap a r hq letI : IsProbabilityMeasure (armCellWeightLaw H inferInstance g hg a r hq) := Measure.isProbabilityMeasure_map (measurable_inverseArmProb a).aemeasurable have hs := armCellWeightLaw_support_admissibleCenters H g hOverlap hg a r hq have hlower : 0 ≤ (1 - ε)⁻¹ := by apply inv_nonneg.mpr linarith [hOverlap.1, hOverlap.2] have hs' : (armCellWeightLaw H inferInstance g hg a r hq) (Icc 0 ε⁻¹)ᶜ = 0 := by apply measure_mono_null _ hs intro w hw hmem exact hw ⟨hlower.trans hmem.1, hmem.2⟩ apply memLp_of_bounded · rw [ae_iff] exact hs' · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.armCellWeightLaw_memLp_two · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:165
theorem fairOutcome_normalizedQuantileGap_eq_sInf_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
- (∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) (1 - u))
= sInf {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ w, |w - c| ∂ (armCellWeightLaw H inferInstance g hg a r hq)}
Proof (Lean source)
lemma fairOutcome_normalizedQuantileGap_eq_sInf_absoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : (∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) u) - (∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) (1 - u)) = sInf {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ w, |w - c| ∂ (armCellWeightLaw H inferInstance g hg a r hq)} := by let W := armCellWeightLaw H inferInstance g hg a r hq let G := armCellScoreLaw H inferInstance g hg a r hq letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hg hOverlap a r hq letI : IsProbabilityMeasure W := Measure.isProbabilityMeasure_map (measurable_inverseArmProb a).aemeasurable have hYae : ∀ᵐ y ∂fairBernoulliLaw, y ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] simp [fairBernoulliLaw] have hY2 : MemLp (fun y : ℝ => y) 2 fairBernoulliLaw := by apply memLp_of_bounded · exact hYae · fun_prop have hW2 : MemLp (fun w : ℝ => w) 2 W := armCellWeightLaw_memLp_two H g hOverlap hg a r hq have hC : (Icc ((1 - ε)⁻¹) ε⁻¹).Nonempty := by refine ⟨Causalean.Stat.quantile W (1 / 2), ?_⟩ exact armCellWeightLaw_median_mem_admissibleCenters H g hOverlap hg a r hq have heq := fairBernoulli_monotoneCoupling_gap_eq_sInf_absoluteDeviation W hW2 (Icc ((1 - ε)⁻¹) ε⁻¹) hC (armCellWeightLaw_median_mem_admissibleCenters H g hOverlap hg a r hq) rw [product_expectation_comonotoneCoupling_interval fairBernoulliLaw W hY2 hW2, product_expectation_countermonotoneCoupling_interval fairBernoulliLaw W] at heq simpa [W] using heq
CausalSmith.PartialID.UnlinkedPropensityAte.fairOutcome_normalizedQuantileGap_eq_sInf_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:195
theorem fairOutcome_positiveCell_gap_eq_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
armCellMass H g a r * ((∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) u) - (∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) (1 - u)))
Proof (Lean source)
lemma fairOutcome_positiveCell_gap_eq_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : armCellMass H g a r * ((∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) u) - (∫ u in (0 : ℝ)..1, generalizedQuantile fairBernoulliLaw u * generalizedQuantile (armCellWeightLaw H inferInstance g hg a r hq) (1 - u))) = cellAbsoluteDeviation H g a r := by let Prel := halfOutcomeReleasedLaw H g let hMass := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg let W := armCellWeightLaw H inferInstance g hg a r hq let A : Set ℝ := {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ w, |w - c| ∂W} let B : Set ℝ := {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ e in cell g r, |1 - c * armProb a e| ∂H} have hscale (c : ℝ) : armCellMass H g a r * (∫ w, |w - c| ∂W) = ∫ e in cell g r, |1 - c * armProb a e| ∂H := by exact armCellWeightLaw_absoluteDeviation H g Prel hMass hOverlap a r hq c have hset : B = armCellMass H g a r • A := by ext v constructor · rintro ⟨c, hc, rfl⟩ rw [Set.mem_smul_set] refine ⟨∫ w, |w - c| ∂W, ⟨c, hc, rfl⟩, ?_⟩ simpa [smul_eq_mul] using hscale c · intro hv rw [Set.mem_smul_set] at hv rcases hv with ⟨x, ⟨c, hc, rfl⟩, rfl⟩ refine ⟨c, hc, ?_⟩ simpa [smul_eq_mul] using hscale c rw [fairOutcome_normalizedQuantileGap_eq_sInf_absoluteDeviation H g hOverlap hg a r hq] unfold cellAbsoluteDeviation change armCellMass H g a r * sInf A = sInf B rw [hset, Real.sInf_smul_of_nonneg hq.le, smul_eq_mul]
CausalSmith.PartialID.UnlinkedPropensityAte.fairOutcome_positiveCell_gap_eq_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:243
theorem halfOutcomeReleasedLaw_positiveCell_gap_eq_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass H g a r
hMass :
armCellMass H g a r * ((∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u) - (∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u)))
Proof (Lean source)
lemma halfOutcomeReleasedLaw_positiveCell_gap_eq_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : let hMass := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg armCellMass H g a r * ((∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u) - (∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u))) = cellAbsoluteDeviation H g a r := by dsimp only rw [halfOutcomeReleasedLaw_armCellOutcomeLaw H g hOverlap hg a r hq] exact fairOutcome_positiveCell_gap_eq_cellAbsoluteDeviation H g hOverlap hg a r hq
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw_positiveCell_gap_eq_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:292
theorem cellAbsoluteDeviation_eq_zero_of_armCellMass_nonpos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hq :
¬0 < armCellMass H g a r
Proof (Lean source)
lemma cellAbsoluteDeviation_eq_zero_of_armCellMass_nonpos {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : ¬0 < armCellMass H g a r) : cellAbsoluteDeviation H g a r = 0 := by have hInt : IntegrableOn (fun e : ScoreSpace ε => armProb a e) (cell g r) H := by apply Integrable.of_bound (by cases a <;> simp [armProb] <;> fun_prop) 1 filter_upwards [] with e rcases e.property with ⟨he0, he1⟩ cases a <;> simp [armProb, abs_le] <;> constructor <;> linarith [hOverlap.1, hOverlap.2] have hlower : ε * H.real (cell g r) ≤ armCellMass H g a r := by have hmono : (∫ _ in cell g r, ε ∂H) ≤ ∫ e in cell g r, armProb a e ∂H := by apply integral_mono (integrable_const ε) hInt intro e rcases e.property with ⟨he0, he1⟩ cases a <;> simp [armProb] <;> linarith simpa [armCellMass, Measure.real_def, mul_comm] using hmono have hq0 : armCellMass H g a r ≤ 0 := le_of_not_gt hq have hreal0 : H.real (cell g r) = 0 := by have hrealNonneg : 0 ≤ H.real (cell g r) := measureReal_nonneg nlinarith [hOverlap.1] have hmeasure0 : H (cell g r) = 0 := by exact ((ENNReal.toReal_eq_zero_iff _).mp hreal0).resolve_right (measure_ne_top H (cell g r)) have hrestrict : H.restrict (cell g r) = 0 := by ext B hB rw [Measure.restrict_apply hB] exact measure_mono_null inter_subset_right hmeasure0 have hzero (c : ℝ) : (∫ e in cell g r, |1 - c * armProb a e| ∂H) = 0 := by change (∫ e, |1 - c * armProb a e| ∂(H.restrict (cell g r))) = 0 rw [hrestrict] simp have hC : (Icc ((1 - ε)⁻¹) ε⁻¹).Nonempty := by refine ⟨ε⁻¹, ?_, le_rfl⟩ have hOne : 0 < 1 - ε := by linarith [hOverlap.1, hOverlap.2] exact (inv_le_inv₀ hOne hOverlap.1).2 (by linarith [hOverlap.2]) unfold cellAbsoluteDeviation have hset : {v : ℝ | ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, v = ∫ e in cell g r, |1 - c * armProb a e| ∂H} = {0} := by ext v constructor · rintro ⟨c, hc, rfl⟩ simp [hzero c] · intro hv have hv0 : v = 0 := by simpa using hv rcases hC with ⟨c, hc⟩ exact ⟨c, hc, by rw [hzero c, hv0]⟩ rw [hset] simp
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_eq_zero_of_armCellMass_nonpos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:319
theorem halfOutcomeReleasedLaw_cellGap_eq_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
r :
hMass :
(if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u else 0)
- (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u) else 0)
Proof (Lean source)
lemma halfOutcomeReleasedLaw_cellGap_eq_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) : let hMass := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u else 0) - (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw (halfOutcomeReleasedLaw H g) hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u) else 0) = cellAbsoluteDeviation H g a r := by dsimp only by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] have hpos := halfOutcomeReleasedLaw_positiveCell_gap_eq_cellAbsoluteDeviation H g hOverlap hg a r hq dsimp only at hpos ring_nf at hpos ⊢ exact hpos · simp only [hq, dif_neg, zero_sub] simpa [hq] using (cellAbsoluteDeviation_eq_zero_of_armCellMass_nonpos H g hOverlap hg a r hq).symm
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcomeReleasedLaw_cellGap_eq_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:379
theorem halfOutcome_muUpper_sub_muLower_eq_sum_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
a :
hMass :
- muLower H g (halfOutcomeReleasedLaw H g) hMass a
= ∑ r : LabelSpace J, cellAbsoluteDeviation H g a r
Proof (Lean source)
lemma halfOutcome_muUpper_sub_muLower_eq_sum_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) : let hMass := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg muUpper H g (halfOutcomeReleasedLaw H g) hMass a - muLower H g (halfOutcomeReleasedLaw H g) hMass a = ∑ r : LabelSpace J, cellAbsoluteDeviation H g a r := by dsimp only unfold muUpper muLower rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro r hr exact halfOutcomeReleasedLaw_cellGap_eq_cellAbsoluteDeviation H g hOverlap hg a r
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcome_muUpper_sub_muLower_eq_sum_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:419
theorem halfOutcome_sharpATELength_eq_sum_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
Proof (Lean source)
lemma halfOutcome_sharpATELength_eq_sum_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) = ∑ r : LabelSpace J, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) := by have htrue := halfOutcome_muUpper_sub_muLower_eq_sum_cellAbsoluteDeviation H g hOverlap hg true have hfalse := halfOutcome_muUpper_sub_muLower_eq_sum_cellAbsoluteDeviation H g hOverlap hg false dsimp only at htrue hfalse unfold sharpATELength rw [Finset.sum_add_distrib] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcome_sharpATELength_eq_sum_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelFairCell.lean:437
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelSupremumUpper 2 declarations The cellwise reciprocal-score deviation bounds are aggregated over both arms and then lifted through the supremum over randomized causal laws.

Universal upper bound for worst case all-label ambiguity

The cellwise reciprocal-score deviation bounds are aggregated over both arms and then lifted through the supremum over randomized causal laws.

theorem randomizedCausalLaw_sharpATELength_le_sum_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
P :
hP :
Proof (Lean source)
lemma randomizedCausalLaw_sharpATELength_le_sum_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (P : Measure (FullRow ε J)) (hP : RandomizedCausalLaw H g P) : sharpATELength H g (releasedLaw P) (compatibleCellMasses_of_randomizedCausalLaw H g P hP) ≤ ∑ r : LabelSpace J, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) := by let hMass := compatibleCellMasses_of_randomizedCausalLaw H g P hP have htrue := muUpper_sub_muLower_le_sum_cellAbsoluteDeviation H g (releasedLaw P) hMass hOverlap true have hfalse := muUpper_sub_muLower_le_sum_cellAbsoluteDeviation H g (releasedLaw P) hMass hOverlap false unfold sharpATELength rw [Finset.sum_add_distrib] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedCausalLaw_sharpATELength_le_sum_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelSupremumUpper.lean:21
theorem worstCaseAmbiguity_le_sum_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
Proof (Lean source)
lemma worstCaseAmbiguity_le_sum_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : worstCaseAmbiguity H g ≤ ∑ r : LabelSpace J, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) := by unfold worstCaseAmbiguity apply csSup_le · let Prel := halfOutcomeReleasedLaw H g let hMass : CompatibleCellMasses H g Prel := halfOutcomeReleasedLaw_cellMasses H g hOverlap hg letI : IsProbabilityMeasure Prel := hMass.2.1 let P := reconstructedFullLaw H g Prel hg have hComp : CompatibleCausalLaw H g Prel P := reconstructedFullLaw_compatibleCausalLaw H g Prel hg hMass hOverlap have hRandom : RandomizedCausalLaw H g P := { probability := hComp.probability measurableRelease := hComp.measurableRelease scoreMarginal := hComp.scoreMarginal randomizedAssignment := hComp.randomizedAssignment consistency := hComp.consistency deterministicRelease := hComp.deterministicRelease } exact ⟨sharpATELength H g (releasedLaw P) (compatibleCellMasses_of_randomizedCausalLaw H g P hRandom), P, hRandom.probability, hRandom, rfl⟩ · intro d hd rcases hd with ⟨P, hprob, hP, rfl⟩ exact randomizedCausalLaw_sharpATELength_le_sum_cellAbsoluteDeviation H g hOverlap P hP
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_le_sum_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelSupremumUpper.lean:41
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.AllLabelUpperCell 2 declarations This file bounds each normalized quantile-product cell range by the corresponding unnormalized reciprocal-score absolute deviation, including cells of zero arm mass.

Universal upper bound for all-label cell endpoint gaps

This file bounds each normalized quantile-product cell range by the corresponding unnormalized reciprocal-score absolute deviation, including cells of zero arm mass.

theorem armCell_quantileEndpoint_gap_le_absoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
(if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u else 0)
- (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u) else 0)
Proof (Lean source)
lemma armCell_quantileEndpoint_gap_le_absoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) u else 0) - (if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ u in (0 : ℝ)..1, generalizedQuantile (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) u * generalizedQuantile (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) (1 - u) else 0) ≤ cellAbsoluteDeviation H g a r := by by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure (armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq) := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) have hYsup : Y (Icc 0 1)ᶜ = 0 := by dsimp [Y, armCellOutcomeLaw] rw [Measure.map_apply (by fun_prop) measurableSet_Icc.compl] have hpre : (fun z : Observation J => (z.2.2 : ℝ)) ⁻¹' (Icc 0 1)ᶜ = ∅ := by ext z exact iff_false_intro (fun hz => hz z.2.2.property) rw [hpre] simp have hWsup : W (Icc 0 ε⁻¹)ᶜ = 0 := by dsimp [W, armCellWeightLaw] rw [Measure.map_apply (by cases a <;> simp [armProb] <;> fun_prop) measurableSet_Icc.compl] have hpre : (fun e : ScoreSpace ε => (armProb a e)⁻¹) ⁻¹' (Icc 0 ε⁻¹)ᶜ = ∅ := by ext e apply iff_false_intro intro he apply he have hp : ε ≤ armProb a e := by rcases e.property with ⟨he0, he1⟩ cases a <;> simp [armProb] <;> linarith have hpa : 0 < armProb a e := lt_of_lt_of_le hOverlap.1 hp exact ⟨inv_nonneg.mpr hpa.le, (inv_le_inv₀ hpa hOverlap.1).mpr hp⟩ rw [hpre] simp have hY2 : MemLp (fun y : ℝ => y) 2 Y := allLabel_memLp_id_of_support_Icc Y 1 hYsup have hW2 : MemLp (fun w : ℝ => w) 2 W := allLabel_memLp_id_of_support_Icc W ε⁻¹ hWsup let C : Set ℝ := Icc ((1 - ε)⁻¹) ε⁻¹ have hC : C.Nonempty := allLabel_centerSet_nonempty hOverlap have hgap := monotoneCoupling_product_gap_le_sInf_absoluteDeviation Y W hYsup hY2 hW2 C hC rw [product_expectation_comonotoneCoupling_interval Y W hY2 hW2, product_expectation_countermonotoneCoupling_interval Y W] at hgap have hbelow : BddBelow {v : ℝ | ∃ c ∈ C, v = ∫ w, |w - c| ∂W} := by refine ⟨0, ?_⟩ rintro v ⟨c, hc, rfl⟩ exact integral_nonneg fun _ => abs_nonneg _ unfold cellAbsoluteDeviation apply le_csInf · rcases hC with ⟨c, hc⟩ exact ⟨∫ e in cell g r, |1 - c * armProb a e| ∂H, c, hc, rfl⟩ · intro v hv rcases hv with ⟨c, hc, rfl⟩ calc armCellMass H g a r * (∫ u in (0 : ℝ)..1, generalizedQuantile Y u * generalizedQuantile W u) - armCellMass H g a r * (∫ u in (0 : ℝ)..1, generalizedQuantile Y u * generalizedQuantile W (1 - u)) = armCellMass H g a r * ((∫ u in (0 : ℝ)..1, generalizedQuantile Y u * generalizedQuantile W u) - ∫ u in (0 : ℝ)..1, generalizedQuantile Y u * generalizedQuantile W (1 - u)) := by ring _ ≤ armCellMass H g a r * sInf {v : ℝ | ∃ d ∈ C, v = ∫ w, |w - d| ∂W} := mul_le_mul_of_nonneg_left hgap hq.le _ ≤ armCellMass H g a r * (∫ w, |w - c| ∂W) := mul_le_mul_of_nonneg_left (csInf_le hbelow ⟨c, hc, rfl⟩) hq.le _ = ∫ e in cell g r, |1 - c * armProb a e| ∂H := armCellWeightLaw_absoluteDeviation H g Prel hMass hOverlap a r hq c · simp [hq] unfold cellAbsoluteDeviation apply le_csInf · rcases allLabel_centerSet_nonempty hOverlap with ⟨c, hc⟩ exact ⟨∫ e in cell g r, |1 - c * armProb a e| ∂H, c, hc, rfl⟩ · intro v hv rcases hv with ⟨c, hc, rfl⟩ exact integral_nonneg fun _ => abs_nonneg _
CausalSmith.PartialID.UnlinkedPropensityAte.armCell_quantileEndpoint_gap_le_absoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelUpperCell.lean:36
theorem muUpper_sub_muLower_le_sum_cellAbsoluteDeviation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
muUpper H g Prel hMass a - muLower H g Prel hMass a
≤ ∑ r : LabelSpace J, cellAbsoluteDeviation H g a r
Proof (Lean source)
lemma muUpper_sub_muLower_le_sum_cellAbsoluteDeviation {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : muUpper H g Prel hMass a - muLower H g Prel hMass a ≤ ∑ r : LabelSpace J, cellAbsoluteDeviation H g a r := by unfold muUpper muLower rw [← Finset.sum_sub_distrib] exact Finset.sum_le_sum fun r _ => armCell_quantileEndpoint_gap_le_absoluteDeviation H g Prel hMass hOverlap a r
CausalSmith.PartialID.UnlinkedPropensityAte.muUpper_sub_muLower_le_sum_cellAbsoluteDeviation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/AllLabelUpperCell.lean:151
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.CompandingReleaseGeometry 5 declarations Geometry of the ordered companding release used in the unlinked propensity-score ATE analysis.

Geometry of the ordered companding release used in the unlinked propensity-score ATE analysis.

theorem continuousOn_densityExtension

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
ScoreSpace ε → ℝ
shared
hf :
ContinuousOn (densityExtension f) (Icc ε (1 - ε))
Proof (Lean source)
lemma continuousOn_densityExtension {f : ScoreSpace ε → ℝ} (hf : Continuous f) : ContinuousOn (densityExtension f) (Icc ε (1 - ε)) := by rw [continuousOn_iff_continuous_domRestrict] convert hf using 1 funext x simp [densityExtension, x.property]
CausalSmith.PartialID.UnlinkedPropensityAte.continuousOn_densityExtension · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompandingReleaseGeometry.lean:21
theorem continuousOn_compandingWeight

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
hOverlap :
0 < ε ∧ ε < 1 / 2
f :
ScoreSpace ε → ℝ
hf :
ContinuousOn (fun t : ℝ => sqrt (densityExtension f t / (t * (1 - t)))) (Icc ε (1 - ε))
Proof (Lean source)
lemma continuousOn_compandingWeight (hOverlap : 0 < ε ∧ ε < 1 / 2) {f : ScoreSpace ε → ℝ} (hf : Continuous f) : ContinuousOn (fun t : ℝ => sqrt (densityExtension f t / (t * (1 - t)))) (Icc ε (1 - ε)) := by have hden : ContinuousOn (fun t : ℝ => t * (1 - t)) (Icc ε (1 - ε)) := by fun_prop have hden_ne : ∀ t ∈ Icc ε (1 - ε), t * (1 - t) ≠ 0 := by intro t ht have ht_pos : 0 < t := hOverlap.1.trans_le ht.1 have ht_lt_one : t < 1 := by linarith [ht.2, hOverlap.1] exact (mul_pos ht_pos (sub_pos.mpr ht_lt_one)).ne' exact ((continuousOn_densityExtension hf).div hden hden_ne).sqrt
CausalSmith.PartialID.UnlinkedPropensityAte.continuousOn_compandingWeight · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompandingReleaseGeometry.lean:30
theorem compandingWeight_intervalIntegrable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
hOverlap :
0 < ε ∧ ε < 1 / 2
f :
ScoreSpace ε → ℝ
hf :
x y :
IntervalIntegrable (fun t : ℝ => sqrt (densityExtension f t / (t * (1 - t)))) volume (x : ℝ) (y : ℝ)
Proof (Lean source)
lemma compandingWeight_intervalIntegrable (hOverlap : 0 < ε ∧ ε < 1 / 2) {f : ScoreSpace ε → ℝ} (hf : Continuous f) (x y : ScoreSpace ε) : IntervalIntegrable (fun t : ℝ => sqrt (densityExtension f t / (t * (1 - t)))) volume (x : ℝ) (y : ℝ) := by apply ContinuousOn.intervalIntegrable exact (continuousOn_compandingWeight hOverlap hf).mono (uIcc_subset_Icc x.property y.property)
CausalSmith.PartialID.UnlinkedPropensityAte.compandingWeight_intervalIntegrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompandingReleaseGeometry.lean:46
theorem monotone_compandingMass

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
hOverlap :
0 < ε ∧ ε < 1 / 2
f :
ScoreSpace ε → ℝ
hf :
Proof (Lean source)
lemma monotone_compandingMass (hOverlap : 0 < ε ∧ ε < 1 / 2) {f : ScoreSpace ε → ℝ} (hf : Continuous f) : Monotone (compandingMass f) := by intro x y hxy unfold compandingMass have hε_mem : ε ∈ Icc ε (1 - ε) := by constructor · rfl · linarith apply intervalIntegral.integral_mono_interval le_rfl x.property.1 hxy · exact Eventually.of_forall fun _ => Real.sqrt_nonneg _ · exact compandingWeight_intervalIntegrable hOverlap hf ⟨ε, hε_mem⟩ y
CausalSmith.PartialID.UnlinkedPropensityAte.monotone_compandingMass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompandingReleaseGeometry.lean:57
theorem measurable_compandingRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
hOverlap :
0 < ε ∧ ε < 1 / 2
f :
ScoreSpace ε → ℝ
hf :
_hf_pos :
∀ e, 0 < f e
K :
ℕ
hK :
0 < K
Proof (Lean source)
lemma measurable_compandingRelease (hOverlap : 0 < ε ∧ ε < 1 / 2) {f : ScoreSpace ε → ℝ} (hf : Continuous f) (_hf_pos : ∀ e, 0 < f e) (K : ℕ) (hK : 0 < K) : Measurable (compandingRelease f K hK) := by have hmass : Measurable (compandingMass f) := (monotone_compandingMass hOverlap hf).measurable have hnat : Measurable fun e => min (Nat.floor ((K : ℝ) * compandingMass f e / (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))))) (K - 1) := by exact ((measurable_const.mul hmass).div_const (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t))))) |>.nat_floor.min measurable_const unfold compandingRelease apply measurable_to_countable' intro r convert hnat (measurableSet_singleton (r : ℕ)) using 1 ext e exact Fin.ext_iff
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_compandingRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompandingReleaseGeometry.lean:72
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.CompatibilityFullLawConstruction 23 declarations Full-law reconstruction from compatible released arm-cell masses.

Full-law reconstruction from compatible released arm-cell masses.

def reconstructedArmPotentialLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
hg :
a :
reconstructedArmPotentialLaw H g Prel hg a :
H ⊗ₘ Kernel.comap (releasedPairLaw Prel).condKernel (fun e => (g e, a)) (hg.prodMk measurable_const)
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedArmPotentialLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:14
instance reconstructedArmPotentialLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedArmPotentialLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:22
theorem reconstructedArmPotentialLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
a :
(reconstructedArmPotentialLaw H g Prel hg a).fst = H
Proof (Lean source)
lemma reconstructedArmPotentialLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hg : Measurable g) (a : ArmSpace) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] : (reconstructedArmPotentialLaw H g Prel hg a).fst = H := by unfold reconstructedArmPotentialLaw exact Measure.fst_compProd H _
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedArmPotentialLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:31
def reconstructedLatentLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
reconstructedLatentLaw H g Prel hg :
instance reconstructedLatentLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedLatentLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:48
theorem reconstructedLatentLaw_map_control

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
(reconstructedLatentLaw H g Prel hg).map (fun p => (p.1, p.2.1))
Proof (Lean source)
lemma reconstructedLatentLaw_map_control {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hg : Measurable g) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] : (reconstructedLatentLaw H g Prel hg).map (fun p => (p.1, p.2.1)) = reconstructedArmPotentialLaw H g Prel hg false := by unfold reconstructedLatentLaw exact glueAlongFst_map_left _ _
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedLatentLaw_map_control · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:57
theorem reconstructedLatentLaw_map_treated

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
(reconstructedLatentLaw H g Prel hg).map (fun p => (p.1, p.2.2))
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedLatentLaw_map_treated · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:67
theorem reconstructedLatentLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
(reconstructedLatentLaw H g Prel hg).fst = H
Proof (Lean source)
lemma reconstructedLatentLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hg : Measurable g) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] : (reconstructedLatentLaw H g Prel hg).fst = H := by unfold Measure.fst calc (reconstructedLatentLaw H g Prel hg).map fst = ((reconstructedLatentLaw H g Prel hg).map (fun p => (p.1, p.2.1))).map fst := by rw [Measure.map_map measurable_fst (by fun_prop)] rfl _ = (reconstructedArmPotentialLaw H g Prel hg false).map fst := by rw [reconstructedLatentLaw_map_control] _ = H := reconstructedArmPotentialLaw_fst H g Prel hg false
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedLatentLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:78
def reconstructedAssignmentDensity

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
a :
reconstructedAssignmentDensity a p :
ofReal (armProb a p.1)
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedAssignmentDensity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:95
def reconstructedFullRow

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
a :
reconstructedFullRow g a p :
FullRow ε J
(p.1, p.2.1, p.2.2, a, if a then p.2.2 else p.2.1, g p.1)
theorem reconstructedFullRow_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
a :
Proof (Lean source)
lemma reconstructedFullRow_measurable {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) : Measurable (reconstructedFullRow g a) := by unfold reconstructedFullRow cases a · simp only [Bool.false_eq_true, ↓reduceIte] fun_prop · simp only [↓reduceIte] fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullRow_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:105
def reconstructedFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
reconstructedFullLaw H g Prel hg :
theorem reconstructedAssignedPotentialLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
a :
((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map (fun p => (p.1, if a then p.2.2 else p.2.1))
= (reconstructedArmPotentialLaw H g Prel hg a).withDensity (fun p => ofReal (armProb a p.1))
Proof (Lean source)
lemma reconstructedAssignedPotentialLaw { ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (a : ArmSpace) : ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map (fun p => (p.1, if a then p.2.2 else p.2.1)) = (reconstructedArmPotentialLaw H g Prel hg a).withDensity (fun p => ofReal (armProb a p.1)) := by cases a · simp only [Bool.false_eq_true, ↓reduceIte] change ((reconstructedLatentLaw H g Prel hg).withDensity ((fun q : ScoreSpace ε × OutcomeSpace => ofReal (1 - (q.1 : ℝ))) ∘ (fun p => (p.1, p.2.1)))).map (fun p => (p.1, p.2.1)) = _ rw [map_withDensity_of_comp _ _ (by fun_prop) _ (by fun_prop), reconstructedLatentLaw_map_control H g Prel hg] rfl · simp only [↓reduceIte] change ((reconstructedLatentLaw H g Prel hg).withDensity ((fun q : ScoreSpace ε × OutcomeSpace => ofReal (q.1 : ℝ)) ∘ (fun p => (p.1, p.2.2)))).map (fun p => (p.1, p.2.2)) = _ rw [map_withDensity_of_comp _ _ (by fun_prop) _ (by fun_prop), reconstructedLatentLaw_map_treated H g Prel hg] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedAssignedPotentialLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:189
theorem reconstructedAssignedReleasedPairLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
a :
((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map (fun p => ((g p.1, a), if a then p.2.2 else p.2.1))
Proof (Lean source)
lemma reconstructedAssignedReleasedPairLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (a : ArmSpace) : ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map (fun p => ((g p.1, a), if a then p.2.2 else p.2.1)) = scoreAssignedKeyLaw H g a ⊗ₘ (releasedPairLaw Prel).condKernel := by let k : ScoreSpace ε → LabelSpace J × ArmSpace := fun e => (g e, a) let d : ScoreSpace ε → ENNReal := fun e => ofReal (armProb a e) let q : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) → ScoreSpace ε × OutcomeSpace := fun p => (p.1, if a then p.2.2 else p.2.1) let v : ScoreSpace ε × OutcomeSpace → (LabelSpace J × ArmSpace) × OutcomeSpace := fun p => (k p.1, p.2) have hk : Measurable k := hg.prodMk measurable_const have hq : Measurable q := by cases a <;> simp [q] <;> fun_prop have hv : Measurable v := by dsimp [v] exact (hk.comp measurable_fst).prodMk measurable_snd have hd : Measurable d := by cases a <;> simp [d, armProb] <;> fun_prop calc ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map (fun p => ((g p.1, a), if a then p.2.2 else p.2.1)) = (((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity a)).map q).map v := by rw [Measure.map_map hv hq] rfl _ = ((reconstructedArmPotentialLaw H g Prel hg a).withDensity (fun p => d p.1)).map v := by rw [reconstructedAssignedPotentialLaw H g Prel hg a] _ = (((H.withDensity d) ⊗ₘ Kernel.comap (releasedPairLaw Prel).condKernel k hk).map v) := by unfold reconstructedArmPotentialLaw rw [withDensity_fst_compProd H _ d hd] _ = (H.withDensity d).map k ⊗ₘ (releasedPairLaw Prel).condKernel := by exact map_compProd_comap (H.withDensity d) (releasedPairLaw Prel).condKernel k hk _ = scoreAssignedKeyLaw H g a ⊗ₘ (releasedPairLaw Prel).condKernel := by rfl
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedAssignedReleasedPairLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:217
theorem reconstructedAssignmentMeasures_sum

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hOverlap :
Proof (Lean source)
lemma reconstructedAssignmentMeasures_sum {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hOverlap : Overlap ε) : (reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity false) + (reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity true) = reconstructedLatentLaw H g Prel hg := by rw [← withDensity_add_left (reconstructedAssignmentDensity_measurable false)] have hfun : reconstructedAssignmentDensity false + reconstructedAssignmentDensity true = (1 : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) → ENNReal) := by funext p exact reconstructedAssignmentDensity_sum hOverlap p rw [hfun, withDensity_one]
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedAssignmentMeasures_sum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:279
theorem reconstructedFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hOverlap :
Proof (Lean source)
lemma reconstructedFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hOverlap : Overlap ε) : IsProbabilityMeasure (reconstructedFullLaw H g Prel hg) := by rw [isProbabilityMeasure_iff] unfold reconstructedFullLaw rw [Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hg false) MeasurableSet.univ, Measure.map_apply (reconstructedFullRow_measurable g hg true) MeasurableSet.univ] simp only [preimage_univ] rw [← Measure.add_apply, reconstructedAssignmentMeasures_sum H g Prel hg hOverlap] exact isProbabilityMeasure_iff.mp inferInstance
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:296
theorem reconstructedFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hOverlap :
Proof (Lean source)
lemma reconstructedFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hOverlap : Overlap ε) : ScoreMarginal (reconstructedFullLaw H g Prel hg) H := by unfold ScoreMarginal reconstructedFullLaw rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg false), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg true)] change Measure.map fst ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity false)) + Measure.map fst ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity true)) = H rw [← Measure.map_add _ _ measurable_fst, reconstructedAssignmentMeasures_sum H g Prel hg hOverlap] exact reconstructedLatentLaw_fst H g Prel hg
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:311
theorem reconstructedFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
Consistency (reconstructedFullLaw H g Prel hg)
Proof (Lean source)
lemma reconstructedFullLaw_consistency {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) : Consistency (reconstructedFullLaw H g Prel hg) := by unfold Consistency reconstructedFullLaw rw [ae_add_measure_iff] constructor · have hrow := reconstructedFullRow_measurable g hg false rw [ae_map_iff hrow.aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with p rfl · have hrow := reconstructedFullRow_measurable g hg true rw [ae_map_iff hrow.aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with p rfl
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:333
theorem reconstructedFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
Proof (Lean source)
lemma reconstructedFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) : DeterministicRelease g (reconstructedFullLaw H g Prel hg) := by unfold DeterministicRelease reconstructedFullLaw rw [ae_add_measure_iff] constructor · rw [ae_map_iff (reconstructedFullRow_measurable g hg false).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)))] filter_upwards [] with p rfl · rw [ae_map_iff (reconstructedFullRow_measurable g hg true).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)))] filter_upwards [] with p rfl
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:363
theorem reconstructedFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hOverlap :
Proof (Lean source)
lemma reconstructedFullLaw_randomizedAssignment {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hOverlap : Overlap ε) : RandomizedAssignment (reconstructedFullLaw H g Prel hg) := by intro B hB let L := reconstructedLatentLaw H g Prel hg let M₀ := L.withDensity (reconstructedAssignmentDensity false) let M₁ := L.withDensity (reconstructedAssignmentDensity true) let D : Set (ScoreSpace ε × (OutcomeSpace × OutcomeSpace)) := {p | (p.1, p.2.1, p.2.2) ∈ B} have hD : MeasurableSet D := hB.preimage (by fun_prop) let S : Set (FullRow ε J) := {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} let T : Set (FullRow ε J) := {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} have hS : MeasurableSet S := (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage (by unfold score outcome0 outcome1; fun_prop)) have hT : MeasurableSet T := hB.preimage (by unfold score outcome0 outcome1; fun_prop) have hpre0S : reconstructedFullRow g false ⁻¹' S = ∅ := by ext p simp [S, reconstructedFullRow, arm] have hpre1S : reconstructedFullRow g true ⁻¹' S = D := by ext p simp [S, D, reconstructedFullRow, arm, score, outcome0, outcome1] have hpre0T : reconstructedFullRow g false ⁻¹' T = D := by ext p simp [T, D, reconstructedFullRow, score, outcome0, outcome1] have hpre1T : reconstructedFullRow g true ⁻¹' T = D := by ext p simp [T, D, reconstructedFullRow, score, outcome0, outcome1] letI : IsFiniteMeasure M₀ := reconstructedComponent_finite H g Prel hg hOverlap false letI : IsFiniteMeasure M₁ := reconstructedComponent_finite H g Prel hg hOverlap true have hmap0 : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hg false) MeasurableSet.univ] simpa using measure_lt_top M₀ Set.univ ⟩ have hmap1 : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hg true) MeasurableSet.univ] simpa using measure_lt_top M₁ Set.univ ⟩ change (reconstructedFullLaw H g Prel hg).real S = ∫ ω in T, (score ω : ℝ) ∂reconstructedFullLaw H g Prel hg have hleft : (reconstructedFullLaw H g Prel hg).real S = ∫ p in D, (p.1 : ℝ) ∂L := by unfold reconstructedFullLaw rw [Measure.real_def, Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hg false) hS, Measure.map_apply (reconstructedFullRow_measurable g hg true) hS, hpre0S, hpre1S, measure_empty, zero_add] change M₁.real D = _ exact assignmentTrue_real H g Prel hg hOverlap D hD rw [hleft] unfold reconstructedFullLaw letI : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := hmap0 letI : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := hmap1 rw [Measure.restrict_add, integral_add_measure (fullScore_integrable_finite _).integrableOn (fullScore_integrable_finite _).integrableOn, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg false).aemeasurable, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg true).aemeasurable, hpre0T, hpre1T] change (∫ p in D, (p.1 : ℝ) ∂L) = (∫ p in D, (p.1 : ℝ) ∂M₀) + (∫ p in D, (p.1 : ℝ) ∂M₁) rw [← integral_add_measure (latentScore_integrable_finite M₀).integrableOn (latentScore_integrable_finite M₁).integrableOn] rw [← Measure.restrict_add, reconstructedAssignmentMeasures_sum H g Prel hg hOverlap]
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:477
theorem reconstructedFullLaw_releasedPairLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hMass :
hOverlap :
(reconstructedFullLaw H g Prel hg).map (fun ω => ((label ω, arm ω), observed ω))
Proof (Lean source)
lemma reconstructedFullLaw_releasedPairLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : (reconstructedFullLaw H g Prel hg).map (fun ω => ((label ω, arm ω), observed ω)) = releasedPairLaw Prel := by have hp : Measurable (fun ω : FullRow ε J => ((label ω, arm ω), observed ω)) := by unfold label arm observed fun_prop unfold reconstructedFullLaw rw [Measure.map_add _ _ hp, Measure.map_map hp (reconstructedFullRow_measurable g hg false), Measure.map_map hp (reconstructedFullRow_measurable g hg true)] change ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity false)).map (fun p => ((g p.1, false), p.2.1)) + ((reconstructedLatentLaw H g Prel hg).withDensity (reconstructedAssignmentDensity true)).map (fun p => ((g p.1, true), p.2.2)) = _ have hfalse := reconstructedAssignedReleasedPairLaw H g Prel hg false have htrue := reconstructedAssignedReleasedPairLaw H g Prel hg true simp only [Bool.false_eq_true, ↓reduceIte] at hfalse simp only [↓reduceIte] at htrue rw [hfalse, htrue, ← Measure.compProd_add_left] change randomizedKeyLaw H g ⊗ₘ (releasedPairLaw Prel).condKernel = _ rw [randomizedKeyLaw_eq_releasedKeyLaw H g Prel hMass hOverlap, releasedPairLaw_disintegrate Prel]
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_releasedPairLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:553
theorem reconstructedFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hMass :
hOverlap :
Proof (Lean source)
lemma reconstructedFullLaw_releasedLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : ReleasedLaw (reconstructedFullLaw H g Prel hg) Prel := by unfold ReleasedLaw releasedLaw have hp : Measurable (fun ω : FullRow ε J => ((label ω, arm ω), observed ω)) := by unfold label arm observed fun_prop have hu : Measurable (fun p : (LabelSpace J × ArmSpace) × OutcomeSpace => (p.1.1, p.1.2, p.2)) := by fun_prop calc (reconstructedFullLaw H g Prel hg).map releasedRecord = ((reconstructedFullLaw H g Prel hg).map (fun ω => ((label ω, arm ω), observed ω))).map (fun p => (p.1.1, p.1.2, p.2)) := by rw [Measure.map_map hu hp] rfl _ = (releasedPairLaw Prel).map (fun p => (p.1.1, p.1.2, p.2)) := by rw [reconstructedFullLaw_releasedPairLaw H g Prel hg hMass hOverlap] _ = Prel := releasedPairLaw_map_unpair Prel
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:585
theorem reconstructedFullLaw_compatibleCausalLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
hMass :
hOverlap :
Proof (Lean source)
lemma reconstructedFullLaw_compatibleCausalLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : CompatibleCausalLaw H g Prel (reconstructedFullLaw H g Prel hg) := by exact { probability := reconstructedFullLaw_isProbabilityMeasure H g Prel hg hOverlap measurableRelease := hg scoreMarginal := reconstructedFullLaw_scoreMarginal H g Prel hg hOverlap randomizedAssignment := reconstructedFullLaw_randomizedAssignment H g Prel hg hOverlap consistency := reconstructedFullLaw_consistency H g Prel hg deterministicRelease := reconstructedFullLaw_deterministicRelease H g Prel hg releasedLaw := reconstructedFullLaw_releasedLaw H g Prel hg hMass hOverlap }
CausalSmith.PartialID.UnlinkedPropensityAte.reconstructedFullLaw_compatibleCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityFullLawConstruction.lean:612
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.CompatibilityReconstruction 12 declarations Measure-level reconstruction leaves for the compatibility converse.

Measure-level reconstruction leaves for the compatibility converse.

def scoreAssignedKeyLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
a :
scoreAssignedKeyLaw H g a :
(H.withDensity (fun e => ofReal (armProb a e))).map (fun e => (g e, a))
def randomizedKeyLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
randomizedKeyLaw H g :
def releasedKeyLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
Prel :
releasedKeyLaw Prel :
Prel.map (fun z => (z.1, z.2.1))
def releasedPairLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
Prel :
releasedPairLaw Prel :
Prel.map (fun z => ((z.1, z.2.1), z.2.2))
instance releasedPairLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance releasedPairLaw_isProbabilityMeasure {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] : IsProbabilityMeasure (releasedPairLaw Prel) := by unfold releasedPairLaw exact Measure.isProbabilityMeasure_map releasedPairing_measurable.aemeasurable
CausalSmith.PartialID.UnlinkedPropensityAte.releasedPairLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:40
theorem releasedPairLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
Prel :
Proof (Lean source)
lemma releasedPairLaw_fst {J : ℕ} (Prel : Measure (Observation J)) : (releasedPairLaw Prel).fst = releasedKeyLaw Prel := by unfold Measure.fst releasedPairLaw releasedKeyLaw rw [Measure.map_map measurable_fst releasedPairing_measurable] rfl
theorem releasedPairLaw_map_unpair

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
Prel :
(releasedPairLaw Prel).map (fun p => (p.1.1, p.1.2, p.2)) = Prel
Proof (Lean source)
lemma releasedPairLaw_map_unpair {J : ℕ} (Prel : Measure (Observation J)) : (releasedPairLaw Prel).map (fun p => (p.1.1, p.1.2, p.2)) = Prel := by unfold releasedPairLaw rw [Measure.map_map (by fun_prop) releasedPairing_measurable] have hfun : ((fun p : (LabelSpace J × ArmSpace) × OutcomeSpace => (p.1.1, p.1.2, p.2)) ∘ (fun z : Observation J => ((z.1, z.2.1), z.2.2))) = id := by funext z rfl rw [hfun, Measure.map_id]
CausalSmith.PartialID.UnlinkedPropensityAte.releasedPairLaw_map_unpair · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:55
theorem releasedPairLaw_disintegrate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
Proof (Lean source)
lemma releasedPairLaw_disintegrate {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] : (releasedKeyLaw Prel) ⊗ₘ (releasedPairLaw Prel).condKernel = releasedPairLaw Prel := by rw [← releasedPairLaw_fst Prel] exact (releasedPairLaw Prel).disintegrate (releasedPairLaw Prel).condKernel
CausalSmith.PartialID.UnlinkedPropensityAte.releasedPairLaw_disintegrate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:68
theorem propensityTilt_real_cell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
hOverlap :
a :
r :
(H.withDensity (fun e => ofReal (armProb a e))).real (cell g r)
= armCellMass H g a r
Proof (Lean source)
lemma propensityTilt_real_cell {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : (H.withDensity (fun e => ofReal (armProb a e))).real (cell g r) = armCellMass H g a r := by let F : ScoreSpace ε → ℝ := (cell g r).indicator (armProb a) have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have hF : Measurable F := (armProb_measurable a).indicator hcell have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : e ∈ cell g r · simpa [F, indicator, he] using armProb_mem_Icc hOverlap a e · simp [F, indicator, he] have hInt : Integrable F H := by apply Integrable.of_bound hF.aestronglyMeasurable 1 filter_upwards [] with e simpa [Real.norm_eq_abs, abs_of_nonneg (hbound e).1] using (hbound e).2 unfold Measure.real armCellMass rw [withDensity_apply _ hcell] have hlin : (∫⁻ e in cell g r, ofReal (armProb a e) ∂H) = ∫⁻ e, ofReal (F e) ∂H := by rw [← lintegral_indicator hcell] apply lintegral_congr intro e by_cases he : e ∈ cell g r <;> simp [F, indicator, he] rw [hlin, ← ofReal_integral_eq_lintegral_ofReal hInt (Filter.Eventually.of_forall (fun e => (hbound e).1))] rw [ENNReal.toReal_ofReal (integral_nonneg (fun e => (hbound e).1))] rw [← integral_indicator hcell]
CausalSmith.PartialID.UnlinkedPropensityAte.propensityTilt_real_cell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:98
theorem randomizedKeyLaw_real_singleton

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
hOverlap :
r :
a :
(randomizedKeyLaw H g).real {(r, a)} = armCellMass H g a r
Proof (Lean source)
lemma randomizedKeyLaw_real_singleton {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hOverlap : Overlap ε) (r : LabelSpace J) (a : ArmSpace) : (randomizedKeyLaw H g).real {(r, a)} = armCellMass H g a r := by letI : IsFiniteMeasure (H.withDensity (fun e => ofReal (armProb false e))) := isFiniteMeasure_withDensity_ofReal (armProb_integrable H hOverlap false).hasFiniteIntegral letI : IsFiniteMeasure (H.withDensity (fun e => ofReal (armProb true e))) := isFiniteMeasure_withDensity_ofReal (armProb_integrable H hOverlap true).hasFiniteIntegral have hkey (b : ArmSpace) : Measurable (fun e : ScoreSpace ε => (g e, b)) := by fun_prop have hsingle : MeasurableSet ({(r, a)} : Set (LabelSpace J × ArmSpace)) := measurableSet_singleton _ letI : IsFiniteMeasure (scoreAssignedKeyLaw H g false) := ⟨by have hs : (H.withDensity (fun e => ofReal (armProb false e))) univ < ∞ := measure_lt_top _ _ unfold scoreAssignedKeyLaw rw [Measure.map_apply (hkey false) MeasurableSet.univ] exact hs ⟩ letI : IsFiniteMeasure (scoreAssignedKeyLaw H g true) := ⟨by have hs : (H.withDensity (fun e => ofReal (armProb true e))) univ < ∞ := measure_lt_top _ _ unfold scoreAssignedKeyLaw rw [Measure.map_apply (hkey true) MeasurableSet.univ] exact hs ⟩ unfold randomizedKeyLaw rw [Measure.real_def, Measure.add_apply] rw [ENNReal.toReal_add (measure_ne_top _ _) (measure_ne_top _ _)] unfold scoreAssignedKeyLaw rw [Measure.map_apply (hkey false) hsingle, Measure.map_apply (hkey true) hsingle] cases a · have hpreFalse : (fun e : ScoreSpace ε => (g e, false)) ⁻¹' {(r, false)} = cell g r := by ext e; simp [cell] have hpreTrue : (fun e : ScoreSpace ε => (g e, true)) ⁻¹' {(r, false)} = ∅ := by ext e simp rw [hpreFalse, hpreTrue, measure_empty, ENNReal.toReal_zero, add_zero] exact propensityTilt_real_cell H g hg hOverlap false r · have hpreFalse : (fun e : ScoreSpace ε => (g e, false)) ⁻¹' {(r, true)} = ∅ := by ext e simp have hpreTrue : (fun e : ScoreSpace ε => (g e, true)) ⁻¹' {(r, true)} = cell g r := by ext e; simp [cell] rw [hpreFalse, hpreTrue, measure_empty, ENNReal.toReal_zero, zero_add] exact propensityTilt_real_cell H g hg hOverlap true r
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedKeyLaw_real_singleton · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:132
theorem releasedKeyLaw_real_singleton

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
a :
(releasedKeyLaw Prel).real {(r, a)} = Prel.real {z | z.1 = r ∧ z.2.1 = a}
Proof (Lean source)
lemma releasedKeyLaw_real_singleton {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] (r : LabelSpace J) (a : ArmSpace) : (releasedKeyLaw Prel).real {(r, a)} = Prel.real {z | z.1 = r ∧ z.2.1 = a} := by have hkey : Measurable (fun z : Observation J => (z.1, z.2.1)) := by fun_prop have hsingle : MeasurableSet ({(r, a)} : Set (LabelSpace J × ArmSpace)) := measurableSet_singleton _ unfold releasedKeyLaw rw [MeasureTheory.map_measureReal_apply hkey hsingle] congr 1 ext z simp
CausalSmith.PartialID.UnlinkedPropensityAte.releasedKeyLaw_real_singleton · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:183
theorem randomizedKeyLaw_eq_releasedKeyLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
Proof (Lean source)
lemma randomizedKeyLaw_eq_releasedKeyLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : randomizedKeyLaw H g = releasedKeyLaw Prel := by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : IsFiniteMeasure (H.withDensity (fun e => ofReal (armProb false e))) := isFiniteMeasure_withDensity_ofReal (armProb_integrable H hOverlap false).hasFiniteIntegral letI : IsFiniteMeasure (H.withDensity (fun e => ofReal (armProb true e))) := isFiniteMeasure_withDensity_ofReal (armProb_integrable H hOverlap true).hasFiniteIntegral letI : IsFiniteMeasure (scoreAssignedKeyLaw H g false) := ⟨by have hs : (H.withDensity (fun e => ofReal (armProb false e))) univ < ∞ := measure_lt_top _ _ unfold scoreAssignedKeyLaw rw [Measure.map_apply (by exact hMass.2.2.1.prodMk measurable_const) MeasurableSet.univ] exact hs ⟩ letI : IsFiniteMeasure (scoreAssignedKeyLaw H g true) := ⟨by have hs : (H.withDensity (fun e => ofReal (armProb true e))) univ < ∞ := measure_lt_top _ _ unfold scoreAssignedKeyLaw rw [Measure.map_apply (by exact hMass.2.2.1.prodMk measurable_const) MeasurableSet.univ] exact hs ⟩ letI : IsFiniteMeasure (randomizedKeyLaw H g) := by unfold randomizedKeyLaw scoreAssignedKeyLaw infer_instance letI : IsProbabilityMeasure (releasedKeyLaw Prel) := by unfold releasedKeyLaw have hkey : Measurable (fun z : Observation J => (z.1, z.2.1)) := by fun_prop exact Measure.isProbabilityMeasure_map hkey.aemeasurable apply Measure.ext_of_measureReal_singleton rintro ⟨r, a⟩ rw [randomizedKeyLaw_real_singleton H g hMass.2.2.1 hOverlap r a, releasedKeyLaw_real_singleton Prel r a, hMass.2.2.2 a r]
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedKeyLaw_eq_releasedKeyLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/CompatibilityReconstruction.lean:198
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.External 16 declarations The independent external score-log experiment and its honest excess-length risk.

The independent external score-log experiment and its honest excess-length risk.

def ExternalSample

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
ExternalSample ε J n m :
Type
TrialSample n J × (Fin m → ScoreSpace ε)
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalSample · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:21

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
g :
P :
H :
probabilityP :
probabilityH :
overlap :
measurableRelease :
scoreMarginal :
randomizedAssignment :
consistency :
Consistency P
deterministicRelease :
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:27

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
g :
ExternalLaws g :
{PH | IsProbabilityMeasure PH.1 ∧ IsProbabilityMeasure PH.2 ∧ ExternalScoreLaw g PH.1 PH.2}
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalLaws · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:39
theorem externalLawCellMasses

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
J :
ℕ
shared
g :
PH :
hPH :
PH ∈ ExternalLaws g
Proof (Lean source)
lemma externalLawCellMasses (g : ScoreSpace ε → LabelSpace J) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) : CompatibleCellMasses PH.2 g (releasedLaw PH.1) := by have hX : ExternalScoreLaw g PH.1 PH.2 := hPH.2.2 have hRandom : RandomizedCausalLaw PH.2 g PH.1 := ⟨hX.probabilityP, hX.measurableRelease, hX.scoreMarginal, hX.randomizedAssignment, hX.consistency, hX.deterministicRelease⟩ exact compatibleCellMasses_of_randomizedCausalLaw PH.2 g PH.1 hRandom
CausalSmith.PartialID.UnlinkedPropensityAte.externalLawCellMasses · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:46
def ExternalLogIID

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
PH ∈ ExternalLaws g :
ExternalLogIID g Qj :
Prop
(Qj PH.1 PH.2).map snd = Measure.pi (fun _ : Fin m => PH.2)
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalLogIID · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:60
def ExternalLogIndependent

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
PH ∈ ExternalLaws g :
ExternalLogIndependent g Qj :
Prop
Qj PH.1 PH.2 = ((Qj PH.1 PH.2).map fst).prod ((Qj PH.1 PH.2).map snd)
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalLogIndependent · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:68
def JointTrialIID

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
PH ∈ ExternalLaws g :
JointTrialIID g Qj :
Prop
(Qj PH.1 PH.2).map fst = Measure.pi (fun _ : Fin n => releasedLaw PH.1)
CausalSmith.PartialID.UnlinkedPropensityAte.JointTrialIID · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:76
def externalExperiment

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n m :
ℕ
P :
H :
externalExperiment n m P H :
(Measure.pi (fun _ : Fin n => releasedLaw P)).prod (Measure.pi (fun _ : Fin m => H))
CausalSmith.PartialID.UnlinkedPropensityAte.externalExperiment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:85
theorem jointTrialLog_eq_externalExperiment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
Qj PH.1 PH.2 = externalExperiment n m PH.1 PH.2
Proof (Lean source)
lemma jointTrialLog_eq_externalExperiment (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) : Qj PH.1 PH.2 = externalExperiment n m PH.1 PH.2 := by rw [hInd PH hPH, hTrial PH hPH, hLog PH hPH] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.jointTrialLog_eq_externalExperiment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:92

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
lo :
ExternalSample ε J n m → ℝ
hi :
ExternalSample ε J n m → ℝ
measurable_lo :
measurable_hi :
lower_bound :
∀ x, -1 ≤ lo x
ordered :
∀ x, lo x ≤ hi x
upper_bound :
∀ x, hi x ≤ 1
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalIntervalProcedure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:105
def contains

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
x :
θ :
ℝ
contains C x θ :
Prop
θ ∈ Icc (C.lo x) (C.hi x)
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalIntervalProcedure.contains · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:114
def length

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
x :
length C x :
ℝ
C.hi x - C.lo x
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalIntervalProcedure.length · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:118
def externalHonestProcedures

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalHonestProcedures g Qj α :
{C | ∀ PH ∈ ExternalLaws g, 1 - α ≤ (externalExperiment n m PH.1 PH.2).real {x | C.contains x (ate PH.1)}}
CausalSmith.PartialID.UnlinkedPropensityAte.externalHonestProcedures · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:124
def externalExcessRisk

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalExcessRisk g Qj α :
ℝ
sInf {v : ℝ | ∃ C ∈ externalHonestProcedures g Qj α, v = sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)}}
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:135
def externalNormalizer

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
n m :
ℕ
externalNormalizer n m :
ℝ
((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)⁻¹
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizer · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:146
def externalNormalizedRisk

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
J :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalNormalizedRisk g Qj α :
ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizedRisk · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/External.lean:152
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerBasic 4 declarations Basic interval bounds used by the lower certificate and projection risk.

Basic interval bounds used by the lower certificate and projection risk.

theorem externalATE_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
ate P ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma externalATE_mem_Icc {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] : ate P ∈ Icc (-1 : ℝ) 1 := by have h₀ : Integrable (fun ω => ((outcome0 ω : OutcomeSpace) : ℝ)) P := by simpa using potentialOutcome_integrable P false have h₁ : Integrable (fun ω => ((outcome1 ω : OutcomeSpace) : ℝ)) P := by simpa using potentialOutcome_integrable P true have h₀lo : 0 ≤ ∫ ω, ((outcome0 ω : OutcomeSpace) : ℝ) ∂P := integral_nonneg (fun ω => (outcome0 ω).property.1) have h₁lo : 0 ≤ ∫ ω, ((outcome1 ω : OutcomeSpace) : ℝ) ∂P := integral_nonneg (fun ω => (outcome1 ω).property.1) have h₀hi : (∫ ω, ((outcome0 ω : OutcomeSpace) : ℝ) ∂P) ≤ 1 := by calc _ ≤ ∫ _ω, (1 : ℝ) ∂P := integral_mono h₀ (integrable_const 1) (fun ω => (outcome0 ω).property.2) _ = 1 := by simp have h₁hi : (∫ ω, ((outcome1 ω : OutcomeSpace) : ℝ) ∂P) ≤ 1 := by calc _ ≤ ∫ _ω, (1 : ℝ) ∂P := integral_mono h₁ (integrable_const 1) (fun ω => (outcome1 ω).property.2) _ = 1 := by simp rw [ate_eq_potentialOutcomeMeans_sub] exact ⟨by linarith, by linarith⟩
CausalSmith.PartialID.UnlinkedPropensityAte.externalATE_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerBasic.lean:16
def externalFullInterval

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
externalFullInterval ε J n m :
clause 1
lo := fun _ => -1
clause 2
hi := fun _ => 1
clause 3
measurable_lo := measurable_const
clause 4
measurable_hi := measurable_const
clause 5
lower_bound := by intro; norm_num
clause 6
ordered := by intro; norm_num
clause 7
upper_bound := by intro; norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.externalFullInterval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerBasic.lean:42
theorem externalFullInterval_honest

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hα :
0 ≤ α
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
Proof (Lean source)
lemma externalFullInterval_honest {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hα : 0 ≤ α) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) : externalFullInterval ε J n m ∈ externalHonestProcedures g Qj α := by intro PH hPH letI : IsProbabilityMeasure (Qj PH.1 PH.2) := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd PH hPH letI : IsProbabilityMeasure (externalExperiment n m PH.1 PH.2) := by rw [← jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd PH hPH] infer_instance letI : IsProbabilityMeasure PH.1 := hPH.1 have hmem := externalATE_mem_Icc PH.1 have hset : {x : ExternalSample ε J n m | (externalFullInterval ε J n m).contains x (ate PH.1)} = univ := by ext x simp [ExternalIntervalProcedure.contains, externalFullInterval, hmem] rw [hset] simp only [Measure.real_def, measure_univ, ENNReal.toReal_one] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.externalFullInterval_honest · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerBasic.lean:54
theorem externalExcessIntegral_le_two

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
(∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2)
≤ 2
Proof (Lean source)
lemma externalExcessIntegral_le_two {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (C : ExternalIntervalProcedure ε J n m) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) : (∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2) ≤ 2 := by letI : IsProbabilityMeasure (Qj PH.1 PH.2) := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd PH hPH have hsharp : 0 ≤ sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH) := sharpATELength_nonneg_of_overlap PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH) hPH.2.2.overlap have hpoint : ∀ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ≤ 2 := by intro x have hlo := C.lower_bound x have hhi := C.upper_bound x dsimp [ExternalIntervalProcedure.length] exact max_le (by norm_num) (by linarith) calc _ ≤ ∫ _x, (2 : ℝ) ∂Qj PH.1 PH.2 := by apply integral_mono_of_nonneg · filter_upwards [] with x exact le_max_left _ _ · exact integrable_const 2 · filter_upwards [] with x exact hpoint x _ = 2 := by simp
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessIntegral_le_two · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerBasic.lean:79
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerCertificate 18 declarations Trial and external-log testing certificates for excess confidence length.

Trial and external-log testing certificates for excess confidence length.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
fiberTripleSeparation g :
ℝ
sSup {v : ℝ | ∃ (r : LabelSpace J) (e₁ e₂ e₃ : ScoreSpace ε), e₁ < e₂ ∧ e₂ < e₃ ∧ g e₁ = r ∧ g e₂ = r ∧ g e₃ = r ∧ v = (((e₃ : ℝ) - e₂) * (1 - (e₁ : ℝ) / e₂)) / sqrt (((e₃ : ℝ) - e₂) ^ 2 + ((e₃ : ℝ) - e₁) ^ 2 + ((e₂ : ℝ) - e₁) ^ 2)}
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTripleSeparation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:18

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ρ :
ℝ
ratioFilter ρ :
Filter (ℕ × ℕ)
(atTop ×ˢ atTop) ⊓ Filter.comap (fun nm : ℕ × ℕ => (nm.1 : ℝ) / (nm.2 : ℝ)) (nhds ρ)
theorem ratioFilter_neBot

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
Proof (Lean source)
lemma ratioFilter_neBot (ρ : ℝ) (hρ : 0 < ρ) : (ratioFilter ρ).NeBot := by let seq : ℕ → ℕ × ℕ := fun m => (⌈ρ * (m : ℝ)⌉₊, m) have hmul : Tendsto (fun m : ℕ => ρ * (m : ℝ)) atTop atTop := (tendsto_const_mul_atTop_of_pos hρ).2 tendsto_natCast_atTop_atTop have hceil : Tendsto (fun m : ℕ => ⌈ρ * (m : ℝ)⌉₊) atTop atTop := tendsto_nat_ceil_atTop.comp hmul have hpair : Tendsto seq atTop (atTop ×ˢ atTop) := hceil.prodMk tendsto_id have hratio : Tendsto (fun m : ℕ => (⌈ρ * (m : ℝ)⌉₊ : ℝ) / (m : ℝ)) atTop (nhds ρ) := (tendsto_nat_ceil_mul_div_atTop hρ.le).comp tendsto_natCast_atTop_atTop have hseq : Tendsto seq atTop (ratioFilter ρ) := by unfold ratioFilter apply tendsto_inf.mpr refine ⟨hpair, ?_⟩ apply tendsto_comap_iff.mpr exact hratio exact (Filter.map_neBot_iff seq).2 inferInstance |>.mono hseq

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
α :
ℝ
trialCertificate α :
ℝ
(1 - 2 * α) * sqrt (log (1 + (1 - 2 * α) ^ 2)) / 4

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
α :
ℝ
logCertificate g α :
ℝ
(1 - 2 * α) * sqrt (log (1 + (1 - 2 * α) ^ 2)) / (2 * sqrt 3) * fiberTripleSeparation g
theorem fiberTriple_exists

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
∃ r : LabelSpace J, ∃ e₁ e₂ e₃ : ScoreSpace ε,
conclusion 1
e₁ < e₂
conclusion 2
e₂ < e₃
conclusion 3
g e₁ = r
conclusion 4
g e₂ = r
conclusion 5
g e₃ = r
Proof (Lean source)
lemma fiberTriple_exists {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) : ∃ r : LabelSpace J, ∃ e₁ e₂ e₃ : ScoreSpace ε, e₁ < e₂ ∧ e₂ < e₃ ∧ g e₁ = r ∧ g e₂ = r ∧ g e₃ = r := by have hε : ε < 1 - ε := by rcases hOverlap with ⟨_, h⟩; linarith let : Infinite (ScoreSpace ε) := Set.Icc.infinite hε obtain ⟨r, hr⟩ := Finite.exists_infinite_fiber g have hset : (g ⁻¹' {r}).Infinite := Set.infinite_coe_iff.mp hr by_contra hn push Not at hn have hfinite : (g ⁻¹' {r}).Finite := by apply Set.finite_of_forall_not_lt_lt intro e₁ he₁ e₂ he₂ e₃ he₃ h₁₂ h₂₃ exact hn r e₁ e₂ e₃ h₁₂ h₂₃ he₁ he₂ he₃ exact hset hfinite
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTriple_exists · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:64
theorem fiberTriple_ratio_bounds Lemma fiberTriple_ratio_bounds in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z :
ℝ
hx :
0 < x
hxy :
x < y
hyz :
y < z
conclusion 1
0 < ((z - y) * (1 - x / y)) / sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2)
conclusion 2
((z - y) * (1 - x / y)) / sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) ≤ 1
Proof (Lean source)
lemma fiberTriple_ratio_bounds (x y z : ℝ) (hx : 0 < x) (hxy : x < y) (hyz : y < z) : 0 < ((z - y) * (1 - x / y)) / sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) ∧ ((z - y) * (1 - x / y)) / sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) ≤ 1 := by have hy : 0 < y := lt_trans hx hxy have hd : 0 < z - y := sub_pos.mpr hyz have hfrac₀ : 0 < x / y := div_pos hx hy have hfrac₁ : x / y < 1 := (div_lt_one hy).mpr hxy have hsquare : 0 ≤ (z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2 := by positivity have hsquare_pos : 0 < (z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2 := by nlinarith [sq_nonneg (z - x), sq_nonneg (y - x), sq_pos_of_pos hd] have hden : 0 < sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) := Real.sqrt_pos.2 hsquare_pos have hden_lower : z - y ≤ sqrt ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) := by have hroot := Real.sq_sqrt hsquare nlinarith [Real.sqrt_nonneg ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2), sq_nonneg (z - x), sq_nonneg (y - x)] constructor · exact div_pos (mul_pos hd (by linarith)) hden · apply (div_le_one hden).mpr nlinarith [mul_nonneg (le_of_lt hd) (le_of_lt hfrac₀)]
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTriple_ratio_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:82
theorem fiberTripleSeparation_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
conclusion 1
conclusion 2
Proof (Lean source)
lemma fiberTripleSeparation_bounds {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) : 0 < fiberTripleSeparation g ∧ fiberTripleSeparation g ≤ 1 := by let T : Set ℝ := {v | ∃ (r : LabelSpace J) (e₁ e₂ e₃ : ScoreSpace ε), e₁ < e₂ ∧ e₂ < e₃ ∧ g e₁ = r ∧ g e₂ = r ∧ g e₃ = r ∧ v = (((e₃ : ℝ) - e₂) * (1 - (e₁ : ℝ) / e₂)) / sqrt (((e₃ : ℝ) - e₂) ^ 2 + ((e₃ : ℝ) - e₁) ^ 2 + ((e₂ : ℝ) - e₁) ^ 2)} have hbound : ∀ v ∈ T, 0 < v ∧ v ≤ 1 := by rintro v ⟨r, e₁, e₂, e₃, h₁₂, h₂₃, _, _, _, rfl⟩ exact fiberTriple_ratio_bounds _ _ _ (lt_of_lt_of_le hOverlap.1 e₁.property.1) h₁₂ h₂₃ obtain ⟨r, e₁, e₂, e₃, h₁₂, h₂₃, hr₁, hr₂, hr₃⟩ := fiberTriple_exists g hOverlap let v : ℝ := (((e₃ : ℝ) - e₂) * (1 - (e₁ : ℝ) / e₂)) / sqrt (((e₃ : ℝ) - e₂) ^ 2 + ((e₃ : ℝ) - e₁) ^ 2 + ((e₂ : ℝ) - e₁) ^ 2) have hv : v ∈ T := ⟨r, e₁, e₂, e₃, h₁₂, h₂₃, hr₁, hr₂, hr₃, rfl⟩ have hbdd : BddAbove T := ⟨1, fun v hv => (hbound v hv).2⟩ change 0 < sSup T ∧ sSup T ≤ 1 exact ⟨lt_of_lt_of_le (hbound v hv).1 (le_csSup hbdd hv), csSup_le ⟨v, hv⟩ (fun v hv => (hbound v hv).2)⟩
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTripleSeparation_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:109
theorem fiberTriple_perturbation_identities Lemma fiberTriple_perturbation_identities in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z :
ℝ
hxy :
x < y
hyz :
y < z
conclusion 1
(z - y) - (z - x) + (y - x) = 0
conclusion 2
x * (z - y) - y * (z - x) + z * (y - x) = 0
conclusion 3
0 < z - y
conclusion 4
0 < y - x
Proof (Lean source)
lemma fiberTriple_perturbation_identities (x y z : ℝ) (hxy : x < y) (hyz : y < z) : (z - y) - (z - x) + (y - x) = 0 ∧ x * (z - y) - y * (z - x) + z * (y - x) = 0 ∧ 0 < z - y ∧ 0 < y - x := by constructor · ring constructor · ring exact ⟨sub_pos.mpr hyz, sub_pos.mpr hxy⟩
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTriple_perturbation_identities · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:134
theorem fiberTriple_upperEndpoint_shift Lemma fiberTriple_upperEndpoint_shift in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z t u :
ℝ
hy :
y ≠ 0
((1 / 3 + u * (z - y)) + (t - x * (1 / 3 + u * (z - y))) / y)
- ((1 / 3 : ℝ) + (t - x * (1 / 3)) / y)
= u * (z - y) * (1 - x / y)
Proof (Lean source)
lemma fiberTriple_upperEndpoint_shift (x y z t u : ℝ) (hy : y ≠ 0) : ((1 / 3 + u * (z - y)) + (t - x * (1 / 3 + u * (z - y))) / y) - ((1 / 3 : ℝ) + (t - x * (1 / 3)) / y) = u * (z - y) * (1 - x / y) := by field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTriple_upperEndpoint_shift · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:146
theorem fiberTriple_chisq_identity Lemma fiberTriple_chisq_identity in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z u :
ℝ
((u * (z - y)) ^ 2 + (u * (z - x)) ^ 2 + (u * (y - x)) ^ 2) / (1 / 3 : ℝ)
= 3 * u ^ 2 * ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2)
Proof (Lean source)
lemma fiberTriple_chisq_identity (x y z u : ℝ) : ((u * (z - y)) ^ 2 + (u * (z - x)) ^ 2 + (u * (y - x)) ^ 2) / (1 / 3 : ℝ) = 3 * u ^ 2 * ((z - y) ^ 2 + (z - x) ^ 2 + (y - x) ^ 2) := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.fiberTriple_chisq_identity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:156
theorem externalCertificate_constants_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
conclusion 1
conclusion 2
Proof (Lean source)
lemma externalCertificate_constants_pos {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) : 0 < trialCertificate α ∧ 0 < logCertificate g α := by have hgap : 0 < 1 - 2 * α := by linarith [hα.2] have hlog : 0 < log (1 + (1 - 2 * α) ^ 2) := by apply Real.log_pos nlinarith [sq_pos_of_pos hgap] have hroot : 0 < sqrt (log (1 + (1 - 2 * α) ^ 2)) := Real.sqrt_pos.2 hlog have hsep := (fiberTripleSeparation_bounds g hOverlap).1 constructor · unfold trialCertificate positivity · unfold logCertificate positivity
CausalSmith.PartialID.UnlinkedPropensityAte.externalCertificate_constants_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:164
theorem normalizedCertificate_trial Lemma normalizedCertificate_trial in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
n m :
ℕ
hn :
0 < n
hm :
0 < m
c R :
ℝ
hR :
c * (sqrt (n : ℝ))⁻¹ ≤ R
c * sqrt (m : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ))
≤ externalNormalizer n m * R
Proof (Lean source)
lemma normalizedCertificate_trial (n m : ℕ) (hn : 0 < n) (hm : 0 < m) (c R : ℝ) (hR : c * (sqrt (n : ℝ))⁻¹ ≤ R) : c * sqrt (m : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ)) ≤ externalNormalizer n m * R := by have hn' : 0 < sqrt (n : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hn) have hm' : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) have hnorm : 0 ≤ externalNormalizer n m := by unfold externalNormalizer positivity have hid : externalNormalizer n m * (c * (sqrt (n : ℝ))⁻¹) = c * sqrt (m : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ)) := by unfold externalNormalizer field_simp ring rw [← hid] exact mul_le_mul_of_nonneg_left hR hnorm
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedCertificate_trial · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:183
theorem normalizedCertificate_log Lemma normalizedCertificate_log in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
n m :
ℕ
hn :
0 < n
hm :
0 < m
c R :
ℝ
hR :
c * (sqrt (m : ℝ))⁻¹ ≤ R
c * sqrt (n : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ))
≤ externalNormalizer n m * R
Proof (Lean source)
lemma normalizedCertificate_log (n m : ℕ) (hn : 0 < n) (hm : 0 < m) (c R : ℝ) (hR : c * (sqrt (m : ℝ))⁻¹ ≤ R) : c * sqrt (n : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ)) ≤ externalNormalizer n m * R := by have hn' : 0 < sqrt (n : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hn) have hm' : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) have hnorm : 0 ≤ externalNormalizer n m := by unfold externalNormalizer positivity have hid : externalNormalizer n m * (c * (sqrt (m : ℝ))⁻¹) = c * sqrt (n : ℝ) / (sqrt (n : ℝ) + sqrt (m : ℝ)) := by unfold externalNormalizer field_simp ring rw [← hid] exact mul_le_mul_of_nonneg_left hR hnorm
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedCertificate_log · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:204
theorem ratioFilter_eventually_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, 0 < nm.1 ∧ 0 < nm.2
Proof (Lean source)
lemma ratioFilter_eventually_pos (ρ : ℝ) : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, 0 < nm.1 ∧ 0 < nm.2 := by apply Filter.Eventually.filter_mono (by unfold ratioFilter; exact inf_le_left) exact (eventually_gt_atTop (0 : ℕ)).prod_mk (eventually_gt_atTop (0 : ℕ))
CausalSmith.PartialID.UnlinkedPropensityAte.ratioFilter_eventually_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:225
theorem ratioFilter_ratio_tendsto

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
Tendsto (fun nm : ℕ × ℕ => (nm.1 : ℝ) / (nm.2 : ℝ)) (ratioFilter ρ) (nhds ρ)
Proof (Lean source)
lemma ratioFilter_ratio_tendsto (ρ : ℝ) : Tendsto (fun nm : ℕ × ℕ => (nm.1 : ℝ) / (nm.2 : ℝ)) (ratioFilter ρ) (nhds ρ) := by exact (tendsto_iff_comap).2 (by unfold ratioFilter exact inf_le_right)
CausalSmith.PartialID.UnlinkedPropensityAte.ratioFilter_ratio_tendsto · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:232
theorem normalizedCertificate_ratio_trial

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
Tendsto (fun nm : ℕ × ℕ => sqrt (nm.2 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) (ratioFilter ρ) (nhds (1 / (1 + sqrt ρ)))
Proof (Lean source)
lemma normalizedCertificate_ratio_trial (ρ : ℝ) (hρ : 0 < ρ) : Tendsto (fun nm : ℕ × ℕ => sqrt (nm.2 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) (ratioFilter ρ) (nhds (1 / (1 + sqrt ρ))) := by have hr := ratioFilter_ratio_tendsto ρ have hcomp : Tendsto (fun nm : ℕ × ℕ => 1 / (1 + sqrt ((nm.1 : ℝ) / (nm.2 : ℝ)))) (ratioFilter ρ) (nhds (1 / (1 + sqrt ρ))) := by have hcont : ContinuousAt (fun x : ℝ => 1 / (1 + sqrt x)) ρ := by have hden : 1 + sqrt ρ ≠ 0 := ne_of_gt (by positivity) fun_prop (disch := assumption) exact hcont.tendsto.comp hr apply hcomp.congr' filter_upwards [hr.eventually (eventually_gt_nhds hρ)] with nm hratio have hm : 0 < nm.2 := by by_contra h have hzero : nm.2 = 0 := by omega simp [hzero] at hratio have hsm : 0 < sqrt (nm.2 : ℝ) := Real.sqrt_pos.2 (by exact_mod_cast hm) rw [Real.sqrt_div (by positivity : 0 ≤ (nm.1 : ℝ)) (nm.2 : ℝ)] field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedCertificate_ratio_trial · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:241
theorem normalizedCertificate_ratio_log

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
Tendsto (fun nm : ℕ × ℕ => sqrt (nm.1 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) (ratioFilter ρ) (nhds (sqrt ρ / (1 + sqrt ρ)))
Proof (Lean source)
lemma normalizedCertificate_ratio_log (ρ : ℝ) (hρ : 0 < ρ) : Tendsto (fun nm : ℕ × ℕ => sqrt (nm.1 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) (ratioFilter ρ) (nhds (sqrt ρ / (1 + sqrt ρ))) := by have hr := ratioFilter_ratio_tendsto ρ have hcomp : Tendsto (fun nm : ℕ × ℕ => sqrt ((nm.1 : ℝ) / (nm.2 : ℝ)) / (1 + sqrt ((nm.1 : ℝ) / (nm.2 : ℝ)))) (ratioFilter ρ) (nhds (sqrt ρ / (1 + sqrt ρ))) := by have hcont : ContinuousAt (fun x : ℝ => sqrt x / (1 + sqrt x)) ρ := by have hden : 1 + sqrt ρ ≠ 0 := ne_of_gt (by positivity) fun_prop (disch := assumption) exact hcont.tendsto.comp hr apply hcomp.congr' filter_upwards [hr.eventually (eventually_gt_nhds hρ)] with nm hratio have hm : 0 < nm.2 := by by_contra h have hzero : nm.2 = 0 := by omega simp [hzero] at hratio have hsm : 0 < sqrt (nm.2 : ℝ) := Real.sqrt_pos.2 (by exact_mod_cast hm) rw [Real.sqrt_div (by positivity : 0 ≤ (nm.1 : ℝ)) (nm.2 : ℝ)] field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedCertificate_ratio_log · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificate.lean:268
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerCertificateAssembly 2 declarations Assembly of the two-source lower certificate.

Assembly of the two-source lower certificate.

theorem externalExcessRisk_normalized_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
α :
ℝ
hOverlap :
hg :
hα :
0 < α ∧ α < 1 / 2
Qj :
∀ n m
if
then
hTrial :
∀ (n m : ℕ), JointTrialIID g (Qj n m)
hLog :
∀ (n m : ℕ), ExternalLogIID g (Qj n m)
hInd :
∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)
∃ C : ℝ,
∀ n m : ℕ, 0 < n → 0 < m → externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C
Proof (Lean source)
lemma externalExcessRisk_normalized_upper {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (hα : 0 < α ∧ α < 1 / 2) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ (n m : ℕ), JointTrialIID g (Qj n m)) (hLog : ∀ (n m : ℕ), ExternalLogIID g (Qj n m)) (hInd : ∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)) : ∃ C : ℝ, ∀ n m : ℕ, 0 < n → 0 < m → externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C := by let L : ℝ := 4 * (ε⁻¹ + (ε ^ 2)⁻¹) let A : ℝ := L * (4 * J / α + 2 * J) let B : ℝ := L * (2 * J * (2 - 2 * ε) / α + J * (2 - 2 * ε)) let C : ℝ := A + B + 1 have hε : 0 < ε := hOverlap.1 have hαpos : 0 < α := hα.1 have hw : 0 < 2 - 2 * ε := by linarith [hOverlap.2] have hL : 0 ≤ L := by dsimp [L]; positivity have hA : 0 ≤ A := by dsimp [A]; exact mul_nonneg hL (by positivity) have hB : 0 ≤ B := by dsimp [B]; exact mul_nonneg hL (by positivity) have hC : 0 ≤ C := by dsimp [C]; linarith refine ⟨C, ?_⟩ intro n m hn hm have hscale : 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := by have hAn : A ≤ C := by dsimp [C]; linarith have hBm : B ≤ C := by dsimp [C]; linarith calc _ = A * (sqrt (n : ℝ))⁻¹ + B * (sqrt (m : ℝ))⁻¹ := by dsimp [A, B, L] simp only [div_eq_mul_inv, mul_inv_rev] ring _ ≤ C * (sqrt (n : ℝ))⁻¹ + C * (sqrt (m : ℝ))⁻¹ := add_le_add (mul_le_mul_of_nonneg_right hAn (by positivity)) (mul_le_mul_of_nonneg_right hBm (by positivity)) _ = _ := by ring let CI : ExternalIntervalProcedure ε J n m := externalProjectionIntervalProcedure g α hOverlap hg have hCI : CI ∈ externalHonestProcedures g (Qj n m) α := externalProjectionIntervalProcedure_honest g α hOverlap hg hn hm hα.1 (Qj n m) (hTrial n m) (hLog n m) (hInd n m) have hExp : ∀ PH, ∀ hPH : PH ∈ ExternalLaws g, (∫ x, max 0 (CI.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj n m PH.1 PH.2)) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := by intro PH hPH exact (externalProjectionIntervalProcedure_population_meanExcessLength_le g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) PH hPH hn hm α hα.1).trans hscale have hRisk := externalExcessRisk_le_of_honest_uniform_bound g α hOverlap hg (Qj n m) (hTrial n m) (hLog n m) (hInd n m) CI hCI _ (by positivity) hExp exact (externalNormalizedRisk_le_of_rootSum_bound g (Qj n m) α C hn hm hRisk)
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_normalized_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificateAssembly.lean:17
theorem externalExcessRisk_lower_certificates

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
α :
ℝ
hOverlap :
hg :
hα :
0 < α ∧ α < 1 / 2
Qj :
∀ n m
if
then
hTrial :
∀ (n m : ℕ), JointTrialIID g (Qj n m)
hLog :
∀ (n m : ℕ), ExternalLogIID g (Qj n m)
hInd :
∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)
conclusion 2
n m :
ℕ
0 < n
0 < m
trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α
conclusion 3
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop
conclusion 4
ρ :
ℝ
0 < ρ
max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))
≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ)
0 < max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))
Proof (Lean source)
lemma externalExcessRisk_lower_certificates {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (hα : 0 < α ∧ α < 1 / 2) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ (n m : ℕ), JointTrialIID g (Qj n m)) (hLog : ∀ (n m : ℕ), ExternalLogIID g (Qj n m)) (hInd : ∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)) : (0 < fiberTripleSeparation g ∧ fiberTripleSeparation g ≤ 1) ∧ (∀ (n m : ℕ), 0 < n → 0 < m → -- @realizes n(positive trial size) @realizes m(positive log size) trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α) ∧ (logCertificate g α ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop ∧ 0 < logCertificate g α) ∧ (∀ ρ : ℝ, 0 < ρ → -- @realizes rho(positive asymptotic ratio) max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ)) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ∧ 0 < max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))) := by have hconstants := externalCertificate_constants_pos g α hOverlap hα have hLogCert : logCertificate g α ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop := by obtain ⟨C, hUpper⟩ := externalExcessRisk_normalized_upper g α hOverlap hg hα Qj hTrial hLog hInd exact scoreLog_logCertificate_liminf g hOverlap hg α hα Qj hTrial hLog hInd C hUpper have hTrialCert : ∀ (n m : ℕ), 0 < n → 0 < m → trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α := by intro n m hn hm let H : Measure (ScoreSpace ε) := Measure.dirac (trialCenterScore hOverlap) let P : Measure (FullRow ε J) := trialCenterFullLaw g hOverlap (1 / 2) have hPH : (P, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by norm_num) (by norm_num), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by norm_num) (by norm_num)⟩ have hbase (C : ExternalIntervalProcedure ε J n m) (hC : C ∈ externalHonestProcedures g (Qj n m) α) : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)} := by let U : Set ℝ := {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)} have hUbd : BddAbove U := by refine ⟨2, ?_⟩ rintro u ⟨PH, hPH', rfl⟩ simpa only [jointTrialLog_eq_externalExperiment g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) PH hPH'] using externalExcessIntegral_le_two g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) C PH hPH' have hzero : sharpATELength H g (releasedLaw P) (externalLawCellMasses g (P, H) hPH) = 0 := trialCenter_sharpATELength_eq_zero g hOverlap (releasedLaw P) (externalLawCellMasses g (P, H) hPH) have hcenter : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, max 0 (C.length x - sharpATELength H g (releasedLaw P) (externalLawCellMasses g (P, H) hPH)) ∂(externalExperiment n m P H) := by have hlen := trialCenter_honest_expectedLength g hOverlap hg α hα hn (Qj n m) (hTrial n m) (hLog n m) (hInd n m) C hC change trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, C.length x ∂(Qj n m P H) at hlen rw [← jointTrialLog_eq_externalExperiment g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) (P, H) hPH] convert hlen using 1 apply integral_congr_ae filter_upwards [] with x rw [hzero, sub_zero] exact max_eq_right (sub_nonneg.mpr (C.ordered x)) exact hcenter.trans (le_csSup hUbd ⟨(P, H), hPH, rfl⟩) unfold externalExcessRisk apply le_csInf · refine ⟨sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 ((externalFullInterval ε J n m).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)}, ?_⟩ exact ⟨externalFullInterval ε J n m, externalFullInterval_honest g α hα.1.le (Qj n m) (hTrial n m) (hLog n m) (hInd n m), rfl⟩ · rintro v ⟨C, hC, rfl⟩ exact hbase C hC refine ⟨fiberTripleSeparation_bounds g hOverlap, hTrialCert, ?_, ?_⟩ · exact ⟨hLogCert, hconstants.2⟩ · intro ρ hρ refine ⟨?_, ?_⟩ · obtain ⟨C, hUpper⟩ := externalExcessRisk_normalized_upper g α hOverlap hg hα Qj hTrial hLog hInd let R : ℕ → ℕ → ℝ := fun n m => externalExcessRisk g (Qj n m) α have hTrialRatio : trialCertificate α / (1 + sqrt ρ) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) := by simpa only [R, externalNormalizedRisk] using trialCertificate_ratio_liminf_of_upperBound ρ hρ (trialCertificate α) C R (fun n m hn hm => by simpa only [R] using hTrialCert n m hn hm) (fun n m hn hm => hUpper n m hn hm) have hLogRatio : logCertificate g α * sqrt ρ / (1 + sqrt ρ) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) := by have hNonneg : ∀ n m : ℕ, 0 < n → 0 < m → 0 ≤ R n m := by intro n m hn hm have hfactor : 0 ≤ (sqrt (n : ℝ))⁻¹ := by positivity have hzero : 0 ≤ trialCertificate α * (sqrt (n : ℝ))⁻¹ := mul_nonneg hconstants.1.le hfactor exact hzero.trans (by simpa only [R] using hTrialCert n m hn hm) simpa only [R, externalNormalizedRisk] using logCertificate_ratio_liminf_of_infimum ρ hρ (logCertificate g α) C R hNonneg (by simpa only [R] using hLogCert) hUpper exact max_le hTrialRatio hLogRatio have hden : 0 < 1 + sqrt ρ := by positivity have hfirst : 0 < trialCertificate α / (1 + sqrt ρ) := div_pos hconstants.1 hden exact lt_of_lt_of_le hfirst (le_max_left _ _)
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_lower_certificates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificateAssembly.lean:81
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerCertificateTransfer 3 declarations Transfer of pointwise two-sample certificates to a ratio-filter lower bound.

Transfer of pointwise two-sample certificates to a ratio-filter lower bound.

theorem trialCertificate_ratio_liminf_of_upperBound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
c C :
ℝ
R :
ℕ → ℕ → ℝ
hTrial :
∀ (n m : ℕ)
if
0 < n
and
0 < m
then
c * (sqrt (n : ℝ))⁻¹ ≤ R n m
hUpper :
∀ (n m : ℕ)
if
0 < n
and
0 < m
then
externalNormalizer n m * R n m ≤ C
c / (1 + sqrt ρ)
≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ)
Proof (Lean source)
lemma trialCertificate_ratio_liminf_of_upperBound (ρ : ℝ) (hρ : 0 < ρ) (c C : ℝ) (R : ℕ → ℕ → ℝ) (hTrial : ∀ (n m : ℕ), 0 < n → 0 < m → c * (sqrt (n : ℝ))⁻¹ ≤ R n m) (hUpper : ∀ (n m : ℕ), 0 < n → 0 < m → externalNormalizer n m * R n m ≤ C) : c / (1 + sqrt ρ) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ) := by letI : (ratioFilter ρ).NeBot := ratioFilter_neBot ρ hρ let u : ℕ × ℕ → ℝ := fun nm => externalNormalizer nm.1 nm.2 * R nm.1 nm.2 let v : ℕ × ℕ → ℝ := fun nm => c * (sqrt (nm.2 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) have hvlim : Tendsto v (ratioFilter ρ) (nhds (c / (1 + sqrt ρ))) := by have hconst : Tendsto (fun _ : ℕ × ℕ => c) (ratioFilter ρ) (nhds c) := tendsto_const_nhds have h := hconst.mul (normalizedCertificate_ratio_trial ρ hρ) simpa [v, div_eq_mul_inv] using h have hle : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, v nm ≤ u nm := by filter_upwards [ratioFilter_eventually_pos ρ] with nm hnm simpa [v, u, mul_div_assoc] using normalizedCertificate_trial nm.1 nm.2 hnm.1 hnm.2 c (R nm.1 nm.2) (hTrial nm.1 nm.2 hnm.1 hnm.2) have hub : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, u nm ≤ C := by filter_upwards [ratioFilter_eventually_pos ρ] with nm hnm exact hUpper nm.1 nm.2 hnm.1 hnm.2 have hvu : (ratioFilter ρ).IsBoundedUnder (· ≥ ·) v := hvlim.isBoundedUnder_ge have huu : (ratioFilter ρ).IsCoboundedUnder (· ≥ ·) u := (isBoundedUnder_of_eventually_le hub).isCoboundedUnder_ge calc c / (1 + sqrt ρ) = liminf v (ratioFilter ρ) := hvlim.liminf_eq.symm _ ≤ liminf u (ratioFilter ρ) := liminf_le_liminf hle hvu huu _ = liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ) := rfl
CausalSmith.PartialID.UnlinkedPropensityAte.trialCertificate_ratio_liminf_of_upperBound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificateTransfer.lean:13
theorem logCertificate_ratio_liminf_of_upperBound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
c C :
ℝ
R :
ℕ → ℕ → ℝ
hLog :
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → c * (sqrt (m : ℝ))⁻¹ ≤ R n m
hUpper :
∀ (n m : ℕ)
if
0 < n
and
0 < m
then
externalNormalizer n m * R n m ≤ C
c * sqrt ρ / (1 + sqrt ρ)
≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ)
Proof (Lean source)
lemma logCertificate_ratio_liminf_of_upperBound (ρ : ℝ) (hρ : 0 < ρ) (c C : ℝ) (R : ℕ → ℕ → ℝ) (hLog : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → c * (sqrt (m : ℝ))⁻¹ ≤ R n m) (hUpper : ∀ (n m : ℕ), 0 < n → 0 < m → externalNormalizer n m * R n m ≤ C) : c * sqrt ρ / (1 + sqrt ρ) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ) := by letI : (ratioFilter ρ).NeBot := ratioFilter_neBot ρ hρ let u : ℕ × ℕ → ℝ := fun nm => externalNormalizer nm.1 nm.2 * R nm.1 nm.2 let v : ℕ × ℕ → ℝ := fun nm => c * (sqrt (nm.1 : ℝ) / (sqrt (nm.1 : ℝ) + sqrt (nm.2 : ℝ))) have hvlim : Tendsto v (ratioFilter ρ) (nhds (c * sqrt ρ / (1 + sqrt ρ))) := by have hconst : Tendsto (fun _ : ℕ × ℕ => c) (ratioFilter ρ) (nhds c) := tendsto_const_nhds simpa only [v, mul_div_assoc] using hconst.mul (normalizedCertificate_ratio_log ρ hρ) have hlog' : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, ∀ n : ℕ, 0 < n → c * (sqrt (nm.2 : ℝ))⁻¹ ≤ R n nm.2 := by apply Filter.Eventually.filter_mono (by unfold ratioFilter; exact inf_le_left) have hfirst : ∀ᶠ _ : ℕ in atTop, True := Filter.Eventually.of_forall (fun _ => True.intro) exact (hfirst.prod_mk hLog).mono (fun _ h => h.2) have hle : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, v nm ≤ u nm := by filter_upwards [ratioFilter_eventually_pos ρ, hlog'] with nm hnm hlognm simpa [v, u, mul_div_assoc] using normalizedCertificate_log nm.1 nm.2 hnm.1 hnm.2 c (R nm.1 nm.2) (hlognm nm.1 hnm.1) have hub : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, u nm ≤ C := by filter_upwards [ratioFilter_eventually_pos ρ] with nm hnm exact hUpper nm.1 nm.2 hnm.1 hnm.2 have hvu : (ratioFilter ρ).IsBoundedUnder (· ≥ ·) v := hvlim.isBoundedUnder_ge have huu : (ratioFilter ρ).IsCoboundedUnder (· ≥ ·) u := (isBoundedUnder_of_eventually_le hub).isCoboundedUnder_ge calc c * sqrt ρ / (1 + sqrt ρ) = liminf v (ratioFilter ρ) := hvlim.liminf_eq.symm _ ≤ liminf u (ratioFilter ρ) := liminf_le_liminf hle hvu huu _ = liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ) := rfl
CausalSmith.PartialID.UnlinkedPropensityAte.logCertificate_ratio_liminf_of_upperBound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificateTransfer.lean:53
theorem logCertificate_ratio_liminf_of_infimum

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ :
ℝ
hρ :
0 < ρ
c C :
ℝ
R :
ℕ → ℕ → ℝ
hNonneg :
∀ n m : ℕ
if
0 < n
and
0 < m
then
0 ≤ R n m
hLog :
c
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop
hUpper :
∀ n m : ℕ
if
0 < n
and
0 < m
then
externalNormalizer n m * R n m ≤ C
c * sqrt ρ / (1 + sqrt ρ)
≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ)
Proof (Lean source)
lemma logCertificate_ratio_liminf_of_infimum (ρ : ℝ) (hρ : 0 < ρ) (c C : ℝ) (R : ℕ → ℕ → ℝ) (hNonneg : ∀ n m : ℕ, 0 < n → 0 < m → 0 ≤ R n m) (hLog : c ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop) (hUpper : ∀ n m : ℕ, 0 < n → 0 < m → externalNormalizer n m * R n m ≤ C) : c * sqrt ρ / (1 + sqrt ρ) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizer nm.1 nm.2 * R nm.1 nm.2) (ratioFilter ρ) := by let F : ℕ → ℝ := fun m => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m} have hFnonneg : ∀ᶠ m : ℕ in atTop, 0 ≤ F m := by filter_upwards [eventually_gt_atTop (0 : ℕ)] with m hm apply le_csInf · exact ⟨Real.sqrt (m : ℝ) * R 1 m, 1, by omega, rfl⟩ · rintro v ⟨n, hn, rfl⟩ exact mul_nonneg (Real.sqrt_nonneg _) (hNonneg n m hn hm) have hFbelow : atTop.IsBoundedUnder (· ≥ ·) F := isBoundedUnder_of_eventually_ge hFnonneg have hweight : 0 < sqrt ρ / (1 + sqrt ρ) := by positivity apply le_of_forall_lt intro x hx have hxdiv : x / (sqrt ρ / (1 + sqrt ρ)) < c := (div_lt_iff₀ hweight).mpr (by simpa only [mul_div_assoc] using hx) let β : ℝ := (x / (sqrt ρ / (1 + sqrt ρ)) + c) / 2 have hβ : β < c := by dsimp [β]; linarith have hxβ : x < β * sqrt ρ / (1 + sqrt ρ) := by have h : x / (sqrt ρ / (1 + sqrt ρ)) < β := by dsimp [β] linarith simpa only [mul_div_assoc] using (div_lt_iff₀ hweight).mp h have hFevent : ∀ᶠ m : ℕ in atTop, β < F m := eventually_lt_of_lt_liminf (lt_of_lt_of_le hβ hLog) hFbelow have hEvent : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → β * (sqrt (m : ℝ))⁻¹ ≤ R n m := by filter_upwards [hFevent, eventually_gt_atTop (0 : ℕ)] with m hβF hm intro n hn have hSbd : BddBelow {v : ℝ | ∃ n' : ℕ, 0 < n' ∧ v = sqrt (m : ℝ) * R n' m} := by refine ⟨0, ?_⟩ rintro v ⟨n', hn', rfl⟩ exact mul_nonneg (Real.sqrt_nonneg _) (hNonneg n' m hn' hm) have hFle : F m ≤ sqrt (m : ℝ) * R n m := csInf_le hSbd ⟨n, hn, rfl⟩ have hsm : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) have hprod : β ≤ R n m * sqrt (m : ℝ) := by simpa only [mul_comm] using (le_trans hβF.le hFle) simpa only [div_eq_mul_inv] using (div_le_iff₀ hsm).mpr hprod have hTransfer := logCertificate_ratio_liminf_of_upperBound ρ hρ β C R hEvent hUpper exact lt_of_lt_of_le hxβ hTransfer
CausalSmith.PartialID.UnlinkedPropensityAte.logCertificate_ratio_liminf_of_infimum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerCertificateTransfer.lean:99
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogArmCell 5 declarations Arm-cell normalization leaves for the score-log construction.

Arm-cell normalization leaves for the score-log construction.

def scoreLogReleasedCellLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
r :
q t c :
ℝ
scoreLogReleasedCellLaw r q t c :
ofReal q • (trialOutcomeLaw (t / q)).map (fun y => (r, true, y))
+ ofReal c • Measure.dirac (r, false, trialZeroOutcome)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogReleasedCellLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogArmCell.lean:15
theorem scoreLogReleasedCellLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
q t c :
ℝ
hq0 :
0 ≤ q
hc0 :
0 ≤ c
hs0 :
0 ≤ t / q
hs1 :
t / q ≤ 1
hsum :
q + c = 1
Proof (Lean source)
lemma scoreLogReleasedCellLaw_isProbabilityMeasure {J : ℕ} (r : LabelSpace J) (q t c : ℝ) (hq0 : 0 ≤ q) (hc0 : 0 ≤ c) (hs0 : 0 ≤ t / q) (hs1 : t / q ≤ 1) (hsum : q + c = 1) : IsProbabilityMeasure (scoreLogReleasedCellLaw r q t c) := by letI := trialOutcomeLaw_isProbabilityMeasure (t / q) hs0 hs1 rw [isProbabilityMeasure_iff] unfold scoreLogReleasedCellLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.map_apply (by fun_prop) MeasurableSet.univ] simp only [Set.preimage_univ, measure_univ, Measure.dirac_apply, Set.mem_univ, Set.indicator_of_mem, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add hq0 hc0, hsum] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogReleasedCellLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogArmCell.lean:21
theorem scoreLogReleasedCellLaw_treated_mass

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
q t c :
ℝ
hq0 :
0 ≤ q
hs0 :
0 ≤ t / q
hs1 :
t / q ≤ 1
(scoreLogReleasedCellLaw r q t c).real {z | z.1 = r ∧ z.2.1 = true} = q
Proof (Lean source)
lemma scoreLogReleasedCellLaw_treated_mass {J : ℕ} (r : LabelSpace J) (q t c : ℝ) (hq0 : 0 ≤ q) (hs0 : 0 ≤ t / q) (hs1 : t / q ≤ 1) : (scoreLogReleasedCellLaw r q t c).real {z | z.1 = r ∧ z.2.1 = true} = q := by letI := trialOutcomeLaw_isProbabilityMeasure (t / q) hs0 hs1 unfold scoreLogReleasedCellLaw rw [Measure.real_def, Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.map_apply (by fun_prop)] · simp [hq0, trialZeroOutcome] · exact (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogReleasedCellLaw_treated_mass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogArmCell.lean:36
theorem scoreLogReleasedCellLaw_treated_mass_ennreal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
q t c :
ℝ
hs0 :
0 ≤ t / q
hs1 :
t / q ≤ 1
scoreLogReleasedCellLaw r q t c {z | z.1 = r ∧ z.2.1 = true} = ofReal q
Proof (Lean source)
lemma scoreLogReleasedCellLaw_treated_mass_ennreal {J : ℕ} (r : LabelSpace J) (q t c : ℝ) (hs0 : 0 ≤ t / q) (hs1 : t / q ≤ 1) : scoreLogReleasedCellLaw r q t c {z | z.1 = r ∧ z.2.1 = true} = ofReal q := by letI := trialOutcomeLaw_isProbabilityMeasure (t / q) hs0 hs1 unfold scoreLogReleasedCellLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.map_apply (by fun_prop)] · simp [trialZeroOutcome] · exact (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogReleasedCellLaw_treated_mass_ennreal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogArmCell.lean:49
theorem scoreLogReleasedCellLaw_armCellOutcomeLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
q t c :
ℝ
hq :
0 < q
hc0 :
0 ≤ c
hs0 :
0 ≤ t / q
hs1 :
t / q ≤ 1
hsum :
q + c = 1
Prel :
hPrel :
armCellOutcomeLaw Prel hPrel true r (by simpa [Prel, scoreLogReleasedCellLaw_treated_mass r q t c hq.le hs0 hs1] using hq)
Proof (Lean source)
lemma scoreLogReleasedCellLaw_armCellOutcomeLaw {J : ℕ} (r : LabelSpace J) (q t c : ℝ) (hq : 0 < q) (hc0 : 0 ≤ c) (hs0 : 0 ≤ t / q) (hs1 : t / q ≤ 1) (hsum : q + c = 1) : let Prel := scoreLogReleasedCellLaw r q t c let hPrel : IsProbabilityMeasure Prel := scoreLogReleasedCellLaw_isProbabilityMeasure r q t c hq.le hc0 hs0 hs1 hsum armCellOutcomeLaw Prel hPrel true r (by simpa [Prel, scoreLogReleasedCellLaw_treated_mass r q t c hq.le hs0 hs1] using hq) = threeScoreOutcomeLaw q t := by dsimp only letI : IsProbabilityMeasure (scoreLogReleasedCellLaw r q t c) := scoreLogReleasedCellLaw_isProbabilityMeasure r q t c hq.le hc0 hs0 hs1 hsum apply Measure.ext fun B hB => ?_ rw [armCellOutcomeLaw_apply] rw [scoreLogReleasedCellLaw_treated_mass_ennreal r q t c hs0 hs1] unfold scoreLogReleasedCellLaw threeScoreOutcomeLaw trialOutcomeLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply] rw [Measure.map_apply (by fun_prop)] · rw [Measure.add_apply, Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.smul_apply, Measure.smul_apply] simp only [Measure.dirac_apply, Set.indicator_of_mem, smul_eq_mul] simp [trialOneOutcome, trialZeroOutcome] have hqE : ofReal q ≠ 0 := by positivity have hqT : ofReal q ≠ ⊤ := ENNReal.ofReal_ne_top rw [← mul_assoc, ENNReal.inv_mul_cancel hqE hqT, one_mul] by_cases h1 : (1 : ℝ) ∈ B <;> by_cases h0 : (0 : ℝ) ∈ B <;> simp [indicator, h1, h0, trialOneOutcome, trialZeroOutcome] · exact (measurableSet_eq_fun measurable_fst measurable_const).inter ((measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const).inter ((by fun_prop : Measurable fun z : Observation J => (z.2.2 : ℝ)) hB)) · exact hB
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogReleasedCellLaw_armCellOutcomeLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogArmCell.lean:63
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogAttainment 5 declarations Paper-specific endpoint-law instantiations for the score-log pair.

Paper-specific endpoint-law instantiations for the score-log pair.

theorem endpointFullLaw_externalScoreLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
ExternalScoreLaw g (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) H where probabilityP
Proof (Lean source)
lemma endpointFullLaw_externalScoreLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : ExternalScoreLaw g (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) H where probabilityP := endpointFullLaw_isProbabilityMeasure H g Prel hMass hOverlap upper0 upper1 probabilityH := hMass.1 overlap := hOverlap measurableRelease := hMass.2.2.1 scoreMarginal := endpointFullLaw_scoreMarginal H g Prel hMass hOverlap upper0 upper1 randomizedAssignment := endpointFullLaw_randomizedAssignment H g Prel hMass hOverlap upper0 upper1 consistency := endpointFullLaw_consistency H g Prel hMass hOverlap upper0 upper1 deterministicRelease := endpointFullLaw_deterministicRelease H g Prel hMass hOverlap upper0 upper1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_externalScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogAttainment.lean:14
theorem endpointFullLaw_mem_externalLaws

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointFullLaw H g Prel hMass hOverlap upper0 upper1, H) ∈ ExternalLaws g
Proof (Lean source)
lemma endpointFullLaw_mem_externalLaws {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointFullLaw H g Prel hMass hOverlap upper0 upper1, H) ∈ ExternalLaws g := ⟨endpointFullLaw_isProbabilityMeasure H g Prel hMass hOverlap upper0 upper1, hMass.1, endpointFullLaw_externalScoreLaw H g Prel hMass hOverlap upper0 upper1⟩
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_mem_externalLaws · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogAttainment.lean:36
theorem endpointFullLaw_ate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
ate (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
= (if upper1 then muUpper H g Prel hMass true else muLower H g Prel hMass true)
- (if upper0 then muUpper H g Prel hMass false else muLower H g Prel hMass false)
Proof (Lean source)
lemma endpointFullLaw_ate {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : ate (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) = (if upper1 then muUpper H g Prel hMass true else muLower H g Prel hMass true) - (if upper0 then muUpper H g Prel hMass false else muLower H g Prel hMass false) := by letI : IsProbabilityMeasure (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := endpointFullLaw_isProbabilityMeasure H g Prel hMass hOverlap upper0 upper1 rw [ate_eq_potentialOutcomeMeans_sub] rw [show (∫ ω, ((outcome1 ω : OutcomeSpace) : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1) = (if upper1 then muUpper H g Prel hMass true else muLower H g Prel hMass true) by simpa using endpointFullLaw_armMean H g Prel hMass hOverlap upper0 upper1 true] rw [show (∫ ω, ((outcome0 ω : OutcomeSpace) : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1) = (if upper0 then muUpper H g Prel hMass false else muLower H g Prel hMass false) by simpa using endpointFullLaw_armMean H g Prel hMass hOverlap upper0 upper1 false]
theorem scoreLogTripleBaseline_lowerEndpoint_ate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t :
ℝ
ht₁ :
(x : ℝ) * (1 / 3) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hMass :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
ate (endpointFullLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass hOverlap true false)
Proof (Lean source)
lemma scoreLogTripleBaseline_lowerEndpoint_ate {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t : ℝ) (ht₁ : (x : ℝ) * (1 / 3) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hMass : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) : ate (endpointFullLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass hOverlap true false) = threeScoreLowerEndpoint (z : ℝ) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := lt_trans (mul_pos hx0 (by norm_num)) ht₁ have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) dsimp [q] nlinarith [mul_pos hz0 (by norm_num : (0 : ℝ) < 1 / 3)] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hq1 : q < 1 := by have hx1 : (x : ℝ) < 1 := lt_of_le_of_lt x.property.2 (by linarith [hOverlap.1]) have hy1 : (y : ℝ) < 1 := lt_of_le_of_lt y.property.2 (by linarith [hOverlap.1]) have hz1 : (z : ℝ) < 1 := lt_of_le_of_lt z.property.2 (by linarith [hOverlap.1]) dsimp [q] linarith have hrel := scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1 have hc := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q))) hMass r q t (1 - q) hrel hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) rw [endpointFullLaw_ate] simp only [Bool.false_eq_true, ↓reduceIte] rw [scoreLogTripleBaseline_muLower_true g hOverlap r x y z hxy hyz hx hy hz t ht₁ ht₂ hMass, hc.2, sub_zero]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_lowerEndpoint_ate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogAttainment.lean:76
theorem scoreLogTriplePerturbed_upperEndpoint_ate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
ht₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
ate (endpointFullLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass hOverlap false true)
= threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t
Proof (Lean source)
lemma scoreLogTriplePerturbed_upperEndpoint_ate {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (ht₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : ate (endpointFullLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass hOverlap false true) = threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hsum := (scoreLogTriple_weight_identities x y z hxy hyz u).1 have hmoment := (scoreLogTriple_weight_identities x y z hxy hyz u).2 let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) have ht0 : 0 < t := by have hxwx : 0 ≤ (x : ℝ) * wx := mul_nonneg hx0.le (by simpa [wx] using hw.1) exact lt_of_le_of_lt hxwx (by simpa [wx] using ht₁) have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) have hwz : 0 ≤ wz := by simpa [wz] using hw.2.2 have hmom : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring have hleft' : t < (x : ℝ) * wx + (y : ℝ) * wy := by simpa [wx, wy] using hleft nlinarith [mul_nonneg hz0.le hwz] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hq1 : q < 1 := by have hx1 : (x : ℝ) < 1 := lt_of_le_of_lt x.property.2 (by linarith [hOverlap.1]) have hy1 : (y : ℝ) < 1 := lt_of_le_of_lt y.property.2 (by linarith [hOverlap.1]) have hz1 : (z : ℝ) < 1 := lt_of_le_of_lt z.property.2 (by linarith [hOverlap.1]) dsimp [q] linarith have hrel := scoreLogTriplePerturbed_releasedLaw_cell g hOverlap r x y z hxy hyz hx hy hz t u hs0 hs1 hu0 hu have hc := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u)) hMass r q t (1 - q) hrel hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) rw [endpointFullLaw_ate] simp only [↓reduceIte, Bool.false_eq_true] rw [scoreLogTriplePerturbed_muUpper_true g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu ht₁ ht₂ hMass, hc.1, sub_zero]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_upperEndpoint_ate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogAttainment.lean:127
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogCalibration 9 declarations Numerical calibration of the three-score external-log perturbation.

Numerical calibration of the three-score external-log perturbation.

def threeScoreGapSq

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
threeScoreGapSq x y z :
ℝ
((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2
def threeScoreCalibratedU

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
α :
ℝ
x y z :
m :
ℕ
threeScoreCalibratedU α x y z m :
ℝ
sqrt (log (1 + (1 - 2 * α) ^ 2)) / (sqrt 3 * sqrt (threeScoreGapSq x y z) * sqrt (m : ℝ))
theorem threeScoreGapSq_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
_hxy :
x < y
hyz :
y < z
0 < threeScoreGapSq x y z
Proof (Lean source)
lemma threeScoreGapSq_pos {ε : ℝ} (x y z : ScoreSpace ε) (_hxy : x < y) (hyz : y < z) : 0 < threeScoreGapSq x y z := by unfold threeScoreGapSq have hzy : 0 < (z : ℝ) - y := sub_pos.mpr hyz nlinarith [sq_pos_of_pos hzy, sq_nonneg ((z : ℝ) - x), sq_nonneg ((y : ℝ) - x)]
theorem threeScoreCalibratedU_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
x y z :
hxy :
x < y
hyz :
y < z
m :
ℕ
hm :
0 < m
0 < threeScoreCalibratedU α x y z m
Proof (Lean source)
lemma threeScoreCalibratedU_pos {ε : ℝ} (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (m : ℕ) (hm : 0 < m) : 0 < threeScoreCalibratedU α x y z m := by unfold threeScoreCalibratedU have hβ : 0 < 1 - 2 * α := by linarith [hα.2] have hlog : 0 < log (1 + (1 - 2 * α) ^ 2) := Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hmR : (0 : ℝ) < m := by exact_mod_cast hm positivity [threeScoreGapSq_pos x y z hxy hyz]
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:30
theorem threeScoreCalibratedU_chisq_scalar

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
x y z :
hxy :
x < y
hyz :
y < z
m :
ℕ
hm :
0 < m
3 * (threeScoreCalibratedU α x y z m) ^ 2 * threeScoreGapSq x y z
= log (1 + (1 - 2 * α) ^ 2) / (m : ℝ)
Proof (Lean source)
lemma threeScoreCalibratedU_chisq_scalar {ε : ℝ} (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (m : ℕ) (hm : 0 < m) : 3 * (threeScoreCalibratedU α x y z m) ^ 2 * threeScoreGapSq x y z = log (1 + (1 - 2 * α) ^ 2) / (m : ℝ) := by let c : ℝ := log (1 + (1 - 2 * α) ^ 2) let D : ℝ := threeScoreGapSq x y z have hβ : 0 < 1 - 2 * α := by linarith [hα.2] have hc : 0 < c := by dsimp [c] exact Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hD : 0 < D := threeScoreGapSq_pos x y z hxy hyz have hmR : (0 : ℝ) < m := by exact_mod_cast hm have hroot3 : (sqrt 3) ^ 2 = 3 := Real.sq_sqrt (by norm_num) have hrootc : (sqrt c) ^ 2 = c := Real.sq_sqrt hc.le have hrootD : (sqrt D) ^ 2 = D := Real.sq_sqrt hD.le have hrootm : (sqrt (m : ℝ)) ^ 2 = (m : ℝ) := Real.sq_sqrt hmR.le change 3 * (sqrt c / (sqrt 3 * sqrt D * sqrt (m : ℝ))) ^ 2 * D = c / (m : ℝ) rw [div_pow, mul_pow, mul_pow, hroot3, hrootc, hrootD, hrootm] field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_chisq_scalar · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:42
theorem threeScoreCalibratedU_pow_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
x y z :
hxy :
x < y
hyz :
y < z
m :
ℕ
hm :
0 < m
(1 + 3 * (threeScoreCalibratedU α x y z m) ^ 2 * threeScoreGapSq x y z) ^ m
≤ 1 + (1 - 2 * α) ^ 2
Proof (Lean source)
lemma threeScoreCalibratedU_pow_bound {ε : ℝ} (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (m : ℕ) (hm : 0 < m) : (1 + 3 * (threeScoreCalibratedU α x y z m) ^ 2 * threeScoreGapSq x y z) ^ m ≤ 1 + (1 - 2 * α) ^ 2 := by rw [threeScoreCalibratedU_chisq_scalar α hα x y z hxy hyz m hm] let c : ℝ := log (1 + (1 - 2 * α) ^ 2) have hc : 0 < c := by dsimp [c] have hβ : 0 < 1 - 2 * α := by linarith [hα.2] exact Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hmR : (0 : ℝ) < m := by exact_mod_cast hm have h := Real.one_sub_div_pow_le_exp_neg (n := m) (t := -c) (by linarith : -c ≤ (m : ℝ)) have hexp : exp c = 1 + (1 - 2 * α) ^ 2 := Real.exp_log (by positivity) simpa only [c, neg_div, sub_neg_eq_add, neg_neg, hexp] using h
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_pow_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:65
theorem threeScoreCalibratedU_tendsto_zero

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
x y z :
Tendsto (fun m : ℕ => threeScoreCalibratedU α x y z m) atTop (nhds 0)
Proof (Lean source)
lemma threeScoreCalibratedU_tendsto_zero {ε : ℝ} (α : ℝ) (x y z : ScoreSpace ε) : Tendsto (fun m : ℕ => threeScoreCalibratedU α x y z m) atTop (nhds 0) := by have hinv : Tendsto (fun m : ℕ => (sqrt (m : ℝ))⁻¹) atTop (nhds 0) := tendsto_inv_atTop_zero.comp (Real.tendsto_sqrt_atTop.comp tendsto_natCast_atTop_atTop) let C : ℝ := sqrt (log (1 + (1 - 2 * α) ^ 2)) / (sqrt 3 * sqrt (threeScoreGapSq x y z)) have h : Tendsto (fun m : ℕ => C * (sqrt (m : ℝ))⁻¹) atTop (nhds (C * 0)) := tendsto_const_nhds.mul hinv convert h using 1 · funext m dsimp [C, threeScoreCalibratedU] rw [div_eq_mul_inv, div_eq_mul_inv, mul_inv] ring · simp
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_tendsto_zero · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:83
theorem threeScoreCalibratedU_eventually_weights_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
x y z :
∀ᶠ m : ℕ in atTop, 0 < 1 / 3
+ threeScoreCalibratedU α x y z m * ((z : ℝ) - y) ∧ 0 < 1 / 3
- threeScoreCalibratedU α x y z m * ((z : ℝ) - x) ∧ 0 < 1 / 3
+ threeScoreCalibratedU α x y z m * ((y : ℝ) - x)
Proof (Lean source)
lemma threeScoreCalibratedU_eventually_weights_pos {ε : ℝ} (α : ℝ) (x y z : ScoreSpace ε) : ∀ᶠ m : ℕ in atTop, 0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y) ∧ 0 < 1 / 3 - threeScoreCalibratedU α x y z m * ((z : ℝ) - x) ∧ 0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((y : ℝ) - x) := by have hu := threeScoreCalibratedU_tendsto_zero α x y z have hxlim : Tendsto (fun m : ℕ => 1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y)) atTop (nhds (1 / 3)) := by simpa using tendsto_const_nhds.add (hu.mul_const ((z : ℝ) - y)) have hylim : Tendsto (fun m : ℕ => 1 / 3 - threeScoreCalibratedU α x y z m * ((z : ℝ) - x)) atTop (nhds (1 / 3)) := by simpa using tendsto_const_nhds.sub (hu.mul_const ((z : ℝ) - x)) have hzlim : Tendsto (fun m : ℕ => 1 / 3 + threeScoreCalibratedU α x y z m * ((y : ℝ) - x)) atTop (nhds (1 / 3)) := by simpa using tendsto_const_nhds.add (hu.mul_const ((y : ℝ) - x)) filter_upwards [hxlim.eventually (Ioi_mem_nhds (by norm_num : (0 : ℝ) < 1 / 3)), hylim.eventually (Ioi_mem_nhds (by norm_num : (0 : ℝ) < 1 / 3)), hzlim.eventually (Ioi_mem_nhds (by norm_num : (0 : ℝ) < 1 / 3))] with m hxm hym hzm exact ⟨hxm, hym, hzm⟩
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_eventually_weights_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:101
theorem threeScoreCalibratedU_commonTrial_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
T :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
x y z :
hxy :
x < y
hyz :
y < z
m :
ℕ
hm :
0 < m
hx :
0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y)
hy :
0 < 1 / 3 - threeScoreCalibratedU α x y z m * ((z : ℝ) - x)
hz :
0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((y : ℝ) - x)
tvDist (ρ.prod (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z (threeScoreCalibratedU α x y z m)))) (ρ.prod (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)))
≤ (1 - 2 * α) / 2
Proof (Lean source)
lemma threeScoreCalibratedU_commonTrial_tv_bound {ε : ℝ} {T : Type*} [MeasurableSpace T] (ρ : Measure T) [IsProbabilityMeasure ρ] (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (m : ℕ) (hm : 0 < m) (hx : 0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y)) (hy : 0 < 1 / 3 - threeScoreCalibratedU α x y z m * ((z : ℝ) - x)) (hz : 0 < 1 / 3 + threeScoreCalibratedU α x y z m * ((y : ℝ) - x)) : tvDist (ρ.prod (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z (threeScoreCalibratedU α x y z m)))) (ρ.prod (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z))) ≤ (1 - 2 * α) / 2 := by let u := threeScoreCalibratedU α x y z m have htv := threeScorePerturbedLaw_commonTrial_tv_bound ρ x y z u hxy hyz hx hy hz m have hpow := threeScoreCalibratedU_pow_bound α hα x y z hxy hyz m hm have hβ : 0 < 1 - 2 * α := by linarith [hα.2] calc _ ≤ (1 / 2 : ℝ) * sqrt ((1 + 3 * u ^ 2 * threeScoreGapSq x y z) ^ m - 1) := by simpa [u, threeScoreGapSq] using htv _ ≤ (1 / 2 : ℝ) * sqrt ((1 - 2 * α) ^ 2) := by apply mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt ?_) (by norm_num) linarith _ = (1 - 2 * α) / 2 := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hβ] ring
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_commonTrial_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCalibration.lean:128
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogCellIdentification 6 declarations Identification of the active released cell in the score-log full laws.

Identification of the active released cell in the score-log full laws.

theorem scoreLogTripleBaseline_releasedLaw_cell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hx :
g x = r
hy :
g y = r
hz :
g z = r
t :
ℝ
hs0 :
0 ≤ t / (((x : ℝ) + y + z) / 3)
hs1 :
t / (((x : ℝ) + y + z) / 3) ≤ 1
q :
((x : ℝ) + y + z) / 3
Proof (Lean source)
lemma scoreLogTripleBaseline_releasedLaw_cell {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t : ℝ) (hs0 : 0 ≤ t / (((x : ℝ) + y + z) / 3)) (hs1 : t / (((x : ℝ) + y + z) / 3) ≤ 1) : let q := ((x : ℝ) + y + z) / 3 releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q)) = scoreLogReleasedCellLaw r q t (1 - q) := by dsimp only let q : ℝ := ((x : ℝ) + y + z) / 3 have ex0 : 0 ≤ (x : ℝ) := le_trans hOverlap.1.le x.property.1 have ey0 : 0 ≤ (y : ℝ) := le_trans hOverlap.1.le y.property.1 have ez0 : 0 ≤ (z : ℝ) := le_trans hOverlap.1.le z.property.1 have ex1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have ey1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have ez1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] have hq0 : 0 ≤ q := by dsimp [q]; positivity have hq1 : q ≤ 1 := by dsimp [q]; linarith let T : Measure (Observation J) := (trialOutcomeLaw (t / q)).map (fun v => (r, true, v)) let F : Measure (Observation J) := Measure.dirac (r, false, trialZeroOutcome) have htCoeff : ofReal (1 / 3 : ℝ) * ofReal (x : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (y : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (z : ℝ) = ofReal q := by rw [← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_add (mul_nonneg (by norm_num) ex0) (mul_nonneg (by norm_num) ey0), ← ENNReal.ofReal_add (add_nonneg (mul_nonneg (by norm_num) ex0) (mul_nonneg (by norm_num) ey0)) (mul_nonneg (by norm_num) ez0)] congr 1 dsimp [q] ring have hcCoeff : ofReal (1 / 3 : ℝ) * ofReal (1 - (x : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (y : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (z : ℝ)) = ofReal (1 - q) := by rw [← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_add (mul_nonneg (by norm_num) (sub_nonneg.mpr ex1)) (mul_nonneg (by norm_num) (sub_nonneg.mpr ey1)), ← ENNReal.ofReal_add (add_nonneg (mul_nonneg (by norm_num) (sub_nonneg.mpr ex1)) (mul_nonneg (by norm_num) (sub_nonneg.mpr ey1))) (mul_nonneg (by norm_num) (sub_nonneg.mpr ez1))] congr 1 dsimp [q] ring rw [scoreLogTripleBaselineFullLaw_releasedLaw, scoreLogAtomFullLaw_releasedLaw g x (t / q) hs0 hs1, scoreLogAtomFullLaw_releasedLaw g y (t / q) hs0 hs1, scoreLogAtomFullLaw_releasedLaw g z (t / q) hs0 hs1, hx, hy, hz] unfold scoreLogReleasedCellLaw have htCoeff' : ofReal (1 / 3 : ℝ) * ofReal (x : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (y : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (z : ℝ) = ofReal (((x : ℝ) + y + z) / 3) := by simpa [q] using htCoeff have hcCoeff' : ofReal (1 / 3 : ℝ) * ofReal (1 - (x : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (y : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (z : ℝ)) = ofReal (1 - (((x : ℝ) + y + z) / 3)) := by simpa [q] using hcCoeff rw [← htCoeff', ← hcCoeff'] module
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_releasedLaw_cell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:15
theorem scoreLogTriplePerturbed_releasedLaw_cell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hs0 :
0 ≤ t / (((x : ℝ) + y + z) / 3)
hs1 :
t / (((x : ℝ) + y + z) / 3) ≤ 1
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
q :
((x : ℝ) + y + z) / 3
Proof (Lean source)
lemma scoreLogTriplePerturbed_releasedLaw_cell {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hs0 : 0 ≤ t / (((x : ℝ) + y + z) / 3)) (hs1 : t / (((x : ℝ) + y + z) / 3) ≤ 1) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : let q := ((x : ℝ) + y + z) / 3 releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u) = scoreLogReleasedCellLaw r q t (1 - q) := by dsimp only rw [← scoreLogTriple_releasedLaw_eq g hOverlap r x y z hxy hyz hx hy hz (t / (((x : ℝ) + y + z) / 3)) hs0 hs1 u hu0 hu] exact scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_releasedLaw_cell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:96
theorem scoreLogTripleBaseline_armCellMass_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
r :
x y z :
hx :
g x = r
hy :
g y = r
hz :
g z = r
armCellMass (scoreLogTripleBaseline x y z) g true r = ((x : ℝ) + y + z) / 3
Proof (Lean source)
lemma scoreLogTripleBaseline_armCellMass_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (r : LabelSpace J) (x y z : ScoreSpace ε) (hx : g x = r) (hy : g y = r) (hz : g z = r) : armCellMass (scoreLogTripleBaseline x y z) g true r = ((x : ℝ) + y + z) / 3 := by classical unfold armCellMass scoreLogTripleBaseline rw [Measure.restrict_add, Measure.restrict_add, Measure.restrict_smul, Measure.restrict_smul, Measure.restrict_smul, restrict_dirac, restrict_dirac, restrict_dirac] simp only [cell, hx, hy, hz, Set.mem_ofPred_eq, if_pos] rw [integral_add_measure, integral_add_measure, integral_smul_measure, integral_smul_measure, integral_smul_measure] simp [armProb] ring all_goals first | exact Integrable.add_measure (Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)) (Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)) | exact Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_armCellMass_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:117
theorem scoreLogTripleBaseline_armCellWeightLaw_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
r :
x y z :
hx :
g x = r
hy :
g y = r
hz :
g z = r
hq :
0 < ((x : ℝ) + y + z) / 3
hm :
by rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq (: 0 < armCellMass (scoreLogTripleBaseline x y z) g true r)
Proof (Lean source)
lemma scoreLogTripleBaseline_armCellWeightLaw_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (r : LabelSpace J) (x y z : ScoreSpace ε) (hx : g x = r) (hy : g y = r) (hz : g z = r) (hq : 0 < ((x : ℝ) + y + z) / 3) : let hm : 0 < armCellMass (scoreLogTripleBaseline x y z) g true r := by rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq armCellWeightLaw (scoreLogTripleBaseline x y z) (scoreLogTripleBaseline_isProbabilityMeasure x y z) g hg true r hm = threeScoreInverseLaw (x : ℝ) y z (1 / 3) (1 / 3) (1 / 3) := by classical dsimp only unfold armCellWeightLaw armCellScoreLaw rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] unfold scoreLogTripleBaseline rw [ withDensity_add_measure, withDensity_add_measure, withDensity_smul_measure, withDensity_smul_measure, withDensity_smul_measure, dirac_withDensity, dirac_withDensity, dirac_withDensity] simp only [Measure.restrict_add, Measure.restrict_smul, restrict_dirac, cell, hx, hy, hz, Set.mem_ofPred_eq, if_pos, armProb] repeat' rw [smul_smul] have hmap : Measurable (fun e : ScoreSpace ε => ((e : ℝ))⁻¹) := by simpa [armProb] using (measurable_inverseArmProb (ε := ε) true) rw [Measure.map_smul, Measure.map_add _ _ hmap, Measure.map_add _ _ hmap, Measure.map_smul, Measure.map_smul, Measure.map_smul, Measure.map_dirac' hmap, Measure.map_dirac' hmap, Measure.map_dirac' hmap] unfold threeScoreInverseLaw have hden : (x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3) + (z : ℝ) * (1 / 3) = ((x : ℝ) + y + z) / 3 := by ring have hcoeff (v : ℝ) : (ofReal (((x : ℝ) + y + z) / 3))⁻¹ * (ofReal (1 / 3 : ℝ) * ofReal v) = ofReal (v * (1 / 3) / ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3) + (z : ℝ) * (1 / 3))) := by rw [hden, ENNReal.ofReal_div_of_pos hq] have hn : ofReal (1 / 3 : ℝ) * ofReal v = ofReal (v * (1 / 3)) := by rw [← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3)] congr 1 ring rw [hn] simp only [div_eq_mul_inv, mul_comm] rw [smul_add, smul_add] repeat' rw [smul_smul] rw [hcoeff (x : ℝ), hcoeff (y : ℝ), hcoeff (z : ℝ)] simp only [one_div]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_armCellWeightLaw_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:142
theorem scoreLogTriplePerturbed_armCellMass_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
armCellMass (scoreLogTriplePerturbed x y z u) g true r = ((x : ℝ) + y + z) / 3
Proof (Lean source)
lemma scoreLogTriplePerturbed_armCellMass_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : armCellMass (scoreLogTriplePerturbed x y z u) g true r = ((x : ℝ) + y + z) / 3 := by classical have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu unfold armCellMass scoreLogTriplePerturbed rw [Measure.restrict_add, Measure.restrict_add, Measure.restrict_smul, Measure.restrict_smul, Measure.restrict_smul, restrict_dirac, restrict_dirac, restrict_dirac] simp only [cell, hx, hy, hz, Set.mem_ofPred_eq, if_pos] rw [integral_add_measure, integral_add_measure, integral_smul_measure, integral_smul_measure, integral_smul_measure] rw [ENNReal.toReal_ofReal hw.1, ENNReal.toReal_ofReal hw.2.1, ENNReal.toReal_ofReal hw.2.2] simp [armProb] have hm := (scoreLogTriple_weight_identities x y z hxy hyz u).2 linarith all_goals first | exact Integrable.add_measure (Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)) (Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)) | exact Integrable.smul_measure (integrable_dirac (by simp [armProb])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_armCellMass_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:201
theorem scoreLogTriplePerturbed_armCellWeightLaw_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
hq :
0 < ((x : ℝ) + y + z) / 3
wx :
1 / 3 + u * ((z : ℝ) - y)
wy :
1 / 3 - u * ((z : ℝ) - x)
wz :
1 / 3 + u * ((y : ℝ) - x)
hm :
by rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq (: 0 < armCellMass (scoreLogTriplePerturbed x y z u) g true r)
= threeScoreInverseLaw (x : ℝ) y z wx wy wz
Proof (Lean source)
lemma scoreLogTriplePerturbed_armCellWeightLaw_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (hq : 0 < ((x : ℝ) + y + z) / 3) : let wx := 1 / 3 + u * ((z : ℝ) - y) let wy := 1 / 3 - u * ((z : ℝ) - x) let wz := 1 / 3 + u * ((y : ℝ) - x) let hm : 0 < armCellMass (scoreLogTriplePerturbed x y z u) g true r := by rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq armCellWeightLaw (scoreLogTriplePerturbed x y z u) (scoreLogTriplePerturbed_isProbabilityMeasure x y z hxy hyz u hu0 hu) g hg true r hm = threeScoreInverseLaw (x : ℝ) y z wx wy wz := by classical dsimp only have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu unfold armCellWeightLaw armCellScoreLaw rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] unfold scoreLogTriplePerturbed rw [withDensity_add_measure, withDensity_add_measure, withDensity_smul_measure, withDensity_smul_measure, withDensity_smul_measure, dirac_withDensity, dirac_withDensity, dirac_withDensity] simp only [Measure.restrict_add, Measure.restrict_smul, restrict_dirac, cell, hx, hy, hz, Set.mem_ofPred_eq, if_pos, armProb] repeat' rw [smul_smul] have hmap : Measurable (fun e : ScoreSpace ε => ((e : ℝ))⁻¹) := by simpa [armProb] using (measurable_inverseArmProb (ε := ε) true) rw [Measure.map_smul, Measure.map_add _ _ hmap, Measure.map_add _ _ hmap, Measure.map_smul, Measure.map_smul, Measure.map_smul, Measure.map_dirac' hmap, Measure.map_dirac' hmap, Measure.map_dirac' hmap] unfold threeScoreInverseLaw have hden : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x)) + (z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)) = ((x : ℝ) + y + z) / 3 := by calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := (scoreLogTriple_weight_identities x y z hxy hyz u).2 _ = ((x : ℝ) + y + z) / 3 := by ring have hcoeff (v w : ℝ) (hw0 : 0 ≤ w) : (ofReal (((x : ℝ) + y + z) / 3))⁻¹ * (ofReal w * ofReal v) = ofReal (v * w / ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x)) + (z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) := by rw [hden, ENNReal.ofReal_div_of_pos hq] have hn : ofReal w * ofReal v = ofReal (v * w) := by rw [← ENNReal.ofReal_mul hw0] congr 1 ring rw [hn] simp only [div_eq_mul_inv, mul_comm] rw [smul_add, smul_add] repeat' rw [smul_smul] rw [hcoeff (x : ℝ) _ hw.1, hcoeff (y : ℝ) _ hw.2.1, hcoeff (z : ℝ) _ hw.2.2] simp only [one_div]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_armCellWeightLaw_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCellIdentification.lean:231
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogCertificate 2 declarations Honest excess-risk transfer from two endpoint-attaining external laws.

Honest excess-risk transfer from two endpoint-attaining external laws.

theorem externalExcessRisk_lower_of_twoPoint

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
P0 P1 :
H0 H1 :
hPH0 :
(P0, H0) ∈ ExternalLaws g
hPH1 :
(P1, H1) ∈ ExternalLaws g
W0 Delta :
ℝ
hW0 :
sharpATELength H0 g (releasedLaw P0) (externalLawCellMasses g (P0, H0) hPH0) = W0
htheta :
ate P0 ≤ ate P1
hsep :
ate P1 - ate P0 = W0 + Delta
hDelta :
0 < Delta
htv :
tvDist (Qj P0 H0) (Qj P1 H1) ≤ (1 - 2 * α) / 2
Delta * ((1 - 2 * α) / 2) ≤ externalExcessRisk g Qj α
Proof (Lean source)
lemma externalExcessRisk_lower_of_twoPoint {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (P0 P1 : Measure (FullRow ε J)) (H0 H1 : Measure (ScoreSpace ε)) (hPH0 : (P0, H0) ∈ ExternalLaws g) (hPH1 : (P1, H1) ∈ ExternalLaws g) (W0 Delta : ℝ) (hW0 : sharpATELength H0 g (releasedLaw P0) (externalLawCellMasses g (P0, H0) hPH0) = W0) (htheta : ate P0 ≤ ate P1) (hsep : ate P1 - ate P0 = W0 + Delta) (hDelta : 0 < Delta) (htv : tvDist (Qj P0 H0) (Qj P1 H1) ≤ (1 - 2 * α) / 2) : Delta * ((1 - 2 * α) / 2) ≤ externalExcessRisk g Qj α := by have hbase (C : ExternalIntervalProcedure ε J n m) (hC : C ∈ externalHonestProcedures g Qj α) : Delta * ((1 - 2 * α) / 2) ≤ sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)} := by letI : IsProbabilityMeasure (Qj P0 H0) := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd (P0, H0) hPH0 letI : IsProbabilityMeasure (Qj P1 H1) := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd (P1, H1) hPH1 have hc0 := hC (P0, H0) hPH0 have hc1 := hC (P1, H1) hPH1 have hQ0 := jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd (P0, H0) hPH0 have hQ1 := jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd (P1, H1) hPH1 change 1 - α ≤ (externalExperiment n m P0 H0).real {x | C.contains x (ate P0)} at hc0 change 1 - α ≤ (externalExperiment n m P1 H1).real {x | C.contains x (ate P1)} at hc1 rw [← hQ0] at hc0 rw [← hQ1] at hc1 have hexcess := externalInterval_twoPoint_expectedExcessLength_of_tv C (Qj P0 H0) (Qj P1 H1) (ate P0) (ate P1) W0 Delta α htheta hsep hDelta hc0 hc1 htv rw [← hW0] at hexcess rw [hQ0] at hexcess let U : Set ℝ := {u | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)} have hUbd : BddAbove U := by refine ⟨2, ?_⟩ rintro u ⟨PH, hPH', rfl⟩ simpa only [jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd PH hPH'] using externalExcessIntegral_le_two g Qj hTrial hLog hInd C PH hPH' exact hexcess.trans (le_csSup hUbd ⟨(P0, H0), hPH0, rfl⟩) unfold externalExcessRisk apply le_csInf · refine ⟨sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 ((externalFullInterval ε J n m).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)}, ?_⟩ exact ⟨externalFullInterval ε J n m, externalFullInterval_honest g α hα.1.le Qj hTrial hLog hInd, rfl⟩ · rintro v ⟨C, hC, rfl⟩ exact hbase C hC
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_lower_of_twoPoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCertificate.lean:18
theorem externalExcessRisk_log_liminf_of_eventual_uniform

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
Qj :
∀ n m
if
then
α beta C :
ℝ
hLower :
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹
≤ externalExcessRisk g (Qj n m) α
hUpper :
∀ (n m : ℕ)
if
0 < n
and
0 < m
then
externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C
beta
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop
Proof (Lean source)
lemma externalExcessRisk_log_liminf_of_eventual_uniform {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (α beta C : ℝ) (hLower : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α) (hUpper : ∀ (n m : ℕ), 0 < n → 0 < m → externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C) : beta ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop := by exact logCertificate_liminf_infimum_of_normalized_upper beta C (fun n m => externalExcessRisk g (Qj n m) α) hLower hUpper
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_log_liminf_of_eventual_uniform · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogCertificate.lean:94
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogExperiment 1 declarations Testing control for the actual trial-plus-score-log experiments.

Testing control for the actual trial-plus-score-log experiments.

theorem scoreLogCalibrated_jointExperiment_eventually_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t α :
ℝ
hα :
0 < α ∧ α < 1 / 2
hs0 :
0 ≤ t / (((x : ℝ) + y + z) / 3)
hs1 :
t / (((x : ℝ) + y + z) / 3) ≤ 1
Qj :
∀ n m
if
then
hTrial :
∀ n m, JointTrialIID g (Qj n m)
hLog :
∀ n m, ExternalLogIID g (Qj n m)
hInd :
∀ n m, ExternalLogIndependent g (Qj n m)
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, let u := threeScoreCalibratedU α x y z m let P₀ := scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) let H₀ := scoreLogTripleBaseline x y z let P₁ := scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u let H₁ := scoreLogTriplePerturbed x y z u tvDist (Qj n m P₀ H₀) (Qj n m P₁ H₁)
≤ (1 - 2 * α) / 2
Proof (Lean source)
lemma scoreLogCalibrated_jointExperiment_eventually_tv_bound {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (hs0 : 0 ≤ t / (((x : ℝ) + y + z) / 3)) (hs1 : t / (((x : ℝ) + y + z) / 3) ≤ 1) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ n m, JointTrialIID g (Qj n m)) (hLog : ∀ n m, ExternalLogIID g (Qj n m)) (hInd : ∀ n m, ExternalLogIndependent g (Qj n m)) : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, let u := threeScoreCalibratedU α x y z m let P₀ := scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) let H₀ := scoreLogTripleBaseline x y z let P₁ := scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u let H₁ := scoreLogTriplePerturbed x y z u tvDist (Qj n m P₀ H₀) (Qj n m P₁ H₁) ≤ (1 - 2 * α) / 2 := by filter_upwards [threeScoreCalibratedU_eventually_weights_pos α x y z, eventually_gt_atTop (0 : ℕ)] with m hw hm intro n dsimp only let u := threeScoreCalibratedU α x y z m let P₀ := scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) let H₀ := scoreLogTripleBaseline x y z let P₁ := scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u let H₁ := scoreLogTriplePerturbed x y z u have hu0 : 0 ≤ u := (threeScoreCalibratedU_pos α hα x y z hxy hyz m hm).le have hu : u * ((z : ℝ) - x) ≤ 1 / 3 := by dsimp [u] at hw ⊢ linarith [hw.2.1] have hpair := scoreLogTriple_externalPair g hOverlap hg r x y z hxy hyz hx hy hz (t / (((x : ℝ) + y + z) / 3)) hs0 hs1 u hu0 hu have hPH₀ : (P₀, H₀) ∈ ExternalLaws g := by simpa [P₀, H₀] using hpair.1 have hPH₁ : (P₁, H₁) ∈ ExternalLaws g := by simpa [P₁, H₁] using hpair.2.1 have hrel : releasedLaw P₀ = releasedLaw P₁ := by simpa [P₀, P₁] using hpair.2.2 have hQ (P : Measure (FullRow ε J)) (H : Measure (ScoreSpace ε)) (hPH : (P, H) ∈ ExternalLaws g) : Qj n m P H = (Measure.pi (fun _ : Fin n => releasedLaw P)).prod (Measure.pi (fun _ : Fin m => H)) := by rw [hInd n m (P, H) hPH, hTrial n m (P, H) hPH, hLog n m (P, H) hPH] rw [hQ P₀ H₀ hPH₀, hQ P₁ H₁ hPH₁] let ρ : Measure (Fin n → Observation J) := Measure.pi (fun _ : Fin n => releasedLaw P₀) have hPrel : IsProbabilityMeasure (releasedLaw P₀) := by exact @Measure.isProbabilityMeasure_map _ _ _ _ P₀ hPH₀.2.2.probabilityP _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable letI : IsProbabilityMeasure (releasedLaw P₀) := hPrel letI : IsProbabilityMeasure ρ := by dsimp [ρ]; infer_instance have htv := threeScoreCalibratedU_commonTrial_tv_bound ρ α hα x y z hxy hyz m hm hw.1 hw.2.1 hw.2.2 rw [← hrel] rw [tvDist_symm] simpa [ρ, H₀, H₁, u, scoreLogTripleBaseline, scoreLogTriplePerturbed, threeScoreBaseLaw, threeScorePerturbedLaw] using htv
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogCalibrated_jointExperiment_eventually_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogExperiment.lean:15
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogFinal 7 declarations Final specialization of the calibrated score-log lower certificate.

Final specialization of the calibrated score-log lower certificate.

theorem scoreLogTripleBaseline_sharpLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t :
ℝ
ht₁ :
(x : ℝ) * (1 / 3) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hMass :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass
= threeScoreUpperEndpoint (x : ℝ) y (1 / 3) t - threeScoreLowerEndpoint (z : ℝ) t
Proof (Lean source)
lemma scoreLogTripleBaseline_sharpLength {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t : ℝ) (ht₁ : (x : ℝ) * (1 / 3) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hMass : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) : sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass = threeScoreUpperEndpoint (x : ℝ) y (1 / 3) t - threeScoreLowerEndpoint (z : ℝ) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := lt_trans (mul_pos hx0 (by norm_num)) ht₁ have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) dsimp [q] nlinarith [mul_pos hz0 (by norm_num : (0 : ℝ) < 1 / 3)] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hq1 : q < 1 := by have hx1 : (x : ℝ) < 1 := lt_of_le_of_lt x.property.2 (by linarith [hOverlap.1]) have hy1 : (y : ℝ) < 1 := lt_of_le_of_lt y.property.2 (by linarith [hOverlap.1]) have hz1 : (z : ℝ) < 1 := lt_of_le_of_lt z.property.2 (by linarith [hOverlap.1]) dsimp [q] linarith have hrel := scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1 have hc := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q))) hMass r q t (1 - q) hrel hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) unfold sharpATELength rw [scoreLogTripleBaseline_muUpper_true g hOverlap r x y z hxy hyz hx hy hz t ht₁ ht₂ hMass, scoreLogTripleBaseline_muLower_true g hOverlap r x y z hxy hyz hx hy hz t ht₁ ht₂ hMass, hc.1, hc.2] ring
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_sharpLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:13
theorem scoreLogTriplePerturbed_sharpLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
ht₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
sharpATELength (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass
= threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t
Proof (Lean source)
lemma scoreLogTriplePerturbed_sharpLength {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (ht₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : sharpATELength (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass = threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t - threeScoreLowerEndpoint (z : ℝ) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hmoment := (scoreLogTriple_weight_identities x y z hxy hyz u).2 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := by have : 0 ≤ (x : ℝ) * wx := mul_nonneg hx0.le (by simpa [wx] using hw.1) exact lt_of_le_of_lt this (by simpa [wx] using ht₁) have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) have hwz : 0 ≤ wz := by simpa [wz] using hw.2.2 have hmom : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring have hleft' : t < (x : ℝ) * wx + (y : ℝ) * wy := by simpa [wx, wy] using hleft nlinarith [mul_nonneg hz0.le hwz] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hq1 : q < 1 := by have hx1 : (x : ℝ) < 1 := lt_of_le_of_lt x.property.2 (by linarith [hOverlap.1]) have hy1 : (y : ℝ) < 1 := lt_of_le_of_lt y.property.2 (by linarith [hOverlap.1]) have hz1 : (z : ℝ) < 1 := lt_of_le_of_lt z.property.2 (by linarith [hOverlap.1]) dsimp [q] linarith have hrel := scoreLogTriplePerturbed_releasedLaw_cell g hOverlap r x y z hxy hyz hx hy hz t u hs0 hs1 hu0 hu have hc := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u)) hMass r q t (1 - q) hrel hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) unfold sharpATELength rw [scoreLogTriplePerturbed_muUpper_true g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu ht₁ ht₂ hMass, scoreLogTriplePerturbed_muLower_true g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu ht₁ ht₂ hMass, hc.1, hc.2] ring
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_sharpLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:64
theorem scoreLogTriple_endpoint_ate_separation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
hb₁ :
(x : ℝ) * (1 / 3) < t
hb₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hp₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
hp₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass₀ :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
hMass₁ :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
ate (endpointFullLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass₁ hOverlap false true)
- ate (endpointFullLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀ hOverlap true false)
= sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀
+ u * ((z : ℝ) - y) * (1 - (x : ℝ) / y)
Proof (Lean source)
lemma scoreLogTriple_endpoint_ate_separation {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (hb₁ : (x : ℝ) * (1 / 3) < t) (hb₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hp₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (hp₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass₀ : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) (hMass₁ : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : ate (endpointFullLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass₁ hOverlap false true) - ate (endpointFullLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀ hOverlap true false) = sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀ + u * ((z : ℝ) - y) * (1 - (x : ℝ) / y) := by have hA₀ := scoreLogTripleBaseline_lowerEndpoint_ate g hOverlap r x y z hxy hyz hx hy hz t hb₁ hb₂ hMass₀ have hA₁ := scoreLogTriplePerturbed_upperEndpoint_ate g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu hp₁ hp₂ hMass₁ have hW₁ := scoreLogTriplePerturbed_sharpLength g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu hp₁ hp₂ hMass₁ have hshift := scoreLogTriple_sharpATELength_perturbation g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu hb₁ hb₂ hp₁ hp₂ hMass₀ hMass₁ rw [hA₁, hA₀, ← hW₁] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_endpoint_ate_separation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:131
theorem externalExperiment_tv_eq_of_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
P0 P0' P1 P1' :
H0 H1 :
hPH0 :
(P0, H0) ∈ ExternalLaws g
hPH0' :
(P0', H0) ∈ ExternalLaws g
hPH1 :
(P1, H1) ∈ ExternalLaws g
hPH1' :
(P1', H1) ∈ ExternalLaws g
hrel0 :
hrel1 :
tvDist (Qj P0' H0) (Qj P1' H1)
= tvDist (Qj P0 H0) (Qj P1 H1)
Proof (Lean source)
lemma externalExperiment_tv_eq_of_releasedLaw {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (P0 P0' P1 P1' : Measure (FullRow ε J)) (H0 H1 : Measure (ScoreSpace ε)) (hPH0 : (P0, H0) ∈ ExternalLaws g) (hPH0' : (P0', H0) ∈ ExternalLaws g) (hPH1 : (P1, H1) ∈ ExternalLaws g) (hPH1' : (P1', H1) ∈ ExternalLaws g) (hrel0 : releasedLaw P0' = releasedLaw P0) (hrel1 : releasedLaw P1' = releasedLaw P1) : tvDist (Qj P0' H0) (Qj P1' H1) = tvDist (Qj P0 H0) (Qj P1 H1) := by have hQ (P : Measure (FullRow ε J)) (H : Measure (ScoreSpace ε)) (hPH : (P, H) ∈ ExternalLaws g) : Qj P H = (Measure.pi (fun _ : Fin n => releasedLaw P)).prod (Measure.pi (fun _ : Fin m => H)) := by rw [hInd (P, H) hPH, hTrial (P, H) hPH, hLog (P, H) hPH] rw [hQ P0' H0 hPH0', hQ P1' H1 hPH1', hQ P0 H0 hPH0, hQ P1 H1 hPH1, hrel0, hrel1]
CausalSmith.PartialID.UnlinkedPropensityAte.externalExperiment_tv_eq_of_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:175
def threeScoreFixedLogCertificate

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
α :
ℝ
x y z :
threeScoreFixedLogCertificate α x y z :
ℝ
(1 - 2 * α) * sqrt (log (1 + (1 - 2 * α) ^ 2)) / (2 * sqrt 3) * ((((z : ℝ) - y) * (1 - (x : ℝ) / y)) / sqrt (threeScoreGapSq x y z))
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreFixedLogCertificate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:201
theorem scoreLogFixedTriple_eventually_externalExcessRisk_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
Qj :
∀ n m
if
then
hTrial :
∀ n m, JointTrialIID g (Qj n m)
hLog :
∀ n m, ExternalLogIID g (Qj n m)
hInd :
∀ n m, ExternalLogIndependent g (Qj n m)
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → threeScoreFixedLogCertificate α x y z * (sqrt (m : ℝ))⁻¹
≤ externalExcessRisk g (Qj n m) α
Proof (Lean source)
lemma scoreLogFixedTriple_eventually_externalExcessRisk_lower {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ n m, JointTrialIID g (Qj n m)) (hLog : ∀ n m, ExternalLogIID g (Qj n m)) (hInd : ∀ n m, ExternalLogIndependent g (Qj n m)) : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → threeScoreFixedLogCertificate α x y z * (sqrt (m : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α := by let t := threeScoreThreshold x y z let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hb := threeScoreThreshold_baseline x y z hx0 hxy hyz dsimp only at hb have hs0 : 0 ≤ t / q := by simpa [t, q] using hb.2.2.1.le have hs1 : t / q ≤ 1 := by simpa [t, q] using hb.2.2.2.le have htv := scoreLogCalibrated_jointExperiment_eventually_tv_bound g hOverlap hg r x y z hxy hyz hx hy hz t α hα hs0 hs1 Qj hTrial hLog hInd filter_upwards [threeScoreCalibratedU_eventually_thresholds α hα x y z hx0 hxy hyz, htv, eventually_gt_atTop (0 : ℕ)] with m hth htv_m hm intro n hn dsimp only at hth let u := threeScoreCalibratedU α x y z m let Pbase := scoreLogTripleBaselineFullLaw g x y z (t / q) let Hbase := scoreLogTripleBaseline x y z let Ppert := scoreLogTriplePerturbedFullLaw g x y z (t / q) u let Hpert := scoreLogTriplePerturbed x y z u have hpair := scoreLogTriple_externalPair g hOverlap hg r x y z hxy hyz hx hy hz (t / q) hs0 hs1 u hth.2.2.2.1 hth.2.2.2.2.1 have hPHbase : (Pbase, Hbase) ∈ ExternalLaws g := by simpa [Pbase, Hbase, q] using hpair.1 have hPHpert : (Ppert, Hpert) ∈ ExternalLaws g := by simpa [Ppert, Hpert, q] using hpair.2.1 let hMass0 := externalLawCellMasses g (Pbase, Hbase) hPHbase let hMass1 := externalLawCellMasses g (Ppert, Hpert) hPHpert let E0 := endpointFullLaw Hbase g (releasedLaw Pbase) hMass0 hOverlap true false let E1 := endpointFullLaw Hpert g (releasedLaw Ppert) hMass1 hOverlap false true have hE0 : (E0, Hbase) ∈ ExternalLaws g := by exact endpointFullLaw_mem_externalLaws Hbase g (releasedLaw Pbase) hMass0 hOverlap true false have hE1 : (E1, Hpert) ∈ ExternalLaws g := by exact endpointFullLaw_mem_externalLaws Hpert g (releasedLaw Ppert) hMass1 hOverlap false true have hrel0 : releasedLaw E0 = releasedLaw Pbase := by exact endpointFullLaw_releasedLaw Hbase g (releasedLaw Pbase) hMass0 hOverlap true false have hrel1 : releasedLaw E1 = releasedLaw Ppert := by exact endpointFullLaw_releasedLaw Hpert g (releasedLaw Ppert) hMass1 hOverlap false true have htvEndpoint : tvDist (Qj n m E0 Hbase) (Qj n m E1 Hpert) ≤ (1 - 2 * α) / 2 := by rw [externalExperiment_tv_eq_of_releasedLaw g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) Pbase E0 Ppert E1 Hbase Hpert hPHbase hE0 hPHpert hE1 hrel0 hrel1] simpa [Pbase, Hbase, Ppert, Hpert, u, t, q] using htv_m n have hW0 := scoreLogTripleBaseline_sharpLength g hOverlap r x y z hxy hyz hx hy hz t hb.1 hb.2.1 hMass0 have hsep := scoreLogTriple_endpoint_ate_separation g hOverlap r x y z hxy hyz hx hy hz t u hth.2.2.2.1 hth.2.2.2.2.1 hb.1 hb.2.1 hth.2.2.2.2.2.1 hth.2.2.2.2.2.2 hMass0 hMass1 let Delta : ℝ := u * ((z : ℝ) - y) * (1 - (x : ℝ) / y) have hu0 : 0 < u := threeScoreCalibratedU_pos α hα x y z hxy hyz m hm have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hDelta : 0 < Delta := by dsimp [Delta] exact mul_pos (mul_pos hu0 (sub_pos.mpr hyz)) (sub_pos.mpr ((div_lt_one hy0).2 hxy)) have hW0nonneg : 0 ≤ sharpATELength Hbase g (releasedLaw Pbase) hMass0 := sharpATELength_nonneg_of_overlap Hbase g (releasedLaw Pbase) hMass0 hOverlap have htheta : ate E0 ≤ ate E1 := by have : ate E1 - ate E0 = sharpATELength Hbase g (releasedLaw Pbase) hMass0 + Delta := by simpa [E0, E1, Pbase, Hbase, Ppert, Hpert, hMass0, hMass1, t, q, u, Delta] using hsep linarith have hSharpEq : sharpATELength Hbase g (releasedLaw E0) (externalLawCellMasses g (E0, Hbase) hE0) = sharpATELength Hbase g (releasedLaw Pbase) hMass0 := by simpa only [hrel0] have hrisk := externalExcessRisk_lower_of_twoPoint g α hα (Qj n m) (hTrial n m) (hLog n m) (hInd n m) E0 E1 Hbase Hpert hE0 hE1 (sharpATELength Hbase g (releasedLaw Pbase) hMass0) Delta hSharpEq htheta (by simpa [E0, E1, Pbase, Hbase, Ppert, Hpert, hMass0, hMass1, t, q, u, Delta] using hsep) hDelta htvEndpoint have hcoef : threeScoreFixedLogCertificate α x y z * (sqrt (m : ℝ))⁻¹ = Delta * ((1 - 2 * α) / 2) := by dsimp [threeScoreFixedLogCertificate, Delta, u, threeScoreCalibratedU] simp only [div_eq_mul_inv, mul_inv] ring rw [hcoef] exact hrisk
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogFixedTriple_eventually_externalExcessRisk_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:209
theorem scoreLog_logCertificate_liminf

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
Qj :
∀ n m
if
then
hTrial :
∀ n m, JointTrialIID g (Qj n m)
hLog :
∀ n m, ExternalLogIID g (Qj n m)
hInd :
∀ n m, ExternalLogIndependent g (Qj n m)
C :
ℝ
hUpper :
∀ n m : ℕ
if
0 < n
and
0 < m
then
externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop
Proof (Lean source)
lemma scoreLog_logCertificate_liminf {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ n m, JointTrialIID g (Qj n m)) (hLog : ∀ n m, ExternalLogIID g (Qj n m)) (hInd : ∀ n m, ExternalLogIndependent g (Qj n m)) (C : ℝ) (hUpper : ∀ n m : ℕ, 0 < n → 0 < m → externalNormalizer n m * externalExcessRisk g (Qj n m) α ≤ C) : logCertificate g α ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop := by let K : ℝ := (1 - 2 * α) * sqrt (log (1 + (1 - 2 * α) ^ 2)) / (2 * sqrt 3) have hβ : 0 < 1 - 2 * α := by linarith [hα.2] have hlog : 0 < log (1 + (1 - 2 * α) ^ 2) := Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hK : 0 < K := by dsimp [K]; positivity apply le_of_forall_lt intro c hc have hcK : c / K < fiberTripleSeparation g := by apply (div_lt_iff₀ hK).2 simpa [logCertificate, K, mul_comm] using hc let T : Set ℝ := {v | ∃ (r : LabelSpace J) (e₁ e₂ e₃ : ScoreSpace ε), e₁ < e₂ ∧ e₂ < e₃ ∧ g e₁ = r ∧ g e₂ = r ∧ g e₃ = r ∧ v = (((e₃ : ℝ) - e₂) * (1 - (e₁ : ℝ) / e₂)) / sqrt (((e₃ : ℝ) - e₂) ^ 2 + ((e₃ : ℝ) - e₁) ^ 2 + ((e₂ : ℝ) - e₁) ^ 2)} have hTne : T.Nonempty := by obtain ⟨r, x, y, z, hxy, hyz, hx, hy, hz⟩ := fiberTriple_exists g hOverlap exact ⟨_, r, x, y, z, hxy, hyz, hx, hy, hz, rfl⟩ have hcSup : c / K < sSup T := by simpa [fiberTripleSeparation, T] using hcK obtain ⟨v, hvT, hcv⟩ := exists_lt_of_lt_csSup hTne hcSup rcases hvT with ⟨r, x, y, z, hxy, hyz, hx, hy, hz, rfl⟩ have hfixed := scoreLogFixedTriple_eventually_externalExcessRisk_lower g hOverlap hg r x y z hxy hyz hx hy hz α hα Qj hTrial hLog hInd have hlim := externalExcessRisk_log_liminf_of_eventual_uniform g Qj α (threeScoreFixedLogCertificate α x y z) C hfixed hUpper have hcoeff : K * ((((z : ℝ) - y) * (1 - (x : ℝ) / y)) / sqrt (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)) = threeScoreFixedLogCertificate α x y z := by simp only [threeScoreFixedLogCertificate, threeScoreGapSq, K] have hcFixed : c < threeScoreFixedLogCertificate α x y z := by have := (div_lt_iff₀ hK).1 hcv rw [mul_comm, hcoeff] at this exact this exact hcFixed.trans_le hlim
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLog_logCertificate_liminf · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFinal.lean:317
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogFullLaw 32 declarations Full causal laws generated by a score atom for the score-log lower pair.

Full causal laws generated by a score atom for the score-log lower pair.

def scoreLogArmLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
e :
scoreLogArmLaw e :
ofReal (e : ℝ) • Measure.dirac true
+ ofReal (1 - (e : ℝ)) • Measure.dirac false
def scoreLogAtomRow

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
e :
a :
scoreLogAtomRow g e y a :
FullRow ε J
(e, trialZeroOutcome, y, a, if a then y else trialZeroOutcome, g e)
theorem scoreLogAtomRow_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
e :
Measurable (fun ya : OutcomeSpace × ArmSpace => scoreLogAtomRow g e ya.1 ya.2)
Proof (Lean source)
lemma scoreLogAtomRow_measurable {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (e : ScoreSpace ε) : Measurable (fun ya : OutcomeSpace × ArmSpace => scoreLogAtomRow g e ya.1 ya.2) := by have hcond : MeasurableSet {ya : OutcomeSpace × ArmSpace | ya.2 = true} := measurableSet_eq_fun measurable_snd measurable_const have hobs : Measurable (fun ya : OutcomeSpace × ArmSpace => if ya.2 then ya.1 else trialZeroOutcome) := Measurable.ite hcond measurable_fst measurable_const unfold scoreLogAtomRow fun_prop (disch := assumption)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomRow_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:24
theorem scoreLogArmLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
e :
hOverlap :
Proof (Lean source)
lemma scoreLogArmLaw_isProbabilityMeasure {ε : ℝ} (e : ScoreSpace ε) (hOverlap : Overlap ε) : IsProbabilityMeasure (scoreLogArmLaw e) := by have he0 : 0 ≤ (e : ℝ) := le_trans hOverlap.1.le e.property.1 have he1 : (e : ℝ) ≤ 1 := by linarith [e.property.2, hOverlap.1] rw [isProbabilityMeasure_iff] unfold scoreLogArmLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply] simp only [Measure.dirac_apply, Set.mem_univ, Set.indicator_of_mem, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add he0 (sub_nonneg.mpr he1)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogArmLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:37
theorem scoreLogArmLaw_true_mass

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
e :
hOverlap :
(scoreLogArmLaw e).real {true} = (e : ℝ)
Proof (Lean source)
lemma scoreLogArmLaw_true_mass {ε : ℝ} (e : ScoreSpace ε) (hOverlap : Overlap ε) : (scoreLogArmLaw e).real {true} = (e : ℝ) := by have he0 : 0 ≤ (e : ℝ) := le_trans hOverlap.1.le e.property.1 unfold scoreLogArmLaw rw [Measure.real_def, Measure.add_apply, Measure.smul_apply, Measure.smul_apply] simp [he0]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogArmLaw_true_mass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:50
def scoreLogAtomFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
e :
s :
ℝ
scoreLogAtomFullLaw g e s :
((trialOutcomeLaw s).prod (scoreLogArmLaw e)).map (fun ya => scoreLogAtomRow g e ya.1 ya.2)
theorem scoreLogAtomFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
e :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
Proof (Lean source)
lemma scoreLogAtomFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (e : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : IsProbabilityMeasure (scoreLogAtomFullLaw g e s) := by letI : IsProbabilityMeasure (trialOutcomeLaw s) := trialOutcomeLaw_isProbabilityMeasure s hs0 hs1 letI : IsProbabilityMeasure (scoreLogArmLaw e) := scoreLogArmLaw_isProbabilityMeasure e hOverlap unfold scoreLogAtomFullLaw exact Measure.isProbabilityMeasure_map (scoreLogAtomRow_measurable g e).aemeasurable
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:65
theorem scoreLogAtomFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
e :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
ScoreMarginal (scoreLogAtomFullLaw g e s) (Measure.dirac e)
Proof (Lean source)
lemma scoreLogAtomFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (e : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : ScoreMarginal (scoreLogAtomFullLaw g e s) (Measure.dirac e) := by letI : IsProbabilityMeasure (trialOutcomeLaw s) := trialOutcomeLaw_isProbabilityMeasure s hs0 hs1 letI : IsProbabilityMeasure (scoreLogArmLaw e) := scoreLogArmLaw_isProbabilityMeasure e hOverlap have hrow := scoreLogAtomRow_measurable g e unfold ScoreMarginal scoreLogAtomFullLaw rw [Measure.map_map (by unfold score; fun_prop) hrow] change ((trialOutcomeLaw s).prod (scoreLogArmLaw e)).map (fun _ => e) = _ rw [Measure.map_const] simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:77
theorem scoreLogAtomFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
e :
s :
ℝ
Consistency (scoreLogAtomFullLaw g e s)
Proof (Lean source)
lemma scoreLogAtomFullLaw_consistency {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (e : ScoreSpace ε) (s : ℝ) : Consistency (scoreLogAtomFullLaw g e s) := by have hrow := scoreLogAtomRow_measurable g e have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const have hpot : Measurable (fun ω : FullRow ε J => if arm ω then outcome1 ω else outcome0 ω) := Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop) have hset : MeasurableSet {ω : FullRow ε J | observed ω = if arm ω then outcome1 ω else outcome0 ω} := measurableSet_eq_fun (by unfold observed; fun_prop) hpot unfold Consistency scoreLogAtomFullLaw rw [ae_map_iff hrow.aemeasurable hset] filter_upwards [] with ya rfl
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:92
theorem scoreLogAtomFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
e :
s :
ℝ
hg :
Proof (Lean source)
lemma scoreLogAtomFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (e : ScoreSpace ε) (s : ℝ) (hg : Measurable g) : DeterministicRelease g (scoreLogAtomFullLaw g e s) := by have hrow := scoreLogAtomRow_measurable g e have hset : MeasurableSet {ω : FullRow ε J | label ω = g (score ω)} := measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)) unfold DeterministicRelease scoreLogAtomFullLaw rw [ae_map_iff hrow.aemeasurable hset] filter_upwards [] with ya rfl
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:110
theorem scoreLogAtomFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
e :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
Proof (Lean source)
lemma scoreLogAtomFullLaw_randomizedAssignment {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (e : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : RandomizedAssignment (scoreLogAtomFullLaw g e s) := by intro B hB let μ : Measure OutcomeSpace := trialOutcomeLaw s let ν : Measure ArmSpace := scoreLogArmLaw e let f : OutcomeSpace × ArmSpace → FullRow ε J := fun ya => scoreLogAtomRow g e ya.1 ya.2 have hf : Measurable f := scoreLogAtomRow_measurable g e let U : Set OutcomeSpace := {y | (e, trialZeroOutcome, y) ∈ B} have hU : MeasurableSet U := by exact hB.preimage (by fun_prop : Measurable (fun y : OutcomeSpace => (e, trialZeroOutcome, y))) let S : Set (FullRow ε J) := {ω | arm ω = true ∧ latentTriple ω ∈ B} let T : Set (FullRow ε J) := {ω | latentTriple ω ∈ B} have hlatent : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop have hS : MeasurableSet S := (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage hlatent) have hT : MeasurableSet T := hB.preimage hlatent have hpreS : f ⁻¹' S = U ×ˢ {true} := by ext ya cases ha : ya.2 <;> simp [f, S, U, scoreLogAtomRow, arm, latentTriple, score, outcome0, outcome1, ha] have hpreT : f ⁻¹' T = U ×ˢ univ := by ext ya simp [f, T, U, scoreLogAtomRow, latentTriple, score, outcome0, outcome1] have hνprob : IsProbabilityMeasure ν := scoreLogArmLaw_isProbabilityMeasure e hOverlap have hνuniv : ν.real univ = 1 := isProbabilityMeasure_iff_real.mp hνprob change (scoreLogAtomFullLaw g e s).real S = ∫ ω in T, (score ω : ℝ) ∂scoreLogAtomFullLaw g e s have hleft : (scoreLogAtomFullLaw g e s).real S = μ.real U * (e : ℝ) := by unfold scoreLogAtomFullLaw rw [MeasureTheory.map_measureReal_apply hf hS, hpreS, measureReal_prod_prod] rw [show ν.real {true} = (e : ℝ) from scoreLogArmLaw_true_mass e hOverlap] have hright : (∫ ω in T, (score ω : ℝ) ∂scoreLogAtomFullLaw g e s) = μ.real U * (e : ℝ) := by unfold scoreLogAtomFullLaw rw [MeasureTheory.setIntegral_map hT (by unfold score; fun_prop) hf.aemeasurable] rw [hpreT] change ∫ _ in U ×ˢ univ, (e : ℝ) ∂(μ.prod ν) = _ rw [setIntegral_const, measureReal_prod_prod, hνuniv] simp only [smul_eq_mul, mul_one] exact hleft.trans hright.symm
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:124
theorem randomizedAssignment_smul_of_ne_top

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
P :
c :
hc :
c ≠ ∞
Proof (Lean source)
lemma randomizedAssignment_smul_of_ne_top {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) (hP : RandomizedAssignment P) (c : ENNReal) (hc : c ≠ ∞) : RandomizedAssignment (c • P) := by intro B hB have hS : MeasurableSet {ω : FullRow ε J | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} := by exact (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage (by unfold score outcome0 outcome1; fun_prop)) rw [Measure.real_def] change ((c • P) {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B}).toReal = ∫ ω, (score ω : ℝ) ∂(c • P).restrict {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} rw [Measure.smul_apply, Measure.restrict_smul, integral_smul_measure] simp only [smul_eq_mul, ENNReal.toReal_mul] have hr := hP B hB rw [Measure.real_def] at hr rw [hr]
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedAssignment_smul_of_ne_top · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:177
theorem score_integrable_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
Integrable (fun ω => (score ω : ℝ)) P
Proof (Lean source)
lemma score_integrable_finite {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsFiniteMeasure P] : Integrable (fun ω => (score ω : ℝ)) P := by apply Integrable.of_bound (by unfold score; fun_prop) (|ε| + |1 - ε| + 1) filter_upwards [] with ω change |((score ω : ScoreSpace ε) : ℝ)| ≤ |ε| + |1 - ε| + 1 rcases (score ω).property with ⟨he₁, he₂⟩ have h₁ := neg_le_abs ε have h₂ := le_abs_self (1 - ε) have h₃ := neg_le_abs (1 - ε) have h₄ := le_abs_self ε exact abs_le.mpr ⟨by linarith, by linarith⟩
CausalSmith.PartialID.UnlinkedPropensityAte.score_integrable_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:197
theorem randomizedAssignment_add

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma randomizedAssignment_add {ε : ℝ} {J : ℕ} (P Q : Measure (FullRow ε J)) [IsFiniteMeasure P] [IsFiniteMeasure Q] (hP : RandomizedAssignment P) (hQ : RandomizedAssignment Q) : RandomizedAssignment (P + Q) := by intro B hB let T : Set (FullRow ε J) := {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} have hT : MeasurableSet T := hB.preimage (by unfold score outcome0 outcome1; fun_prop) have hS : MeasurableSet {ω : FullRow ε J | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} := by exact (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter hT change (P + Q).real _ = ∫ ω in T, (score ω : ℝ) ∂(P + Q) rw [Measure.real_def, Measure.add_apply _ _ _, ENNReal.toReal_add (measure_ne_top P _) (measure_ne_top Q _)] rw [Measure.restrict_add, integral_add_measure (score_integrable_finite P).integrableOn (score_integrable_finite Q).integrableOn] change P.real _ + Q.real _ = _ rw [hP B hB, hQ B hB]
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedAssignment_add · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:211
theorem scoreLogTripleFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
x y z :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
w₁ w₂ w₃ :
ℝ
Proof (Lean source)
lemma scoreLogTripleFullLaw_randomizedAssignment {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (x y z : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (w₁ w₂ w₃ : ℝ) : RandomizedAssignment (ofReal w₁ • scoreLogAtomFullLaw g x s + ofReal w₂ • scoreLogAtomFullLaw g y s + ofReal w₃ • scoreLogAtomFullLaw g z s) := by letI : IsProbabilityMeasure (scoreLogAtomFullLaw g x s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap x s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g y s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap y s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g z s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap z s hs0 hs1 have hx := randomizedAssignment_smul_of_ne_top _ (scoreLogAtomFullLaw_randomizedAssignment g hOverlap x s hs0 hs1) (ofReal w₁) (by simp) have hy := randomizedAssignment_smul_of_ne_top _ (scoreLogAtomFullLaw_randomizedAssignment g hOverlap y s hs0 hs1) (ofReal w₂) (by simp) have hz := randomizedAssignment_smul_of_ne_top _ (scoreLogAtomFullLaw_randomizedAssignment g hOverlap z s hs0 hs1) (ofReal w₃) (by simp) letI : IsFiniteMeasure (ofReal w₁ • scoreLogAtomFullLaw g x s) := ⟨by simp⟩ letI : IsFiniteMeasure (ofReal w₂ • scoreLogAtomFullLaw g y s) := ⟨by simp⟩ letI : IsFiniteMeasure (ofReal w₃ • scoreLogAtomFullLaw g z s) := ⟨by simp⟩ exact randomizedAssignment_add _ _ (randomizedAssignment_add _ _ hx hy) hz
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:233
def scoreLogTripleBaselineFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
x y z :
s :
ℝ
scoreLogTripleBaselineFullLaw g x y z s :
ofReal (1 / 3 : ℝ) • scoreLogAtomFullLaw g x s
+ ofReal (1 / 3 : ℝ) • scoreLogAtomFullLaw g y s
+ ofReal (1 / 3 : ℝ) • scoreLogAtomFullLaw g z s
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:265
def scoreLogTriplePerturbedFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
x y z :
s u :
ℝ
scoreLogTriplePerturbedFullLaw g x y z s u :
ofReal (1 / 3 + u * ((z : ℝ) - y)) • scoreLogAtomFullLaw g x s
+ ofReal (1 / 3 - u * ((z : ℝ) - x)) • scoreLogAtomFullLaw g y s
+ ofReal (1 / 3 + u * ((y : ℝ) - x)) • scoreLogAtomFullLaw g z s
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:273
theorem scoreLogTripleBaselineFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
x y z :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
Proof (Lean source)
lemma scoreLogTripleBaselineFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (x y z : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : IsProbabilityMeasure (scoreLogTripleBaselineFullLaw g x y z s) := by letI : IsProbabilityMeasure (scoreLogAtomFullLaw g x s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap x s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g y s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap y s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g z s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap z s hs0 hs1 rw [isProbabilityMeasure_iff] unfold scoreLogTripleBaselineFullLaw rw [Measure.add_apply, Measure.add_apply] simp only [Measure.smul_apply, measure_univ, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3) (by norm_num), ← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3 + 1 / 3) (by norm_num)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:283
theorem scoreLogTriplePerturbedFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
x y z :
hxy :
x < y
hyz :
y < z
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
Proof (Lean source)
lemma scoreLogTriplePerturbedFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : IsProbabilityMeasure (scoreLogTriplePerturbedFullLaw g x y z s u) := by letI : IsProbabilityMeasure (scoreLogAtomFullLaw g x s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap x s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g y s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap y s hs0 hs1 letI : IsProbabilityMeasure (scoreLogAtomFullLaw g z s) := scoreLogAtomFullLaw_isProbabilityMeasure g hOverlap z s hs0 hs1 have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hsum := (scoreLogTriple_weight_identities x y z hxy hyz u).1 rw [isProbabilityMeasure_iff] unfold scoreLogTriplePerturbedFullLaw rw [Measure.add_apply, Measure.add_apply] simp only [Measure.smul_apply, measure_univ, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add hw.1 hw.2.1, ← ENNReal.ofReal_add (add_nonneg hw.1 hw.2.1) hw.2.2, hsum] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:301
theorem scoreLogTripleBaselineFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
x y z :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
Proof (Lean source)
lemma scoreLogTripleBaselineFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (x y z : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : ScoreMarginal (scoreLogTripleBaselineFullLaw g x y z s) (scoreLogTripleBaseline x y z) := by unfold ScoreMarginal scoreLogTripleBaselineFullLaw scoreLogTripleBaseline rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_smul, Measure.map_smul, Measure.map_smul] rw [scoreLogAtomFullLaw_scoreMarginal g hOverlap x s hs0 hs1, scoreLogAtomFullLaw_scoreMarginal g hOverlap y s hs0 hs1, scoreLogAtomFullLaw_scoreMarginal g hOverlap z s hs0 hs1]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:323
theorem scoreLogTriplePerturbedFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
x y z :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
u :
ℝ
Proof (Lean source)
lemma scoreLogTriplePerturbedFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (x y z : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (u : ℝ) : ScoreMarginal (scoreLogTriplePerturbedFullLaw g x y z s u) (scoreLogTriplePerturbed x y z u) := by unfold ScoreMarginal scoreLogTriplePerturbedFullLaw scoreLogTriplePerturbed rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_smul, Measure.map_smul, Measure.map_smul] rw [scoreLogAtomFullLaw_scoreMarginal g hOverlap x s hs0 hs1, scoreLogAtomFullLaw_scoreMarginal g hOverlap y s hs0 hs1, scoreLogAtomFullLaw_scoreMarginal g hOverlap z s hs0 hs1]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:336
theorem scoreLogTripleBaselineFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
x y z :
s :
ℝ
Consistency (scoreLogTripleBaselineFullLaw g x y z s)
Proof (Lean source)
lemma scoreLogTripleBaselineFullLaw_consistency {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (x y z : ScoreSpace ε) (s : ℝ) : Consistency (scoreLogTripleBaselineFullLaw g x y z s) := by unfold Consistency scoreLogTripleBaselineFullLaw rw [ae_add_measure_iff, ae_add_measure_iff] exact ⟨⟨Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g x s) _, Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g y s) _⟩, Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g z s) _⟩
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:350
theorem scoreLogTriplePerturbedFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
x y z :
s u :
ℝ
Consistency (scoreLogTriplePerturbedFullLaw g x y z s u)
Proof (Lean source)
lemma scoreLogTriplePerturbedFullLaw_consistency {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (x y z : ScoreSpace ε) (s u : ℝ) : Consistency (scoreLogTriplePerturbedFullLaw g x y z s u) := by unfold Consistency scoreLogTriplePerturbedFullLaw rw [ae_add_measure_iff, ae_add_measure_iff] exact ⟨⟨Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g x s) _, Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g y s) _⟩, Measure.ae_smul_measure (scoreLogAtomFullLaw_consistency g z s) _⟩
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:359
theorem scoreLogTripleBaselineFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
x y z :
s :
ℝ
Proof (Lean source)
lemma scoreLogTripleBaselineFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (x y z : ScoreSpace ε) (s : ℝ) : DeterministicRelease g (scoreLogTripleBaselineFullLaw g x y z s) := by unfold DeterministicRelease scoreLogTripleBaselineFullLaw rw [ae_add_measure_iff, ae_add_measure_iff] exact ⟨⟨Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g x s hg) _, Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g y s hg) _⟩, Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g z s hg) _⟩
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:368
theorem scoreLogTriplePerturbedFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
x y z :
s u :
ℝ
Proof (Lean source)
lemma scoreLogTriplePerturbedFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (x y z : ScoreSpace ε) (s u : ℝ) : DeterministicRelease g (scoreLogTriplePerturbedFullLaw g x y z s u) := by unfold DeterministicRelease scoreLogTriplePerturbedFullLaw rw [ae_add_measure_iff, ae_add_measure_iff] exact ⟨⟨Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g x s hg) _, Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g y s hg) _⟩, Measure.ae_smul_measure (scoreLogAtomFullLaw_deterministicRelease g z s hg) _⟩
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:379
theorem scoreLogTripleBaseline_externalScoreLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
x y z :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
Proof (Lean source)
lemma scoreLogTripleBaseline_externalScoreLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (x y z : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : ExternalScoreLaw g (scoreLogTripleBaselineFullLaw g x y z s) (scoreLogTripleBaseline x y z) where probabilityP := scoreLogTripleBaselineFullLaw_isProbabilityMeasure g hOverlap x y z s hs0 hs1 probabilityH := scoreLogTripleBaseline_isProbabilityMeasure x y z overlap := hOverlap measurableRelease := hg scoreMarginal := scoreLogTripleBaselineFullLaw_scoreMarginal g hOverlap x y z s hs0 hs1 randomizedAssignment := scoreLogTripleFullLaw_randomizedAssignment g hOverlap x y z s hs0 hs1 (1 / 3) (1 / 3) (1 / 3) consistency := scoreLogTripleBaselineFullLaw_consistency g x y z s deterministicRelease := scoreLogTripleBaselineFullLaw_deterministicRelease g hg x y z s
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_externalScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:391
theorem scoreLogTriplePerturbed_externalScoreLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
x y z :
hxy :
x < y
hyz :
y < z
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
ExternalScoreLaw g (scoreLogTriplePerturbedFullLaw g x y z s u) (scoreLogTriplePerturbed x y z u) where probabilityP
Proof (Lean source)
lemma scoreLogTriplePerturbed_externalScoreLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : ExternalScoreLaw g (scoreLogTriplePerturbedFullLaw g x y z s u) (scoreLogTriplePerturbed x y z u) where probabilityP := scoreLogTriplePerturbedFullLaw_isProbabilityMeasure g hOverlap x y z hxy hyz s hs0 hs1 u hu0 hu probabilityH := scoreLogTriplePerturbed_isProbabilityMeasure x y z hxy hyz u hu0 hu overlap := hOverlap measurableRelease := hg scoreMarginal := scoreLogTriplePerturbedFullLaw_scoreMarginal g hOverlap x y z s hs0 hs1 u randomizedAssignment := scoreLogTripleFullLaw_randomizedAssignment g hOverlap x y z s hs0 hs1 (1 / 3 + u * ((z : ℝ) - y)) (1 / 3 - u * ((z : ℝ) - x)) (1 / 3 + u * ((y : ℝ) - x)) consistency := scoreLogTriplePerturbedFullLaw_consistency g x y z s u deterministicRelease := scoreLogTriplePerturbedFullLaw_deterministicRelease g hg x y z s u
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_externalScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:411
theorem scoreLogAtomFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
e :
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
= ofReal (e : ℝ) • (trialOutcomeLaw s).map (fun y => (g e, true, y))
+ ofReal (1 - (e : ℝ)) • Measure.dirac (g e, false, trialZeroOutcome)
Proof (Lean source)
lemma scoreLogAtomFullLaw_releasedLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (e : ScoreSpace ε) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) : releasedLaw (scoreLogAtomFullLaw g e s) = ofReal (e : ℝ) • (trialOutcomeLaw s).map (fun y => (g e, true, y)) + ofReal (1 - (e : ℝ)) • Measure.dirac (g e, false, trialZeroOutcome) := by letI : IsProbabilityMeasure (trialOutcomeLaw s) := trialOutcomeLaw_isProbabilityMeasure s hs0 hs1 have hrow := scoreLogAtomRow_measurable g e have hread : Measurable (fun ya : OutcomeSpace × ArmSpace => (g e, ya.2, if ya.2 then ya.1 else trialZeroOutcome)) := by have hcond : MeasurableSet {ya : OutcomeSpace × ArmSpace | ya.2 = true} := measurableSet_eq_fun measurable_snd measurable_const have hobs : Measurable (fun ya : OutcomeSpace × ArmSpace => if ya.2 then ya.1 else trialZeroOutcome) := Measurable.ite hcond measurable_fst measurable_const fun_prop (disch := assumption) unfold releasedLaw scoreLogAtomFullLaw rw [Measure.map_map (by unfold releasedRecord label arm observed; fun_prop) hrow] change ((trialOutcomeLaw s).prod (scoreLogArmLaw e)).map _ = _ unfold scoreLogArmLaw rw [Measure.prod_add _, Measure.prod_smul_right, Measure.prod_smul_right] change Measure.map (fun ya : OutcomeSpace × ArmSpace => (g e, ya.2, if ya.2 then ya.1 else trialZeroOutcome)) _ = _ rw [Measure.map_add _ _ hread, Measure.map_smul, Measure.map_smul, Measure.prod_dirac, Measure.prod_dirac, Measure.map_map hread (by fun_prop), Measure.map_map hread (by fun_prop)] congr 1 rw [show ((fun ya : OutcomeSpace × ArmSpace => (g e, ya.2, if ya.2 then ya.1 else trialZeroOutcome)) ∘ fun y => (y, false)) = (fun _ : OutcomeSpace => (g e, false, trialZeroOutcome)) by funext y rfl] rw [Measure.map_const] simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogAtomFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:437
theorem scoreLogTripleBaselineFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
x y z :
s :
ℝ
= ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g x s)
+ ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g y s)
+ ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g z s)
Proof (Lean source)
lemma scoreLogTripleBaselineFullLaw_releasedLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (x y z : ScoreSpace ε) (s : ℝ) : releasedLaw (scoreLogTripleBaselineFullLaw g x y z s) = ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g x s) + ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g y s) + ofReal (1 / 3 : ℝ) • releasedLaw (scoreLogAtomFullLaw g z s) := by unfold releasedLaw scoreLogTripleBaselineFullLaw rw [Measure.map_add _ _ (by unfold releasedRecord label arm observed; fun_prop), Measure.map_add _ _ (by unfold releasedRecord label arm observed; fun_prop), Measure.map_smul, Measure.map_smul, Measure.map_smul]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaselineFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:477
theorem scoreLogTriplePerturbedFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
x y z :
s u :
ℝ
= ofReal (1 / 3 + u * ((z : ℝ) - y)) • releasedLaw (scoreLogAtomFullLaw g x s)
+ ofReal (1 / 3 - u * ((z : ℝ) - x)) • releasedLaw (scoreLogAtomFullLaw g y s)
+ ofReal (1 / 3 + u * ((y : ℝ) - x)) • releasedLaw (scoreLogAtomFullLaw g z s)
Proof (Lean source)
lemma scoreLogTriplePerturbedFullLaw_releasedLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (x y z : ScoreSpace ε) (s u : ℝ) : releasedLaw (scoreLogTriplePerturbedFullLaw g x y z s u) = ofReal (1 / 3 + u * ((z : ℝ) - y)) • releasedLaw (scoreLogAtomFullLaw g x s) + ofReal (1 / 3 - u * ((z : ℝ) - x)) • releasedLaw (scoreLogAtomFullLaw g y s) + ofReal (1 / 3 + u * ((y : ℝ) - x)) • releasedLaw (scoreLogAtomFullLaw g z s) := by unfold releasedLaw scoreLogTriplePerturbedFullLaw rw [Measure.map_add _ _ (by unfold releasedRecord label arm observed; fun_prop), Measure.map_add _ _ (by unfold releasedRecord label arm observed; fun_prop), Measure.map_smul, Measure.map_smul, Measure.map_smul]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbedFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:490
theorem scoreLogTriple_releasedLaw_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
Proof (Lean source)
lemma scoreLogTriple_releasedLaw_eq {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : releasedLaw (scoreLogTripleBaselineFullLaw g x y z s) = releasedLaw (scoreLogTriplePerturbedFullLaw g x y z s u) := by have ex0 : 0 ≤ (x : ℝ) := le_trans hOverlap.1.le x.property.1 have ey0 : 0 ≤ (y : ℝ) := le_trans hOverlap.1.le y.property.1 have ez0 : 0 ≤ (z : ℝ) := le_trans hOverlap.1.le z.property.1 have ex1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have ey1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have ez1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hid := scoreLogTriple_weight_identities x y z hxy hyz u let w₁ : ℝ := 1 / 3 + u * ((z : ℝ) - y) let w₂ : ℝ := 1 / 3 - u * ((z : ℝ) - x) let w₃ : ℝ := 1 / 3 + u * ((y : ℝ) - x) have hw' : 0 ≤ w₁ ∧ 0 ≤ w₂ ∧ 0 ≤ w₃ := by simpa [w₁, w₂, w₃] using hw have htReal : (1 / 3) * (x : ℝ) + (1 / 3) * (y : ℝ) + (1 / 3) * (z : ℝ) = w₁ * (x : ℝ) + w₂ * (y : ℝ) + w₃ * (z : ℝ) := by dsimp [w₁, w₂, w₃] nlinarith [hid.2] have hcReal : (1 / 3) * (1 - (x : ℝ)) + (1 / 3) * (1 - (y : ℝ)) + (1 / 3) * (1 - (z : ℝ)) = w₁ * (1 - (x : ℝ)) + w₂ * (1 - (y : ℝ)) + w₃ * (1 - (z : ℝ)) := by dsimp [w₁, w₂, w₃] nlinarith [hid.1, hid.2] have ht := ennreal_three_weighted_eq (x : ℝ) y z (1 / 3) (1 / 3) (1 / 3) w₁ w₂ w₃ ex0 ey0 ez0 (by norm_num) (by norm_num) (by norm_num) hw'.1 hw'.2.1 hw'.2.2 htReal have hc := ennreal_three_weighted_eq (1 - (x : ℝ)) (1 - (y : ℝ)) (1 - (z : ℝ)) (1 / 3) (1 / 3) (1 / 3) w₁ w₂ w₃ (sub_nonneg.mpr ex1) (sub_nonneg.mpr ey1) (sub_nonneg.mpr ez1) (by norm_num) (by norm_num) (by norm_num) hw'.1 hw'.2.1 hw'.2.2 hcReal let T : Measure (Observation J) := (trialOutcomeLaw s).map (fun y => (r, true, y)) let F : Measure (Observation J) := Measure.dirac (r, false, trialZeroOutcome) have hb : releasedLaw (scoreLogTripleBaselineFullLaw g x y z s) = (ofReal (1 / 3 : ℝ) * ofReal (x : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (y : ℝ) + ofReal (1 / 3 : ℝ) * ofReal (z : ℝ)) • T + (ofReal (1 / 3 : ℝ) * ofReal (1 - (x : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (y : ℝ)) + ofReal (1 / 3 : ℝ) * ofReal (1 - (z : ℝ))) • F := by rw [scoreLogTripleBaselineFullLaw_releasedLaw, scoreLogAtomFullLaw_releasedLaw g x s hs0 hs1, scoreLogAtomFullLaw_releasedLaw g y s hs0 hs1, scoreLogAtomFullLaw_releasedLaw g z s hs0 hs1, hx, hy, hz] dsimp [T, F] module have hp : releasedLaw (scoreLogTriplePerturbedFullLaw g x y z s u) = (ofReal w₁ * ofReal (x : ℝ) + ofReal w₂ * ofReal (y : ℝ) + ofReal w₃ * ofReal (z : ℝ)) • T + (ofReal w₁ * ofReal (1 - (x : ℝ)) + ofReal w₂ * ofReal (1 - (y : ℝ)) + ofReal w₃ * ofReal (1 - (z : ℝ))) • F := by rw [scoreLogTriplePerturbedFullLaw_releasedLaw, scoreLogAtomFullLaw_releasedLaw g x s hs0 hs1, scoreLogAtomFullLaw_releasedLaw g y s hs0 hs1, scoreLogAtomFullLaw_releasedLaw g z s hs0 hs1, hx, hy, hz] dsimp [w₁, w₂, w₃, T, F] module rw [hb, hp, ht, hc]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_releasedLaw_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:530
theorem scoreLogTriple_externalPair

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
s :
ℝ
hs0 :
0 ≤ s
hs1 :
s ≤ 1
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
(P₀, H₀) ∈ ExternalLaws g
(P₁, H₁) ∈ ExternalLaws g
Proof (Lean source)
lemma scoreLogTriple_externalPair {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (s : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : let P₀ := scoreLogTripleBaselineFullLaw g x y z s let H₀ := scoreLogTripleBaseline x y z let P₁ := scoreLogTriplePerturbedFullLaw g x y z s u let H₁ := scoreLogTriplePerturbed x y z u (P₀, H₀) ∈ ExternalLaws g ∧ (P₁, H₁) ∈ ExternalLaws g ∧ releasedLaw P₀ = releasedLaw P₁ := by dsimp refine ⟨?_, ?_, scoreLogTriple_releasedLaw_eq g hOverlap r x y z hxy hyz hx hy hz s hs0 hs1 u hu0 hu⟩ · exact ⟨scoreLogTripleBaselineFullLaw_isProbabilityMeasure g hOverlap x y z s hs0 hs1, scoreLogTripleBaseline_isProbabilityMeasure x y z, scoreLogTripleBaseline_externalScoreLaw g hOverlap hg x y z s hs0 hs1⟩ · exact ⟨scoreLogTriplePerturbedFullLaw_isProbabilityMeasure g hOverlap x y z hxy hyz s hs0 hs1 u hu0 hu, scoreLogTriplePerturbed_isProbabilityMeasure x y z hxy hyz u hu0 hu, scoreLogTriplePerturbed_externalScoreLaw g hOverlap hg x y z hxy hyz s hs0 hs1 u hu0 hu⟩
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_externalPair · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogFullLaw.lean:601
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogHonestLength 2 declarations Honest two-point lower bounds for excess interval length.

Honest two-point lower bounds for excess interval length.

theorem externalInterval_twoPoint_expectedExcessLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
epsilon :
ℝ
J n m :
ℕ
C :
theta0 theta1 W0 Delta alpha :
ℝ
_htheta :
theta0 ≤ theta1
hsep :
theta1 - theta0 = W0 + Delta
hDelta :
0 ≤ Delta
hcover0 :
1 - alpha ≤ Q0.real {x | C.contains x theta0}
hcover1 :
1 - alpha ≤ Q1.real {x | C.contains x theta1}
Delta * (1 - 2 * alpha - tvDist Q0 Q1) ≤ ∫ x, max 0 (C.length x - W0) ∂Q0
Proof (Lean source)
lemma externalInterval_twoPoint_expectedExcessLength {epsilon : ℝ} {J n m : ℕ} (C : ExternalIntervalProcedure epsilon J n m) (Q0 Q1 : Measure (ExternalSample epsilon J n m)) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (theta0 theta1 W0 Delta alpha : ℝ) (_htheta : theta0 ≤ theta1) (hsep : theta1 - theta0 = W0 + Delta) (hDelta : 0 ≤ Delta) (hcover0 : 1 - alpha ≤ Q0.real {x | C.contains x theta0}) (hcover1 : 1 - alpha ≤ Q1.real {x | C.contains x theta1}) : Delta * (1 - 2 * alpha - tvDist Q0 Q1) ≤ ∫ x, max 0 (C.length x - W0) ∂Q0 := by let A0 : Set (ExternalSample epsilon J n m) := {x | C.contains x theta0} let A1 : Set (ExternalSample epsilon J n m) := {x | C.contains x theta1} let I := A0 ∩ A1 have hA (theta : ℝ) : MeasurableSet {x | C.contains x theta} := by change MeasurableSet {x | C.lo x ≤ theta ∧ theta ≤ C.hi x} exact (measurableSet_le C.measurable_lo measurable_const).inter (measurableSet_le measurable_const C.measurable_hi) have hA0 : MeasurableSet A0 := hA theta0 have hA1 : MeasurableSet A1 := hA theta1 have hI : MeasurableSet I := hA0.inter hA1 have htransfer : 1 - alpha - tvDist Q0 Q1 ≤ Q0.real A1 := by have htv := measureReal_sub_le_tvDist (μ := Q0) (ν := Q1) hA1 dsimp [A1] at htv linarith have hmass : 1 - 2 * alpha - tvDist Q0 Q1 ≤ Q0.real I := by have hu : Q0.real (A0 ∪ A1) ≤ 1 := measureReal_le_one have hsum := measureReal_union_add_inter (μ := Q0) (s := A0) (t := A1) hA1 (measure_ne_top Q0 A0) (measure_ne_top Q0 A1) change Q0.real (A0 ∪ A1) + Q0.real I = Q0.real A0 + Q0.real A1 at hsum linarith have hlengthInt : Integrable C.length Q0 := by have hlengthMeas : Measurable C.length := C.measurable_hi.sub C.measurable_lo apply Integrable.of_bound hlengthMeas.aestronglyMeasurable 2 filter_upwards with x dsimp [ExternalIntervalProcedure.length] rw [abs_of_nonneg (sub_nonneg.mpr (C.ordered x))] linarith [C.lower_bound x, C.upper_bound x] have hexcessInt : Integrable (fun x => max 0 (C.length x - W0)) Q0 := by have hsub : Integrable (fun x => C.length x - W0) Q0 := by fun_prop simpa only [max_comm] using hsub.pos_part have hindInt : Integrable (I.indicator (fun _ => Delta)) Q0 := (integrable_const _).indicator hI have hpoint (x : ExternalSample epsilon J n m) : I.indicator (fun _ => Delta) x ≤ max 0 (C.length x - W0) := by by_cases hx : x ∈ I · rw [Set.indicator_of_mem hx] have hx0 : C.lo x ≤ theta0 ∧ theta0 ≤ C.hi x := hx.1 have hx1 : C.lo x ≤ theta1 ∧ theta1 ≤ C.hi x := hx.2 apply le_max_of_le_right dsimp [ExternalIntervalProcedure.length] linarith · rw [Set.indicator_of_notMem hx] exact le_max_left _ _ have hmono := integral_mono hindInt hexcessInt hpoint rw [integral_indicator_const Delta hI] at hmono simp only [smul_eq_mul] at hmono rw [mul_comm (Q0.real I) Delta] at hmono exact (mul_le_mul_of_nonneg_left hmass hDelta).trans hmono
CausalSmith.PartialID.UnlinkedPropensityAte.externalInterval_twoPoint_expectedExcessLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogHonestLength.lean:13
theorem externalInterval_twoPoint_expectedExcessLength_of_tv

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
epsilon :
ℝ
J n m :
ℕ
C :
theta0 theta1 W0 Delta alpha :
ℝ
htheta :
theta0 ≤ theta1
hsep :
theta1 - theta0 = W0 + Delta
hDelta :
0 < Delta
hcover0 :
1 - alpha ≤ Q0.real {x | C.contains x theta0}
hcover1 :
1 - alpha ≤ Q1.real {x | C.contains x theta1}
htv :
tvDist Q0 Q1 ≤ (1 - 2 * alpha) / 2
Delta * ((1 - 2 * alpha) / 2) ≤ ∫ x, max 0 (C.length x - W0) ∂Q0
Proof (Lean source)
lemma externalInterval_twoPoint_expectedExcessLength_of_tv {epsilon : ℝ} {J n m : ℕ} (C : ExternalIntervalProcedure epsilon J n m) (Q0 Q1 : Measure (ExternalSample epsilon J n m)) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (theta0 theta1 W0 Delta alpha : ℝ) (htheta : theta0 ≤ theta1) (hsep : theta1 - theta0 = W0 + Delta) (hDelta : 0 < Delta) (hcover0 : 1 - alpha ≤ Q0.real {x | C.contains x theta0}) (hcover1 : 1 - alpha ≤ Q1.real {x | C.contains x theta1}) (htv : tvDist Q0 Q1 ≤ (1 - 2 * alpha) / 2) : Delta * ((1 - 2 * alpha) / 2) ≤ ∫ x, max 0 (C.length x - W0) ∂Q0 := by have hexact := externalInterval_twoPoint_expectedExcessLength C Q0 Q1 theta0 theta1 W0 Delta alpha htheta hsep hDelta.le hcover0 hcover1 have hcoefficient : (1 - 2 * alpha) / 2 ≤ 1 - 2 * alpha - tvDist Q0 Q1 := by linarith exact (mul_le_mul_of_nonneg_left hcoefficient hDelta.le).trans hexact
CausalSmith.PartialID.UnlinkedPropensityAte.externalInterval_twoPoint_expectedExcessLength_of_tv · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogHonestLength.lean:81
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogInverseQuantile 1 declarations Exact lower quantiles for the ordered three-atom inverse-score law.

Exact lower quantiles for the ordered three-atom inverse-score law.

theorem threeScoreInverseLaw_quantile

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z w₁ w₂ w₃ u :
ℝ
hx :
0 < x
hxy :
x < y
hyz :
y < z
hw₁ :
0 ≤ w₁
hw₂ :
0 ≤ w₂
hw₃ :
0 ≤ w₃
hq :
0 < x * w₁ + y * w₂ + z * w₃
hu0 :
0 < u
hu1 :
u < 1
quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u
= if u ≤ z * w₃ / (x * w₁ + y * w₂ + z * w₃) then 1 / z else if u ≤ z * w₃ / (x * w₁ + y * w₂ + z * w₃)
+ y * w₂ / (x * w₁ + y * w₂ + z * w₃) then 1 / y else 1 / x
Proof (Lean source)
lemma threeScoreInverseLaw_quantile (x y z w₁ w₂ w₃ u : ℝ) (hx : 0 < x) (hxy : x < y) (hyz : y < z) (hw₁ : 0 ≤ w₁) (hw₂ : 0 ≤ w₂) (hw₃ : 0 ≤ w₃) (hq : 0 < x * w₁ + y * w₂ + z * w₃) (hu0 : 0 < u) (hu1 : u < 1) : quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u = if u ≤ z * w₃ / (x * w₁ + y * w₂ + z * w₃) then 1 / z else if u ≤ z * w₃ / (x * w₁ + y * w₂ + z * w₃) + y * w₂ / (x * w₁ + y * w₂ + z * w₃) then 1 / y else 1 / x := by have hy : 0 < y := lt_trans hx hxy have hz : 0 < z := lt_trans hy hyz have hAB : 1 / z < 1 / y := one_div_lt_one_div_of_lt hy hyz have hBC : 1 / y < 1 / x := one_div_lt_one_div_of_lt hx hxy have ha : 0 ≤ x * w₁ / (x * w₁ + y * w₂ + z * w₃) := div_nonneg (mul_nonneg hx.le hw₁) hq.le have hb : 0 ≤ y * w₂ / (x * w₁ + y * w₂ + z * w₃) := div_nonneg (mul_nonneg hy.le hw₂) hq.le have hc : 0 ≤ z * w₃ / (x * w₁ + y * w₂ + z * w₃) := div_nonneg (mul_nonneg hz.le hw₃) hq.le have hsum : x * w₁ / (x * w₁ + y * w₂ + z * w₃) + y * w₂ / (x * w₁ + y * w₂ + z * w₃) + z * w₃ / (x * w₁ + y * w₂ + z * w₃) = 1 := by field_simp unfold threeScoreInverseLaw exact orderedThreeAtomLaw_quantile (1 / z) (1 / y) (1 / x) (x * w₁ / (x * w₁ + y * w₂ + z * w₃)) (y * w₂ / (x * w₁ + y * w₂ + z * w₃)) (z * w₃ / (x * w₁ + y * w₂ + z * w₃)) u hAB hBC ha hb hc hsum hu0 hu1
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreInverseLaw_quantile · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogInverseQuantile.lean:153
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogLimit 3 declarations Transfer of eventual uniform log certificates through an infimum and liminf.

Transfer of eventual uniform log certificates through an infimum and liminf.

theorem logCertificate_liminf_infimum_of_eventual_uniform

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
beta C :
ℝ
R :
ℕ → ℕ → ℝ
hLower :
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹ ≤ R n m
hUpperWitness :
∀ᶠ m : ℕ in atTop, ∃ n : ℕ, 0 < n ∧ sqrt (m : ℝ) * R n m ≤ C
beta
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop
Proof (Lean source)
lemma logCertificate_liminf_infimum_of_eventual_uniform (beta C : ℝ) (R : ℕ → ℕ → ℝ) (hLower : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹ ≤ R n m) (hUpperWitness : ∀ᶠ m : ℕ in atTop, ∃ n : ℕ, 0 < n ∧ sqrt (m : ℝ) * R n m ≤ C) : beta ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop := by let F : ℕ → ℝ := fun m => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m} have hFLower : ∀ᶠ m : ℕ in atTop, beta ≤ F m := by filter_upwards [hLower, eventually_gt_atTop (0 : ℕ)] with m hlower hm have hsqrt : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) apply le_csInf · exact ⟨Real.sqrt (m : ℝ) * R 1 m, 1, by omega, rfl⟩ · rintro v ⟨n, hn, rfl⟩ have h := mul_le_mul_of_nonneg_left (hlower n hn) hsqrt.le field_simp at h simpa [mul_comm] using h have hFUpper : ∀ᶠ m : ℕ in atTop, F m ≤ C := by filter_upwards [hLower, hUpperWitness, eventually_gt_atTop (0 : ℕ)] with m hlower ⟨n, hn, hupper⟩ hm have hsqrt : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) have hsetBelow : BddBelow {v : ℝ | ∃ n' : ℕ, 0 < n' ∧ v = sqrt (m : ℝ) * R n' m} := by refine ⟨beta, ?_⟩ rintro v ⟨n', hn', rfl⟩ have h := mul_le_mul_of_nonneg_left (hlower n' hn') hsqrt.le field_simp at h simpa [mul_comm] using h exact (csInf_le hsetBelow ⟨n, hn, rfl⟩).trans hupper have hCobounded : atTop.IsCoboundedUnder (· ≥ ·) F := (isBoundedUnder_of_eventually_le hFUpper).isCoboundedUnder_ge exact le_liminf_of_le hCobounded hFLower
CausalSmith.PartialID.UnlinkedPropensityAte.logCertificate_liminf_infimum_of_eventual_uniform · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogLimit.lean:13
theorem externalNormalizer_self

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
m :
ℕ
hm :
0 < m
externalNormalizer m m = sqrt (m : ℝ) / 2
Proof (Lean source)
lemma externalNormalizer_self (m : ℕ) (hm : 0 < m) : externalNormalizer m m = sqrt (m : ℝ) / 2 := by have hsqrt : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) unfold externalNormalizer field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizer_self · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogLimit.lean:53
theorem logCertificate_liminf_infimum_of_normalized_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
beta C :
ℝ
R :
ℕ → ℕ → ℝ
hLower :
∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹ ≤ R n m
hUpper :
∀ (n m : ℕ)
if
0 < n
and
0 < m
then
externalNormalizer n m * R n m ≤ C
beta
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop
Proof (Lean source)
lemma logCertificate_liminf_infimum_of_normalized_upper (beta C : ℝ) (R : ℕ → ℕ → ℝ) (hLower : ∀ᶠ m : ℕ in atTop, ∀ n : ℕ, 0 < n → beta * (sqrt (m : ℝ))⁻¹ ≤ R n m) (hUpper : ∀ (n m : ℕ), 0 < n → 0 < m → externalNormalizer n m * R n m ≤ C) : beta ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * R n m}) atTop := by apply logCertificate_liminf_infimum_of_eventual_uniform beta (2 * C) R hLower filter_upwards [eventually_gt_atTop (0 : ℕ)] with m hm refine ⟨m, hm, ?_⟩ have h := mul_le_mul_of_nonneg_left (hUpper m m hm hm) (by norm_num : (0 : ℝ) ≤ 2) rw [externalNormalizer_self m hm] at h nlinarith
CausalSmith.PartialID.UnlinkedPropensityAte.logCertificate_liminf_infimum_of_normalized_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogLimit.lean:62
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogPair 6 declarations An explicit moment-matched three-score pair for the score-log lower bound.

An explicit moment-matched three-score pair for the score-log lower bound.

def scoreLogTripleBaseline

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
scoreLogTripleBaseline x y z :
(ofReal (1 / 3 : ℝ)) • Measure.dirac x
+ (ofReal (1 / 3 : ℝ)) • Measure.dirac y
+ (ofReal (1 / 3 : ℝ)) • Measure.dirac z
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:14
def scoreLogTriplePerturbed

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
u :
ℝ
scoreLogTriplePerturbed x y z u :
ofReal (1 / 3 + u * ((z : ℝ) - y)) • Measure.dirac x
+ ofReal (1 / 3 - u * ((z : ℝ) - x)) • Measure.dirac y
+ ofReal (1 / 3 + u * ((y : ℝ) - x)) • Measure.dirac z
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:21
theorem scoreLogTriple_weights_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
hxy :
x < y
hyz :
y < z
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
conclusion 1
0 ≤ 1 / 3 + u * ((z : ℝ) - y)
conclusion 2
0 ≤ 1 / 3 - u * ((z : ℝ) - x)
conclusion 3
0 ≤ 1 / 3 + u * ((y : ℝ) - x)
Proof (Lean source)
lemma scoreLogTriple_weights_nonneg {ε : ℝ} (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : 0 ≤ 1 / 3 + u * ((z : ℝ) - y) ∧ 0 ≤ 1 / 3 - u * ((z : ℝ) - x) ∧ 0 ≤ 1 / 3 + u * ((y : ℝ) - x) := by have hzy : 0 ≤ (z : ℝ) - y := sub_nonneg.mpr (le_of_lt hyz) have hyx : 0 ≤ (y : ℝ) - x := sub_nonneg.mpr (le_of_lt hxy) constructor · positivity constructor · linarith · positivity
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_weights_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:28
theorem scoreLogTriple_weight_identities

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
hxy :
x < y
hyz :
y < z
u :
ℝ
conclusion 1
(1 / 3 + u * ((z : ℝ) - y)) + (1 / 3 - u * ((z : ℝ) - x)) + (1 / 3 + u * ((y : ℝ) - x))
= 1
conclusion 2
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y))
+ (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))
+ (z : ℝ) * (1 / 3 + u * ((y : ℝ) - x))
= (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3
Proof (Lean source)
lemma scoreLogTriple_weight_identities {ε : ℝ} (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (u : ℝ) : (1 / 3 + u * ((z : ℝ) - y)) + (1 / 3 - u * ((z : ℝ) - x)) + (1 / 3 + u * ((y : ℝ) - x)) = 1 ∧ (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x)) + (z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)) = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := by have h := fiberTriple_perturbation_identities (x : ℝ) y z hxy hyz constructor <;> nlinarith [h.1, h.2.1]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_weight_identities · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:43
theorem scoreLogTripleBaseline_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
Proof (Lean source)
lemma scoreLogTripleBaseline_isProbabilityMeasure {ε : ℝ} (x y z : ScoreSpace ε) : IsProbabilityMeasure (scoreLogTripleBaseline x y z) := by rw [isProbabilityMeasure_iff] unfold scoreLogTripleBaseline rw [Measure.add_apply, Measure.add_apply] simp only [Measure.smul_apply, Measure.dirac_apply, Set.mem_univ, Set.indicator_of_mem, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3) (by norm_num), ← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3 + 1 / 3) (by norm_num)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:56
theorem scoreLogTriplePerturbed_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
hxy :
x < y
hyz :
y < z
u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
Proof (Lean source)
lemma scoreLogTriplePerturbed_isProbabilityMeasure {ε : ℝ} (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) : IsProbabilityMeasure (scoreLogTriplePerturbed x y z u) := by have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hsum := (scoreLogTriple_weight_identities x y z hxy hyz u).1 rw [isProbabilityMeasure_iff] unfold scoreLogTriplePerturbed rw [Measure.add_apply, Measure.add_apply] simp only [Measure.smul_apply, Measure.dirac_apply, Set.mem_univ, Set.indicator_of_mem, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add hw.1 hw.2.1, ← ENNReal.ofReal_add (add_nonneg hw.1 hw.2.1) hw.2.2] rw [hsum] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogPair.lean:69
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogQuantileBridge 2 declarations A measure-theoretic realization of the finite three-score coupling problem.

A measure-theoretic realization of the finite three-score coupling problem.

def threeScoreOutcomeLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
q t :
ℝ
threeScoreOutcomeLaw q t :
ofReal (t / q) • Measure.dirac 1 + ofReal (1 - t / q) • Measure.dirac 0
def threeScoreInverseLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
x y z w₁ w₂ w₃ :
ℝ
threeScoreInverseLaw x y z w₁ w₂ w₃ :
q :
x * w₁ + y * w₂ + z * w₃
(ofReal (x * w₁ / q) • Measure.dirac (1 / x) + ofReal (y * w₂ / q) • Measure.dirac (1 / y))
+ ofReal (z * w₃ / q) • Measure.dirac (1 / z)
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogQuantileExact 2 declarations Exact quantiles of the normalized Bernoulli margin in the three-score problem.

Exact quantiles of the normalized Bernoulli margin in the three-score problem.

theorem threeScoreOutcomeLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
q t :
ℝ
h0 :
0 ≤ t / q
h1 :
t / q ≤ 1
Proof (Lean source)
lemma threeScoreOutcomeLaw_isProbabilityMeasure (q t : ℝ) (h0 : 0 ≤ t / q) (h1 : t / q ≤ 1) : IsProbabilityMeasure (threeScoreOutcomeLaw q t) := by rw [isProbabilityMeasure_iff] unfold threeScoreOutcomeLaw rw [Measure.add_apply] simp only [Measure.smul_apply, Measure.dirac_apply, Set.mem_univ, Set.indicator_of_mem, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add h0 (sub_nonneg.mpr h1)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreOutcomeLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogQuantileExact.lean:15
theorem threeScoreOutcomeLaw_quantile

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
q t u :
ℝ
h0 :
0 ≤ t / q
h1 :
t / q ≤ 1
hu0 :
0 < u
hu1 :
u < 1
quantile (threeScoreOutcomeLaw q t) u = if u ≤ 1 - t / q then 0 else 1
Proof (Lean source)
lemma threeScoreOutcomeLaw_quantile (q t u : ℝ) (h0 : 0 ≤ t / q) (h1 : t / q ≤ 1) (hu0 : 0 < u) (hu1 : u < 1) : quantile (threeScoreOutcomeLaw q t) u = if u ≤ 1 - t / q then 0 else 1 := by letI := threeScoreOutcomeLaw_isProbabilityMeasure q t h0 h1 split_ifs with hu · apply le_antisymm · apply quantile_le_of_le_cdf hu0 have hc := threeScoreOutcomeLaw_cdf_between q t 0 h0 h1 (le_refl 0) (by norm_num) simpa [hc] using hu · by_contra hn have hneg : quantile (threeScoreOutcomeLaw q t) u < 0 := lt_of_not_ge hn have hle := (quantile_le_iff hu0 hu1).mp (le_refl (quantile (threeScoreOutcomeLaw q t) u)) rw [threeScoreOutcomeLaw_cdf_of_lt_zero q t _ h0 h1 hneg] at hle linarith · apply le_antisymm · apply quantile_le_of_le_cdf hu0 rw [threeScoreOutcomeLaw_cdf_one q t h0 h1] exact hu1.le · by_contra hn have hlt : quantile (threeScoreOutcomeLaw q t) u < 1 := lt_of_not_ge hn let r := (quantile (threeScoreOutcomeLaw q t) u + 1) / 2 have hqr : quantile (threeScoreOutcomeLaw q t) u ≤ r := by dsimp [r] linarith have hr0 : 0 ≤ r := by have hq0 : 0 ≤ quantile (threeScoreOutcomeLaw q t) u := by by_contra hn0 have hqneg : quantile (threeScoreOutcomeLaw q t) u < 0 := lt_of_not_ge hn0 have hle := (quantile_le_iff hu0 hu1).mp (le_refl (quantile (threeScoreOutcomeLaw q t) u)) rw [threeScoreOutcomeLaw_cdf_of_lt_zero q t _ h0 h1 hqneg] at hle linarith dsimp [r] linarith have hr1 : r < 1 := by dsimp [r]; linarith have hle := (quantile_le_iff hu0 hu1).mp hqr rw [threeScoreOutcomeLaw_cdf_between q t r h0 h1 hr0 hr1] at hle exact hu hle
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreOutcomeLaw_quantile · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogQuantileExact.lean:57
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogQuantileIntegrals 2 declarations Exact integrals of the Bernoulli and inverse-score quantile steps.

Exact integrals of the Bernoulli and inverse-score quantile steps.

theorem threeScore_quantileProduct_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z w₁ w₂ w₃ t :
ℝ
hx :
0 < x
hxy :
x < y
hyz :
y < z
hw₁ :
0 ≤ w₁
hw₂ :
0 ≤ w₂
hw₃ :
0 ≤ w₃
hsum :
w₁ + w₂ + w₃ = 1
ht₁ :
x * w₁ < t
ht₂ :
t < min (x * w₁ + y * w₂) (z * w₃)
q :
x * w₁ + y * w₂ + z * w₃
q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u)
Proof (Lean source)
lemma threeScore_quantileProduct_upper (x y z w₁ w₂ w₃ t : ℝ) (hx : 0 < x) (hxy : x < y) (hyz : y < z) (hw₁ : 0 ≤ w₁) (hw₂ : 0 ≤ w₂) (hw₃ : 0 ≤ w₃) (hsum : w₁ + w₂ + w₃ = 1) (ht₁ : x * w₁ < t) (ht₂ : t < min (x * w₁ + y * w₂) (z * w₃)) : let q := x * w₁ + y * w₂ + z * w₃ q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u) = threeScoreUpperEndpoint x y w₁ t := by dsimp only let q := x * w₁ + y * w₂ + z * w₃ change q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u) = threeScoreUpperEndpoint x y w₁ t have hy : 0 < y := lt_trans hx hxy have hz : 0 < z := lt_trans hy hyz have hq : 0 < q := by dsimp [q] have hone : 0 < w₁ + w₂ + w₃ := by rw [hsum]; norm_num nlinarith [mul_nonneg hx.le hw₁, mul_nonneg hy.le hw₂, mul_nonneg hz.le hw₃] have hs0 : 0 ≤ t / q := by have ht0 : 0 < t := lt_of_le_of_lt (mul_nonneg hx.le hw₁) ht₁ positivity have hs1 : t / q ≤ 1 := by have htq : t < q := by dsimp [q] have := lt_of_lt_of_le ht₂ (min_le_left _ _) nlinarith [mul_nonneg hz.le hw₃] exact (div_lt_one hq).2 htq |>.le have ha0 : 0 ≤ x * w₁ / q := div_nonneg (mul_nonneg hx.le hw₁) hq.le have ha1 : x * w₁ / q ≤ 1 := by apply (div_le_one hq).2 dsimp [q] nlinarith [mul_nonneg hy.le hw₂, mul_nonneg hz.le hw₃] have hrs : 1 - t / q ≤ 1 - x * w₁ / q := by apply sub_le_sub_left exact (div_lt_div_iff_of_pos_right hq).2 ht₁ |>.le have heq : ∀ᵐ u ∂volume.restrict (Ioo (0 : ℝ) 1), quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) u = if u ≤ 1 - t / q then 0 else if u ≤ 1 - x * w₁ / q then 1 / y else 1 / x := by filter_upwards [ae_restrict_mem measurableSet_Ioo] with u hu rw [threeScoreOutcomeLaw_quantile q t u hs0 hs1 hu.1 hu.2, threeScoreInverseLaw_quantile x y z w₁ w₂ w₃ u hx hxy hyz hw₁ hw₂ hw₃ hq hu.1 hu.2] rw [show x * w₁ + y * w₂ + z * w₃ = q by rfl] have hthreshold : z * w₃ / q + y * w₂ / q = 1 - x * w₁ / q := by calc z * w₃ / q + y * w₂ / q = (z * w₃ + y * w₂) / q := by ring _ = (q - x * w₁) / q := by congr 1 dsimp [q] ring _ = 1 - x * w₁ / q := by field_simp [ne_of_gt hq] rw [hthreshold] by_cases hu0 : u ≤ 1 - t / q · simp [hu0] · have htFirstTwo : t / q < (x * w₁ + y * w₂) / q := by exact (div_lt_div_iff_of_pos_right hq).2 (lt_of_lt_of_le ht₂ (min_le_left _ _)) have htotal : (x * w₁ + y * w₂) / q = 1 - z * w₃ / q := by calc (x * w₁ + y * w₂) / q = (q - z * w₃) / q := by congr 1 dsimp [q] ring _ = 1 - z * w₃ / q := by field_simp [ne_of_gt hq] have hthird : z * w₃ / q < u := by linarith have hnthird : ¬u ≤ z * w₃ / q := not_le.mpr hthird simp [hu0, hnthird] rw [integral_congr_ae heq, upper_step_integral (1 - t / q) (1 - x * w₁ / q) (1 / y) (1 / x) (sub_nonneg.mpr hs1) hrs (sub_le_self 1 ha0)] unfold threeScoreUpperEndpoint field_simp [ne_of_gt hq, ne_of_gt hx, ne_of_gt hy] ring
CausalSmith.PartialID.UnlinkedPropensityAte.threeScore_quantileProduct_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogQuantileIntegrals.lean:91
theorem threeScore_quantileProduct_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z w₁ w₂ w₃ t :
ℝ
hx :
0 < x
hxy :
x < y
hyz :
y < z
hw₁ :
0 ≤ w₁
hw₂ :
0 ≤ w₂
hw₃ :
0 ≤ w₃
hsum :
w₁ + w₂ + w₃ = 1
ht₁ :
x * w₁ < t
ht₂ :
t < min (x * w₁ + y * w₂) (z * w₃)
q :
x * w₁ + y * w₂ + z * w₃
q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) (1 - u))
Proof (Lean source)
lemma threeScore_quantileProduct_lower (x y z w₁ w₂ w₃ t : ℝ) (hx : 0 < x) (hxy : x < y) (hyz : y < z) (hw₁ : 0 ≤ w₁) (hw₂ : 0 ≤ w₂) (hw₃ : 0 ≤ w₃) (hsum : w₁ + w₂ + w₃ = 1) (ht₁ : x * w₁ < t) (ht₂ : t < min (x * w₁ + y * w₂) (z * w₃)) : let q := x * w₁ + y * w₂ + z * w₃ q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) (1 - u)) = threeScoreLowerEndpoint z t := by dsimp only let q := x * w₁ + y * w₂ + z * w₃ change q * (∫ u in Ioo (0 : ℝ) 1, quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) (1 - u)) = threeScoreLowerEndpoint z t have hy : 0 < y := lt_trans hx hxy have hz : 0 < z := lt_trans hy hyz have hq : 0 < q := by dsimp [q] have hone : 0 < w₁ + w₂ + w₃ := by rw [hsum]; norm_num nlinarith [mul_nonneg hx.le hw₁, mul_nonneg hy.le hw₂, mul_nonneg hz.le hw₃] have hs0 : 0 ≤ t / q := by have ht0 : 0 < t := lt_of_le_of_lt (mul_nonneg hx.le hw₁) ht₁ positivity have hs1 : t / q ≤ 1 := by have htq : t < q := by dsimp [q] have := lt_of_lt_of_le ht₂ (min_le_left _ _) nlinarith [mul_nonneg hz.le hw₃] exact (div_lt_one hq).2 htq |>.le have heq : ∀ᵐ u ∂volume.restrict (Ioo (0 : ℝ) 1), quantile (threeScoreOutcomeLaw q t) u * quantile (threeScoreInverseLaw x y z w₁ w₂ w₃) (1 - u) = if u ≤ 1 - t / q then 0 else 1 / z := by filter_upwards [ae_restrict_mem measurableSet_Ioo] with u hu have huv0 : 0 < 1 - u := by linarith [hu.2] have huv1 : 1 - u < 1 := by linarith [hu.1] rw [threeScoreOutcomeLaw_quantile q t u hs0 hs1 hu.1 hu.2, threeScoreInverseLaw_quantile x y z w₁ w₂ w₃ (1 - u) hx hxy hyz hw₁ hw₂ hw₃ hq huv0 huv1] rw [show x * w₁ + y * w₂ + z * w₃ = q by rfl] by_cases hu0 : u ≤ 1 - t / q · simp [hu0] · have htThird : t / q < z * w₃ / q := by exact (div_lt_div_iff_of_pos_right hq).2 (lt_of_lt_of_le ht₂ (min_le_right _ _)) have hfirst : 1 - u ≤ z * w₃ / q := by linarith simp [hu0, hfirst] rw [integral_congr_ae heq, lower_reflected_step_integral (t / q) (1 / z) hs0 hs1] unfold threeScoreLowerEndpoint field_simp [ne_of_gt hq, ne_of_gt hz]
CausalSmith.PartialID.UnlinkedPropensityAte.threeScore_quantileProduct_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogQuantileIntegrals.lean:176
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogSharp 3 declarations Explicit three-score couplings for the score-log sharp endpoints.

Explicit three-score couplings for the score-log sharp endpoints.

def threeScoreUpperEndpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
x y w₁ t :
ℝ
threeScoreUpperEndpoint x y w₁ t :
ℝ
w₁ + (t - x * w₁) / y
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreUpperEndpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharp.lean:13
def threeScoreLowerEndpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
z t :
ℝ
threeScoreLowerEndpoint z t :
ℝ
t / z
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreLowerEndpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharp.lean:17
theorem threeScoreUpperEndpoint_perturbation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y z t u :
ℝ
hx :
0 < x
hxy :
x < y
threeScoreUpperEndpoint x y (1 / 3 + u * (z - y)) t
- threeScoreUpperEndpoint x y (1 / 3) t
= u * (z - y) * (1 - x / y)
Proof (Lean source)
lemma threeScoreUpperEndpoint_perturbation (x y z t u : ℝ) (hx : 0 < x) (hxy : x < y) : threeScoreUpperEndpoint x y (1 / 3 + u * (z - y)) t - threeScoreUpperEndpoint x y (1 / 3) t = u * (z - y) * (1 - x / y) := by unfold threeScoreUpperEndpoint exact fiberTriple_upperEndpoint_shift x y z t u (ne_of_gt (lt_trans hx hxy))
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreUpperEndpoint_perturbation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharp.lean:21
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogSharpATE 6 declarations Concrete sharp endpoint identities for the three-score score-log laws.

Concrete sharp endpoint identities for the three-score score-log laws.

theorem muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
r :
q t c :
ℝ
hrel :
hq0 :
0 ≤ q
hc :
0 < c
hs0 :
0 ≤ t / q
hs1 :
t / q ≤ 1
hsum :
q + c = 1
conclusion 1
muLower H g Prel hMass false = 0
conclusion 2
muUpper H g Prel hMass false = 0
Proof (Lean source)
lemma muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (r : LabelSpace J) (q t c : ℝ) (hrel : Prel = scoreLogReleasedCellLaw r q t c) (hq0 : 0 ≤ q) (hc : 0 < c) (hs0 : 0 ≤ t / q) (hs1 : t / q ≤ 1) (hsum : q + c = 1) : muLower H g Prel hMass false = 0 ∧ muUpper H g Prel hMass false = 0 := by have hmass (r' : LabelSpace J) : armCellMass H g false r' = if r' = r then c else 0 := by rw [← hMass.2.2.2 false r', hrel] exact scoreLogReleasedCellLaw_control_mass_all r r' q t c hc.le hs0 hs1 have hout : armCellOutcomeLaw Prel hMass.2.1 false r (by rw [hMass.2.2.2 false r, hmass r, if_pos rfl]; exact hc) = Measure.dirac 0 := by unfold armCellOutcomeLaw rw [hrel] have hout' := scoreLogReleasedCellLaw_armCellOutcomeLaw_false r q t c hq0 hc hs0 hs1 hsum unfold armCellOutcomeLaw at hout' exact hout' constructor · unfold muLower rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [hmass r, if_pos rfl, hout, quantile_dirac_zero_product _ (fun u => 1 - u), mul_zero] · exfalso apply hpos rw [hmass r, if_pos rfl] exact hc · intro r' _ hr' split_ifs with hpos · rw [hmass r', if_neg hr'] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp · unfold muUpper rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [hmass r, if_pos rfl, hout, quantile_dirac_zero_product _ (fun u => u), mul_zero] · exfalso apply hpos rw [hmass r, if_pos rfl] exact hc · intro r' _ hr' split_ifs with hpos · rw [hmass r', if_neg hr'] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp
CausalSmith.PartialID.UnlinkedPropensityAte.muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:98
theorem scoreLogTripleBaseline_muUpper_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t :
ℝ
ht₁ :
(x : ℝ) * (1 / 3) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hMass :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
muUpper (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass true
= threeScoreUpperEndpoint (x : ℝ) y (1 / 3) t
Proof (Lean source)
lemma scoreLogTripleBaseline_muUpper_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t : ℝ) (ht₁ : (x : ℝ) * (1 / 3) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hMass : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) : muUpper (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass true = threeScoreUpperEndpoint (x : ℝ) y (1 / 3) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := lt_trans (mul_pos hx0 (by norm_num)) ht₁ have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) dsimp [q] nlinarith [mul_pos hz0 (by norm_num : (0 : ℝ) < 1 / 3)] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hrel := scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1 have hout : armCellOutcomeLaw (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q))) hMass.2.1 true r (by rw [hMass.2.2.2 true r, scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq) = threeScoreOutcomeLaw q t := by unfold armCellOutcomeLaw rw [hrel] have hout' := scoreLogReleasedCellLaw_armCellOutcomeLaw r q t (1 - q) hq (sub_nonneg.mpr (by dsimp [q] have hx1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have hy1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have hz1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] linarith)) hs0 hs1 (by ring) unfold armCellOutcomeLaw at hout' exact hout' unfold muUpper rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] rw [hout] rw [scoreLogTripleBaseline_armCellWeightLaw_true g hMass.2.2.1 r x y z hx hy hz hq] rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_Ioc_eq_integral_Ioo] have hupper := threeScore_quantileProduct_upper (x : ℝ) y z (1 / 3) (1 / 3) (1 / 3) t hx0 hxy hyz (by norm_num) (by norm_num) (by norm_num) (by norm_num) ht₁ ht₂ have hqeq : (x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3) + (z : ℝ) * (1 / 3) = q := by dsimp [q] ring rw [hqeq] at hupper exact hupper · exfalso apply hpos rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq · intro r' _ hr' split_ifs with hpos · have hzero := scoreLogTripleBaseline_armCellMass_true_all g r r' x y z hx hy hz rw [if_neg hr'] at hzero rw [hzero] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_muUpper_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:173
theorem scoreLogTriplePerturbed_muUpper_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
ht₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
muUpper (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass true
= threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t
Proof (Lean source)
lemma scoreLogTriplePerturbed_muUpper_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (ht₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : muUpper (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass true = threeScoreUpperEndpoint (x : ℝ) y (1 / 3 + u * ((z : ℝ) - y)) t := by let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) let q : ℝ := ((x : ℝ) + y + z) / 3 have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hsum := (scoreLogTriple_weight_identities x y z hxy hyz u).1 have hmoment := (scoreLogTriple_weight_identities x y z hxy hyz u).2 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := by have : 0 ≤ (x : ℝ) * wx := mul_nonneg hx0.le (by simpa [wx] using hw.1) exact lt_of_le_of_lt this (by simpa [wx] using ht₁) have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) have hwz : 0 ≤ wz := by simpa [wz] using hw.2.2 have hmom : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring have hleft' : t < (x : ℝ) * wx + (y : ℝ) * wy := by simpa [wx, wy] using hleft nlinarith [mul_nonneg hz0.le hwz] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hrel := scoreLogTriplePerturbed_releasedLaw_cell g hOverlap r x y z hxy hyz hx hy hz t u hs0 hs1 hu0 hu have hout : armCellOutcomeLaw (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u)) hMass.2.1 true r (by rw [hMass.2.2.2 true r, scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq) = threeScoreOutcomeLaw q t := by unfold armCellOutcomeLaw rw [hrel] have hout' := scoreLogReleasedCellLaw_armCellOutcomeLaw r q t (1 - q) hq (sub_nonneg.mpr (by dsimp [q] have hx1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have hy1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have hz1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] linarith)) hs0 hs1 (by ring) unfold armCellOutcomeLaw at hout' exact hout' unfold muUpper rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] rw [hout] rw [scoreLogTriplePerturbed_armCellWeightLaw_true g hMass.2.2.1 r x y z hxy hyz hx hy hz u hu0 hu hq] rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_Ioc_eq_integral_Ioo] have hupper := threeScore_quantileProduct_upper (x : ℝ) y z wx wy wz t hx0 hxy hyz (by simpa [wx] using hw.1) (by simpa [wy] using hw.2.1) (by simpa [wz] using hw.2.2) (by simpa [wx, wy, wz] using hsum) (by simpa [wx] using ht₁) (by simpa [wx, wy, wz] using ht₂) have hqeq : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring rw [hqeq] at hupper exact hupper · exfalso apply hpos rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq · intro r' _ hr' split_ifs with hpos · have hzero := scoreLogTriplePerturbed_armCellMass_true_all g r r' x y z hxy hyz hx hy hz u hu0 hu rw [if_neg hr'] at hzero rw [hzero] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_muUpper_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:277
theorem scoreLogTripleBaseline_muLower_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t :
ℝ
ht₁ :
(x : ℝ) * (1 / 3) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hMass :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
muLower (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass true
Proof (Lean source)
lemma scoreLogTripleBaseline_muLower_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t : ℝ) (ht₁ : (x : ℝ) * (1 / 3) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hMass : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) : muLower (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass true = threeScoreLowerEndpoint (z : ℝ) t := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := lt_trans (mul_pos hx0 (by norm_num)) ht₁ have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) dsimp [q] nlinarith [mul_pos hz0 (by norm_num : (0 : ℝ) < 1 / 3)] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hrel := scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1 have hout : armCellOutcomeLaw (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q))) hMass.2.1 true r (by rw [hMass.2.2.2 true r, scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq) = threeScoreOutcomeLaw q t := by unfold armCellOutcomeLaw rw [hrel] have hout' := scoreLogReleasedCellLaw_armCellOutcomeLaw r q t (1 - q) hq (sub_nonneg.mpr (by dsimp [q] have hx1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have hy1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have hz1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] linarith)) hs0 hs1 (by ring) unfold armCellOutcomeLaw at hout' exact hout' unfold muLower rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] rw [hout] rw [scoreLogTripleBaseline_armCellWeightLaw_true g hMass.2.2.1 r x y z hx hy hz hq] rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_Ioc_eq_integral_Ioo] have hlower := threeScore_quantileProduct_lower (x : ℝ) y z (1 / 3) (1 / 3) (1 / 3) t hx0 hxy hyz (by norm_num) (by norm_num) (by norm_num) (by norm_num) ht₁ ht₂ have hqeq : (x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3) + (z : ℝ) * (1 / 3) = q := by dsimp [q] ring rw [hqeq] at hlower exact hlower · exfalso apply hpos rw [scoreLogTripleBaseline_armCellMass_true g r x y z hx hy hz] exact hq · intro r' _ hr' split_ifs with hpos · have hzero := scoreLogTripleBaseline_armCellMass_true_all g r r' x y z hx hy hz rw [if_neg hr'] at hzero rw [hzero] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTripleBaseline_muLower_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:385
theorem scoreLogTriplePerturbed_muLower_true

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
ht₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
ht₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
muLower (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass true
Proof (Lean source)
lemma scoreLogTriplePerturbed_muLower_true {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (ht₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (ht₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : muLower (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass true = threeScoreLowerEndpoint (z : ℝ) t := by let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) let q : ℝ := ((x : ℝ) + y + z) / 3 have hw := scoreLogTriple_weights_nonneg x y z hxy hyz u hu0 hu have hsum := (scoreLogTriple_weight_identities x y z hxy hyz u).1 have hmoment := (scoreLogTriple_weight_identities x y z hxy hyz u).2 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := by have : 0 ≤ (x : ℝ) * wx := mul_nonneg hx0.le (by simpa [wx] using hw.1) exact lt_of_le_of_lt this (by simpa [wx] using ht₁) have htq : t < q := by have hleft := lt_of_lt_of_le ht₂ (min_le_left _ _) have hwz : 0 ≤ wz := by simpa [wz] using hw.2.2 have hmom : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring have hleft' : t < (x : ℝ) * wx + (y : ℝ) * wy := by simpa [wx, wy] using hleft nlinarith [mul_nonneg hz0.le hwz] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hrel := scoreLogTriplePerturbed_releasedLaw_cell g hOverlap r x y z hxy hyz hx hy hz t u hs0 hs1 hu0 hu have hout : armCellOutcomeLaw (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u)) hMass.2.1 true r (by rw [hMass.2.2.2 true r, scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq) = threeScoreOutcomeLaw q t := by unfold armCellOutcomeLaw rw [hrel] have hout' := scoreLogReleasedCellLaw_armCellOutcomeLaw r q t (1 - q) hq (sub_nonneg.mpr (by dsimp [q] have hx1 : (x : ℝ) ≤ 1 := by linarith [x.property.2, hOverlap.1] have hy1 : (y : ℝ) ≤ 1 := by linarith [y.property.2, hOverlap.1] have hz1 : (z : ℝ) ≤ 1 := by linarith [z.property.2, hOverlap.1] linarith)) hs0 hs1 (by ring) unfold armCellOutcomeLaw at hout' exact hout' unfold muLower rw [Finset.sum_eq_single r] · split_ifs with hpos · rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] rw [hout] rw [scoreLogTriplePerturbed_armCellWeightLaw_true g hMass.2.2.1 r x y z hxy hyz hx hy hz u hu0 hu hq] rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_Ioc_eq_integral_Ioo] have hlower := threeScore_quantileProduct_lower (x : ℝ) y z wx wy wz t hx0 hxy hyz (by simpa [wx] using hw.1) (by simpa [wy] using hw.2.1) (by simpa [wz] using hw.2.2) (by simpa [wx, wy, wz] using hsum) (by simpa [wx] using ht₁) (by simpa [wx, wy, wz] using ht₂) have hqeq : (x : ℝ) * wx + (y : ℝ) * wy + (z : ℝ) * wz = q := by dsimp [wx, wy, wz, q] calc _ = (x : ℝ) / 3 + (y : ℝ) / 3 + (z : ℝ) / 3 := hmoment _ = ((x : ℝ) + y + z) / 3 := by ring rw [hqeq] at hlower exact hlower · exfalso apply hpos rw [scoreLogTriplePerturbed_armCellMass_true g r x y z hxy hyz hx hy hz u hu0 hu] exact hq · intro r' _ hr' split_ifs with hpos · have hzero := scoreLogTriplePerturbed_armCellMass_true_all g r r' x y z hxy hyz hx hy hz u hu0 hu rw [if_neg hr'] at hzero rw [hzero] at hpos exact (lt_irrefl 0 hpos).elim · rfl · simp
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriplePerturbed_muLower_true · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:469
theorem scoreLogTriple_sharpATELength_perturbation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
r :
x y z :
hxy :
x < y
hyz :
y < z
hx :
g x = r
hy :
g y = r
hz :
g z = r
t u :
ℝ
hu0 :
0 ≤ u
hu :
u * ((z : ℝ) - x) ≤ 1 / 3
hb₁ :
(x : ℝ) * (1 / 3) < t
hb₂ :
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
hp₁ :
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t
hp₂ :
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
hMass₀ :
CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))
hMass₁ :
CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))
sharpATELength (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass₁
- sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀
= u * ((z : ℝ) - y) * (1 - (x : ℝ) / y)
Proof (Lean source)
lemma scoreLogTriple_sharpATELength_perturbation {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (x y z : ScoreSpace ε) (hxy : x < y) (hyz : y < z) (hx : g x = r) (hy : g y = r) (hz : g z = r) (t u : ℝ) (hu0 : 0 ≤ u) (hu : u * ((z : ℝ) - x) ≤ 1 / 3) (hb₁ : (x : ℝ) * (1 / 3) < t) (hb₂ : t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))) (hp₁ : (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t) (hp₂ : t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))) (hMass₀ : CompatibleCellMasses (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3))))) (hMass₁ : CompatibleCellMasses (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u))) : sharpATELength (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)) u)) hMass₁ - sharpATELength (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / (((x : ℝ) + y + z) / 3)))) hMass₀ = u * ((z : ℝ) - y) * (1 - (x : ℝ) / y) := by let q : ℝ := ((x : ℝ) + y + z) / 3 have hx0 : 0 < (x : ℝ) := lt_of_lt_of_le hOverlap.1 x.property.1 have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hq : 0 < q := by dsimp [q]; linarith have ht0 : 0 < t := lt_trans (mul_pos hx0 (by norm_num)) hb₁ have htq : t < q := by have hleft := lt_of_lt_of_le hb₂ (min_le_left _ _) dsimp [q] nlinarith [mul_pos hz0 (by norm_num : (0 : ℝ) < 1 / 3)] have hs0 : 0 ≤ t / q := (div_pos ht0 hq).le have hs1 : t / q ≤ 1 := (div_lt_one hq).2 htq |>.le have hq1 : q < 1 := by have hx1 : (x : ℝ) < 1 := lt_of_le_of_lt x.property.2 (by linarith [hOverlap.1]) have hy1 : (y : ℝ) < 1 := lt_of_le_of_lt y.property.2 (by linarith [hOverlap.1]) have hz1 : (z : ℝ) < 1 := lt_of_le_of_lt z.property.2 (by linarith [hOverlap.1]) dsimp [q] linarith have hrel₀ := scoreLogTripleBaseline_releasedLaw_cell g hOverlap r x y z hx hy hz t hs0 hs1 have hrel₁ := scoreLogTriplePerturbed_releasedLaw_cell g hOverlap r x y z hxy hyz hx hy hz t u hs0 hs1 hu0 hu have hc₀ := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTripleBaseline x y z) g (releasedLaw (scoreLogTripleBaselineFullLaw g x y z (t / q))) hMass₀ r q t (1 - q) hrel₀ hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) have hc₁ := muLower_muUpper_false_eq_zero_of_scoreLogReleasedCellLaw (scoreLogTriplePerturbed x y z u) g (releasedLaw (scoreLogTriplePerturbedFullLaw g x y z (t / q) u)) hMass₁ r q t (1 - q) hrel₁ hq.le (sub_pos.mpr hq1) hs0 hs1 (by ring) unfold sharpATELength rw [scoreLogTriplePerturbed_muUpper_true g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu hp₁ hp₂ hMass₁, scoreLogTriplePerturbed_muLower_true g hOverlap r x y z hxy hyz hx hy hz t u hu0 hu hp₁ hp₂ hMass₁, scoreLogTripleBaseline_muUpper_true g hOverlap r x y z hxy hyz hx hy hz t hb₁ hb₂ hMass₀, scoreLogTripleBaseline_muLower_true g hOverlap r x y z hxy hyz hx hy hz t hb₁ hb₂ hMass₀, hc₁.1, hc₁.2, hc₀.1, hc₀.2] have hshift := threeScoreUpperEndpoint_perturbation (x : ℝ) y z t u hx0 hxy linarith
CausalSmith.PartialID.UnlinkedPropensityAte.scoreLogTriple_sharpATELength_perturbation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogSharpATE.lean:576
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogTesting 8 declarations Testing estimates for the three-score external-log perturbation.

Testing estimates for the three-score external-log perturbation.

def threeScoreBaseLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
threeScoreBaseLaw x y z :
ofReal (1 / 3 : ℝ) • Measure.dirac x
+ ofReal (1 / 3 : ℝ) • Measure.dirac y
+ ofReal (1 / 3 : ℝ) • Measure.dirac z
def threeScorePerturbedLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
u :
ℝ
threeScorePerturbedLaw x y z u :
ofReal (1 / 3 + u * ((z : ℝ) - y)) • Measure.dirac x
+ ofReal (1 / 3 - u * ((z : ℝ) - x)) • Measure.dirac y
+ ofReal (1 / 3 + u * ((y : ℝ) - x)) • Measure.dirac z
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:20
theorem threeScoreBaseLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
Proof (Lean source)
lemma threeScoreBaseLaw_isProbabilityMeasure {ε : ℝ} (x y z : ScoreSpace ε) : IsProbabilityMeasure (threeScoreBaseLaw x y z) := by rw [isProbabilityMeasure_iff] unfold threeScoreBaseLaw rw [Measure.add_apply, Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.smul_apply] simp only [Measure.dirac_apply, Set.indicator_of_mem, Set.mem_univ, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3) (by norm_num : (0 : ℝ) ≤ 1 / 3), ← ENNReal.ofReal_add (by norm_num : (0 : ℝ) ≤ 1 / 3 + 1 / 3) (by norm_num : (0 : ℝ) ≤ 1 / 3)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreBaseLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:27
theorem threeScorePerturbedLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
u :
ℝ
hx :
0 < 1 / 3 + u * ((z : ℝ) - y)
hy :
0 < 1 / 3 - u * ((z : ℝ) - x)
hz :
0 < 1 / 3 + u * ((y : ℝ) - x)
Proof (Lean source)
lemma threeScorePerturbedLaw_isProbabilityMeasure {ε : ℝ} (x y z : ScoreSpace ε) (u : ℝ) (hx : 0 < 1 / 3 + u * ((z : ℝ) - y)) (hy : 0 < 1 / 3 - u * ((z : ℝ) - x)) (hz : 0 < 1 / 3 + u * ((y : ℝ) - x)) : IsProbabilityMeasure (threeScorePerturbedLaw x y z u) := by rw [isProbabilityMeasure_iff] unfold threeScorePerturbedLaw rw [Measure.add_apply, Measure.add_apply, Measure.smul_apply, Measure.smul_apply, Measure.smul_apply] simp only [Measure.dirac_apply, Set.indicator_of_mem, Set.mem_univ, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add hx.le hy.le, ← ENNReal.ofReal_add (add_nonneg hx.le hy.le) hz.le] rw [show (1 / 3 + u * ((z : ℝ) - y)) + (1 / 3 - u * ((z : ℝ) - x)) + (1 / 3 + u * ((y : ℝ) - x)) = 1 by ring, ENNReal.ofReal_one]
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:42
theorem threeScorePerturbedLaw_ac_integrable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
u :
ℝ
hxy :
x < y
hyz :
y < z
conclusion 1
conclusion 2
Integrable (fun e => (((threeScorePerturbedLaw x y z u).rnDeriv (threeScoreBaseLaw x y z) e).toReal - 1) ^ 2) (threeScoreBaseLaw x y z)
Proof (Lean source)
lemma threeScorePerturbedLaw_ac_integrable {ε : ℝ} (x y z : ScoreSpace ε) (u : ℝ) (hxy : x < y) (hyz : y < z) : threeScorePerturbedLaw x y z u ≪ threeScoreBaseLaw x y z ∧ Integrable (fun e => (((threeScorePerturbedLaw x y z u).rnDeriv (threeScoreBaseLaw x y z) e).toReal - 1) ^ 2) (threeScoreBaseLaw x y z) := by let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) let d : ScoreSpace ε → ENNReal := fun e => if e = x then ofReal (3 * wx) else if e = y then ofReal (3 * wy) else if e = z then ofReal (3 * wz) else 0 have hxy_ne : x ≠ y := ne_of_lt hxy have hxz_ne : x ≠ z := ne_of_lt (lt_trans hxy hyz) have hyz_ne : y ≠ z := ne_of_lt hyz have hd : Measurable d := by dsimp [d] exact Measurable.ite (measurableSet_singleton x) measurable_const (Measurable.ite (measurableSet_singleton y) measurable_const (Measurable.ite (measurableSet_singleton z) measurable_const measurable_const)) have hscale (w : ℝ) : ofReal (1 / 3 : ℝ) * ofReal (3 * w) = ofReal w := by rw [← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3)] exact congrArg ofReal (by ring) have hwd : threeScorePerturbedLaw x y z u = (threeScoreBaseLaw x y z).withDensity d := by unfold threeScorePerturbedLaw threeScoreBaseLaw rw [withDensity_add_measure, withDensity_add_measure, withDensity_smul_measure, withDensity_smul_measure, withDensity_smul_measure, dirac_withDensity, dirac_withDensity, dirac_withDensity] dsimp only [d] simp only [if_pos, if_neg hxy_ne.symm, if_neg hxz_ne.symm, if_neg hxy_ne, if_neg hyz_ne.symm, if_neg hxz_ne, if_neg hyz_ne] repeat' rw [smul_smul] rw [hscale wx, hscale wy, hscale wz] constructor · rw [hwd] exact withDensity_absolutelyContinuous _ _ · unfold threeScoreBaseLaw apply Integrable.add_measure · apply Integrable.add_measure · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw_ac_integrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:62
theorem threeScorePerturbedLaw_chisq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
u :
ℝ
hxy :
x < y
hyz :
y < z
hx :
0 < 1 / 3 + u * ((z : ℝ) - y)
hy :
0 < 1 / 3 - u * ((z : ℝ) - x)
hz :
0 < 1 / 3 + u * ((y : ℝ) - x)
= 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)
Proof (Lean source)
lemma threeScorePerturbedLaw_chisq {ε : ℝ} (x y z : ScoreSpace ε) (u : ℝ) (hxy : x < y) (hyz : y < z) (hx : 0 < 1 / 3 + u * ((z : ℝ) - y)) (hy : 0 < 1 / 3 - u * ((z : ℝ) - x)) (hz : 0 < 1 / 3 + u * ((y : ℝ) - x)) : chiSqDiv (threeScorePerturbedLaw x y z u) (threeScoreBaseLaw x y z) = 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2) := by let wx : ℝ := 1 / 3 + u * ((z : ℝ) - y) let wy : ℝ := 1 / 3 - u * ((z : ℝ) - x) let wz : ℝ := 1 / 3 + u * ((y : ℝ) - x) let d : ScoreSpace ε → ENNReal := fun e => if e = x then ofReal (3 * wx) else if e = y then ofReal (3 * wy) else if e = z then ofReal (3 * wz) else 0 have hxy_ne : x ≠ y := ne_of_lt hxy have hxz_ne : x ≠ z := ne_of_lt (lt_trans hxy hyz) have hyz_ne : y ≠ z := ne_of_lt hyz have hd : Measurable d := by dsimp [d] exact Measurable.ite (measurableSet_singleton x) measurable_const (Measurable.ite (measurableSet_singleton y) measurable_const (Measurable.ite (measurableSet_singleton z) measurable_const measurable_const)) have hscale (w : ℝ) : ofReal (1 / 3 : ℝ) * ofReal (3 * w) = ofReal w := by rw [← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 1 / 3)] exact congrArg ofReal (by ring) have hwd : threeScorePerturbedLaw x y z u = (threeScoreBaseLaw x y z).withDensity d := by unfold threeScorePerturbedLaw threeScoreBaseLaw rw [withDensity_add_measure, withDensity_add_measure, withDensity_smul_measure, withDensity_smul_measure, withDensity_smul_measure, dirac_withDensity, dirac_withDensity, dirac_withDensity] dsimp only [d] simp only [if_pos, if_neg hxy_ne.symm, if_neg hxz_ne.symm, if_neg hxy_ne, if_neg hyz_ne.symm, if_neg hxz_ne, if_neg hyz_ne] repeat' rw [smul_smul] rw [hscale wx, hscale wy, hscale wz] letI : IsProbabilityMeasure (threeScoreBaseLaw x y z) := threeScoreBaseLaw_isProbabilityMeasure x y z have hrn : (threeScorePerturbedLaw x y z u).rnDeriv (threeScoreBaseLaw x y z) =ᵐ[threeScoreBaseLaw x y z] d := by rw [hwd] exact Measure.rnDeriv_withDensity _ hd rw [chiSqDiv] trans ∫ e, ((d e).toReal - 1) ^ 2 ∂(threeScoreBaseLaw x y z) · exact integral_congr_ae <| hrn.mono fun e he => by simpa only using congrArg (fun r : ENNReal => (r.toReal - 1) ^ 2) he unfold threeScoreBaseLaw rw [integral_add_measure] · rw [integral_add_measure] · rw [integral_smul_measure, integral_smul_measure, integral_smul_measure] simp only [integral_dirac] dsimp [d, wx, wy, wz] simp only [if_pos, if_neg hxy_ne.symm, if_neg hxz_ne.symm, if_neg hxy_ne, if_neg hyz_ne.symm, if_neg hxz_ne, if_neg hyz_ne] rw [ENNReal.toReal_ofReal (mul_nonneg (by norm_num) hx.le), ENNReal.toReal_ofReal (mul_nonneg (by norm_num) hy.le), ENNReal.toReal_ofReal (mul_nonneg (by norm_num) hz.le)] norm_num ring · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · apply Integrable.add_measure · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw_chisq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:112
theorem threeScorePerturbedLaw_product_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
u :
ℝ
hxy :
x < y
hyz :
y < z
hx :
0 < 1 / 3 + u * ((z : ℝ) - y)
hy :
0 < 1 / 3 - u * ((z : ℝ) - x)
hz :
0 < 1 / 3 + u * ((y : ℝ) - x)
m :
ℕ
tvDist (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u)) (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z))
≤ (1 / 2 : ℝ) * sqrt ((1 + 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)) ^ m - 1)
Proof (Lean source)
lemma threeScorePerturbedLaw_product_tv_bound {ε : ℝ} (x y z : ScoreSpace ε) (u : ℝ) (hxy : x < y) (hyz : y < z) (hx : 0 < 1 / 3 + u * ((z : ℝ) - y)) (hy : 0 < 1 / 3 - u * ((z : ℝ) - x)) (hz : 0 < 1 / 3 + u * ((y : ℝ) - x)) (m : ℕ) : tvDist (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u)) (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)) ≤ (1 / 2 : ℝ) * sqrt ((1 + 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)) ^ m - 1) := by letI : IsProbabilityMeasure (threeScorePerturbedLaw x y z u) := threeScorePerturbedLaw_isProbabilityMeasure x y z u hx hy hz letI : IsProbabilityMeasure (threeScoreBaseLaw x y z) := threeScoreBaseLaw_isProbabilityMeasure x y z have h := threeScorePerturbedLaw_ac_integrable x y z u hxy hyz simpa [threeScorePerturbedLaw_chisq x y z u hxy hyz hx hy hz] using trialProduct_tv_le_of_chisq (threeScorePerturbedLaw x y z u) (threeScoreBaseLaw x y z) h.1 h.2 m
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw_product_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:184
theorem threeScorePerturbedLaw_commonTrial_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
T :
x y z :
u :
ℝ
hxy :
x < y
hyz :
y < z
hx :
0 < 1 / 3 + u * ((z : ℝ) - y)
hy :
0 < 1 / 3 - u * ((z : ℝ) - x)
hz :
0 < 1 / 3 + u * ((y : ℝ) - x)
m :
ℕ
tvDist (ρ.prod (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u))) (ρ.prod (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)))
≤ (1 / 2 : ℝ) * sqrt ((1 + 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)) ^ m - 1)
Proof (Lean source)
lemma threeScorePerturbedLaw_commonTrial_tv_bound {ε : ℝ} {T : Type*} [MeasurableSpace T] (ρ : Measure T) [IsProbabilityMeasure ρ] (x y z : ScoreSpace ε) (u : ℝ) (hxy : x < y) (hyz : y < z) (hx : 0 < 1 / 3 + u * ((z : ℝ) - y)) (hy : 0 < 1 / 3 - u * ((z : ℝ) - x)) (hz : 0 < 1 / 3 + u * ((y : ℝ) - x)) (m : ℕ) : tvDist (ρ.prod (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u))) (ρ.prod (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z))) ≤ (1 / 2 : ℝ) * sqrt ((1 + 3 * u ^ 2 * (((z : ℝ) - y) ^ 2 + ((z : ℝ) - x) ^ 2 + ((y : ℝ) - x) ^ 2)) ^ m - 1) := by letI : IsProbabilityMeasure (threeScorePerturbedLaw x y z u) := threeScorePerturbedLaw_isProbabilityMeasure x y z u hx hy hz letI : IsProbabilityMeasure (threeScoreBaseLaw x y z) := threeScoreBaseLaw_isProbabilityMeasure x y z have hprod := tvDist_prod_le_add ρ ρ (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u)) (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)) have hself : tvDist ρ ρ = 0 := by unfold tvDist simp calc _ ≤ tvDist ρ ρ + tvDist (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u)) (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)) := hprod _ = tvDist (Measure.pi (fun _ : Fin m => threeScorePerturbedLaw x y z u)) (Measure.pi (fun _ : Fin m => threeScoreBaseLaw x y z)) := by rw [hself, zero_add] _ ≤ _ := threeScorePerturbedLaw_product_tv_bound x y z u hxy hyz hx hy hz m
CausalSmith.PartialID.UnlinkedPropensityAte.threeScorePerturbedLaw_commonTrial_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogTesting.lean:205
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerScoreLogThresholds 3 declarations Explicit strict filling thresholds for the calibrated three-score pair.

Explicit strict filling thresholds for the calibrated three-score pair.

def threeScoreThreshold

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
x y z :
threeScoreThreshold x y z :
ℝ
(((x : ℝ) / 3) + min (((x : ℝ) + y) / 3) ((z : ℝ) / 3)) / 2
theorem threeScoreThreshold_baseline

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
x y z :
hx0 :
0 < (x : ℝ)
hxy :
x < y
hyz :
y < z
q :
((x : ℝ) + y + z) / 3
(x : ℝ) * (1 / 3) < t
t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3))
0 < t / q
t / q < 1
Proof (Lean source)
lemma threeScoreThreshold_baseline {ε : ℝ} (x y z : ScoreSpace ε) (hx0 : 0 < (x : ℝ)) (hxy : x < y) (hyz : y < z) : let t := threeScoreThreshold x y z let q := ((x : ℝ) + y + z) / 3 (x : ℝ) * (1 / 3) < t ∧ t < min ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3)) ((z : ℝ) * (1 / 3)) ∧ 0 < t / q ∧ t / q < 1 := by dsimp only have hxyR : (x : ℝ) < (y : ℝ) := hxy have hyzR : (y : ℝ) < (z : ℝ) := hyz have hy0 : 0 < (y : ℝ) := lt_trans hx0 hxy have hz0 : 0 < (z : ℝ) := lt_trans hy0 hyz have hlower : (x : ℝ) / 3 < min (((x : ℝ) + y) / 3) ((z : ℝ) / 3) := by rw [lt_min_iff] constructor <;> linarith have htLower : (x : ℝ) / 3 < threeScoreThreshold x y z := by unfold threeScoreThreshold linarith have htUpper : threeScoreThreshold x y z < min (((x : ℝ) + y) / 3) ((z : ℝ) / 3) := by unfold threeScoreThreshold linarith have hq : 0 < ((x : ℝ) + y + z) / 3 := by linarith have ht0 : 0 < threeScoreThreshold x y z := lt_trans (by positivity) htLower have htq : threeScoreThreshold x y z < ((x : ℝ) + y + z) / 3 := by have hmin := min_le_left (((x : ℝ) + y) / 3) ((z : ℝ) / 3) linarith refine ⟨?_, ?_, div_pos ht0 hq, (div_lt_one hq).2 htq⟩ · convert htLower using 1 <;> norm_num [div_eq_mul_inv] · convert htUpper using 1 <;> norm_num [div_eq_mul_inv] <;> ring
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreThreshold_baseline · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogThresholds.lean:17
theorem threeScoreCalibratedU_eventually_thresholds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
x y z :
hx0 :
0 < (x : ℝ)
hxy :
x < y
hyz :
y < z
∀ᶠ m : ℕ in atTop, let u := threeScoreCalibratedU α x y z m let t := threeScoreThreshold x y z 0 < 1 / 3
+ u * ((z : ℝ) - y) ∧ 0 < 1 / 3
- u * ((z : ℝ) - x) ∧ 0 < 1 / 3
+ u * ((y : ℝ) - x) ∧ 0
≤ u ∧
u * ((z : ℝ) - x) ≤ 1 / 3 ∧
(x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t ∧
t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x)))
Proof (Lean source)
lemma threeScoreCalibratedU_eventually_thresholds {ε : ℝ} (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (x y z : ScoreSpace ε) (hx0 : 0 < (x : ℝ)) (hxy : x < y) (hyz : y < z) : ∀ᶠ m : ℕ in atTop, let u := threeScoreCalibratedU α x y z m let t := threeScoreThreshold x y z 0 < 1 / 3 + u * ((z : ℝ) - y) ∧ 0 < 1 / 3 - u * ((z : ℝ) - x) ∧ 0 < 1 / 3 + u * ((y : ℝ) - x) ∧ 0 ≤ u ∧ u * ((z : ℝ) - x) ≤ 1 / 3 ∧ (x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) < t ∧ t < min ((x : ℝ) * (1 / 3 + u * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - u * ((z : ℝ) - x))) ((z : ℝ) * (1 / 3 + u * ((y : ℝ) - x))) := by have hbase := threeScoreThreshold_baseline x y z hx0 hxy hyz dsimp only at hbase have hu := threeScoreCalibratedU_tendsto_zero α x y z have hxlim : Tendsto (fun m : ℕ => (x : ℝ) * (1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y))) atTop (nhds ((x : ℝ) * (1 / 3))) := by convert tendsto_const_nhds.mul (tendsto_const_nhds.add (hu.mul_const ((z : ℝ) - y))) using 1 <;> simp have hxylim : Tendsto (fun m : ℕ => (x : ℝ) * (1 / 3 + threeScoreCalibratedU α x y z m * ((z : ℝ) - y)) + (y : ℝ) * (1 / 3 - threeScoreCalibratedU α x y z m * ((z : ℝ) - x))) atTop (nhds ((x : ℝ) * (1 / 3) + (y : ℝ) * (1 / 3))) := by convert (tendsto_const_nhds.mul (tendsto_const_nhds.add (hu.mul_const ((z : ℝ) - y)))).add (tendsto_const_nhds.mul (tendsto_const_nhds.sub (hu.mul_const ((z : ℝ) - x)))) using 1 <;> simp have hzlim : Tendsto (fun m : ℕ => (z : ℝ) * (1 / 3 + threeScoreCalibratedU α x y z m * ((y : ℝ) - x))) atTop (nhds ((z : ℝ) * (1 / 3))) := by convert tendsto_const_nhds.mul (tendsto_const_nhds.add (hu.mul_const ((y : ℝ) - x))) using 1 <;> simp filter_upwards [threeScoreCalibratedU_eventually_weights_pos α x y z, eventually_gt_atTop (0 : ℕ), hxlim.eventually (Iio_mem_nhds hbase.1), hxylim.eventually (Ioi_mem_nhds (lt_of_lt_of_le hbase.2.1 (min_le_left _ _))), hzlim.eventually (Ioi_mem_nhds (lt_of_lt_of_le hbase.2.1 (min_le_right _ _)))] with m hweights hm hfirst hfirstTwo hthird dsimp only have hu0 := (threeScoreCalibratedU_pos α hα x y z hxy hyz m hm).le refine ⟨hweights.1, hweights.2.1, hweights.2.2, hu0, ?_, hfirst, ?_⟩ · linarith [hweights.2.1] · exact lt_min hfirstTwo hthird
CausalSmith.PartialID.UnlinkedPropensityAte.threeScoreCalibratedU_eventually_thresholds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerScoreLogThresholds.lean:51
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerTrialPair 19 declarations Center-score Bernoulli trial submodels for the lower certificate.

Center-score Bernoulli trial submodels for the lower certificate.

def trialCenterScore

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
trialCenterScore hOverlap :
⟨1 / 2, by constructor · exact le_of_lt hOverlap.2 · linarith [hOverlap.2]⟩
def trialZeroOutcome

This definition introduces the corresponding mathematical object.

Definition (Lean source)
trialZeroOutcome :
⟨0, by norm_num⟩
def trialOneOutcome

This definition introduces the corresponding mathematical object.

Definition (Lean source)
trialOneOutcome :
⟨1, by norm_num⟩
def trialCenterRow

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
hOverlap :
a :
trialCenterRow g hOverlap y a :
FullRow ε J
(trialCenterScore hOverlap, trialZeroOutcome, y, a, if a then y else trialZeroOutcome, g (trialCenterScore hOverlap))
theorem trialCenterRow_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
Measurable (fun ya : OutcomeSpace × ArmSpace => trialCenterRow g hOverlap ya.1 ya.2)
Proof (Lean source)
lemma trialCenterRow_measurable {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) : Measurable (fun ya : OutcomeSpace × ArmSpace => trialCenterRow g hOverlap ya.1 ya.2) := by have hcond : MeasurableSet {ya : OutcomeSpace × ArmSpace | ya.2 = true} := by exact measurableSet_eq_fun measurable_snd measurable_const have hobs : Measurable (fun ya : OutcomeSpace × ArmSpace => if ya.2 then ya.1 else trialZeroOutcome) := Measurable.ite hcond measurable_fst measurable_const unfold trialCenterRow fun_prop (disch := assumption)
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterRow_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:31
def trialOutcomeLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
p :
ℝ
trialOutcomeLaw p :
ofReal p • Measure.dirac trialOneOutcome
+ ofReal (1 - p) • Measure.dirac trialZeroOutcome
theorem trialOutcomeLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma trialOutcomeLaw_isProbabilityMeasure (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : IsProbabilityMeasure (trialOutcomeLaw p) := by rw [isProbabilityMeasure_iff] unfold trialOutcomeLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply] simp only [Measure.dirac_apply, Set.indicator_of_mem, Set.mem_univ, Pi.one_apply, smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add hp0 (sub_nonneg.mpr hp1)] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.trialOutcomeLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:48
def trialArmLaw

This definition introduces the corresponding mathematical object.

Definition (Lean source)
trialArmLaw :
(1 / 2 : ℝ≥0∞) • Measure.dirac true + (1 / 2 : ℝ≥0∞) • Measure.dirac false
theorem trialArmLaw_isProbabilityMeasure

This result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma trialArmLaw_isProbabilityMeasure : IsProbabilityMeasure trialArmLaw := by rw [isProbabilityMeasure_iff] unfold trialArmLaw rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply] simpa only [Measure.dirac_apply, Set.indicator_of_mem, Set.mem_univ, Pi.one_apply, smul_eq_mul, mul_one, one_div] using ENNReal.inv_two_add_inv_two
CausalSmith.PartialID.UnlinkedPropensityAte.trialArmLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:64
theorem trialArmLaw_true_mass

This result establishes the stated mathematical conclusion.

Formal statement
trialArmLaw.real {true} = 1 / 2
Proof (Lean source)
lemma trialArmLaw_true_mass : trialArmLaw.real {true} = 1 / 2 := by unfold trialArmLaw rw [Measure.real_def, Measure.add_apply, Measure.smul_apply, Measure.smul_apply] norm_num
CausalSmith.PartialID.UnlinkedPropensityAte.trialArmLaw_true_mass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:71
def trialCenterFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
trialCenterFullLaw g hOverlap p :
((trialOutcomeLaw p).prod trialArmLaw).map (fun ya => trialCenterRow g hOverlap ya.1 ya.2)
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:77
theorem trialCenterFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma trialCenterFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : IsProbabilityMeasure (trialCenterFullLaw g hOverlap p) := by letI : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure unfold trialCenterFullLaw exact Measure.isProbabilityMeasure_map (trialCenterRow_measurable g hOverlap).aemeasurable
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:83
theorem trialCenterFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
ScoreMarginal (trialCenterFullLaw g hOverlap p) (Measure.dirac (trialCenterScore hOverlap))
Proof (Lean source)
lemma trialCenterFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : ScoreMarginal (trialCenterFullLaw g hOverlap p) (Measure.dirac (trialCenterScore hOverlap)) := by letI : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure have hrow := trialCenterRow_measurable g hOverlap unfold ScoreMarginal trialCenterFullLaw rw [Measure.map_map (by unfold score; fun_prop) hrow] change ((trialOutcomeLaw p).prod trialArmLaw).map (fun _ => trialCenterScore hOverlap) = _ rw [Measure.map_const] simp
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:94
theorem trialCenterFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
Consistency (trialCenterFullLaw g hOverlap p)
Proof (Lean source)
lemma trialCenterFullLaw_consistency {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) : Consistency (trialCenterFullLaw g hOverlap p) := by have hrow := trialCenterRow_measurable g hOverlap have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const have hpot : Measurable (fun ω : FullRow ε J => if arm ω then outcome1 ω else outcome0 ω) := Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop) have hset : MeasurableSet {ω : FullRow ε J | observed ω = if arm ω then outcome1 ω else outcome0 ω} := by exact measurableSet_eq_fun (by unfold observed; fun_prop) hpot unfold Consistency trialCenterFullLaw rw [ae_map_iff hrow.aemeasurable hset] filter_upwards [] with ya rfl
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:111
theorem trialCenterFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
hg :
Proof (Lean source)
lemma trialCenterFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) (hg : Measurable g) : DeterministicRelease g (trialCenterFullLaw g hOverlap p) := by have hrow := trialCenterRow_measurable g hOverlap have hset : MeasurableSet {ω : FullRow ε J | label ω = g (score ω)} := by exact measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)) unfold DeterministicRelease trialCenterFullLaw rw [ae_map_iff hrow.aemeasurable hset] filter_upwards [] with ya rfl
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:131
theorem trialOutcomeLaw_mean

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
(∫ y : OutcomeSpace, (y : ℝ) ∂(trialOutcomeLaw p)) = p
Proof (Lean source)
lemma trialOutcomeLaw_mean (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : (∫ y : OutcomeSpace, (y : ℝ) ∂(trialOutcomeLaw p)) = p := by unfold trialOutcomeLaw rw [integral_add_measure] · rw [integral_smul_measure, integral_smul_measure] simp [trialOneOutcome, trialZeroOutcome, hp0, sub_nonneg.mpr hp1, smul_eq_mul] · exact Integrable.smul_measure (μ := Measure.dirac trialOneOutcome) (c := ofReal p) (integrable_dirac (f := fun y : OutcomeSpace => (y : ℝ)) (a := trialOneOutcome) (by simp [enorm])) (by simp) · exact Integrable.smul_measure (μ := Measure.dirac trialZeroOutcome) (c := ofReal (1 - p)) (integrable_dirac (f := fun y : OutcomeSpace => (y : ℝ)) (a := trialZeroOutcome) (by simp [enorm])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.trialOutcomeLaw_mean · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:144
theorem trialCenterFullLaw_ate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
ate (trialCenterFullLaw g hOverlap p) = p
Proof (Lean source)
lemma trialCenterFullLaw_ate {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : ate (trialCenterFullLaw g hOverlap p) = p := by letI : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure have hrow := trialCenterRow_measurable g hOverlap calc ate (trialCenterFullLaw g hOverlap p) = ∫ ya : OutcomeSpace × ArmSpace, (ya.1 : ℝ) ∂((trialOutcomeLaw p).prod trialArmLaw) := by unfold ate trialCenterFullLaw rw [integral_map hrow.aemeasurable (by unfold outcome0 outcome1 fun_prop)] simp [trialCenterRow, outcome0, outcome1, trialZeroOutcome] _ = ∫ y : OutcomeSpace, (y : ℝ) ∂(((trialOutcomeLaw p).prod trialArmLaw).map fst) := by rw [integral_map measurable_fst.aemeasurable (by fun_prop)] _ = ∫ y : OutcomeSpace, (y : ℝ) ∂(trialOutcomeLaw p) := by rw [Measure.map_fst_prod] rw [show trialArmLaw univ = 1 from isProbabilityMeasure_iff.mp inferInstance] simp _ = p := trialOutcomeLaw_mean p hp0 hp1
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_ate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:160
theorem trialCenterFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma trialCenterFullLaw_randomizedAssignment {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : RandomizedAssignment (trialCenterFullLaw g hOverlap p) := by intro B hB let μ : Measure OutcomeSpace := trialOutcomeLaw p let ν : Measure ArmSpace := trialArmLaw let f : OutcomeSpace × ArmSpace → FullRow ε J := fun ya => trialCenterRow g hOverlap ya.1 ya.2 have hf : Measurable f := trialCenterRow_measurable g hOverlap let U : Set OutcomeSpace := {y | (trialCenterScore hOverlap, trialZeroOutcome, y) ∈ B} have hU : MeasurableSet U := by have htriple : Measurable (fun y : OutcomeSpace => (trialCenterScore hOverlap, trialZeroOutcome, y)) := by fun_prop exact hB.preimage htriple let S : Set (FullRow ε J) := {ω | arm ω = true ∧ latentTriple ω ∈ B} let T : Set (FullRow ε J) := {ω | latentTriple ω ∈ B} have hlatent : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop have hS : MeasurableSet S := (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage hlatent) have hT : MeasurableSet T := hB.preimage hlatent have hpreS : f ⁻¹' S = U ×ˢ {true} := by ext ya cases ha : ya.2 <;> simp [f, S, U, trialCenterRow, arm, latentTriple, score, outcome0, outcome1, ha] have hpreT : f ⁻¹' T = U ×ˢ univ := by ext ya simp [f, T, U, trialCenterRow, latentTriple, score, outcome0, outcome1] have hνprob : IsProbabilityMeasure ν := trialArmLaw_isProbabilityMeasure have hνuniv : ν.real univ = 1 := isProbabilityMeasure_iff_real.mp hνprob change (trialCenterFullLaw g hOverlap p).real S = ∫ ω in T, (score ω : ℝ) ∂(trialCenterFullLaw g hOverlap p) have hleft : (trialCenterFullLaw g hOverlap p).real S = μ.real U / 2 := by unfold trialCenterFullLaw rw [MeasureTheory.map_measureReal_apply hf hS, hpreS, measureReal_prod_prod] rw [show ν.real {true} = 1 / 2 from trialArmLaw_true_mass] ring have hright : (∫ ω in T, (score ω : ℝ) ∂(trialCenterFullLaw g hOverlap p)) = μ.real U / 2 := by unfold trialCenterFullLaw rw [MeasureTheory.setIntegral_map hT (by unfold score; fun_prop) hf.aemeasurable] rw [hpreT] change ∫ _ in U ×ˢ univ, (1 / 2 : ℝ) ∂(μ.prod ν) = _ rw [setIntegral_const, measureReal_prod_prod, hνuniv] simp only [smul_eq_mul, mul_one] ring exact hleft.trans hright.symm
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:187
theorem trialCenterFullLaw_externalScoreLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
ExternalScoreLaw g (trialCenterFullLaw g hOverlap p) (Measure.dirac (trialCenterScore hOverlap)) where probabilityP
Proof (Lean source)
lemma trialCenterFullLaw_externalScoreLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : ExternalScoreLaw g (trialCenterFullLaw g hOverlap p) (Measure.dirac (trialCenterScore hOverlap)) where probabilityP := trialCenterFullLaw_isProbabilityMeasure g hOverlap p hp0 hp1 probabilityH := inferInstance overlap := hOverlap measurableRelease := hg scoreMarginal := trialCenterFullLaw_scoreMarginal g hOverlap p hp0 hp1 randomizedAssignment := trialCenterFullLaw_randomizedAssignment g hOverlap p hp0 hp1 consistency := trialCenterFullLaw_consistency g hOverlap p deterministicRelease := trialCenterFullLaw_deterministicRelease g hOverlap p hg
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenterFullLaw_externalScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialPair.lean:243
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerTrialSharp 8 declarations Point identification of the Bernoulli trial submodels at a Dirac score.

Point identification of the Bernoulli trial submodels at a Dirac score.

theorem trialCenter_armProb

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
armProb a (trialCenterScore hOverlap) = 1 / 2
Proof (Lean source)
lemma trialCenter_armProb {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) : armProb a (trialCenterScore hOverlap) = 1 / 2 := by cases a <;> simp [armProb, trialCenterScore] <;> ring
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_armProb · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:15
theorem trialCenter_armCellMass

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
a :
r :
armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r
= if g (trialCenterScore hOverlap) = r then 1 / 2 else 0
Proof (Lean source)
lemma trialCenter_armCellMass {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r = if g (trialCenterScore hOverlap) = r then 1 / 2 else 0 := by classical unfold armCellMass rw [setIntegral_dirac] simp [cell, trialCenter_armProb]
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_armCellMass · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:20
theorem trialCenter_armCellScoreLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r
armCellScoreLaw (Measure.dirac (trialCenterScore hOverlap)) inferInstance g hg a r hq
= Measure.dirac (trialCenterScore hOverlap)
Proof (Lean source)
lemma trialCenter_armCellScoreLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r) : armCellScoreLaw (Measure.dirac (trialCenterScore hOverlap)) inferInstance g hg a r hq = Measure.dirac (trialCenterScore hOverlap) := by classical have hr : g (trialCenterScore hOverlap) = r := by by_contra h rw [trialCenter_armCellMass, if_neg h] at hq exact (lt_irrefl 0) hq unfold armCellScoreLaw rw [trialCenter_armCellMass, if_pos hr, dirac_withDensity, Measure.restrict_smul, restrict_dirac] simp [cell, hr, trialCenter_armProb, smul_smul] rw [ENNReal.mul_inv_cancel (by norm_num : (2 : ℝ≥0∞) ≠ 0) (by norm_num : (2 : ℝ≥0∞) ≠ ⊤), one_smul]
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_armCellScoreLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:31
theorem trialCenter_armCellWeightLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
hg :
a :
r :
hq :
0 < armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r
armCellWeightLaw (Measure.dirac (trialCenterScore hOverlap)) inferInstance g hg a r hq
= Measure.dirac (2 : ℝ)
Proof (Lean source)
lemma trialCenter_armCellWeightLaw {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass (Measure.dirac (trialCenterScore hOverlap)) g a r) : armCellWeightLaw (Measure.dirac (trialCenterScore hOverlap)) inferInstance g hg a r hq = Measure.dirac (2 : ℝ) := by unfold armCellWeightLaw rw [trialCenter_armCellScoreLaw g hOverlap hg a r hq] rw [Measure.map_dirac' (measurable_inverseArmProb a)] simp [trialCenter_armProb]
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_armCellWeightLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:50
theorem quantile_dirac_interior

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
c u :
ℝ
hu0 :
0 < u
hu1 :
u < 1
quantile (Measure.dirac c) u = c
Proof (Lean source)
lemma quantile_dirac_interior (c u : ℝ) (hu0 : 0 < u) (hu1 : u < 1) : quantile (Measure.dirac c) u = c := by apply le_antisymm · apply quantile_le_of_le_cdf hu0 rw [ProbabilityTheory.cdf_eq_real] simpa [Measure.real] using hu1.le · have hq := le_cdf_quantile (μ := Measure.dirac c) hu1 rw [ProbabilityTheory.cdf_eq_real] at hq by_contra h have hlt : quantile (Measure.dirac c) u < c := lt_of_not_ge h have hc : c ∉ Iic (quantile (Measure.dirac c) u) := not_le.mpr hlt simp [Measure.real, hc] at hq exact (not_le_of_gt hu0) hq
CausalSmith.PartialID.UnlinkedPropensityAte.quantile_dirac_interior · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:62
theorem quantileProduct_endpoints_dirac

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Y :
c :
ℝ
(∫ u in (0 : ℝ)..1, quantile Y u * quantile (Measure.dirac c) (1 - u))
= (∫ u in (0 : ℝ)..1, quantile Y u * quantile (Measure.dirac c) u)
Proof (Lean source)
lemma quantileProduct_endpoints_dirac (Y : Measure ℝ) (c : ℝ) : (∫ u in (0 : ℝ)..1, quantile Y u * quantile (Measure.dirac c) (1 - u)) = (∫ u in (0 : ℝ)..1, quantile Y u * quantile (Measure.dirac c) u) := by apply intervalIntegral.integral_congr_Ioo_of_le (by norm_num) intro u hu dsimp rw [quantile_dirac_interior c (1 - u) (by linarith [hu.2]) (by linarith [hu.1]), quantile_dirac_interior c u hu.1 hu.2]
CausalSmith.PartialID.UnlinkedPropensityAte.quantileProduct_endpoints_dirac · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:77
theorem trialCenter_muLower_eq_muUpper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
Prel :
hMass :
CompatibleCellMasses (Measure.dirac (trialCenterScore hOverlap)) g Prel
a :
muLower (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass a
= muUpper (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass a
Proof (Lean source)
lemma trialCenter_muLower_eq_muUpper {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses (Measure.dirac (trialCenterScore hOverlap)) g Prel) (a : ArmSpace) : muLower (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass a = muUpper (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass a := by unfold muLower muUpper apply Finset.sum_congr rfl intro r _ split_ifs with hq · rw [trialCenter_armCellWeightLaw g hOverlap hMass.2.2.1 a r hq] rw [quantileProduct_endpoints_dirac] · rfl
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_muLower_eq_muUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:89
theorem trialCenter_sharpATELength_eq_zero

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
Prel :
hMass :
CompatibleCellMasses (Measure.dirac (trialCenterScore hOverlap)) g Prel
sharpATELength (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass = 0
Proof (Lean source)
lemma trialCenter_sharpATELength_eq_zero {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses (Measure.dirac (trialCenterScore hOverlap)) g Prel) : sharpATELength (Measure.dirac (trialCenterScore hOverlap)) g Prel hMass = 0 := by unfold sharpATELength rw [trialCenter_muLower_eq_muUpper g hOverlap Prel hMass true, trialCenter_muLower_eq_muUpper g hOverlap Prel hMass false] ring
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_sharpATELength_eq_zero · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialSharp.lean:105
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ExternalLowerTrialTesting 18 declarations Testing estimates for the Bernoulli trial pair.

Testing estimates for the Bernoulli trial pair.

theorem trialReadout_tv_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
tvDist (μ.map f) (ν.map f) ≤ tvDist μ ν
Proof (Lean source)
lemma trialReadout_tv_le {S T : Type*} [MeasurableSpace S] [MeasurableSpace T] (μ ν : Measure S) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (f : S → T) (hf : Measurable f) : tvDist (μ.map f) (ν.map f) ≤ tvDist μ ν := by unfold tvDist apply ciSup_le intro A simp only [Measure.real_def, Measure.map_apply hf A.property] exact abs_measureReal_sub_le_tvDist (hf A.property)
theorem trialCenter_releasedLaw_map

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p :
ℝ
= ((trialOutcomeLaw p).prod trialArmLaw).map (fun ya : OutcomeSpace × ArmSpace => (g (trialCenterScore hOverlap), ya.2, if ya.2 then ya.1 else trialZeroOutcome))
Proof (Lean source)
lemma trialCenter_releasedLaw_map {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p : ℝ) : releasedLaw (trialCenterFullLaw g hOverlap p) = ((trialOutcomeLaw p).prod trialArmLaw).map (fun ya : OutcomeSpace × ArmSpace => (g (trialCenterScore hOverlap), ya.2, if ya.2 then ya.1 else trialZeroOutcome)) := by unfold releasedLaw trialCenterFullLaw rw [Measure.map_map (by unfold releasedRecord label arm observed; fun_prop) (trialCenterRow_measurable g hOverlap)] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_releasedLaw_map · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:25
theorem trialCenter_productReleased_tv_le_latent

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
p q :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
hq0 :
0 ≤ q
hq1 :
q ≤ 1
n :
ℕ
tvDist (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap p))) (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap q)))
≤ tvDist (Measure.pi (fun _ : Fin n => (trialOutcomeLaw p).prod trialArmLaw)) (Measure.pi (fun _ : Fin n => (trialOutcomeLaw q).prod trialArmLaw))
Proof (Lean source)
lemma trialCenter_productReleased_tv_le_latent {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (p q : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (n : ℕ) : tvDist (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap p))) (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap q))) ≤ tvDist (Measure.pi (fun _ : Fin n => (trialOutcomeLaw p).prod trialArmLaw)) (Measure.pi (fun _ : Fin n => (trialOutcomeLaw q).prod trialArmLaw)) := by let f : OutcomeSpace × ArmSpace → Observation J := fun ya => (g (trialCenterScore hOverlap), ya.2, if ya.2 then ya.1 else trialZeroOutcome) have hf : Measurable f := by dsimp [f] have hcond : MeasurableSet {ya : OutcomeSpace × ArmSpace | ya.2 = true} := measurableSet_eq_fun measurable_snd measurable_const have hobs : Measurable (fun ya : OutcomeSpace × ArmSpace => if ya.2 then ya.1 else trialZeroOutcome) := Measurable.ite hcond measurable_fst measurable_const fun_prop (disch := assumption) have hp : IsProbabilityMeasure ((trialOutcomeLaw p).prod trialArmLaw) := by letI : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure infer_instance have hq : IsProbabilityMeasure ((trialOutcomeLaw q).prod trialArmLaw) := by letI : IsProbabilityMeasure (trialOutcomeLaw q) := trialOutcomeLaw_isProbabilityMeasure q hq0 hq1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure infer_instance letI := hp letI := hq have hmap (r : ℝ) (hr0 : 0 ≤ r) (hr1 : r ≤ 1) : Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap r)) = (Measure.pi (fun _ : Fin n => (trialOutcomeLaw r).prod trialArmLaw)).map (fun z i => f (z i)) := by letI : IsProbabilityMeasure (trialOutcomeLaw r) := trialOutcomeLaw_isProbabilityMeasure r hr0 hr1 letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure rw [Measure.pi_map_pi (fun _ => hf.aemeasurable)] simp only [trialCenter_releasedLaw_map] rfl rw [hmap p hp0 hp1, hmap q hq0 hq1] exact trialReadout_tv_le _ _ _ (measurable_pi_lambda _ fun _ => hf.comp (measurable_pi_apply _))
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_productReleased_tv_le_latent · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:38
theorem trialOutcomeLaw_withDensity_center

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
p q :
ℝ
hq0 :
0 < q
hq1 :
q < 1
= (trialOutcomeLaw q).withDensity (fun y : OutcomeSpace => if y = trialOneOutcome then ofReal (p / q) else ofReal ((1 - p) / (1 - q)))
Proof (Lean source)
lemma trialOutcomeLaw_withDensity_center (p q : ℝ) (hq0 : 0 < q) (hq1 : q < 1) : trialOutcomeLaw p = (trialOutcomeLaw q).withDensity (fun y : OutcomeSpace => if y = trialOneOutcome then ofReal (p / q) else ofReal ((1 - p) / (1 - q))) := by let f : OutcomeSpace → ENNReal := fun y => if y = trialOneOutcome then ofReal (p / q) else ofReal ((1 - p) / (1 - q)) have hqne : ofReal q ≠ 0 := by intro h have hle := ENNReal.ofReal_eq_zero.mp h linarith have h1qne : ofReal (1 - q) ≠ 0 := by intro h have hle := ENNReal.ofReal_eq_zero.mp h linarith change trialOutcomeLaw p = (trialOutcomeLaw q).withDensity f ext s hs rw [withDensity_apply _ hs, ← lintegral_indicator hs f] unfold trialOutcomeLaw dsimp [f] rw [lintegral_add_measure, lintegral_smul_measure, lintegral_smul_measure] simp only [lintegral_dirac] have h10 : trialZeroOutcome ≠ trialOneOutcome := by norm_num [trialZeroOutcome, trialOneOutcome] by_cases h1 : trialOneOutcome ∈ s · by_cases h0 : trialZeroOutcome ∈ s · simp [h1, h0, ENNReal.ofReal_div_of_pos hq0, ENNReal.ofReal_div_of_pos (sub_pos.mpr hq1), ENNReal.mul_div_cancel hqne ENNReal.ofReal_ne_top, ENNReal.mul_div_cancel h1qne ENNReal.ofReal_ne_top, h10] · simp [h1, h0, ENNReal.ofReal_div_of_pos hq0, ENNReal.mul_div_cancel hqne ENNReal.ofReal_ne_top, h10] · by_cases h0 : trialZeroOutcome ∈ s · simp [h1, h0, ENNReal.ofReal_div_of_pos (sub_pos.mpr hq1), ENNReal.mul_div_cancel h1qne ENNReal.ofReal_ne_top, h10] · simp [h1, h0, f, h10]
CausalSmith.PartialID.UnlinkedPropensityAte.trialOutcomeLaw_withDensity_center · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:85
theorem trialOutcomeLaw_chisq_center

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
u :
ℝ
hu :
|u| < 1 / 2
chiSqDiv (trialOutcomeLaw (1 / 2 + u)) (trialOutcomeLaw (1 / 2))
= 4 * u ^ 2
Proof (Lean source)
lemma trialOutcomeLaw_chisq_center (u : ℝ) (hu : |u| < 1 / 2) : chiSqDiv (trialOutcomeLaw (1 / 2 + u)) (trialOutcomeLaw (1 / 2)) = 4 * u ^ 2 := by let p : ℝ := 1 / 2 + u let q : ℝ := 1 / 2 have hub := abs_lt.mp hu have hp0 : 0 ≤ p := by dsimp [p]; linarith have hp1 : p ≤ 1 := by dsimp [p]; linarith have hq0 : 0 < q := by norm_num [q] have hq1 : q < 1 := by norm_num [q] letI : IsProbabilityMeasure (trialOutcomeLaw q) := trialOutcomeLaw_isProbabilityMeasure q hq0.le hq1.le let f : OutcomeSpace → ENNReal := fun y => if y = trialOneOutcome then ofReal (p / q) else ofReal ((1 - p) / (1 - q)) have hf : Measurable f := by dsimp [f] exact Measurable.ite (measurableSet_singleton trialOneOutcome) measurable_const measurable_const have hwd : trialOutcomeLaw p = (trialOutcomeLaw q).withDensity f := trialOutcomeLaw_withDensity_center p q hq0 hq1 have hrn : (trialOutcomeLaw p).rnDeriv (trialOutcomeLaw q) =ᵐ[trialOutcomeLaw q] f := by rw [hwd] exact Measure.rnDeriv_withDensity _ hf change chiSqDiv (trialOutcomeLaw p) (trialOutcomeLaw q) = 4 * u ^ 2 rw [chiSqDiv] trans ∫ y, ((f y).toReal - 1) ^ 2 ∂(trialOutcomeLaw q) · exact integral_congr_ae <| hrn.mono fun y hy => by dsimp rw [hy] unfold trialOutcomeLaw rw [integral_add_measure] · rw [integral_smul_measure, integral_smul_measure] simp [f, trialOneOutcome, trialZeroOutcome, ENNReal.toReal_ofReal (div_nonneg hp0 hq0.le), ENNReal.toReal_ofReal (div_nonneg (sub_nonneg.mpr hp1) (sub_nonneg.mpr hq1.le))] dsimp [p, q] norm_num [q] ring · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.trialOutcomeLaw_chisq_center · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:126
theorem trialOutcomeLaw_ac_integrable_center

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
u :
ℝ
conclusion 1
trialOutcomeLaw (1 / 2 + u) ≪ trialOutcomeLaw (1 / 2)
conclusion 2
Integrable (fun y : OutcomeSpace => (((trialOutcomeLaw (1 / 2 + u)).rnDeriv (trialOutcomeLaw (1 / 2)) y).toReal - 1) ^ 2) (trialOutcomeLaw (1 / 2))
Proof (Lean source)
lemma trialOutcomeLaw_ac_integrable_center (u : ℝ) : trialOutcomeLaw (1 / 2 + u) ≪ trialOutcomeLaw (1 / 2) ∧ Integrable (fun y : OutcomeSpace => (((trialOutcomeLaw (1 / 2 + u)).rnDeriv (trialOutcomeLaw (1 / 2)) y).toReal - 1) ^ 2) (trialOutcomeLaw (1 / 2)) := by constructor · rw [trialOutcomeLaw_withDensity_center (1 / 2 + u) (1 / 2) (by norm_num) (by norm_num)] exact withDensity_absolutelyContinuous _ _ · unfold trialOutcomeLaw apply Integrable.add_measure · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp) · exact Integrable.smul_measure (integrable_dirac (by simp [enorm])) (by simp)
CausalSmith.PartialID.UnlinkedPropensityAte.trialOutcomeLaw_ac_integrable_center · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:170
theorem trial_ancillary_integrable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
μ ν :
ρ :
hac :
μ ≪ ν
hint :
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
Integrable (fun z => (((μ.prod ρ).rnDeriv (ν.prod ρ) z).toReal - 1) ^ 2) (ν.prod ρ)
Proof (Lean source)
lemma trial_ancillary_integrable {S T : Type*} [MeasurableSpace S] [MeasurableSpace T] (μ ν : Measure S) (ρ : Measure T) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [IsProbabilityMeasure ρ] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) : Integrable (fun z => (((μ.prod ρ).rnDeriv (ν.prod ρ) z).toReal - 1) ^ 2) (ν.prod ρ) := by have hrn := rnDeriv_prod_eq μ ν ρ ρ hac (Measure.AbsolutelyContinuous.refl ρ) have hself : ∀ᵐ z ∂ν.prod ρ, ρ.rnDeriv ρ z.2 = 1 := by have hs : ∀ᵐ y ∂ρ, ρ.rnDeriv ρ y = 1 := by filter_upwards [ρ.rnDeriv_self] with y hy exact hy have hmap : ∀ᵐ y ∂Measure.map snd (ν.prod ρ), ρ.rnDeriv ρ y = 1 := by simpa [MeasurePreserving.map_eq (measurePreserving_snd (μ := ν) (ν := ρ))] using hs exact (ae_map_iff (measurePreserving_snd (μ := ν) (ν := ρ)).aemeasurable (measurableSet_eq_fun (Measure.measurable_rnDeriv ρ ρ) measurable_const)).mp hmap have heq : (fun z => (((μ.prod ρ).rnDeriv (ν.prod ρ) z).toReal - 1) ^ 2) =ᵐ[ν.prod ρ] (fun z => ((μ.rnDeriv ν z.1).toReal - 1) ^ 2) := by filter_upwards [hrn, hself] with z hz hs simp [hz, hs] exact (hint.comp_fst ρ).congr heq.symm
CausalSmith.PartialID.UnlinkedPropensityAte.trial_ancillary_integrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:185
theorem trialProduct_tv_le_of_chisq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
hac :
μ ≪ ν
hint :
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν
n :
ℕ
tvDist (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν))
≤ (1 / 2 : ℝ) * sqrt ((1 + chiSqDiv μ ν) ^ n - 1)
Proof (Lean source)
lemma trialProduct_tv_le_of_chisq {S : Type*} [MeasurableSpace S] (μ ν : Measure S) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1) ^ 2) ν) (n : ℕ) : tvDist (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) ≤ (1 / 2 : ℝ) * sqrt ((1 + chiSqDiv μ ν) ^ n - 1) := by have hacn : Measure.pi (fun _ : Fin n => μ) ≪ Measure.pi (fun _ : Fin n => ν) := pi_iid_absolutelyContinuous μ ν hac n have hintn := pi_iid_integrable_sq_dev μ ν hac hint n have htv := tvDist_le_half_sqrt_chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) hacn hintn rw [show chiSqDiv (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) = (1 + chiSqDiv μ ν) ^ n - 1 by linarith [one_add_chiSqDiv_pi_iid_general μ ν hac hint n]] at htv exact htv
CausalSmith.PartialID.UnlinkedPropensityAte.trialProduct_tv_le_of_chisq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:210
theorem trialCenter_latent_chisq_center

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
u :
ℝ
hu :
|u| < 1 / 2
Proof (Lean source)
lemma trialCenter_latent_chisq_center (u : ℝ) (hu : |u| < 1 / 2) : chiSqDiv ((trialOutcomeLaw (1 / 2 + u)).prod trialArmLaw) ((trialOutcomeLaw (1 / 2)).prod trialArmLaw) = 4 * u ^ 2 := by have hub := abs_lt.mp hu letI : IsProbabilityMeasure (trialOutcomeLaw (1 / 2 + u)) := trialOutcomeLaw_isProbabilityMeasure _ (by linarith) (by linarith) letI : IsProbabilityMeasure (trialOutcomeLaw (1 / 2)) := trialOutcomeLaw_isProbabilityMeasure _ (by norm_num) (by norm_num) letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure have h := trialOutcomeLaw_ac_integrable_center u rw [chiSqDiv_prod_ancillary _ _ trialArmLaw h.1 h.2] exact trialOutcomeLaw_chisq_center u hu
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_latent_chisq_center · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:233
theorem trialCenter_productReleased_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hOverlap :
u :
ℝ
hu :
|u| < 1 / 2
n :
ℕ
tvDist (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap (1 / 2 + u)))) (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap (1 / 2))))
≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1)
Proof (Lean source)
lemma trialCenter_productReleased_tv_bound {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (u : ℝ) (hu : |u| < 1 / 2) (n : ℕ) : tvDist (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap (1 / 2 + u)))) (Measure.pi (fun _ : Fin n => releasedLaw (trialCenterFullLaw g hOverlap (1 / 2)))) ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := by have hub := abs_lt.mp hu let μ := (trialOutcomeLaw (1 / 2 + u)).prod trialArmLaw let ν := (trialOutcomeLaw (1 / 2)).prod trialArmLaw letI : IsProbabilityMeasure (trialOutcomeLaw (1 / 2 + u)) := trialOutcomeLaw_isProbabilityMeasure _ (by linarith) (by linarith) letI : IsProbabilityMeasure (trialOutcomeLaw (1 / 2)) := trialOutcomeLaw_isProbabilityMeasure _ (by norm_num) (by norm_num) letI : IsProbabilityMeasure trialArmLaw := trialArmLaw_isProbabilityMeasure have h := trialOutcomeLaw_ac_integrable_center u have hac : μ ≪ ν := h.1.prod (Measure.AbsolutelyContinuous.refl trialArmLaw) have hint : Integrable (fun z => ((μ.rnDeriv ν z).toReal - 1) ^ 2) ν := trial_ancillary_integrable _ _ trialArmLaw h.1 h.2 calc _ ≤ tvDist (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) := trialCenter_productReleased_tv_le_latent g hOverlap (1 / 2 + u) (1 / 2) (by linarith) (by linarith) (by norm_num) (by norm_num) n _ ≤ (1 / 2 : ℝ) * sqrt ((1 + chiSqDiv μ ν) ^ n - 1) := trialProduct_tv_le_of_chisq μ ν hac hint n _ = _ := by rw [trialCenter_latent_chisq_center u hu]
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_productReleased_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:248
theorem trial_commonLog_tv_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
tvDist (μ.prod ρ) (ν.prod ρ) ≤ tvDist μ ν
Proof (Lean source)
lemma trial_commonLog_tv_le {S T : Type*} [MeasurableSpace S] [MeasurableSpace T] (μ ν : Measure S) (ρ : Measure T) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [IsProbabilityMeasure ρ] : tvDist (μ.prod ρ) (ν.prod ρ) ≤ tvDist μ ν := by have h := Causalean.Stat.Minimax.MomentMatchedMixture.tvDist_prod_le_add μ ν ρ ρ have hself : tvDist ρ ρ = 0 := by unfold tvDist simp simpa [hself] using h
CausalSmith.PartialID.UnlinkedPropensityAte.trial_commonLog_tv_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:281
theorem trialCenter_jointExperiment_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
hOverlap :
hg :
u :
ℝ
hu :
|u| < 1 / 2
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
tvDist (Qj (trialCenterFullLaw g hOverlap (1 / 2 + u)) (Measure.dirac (trialCenterScore hOverlap))) (Qj (trialCenterFullLaw g hOverlap (1 / 2)) (Measure.dirac (trialCenterScore hOverlap)))
≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1)
Proof (Lean source)
lemma trialCenter_jointExperiment_tv_bound {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (u : ℝ) (hu : |u| < 1 / 2) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) : tvDist (Qj (trialCenterFullLaw g hOverlap (1 / 2 + u)) (Measure.dirac (trialCenterScore hOverlap))) (Qj (trialCenterFullLaw g hOverlap (1 / 2)) (Measure.dirac (trialCenterScore hOverlap))) ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := by have hub := abs_lt.mp hu let H : Measure (ScoreSpace ε) := Measure.dirac (trialCenterScore hOverlap) let P1 := trialCenterFullLaw g hOverlap (1 / 2 + u) let P0 := trialCenterFullLaw g hOverlap (1 / 2) have hPH1 : (P1, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by linarith) (by linarith), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by linarith) (by linarith)⟩ have hPH0 : (P0, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by norm_num) (by norm_num), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by norm_num) (by norm_num)⟩ have hQ (P : Measure (FullRow ε J)) (hPH : (P, H) ∈ ExternalLaws g) : Qj P H = (Measure.pi (fun _ : Fin n => releasedLaw P)).prod (Measure.pi (fun _ : Fin m => H)) := by rw [hInd (P, H) hPH, hTrial (P, H) hPH, hLog (P, H) hPH] rw [hQ P1 hPH1, hQ P0 hPH0] letI : IsProbabilityMeasure (releasedLaw P1) := by exact @Measure.isProbabilityMeasure_map _ _ _ _ P1 hPH1.2.2.probabilityP _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable letI : IsProbabilityMeasure (releasedLaw P0) := by exact @Measure.isProbabilityMeasure_map _ _ _ _ P0 hPH0.2.2.probabilityP _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable letI : IsProbabilityMeasure H := inferInstance calc _ ≤ tvDist (Measure.pi (fun _ : Fin n => releasedLaw P1)) (Measure.pi (fun _ : Fin n => releasedLaw P0)) := trial_commonLog_tv_le _ _ (Measure.pi (fun _ : Fin m => H)) _ ≤ _ := trialCenter_productReleased_tv_bound g hOverlap u hu n
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_jointExperiment_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:293
theorem externalInterval_twoPoint_expectedLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
θ0 θ1 α :
ℝ
hθ :
θ0 ≤ θ1
hcover0 :
1 - α ≤ Q0.real {x | C.contains x θ0}
hcover1 :
1 - α ≤ Q1.real {x | C.contains x θ1}
(θ1 - θ0) * (1 - 2 * α - tvDist Q0 Q1) ≤ ∫ x, C.length x ∂Q0
Proof (Lean source)
lemma externalInterval_twoPoint_expectedLength {ε : ℝ} {J n m : ℕ} (C : ExternalIntervalProcedure ε J n m) (Q0 Q1 : Measure (ExternalSample ε J n m)) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (θ0 θ1 α : ℝ) (hθ : θ0 ≤ θ1) (hcover0 : 1 - α ≤ Q0.real {x | C.contains x θ0}) (hcover1 : 1 - α ≤ Q1.real {x | C.contains x θ1}) : (θ1 - θ0) * (1 - 2 * α - tvDist Q0 Q1) ≤ ∫ x, C.length x ∂Q0 := by let A0 : Set (ExternalSample ε J n m) := {x | C.contains x θ0} let A1 : Set (ExternalSample ε J n m) := {x | C.contains x θ1} let I := A0 ∩ A1 have hA (θ : ℝ) : MeasurableSet {x | C.contains x θ} := by change MeasurableSet {x | C.lo x ≤ θ ∧ θ ≤ C.hi x} exact (measurableSet_le C.measurable_lo measurable_const).inter (measurableSet_le measurable_const C.measurable_hi) have hA0 : MeasurableSet A0 := hA θ0 have hA1 : MeasurableSet A1 := hA θ1 have hI : MeasurableSet I := hA0.inter hA1 have htransfer : 1 - α - tvDist Q0 Q1 ≤ Q0.real A1 := by have htv := measureReal_sub_le_tvDist (μ := Q0) (ν := Q1) hA1 dsimp [A1] at htv linarith have hmass : 1 - 2 * α - tvDist Q0 Q1 ≤ Q0.real I := by have hu : Q0.real (A0 ∪ A1) ≤ 1 := measureReal_le_one have hsum := measureReal_union_add_inter (μ := Q0) (s := A0) (t := A1) hA1 (measure_ne_top Q0 A0) (measure_ne_top Q0 A1) change Q0.real (A0 ∪ A1) + Q0.real I = Q0.real A0 + Q0.real A1 at hsum linarith have hlenMeas : Measurable C.length := C.measurable_hi.sub C.measurable_lo have hlenNonneg (x : ExternalSample ε J n m) : 0 ≤ C.length x := sub_nonneg.mpr (C.ordered x) have hlenBound (x : ExternalSample ε J n m) : C.length x ≤ 2 := by dsimp [ExternalIntervalProcedure.length] linarith [C.lower_bound x, C.upper_bound x] have hlenInt : Integrable C.length Q0 := by apply Integrable.of_bound hlenMeas.aestronglyMeasurable 2 filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (hlenNonneg x)] exact hlenBound x have hindInt : Integrable (I.indicator (fun _ => θ1 - θ0)) Q0 := (integrable_const _).indicator hI have hpoint (x : ExternalSample ε J n m) : I.indicator (fun _ => θ1 - θ0) x ≤ C.length x := by by_cases hx : x ∈ I · rw [Set.indicator_of_mem hx] have hx0 : C.lo x ≤ θ0 ∧ θ0 ≤ C.hi x := hx.1 have hx1 : C.lo x ≤ θ1 ∧ θ1 ≤ C.hi x := hx.2 dsimp [ExternalIntervalProcedure.length] linarith · rw [Set.indicator_of_notMem hx] exact hlenNonneg x have hmono := integral_mono hindInt hlenInt hpoint rw [integral_indicator_const (θ1 - θ0) hI] at hmono simp only [smul_eq_mul] at hmono rw [mul_comm (Q0.real I) (θ1 - θ0)] at hmono exact (mul_le_mul_of_nonneg_left hmass (sub_nonneg.mpr hθ)).trans hmono
CausalSmith.PartialID.UnlinkedPropensityAte.externalInterval_twoPoint_expectedLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:340
theorem trial_calibrated_perturbation

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
n :
ℕ
hn :
0 < n
β :
1 - 2 * α
u :
sqrt (log (1 + β ^ 2) / (n : ℝ)) / 2
0 < u
|u| < 1 / 2
(1 + 4 * u ^ 2) ^ n ≤ 1 + β ^ 2
Proof (Lean source)
lemma trial_calibrated_perturbation (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (n : ℕ) (hn : 0 < n) : let β := 1 - 2 * α let u := sqrt (log (1 + β ^ 2) / (n : ℝ)) / 2 0 < u ∧ |u| < 1 / 2 ∧ (1 + 4 * u ^ 2) ^ n ≤ 1 + β ^ 2 := by dsimp let β : ℝ := 1 - 2 * α let x : ℝ := log (1 + β ^ 2) let u : ℝ := sqrt (x / (n : ℝ)) / 2 have hβ0 : 0 < β := by dsimp [β]; linarith [hα.2] have hβ1 : β < 1 := by dsimp [β]; linarith [hα.1] have hβsq : β ^ 2 < 1 := by nlinarith have hx0 : 0 < x := by dsimp [x] exact Real.log_pos (by nlinarith [sq_pos_of_pos hβ0]) have hxle : x ≤ β ^ 2 := by dsimp [x] nlinarith [Real.log_le_sub_one_of_pos (show 0 < 1 + β ^ 2 by positivity)] have hn0 : (0 : ℝ) < n := by exact_mod_cast hn have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn have hq0 : 0 < x / (n : ℝ) := div_pos hx0 hn0 have hq1 : x / (n : ℝ) < 1 := (div_lt_one hn0).2 (by linarith) have hu0 : 0 < u := by dsimp [u]; positivity have hu1 : |u| < 1 / 2 := by rw [abs_of_pos hu0] dsimp [u] have hs : sqrt (x / (n : ℝ)) < 1 := by rw [Real.sqrt_lt' (by norm_num : (0 : ℝ) < 1)] simpa using hq1 linarith have h4u : 4 * u ^ 2 = x / (n : ℝ) := by dsimp [u] calc 4 * (sqrt (x / (n : ℝ)) / 2) ^ 2 = (sqrt (x / (n : ℝ))) ^ 2 := by ring _ = x / (n : ℝ) := Real.sq_sqrt hq0.le have hpow : (1 + 4 * u ^ 2) ^ n ≤ 1 + β ^ 2 := by rw [h4u] have h := Real.one_sub_div_pow_le_exp_neg (n := n) (t := -x) (by linarith : -x ≤ (n : ℝ)) have hexp : exp x = 1 + β ^ 2 := Real.exp_log (by positivity) simpa only [neg_div, sub_neg_eq_add, neg_neg, hexp] using h exact ⟨hu0, hu1, hpow⟩
CausalSmith.PartialID.UnlinkedPropensityAte.trial_calibrated_perturbation · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:400
theorem trial_calibrated_coefficient

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
α :
ℝ
n :
ℕ
β :
1 - 2 * α
u :
sqrt (log (1 + β ^ 2) / (n : ℝ)) / 2
β * u / 2 = trialCertificate α * (sqrt (n : ℝ))⁻¹
Proof (Lean source)
lemma trial_calibrated_coefficient (α : ℝ) (n : ℕ) : let β := 1 - 2 * α let u := sqrt (log (1 + β ^ 2) / (n : ℝ)) / 2 β * u / 2 = trialCertificate α * (sqrt (n : ℝ))⁻¹ := by dsimp [trialCertificate] rw [Real.sqrt_div (Real.log_nonneg (by nlinarith [sq_nonneg (1 - 2 * α)])) (n : ℝ)] ring
CausalSmith.PartialID.UnlinkedPropensityAte.trial_calibrated_coefficient · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:446
theorem trial_calibrated_honest_expectedLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
hn :
0 < n
u :
ℝ
hu :
u = sqrt (log (1 + (1 - 2 * α) ^ 2) / (n : ℝ)) / 2
hcover0 :
1 - α ≤ Q0.real {x | C.contains x (1 / 2)}
hcover1 :
1 - α ≤ Q1.real {x | C.contains x (1 / 2 + u)}
htv :
tvDist Q0 Q1 ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1)
trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, C.length x ∂Q0
Proof (Lean source)
lemma trial_calibrated_honest_expectedLength {ε : ℝ} {J n m : ℕ} (C : ExternalIntervalProcedure ε J n m) (Q0 Q1 : Measure (ExternalSample ε J n m)) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (hn : 0 < n) (u : ℝ) (hu : u = sqrt (log (1 + (1 - 2 * α) ^ 2) / (n : ℝ)) / 2) (hcover0 : 1 - α ≤ Q0.real {x | C.contains x (1 / 2)}) (hcover1 : 1 - α ≤ Q1.real {x | C.contains x (1 / 2 + u)}) (htv : tvDist Q0 Q1 ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1)) : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, C.length x ∂Q0 := by have hcal := trial_calibrated_perturbation α hα n hn dsimp at hcal rw [← hu] at hcal rcases hcal with ⟨hu0, _, hpow⟩ let β : ℝ := 1 - 2 * α have hβ0 : 0 < β := by dsimp [β]; linarith [hα.2] have htvhalf : tvDist Q0 Q1 ≤ β / 2 := by calc _ ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := htv _ ≤ (1 / 2 : ℝ) * sqrt (β ^ 2) := by apply mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt ?_) (by norm_num) dsimp [β] at hpow ⊢ linarith _ = β / 2 := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hβ0]; ring have hlen := externalInterval_twoPoint_expectedLength C Q0 Q1 (1 / 2) (1 / 2 + u) α (by linarith) hcover0 hcover1 have hcoef : β * u / 2 ≤ u * (1 - 2 * α - tvDist Q0 Q1) := by dsimp [β] at htvhalf ⊢ nlinarith [mul_nonneg (le_of_lt hu0) (show 0 ≤ 1 - 2 * α - 2 * tvDist Q0 Q1 by linarith)] have hident := trial_calibrated_coefficient α n dsimp at hident rw [← hu] at hident rw [← hident] have hlen' : u * (1 - 2 * α - tvDist Q0 Q1) ≤ ∫ x, C.length x ∂Q0 := by convert hlen using 1 <;> ring exact hcoef.trans hlen'
CausalSmith.PartialID.UnlinkedPropensityAte.trial_calibrated_honest_expectedLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:456
theorem externalLaw_jointExperiment_probability

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
IsProbabilityMeasure (Qj PH.1 PH.2)
Proof (Lean source)
lemma externalLaw_jointExperiment_probability {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) : IsProbabilityMeasure (Qj PH.1 PH.2) := by have hrel : IsProbabilityMeasure (releasedLaw PH.1) := by exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.2.2.probabilityP _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable letI : IsProbabilityMeasure (releasedLaw PH.1) := hrel letI : IsProbabilityMeasure PH.2 := hPH.2.1 rw [hInd PH hPH, hTrial PH hPH, hLog PH hPH] infer_instance
CausalSmith.PartialID.UnlinkedPropensityAte.externalLaw_jointExperiment_probability · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:500
theorem trialCenter_honest_expectedLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
hn :
0 < n
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
hC :
trialCertificate α * (sqrt (n : ℝ))⁻¹
≤ ∫ x, C.length x ∂(Qj (trialCenterFullLaw g hOverlap (1 / 2)) (Measure.dirac (trialCenterScore hOverlap)))
Proof (Lean source)
lemma trialCenter_honest_expectedLength {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (hn : 0 < n) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (C : ExternalIntervalProcedure ε J n m) (hC : C ∈ externalHonestProcedures g Qj α) : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, C.length x ∂(Qj (trialCenterFullLaw g hOverlap (1 / 2)) (Measure.dirac (trialCenterScore hOverlap))) := by let u : ℝ := sqrt (log (1 + (1 - 2 * α) ^ 2) / (n : ℝ)) / 2 have hcal := trial_calibrated_perturbation α hα n hn dsimp at hcal change 0 < u ∧ |u| < 1 / 2 ∧ _ at hcal have hu : |u| < 1 / 2 := hcal.2.1 let H : Measure (ScoreSpace ε) := Measure.dirac (trialCenterScore hOverlap) let P0 := trialCenterFullLaw g hOverlap (1 / 2) let P1 := trialCenterFullLaw g hOverlap (1 / 2 + u) have hub := abs_lt.mp hu have hPH0 : (P0, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by norm_num) (by norm_num), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by norm_num) (by norm_num)⟩ have hPH1 : (P1, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by linarith) (by linarith), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by linarith) (by linarith)⟩ let Q0 := Qj P0 H let Q1 := Qj P1 H letI : IsProbabilityMeasure Q0 := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd (P0, H) hPH0 letI : IsProbabilityMeasure Q1 := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd (P1, H) hPH1 have hQ0 : Q0 = externalExperiment n m P0 H := by dsimp [Q0, externalExperiment] rw [hInd (P0, H) hPH0, hTrial (P0, H) hPH0, hLog (P0, H) hPH0] have hQ1 : Q1 = externalExperiment n m P1 H := by dsimp [Q1, externalExperiment] rw [hInd (P1, H) hPH1, hTrial (P1, H) hPH1, hLog (P1, H) hPH1] have hc0 := hC (P0, H) hPH0 have hc1 := hC (P1, H) hPH1 change 1 - α ≤ (externalExperiment n m P0 H).real {x | C.contains x (ate P0)} at hc0 change 1 - α ≤ (externalExperiment n m P1 H).real {x | C.contains x (ate P1)} at hc1 rw [← hQ0] at hc0 rw [← hQ1] at hc1 rw [trialCenterFullLaw_ate g hOverlap _ (by norm_num) (by norm_num)] at hc0 rw [trialCenterFullLaw_ate g hOverlap _ (by linarith) (by linarith)] at hc1 have htv : tvDist Q0 Q1 ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := by rw [tvDist_symm] exact trialCenter_jointExperiment_tv_bound g hOverlap hg u hu Qj hTrial hLog hInd exact trial_calibrated_honest_expectedLength C Q0 Q1 α hα hn u rfl hc0 hc1 htv
CausalSmith.PartialID.UnlinkedPropensityAte.trialCenter_honest_expectedLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ExternalLowerTrialTesting.lean:518
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLaw 1 declarations Sharp potential-outcome means and ATE interval at a fixed released law.

Sharp potential-outcome means and ATE interval at a fixed released law.

theorem fixedReleasedLaw_sharp

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hOverlap :
hg :
hcomp :
(CompatibleLaws H g Prel).Nonempty
conclusion 1
a :
{v : ℝ | ∃ P ∈ CompatibleLaws H g Prel, v = ∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P}
= Icc (muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) a) (muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) a)
conclusion 2
{v : ℝ | ∃ P ∈ CompatibleLaws H g Prel, v = ate P}
= sharpATESet H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp)
conclusion 3
∃ Pminus ∈ CompatibleLaws H g Prel, ∃ Pplus ∈ CompatibleLaws H g Prel,
ate Pminus
= muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) true
- muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) false
ate Pplus
= muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) true
- muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) false
Proof (Lean source)
lemma fixedReleasedLaw_sharp {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hOverlap : Overlap ε) (hg : Measurable g) (hcomp : (CompatibleLaws H g Prel).Nonempty) : (∀ a : ArmSpace, {v : ℝ | ∃ P ∈ CompatibleLaws H g Prel, v = ∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P} = Icc (muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) a) (muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) a)) ∧ {v : ℝ | ∃ P ∈ CompatibleLaws H g Prel, v = ate P} = sharpATESet H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) ∧ (∃ Pminus ∈ CompatibleLaws H g Prel, ∃ Pplus ∈ CompatibleLaws H g Prel, ate Pminus = muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) true - muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) false ∧ ate Pplus = muUpper H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) true - muLower H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) false) := by let hMass := compatibleCellMasses_of_nonempty H g Prel hcomp let Plo := endpointFullLaw H g Prel hMass hOverlap false false let Phi := endpointFullLaw H g Prel hMass hOverlap true true let Pminus := endpointFullLaw H g Prel hMass hOverlap true false let Pplus := endpointFullLaw H g Prel hMass hOverlap false true have hlo : CompatibleCausalLaw H g Prel Plo := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap false false have hhi : CompatibleCausalLaw H g Prel Phi := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap true true have hminus : CompatibleCausalLaw H g Prel Pminus := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap true false have hplus : CompatibleCausalLaw H g Prel Pplus := endpointFullLaw_compatibleCausalLaw H g Prel hMass hOverlap false true have hloMem : Plo ∈ CompatibleLaws H g Prel := ⟨hlo.probability, hlo⟩ have hhiMem : Phi ∈ CompatibleLaws H g Prel := ⟨hhi.probability, hhi⟩ have hminusMem : Pminus ∈ CompatibleLaws H g Prel := ⟨hminus.probability, hminus⟩ have hplusMem : Pplus ∈ CompatibleLaws H g Prel := ⟨hplus.probability, hplus⟩ have hminusAte : ate Pminus = muLower H g Prel hMass true - muUpper H g Prel hMass false := by letI : IsProbabilityMeasure Pminus := hminus.probability rw [ate_eq_potentialOutcomeMeans_sub] have h1 := endpointFullLaw_armMean H g Prel hMass hOverlap true false true have h0 := endpointFullLaw_armMean H g Prel hMass hOverlap true false false simpa [Pminus] using congrArg₂ (· - ·) h1 h0 have hplusAte : ate Pplus = muUpper H g Prel hMass true - muLower H g Prel hMass false := by letI : IsProbabilityMeasure Pplus := hplus.probability rw [ate_eq_potentialOutcomeMeans_sub] have h1 := endpointFullLaw_armMean H g Prel hMass hOverlap false true true have h0 := endpointFullLaw_armMean H g Prel hMass hOverlap false true false simpa [Pplus] using congrArg₂ (· - ·) h1 h0 refine ⟨?_, ?_, ?_⟩ · intro a ext v constructor · rintro ⟨P, hP, rfl⟩ exact compatible_armMean_mem_endpoints H g Prel P hP.2 hMass hOverlap a · intro hv rcases Icc_subset_segment hv with ⟨c, d, hc, hd, hcd, hv⟩ let cE : ENNReal := ENNReal.ofReal c let dE : ENNReal := ENNReal.ofReal d let Pmix := compatibleMixture cE dE Plo Phi have hsumE : cE + dE = 1 := by dsimp [cE, dE] rw [← ENNReal.ofReal_add hc hd, hcd] norm_num have hmix := compatibleCausalLaw_mixture H g Prel Plo Phi hlo hhi cE dE ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top hsumE refine ⟨Pmix, ⟨hmix.probability, hmix⟩, ?_⟩ letI : IsProbabilityMeasure Plo := hlo.probability letI : IsProbabilityMeasure Phi := hhi.probability have hint := integral_compatibleMixture Plo Phi cE dE ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top (fun ω => ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ)) (by cases a · simp only [Bool.false_eq_true, ↓reduceIte] unfold outcome0 fun_prop · simp only [↓reduceIte] unfold outcome1 fun_prop) 1 (by intro ω cases a · simp only [Bool.false_eq_true, ↓reduceIte] rw [Real.norm_eq_abs, abs_of_nonneg (outcome0 ω).property.1] exact (outcome0 ω).property.2 · simp only [↓reduceIte] rw [Real.norm_eq_abs, abs_of_nonneg (outcome1 ω).property.1] exact (outcome1 ω).property.2) have hL := endpointFullLaw_armMean H g Prel hMass hOverlap false false a have hU := endpointFullLaw_armMean H g Prel hMass hOverlap true true a change v = ∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂Pmix rw [hint, hL, hU] dsimp [cE, dE] rw [ENNReal.toReal_ofReal hc, ENNReal.toReal_ofReal hd] simpa [smul_eq_mul] using hv.symm · ext v constructor · rintro ⟨P, hP, rfl⟩ exact compatibleLaw_ate_mem_sharpATESet H g Prel hOverlap hcomp P hP · intro hv unfold sharpATESet at hv rcases Icc_subset_segment hv with ⟨c, d, hc, hd, hcd, hv⟩ let cE : ENNReal := ENNReal.ofReal c let dE : ENNReal := ENNReal.ofReal d let Pmix := compatibleMixture cE dE Pminus Pplus have hsumE : cE + dE = 1 := by dsimp [cE, dE] rw [← ENNReal.ofReal_add hc hd, hcd] norm_num have hmix := compatibleCausalLaw_mixture H g Prel Pminus Pplus hminus hplus cE dE ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top hsumE refine ⟨Pmix, ⟨hmix.probability, hmix⟩, ?_⟩ letI : IsProbabilityMeasure Pminus := hminus.probability letI : IsProbabilityMeasure Pplus := hplus.probability have hint := integral_compatibleMixture Pminus Pplus cE dE ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top (fun ω => (outcome1 ω : ℝ) - (outcome0 ω : ℝ)) (by unfold outcome0 outcome1; fun_prop) 1 (by intro ω rw [Real.norm_eq_abs] exact abs_le.mpr ⟨by linarith [(outcome0 ω).property.2, (outcome1 ω).property.1], by linarith [(outcome1 ω).property.2, (outcome0 ω).property.1]⟩) change v = ate Pmix rw [show ate Pmix = _ from hint] change v = cE.toReal * ate Pminus + dE.toReal * ate Pplus rw [hminusAte, hplusAte] dsimp [cE, dE] rw [ENNReal.toReal_ofReal hc, ENNReal.toReal_ofReal hd] simpa [smul_eq_mul] using hv.symm · exact ⟨Pminus, hminusMem, Pplus, hplusMem, hminusAte, hplusAte⟩
CausalSmith.PartialID.UnlinkedPropensityAte.fixedReleasedLaw_sharp · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLaw.lean:15
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawAttainment 4 declarations This file isolates the measure-theoretic reconstruction step needed to combine two potential-outcome laws that share the same score marginal.

Common-marginal gluing needed for fixed-law endpoint attainment

This file isolates the measure-theoretic reconstruction step needed to combine two potential-outcome laws that share the same score marginal. The gluing is obtained by disintegrating both laws over their first coordinate and taking the conditional product of the resulting kernels.

def glueAlongFst

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ρ₀ :
Measure (α × β)
ρ₁ :
Measure (α × γ)
glueAlongFst ρ₀ ρ₁ :
Measure (α × (β × γ))
ρ₀.fst ⊗ₘ (ρ₀.condKernel ×ₖ ρ₁.condKernel)
theorem glueAlongFst_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ₀ :
Measure (α × β)
ρ₁ :
Measure (α × γ)
Proof (Lean source)
lemma glueAlongFst_isProbabilityMeasure {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [CountablyGenerated α] [StandardBorelSpace β] [Nonempty β] [StandardBorelSpace γ] [Nonempty γ] (ρ₀ : Measure (α × β)) (ρ₁ : Measure (α × γ)) [IsProbabilityMeasure ρ₀] [IsProbabilityMeasure ρ₁] : IsProbabilityMeasure (glueAlongFst ρ₀ ρ₁) := by unfold glueAlongFst infer_instance
CausalSmith.PartialID.UnlinkedPropensityAte.glueAlongFst_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawAttainment.lean:35
theorem glueAlongFst_map_left

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ₀ :
Measure (α × β)
ρ₁ :
Measure (α × γ)
(glueAlongFst ρ₀ ρ₁).map (fun p => (p.1, p.2.1)) = ρ₀
Proof (Lean source)
lemma glueAlongFst_map_left {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [CountablyGenerated α] [StandardBorelSpace β] [Nonempty β] [StandardBorelSpace γ] [Nonempty γ] (ρ₀ : Measure (α × β)) (ρ₁ : Measure (α × γ)) [IsFiniteMeasure ρ₀] [IsFiniteMeasure ρ₁] : (glueAlongFst ρ₀ ρ₁).map (fun p => (p.1, p.2.1)) = ρ₀ := by rw [glueAlongFst] change (ρ₀.fst ⊗ₘ (ρ₀.condKernel ×ₖ ρ₁.condKernel)).map (map id fst) = ρ₀ rw [← Measure.compProd_map measurable_fst] rw [← Kernel.fst_eq, Kernel.fst_prod] exact ρ₀.disintegrate ρ₀.condKernel
CausalSmith.PartialID.UnlinkedPropensityAte.glueAlongFst_map_left · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawAttainment.lean:47
theorem glueAlongFst_map_right

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ρ₀ :
Measure (α × β)
ρ₁ :
Measure (α × γ)
hfst :
ρ₀.fst = ρ₁.fst
(glueAlongFst ρ₀ ρ₁).map (fun p => (p.1, p.2.2)) = ρ₁
Proof (Lean source)
lemma glueAlongFst_map_right {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [CountablyGenerated α] [StandardBorelSpace β] [Nonempty β] [StandardBorelSpace γ] [Nonempty γ] (ρ₀ : Measure (α × β)) (ρ₁ : Measure (α × γ)) [IsFiniteMeasure ρ₀] [IsFiniteMeasure ρ₁] (hfst : ρ₀.fst = ρ₁.fst) : (glueAlongFst ρ₀ ρ₁).map (fun p => (p.1, p.2.2)) = ρ₁ := by rw [glueAlongFst] change (ρ₀.fst ⊗ₘ (ρ₀.condKernel ×ₖ ρ₁.condKernel)).map (map id snd) = ρ₁ rw [← Measure.compProd_map measurable_snd] rw [← Kernel.snd_eq, Kernel.snd_prod, hfst] exact ρ₁.disintegrate ρ₁.condKernel
CausalSmith.PartialID.UnlinkedPropensityAte.glueAlongFst_map_right · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawAttainment.lean:63
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawCellCoupling 6 declarations Assigned-cell mass identity for a compatible fixed released law.

Assigned-cell mass identity for a compatible fixed released law.

This identifies the mass used to normalize an assigned release-cell coupling with the score-induced arm-cell mass.

theorem compatible_assignedScoreLaw_eq_tilt

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hOverlap :
a :
(P.restrict {ω | arm ω = a}).map score
= H.withDensity (fun e => ofReal (armProb a e))
Proof (Lean source)
lemma compatible_assignedScoreLaw_eq_tilt {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hOverlap : Overlap ε) (a : ArmSpace) : (P.restrict {ω | arm ω = a}).map score = H.withDensity (fun e => ofReal (armProb a e)) := by letI : IsProbabilityMeasure P := hP.probability have hX : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop have hscore : Measurable (score (ε := ε) (J := J)) := by unfold score fun_prop have hf : Measurable (fun e : ScoreSpace ε => ofReal (armProb a e)) := by cases a <;> simp [armProb] <;> fun_prop calc (P.restrict {ω | arm ω = a}).map score = (assignedLatentLaw P a).map fst := by unfold assignedLatentLaw rw [Measure.map_map measurable_fst hX] rfl _ = (propensityTiltedLatentLaw P a).map fst := congrArg (fun μ : Measure (ScoreSpace ε × OutcomeSpace × OutcomeSpace) => μ.map fst) (assignedLatentLaw_eq_propensityTiltedLatentLaw P hOverlap hP.randomizedAssignment a) _ = H.withDensity (fun e => ofReal (armProb a e)) := by unfold propensityTiltedLatentLaw rw [map_fst_withDensity_of_fst _ _ hf] rw [Measure.map_map measurable_fst hX] change (P.map score).withDensity _ = _ rw [hP.scoreMarginal]
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_assignedScoreLaw_eq_tilt · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:29
theorem compatible_assignedCellWeightLaw_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hOverlap :
a :
r :
(P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map (fun ω => (armProb a (score ω))⁻¹)
= ((H.withDensity (fun e => ofReal (armProb a e))).restrict (cell g r)).map (fun e => (armProb a e)⁻¹)
Proof (Lean source)
lemma compatible_assignedCellWeightLaw_eq {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : (P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map (fun ω => (armProb a (score ω))⁻¹) = ((H.withDensity (fun e => ofReal (armProb a e))).restrict (cell g r)).map (fun e => (armProb a e)⁻¹) := by let w : ScoreSpace ε → ℝ := fun e => (armProb a e)⁻¹ have hw : Measurable w := by cases a <;> simp [w, armProb] <;> fun_prop have hscore : Measurable (score (ε := ε) (J := J)) := by unfold score fun_prop have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hP.measurableRelease measurable_const have hS : {ω : FullRow ε J | arm ω = a ∧ g (score ω) = r} = {ω | arm ω = a} ∩ score ⁻¹' cell g r := by ext ω simp [cell] have hA : MeasurableSet {ω : FullRow ε J | arm ω = a} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const have hRestrict : (P.restrict {ω | arm ω = a}).restrict (score ⁻¹' cell g r) = P.restrict {ω | arm ω = a ∧ g (score ω) = r} := by rw [Measure.restrict_restrict' hA, hS, Set.inter_comm] calc (P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map (fun ω => (armProb a (score ω))⁻¹) = ((P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map score).map w := by rw [Measure.map_map hw hscore] rfl _ = (((P.restrict {ω | arm ω = a}).map score).restrict (cell g r)).map w := by rw [Measure.restrict_map hscore hcell, hRestrict] _ = ((H.withDensity (fun e => ofReal (armProb a e))).restrict (cell g r)).map (fun e => (armProb a e)⁻¹) := by rw [compatible_assignedScoreLaw_eq_tilt H g Prel P hP hOverlap a]
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_assignedCellWeightLaw_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:65
theorem compatibleArmCellCoupling_map_snd

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
= armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq
Proof (Lean source)
lemma compatibleArmCellCoupling_map_snd {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : (compatibleArmCellCoupling H g P a r hq).map snd = armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq := by unfold compatibleArmCellCoupling armCellWeightLaw armCellScoreLaw rw [Measure.map_smul, Measure.map_map (by fun_prop) (by cases a <;> simp [armProb, outcome0, outcome1, score] <;> fun_prop), Measure.map_smul] congr 1 exact compatible_assignedCellWeightLaw_eq H g Prel P hP hOverlap a r
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleArmCellCoupling_map_snd · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:105
theorem compatibleArmCellCoupling_map_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
a :
r :
hq :
0 < armCellMass H g a r
= armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)
Proof (Lean source)
lemma compatibleArmCellCoupling_map_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : (compatibleArmCellCoupling H g P a r hq).map fst = armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) := by have hpair : Measurable (fun ω : FullRow ε J => (((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ), (armProb a (score ω))⁻¹)) := by cases a <;> simp [armProb, outcome0, outcome1, score] <;> fun_prop unfold compatibleArmCellCoupling armCellOutcomeLaw rw [Measure.map_smul, Measure.map_map (by fun_prop) hpair] letI : IsProbabilityMeasure Prel := hMass.2.1 have hTmeasure : Prel {z | z.1 = r ∧ z.2.1 = a} = ofReal (armCellMass H g a r) := by rw [← hMass.2.2.2 a r] exact (ENNReal.ofReal_toReal (measure_ne_top Prel _)).symm rw [hTmeasure] congr 1 ext B hB have hY : Measurable (fun ω : FullRow ε J => ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ)) := by cases a <;> simp [outcome0, outcome1] <;> fun_prop have hobs : Measurable (fun z : Observation J => (z.2.2 : ℝ)) := by fun_prop have hrecord : Measurable (releasedRecord (ε := ε) (J := J)) := by unfold releasedRecord label arm observed fun_prop have hT : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = a} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) change ((P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map (fun ω : FullRow ε J => ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ))) B = _ rw [Measure.map_apply hY hB, Measure.restrict_apply (hB.preimage hY)] rw [Measure.map_apply hobs hB, Measure.restrict_apply (hB.preimage hobs)] rw [← hP.releasedLaw] unfold releasedLaw rw [Measure.map_apply hrecord ((hB.preimage hobs).inter hT)] apply measure_congr filter_upwards [hP.consistency, hP.deterministicRelease] with ω hcons hlabel change ((((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∈ B ∧ arm ω = a ∧ g (score ω) = r) = ((observed ω : ℝ) ∈ B ∧ label ω = r ∧ arm ω = a)) apply propext by_cases ha : arm ω = a · rw [ha] at hcons simp [ha, hcons, hlabel, and_comm] · simp [ha]
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleArmCellCoupling_map_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:122
theorem compatible_assignedArmCell_measureReal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
a :
r :
P.real {ω | arm ω = a ∧ g (score ω) = r} = armCellMass H g a r
Proof (Lean source)
lemma compatible_assignedArmCell_measureReal {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (a : ArmSpace) (r : LabelSpace J) : P.real {ω | arm ω = a ∧ g (score ω) = r} = armCellMass H g a r := by have hrecord : Measurable (releasedRecord (ε := ε) (J := J)) := by unfold releasedRecord label arm observed fun_prop have hcell : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = a} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) rw [← hMass.2.2.2 a r, ← hP.releasedLaw] unfold releasedLaw rw [MeasureTheory.map_measureReal_apply hrecord hcell] apply measureReal_congr filter_upwards [hP.deterministicRelease] with ω hlabel change (arm ω = a ∧ g (score ω) = r) = (label ω = r ∧ arm ω = a) apply propext simp [hlabel, and_comm]
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_assignedArmCell_measureReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:176
theorem compatibleArmCellCoupling_isCoupling

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
IsCoupling (compatibleArmCellCoupling H g P a r hq) (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)
Proof (Lean source)
lemma compatibleArmCellCoupling_isCoupling {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : IsCoupling (compatibleArmCellCoupling H g P a r hq) (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) := by letI : IsProbabilityMeasure P := hP.probability let S : Set (FullRow ε J) := {ω | arm ω = a ∧ g (score ω) = r} have hSreal : P.real S = armCellMass H g a r := by simpa [S] using compatible_assignedArmCell_measureReal H g Prel P hP hMass a r have hSmeasure : P S = ofReal (armCellMass H g a r) := by rw [← hSreal] exact (ENNReal.ofReal_toReal (measure_ne_top P S)).symm have hSzero : P S ≠ 0 := by rw [hSmeasure] exact ne_of_gt (ENNReal.ofReal_pos.mpr hq) let μ : Measure (FullRow ε J) := P.restrict S letI : IsFiniteMeasure μ := inferInstance letI : NeZero μ := by constructor intro hμ have : P S = 0 := by rw [← Measure.restrict_apply_univ S, show P.restrict S = μ from rfl, hμ] simp exact hSzero this have hprob : IsProbabilityMeasure ((ofReal (armCellMass H g a r))⁻¹ • μ) := by rw [← hSmeasure, ← Measure.restrict_apply_univ S] infer_instance have hpair : Measurable (fun ω : FullRow ε J => (((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ), (armProb a (score ω))⁻¹)) := by cases a <;> simp [armProb, outcome0, outcome1, score] <;> fun_prop refine ⟨?_, ?_, ?_⟩ · unfold compatibleArmCellCoupling rw [← Measure.map_smul] change IsProbabilityMeasure (((ofReal (armCellMass H g a r))⁻¹ • μ).map _) exact @Measure.isProbabilityMeasure_map _ _ _ _ _ hprob _ hpair.aemeasurable · exact compatibleArmCellCoupling_map_fst H g Prel P hP hMass a r hq · exact compatibleArmCellCoupling_map_snd H g Prel P hP hMass hOverlap a r hq
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleArmCellCoupling_isCoupling · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCellCoupling.lean:200
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawConvexity 3 declarations Convex closure of compatible fixed released laws.

Convex closure of compatible fixed released laws.

def compatibleMixture

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
c d :
P Q :
compatibleMixture c d P Q :
c • P + d • Q
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleMixture · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawConvexity.lean:13
theorem compatibleCausalLaw_mixture

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P Q :
hP :
hQ :
c d :
hc :
c ≠ ∞
hd :
d ≠ ∞
hsum :
c + d = 1
Proof (Lean source)
lemma compatibleCausalLaw_mixture {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P Q : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hQ : CompatibleCausalLaw H g Prel Q) (c d : ENNReal) (hc : c ≠ ∞) (hd : d ≠ ∞) (hsum : c + d = 1) : CompatibleCausalLaw H g Prel (compatibleMixture c d P Q) := by letI : IsProbabilityMeasure P := hP.probability letI : IsProbabilityMeasure Q := hQ.probability have hprob : IsProbabilityMeasure (compatibleMixture c d P Q) := by rw [isProbabilityMeasure_iff] unfold compatibleMixture rw [Measure.add_apply, Measure.smul_apply, Measure.smul_apply] simp only [measure_univ, smul_eq_mul, mul_one] exact hsum refine { probability := hprob measurableRelease := hP.measurableRelease scoreMarginal := ?_ randomizedAssignment := ?_ consistency := ?_ deterministicRelease := ?_ releasedLaw := ?_ } · unfold ScoreMarginal compatibleMixture rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_smul, Measure.map_smul, hP.scoreMarginal, hQ.scoreMarginal, ← add_smul, hsum, one_smul] · intro B hB let S : Set (FullRow ε J) := {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} let T : Set (FullRow ε J) := {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} have hSintP := mixtureScore_integrable c hc P have hSintQ := mixtureScore_integrable d hd Q change (compatibleMixture c d P Q).real S = ∫ ω in T, (score ω : ℝ) ∂compatibleMixture c d P Q unfold compatibleMixture rw [mixture_real_apply c d hc hd P Q S] rw [Measure.restrict_add, integral_add_measure hSintP.integrableOn hSintQ.integrableOn, Measure.restrict_smul, Measure.restrict_smul, integral_smul_measure, integral_smul_measure] rw [hP.randomizedAssignment B hB, hQ.randomizedAssignment B hB] simp only [smul_eq_mul] rfl · unfold Consistency compatibleMixture rw [ae_add_measure_iff] exact ⟨Measure.smul_absolutelyContinuous.ae_le hP.consistency, Measure.smul_absolutelyContinuous.ae_le hQ.consistency⟩ · unfold DeterministicRelease compatibleMixture rw [ae_add_measure_iff] exact ⟨Measure.smul_absolutelyContinuous.ae_le hP.deterministicRelease, Measure.smul_absolutelyContinuous.ae_le hQ.deterministicRelease⟩ · unfold ReleasedLaw releasedLaw compatibleMixture rw [Measure.map_add _ _ (by unfold releasedRecord label arm observed fun_prop), Measure.map_smul, Measure.map_smul, show P.map releasedRecord = Prel from hP.releasedLaw, show Q.map releasedRecord = Prel from hQ.releasedLaw, ← add_smul, hsum, one_smul]
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleCausalLaw_mixture · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawConvexity.lean:48
theorem integral_compatibleMixture

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
c d :
hc :
c ≠ ∞
hd :
d ≠ ∞
f :
FullRow ε J → ℝ
hf :
K :
ℝ
hK :
∀ ω, ‖f ω‖ ≤ K
(∫ ω, f ω ∂compatibleMixture c d P Q) = c.toReal * ∫ ω, f ω ∂P + d.toReal * ∫ ω, f ω ∂Q
Proof (Lean source)
lemma integral_compatibleMixture {ε : ℝ} {J : ℕ} (P Q : Measure (FullRow ε J)) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (c d : ENNReal) (hc : c ≠ ∞) (hd : d ≠ ∞) (f : FullRow ε J → ℝ) (hf : Measurable f) (K : ℝ) (hK : ∀ ω, ‖f ω‖ ≤ K) : (∫ ω, f ω ∂compatibleMixture c d P Q) = c.toReal * ∫ ω, f ω ∂P + d.toReal * ∫ ω, f ω ∂Q := by have hPc : Integrable f (c • P) := by letI : IsFiniteMeasure (c • P) := ⟨by rw [Measure.smul_apply] exact ENNReal.mul_lt_top (lt_top_iff_ne_top.mpr hc) (measure_lt_top P univ)⟩ exact Integrable.of_bound hf.aestronglyMeasurable K (Filter.Eventually.of_forall hK) have hQd : Integrable f (d • Q) := by letI : IsFiniteMeasure (d • Q) := ⟨by rw [Measure.smul_apply] exact ENNReal.mul_lt_top (lt_top_iff_ne_top.mpr hd) (measure_lt_top Q univ)⟩ exact Integrable.of_bound hf.aestronglyMeasurable K (Filter.Eventually.of_forall hK) unfold compatibleMixture rw [integral_add_measure hPc hQd, integral_smul_measure, integral_smul_measure] simp only [smul_eq_mul]
CausalSmith.PartialID.UnlinkedPropensityAte.integral_compatibleMixture · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawConvexity.lean:110
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawCoverage 4 declarations Membership of a compatible law's ATE in the population interval.

Membership of a compatible law's ATE in the population interval.

theorem compatible_armMean_eq_sum_cellCouplings

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
hOverlap :
a :
(∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P)
= ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ p, p.1 * p.2 ∂(compatibleArmCellCoupling H g P a r hq) else 0
Proof (Lean source)
lemma compatible_armMean_eq_sum_cellCouplings {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) = ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ p, p.1 * p.2 ∂(compatibleArmCellCoupling H g P a r hq) else 0 := by letI : IsProbabilityMeasure P := hP.probability rw [potentialOutcomeMean_eq_inversePropensity P hOverlap hP.randomizedAssignment a] rw [assignedProduct_integral_eq_sum_cells P g hMass.2.2.1 hOverlap a] apply Finset.sum_congr rfl intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] exact assignedProduct_cell_eq_mass_mul_coupling H g P a r hq · simp only [hq, dif_neg] exact assignedProduct_cell_eq_zero H g Prel P hP hMass a r hq
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_armMean_eq_sum_cellCouplings · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCoverage.lean:124
theorem compatible_armMean_mem_endpoints

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hMass :
hOverlap :
a :
(∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) ∈ Icc (muLower H g Prel hMass a) (muUpper H g Prel hMass a)
Proof (Lean source)
lemma compatible_armMean_mem_endpoints {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) ∈ Icc (muLower H g Prel hMass a) (muUpper H g Prel hMass a) := by let π : ∀ r : LabelSpace J, 0 < armCellMass H g a r → Measure (ℝ × ℝ) := fun r hq => compatibleArmCellCoupling H g P a r hq apply armMean_mem_endpoints_of_cellCouplings H g Prel hMass a π · intro r hq exact compatibleArmCellCoupling_isCoupling H g Prel P hP hMass hOverlap a r hq · intro r hq exact (compatibleArmCell_moments H g Prel P hP hMass hOverlap a r hq).1 · intro r hq exact (compatibleArmCell_moments H g Prel P hP hMass hOverlap a r hq).2 · exact compatible_armMean_eq_sum_cellCouplings H g Prel P hP hMass hOverlap a
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_armMean_mem_endpoints · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCoverage.lean:201
theorem compatible_ate_mem_sharpATESet

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
P :
hP :
hOverlap :
ate P ∈ sharpATESet H g Prel (compatibleCellMasses_of_compatibleCausalLaw H g Prel P hP)
Proof (Lean source)
lemma compatible_ate_mem_sharpATESet {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (P : Measure (FullRow ε J)) (hP : CompatibleCausalLaw H g Prel P) (hOverlap : Overlap ε) : ate P ∈ sharpATESet H g Prel (compatibleCellMasses_of_compatibleCausalLaw H g Prel P hP) := by let hMass := compatibleCellMasses_of_compatibleCausalLaw H g Prel P hP letI : IsProbabilityMeasure P := hP.probability apply ate_mem_sharpATESet_of_armMean_bounds H g Prel hMass P · intro a exact (compatible_armMean_mem_endpoints H g Prel P hP hMass hOverlap a).1 · intro a exact (compatible_armMean_mem_endpoints H g Prel P hP hMass hOverlap a).2
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_ate_mem_sharpATESet · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCoverage.lean:221
theorem compatibleLaw_ate_mem_sharpATESet

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hOverlap :
hcomp :
(CompatibleLaws H g Prel).Nonempty
P :
hP :
P ∈ CompatibleLaws H g Prel
ate P ∈ sharpATESet H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp)
Proof (Lean source)
lemma compatibleLaw_ate_mem_sharpATESet {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hOverlap : Overlap ε) (hcomp : (CompatibleLaws H g Prel).Nonempty) (P : Measure (FullRow ε J)) (hP : P ∈ CompatibleLaws H g Prel) : ate P ∈ sharpATESet H g Prel (compatibleCellMasses_of_nonempty H g Prel hcomp) := by simpa using compatible_ate_mem_sharpATESet H g Prel P hP.2 hOverlap
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleLaw_ate_mem_sharpATESet · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawCoverage.lean:237
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawEndpointAssembly 21 declarations Assembly of endpoint-attaining cell laws into bounded arm laws.

Assembly of endpoint-attaining cell laws into bounded arm laws.

theorem endpointCellScoreOutcomeLaw_snd

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).snd
= armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)
Proof (Lean source)
lemma endpointCellScoreOutcomeLaw_snd {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).snd = armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) := by let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq let π : Measure (ℝ × ℝ) := if upper then Causalean.Stat.comonotoneCoupling Y W else Causalean.Stat.countermonotoneCoupling Y W have hπ : IsCoupling π Y W := by simpa [π, Y, W] using endpointCoupling_isCoupling H g Prel hMass hOverlap a r hq upper unfold Measure.snd calc (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).map snd = ((endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.2, (armProb a p.1)⁻¹))).map fst := by rw [Measure.map_map measurable_fst (by cases a <;> simp [armProb] <;> fun_prop)] rfl _ = π.map fst := by rw [endpointCellScoreOutcomeLaw_map_outcome_weight H g Prel hMass hOverlap a r hq upper] _ = Y := hπ.map_fst
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw_snd · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:14
theorem endpointCellScoreOutcomeLaw_outcome_support

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper {p | p.2 ∉ Icc (0 : ℝ) 1}
= 0
Proof (Lean source)
lemma endpointCellScoreOutcomeLaw_outcome_support {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper {p | p.2 ∉ Icc (0 : ℝ) 1} = 0 := by let M := endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper have hs : MeasurableSet ({y : ℝ | y ∉ Icc (0 : ℝ) 1}) := measurableSet_Icc.compl have hsnd : M.snd = armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) := endpointCellScoreOutcomeLaw_snd H g Prel hMass hOverlap a r hq upper have hset : {p : ScoreSpace ε × ℝ | p.2 ∉ Icc (0 : ℝ) 1} = snd ⁻¹' {y : ℝ | y ∉ Icc (0 : ℝ) 1} := rfl rw [hset, ← Measure.map_apply measurable_snd hs, show M.map snd = M.snd from rfl, hsnd] unfold armCellOutcomeLaw rw [Measure.smul_apply, Measure.map_apply (by fun_prop) hs] have hpre : (fun z : Observation J => (z.2.2 : ℝ)) ⁻¹' {y : ℝ | y ∉ Icc (0 : ℝ) 1} = ∅ := by ext z exact iff_false_intro (fun hz => hz z.2.2.property) rw [hpre] simp
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw_outcome_support · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:46
def clampOutcome

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
y :
ℝ
clampOutcome y :
⟨min 1 (max 0 y), by constructor <;> simp⟩
theorem clampOutcome_measurable

This result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma clampOutcome_measurable : Measurable clampOutcome := by unfold clampOutcome fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.clampOutcome_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:76
theorem clampOutcome_coe_of_mem

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
y :
ℝ
hy :
y ∈ Icc (0 : ℝ) 1
((clampOutcome y : OutcomeSpace) : ℝ) = y
Proof (Lean source)
lemma clampOutcome_coe_of_mem {y : ℝ} (hy : y ∈ Icc (0 : ℝ) 1) : ((clampOutcome y : OutcomeSpace) : ℝ) = y := by simp [clampOutcome, hy.1, hy.2]
CausalSmith.PartialID.UnlinkedPropensityAte.clampOutcome_coe_of_mem · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:80
def boundedEndpointCellLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper :
(endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.1, clampOutcome p.2))
CausalSmith.PartialID.UnlinkedPropensityAte.boundedEndpointCellLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:85
instance boundedEndpointCellLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance boundedEndpointCellLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : IsProbabilityMeasure (boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper) := by unfold boundedEndpointCellLaw letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : Nonempty (ScoreSpace ε) := ⟨⟨1 / 2, by constructor <;> linarith [hOverlap.1, hOverlap.2]⟩⟩ letI : IsProbabilityMeasure (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper) := endpointCellScoreOutcomeLaw_isProbabilityMeasure H g Prel hMass hOverlap a r hq upper exact Measure.isProbabilityMeasure_map (by exact (measurable_fst.prodMk (clampOutcome_measurable.comp measurable_snd)).aemeasurable)
CausalSmith.PartialID.UnlinkedPropensityAte.boundedEndpointCellLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:94
theorem boundedEndpointCellLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper).fst
= armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq
Proof (Lean source)
lemma boundedEndpointCellLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper).fst = armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq := by unfold boundedEndpointCellLaw Measure.fst rw [Measure.map_map measurable_fst (by exact measurable_fst.prodMk (clampOutcome_measurable.comp measurable_snd))] change (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).fst = _ exact endpointCellScoreOutcomeLaw_fst H g Prel hMass hOverlap a r hq upper
CausalSmith.PartialID.UnlinkedPropensityAte.boundedEndpointCellLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:114
theorem boundedEndpointCellLaw_map_real_outcome

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.2 : ℝ))
= armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)
Proof (Lean source)
lemma boundedEndpointCellLaw_map_real_outcome {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.2 : ℝ)) = armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) := by let M := endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper have hsupport : ∀ᵐ p ∂M, p.2 ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] exact endpointCellScoreOutcomeLaw_outcome_support H g Prel hMass hOverlap a r hq upper unfold boundedEndpointCellLaw change (M.map (fun p => (p.1, clampOutcome p.2))).map (fun p => (p.2 : ℝ)) = _ have hb : Measurable (fun p : ScoreSpace ε × ℝ => (p.1, clampOutcome p.2)) := measurable_fst.prodMk (clampOutcome_measurable.comp measurable_snd) have hc : Measurable (fun p : ScoreSpace ε × OutcomeSpace => (p.2 : ℝ)) := by fun_prop rw [Measure.map_map hc hb] calc M.map ((fun p : ScoreSpace ε × OutcomeSpace => (p.2 : ℝ)) ∘ (fun p : ScoreSpace ε × ℝ => (p.1, clampOutcome p.2))) = M.map snd := by apply Measure.map_congr filter_upwards [hsupport] with p hp exact clampOutcome_coe_of_mem hp _ = _ := endpointCellScoreOutcomeLaw_snd H g Prel hMass hOverlap a r hq upper
CausalSmith.PartialID.UnlinkedPropensityAte.boundedEndpointCellLaw_map_real_outcome · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:128
def endpointAssignedArmLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
endpointAssignedArmLaw H g Prel hMass hOverlap a upper :
Measure.sum fun r : LabelSpace J
=> if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignedArmLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:162
theorem endpointAssignedCell_realOutcome

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
r :
(if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0).map (fun p => (p.2 : ℝ))
= (Prel.restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => (z.2.2 : ℝ))
Proof (Lean source)
lemma endpointAssignedCell_realOutcome {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) (r : LabelSpace J) : (if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0).map (fun p => (p.2 : ℝ)) = (Prel.restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => (z.2.2 : ℝ)) := by let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a} letI : IsProbabilityMeasure Prel := hMass.2.1 split · rename_i hq rw [Measure.map_smul, boundedEndpointCellLaw_map_real_outcome H g Prel hMass hOverlap a r hq upper] unfold armCellOutcomeLaw rw [smul_smul] have hC : Prel C = ofReal (armCellMass H g a r) := by calc Prel C = ofReal (Prel.real C) := (ENNReal.ofReal_toReal (measure_ne_top Prel C)).symm _ = ofReal (armCellMass H g a r) := by rw [hMass.2.2.2 a r] change (ofReal (armCellMass H g a r) * (Prel C)⁻¹) • ((Prel.restrict C).map (fun z => (z.2.2 : ℝ))) = _ rw [hC, ENNReal.mul_inv_cancel (ne_of_gt (ENNReal.ofReal_pos.mpr hq)) ENNReal.ofReal_ne_top, one_smul] · rename_i hq rw [Measure.map_zero] have hnonneg : 0 ≤ armCellMass H g a r := by rw [← hMass.2.2.2 a r] exact measureReal_nonneg have hqzero : armCellMass H g a r = 0 := le_antisymm (le_of_not_gt hq) hnonneg have hCreal : Prel.real C = 0 := by rw [hMass.2.2.2 a r, hqzero] have hCzero : Prel C = 0 := (measureReal_eq_zero_iff).mp hCreal rw [Measure.restrict_zero_set hCzero, Measure.map_zero]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignedCell_realOutcome · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:235
theorem endpointAssignedArmLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
(endpointAssignedArmLaw H g Prel hMass hOverlap a upper).fst
= H.withDensity (fun e => ofReal (armProb a e))
Proof (Lean source)
lemma endpointAssignedArmLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : (endpointAssignedArmLaw H g Prel hMass hOverlap a upper).fst = H.withDensity (fun e => ofReal (armProb a e)) := by unfold endpointAssignedArmLaw Measure.fst rw [Measure.map_sum (by fun_prop)] simp_rw [endpointAssignedCell_fst H g Prel hMass hOverlap a upper] let μ := H.withDensity (fun e => ofReal (armProb a e)) have hcell : ∀ r : LabelSpace J, MeasurableSet (cell g r) := by intro r exact measurableSet_eq_fun hMass.2.2.1 measurable_const have hdisj : Pairwise (fun r s : LabelSpace J => Disjoint (cell g r) (cell g s)) := by intro r s hrs apply Set.disjoint_left.mpr intro e her hes exact hrs (her.symm.trans hes) have hunion : (⋃ r : LabelSpace J, cell g r) = univ := by ext e simp [cell] rw [← Measure.restrict_iUnion hdisj hcell, hunion, Measure.restrict_univ]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignedArmLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:278
def endpointArmPotentialLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
endpointArmPotentialLaw H g Prel hMass hOverlap a upper :
(endpointAssignedArmLaw H g Prel hMass hOverlap a upper).withDensity (fun p => (ofReal (armProb a p.1))⁻¹)
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:313
theorem endpointArmPotentialLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
(endpointArmPotentialLaw H g Prel hMass hOverlap a upper).fst = H
Proof (Lean source)
lemma endpointArmPotentialLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : (endpointArmPotentialLaw H g Prel hMass hOverlap a upper).fst = H := by let f : ScoreSpace ε → ENNReal := fun e => ofReal (armProb a e) have hf : Measurable f := by cases a <;> simp [f, armProb] <;> fun_prop have hf0 : ∀ e : ScoreSpace ε, f e ≠ 0 := by intro e apply ne_of_gt rw [ENNReal.ofReal_pos] rcases e.property with ⟨he0, he1⟩ cases a <;> simp [f, armProb] <;> linarith [hOverlap.1, hOverlap.2] have hft : ∀ e : ScoreSpace ε, f e ≠ ∞ := fun _ => ENNReal.ofReal_ne_top unfold endpointArmPotentialLaw Measure.fst change ((endpointAssignedArmLaw H g Prel hMass hOverlap a upper).withDensity (fun p => (f p.1)⁻¹)).map fst = H rw [map_withDensity_of_fst _ (fun e => (f e)⁻¹) hf.fun_inv] change ((endpointAssignedArmLaw H g Prel hMass hOverlap a upper).fst).withDensity (fun e => (f e)⁻¹) = H rw [endpointAssignedArmLaw_fst H g Prel hMass hOverlap a upper] change (H.withDensity f).withDensity (fun e => (f e)⁻¹) = H exact withDensity_inv_same hf (Filter.Eventually.of_forall hf0) (Filter.Eventually.of_forall hft)
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:322
instance endpointArmPotentialLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance endpointArmPotentialLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : IsProbabilityMeasure (endpointArmPotentialLaw H g Prel hMass hOverlap a upper) := by rw [isProbabilityMeasure_iff] have hfst := endpointArmPotentialLaw_fst H g Prel hMass hOverlap a upper calc endpointArmPotentialLaw H g Prel hMass hOverlap a upper univ = (endpointArmPotentialLaw H g Prel hMass hOverlap a upper).fst univ := by unfold Measure.fst rw [Measure.map_apply measurable_fst MeasurableSet.univ] simp _ = H univ := congrArg (fun μ : Measure (ScoreSpace ε) => μ univ) hfst _ = 1 := isProbabilityMeasure_iff.mp hMass.1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:349
theorem endpointArmPotentialLaw_retilt

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
(endpointArmPotentialLaw H g Prel hMass hOverlap a upper).withDensity (fun p => ofReal (armProb a p.1))
= endpointAssignedArmLaw H g Prel hMass hOverlap a upper
Proof (Lean source)
lemma endpointArmPotentialLaw_retilt {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : (endpointArmPotentialLaw H g Prel hMass hOverlap a upper).withDensity (fun p => ofReal (armProb a p.1)) = endpointAssignedArmLaw H g Prel hMass hOverlap a upper := by let f : ScoreSpace ε × OutcomeSpace → ENNReal := fun p => ofReal (armProb a p.1) have hf : Measurable f := by cases a <;> simp [f, armProb] <;> fun_prop have hf0 : ∀ p : ScoreSpace ε × OutcomeSpace, f p ≠ 0 := by intro p apply ne_of_gt rw [ENNReal.ofReal_pos] rcases p.1.property with ⟨he0, he1⟩ cases a <;> simp [f, armProb] <;> linarith [hOverlap.1, hOverlap.2] unfold endpointArmPotentialLaw change ((endpointAssignedArmLaw H g Prel hMass hOverlap a upper).withDensity (fun p => (f p)⁻¹)).withDensity f = _ rw [← withDensity_mul _ hf.fun_inv hf] have hfun : (fun p => (f p)⁻¹) * f = 1 := by funext p exact ENNReal.inv_mul_cancel (hf0 p) ENNReal.ofReal_ne_top rw [hfun, withDensity_one]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialLaw_retilt · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:367
def endpointLatentLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
endpointLatentLaw H g Prel hMass hOverlap upper0 upper1 :
glueAlongFst (endpointArmPotentialLaw H g Prel hMass hOverlap false upper0) (endpointArmPotentialLaw H g Prel hMass hOverlap true upper1)
instance endpointLatentLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance endpointLatentLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : IsProbabilityMeasure (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1) := by unfold endpointLatentLaw letI : IsProbabilityMeasure (endpointArmPotentialLaw H g Prel hMass hOverlap false upper0) := endpointArmPotentialLaw_isProbabilityMeasure H g Prel hMass hOverlap false upper0 letI : IsProbabilityMeasure (endpointArmPotentialLaw H g Prel hMass hOverlap true upper1) := endpointArmPotentialLaw_isProbabilityMeasure H g Prel hMass hOverlap true upper1 exact glueAlongFst_isProbabilityMeasure _ _
CausalSmith.PartialID.UnlinkedPropensityAte.endpointLatentLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:403
theorem endpointLatentLaw_map_control

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map (fun p => (p.1, p.2.1))
= endpointArmPotentialLaw H g Prel hMass hOverlap false upper0
Proof (Lean source)
lemma endpointLatentLaw_map_control {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map (fun p => (p.1, p.2.1)) = endpointArmPotentialLaw H g Prel hMass hOverlap false upper0 := by unfold endpointLatentLaw exact glueAlongFst_map_left _ _
CausalSmith.PartialID.UnlinkedPropensityAte.endpointLatentLaw_map_control · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:420
theorem endpointLatentLaw_map_treated

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map (fun p => (p.1, p.2.2))
= endpointArmPotentialLaw H g Prel hMass hOverlap true upper1
Proof (Lean source)
lemma endpointLatentLaw_map_treated {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map (fun p => (p.1, p.2.2)) = endpointArmPotentialLaw H g Prel hMass hOverlap true upper1 := by unfold endpointLatentLaw apply glueAlongFst_map_right rw [endpointArmPotentialLaw_fst, endpointArmPotentialLaw_fst]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointLatentLaw_map_treated · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:430
theorem endpointLatentLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).fst = H
Proof (Lean source)
lemma endpointLatentLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).fst = H := by unfold Measure.fst calc (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map fst = ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).map (fun p => (p.1, p.2.1))).map fst := by rw [Measure.map_map measurable_fst (by fun_prop)] rfl _ = (endpointArmPotentialLaw H g Prel hMass hOverlap false upper0).map fst := by rw [endpointLatentLaw_map_control] _ = H := by change (endpointArmPotentialLaw H g Prel hMass hOverlap false upper0).fst = H exact endpointArmPotentialLaw_fst H g Prel hMass hOverlap false upper0
CausalSmith.PartialID.UnlinkedPropensityAte.endpointLatentLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointAssembly.lean:441
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawEndpointConstruction 10 declarations Reconstruction leaves for fixed-law endpoint attainment.

Reconstruction leaves for fixed-law endpoint attainment.

def liftTransformCoupling

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
G :
w :
α → γ
hw :
π :
Measure (β × γ)
liftTransformCoupling G w hw π :
Measure (α × β)
(glueAlongFst (π.map swap) (G.map (fun x => (w x, x)))).map (fun p => (p.2.2, p.2.1))
CausalSmith.PartialID.UnlinkedPropensityAte.liftTransformCoupling · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:16
instance liftTransformCoupling_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance liftTransformCoupling_isProbabilityMeasure {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [StandardBorelSpace α] [Nonempty α] [StandardBorelSpace β] [Nonempty β] [CountablyGenerated γ] (G : Measure α) (w : α → γ) (hw : Measurable w) (π : Measure (β × γ)) [IsProbabilityMeasure G] [IsProbabilityMeasure π] : IsProbabilityMeasure (liftTransformCoupling G w hw π) := by unfold liftTransformCoupling letI : IsProbabilityMeasure (π.map swap) := Measure.isProbabilityMeasure_map (by fun_prop) letI : IsProbabilityMeasure (G.map (fun x => (w x, x))) := Measure.isProbabilityMeasure_map (by fun_prop) letI : IsProbabilityMeasure (glueAlongFst (π.map swap) (G.map (fun x => (w x, x)))) := glueAlongFst_isProbabilityMeasure _ _ exact Measure.isProbabilityMeasure_map (by fun_prop)
CausalSmith.PartialID.UnlinkedPropensityAte.liftTransformCoupling_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:28
theorem liftTransformCoupling_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
G :
w :
α → γ
hw :
π :
Measure (β × γ)
htransform :
π.map snd = G.map w
(liftTransformCoupling G w hw π).fst = G
Proof (Lean source)
lemma liftTransformCoupling_fst {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [StandardBorelSpace α] [Nonempty α] [StandardBorelSpace β] [Nonempty β] [CountablyGenerated γ] (G : Measure α) (w : α → γ) (hw : Measurable w) (π : Measure (β × γ)) [IsProbabilityMeasure G] [IsProbabilityMeasure π] (htransform : π.map snd = G.map w) : (liftTransformCoupling G w hw π).fst = G := by let ρ0 : Measure (γ × β) := π.map Prod.swap let ρ1 : Measure (γ × α) := G.map (fun x => (w x, x)) have hfst : ρ0.fst = ρ1.fst := by dsimp [ρ0, ρ1] rw [reversedCoupling_fst, transformGraph_fst G w hw, htransform] unfold liftTransformCoupling Measure.fst calc (Measure.map (fun p => (p.2.2, p.2.1)) (glueAlongFst ρ0 ρ1)).map fst = ((glueAlongFst ρ0 ρ1).map (fun p => (p.1, p.2.2))).map snd := by rw [Measure.map_map measurable_fst (by fun_prop), Measure.map_map measurable_snd (by fun_prop)] rfl _ = ρ1.map snd := by rw [glueAlongFst_map_right ρ0 ρ1 hfst] _ = G := by dsimp [ρ1] rw [Measure.map_map measurable_snd (by fun_prop)] change Measure.map id G = G exact Measure.map_id
CausalSmith.PartialID.UnlinkedPropensityAte.liftTransformCoupling_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:65
theorem liftTransformCoupling_map_outcome_transform

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
G :
w :
α → γ
hw :
π :
Measure (β × γ)
htransform :
π.map snd = G.map w
(liftTransformCoupling G w hw π).map (fun p => (p.2, w p.1)) = π
Proof (Lean source)
lemma liftTransformCoupling_map_outcome_transform {α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] [StandardBorelSpace α] [Nonempty α] [StandardBorelSpace β] [Nonempty β] [CountablyGenerated γ] [MeasurableEq γ] (G : Measure α) (w : α → γ) (hw : Measurable w) (π : Measure (β × γ)) [IsProbabilityMeasure G] [IsProbabilityMeasure π] (htransform : π.map snd = G.map w) : (liftTransformCoupling G w hw π).map (fun p => (p.2, w p.1)) = π := by let ρ0 : Measure (γ × β) := π.map Prod.swap let ρ1 : Measure (γ × α) := G.map (fun x => (w x, x)) let L : Measure (γ × (β × α)) := glueAlongFst ρ0 ρ1 have hfst : ρ0.fst = ρ1.fst := by dsimp [ρ0, ρ1] rw [reversedCoupling_fst, transformGraph_fst G w hw, htransform] have hright : L.map (fun p => (p.1, p.2.2)) = ρ1 := by exact glueAlongFst_map_right ρ0 ρ1 hfst let S : Set (γ × α) := {q | q.1 = w q.2} have hS : MeasurableSet S := measurableSet_eq_fun measurable_fst (hw.comp measurable_snd) have hSc : MeasurableSet {q : γ × α | q ∉ S} := hS.compl have hgraphMap : Measurable (fun x : α => (w x, x)) := by fun_prop have hrightMap : Measurable (fun p : γ × (β × α) => (p.1, p.2.2)) := by fun_prop have hgraphρ1 : ∀ᵐ q ∂ρ1, q ∈ S := by rw [ae_iff] dsimp [ρ1] rw [Measure.map_apply hgraphMap hSc] have hpre : (fun x : α => (w x, x)) ⁻¹' {q | q ∉ S} = ∅ := by ext x simp [S] rw [hpre, measure_empty] have hgraphLS : ∀ᵐ p ∂L, (p.1, p.2.2) ∈ S := by rw [← hright] at hgraphρ1 rw [ae_iff] at hgraphρ1 ⊢ rw [Measure.map_apply hrightMap hSc] at hgraphρ1 exact hgraphρ1 have hgraphL : ∀ᵐ p ∂L, p.1 = w p.2.2 := by filter_upwards [hgraphLS] with p hp exact hp have hleft : L.map (fun p => (p.1, p.2.1)) = ρ0 := glueAlongFst_map_left ρ0 ρ1 unfold liftTransformCoupling rw [Measure.map_map (by fun_prop) (by fun_prop)] calc L.map ((fun q : α × β => (q.2, w q.1)) ∘ (fun p : γ × (β × α) => (p.2.2, p.2.1))) = L.map (fun p => (p.2.1, p.1)) := by apply Measure.map_congr filter_upwards [hgraphL] with p hp simp only [Function.comp_apply] rw [hp] _ = (L.map (fun p => (p.1, p.2.1))).map Prod.swap := by rw [Measure.map_map (by fun_prop) (by fun_prop)] rfl _ = ρ0.map Prod.swap := by rw [hleft] _ = π := by dsimp [ρ0] rw [Measure.map_map (by fun_prop) (by fun_prop)] change Measure.map id π = π exact Measure.map_id
CausalSmith.PartialID.UnlinkedPropensityAte.liftTransformCoupling_map_outcome_transform · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:97
theorem armCellScoreLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
Proof (Lean source)
lemma armCellScoreLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) : IsProbabilityMeasure (armCellScoreLaw H inferInstance g hg a r hq) := by have hInt : Integrable (armProb a : ScoreSpace ε → ℝ) H := by apply Integrable.of_bound (by cases a · change AEStronglyMeasurable (fun e : ScoreSpace ε => 1 - (e : ℝ)) H fun_prop · change AEStronglyMeasurable (fun e : ScoreSpace ε => (e : ℝ)) H fun_prop) 1 filter_upwards [] with e rcases e.property with ⟨he0, he1⟩ have hzero : 0 ≤ (e : ℝ) := le_trans hOverlap.1.le he0 have hone : (e : ℝ) ≤ 1 := by linarith [he1, hOverlap.1] cases a · change |1 - (e : ℝ)| ≤ 1 rw [abs_of_nonneg (by linarith)] linarith · change |(e : ℝ)| ≤ 1 rw [abs_of_nonneg hzero] exact hone letI : IsFiniteMeasure (H.withDensity (fun e => ofReal (armProb a e))) := isFiniteMeasure_withDensity_ofReal hInt.hasFiniteIntegral rw [isProbabilityMeasure_iff] unfold armCellScoreLaw rw [Measure.smul_apply, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter, smul_eq_mul] have hfinite : (H.withDensity (fun e => ofReal (armProb a e))) (cell g r) ≠ ∞ := measure_ne_top _ _ have hmeasure : (H.withDensity (fun e => ofReal (armProb a e))) (cell g r) = ofReal (armCellMass H g a r) := by rw [← propensityTilt_real_cell H g hg hOverlap a r] exact (ENNReal.ofReal_toReal hfinite).symm rw [hmeasure, ENNReal.inv_mul_cancel] · exact ne_of_gt (ENNReal.ofReal_pos.mpr hq) · exact ENNReal.ofReal_ne_top
CausalSmith.PartialID.UnlinkedPropensityAte.armCellScoreLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:161
def endpointCellScoreOutcomeLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper :
Measure (ScoreSpace ε × ℝ)
by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : Nonempty (ScoreSpace ε) := ⟨⟨1 / 2, by constructor <;> linarith [hOverlap.1, hOverlap.2]⟩⟩ let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let G := armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) let π : Measure (ℝ × ℝ) := if upper then Causalean.Stat.comonotoneCoupling Y W else Causalean.Stat.countermonotoneCoupling Y W letI : IsProbabilityMeasure π := by dsimp [π] split_ifs · exact (isCoupling_comonotoneCoupling Y W).isProbabilityMeasure · exact (isCoupling_countermonotoneCoupling Y W).isProbabilityMeasure exact liftTransformCoupling G (fun e => (armProb a e)⁻¹) (by cases a <;> simp [armProb] <;> fun_prop) π
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:205
instance endpointCellScoreOutcomeLaw_isProbabilityMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
instance endpointCellScoreOutcomeLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : IsProbabilityMeasure (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper) := by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : Nonempty (ScoreSpace ε) := ⟨⟨1 / 2, by constructor <;> linarith [hOverlap.1, hOverlap.2]⟩⟩ let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let G := armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq let π : Measure (ℝ × ℝ) := if upper then Causalean.Stat.comonotoneCoupling Y W else Causalean.Stat.countermonotoneCoupling Y W letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) letI : IsProbabilityMeasure π := by dsimp [π] split_ifs · exact (isCoupling_comonotoneCoupling Y W).isProbabilityMeasure · exact (isCoupling_countermonotoneCoupling Y W).isProbabilityMeasure have hw : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by cases a <;> simp [armProb] <;> fun_prop change IsProbabilityMeasure (liftTransformCoupling G (fun e => (armProb a e)⁻¹) hw π) infer_instance
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:239
theorem endpointCoupling_isCoupling

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
Y :
armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)
W :
armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq
IsCoupling (if upper then comonotoneCoupling Y W else countermonotoneCoupling Y W) Y W
Proof (Lean source)
lemma endpointCoupling_isCoupling {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq IsCoupling (if upper then comonotoneCoupling Y W else countermonotoneCoupling Y W) Y W := by dsimp letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : IsProbabilityMeasure (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure (armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq) := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) := by unfold armCellWeightLaw exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) cases upper · exact isCoupling_countermonotoneCoupling _ _ · exact isCoupling_comonotoneCoupling _ _
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCoupling_isCoupling · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:277
theorem endpointCellScoreOutcomeLaw_fst

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).fst
= armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq
Proof (Lean source)
lemma endpointCellScoreOutcomeLaw_fst {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).fst = armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq := by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : Nonempty (ScoreSpace ε) := ⟨⟨1 / 2, by constructor <;> linarith [hOverlap.1, hOverlap.2]⟩⟩ let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let G := armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq let π : Measure (ℝ × ℝ) := if upper then Causalean.Stat.comonotoneCoupling Y W else Causalean.Stat.countermonotoneCoupling Y W letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) have hπ : IsCoupling π Y W := by simpa [π, Y, W] using endpointCoupling_isCoupling H g Prel hMass hOverlap a r hq upper letI : IsProbabilityMeasure π := hπ.isProbabilityMeasure have hw : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by cases a <;> simp [armProb] <;> fun_prop have htransform : π.map snd = G.map (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by rw [hπ.map_snd] rfl change (liftTransformCoupling G (fun e : ScoreSpace ε => (armProb a e)⁻¹) hw π).fst = G exact liftTransformCoupling_fst G _ hw π htransform
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw_fst · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:309
theorem endpointCellScoreOutcomeLaw_map_outcome_weight

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.2, (armProb a p.1)⁻¹))
= (if upper then comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq))
Proof (Lean source)
lemma endpointCellScoreOutcomeLaw_map_outcome_weight {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper).map (fun p => (p.2, (armProb a p.1)⁻¹)) = (if upper then Causalean.Stat.comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else Causalean.Stat.countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) := by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : Nonempty (ScoreSpace ε) := ⟨⟨1 / 2, by constructor <;> linarith [hOverlap.1, hOverlap.2]⟩⟩ let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let G := armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq let π : Measure (ℝ × ℝ) := if upper then Causalean.Stat.comonotoneCoupling Y W else Causalean.Stat.countermonotoneCoupling Y W letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure G := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) have hπ : IsCoupling π Y W := by simpa [π, Y, W] using endpointCoupling_isCoupling H g Prel hMass hOverlap a r hq upper letI : IsProbabilityMeasure π := hπ.isProbabilityMeasure have hw : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by cases a <;> simp [armProb] <;> fun_prop have htransform : π.map snd = G.map (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by rw [hπ.map_snd] rfl change (liftTransformCoupling G (fun e : ScoreSpace ε => (armProb a e)⁻¹) hw π).map (fun p => (p.2, (armProb a p.1)⁻¹)) = π exact liftTransformCoupling_map_outcome_transform G _ hw π htransform
CausalSmith.PartialID.UnlinkedPropensityAte.endpointCellScoreOutcomeLaw_map_outcome_weight · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointConstruction.lean:351
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawEndpointFullRow 19 declarations Full-row realization of the fixed-law endpoint constructions.

Full-row realization of the fixed-law endpoint constructions.

def endpointFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
endpointFullLaw H g Prel hMass hOverlap upper0 upper1 :
((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)).map (reconstructedFullRow g false)
+ ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)).map (reconstructedFullRow g true)
theorem endpointAssignmentMeasures_sum

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)
+ (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)
= endpointLatentLaw H g Prel hMass hOverlap upper0 upper1
Proof (Lean source)
lemma endpointAssignmentMeasures_sum {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false) + (endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true) = endpointLatentLaw H g Prel hMass hOverlap upper0 upper1 := by rw [← withDensity_add_left (endpointAssignmentDensity_measurable false)] have hfun : reconstructedAssignmentDensity false + reconstructedAssignmentDensity true = (1 : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) → ENNReal) := by funext p exact endpointAssignmentDensity_sum hOverlap p rw [hfun, withDensity_one]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignmentMeasures_sum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:49
theorem endpointAssignedPotentialLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
a :
((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity a)).map (fun p => (p.1, if a then p.2.2 else p.2.1))
= endpointAssignedArmLaw H g Prel hMass hOverlap a (if a then upper1 else upper0)
Proof (Lean source)
lemma endpointAssignedPotentialLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) (a : ArmSpace) : ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity a)).map (fun p => (p.1, if a then p.2.2 else p.2.1)) = endpointAssignedArmLaw H g Prel hMass hOverlap a (if a then upper1 else upper0) := by cases a · simp only [Bool.false_eq_true, ↓reduceIte] change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity ((fun q : ScoreSpace ε × OutcomeSpace => ofReal (1 - (q.1 : ℝ))) ∘ (fun p => (p.1, p.2.1)))).map (fun p => (p.1, p.2.1)) = _ rw [endpoint_map_withDensity_of_comp _ _ (by fun_prop) _ (by fun_prop), endpointLatentLaw_map_control H g Prel hMass hOverlap upper0 upper1] simpa [armProb] using endpointArmPotentialLaw_retilt H g Prel hMass hOverlap false upper0 · simp only [↓reduceIte] change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity ((fun q : ScoreSpace ε × OutcomeSpace => ofReal (q.1 : ℝ)) ∘ (fun p => (p.1, p.2.2)))).map (fun p => (p.1, p.2.2)) = _ rw [endpoint_map_withDensity_of_comp _ _ (by fun_prop) _ (by fun_prop), endpointLatentLaw_map_treated H g Prel hMass hOverlap upper0 upper1] simpa [armProb] using endpointArmPotentialLaw_retilt H g Prel hMass hOverlap true upper1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignedPotentialLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:78
theorem endpointFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
IsProbabilityMeasure (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
Proof (Lean source)
lemma endpointFullLaw_isProbabilityMeasure {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : IsProbabilityMeasure (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := by rw [isProbabilityMeasure_iff] unfold endpointFullLaw rw [Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 false) MeasurableSet.univ, Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 true) MeasurableSet.univ] simp only [preimage_univ] rw [← Measure.add_apply, endpointAssignmentMeasures_sum H g Prel hMass hOverlap upper0 upper1] exact isProbabilityMeasure_iff.mp inferInstance
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:107
theorem endpointFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
ScoreMarginal (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) H
Proof (Lean source)
lemma endpointFullLaw_scoreMarginal {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : ScoreMarginal (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) H := by unfold ScoreMarginal endpointFullLaw rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hMass.2.2.1 false), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hMass.2.2.1 true)] change Measure.map fst ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)) + Measure.map fst ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)) = H rw [← Measure.map_add _ _ measurable_fst, endpointAssignmentMeasures_sum H g Prel hMass hOverlap upper0 upper1] exact endpointLatentLaw_fst H g Prel hMass hOverlap upper0 upper1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:125
theorem endpointFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
Consistency (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
Proof (Lean source)
lemma endpointFullLaw_consistency {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : Consistency (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := by unfold Consistency endpointFullLaw rw [ae_add_measure_iff] constructor · rw [ae_map_iff (reconstructedFullRow_measurable g hMass.2.2.1 false).aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with p rfl · rw [ae_map_iff (reconstructedFullRow_measurable g hMass.2.2.1 true).aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε J | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with p rfl
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:146
theorem endpointFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
DeterministicRelease g (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
Proof (Lean source)
lemma endpointFullLaw_deterministicRelease {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : DeterministicRelease g (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := by unfold DeterministicRelease endpointFullLaw rw [ae_add_measure_iff] constructor · rw [ae_map_iff (reconstructedFullRow_measurable g hMass.2.2.1 false).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hMass.2.2.1.comp (by unfold score; fun_prop)))] filter_upwards [] with p rfl · rw [ae_map_iff (reconstructedFullRow_measurable g hMass.2.2.1 true).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hMass.2.2.1.comp (by unfold score; fun_prop)))] filter_upwards [] with p rfl
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:175
theorem endpointFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
RandomizedAssignment (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
Proof (Lean source)
lemma endpointFullLaw_randomizedAssignment {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : RandomizedAssignment (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := by intro B hB let L := endpointLatentLaw H g Prel hMass hOverlap upper0 upper1 let M₀ := L.withDensity (reconstructedAssignmentDensity false) let M₁ := L.withDensity (reconstructedAssignmentDensity true) let D : Set (ScoreSpace ε × (OutcomeSpace × OutcomeSpace)) := {p | (p.1, p.2.1, p.2.2) ∈ B} have hD : MeasurableSet D := hB.preimage (by fun_prop) let S : Set (FullRow ε J) := {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} let T : Set (FullRow ε J) := {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} have hS : MeasurableSet S := (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage (by unfold score outcome0 outcome1; fun_prop)) have hT : MeasurableSet T := hB.preimage (by unfold score outcome0 outcome1; fun_prop) have hpre0S : reconstructedFullRow g false ⁻¹' S = ∅ := by ext p simp [S, reconstructedFullRow, arm] have hpre1S : reconstructedFullRow g true ⁻¹' S = D := by ext p simp [S, D, reconstructedFullRow, arm, score, outcome0, outcome1] have hpre0T : reconstructedFullRow g false ⁻¹' T = D := by ext p simp [T, D, reconstructedFullRow, score, outcome0, outcome1] have hpre1T : reconstructedFullRow g true ⁻¹' T = D := by ext p simp [T, D, reconstructedFullRow, score, outcome0, outcome1] letI : IsFiniteMeasure M₀ := endpointComponent_finite H g Prel hMass hOverlap upper0 upper1 false letI : IsFiniteMeasure M₁ := endpointComponent_finite H g Prel hMass hOverlap upper0 upper1 true have hmap0 : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 false) MeasurableSet.univ] simpa using measure_lt_top M₀ Set.univ ⟩ have hmap1 : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 true) MeasurableSet.univ] simpa using measure_lt_top M₁ Set.univ ⟩ change (endpointFullLaw H g Prel hMass hOverlap upper0 upper1).real S = ∫ ω in T, (score ω : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1 have hleft : (endpointFullLaw H g Prel hMass hOverlap upper0 upper1).real S = ∫ p in D, (p.1 : ℝ) ∂L := by unfold endpointFullLaw rw [Measure.real_def, Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 false) hS, Measure.map_apply (reconstructedFullRow_measurable g hMass.2.2.1 true) hS, hpre0S, hpre1S, measure_empty, zero_add] change M₁.real D = _ exact endpointAssignmentTrue_real H g Prel hMass hOverlap upper0 upper1 D hD rw [hleft] unfold endpointFullLaw letI : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := hmap0 letI : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := hmap1 rw [Measure.restrict_add, integral_add_measure (endpointFullScore_integrable_finite _).integrableOn (endpointFullScore_integrable_finite _).integrableOn, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hMass.2.2.1 false).aemeasurable, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hMass.2.2.1 true).aemeasurable, hpre0T, hpre1T] change (∫ p in D, (p.1 : ℝ) ∂L) = (∫ p in D, (p.1 : ℝ) ∂M₀) + (∫ p in D, (p.1 : ℝ) ∂M₁) rw [← integral_add_measure (endpointLatentScore_integrable_finite M₀).integrableOn (endpointLatentScore_integrable_finite M₁).integrableOn] rw [← Measure.restrict_add, endpointAssignmentMeasures_sum H g Prel hMass hOverlap upper0 upper1]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:293
def endpointObservationReal

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
z :
endpointObservationReal z :
LabelSpace J × (ArmSpace × ℝ)
(z.1, z.2.1, (z.2.2 : ℝ))
CausalSmith.PartialID.UnlinkedPropensityAte.endpointObservationReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:371
theorem endpointAssignedArmLaw_releaseReal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
(endpointAssignedArmLaw H g Prel hMass hOverlap a upper).map (fun p => (g p.1, a, (p.2 : ℝ)))
= (Prel.restrict {z | z.2.1 = a}).map endpointObservationReal
Proof (Lean source)
lemma endpointAssignedArmLaw_releaseReal {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : (endpointAssignedArmLaw H g Prel hMass hOverlap a upper).map (fun p => (g p.1, a, (p.2 : ℝ))) = (Prel.restrict {z | z.2.1 = a}).map endpointObservationReal := by let C : LabelSpace J → Set (Observation J) := fun r => {z | z.1 = r ∧ z.2.1 = a} let A : Set (Observation J) := {z | z.2.1 = a} have hC : ∀ r, MeasurableSet (C r) := by intro r exact (measurableSet_eq_fun (by fun_prop) measurable_const).inter (measurableSet_eq_fun (by fun_prop) measurable_const) have hdisj : Pairwise (fun r s => Disjoint (C r) (C s)) := by intro r s hrs apply Set.disjoint_left.mpr intro z hzr hzs exact hrs (hzr.1.symm.trans hzs.1) have hunion : (⋃ r, C r) = A := by ext z simp [C, A] have hpartition : Measure.sum (fun r => Prel.restrict (C r)) = Prel.restrict A := by rw [← Measure.restrict_iUnion hdisj hC, hunion] let f : ScoreSpace ε × OutcomeSpace → LabelSpace J × (ArmSpace × ℝ) := fun p => (g p.1, a, (p.2 : ℝ)) have hf : Measurable f := by have hg : Measurable g := hMass.2.2.1 dsimp only [f] fun_prop unfold endpointAssignedArmLaw change (Measure.sum fun r : LabelSpace J => if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0).map f = _ rw [Measure.map_sum hf.aemeasurable] have hterms : (fun r : LabelSpace J => (if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0).map f) = (fun r => (Prel.restrict (C r)).map endpointObservationReal) := by funext r exact endpointAssignedCell_releaseReal H g Prel hMass hOverlap a upper r rw [hterms] change Measure.sum (fun r => (Prel.restrict (C r)).map endpointObservationReal) = (Prel.restrict A).map endpointObservationReal rw [← hpartition, Measure.map_sum endpointObservationReal_measurable.aemeasurable]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointAssignedArmLaw_releaseReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:445
theorem endpointFullLaw_releaseReal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
(endpointFullLaw H g Prel hMass hOverlap upper0 upper1).map (fun ω => endpointObservationReal (releasedRecord ω))
Proof (Lean source)
lemma endpointFullLaw_releaseReal {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : (endpointFullLaw H g Prel hMass hOverlap upper0 upper1).map (fun ω => endpointObservationReal (releasedRecord ω)) = Prel.map endpointObservationReal := by have hrel : Measurable (fun ω : FullRow ε J => endpointObservationReal (releasedRecord ω)) := by exact endpointObservationReal_measurable.comp (by unfold releasedRecord label arm observed fun_prop) unfold endpointFullLaw rw [Measure.map_add _ _ hrel, Measure.map_map hrel (reconstructedFullRow_measurable g hMass.2.2.1 false), Measure.map_map hrel (reconstructedFullRow_measurable g hMass.2.2.1 true)] change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)).map (fun p => (g p.1, false, (p.2.1 : ℝ))) + ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)).map (fun p => (g p.1, true, (p.2.2 : ℝ))) = _ have h0 := congrArg (Measure.map (fun q : ScoreSpace ε × OutcomeSpace => (g q.1, false, (q.2 : ℝ)))) (endpointAssignedPotentialLaw H g Prel hMass hOverlap upper0 upper1 false) have hg : Measurable g := hMass.2.2.1 rw [Measure.map_map (by fun_prop) (by simp only [Bool.false_eq_true, ↓reduceIte]; fun_prop)] at h0 simp only [Bool.false_eq_true, ↓reduceIte] at h0 change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)).map (fun p => (g p.1, false, (p.2.1 : ℝ))) = (endpointAssignedArmLaw H g Prel hMass hOverlap false upper0).map (fun q => (g q.1, false, (q.2 : ℝ))) at h0 have h1 := congrArg (Measure.map (fun q : ScoreSpace ε × OutcomeSpace => (g q.1, true, (q.2 : ℝ)))) (endpointAssignedPotentialLaw H g Prel hMass hOverlap upper0 upper1 true) rw [Measure.map_map (by fun_prop) (by simp only [↓reduceIte]; fun_prop)] at h1 simp only [↓reduceIte] at h1 change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)).map (fun p => (g p.1, true, (p.2.2 : ℝ))) = (endpointAssignedArmLaw H g Prel hMass hOverlap true upper1).map (fun q => (g q.1, true, (q.2 : ℝ))) at h1 rw [h0, h1, endpointAssignedArmLaw_releaseReal H g Prel hMass hOverlap false upper0, endpointAssignedArmLaw_releaseReal H g Prel hMass hOverlap true upper1, ← Measure.map_add _ _ endpointObservationReal_measurable] congr 1 let S : Set (Observation J) := {z | z.2.1 = true} have hS : MeasurableSet S := measurableSet_eq_fun (by fun_prop) measurable_const have hfalse : {z : Observation J | z.2.1 = false} = Sᶜ := by ext z simp [S] rw [hfalse, Measure.restrict_compl_add_restrict hS]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_releaseReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:499
theorem endpointFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
ReleasedLaw (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) Prel
Proof (Lean source)
lemma endpointFullLaw_releasedLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : ReleasedLaw (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) Prel := by have hcoe : MeasurableEmbedding (fun y : OutcomeSpace => (y : ℝ)) := MeasurableEmbedding.subtype_coe measurableSet_Icc have hinner : MeasurableEmbedding (fun p : ArmSpace × OutcomeSpace => (p.1, (p.2 : ℝ))) := by change MeasurableEmbedding (map id (fun y : OutcomeSpace => (y : ℝ))) exact MeasurableEmbedding.id.prodMap hcoe have hemb : MeasurableEmbedding (endpointObservationReal (J := J)) := by change MeasurableEmbedding (map id (fun p : ArmSpace × OutcomeSpace => (p.1, (p.2 : ℝ)))) exact MeasurableEmbedding.id.prodMap hinner unfold ReleasedLaw releasedLaw apply hemb.map_injective rw [Measure.map_map hemb.measurable (by unfold releasedRecord label arm observed fun_prop)] exact endpointFullLaw_releaseReal H g Prel hMass hOverlap upper0 upper1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:562
theorem endpointFullLaw_compatibleCausalLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
CompatibleCausalLaw H g Prel (endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
Proof (Lean source)
lemma endpointFullLaw_compatibleCausalLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) : CompatibleCausalLaw H g Prel (endpointFullLaw H g Prel hMass hOverlap upper0 upper1) := by exact { probability := endpointFullLaw_isProbabilityMeasure H g Prel hMass hOverlap upper0 upper1 measurableRelease := hMass.2.2.1 scoreMarginal := endpointFullLaw_scoreMarginal H g Prel hMass hOverlap upper0 upper1 randomizedAssignment := endpointFullLaw_randomizedAssignment H g Prel hMass hOverlap upper0 upper1 consistency := endpointFullLaw_consistency H g Prel hMass hOverlap upper0 upper1 deterministicRelease := endpointFullLaw_deterministicRelease H g Prel hMass hOverlap upper0 upper1 releasedLaw := endpointFullLaw_releasedLaw H g Prel hMass hOverlap upper0 upper1 }
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_compatibleCausalLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:588
theorem endpointFullLaw_potentialLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
a :
(endpointFullLaw H g Prel hMass hOverlap upper0 upper1).map (fun ω => (score ω, if a then outcome1 ω else outcome0 ω))
= endpointArmPotentialLaw H g Prel hMass hOverlap a (if a then upper1 else upper0)
Proof (Lean source)
lemma endpointFullLaw_potentialLaw {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) (a : ArmSpace) : (endpointFullLaw H g Prel hMass hOverlap upper0 upper1).map (fun ω => (score ω, if a then outcome1 ω else outcome0 ω)) = endpointArmPotentialLaw H g Prel hMass hOverlap a (if a then upper1 else upper0) := by have hp : Measurable (fun ω : FullRow ε J => (score ω, if a then outcome1 ω else outcome0 ω)) := by cases a · simp only [Bool.false_eq_true, ↓reduceIte] have hs : Measurable (score (ε := ε) (J := J)) := by unfold score fun_prop have ho : Measurable (outcome0 (ε := ε) (J := J)) := by unfold outcome0 fun_prop exact hs.prodMk ho · simp only [↓reduceIte] have hs : Measurable (score (ε := ε) (J := J)) := by unfold score fun_prop have ho : Measurable (outcome1 (ε := ε) (J := J)) := by unfold outcome1 fun_prop exact hs.prodMk ho unfold endpointFullLaw rw [Measure.map_add _ _ hp, Measure.map_map hp (reconstructedFullRow_measurable g hMass.2.2.1 false), Measure.map_map hp (reconstructedFullRow_measurable g hMass.2.2.1 true)] change ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity false)).map (fun p => (p.1, if a then p.2.2 else p.2.1)) + ((endpointLatentLaw H g Prel hMass hOverlap upper0 upper1).withDensity (reconstructedAssignmentDensity true)).map (fun p => (p.1, if a then p.2.2 else p.2.1)) = _ rw [← Measure.map_add _ _ (by cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop), endpointAssignmentMeasures_sum H g Prel hMass hOverlap upper0 upper1] cases a · simp only [Bool.false_eq_true, ↓reduceIte] exact endpointLatentLaw_map_control H g Prel hMass hOverlap upper0 upper1 · simp only [↓reduceIte] exact endpointLatentLaw_map_treated H g Prel hMass hOverlap upper0 upper1
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_potentialLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:610
theorem boundedEndpointCell_productIntegral

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
r :
hq :
0 < armCellMass H g a r
upper :
(∫ p, (p.2 : ℝ) * (armProb a p.1)⁻¹ ∂boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper)
= ∫ q, q.1 * q.2 ∂(if upper then comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq))
Proof (Lean source)
lemma boundedEndpointCell_productIntegral {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hq : 0 < armCellMass H g a r) (upper : Bool) : (∫ p, (p.2 : ℝ) * (armProb a p.1)⁻¹ ∂boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper) = ∫ q, q.1 * q.2 ∂(if upper then comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) := by let M := endpointCellScoreOutcomeLaw H g Prel hMass hOverlap a r hq upper let b : ScoreSpace ε × ℝ → ScoreSpace ε × OutcomeSpace := fun p => (p.1, clampOutcome p.2) let t : ScoreSpace ε × ℝ → ℝ × ℝ := fun p => (p.2, (armProb a p.1)⁻¹) have hb : Measurable b := by dsimp only [b] exact measurable_fst.prodMk (clampOutcome_measurable.comp measurable_snd) have ht : Measurable t := by dsimp only [t] cases a <;> simp [armProb] <;> fun_prop have hboundedProduct : Measurable (fun p : ScoreSpace ε × OutcomeSpace => (p.2 : ℝ) * (armProb a p.1)⁻¹) := by have hy : Measurable (fun p : ScoreSpace ε × OutcomeSpace => (p.2 : ℝ)) := by fun_prop have hw : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by cases a <;> simp [armProb] <;> fun_prop exact hy.mul (hw.comp measurable_fst) have hsupport : ∀ᵐ p ∂M, p.2 ∈ Icc (0 : ℝ) 1 := by rw [ae_iff] exact endpointCellScoreOutcomeLaw_outcome_support H g Prel hMass hOverlap a r hq upper unfold boundedEndpointCellLaw rw [integral_map hb.aemeasurable hboundedProduct.aestronglyMeasurable] calc (∫ p, ((clampOutcome p.2 : OutcomeSpace) : ℝ) * (armProb a p.1)⁻¹ ∂M) = ∫ p, p.2 * (armProb a p.1)⁻¹ ∂M := by apply integral_congr_ae filter_upwards [hsupport] with p hp rw [clampOutcome_coe_of_mem hp] _ = ∫ q, q.1 * q.2 ∂M.map t := by rw [integral_map ht.aemeasurable (by fun_prop)] _ = _ := by rw [endpointCellScoreOutcomeLaw_map_outcome_weight H g Prel hMass hOverlap a r hq upper]
CausalSmith.PartialID.UnlinkedPropensityAte.boundedEndpointCell_productIntegral · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:662
theorem endpointArmPotentialMean_eq_sum_cellProducts

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
(∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a upper)
= ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ q, q.1 * q.2 ∂(if upper then comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) else 0
Proof (Lean source)
lemma endpointArmPotentialMean_eq_sum_cellProducts {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : (∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a upper) = ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ q, q.1 * q.2 ∂(if upper then comonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) else countermonotoneCoupling (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) else 0 := by let F : ScoreSpace ε × OutcomeSpace → ℝ := fun p => (p.2 : ℝ) * (armProb a p.1)⁻¹ have hF : Measurable F := by dsimp only [F] have hy : Measurable (fun p : ScoreSpace ε × OutcomeSpace => (p.2 : ℝ)) := by fun_prop have hw : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by cases a <;> simp [armProb] <;> fun_prop exact hy.mul (hw.comp measurable_fst) have hcellInt : ∀ r : LabelSpace J, Integrable F (if hq : 0 < armCellMass H g a r then ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper else 0) := by intro r split · rename_i hq letI : IsFiniteMeasure (ofReal (armCellMass H g a r) • boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper) := ⟨by rw [Measure.smul_apply] exact ENNReal.mul_lt_top ENNReal.ofReal_lt_top (measure_lt_top _ _)⟩ apply Integrable.of_bound hF.aestronglyMeasurable (|ε⁻¹| + 1) filter_upwards [] with p have hp : ε ≤ armProb a p.1 := by rcases p.1.property with ⟨hp0, hp1⟩ cases a <;> simp [armProb] <;> linarith have hpa : 0 < armProb a p.1 := lt_of_lt_of_le hOverlap.1 hp have hw0 : 0 ≤ (armProb a p.1)⁻¹ := (inv_nonneg.mpr hpa.le) have hw1 : (armProb a p.1)⁻¹ ≤ ε⁻¹ := (inv_le_inv₀ hpa hOverlap.1).mpr hp have hy := p.2.property rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hy.1 hw0)] calc (p.2 : ℝ) * (armProb a p.1)⁻¹ ≤ 1 * (armProb a p.1)⁻¹ := mul_le_mul_of_nonneg_right hy.2 hw0 _ = (armProb a p.1)⁻¹ := one_mul _ _ ≤ ε⁻¹ := hw1 _ ≤ |ε⁻¹| := le_abs_self _ _ ≤ |ε⁻¹| + 1 := by linarith · simp [F] unfold endpointArmPotentialLaw rw [integral_withDensity_eq_integral_toReal_smul (by cases a <;> simp [armProb] <;> fun_prop) (Filter.Eventually.of_forall fun p => by rw [ENNReal.inv_lt_top] apply ENNReal.ofReal_pos.mpr rcases p.1.property with ⟨hp0, hp1⟩ cases a <;> simp [armProb] <;> linarith [hOverlap.1]) ] have hconvert : (∫ p, ((ofReal (armProb a p.1))⁻¹).toReal • (p.2 : ℝ) ∂endpointAssignedArmLaw H g Prel hMass hOverlap a upper) = ∫ p, F p ∂endpointAssignedArmLaw H g Prel hMass hOverlap a upper := by apply integral_congr_ae filter_upwards [] with p have hp : 0 < armProb a p.1 := by rcases p.1.property with ⟨hp0, hp1⟩ cases a <;> simp [armProb] <;> linarith [hOverlap.1] rw [ENNReal.toReal_inv, ENNReal.toReal_ofReal hp.le] simp [F, mul_comm] rw [hconvert] unfold endpointAssignedArmLaw rw [Measure.sum_fintype, integral_finset_sum_measure (fun r _ => hcellInt r)] apply Finset.sum_congr rfl intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] rw [integral_smul_measure] rw [ENNReal.toReal_ofReal hq.le] change armCellMass H g a r * (∫ p, (p.2 : ℝ) * (armProb a p.1)⁻¹ ∂boundedEndpointCellLaw H g Prel hMass hOverlap a r hq upper) = _ rw [boundedEndpointCell_productIntegral H g Prel hMass hOverlap a r hq upper] · simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialMean_eq_sum_cellProducts · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:719
theorem endpointArmPotentialMean_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
(∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a false)
= muLower H g Prel hMass a
Proof (Lean source)
lemma endpointArmPotentialMean_lower {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : (∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a false) = muLower H g Prel hMass a := by rw [endpointArmPotentialMean_eq_sum_cellProducts H g Prel hMass hOverlap a false] unfold muLower apply Finset.sum_congr rfl intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos, Bool.false_eq_true, ↓reduceIte] let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure (armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq) := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) congr 1 exact product_expectation_countermonotoneCoupling_interval Y W · simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialMean_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:820
theorem endpointArmPotentialMean_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
(∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a true)
= muUpper H g Prel hMass a
Proof (Lean source)
lemma endpointArmPotentialMean_upper {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : (∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a true) = muUpper H g Prel hMass a := by rw [endpointArmPotentialMean_eq_sum_cellProducts H g Prel hMass hOverlap a true] unfold muUpper apply Finset.sum_congr rfl intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos, ↓reduceIte] let Y := armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq) let W := armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 letI : IsProbabilityMeasure Y := armCellOutcomeLaw_isProbabilityMeasure Prel a r (by rw [hMass.2.2.2 a r]; exact hq) letI : IsProbabilityMeasure (armCellScoreLaw H hMass.1 g hMass.2.2.1 a r hq) := armCellScoreLaw_isProbabilityMeasure H g hMass.2.2.1 hOverlap a r hq letI : IsProbabilityMeasure W := by dsimp [W, armCellWeightLaw] exact Measure.isProbabilityMeasure_map (by cases a <;> simp [armProb] <;> fun_prop) have hm := endpointArmCell_moments H g Prel hMass hOverlap a r hq congr 1 exact product_expectation_comonotoneCoupling_interval Y W hm.1 hm.2 · simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.endpointArmPotentialMean_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:915
theorem endpointFullLaw_armMean

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
upper0 upper1 :
a :
(∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1)
= if (if a then upper1 else upper0) then muUpper H g Prel hMass a else muLower H g Prel hMass a
Proof (Lean source)
lemma endpointFullLaw_armMean {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (upper0 upper1 : Bool) (a : ArmSpace) : (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1) = if (if a then upper1 else upper0) then muUpper H g Prel hMass a else muLower H g Prel hMass a := by have hmap := endpointFullLaw_potentialLaw H g Prel hMass hOverlap upper0 upper1 a have hint := congrArg (fun μ : Measure (ScoreSpace ε × OutcomeSpace) => ∫ p, (p.2 : ℝ) ∂μ) hmap rw [integral_map (by cases a · simp only [Bool.false_eq_true, ↓reduceIte] exact ((by unfold score; fun_prop : Measurable (score (ε := ε) (J := J))).prodMk (by unfold outcome0; fun_prop)).aemeasurable · simp only [↓reduceIte] exact ((by unfold score; fun_prop : Measurable (score (ε := ε) (J := J))).prodMk (by unfold outcome1; fun_prop)).aemeasurable) (by fun_prop)] at hint change (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂endpointFullLaw H g Prel hMass hOverlap upper0 upper1) = ∫ p, (p.2 : ℝ) ∂endpointArmPotentialLaw H g Prel hMass hOverlap a (if a then upper1 else upper0) at hint rw [hint] generalize hu : (if a then upper1 else upper0) = u cases u · simp only [Bool.false_eq_true, ↓reduceIte] simpa [hu] using endpointArmPotentialMean_lower H g Prel hMass hOverlap a · simp only [↓reduceIte] simpa [hu] using endpointArmPotentialMean_upper H g Prel hMass hOverlap a
CausalSmith.PartialID.UnlinkedPropensityAte.endpointFullLaw_armMean · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawEndpointFullRow.lean:950
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.FixedLawMembership 17 declarations One-sided membership lemmas for the fixed-released-law sharp ATE interval.

One-sided membership lemmas for the fixed-released-law sharp ATE interval.

This file isolates the algebraic passage from armwise potential-outcome mean bounds to membership of the ATE in the candidate sharp interval. It also records the quantile formulas needed when the arm-cell law has been exhibited as a coupling of the released outcome law and the inverse-score law.

theorem potentialOutcome_integrable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
a :
Integrable (fun ω => ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ)) P
Proof (Lean source)
lemma potentialOutcome_integrable {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (a : ArmSpace) : Integrable (fun ω => ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ)) P := by cases a with | false => change Integrable (fun ω => ((outcome0 ω : OutcomeSpace) : ℝ)) P apply Integrable.of_bound (by unfold outcome0; fun_prop) 1 filter_upwards [] with ω exact abs_le.mpr ⟨by linarith [((outcome0 ω).property).1], ((outcome0 ω).property).2⟩ | true => change Integrable (fun ω => ((outcome1 ω : OutcomeSpace) : ℝ)) P apply Integrable.of_bound (by unfold outcome1; fun_prop) 1 filter_upwards [] with ω exact abs_le.mpr ⟨by linarith [((outcome1 ω).property).1], ((outcome1 ω).property).2⟩
CausalSmith.PartialID.UnlinkedPropensityAte.potentialOutcome_integrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:21
theorem ate_eq_potentialOutcomeMeans_sub

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
ate P
= (∫ ω, ((outcome1 ω : OutcomeSpace) : ℝ) ∂P) - ∫ ω, ((outcome0 ω : OutcomeSpace) : ℝ) ∂P
Proof (Lean source)
lemma ate_eq_potentialOutcomeMeans_sub {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] : ate P = (∫ ω, ((outcome1 ω : OutcomeSpace) : ℝ) ∂P) - ∫ ω, ((outcome0 ω : OutcomeSpace) : ℝ) ∂P := by unfold ate have h₁ : Integrable (fun ω => ((outcome1 ω : OutcomeSpace) : ℝ)) P := by simpa using potentialOutcome_integrable P true have h₀ : Integrable (fun ω => ((outcome0 ω : OutcomeSpace) : ℝ)) P := by simpa using potentialOutcome_integrable P false exact integral_sub h₁ h₀
CausalSmith.PartialID.UnlinkedPropensityAte.ate_eq_potentialOutcomeMeans_sub · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:42
theorem ate_mem_sharpATESet_of_armMean_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hLower :
∀ a : ArmSpace,
muLower H g Prel hMass a
≤ ∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P
hUpper :
∀ a : ArmSpace,
(∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P)
≤ muUpper H g Prel hMass a
ate P ∈ sharpATESet H g Prel hMass
Proof (Lean source)
lemma ate_mem_sharpATESet_of_armMean_bounds {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hLower : ∀ a : ArmSpace, muLower H g Prel hMass a ≤ ∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) (hUpper : ∀ a : ArmSpace, (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) ≤ muUpper H g Prel hMass a) : ate P ∈ sharpATESet H g Prel hMass := by rw [ate_eq_potentialOutcomeMeans_sub P] unfold sharpATESet constructor · have h₁ := hLower true have h₀ := hUpper false simp at h₁ h₀ linarith · have h₁ := hUpper true have h₀ := hLower false simp at h₁ h₀ linarith
CausalSmith.PartialID.UnlinkedPropensityAte.ate_mem_sharpATESet_of_armMean_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:55
def latentTriple

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
ω :
FullRow ε J
latentTriple ω :
(score ω, outcome0 ω, outcome1 ω)
def assignedLatentLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
P :
a :
assignedLatentLaw P a :
(P.restrict {ω | arm ω = a}).map latentTriple
CausalSmith.PartialID.UnlinkedPropensityAte.assignedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:84
def propensityTiltedLatentLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
P :
a :
propensityTiltedLatentLaw P a :
(P.map latentTriple).withDensity (fun x => ofReal (armProb a x.1))
CausalSmith.PartialID.UnlinkedPropensityAte.propensityTiltedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:89
theorem randomizedAssignment_false_measureReal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hRandom :
hB :
P.real {ω | arm ω = false ∧ latentTriple ω ∈ B}
= ∫ x in B, (1 - (x.1 : ℝ)) ∂(P.map latentTriple)
Proof (Lean source)
lemma randomizedAssignment_false_measureReal {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hRandom : RandomizedAssignment P) (B : Set (ScoreSpace ε × OutcomeSpace × OutcomeSpace)) (hB : MeasurableSet B) : P.real {ω | arm ω = false ∧ latentTriple ω ∈ B} = ∫ x in B, (1 - (x.1 : ℝ)) ∂(P.map latentTriple) := by have hX : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop let C : Set (FullRow ε J) := latentTriple ⁻¹' B let T : Set (FullRow ε J) := {ω | arm ω = true} have hT : MeasurableSet T := by dsimp [T] exact measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const have hsplit := measureReal_inter_add_sdiff (μ := P) (s := C) (t := T) hT have htreated : P.real (C ∩ T) = ∫ x in B, (x.1 : ℝ) ∂(P.map latentTriple) := by rw [MeasureTheory.setIntegral_map hB (by fun_prop) hX.aemeasurable] convert hRandom B hB using 1 · apply measureReal_congr filter_upwards [] with ω change (latentTriple ω ∈ B ∧ arm ω = true) = (arm ω = true ∧ latentTriple ω ∈ B) exact propext and_comm · apply setIntegral_congr_set filter_upwards [] with ω rfl have hC : P.real C = ∫ _x in B, (1 : ℝ) ∂(P.map latentTriple) := by rw [MeasureTheory.setIntegral_const] simp only [smul_eq_mul, mul_one] change (P C).toReal = ((P.map latentTriple) B).toReal rw [Measure.map_apply hX hB] have hIntOne : IntegrableOn (fun _x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (1 : ℝ)) B (P.map latentTriple) := integrableOn_const have hIntScore : IntegrableOn (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (x.1 : ℝ)) B (P.map latentTriple) := by apply Integrable.of_bound ((by fun_prop : AEStronglyMeasurable (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (x.1 : ℝ)) (P.map latentTriple)).restrict) (|ε| + |1 - ε| + 1) filter_upwards [] with x rcases x.1.property with ⟨hx₁, hx₂⟩ have h₁ := neg_le_abs ε have h₂ := le_abs_self (1 - ε) have h₃ := neg_le_abs (1 - ε) have h₄ := le_abs_self ε exact abs_le.mpr ⟨by linarith, by linarith⟩ rw [MeasureTheory.integral_sub hIntOne hIntScore] rw [← hC, ← htreated] have hfalse : C \ T = {ω | arm ω = false ∧ latentTriple ω ∈ B} := by ext ω cases hA : arm ω <;> simp [C, T, hA, and_comm] rw [hfalse] at hsplit linarith
CausalSmith.PartialID.UnlinkedPropensityAte.randomizedAssignment_false_measureReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:96
theorem assignedLatentLaw_true_eq_propensityTiltedLatentLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
hRandom :
Proof (Lean source)
lemma assignedLatentLaw_true_eq_propensityTiltedLatentLaw {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hOverlap : Overlap ε) (hRandom : RandomizedAssignment P) : assignedLatentLaw P true = propensityTiltedLatentLaw P true := by have hX : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop ext B hB have hInt : IntegrableOn (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (x.1 : ℝ)) B (P.map latentTriple) := by apply Integrable.of_bound ((by fun_prop : AEStronglyMeasurable (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (x.1 : ℝ)) (P.map latentTriple)).restrict) 1 filter_upwards [] with x rcases x.1.property with ⟨hx₁, hx₂⟩ exact abs_le.mpr ⟨by linarith [hOverlap.1], by linarith [hOverlap.1]⟩ have hnonneg : 0 ≤ᵐ[(P.map latentTriple).restrict B] fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => (x.1 : ℝ) := ae_of_all _ fun x => le_trans hOverlap.1.le x.1.property.1 have hleft : assignedLatentLaw P true B ≠ ⊤ := by rw [assignedLatentLaw, Measure.map_apply hX hB, Measure.restrict_apply (hB.preimage hX)] exact measure_ne_top P _ have hright : propensityTiltedLatentLaw P true B ≠ ⊤ := by rw [propensityTiltedLatentLaw, withDensity_apply _ hB] simp only [armProb, ↓reduceIte] exact (MeasureTheory.ofReal_integral_eq_lintegral_ofReal hInt hnonneg).symm.trans_ne (by simp) rw [← ENNReal.toReal_eq_toReal_iff' hleft hright] rw [assignedLatentLaw, Measure.map_apply hX hB, Measure.restrict_apply (hB.preimage hX)] change P.real (latentTriple ⁻¹' B ∩ {ω | arm ω = true}) = _ rw [propensityTiltedLatentLaw, withDensity_apply _ hB] simp only [armProb, ↓reduceIte] rw [← MeasureTheory.ofReal_integral_eq_lintegral_ofReal hInt hnonneg, ENNReal.toReal_ofReal] · rw [MeasureTheory.setIntegral_map hB (by fun_prop) hX.aemeasurable] convert hRandom B hB using 1 · apply measureReal_congr filter_upwards [] with ω change (latentTriple ω ∈ B ∧ arm ω = true) = (arm ω = true ∧ latentTriple ω ∈ B) exact propext and_comm · rfl · exact integral_nonneg_of_ae hnonneg
CausalSmith.PartialID.UnlinkedPropensityAte.assignedLatentLaw_true_eq_propensityTiltedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:154
theorem assignedLatentLaw_false_eq_propensityTiltedLatentLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
hRandom :
Proof (Lean source)
lemma assignedLatentLaw_false_eq_propensityTiltedLatentLaw {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hOverlap : Overlap ε) (hRandom : RandomizedAssignment P) : assignedLatentLaw P false = propensityTiltedLatentLaw P false := by have hX : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop ext B hB have hInt : IntegrableOn (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => 1 - (x.1 : ℝ)) B (P.map latentTriple) := by apply Integrable.of_bound ((by fun_prop : AEStronglyMeasurable (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => 1 - (x.1 : ℝ)) (P.map latentTriple)).restrict) 1 filter_upwards [] with x rcases x.1.property with ⟨hx₁, hx₂⟩ exact abs_le.mpr ⟨by linarith [hOverlap.1], by linarith [hOverlap.1]⟩ have hnonneg : 0 ≤ᵐ[(P.map latentTriple).restrict B] fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => 1 - (x.1 : ℝ) := ae_of_all _ fun x => show 0 ≤ 1 - (x.1 : ℝ) by linarith [x.1.property.2, hOverlap.1] have hleft : assignedLatentLaw P false B ≠ ⊤ := by rw [assignedLatentLaw, Measure.map_apply hX hB, Measure.restrict_apply (hB.preimage hX)] exact measure_ne_top P _ have hright : propensityTiltedLatentLaw P false B ≠ ⊤ := by rw [propensityTiltedLatentLaw, withDensity_apply _ hB] simp only [armProb, Bool.false_eq_true, ↓reduceIte] exact (MeasureTheory.ofReal_integral_eq_lintegral_ofReal hInt hnonneg).symm.trans_ne (by simp) rw [← ENNReal.toReal_eq_toReal_iff' hleft hright] rw [assignedLatentLaw, Measure.map_apply hX hB, Measure.restrict_apply (hB.preimage hX)] change P.real (latentTriple ⁻¹' B ∩ {ω | arm ω = false}) = _ rw [propensityTiltedLatentLaw, withDensity_apply _ hB] simp only [armProb, Bool.false_eq_true, ↓reduceIte] rw [← MeasureTheory.ofReal_integral_eq_lintegral_ofReal hInt hnonneg, ENNReal.toReal_ofReal] · rw [← randomizedAssignment_false_measureReal P hRandom B hB] apply measureReal_congr filter_upwards [] with ω change (latentTriple ω ∈ B ∧ arm ω = false) = (arm ω = false ∧ latentTriple ω ∈ B) exact propext and_comm · exact integral_nonneg_of_ae hnonneg
CausalSmith.PartialID.UnlinkedPropensityAte.assignedLatentLaw_false_eq_propensityTiltedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:203
theorem assignedLatentLaw_eq_propensityTiltedLatentLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
hRandom :
a :
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.assignedLatentLaw_eq_propensityTiltedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:251
theorem integral_inversePropensity_assignedLatentLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
hRandom :
a :
(∫ x, ((if a then x.2.2 else x.2.1 : OutcomeSpace) : ℝ) * (armProb a x.1)⁻¹ ∂(assignedLatentLaw P a))
= ∫ x, ((if a then x.2.2 else x.2.1 : OutcomeSpace) : ℝ) ∂(P.map latentTriple)
Proof (Lean source)
lemma integral_inversePropensity_assignedLatentLaw {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hOverlap : Overlap ε) (hRandom : RandomizedAssignment P) (a : ArmSpace) : (∫ x, ((if a then x.2.2 else x.2.1 : OutcomeSpace) : ℝ) * (armProb a x.1)⁻¹ ∂(assignedLatentLaw P a)) = ∫ x, ((if a then x.2.2 else x.2.1 : OutcomeSpace) : ℝ) ∂(P.map latentTriple) := by rw [assignedLatentLaw_eq_propensityTiltedLatentLaw P hOverlap hRandom a] unfold propensityTiltedLatentLaw rw [integral_withDensity_eq_integral_toReal_smul (by cases a <;> simp only [armProb, Bool.false_eq_true, ↓reduceIte] <;> fun_prop) (ae_of_all _ fun _ => by finiteness)] apply integral_congr_ae filter_upwards [] with x have hp : 0 < armProb a x.1 := by rcases x.1.property with ⟨hx₁, hx₂⟩ cases a <;> simp [armProb] <;> linarith [hOverlap.1] rw [ENNReal.toReal_ofReal hp.le] simp only [smul_eq_mul] field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.integral_inversePropensity_assignedLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:260
theorem potentialOutcomeMean_eq_inversePropensity

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
hRandom :
a :
(∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P)
= ∫ ω in {ω | arm ω = a}, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) * (armProb a (score ω))⁻¹ ∂P
Proof (Lean source)
lemma potentialOutcomeMean_eq_inversePropensity {ε : ℝ} {J : ℕ} (P : Measure (FullRow ε J)) [IsProbabilityMeasure P] (hOverlap : Overlap ε) (hRandom : RandomizedAssignment P) (a : ArmSpace) : (∫ ω, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) ∂P) = ∫ ω in {ω | arm ω = a}, ((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ) * (armProb a (score ω))⁻¹ ∂P := by have hX : Measurable (latentTriple (ε := ε) (J := J)) := by unfold latentTriple score outcome0 outcome1 fun_prop have h := integral_inversePropensity_assignedLatentLaw P hOverlap hRandom a rw [assignedLatentLaw, MeasureTheory.integral_map] at h · rw [MeasureTheory.integral_map] at h · simpa [latentTriple] using h.symm · exact hX.aemeasurable · cases a with | false => change AEStronglyMeasurable (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => ((x.2.1 : OutcomeSpace) : ℝ)) _ fun_prop | true => change AEStronglyMeasurable (fun x : ScoreSpace ε × OutcomeSpace × OutcomeSpace => ((x.2.2 : OutcomeSpace) : ℝ)) _ fun_prop · exact hX.aemeasurable · cases a <;> simp only [armProb, Bool.false_eq_true, ↓reduceIte] <;> fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.potentialOutcomeMean_eq_inversePropensity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:282
def compatibleArmCellCoupling

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
P :
a :
r :
_hq :
0 < armCellMass H g a r
compatibleArmCellCoupling H g P a r _hq :
Measure (ℝ × ℝ)
(ofReal (armCellMass H g a r))⁻¹ • ((P.restrict {ω | arm ω = a ∧ g (score ω) = r}).map (fun ω => (((if a then outcome1 ω else outcome0 ω : OutcomeSpace) : ℝ), (armProb a (score ω))⁻¹)))
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleArmCellCoupling · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:312
theorem product_expectation_countermonotoneCoupling_interval

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
(∫ p, p.1 * p.2 ∂(countermonotoneCoupling μ ν))
= ∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (1 - u)
Proof (Lean source)
lemma product_expectation_countermonotoneCoupling_interval (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : (∫ p, p.1 * p.2 ∂(Causalean.Stat.countermonotoneCoupling μ ν)) = ∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (1 - u) := by have hrest : volume.restrict (Ioc (0 : ℝ) 1) = unifOI := by rw [unifOI, restrict_Ioo_eq_restrict_Ioc] unfold Causalean.Stat.countermonotoneCoupling let r : ℝ → ℝ := fun u => 1 - u have hr : Measurable r := measurable_const.sub measurable_id have hνmap : AEMeasurable (quantile ν) (Causalean.Stat.unifOI.map r) := by simpa [r, map_one_sub_unifOI] using (aemeasurable_quantile_unifOI ν) have hνr : AEMeasurable (fun u : ℝ => quantile ν (1 - u)) unifOI := by simpa [r, Function.comp_def] using hνmap.comp_measurable hr rw [MeasureTheory.integral_map] · rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest] · exact (aemeasurable_quantile_unifOI μ).prodMk hνr · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.product_expectation_countermonotoneCoupling_interval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:323
theorem product_expectation_comonotoneCoupling_interval

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
hμ :
MemLp (fun x : ℝ => x) 2 μ
hν :
MemLp (fun y : ℝ => y) 2 ν
(∫ p, p.1 * p.2 ∂(comonotoneCoupling μ ν))
= ∫ u in (0 : ℝ)..1, quantile μ u * quantile ν u
Proof (Lean source)
lemma product_expectation_comonotoneCoupling_interval (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : (∫ p, p.1 * p.2 ∂(comonotoneCoupling μ ν)) = ∫ u in (0 : ℝ)..1, quantile μ u * quantile ν u := by have hrest : volume.restrict (Ioc (0 : ℝ) 1) = unifOI := by rw [unifOI, restrict_Ioo_eq_restrict_Ioc] rw [product_expectation_comonotoneCoupling μ ν hμ hν, ← integral_Ioc_eq_integral_Ioo, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest]
CausalSmith.PartialID.UnlinkedPropensityAte.product_expectation_comonotoneCoupling_interval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:346
theorem product_expectation_mem_quantileInterval

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
π :
Measure (ℝ × ℝ)
μ ν :
hπ :
IsCoupling π μ ν
hμ :
MemLp (fun x : ℝ => x) 2 μ
hν :
MemLp (fun y : ℝ => y) 2 ν
(∫ p, p.1 * p.2 ∂π) ∈ Icc (∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (1 - u)) (∫ u in (0 : ℝ)..1, quantile μ u * quantile ν u)
Proof (Lean source)
lemma product_expectation_mem_quantileInterval {π : Measure (ℝ × ℝ)} {μ ν : Measure ℝ} (hπ : IsCoupling π μ ν) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hμ : MemLp (fun x : ℝ => x) 2 μ) (hν : MemLp (fun y : ℝ => y) 2 ν) : (∫ p, p.1 * p.2 ∂π) ∈ Icc (∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (1 - u)) (∫ u in (0 : ℝ)..1, quantile μ u * quantile ν u) := by constructor · rw [← product_expectation_countermonotoneCoupling_interval μ ν] exact countermonotone_le_product_expectation hπ hμ hν · rw [← product_expectation_comonotoneCoupling_interval μ ν hμ hν] exact product_expectation_le_comonotone hπ hμ hν
CausalSmith.PartialID.UnlinkedPropensityAte.product_expectation_mem_quantileInterval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:359
theorem armMean_mem_endpoints_of_cellCouplings

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
a :
π :
∀ r : LabelSpace J
if
0 < armCellMass H g a r
then
Measure (ℝ × ℝ)
hπ :
∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r),
IsCoupling (π r hq) (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)
hY2 :
∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r),
MemLp (fun x : ℝ => x) 2 (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq))
hW2 :
∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r),
MemLp (fun x : ℝ => x) 2 (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)
m :
ℝ
hm :
m
= ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ p, p.1 * p.2 ∂(π r hq) else 0
m ∈ Icc (muLower H g Prel hMass a) (muUpper H g Prel hMass a)
Proof (Lean source)
lemma armMean_mem_endpoints_of_cellCouplings {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (a : ArmSpace) (π : ∀ r : LabelSpace J, 0 < armCellMass H g a r → Measure (ℝ × ℝ)) (hπ : ∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r), IsCoupling (π r hq) (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) (hY2 : ∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r), MemLp (fun x : ℝ => x) 2 (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq))) (hW2 : ∀ (r : LabelSpace J) (hq : 0 < armCellMass H g a r), MemLp (fun x : ℝ => x) 2 (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq)) (m : ℝ) (hm : m = ∑ r : LabelSpace J, if hq : 0 < armCellMass H g a r then armCellMass H g a r * ∫ p, p.1 * p.2 ∂(π r hq) else 0) : m ∈ Icc (muLower H g Prel hMass a) (muUpper H g Prel hMass a) := by rw [hm] constructor · unfold muLower apply Finset.sum_le_sum intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] letI : IsProbabilityMeasure (π r hq) := (hπ r hq).isProbabilityMeasure letI : IsProbabilityMeasure (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) := by rw [← (hπ r hq).map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable letI : IsProbabilityMeasure (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) := by rw [← (hπ r hq).map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable apply mul_le_mul_of_nonneg_left _ hq.le exact (product_expectation_mem_quantileInterval (hπ r hq) (hY2 r hq) (hW2 r hq)).1 · simp [hq] · unfold muUpper apply Finset.sum_le_sum intro r _ by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos] letI : IsProbabilityMeasure (π r hq) := (hπ r hq).isProbabilityMeasure letI : IsProbabilityMeasure (armCellOutcomeLaw Prel hMass.2.1 a r (by rw [hMass.2.2.2 a r]; exact hq)) := by rw [← (hπ r hq).map_fst] exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable letI : IsProbabilityMeasure (armCellWeightLaw H hMass.1 g hMass.2.2.1 a r hq) := by rw [← (hπ r hq).map_snd] exact Measure.isProbabilityMeasure_map measurable_snd.aemeasurable apply mul_le_mul_of_nonneg_left _ hq.le exact (product_expectation_mem_quantileInterval (hπ r hq) (hY2 r hq) (hW2 r hq)).2 · simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.armMean_mem_endpoints_of_cellCouplings · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/FixedLawMembership.lean:377
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionCost 11 declarations Paper-specific paired quantization coefficients and cell costs.

Paper-specific paired quantization coefficients and cell costs.

def highResolutionBeta

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
f :
ScoreSpace ε → ℝ
s :
Fin 2
x z :
ℝ
highResolutionBeta f s x z :
ℝ
if s = 0 then densityExtension f x / (1 - z) else densityExtension f x / z
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionBeta · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:18
theorem highResolutionBeta_diagonal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
x :
ℝ
hx :
x ∈ Icc ε (1 - ε)
Proof (Lean source)
lemma highResolutionBeta_diagonal {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (x : ℝ) (hx : x ∈ Icc ε (1 - ε)) : pairedDiagonalWeight 2 (highResolutionBeta f) x = densityExtension f x / (x * (1 - x)) := by have hx0 : x ≠ 0 := ne_of_gt (hOverlap.1.trans_le hx.1) have hx1 : 1 - x ≠ 0 := ne_of_gt (by linarith [hx.2, hOverlap.1]) unfold pairedDiagonalWeight highResolutionBeta simp only [Fin.sum_univ_two, Fin.isValue, ↓reduceIte, one_ne_zero] field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionBeta_diagonal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:24
theorem highResolutionBeta_continuousOn

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
s :
Fin 2
ContinuousOn (fun p : ℝ × ℝ => highResolutionBeta f s p.1 p.2) (Icc ε (1 - ε) ×ˢ Icc ε (1 - ε))
Proof (Lean source)
lemma highResolutionBeta_continuousOn {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (s : Fin 2) : ContinuousOn (fun p : ℝ × ℝ => highResolutionBeta f s p.1 p.2) (Icc ε (1 - ε) ×ˢ Icc ε (1 - ε)) := by have hnum : ContinuousOn (fun p : ℝ × ℝ => densityExtension f p.1) (Icc ε (1 - ε) ×ˢ Icc ε (1 - ε)) := (continuousOn_densityExtension hfcont).comp continuousOn_fst (fun _ hp => hp.1) by_cases hs : s = 0 · simp only [highResolutionBeta, hs, if_pos] apply hnum.div (by fun_prop) intro p hp linarith [hp.2.2, hOverlap.1] · simp only [highResolutionBeta, hs] apply hnum.div (by fun_prop) intro p hp exact ne_of_gt (hOverlap.1.trans_le hp.2.1)
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionBeta_continuousOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:37
theorem highResolutionBeta_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfpos :
∀ e, 0 < f e
s :
Fin 2
x z :
ℝ
hx :
x ∈ Icc ε (1 - ε)
hz :
z ∈ Icc ε (1 - ε)
0 < highResolutionBeta f s x z
Proof (Lean source)
lemma highResolutionBeta_pos {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfpos : ∀ e, 0 < f e) (s : Fin 2) (x z : ℝ) (hx : x ∈ Icc ε (1 - ε)) (hz : z ∈ Icc ε (1 - ε)) : 0 < highResolutionBeta f s x z := by have hfx : 0 < densityExtension f x := by rw [densityExtension, dif_pos hx] exact hfpos ⟨x, hx⟩ by_cases hs : s = 0 · rw [highResolutionBeta, if_pos hs] exact div_pos hfx (by linarith [hz.2, hOverlap.1]) · rw [highResolutionBeta, if_neg hs] exact div_pos hfx (hOverlap.1.trans_le hz.1)
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionBeta_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:58
theorem measurable_densityExtension

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
f :
ScoreSpace ε → ℝ
hf :
Proof (Lean source)
lemma measurable_densityExtension {ε : ℝ} (f : ScoreSpace ε → ℝ) (hf : Measurable f) : Measurable (densityExtension f) := by have hemb : MeasurableEmbedding (Subtype.val : ScoreSpace ε → ℝ) := MeasurableEmbedding.subtype_coe measurableSet_Icc have hext : Measurable (Function.extend (Subtype.val : ScoreSpace ε → ℝ) f (fun _ => 0)) := hemb.measurable_extend hf measurable_const convert hext using 1 funext x by_cases hx : x ∈ Icc ε (1 - ε) · rw [densityExtension, dif_pos hx] exact (hemb.injective.extend_apply f (fun _ => 0) ⟨x, hx⟩).symm · rw [densityExtension, dif_neg hx] rw [Function.extend_apply' _ _ _ (by intro hmem rcases hmem with ⟨e, he⟩ apply hx rw [← he] exact e.property)]
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_densityExtension · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:73
theorem scoreBase_setIntegral_eq_realScoreCell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
r :
φ :
ℝ → ℝ
hφ :
(∫ e in cell g r, φ (e : ℝ) ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)))
= ∫ x in realScoreCell g r, φ x
Proof (Lean source)
lemma scoreBase_setIntegral_eq_realScoreCell {ε : ℝ} {K : ℕ} (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (φ : ℝ → ℝ) (hφ : Measurable φ) : (∫ e in cell g r, φ (e : ℝ) ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))) = ∫ x in realScoreCell g r, φ x := by let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have himageMeas : MeasurableSet (realScoreCell g r) := (MeasurableEmbedding.subtype_coe measurableSet_Icc).measurableSet_image' hcell have hmap := MeasureTheory.setIntegral_map (μ := μ) (g := (Subtype.val : ScoreSpace ε → ℝ)) (f := φ) (s := realScoreCell g r) himageMeas hφ.aestronglyMeasurable measurable_subtype_coe.aemeasurable have hmapMeasure : Measure.map (Subtype.val : ScoreSpace ε → ℝ) μ = volume.restrict (Icc ε (1 - ε)) := map_comap_subtype_coe measurableSet_Icc volume rw [hmapMeasure] at hmap have himageSub : realScoreCell g r ⊆ Icc ε (1 - ε) := by rintro x ⟨e, he, rfl⟩ exact e.property have hrestrict : (volume.restrict (Icc ε (1 - ε))).restrict (realScoreCell g r) = volume.restrict (realScoreCell g r) := Measure.restrict_restrict_of_subset himageSub have hpreimage : cell g r = (Subtype.val : ScoreSpace ε → ℝ) ⁻¹' (realScoreCell g r) := by ext e constructor · intro he exact ⟨e, he, rfl⟩ · rintro ⟨e', he', heq⟩ simpa [Subtype.ext heq] using he' rw [hpreimage, ← hmap] change (∫ x, φ x ∂(volume.restrict (Icc ε (1 - ε))).restrict (realScoreCell g r)) = _ rw [hrestrict]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreBase_setIntegral_eq_realScoreCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:94
theorem treatedCandidate_eq_highResolutionCellCost

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
r :
z :
ℝ
hz :
z ∈ Icc ε (1 - ε)
hOverlap :
hfpos :
∀ e, 0 < f e
(∫ e in cell g r, |1 - z⁻¹ * armProb true e| ∂H)
= ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|
Proof (Lean source)
lemma treatedCandidate_eq_highResolutionCellCost {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (z : ℝ) (hz : z ∈ Icc ε (1 - ε)) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) : (∫ e in cell g r, |1 - z⁻¹ * armProb true e| ∂H) = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z| := by let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) let _ : IsFiniteMeasure μ := rateLower_scoreBaseMeasure_isFinite ε let φ : ℝ → ℝ := fun x => highResolutionBeta f 1 x z * |x - z| have hfmeas : Measurable f := hDensity.densityLower.1 have hφmeas : Measurable φ := by dsimp [φ, highResolutionBeta] exact ((measurable_densityExtension f hfmeas).div_const z).mul (by fun_prop) have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have hzpos : 0 < z := hOverlap.1.trans_le hz.1 have hpoint (e : ScoreSpace ε) : f e * |1 - z⁻¹ * armProb true e| = φ (e : ℝ) := by have hext : densityExtension f (e : ℝ) = f e := by rw [densityExtension, dif_pos e.property] have hid : |1 - z⁻¹ * (e : ℝ)| = z⁻¹ * |(e : ℝ) - z| := by rw [show 1 - z⁻¹ * (e : ℝ) = -z⁻¹ * ((e : ℝ) - z) by field_simp ring] rw [abs_mul, abs_neg, abs_of_pos (inv_pos.mpr hzpos)] simp only [armProb, ↓reduceIte, φ, highResolutionBeta, Fin.isValue, one_ne_zero, hext] rw [hid] ring calc (∫ e in cell g r, |1 - z⁻¹ * armProb true e| ∂H) = ∫ e, (cell g r).indicator (fun e => |1 - z⁻¹ * armProb true e|) e ∂H := by rw [integral_indicator hcell] _ = ∫ e, (ofReal (f e)).toReal * (cell g r).indicator (fun e => |1 - z⁻¹ * armProb true e|) e ∂μ := by rw [hDensity.densityLower.2.1, integral_withDensity_eq_integral_toReal_smul hfmeas.ennreal_ofReal (by simp)] simp only [smul_eq_mul] rfl _ = ∫ e, (cell g r).indicator (fun e => φ (e : ℝ)) e ∂μ := by apply integral_congr_ae filter_upwards [] with e by_cases he : e ∈ cell g r · simp only [Set.indicator_of_mem he] rw [ENNReal.toReal_ofReal (hfpos e).le, hpoint] · simp [Set.indicator_of_notMem he] _ = ∫ e in cell g r, φ (e : ℝ) ∂μ := by rw [integral_indicator hcell] _ = ∫ x in realScoreCell g r, φ x := scoreBase_setIntegral_eq_realScoreCell g hg r φ hφmeas _ = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z| := rfl
CausalSmith.PartialID.UnlinkedPropensityAte.treatedCandidate_eq_highResolutionCellCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:134
theorem treatedCellAbsoluteDeviation_eq_highResolutionInf

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
r :
hOverlap :
hfpos :
∀ e, 0 < f e
= sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|}
Proof (Lean source)
lemma treatedCellAbsoluteDeviation_eq_highResolutionInf {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) : cellAbsoluteDeviation H g true r = sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|} := by have hε : 0 < ε := hOverlap.1 have h1ε : 0 < 1 - ε := by linarith [hOverlap.2] unfold cellAbsoluteDeviation congr 1 ext v constructor · rintro ⟨c, hc, hvc⟩ have hcpos : 0 < c := lt_of_lt_of_le (inv_pos.mpr h1ε) hc.1 let z : ℝ := c⁻¹ have hz : z ∈ Icc ε (1 - ε) := by constructor · have h := (inv_le_inv₀ (inv_pos.mpr hε) hcpos).2 hc.2 simpa [z] using h · have h := (inv_le_inv₀ hcpos (inv_pos.mpr h1ε)).2 hc.1 simpa [z] using h refine ⟨z, hz, ?_⟩ have hzinv : z⁻¹ = c := by dsimp [z] exact inv_inv c have hcandidate := treatedCandidate_eq_highResolutionCellCost H f hDensity g hg r z hz hOverlap hfpos rw [hzinv] at hcandidate exact hvc.trans hcandidate · rintro ⟨z, hz, hvz⟩ have hzpos : 0 < z := hε.trans_le hz.1 let c : ℝ := z⁻¹ have hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := by constructor · exact (inv_le_inv₀ h1ε hzpos).2 hz.2 · exact (inv_le_inv₀ hzpos hε).2 hz.1 refine ⟨c, hc, ?_⟩ have hcandidate := treatedCandidate_eq_highResolutionCellCost H f hDensity g hg r z hz hOverlap hfpos exact hvz.trans hcandidate.symm
CausalSmith.PartialID.UnlinkedPropensityAte.treatedCellAbsoluteDeviation_eq_highResolutionInf · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:196
theorem controlCandidate_eq_highResolutionCellCost

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
r :
z :
ℝ
hz :
z ∈ Icc ε (1 - ε)
hOverlap :
hfpos :
∀ e, 0 < f e
(∫ e in cell g r, |1 - (1 - z)⁻¹ * armProb false e| ∂H)
= ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|
Proof (Lean source)
lemma controlCandidate_eq_highResolutionCellCost {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (z : ℝ) (hz : z ∈ Icc ε (1 - ε)) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) : (∫ e in cell g r, |1 - (1 - z)⁻¹ * armProb false e| ∂H) = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z| := by let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) let _ : IsFiniteMeasure μ := rateLower_scoreBaseMeasure_isFinite ε let φ : ℝ → ℝ := fun x => highResolutionBeta f 0 x z * |x - z| have hfmeas : Measurable f := hDensity.densityLower.1 have hφmeas : Measurable φ := by dsimp [φ, highResolutionBeta] exact ((measurable_densityExtension f hfmeas).div_const (1 - z)).mul (by fun_prop) have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have h1zpos : 0 < 1 - z := by linarith [hz.2, hOverlap.1] have hpoint (e : ScoreSpace ε) : f e * |1 - (1 - z)⁻¹ * armProb false e| = φ (e : ℝ) := by have hext : densityExtension f (e : ℝ) = f e := by rw [densityExtension, dif_pos e.property] have hid : |1 - (1 - z)⁻¹ * (1 - (e : ℝ))| = (1 - z)⁻¹ * |(e : ℝ) - z| := by rw [show 1 - (1 - z)⁻¹ * (1 - (e : ℝ)) = (1 - z)⁻¹ * ((e : ℝ) - z) by field_simp ring] rw [abs_mul, abs_of_pos (inv_pos.mpr h1zpos)] simp only [armProb, Bool.false_eq_true, ↓reduceIte, φ, highResolutionBeta, Fin.isValue, hext] rw [hid] ring calc (∫ e in cell g r, |1 - (1 - z)⁻¹ * armProb false e| ∂H) = ∫ e, (cell g r).indicator (fun e => |1 - (1 - z)⁻¹ * armProb false e|) e ∂H := by rw [integral_indicator hcell] _ = ∫ e, (ofReal (f e)).toReal * (cell g r).indicator (fun e => |1 - (1 - z)⁻¹ * armProb false e|) e ∂μ := by rw [hDensity.densityLower.2.1, integral_withDensity_eq_integral_toReal_smul hfmeas.ennreal_ofReal (by simp)] simp only [smul_eq_mul] rfl _ = ∫ e, (cell g r).indicator (fun e => φ (e : ℝ)) e ∂μ := by apply integral_congr_ae filter_upwards [] with e by_cases he : e ∈ cell g r · simp only [Set.indicator_of_mem he] rw [ENNReal.toReal_ofReal (hfpos e).le, hpoint] · simp [Set.indicator_of_notMem he] _ = ∫ e in cell g r, φ (e : ℝ) ∂μ := by rw [integral_indicator hcell] _ = ∫ x in realScoreCell g r, φ x := scoreBase_setIntegral_eq_realScoreCell g hg r φ hφmeas _ = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z| := rfl
CausalSmith.PartialID.UnlinkedPropensityAte.controlCandidate_eq_highResolutionCellCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:243
theorem controlCellAbsoluteDeviation_eq_highResolutionInf

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
r :
hOverlap :
hfpos :
∀ e, 0 < f e
= sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|}
Proof (Lean source)
lemma controlCellAbsoluteDeviation_eq_highResolutionInf {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) : cellAbsoluteDeviation H g false r = sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|} := by have hε : 0 < ε := hOverlap.1 have h1ε : 0 < 1 - ε := by linarith [hOverlap.2] unfold cellAbsoluteDeviation congr 1 ext v constructor · rintro ⟨c, hc, hvc⟩ have hcpos : 0 < c := lt_of_lt_of_le (inv_pos.mpr h1ε) hc.1 let z : ℝ := 1 - c⁻¹ have hcinvLower : ε ≤ c⁻¹ := by have h := (inv_le_inv₀ (inv_pos.mpr hε) hcpos).2 hc.2 simpa using h have hcinvUpper : c⁻¹ ≤ 1 - ε := by have h := (inv_le_inv₀ hcpos (inv_pos.mpr h1ε)).2 hc.1 simpa using h have hz : z ∈ Icc ε (1 - ε) := by dsimp [z] constructor <;> linarith refine ⟨z, hz, ?_⟩ have hzc : (1 - z)⁻¹ = c := by dsimp [z] rw [sub_sub_cancel, inv_inv] have hcandidate := controlCandidate_eq_highResolutionCellCost H f hDensity g hg r z hz hOverlap hfpos rw [hzc] at hcandidate exact hvc.trans hcandidate · rintro ⟨z, hz, hvz⟩ have h1zpos : 0 < 1 - z := by linarith [hz.2, hε] let c : ℝ := (1 - z)⁻¹ have hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := by constructor · exact (inv_le_inv₀ h1ε h1zpos).2 (by linarith [hz.1]) · exact (inv_le_inv₀ h1zpos hε).2 (by linarith [hz.2]) refine ⟨c, hc, ?_⟩ have hcandidate := controlCandidate_eq_highResolutionCellCost H f hDensity g hg r z hz hOverlap hfpos exact hvz.trans hcandidate.symm
CausalSmith.PartialID.UnlinkedPropensityAte.controlCellAbsoluteDeviation_eq_highResolutionInf · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:306
theorem sum_cellAbsoluteDeviation_eq_highResolutionInfs

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
r :
hOverlap :
hfpos :
∀ e, 0 < f e
= sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|}
+ sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|}
Proof (Lean source)
lemma sum_cellAbsoluteDeviation_eq_highResolutionInfs {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) : cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r = sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|} + sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|} := by rw [treatedCellAbsoluteDeviation_eq_highResolutionInf H f hDensity g hg r hOverlap hfpos, controlCellAbsoluteDeviation_eq_highResolutionInf H f hDensity g hg r hOverlap hfpos]
CausalSmith.PartialID.UnlinkedPropensityAte.sum_cellAbsoluteDeviation_eq_highResolutionInfs · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionCost.lean:356
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionFiniteInfimum 4 declarations Finite assembly of independent reproduction-center infima.

Finite assembly of independent reproduction-center infima.

def independentCenterValues

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ι Z :
Type*
C :
ι → Set Z
cost :
ι → Z → ℝ
i :
ι
independentCenterValues C cost i :
Set ℝ
{v | ∃ z ∈ C i, v = cost i z}
CausalSmith.PartialID.UnlinkedPropensityAte.independentCenterValues · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionFiniteInfimum.lean:16
def independentCenterTotalValues

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ι Z :
Type*
C :
ι → Set Z
cost :
ι → Z → ℝ
independentCenterTotalValues C cost :
Set ℝ
{v | ∃ z : ι → Z, (∀ i, z i ∈ C i) ∧ v = ∑ i, cost i (z i)}
CausalSmith.PartialID.UnlinkedPropensityAte.independentCenterTotalValues · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionFiniteInfimum.lean:21
theorem sInf_independentCenterTotalValues_eq_sum_of_nonempty_bddBelow

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ι Z :
Type*
C :
ι → Set Z
cost :
ι → Z → ℝ
hne :
∀ i, (independentCenterValues C cost i).Nonempty
hbelow :
Proof (Lean source)
lemma sInf_independentCenterTotalValues_eq_sum_of_nonempty_bddBelow {ι Z : Type*} [Fintype ι] (C : ι → Set Z) (cost : ι → Z → ℝ) (hne : ∀ i, (independentCenterValues C cost i).Nonempty) (hbelow : ∀ i, BddBelow (independentCenterValues C cost i)) : sInf (independentCenterTotalValues C cost) = ∑ i, sInf (independentCenterValues C cost i) := by classical choose lower hlower using hbelow have hne' := hne choose initial hinitial using hne choose z hzC hzcost using fun i => hinitial i have htotalBelow : BddBelow (independentCenterTotalValues C cost) := by refine ⟨∑ i, lower i, ?_⟩ rintro v ⟨w, hwC, rfl⟩ apply Finset.sum_le_sum intro i hi exact hlower i ⟨w i, hwC i, rfl⟩ have htotalNonempty : (independentCenterTotalValues C cost).Nonempty := ⟨∑ i, cost i (z i), z, hzC, rfl⟩ apply le_antisymm · apply le_of_forall_pos_le_add intro δ hδ let η : ℝ := δ / ((Fintype.card ι : ℝ) + 1) have hden : 0 < (Fintype.card ι : ℝ) + 1 := by positivity have hη : 0 < η := div_pos hδ hden have hbudget : (Fintype.card ι : ℝ) * η < δ := by dsimp [η] rw [show (Fintype.card ι : ℝ) * (δ / ((Fintype.card ι : ℝ) + 1)) = ((Fintype.card ι : ℝ) * δ) / ((Fintype.card ι : ℝ) + 1) by ring] rw [div_lt_iff₀ hden] have hcard : (0 : ℝ) ≤ (Fintype.card ι : ℝ) := by positivity nlinarith have happrox (i : ι) : ∃ v ∈ independentCenterValues C cost i, v < sInf (independentCenterValues C cost i) + η := Real.lt_sInf_add_pos (hne' i) hη choose v hv hvalt using happrox choose w hwC hvw using fun i => hv i have hmember : (∑ i, cost i (w i)) ∈ independentCenterTotalValues C cost := ⟨w, hwC, rfl⟩ have hinf : sInf (independentCenterTotalValues C cost) ≤ ∑ i, cost i (w i) := csInf_le htotalBelow hmember have hsum : (∑ i, cost i (w i)) ≤ ∑ i, (sInf (independentCenterValues C cost i) + η) := by apply Finset.sum_le_sum intro i hi rw [← hvw i] exact (hvalt i).le calc sInf (independentCenterTotalValues C cost) ≤ ∑ i, cost i (w i) := hinf _ ≤ ∑ i, (sInf (independentCenterValues C cost i) + η) := hsum _ = (∑ i, sInf (independentCenterValues C cost i)) + (Fintype.card ι : ℝ) * η := by rw [Finset.sum_add_distrib] simp _ ≤ (∑ i, sInf (independentCenterValues C cost i)) + δ := by linarith · apply le_csInf htotalNonempty rintro v ⟨w, hwC, rfl⟩ apply Finset.sum_le_sum intro i hi exact csInf_le ⟨lower i, hlower i⟩ ⟨w i, hwC i, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.sInf_independentCenterTotalValues_eq_sum_of_nonempty_bddBelow · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionFiniteInfimum.lean:26
theorem sInf_independentCenterTotalValues_Icc_eq_sum_of_bddBelow

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ι :
Type*
a b :
ℝ
hab :
a ≤ b
cost :
ι → ℝ → ℝ
hbelow :
∀ i, BddBelow (independentCenterValues (fun _ : ι => Icc a b) cost i)
sInf (independentCenterTotalValues (fun _ : ι => Icc a b) cost)
= ∑ i, sInf (independentCenterValues (fun _ : ι => Icc a b) cost i)
Proof (Lean source)
lemma sInf_independentCenterTotalValues_Icc_eq_sum_of_bddBelow {ι : Type*} [Fintype ι] (a b : ℝ) (hab : a ≤ b) (cost : ι → ℝ → ℝ) (hbelow : ∀ i, BddBelow (independentCenterValues (fun _ : ι => Icc a b) cost i)) : sInf (independentCenterTotalValues (fun _ : ι => Icc a b) cost) = ∑ i, sInf (independentCenterValues (fun _ : ι => Icc a b) cost i) := by apply sInf_independentCenterTotalValues_eq_sum_of_nonempty_bddBelow · intro i exact ⟨cost i a, a, ⟨le_rfl, hab⟩, rfl⟩ · exact hbelow
CausalSmith.PartialID.UnlinkedPropensityAte.sInf_independentCenterTotalValues_Icc_eq_sum_of_bddBelow · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionFiniteInfimum.lean:95
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionObjective 3 declarations The fixed-release ambiguity as a finite paired quantization objective.

The fixed-release ambiguity as a finite paired quantization objective.

theorem highResolutionCellValues_nonempty_bddBelow

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
f :
ScoreSpace ε → ℝ
g :
hg :
hOverlap :
hfpos :
∀ e, 0 < f e
i :
cost :
fun i z
=> ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x
- z| (: (LabelSpace K × Fin 2) → ℝ → ℝ)
(independentCenterValues (fun _ => Icc ε (1 - ε)) cost i).Nonempty
BddBelow (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i)
Proof (Lean source)
lemma highResolutionCellValues_nonempty_bddBelow {ε : ℝ} {K : ℕ} (f : ScoreSpace ε → ℝ) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) (i : LabelSpace K × Fin 2) : let cost : (LabelSpace K × Fin 2) → ℝ → ℝ := fun i z => ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x - z| (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i).Nonempty ∧ BddBelow (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i) := by dsimp only have hεle : ε ≤ 1 - ε := by linarith [hOverlap.2] have hcellMeas : MeasurableSet (realScoreCell g i.1) := (MeasurableEmbedding.subtype_coe measurableSet_Icc).measurableSet_image' (measurableSet_eq_fun hg measurable_const) have hcostNonneg (z : ℝ) (hz : z ∈ Icc ε (1 - ε)) : 0 ≤ ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x - z| := by apply integral_nonneg_of_ae filter_upwards [self_mem_ae_restrict hcellMeas] with x hx rcases hx with ⟨e, he, rfl⟩ exact mul_nonneg (le_of_lt (highResolutionBeta_pos hOverlap f hfpos i.2 (e : ℝ) z e.property hz)) (abs_nonneg _) constructor · refine ⟨_, ε, ⟨le_refl _, hεle⟩, rfl⟩ · refine ⟨0, ?_⟩ rintro v ⟨z, hz, rfl⟩ exact hcostNonneg z hz
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionCellValues_nonempty_bddBelow · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionObjective.lean:17
theorem independentCenterTotalValues_eq_pairedPartitionValues

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
f :
ScoreSpace ε → ℝ
g :
cost :
fun i z
=> ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x
- z| (: (LabelSpace K × Fin 2) → ℝ → ℝ)
independentCenterTotalValues (fun _ => Icc ε (1 - ε)) cost
= {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z}
Proof (Lean source)
lemma independentCenterTotalValues_eq_pairedPartitionValues {ε : ℝ} {K : ℕ} (f : ScoreSpace ε → ℝ) (g : ScoreSpace ε → LabelSpace K) : let cost : (LabelSpace K × Fin 2) → ℝ → ℝ := fun i z => ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x - z| independentCenterTotalValues (fun _ => Icc ε (1 - ε)) cost = {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} := by dsimp only ext v constructor · rintro ⟨z, hz, rfl⟩ refine ⟨fun r s => z (r, s), ?_, ?_⟩ · intro r s exact hz (r, s) · simp only [pairedPartitionCost, Fintype.sum_prod_type] · rintro ⟨z, hz, rfl⟩ refine ⟨fun i => z i.1 i.2, ?_, ?_⟩ · intro i exact hz i.1 i.2 · simp only [pairedPartitionCost, Fintype.sum_prod_type]
CausalSmith.PartialID.UnlinkedPropensityAte.independentCenterTotalValues_eq_pairedPartitionValues · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionObjective.lean:50
theorem worstCaseAmbiguity_eq_highResolutionObjective

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
g :
hg :
hOverlap :
_hfcont :
hfpos :
∀ e, 0 < f e
= sInf {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z}
Proof (Lean source)
theorem worstCaseAmbiguity_eq_highResolutionObjective {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (_hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) : worstCaseAmbiguity H g = sInf {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} := by let _ : IsProbabilityMeasure H := hDensity.probability let cost : (LabelSpace K × Fin 2) → ℝ → ℝ := fun i z => ∫ x in realScoreCell g i.1, highResolutionBeta f i.2 x z * |x - z| have hlocal (i : LabelSpace K × Fin 2) : (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i).Nonempty ∧ BddBelow (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i) := by simpa only [cost] using highResolutionCellValues_nonempty_bddBelow f g hg hOverlap hfpos i have hεle : ε ≤ 1 - ε := by linarith [hOverlap.2] have hassembly : sInf (independentCenterTotalValues (fun _ : LabelSpace K × Fin 2 => Icc ε (1 - ε)) cost) = ∑ i : LabelSpace K × Fin 2, sInf (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i) := sInf_independentCenterTotalValues_Icc_eq_sum_of_bddBelow ε (1 - ε) hεle cost (fun i => (hlocal i).2) have hscalar (r : LabelSpace K) : cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r = ∑ s : Fin 2, sInf (independentCenterValues (fun _ : LabelSpace K × Fin 2 => Icc ε (1 - ε)) cost (r, s)) := by rw [sum_cellAbsoluteDeviation_eq_highResolutionInfs H f hDensity g hg r hOverlap hfpos] rw [Fin.sum_univ_two] change sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|} + sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|} = sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 0 x z * |x - z|} + sInf {v : ℝ | ∃ z ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f 1 x z * |x - z|} exact add_comm _ _ rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] calc (∑ r : LabelSpace K, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r)) = ∑ r : LabelSpace K, ∑ s : Fin 2, sInf (independentCenterValues (fun _ : LabelSpace K × Fin 2 => Icc ε (1 - ε)) cost (r, s)) := by apply Finset.sum_congr rfl intro r hr exact hscalar r _ = ∑ i : LabelSpace K × Fin 2, sInf (independentCenterValues (fun _ => Icc ε (1 - ε)) cost i) := by rw [Fintype.sum_prod_type] _ = sInf (independentCenterTotalValues (fun _ : LabelSpace K × Fin 2 => Icc ε (1 - ε)) cost) := hassembly.symm _ = sInf {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} := by rw [independentCenterTotalValues_eq_pairedPartitionValues f g]
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_eq_highResolutionObjective · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionObjective.lean:76
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionOptimal 4 declarations Identification of optimal finite-label ambiguity with paired quantization.

Identification of optimal finite-label ambiguity with paired quantization.

theorem sInf_feasibleFiberInfs_eq_sInf_feasibleValues

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ι :
Type*
p :
ι → Prop
A :
ι → Set ℝ
hp :
∃ i, p i
hne :
∀ i
if
p i
then
(A i).Nonempty
hbelow :
BddBelow {x : ℝ | ∃ i, p i ∧ x ∈ A i}
sInf {v : ℝ | ∃ i, p i ∧ v = sInf (A i)} = sInf {x : ℝ | ∃ i, p i ∧ x ∈ A i}
Proof (Lean source)
lemma sInf_feasibleFiberInfs_eq_sInf_feasibleValues {ι : Type*} (p : ι → Prop) (A : ι → Set ℝ) (hp : ∃ i, p i) (hne : ∀ i, p i → (A i).Nonempty) (hbelow : BddBelow {x : ℝ | ∃ i, p i ∧ x ∈ A i}) : sInf {v : ℝ | ∃ i, p i ∧ v = sInf (A i)} = sInf {x : ℝ | ∃ i, p i ∧ x ∈ A i} := by rcases hbelow with ⟨lower, hlower⟩ have hfiberBelow (i : ι) (hi : p i) : BddBelow (A i) := by refine ⟨lower, ?_⟩ intro x hx exact hlower ⟨i, hi, hx⟩ have hflatBelow : BddBelow {x : ℝ | ∃ i, p i ∧ x ∈ A i} := ⟨lower, hlower⟩ have hflatNe : {x : ℝ | ∃ i, p i ∧ x ∈ A i}.Nonempty := by rcases hp with ⟨i, hi⟩ rcases hne i hi with ⟨x, hx⟩ exact ⟨x, i, hi, hx⟩ have houterNe : {v : ℝ | ∃ i, p i ∧ v = sInf (A i)}.Nonempty := by rcases hp with ⟨i, hi⟩ exact ⟨sInf (A i), i, hi, rfl⟩ have houterBelow : BddBelow {v : ℝ | ∃ i, p i ∧ v = sInf (A i)} := by refine ⟨lower, ?_⟩ rintro v ⟨i, hi, rfl⟩ apply le_csInf (hne i hi) intro x hx exact hlower ⟨i, hi, hx⟩ apply le_antisymm · apply le_csInf hflatNe rintro x ⟨i, hi, hx⟩ exact (csInf_le houterBelow ⟨i, hi, rfl⟩).trans (csInf_le (hfiberBelow i hi) hx) · apply le_csInf houterNe rintro v ⟨i, hi, rfl⟩ apply le_csInf (hne i hi) intro x hx exact csInf_le hflatBelow ⟨i, hi, hx⟩
CausalSmith.PartialID.UnlinkedPropensityAte.sInf_feasibleFiberInfs_eq_sInf_feasibleValues · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOptimal.lean:16
theorem highResolution_pairedPartitionCost_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
f :
ScoreSpace ε → ℝ
hOverlap :
hfpos :
∀ e, 0 < f e
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
z :
Fin K → Fin 2 → ℝ
hz :
∀ r s, z r s ∈ Icc ε (1 - ε)
Proof (Lean source)
lemma highResolution_pairedPartitionCost_nonneg {ε : ℝ} {K : ℕ} (f : ScoreSpace ε → ℝ) (hOverlap : Overlap ε) (hfpos : ∀ e, 0 < f e) (B : Fin K → Set ℝ) (hB : IsIntervalPartition ε (1 - ε) K B) (z : Fin K → Fin 2 → ℝ) (hz : ∀ r s, z r s ∈ Icc ε (1 - ε)) : 0 ≤ pairedPartitionCost 2 K (highResolutionBeta f) B z := by unfold pairedPartitionCost apply Finset.sum_nonneg intro r hr apply Finset.sum_nonneg intro s hs apply integral_nonneg_of_ae filter_upwards [self_mem_ae_restrict (hB.1 r)] with x hx have hxIcc : x ∈ Icc ε (1 - ε) := by rw [← hB.2.2] exact Set.mem_iUnion_of_mem r hx exact mul_nonneg (le_of_lt (highResolutionBeta_pos hOverlap f hfpos s x (z r s) hxIcc (hz r s))) (abs_nonneg _)
CausalSmith.PartialID.UnlinkedPropensityAte.highResolution_pairedPartitionCost_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOptimal.lean:55
theorem measurableReleaseValues_eq_intervalPartitionValues

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
f :
ScoreSpace ε → ℝ
{v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z}
= {v : ℝ | ∃ (B : Fin K → Set ℝ) (z : Fin K → Fin 2 → ℝ), IsIntervalPartition ε (1 - ε) K B ∧ (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) B z}
Proof (Lean source)
lemma measurableReleaseValues_eq_intervalPartitionValues {ε : ℝ} {K : ℕ} (f : ScoreSpace ε → ℝ) : {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} = {v : ℝ | ∃ (B : Fin K → Set ℝ) (z : Fin K → Fin 2 → ℝ), IsIntervalPartition ε (1 - ε) K B ∧ (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) B z} := by ext v constructor · rintro ⟨g, hg, z, hz, rfl⟩ exact ⟨realScoreCell g, z, measurableRelease_intervalPartition g hg, hz, rfl⟩ · rintro ⟨B, z, hB, hz, rfl⟩ let g := intervalPartitionRelease B hB refine ⟨g, intervalPartitionRelease_measurable B hB, z, hz, ?_⟩ unfold g have hcells : realScoreCell (intervalPartitionRelease B hB) = B := by funext r exact realScoreCell_intervalPartitionRelease B hB r rw [hcells]
CausalSmith.PartialID.UnlinkedPropensityAte.measurableReleaseValues_eq_intervalPartitionValues · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOptimal.lean:78
theorem optimalKAmbiguity_eq_optimalPairedCost

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
hDensity :
hOverlap :
hfcont :
hfpos :
∀ e, 0 < f e
hK :
0 < K
Proof (Lean source)
theorem optimalKAmbiguity_eq_optimalPairedCost {ε mf Mf : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (hOverlap : Overlap ε) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (hK : 0 < K) : optimalKAmbiguity ε K H = optimalPairedCost ε (1 - ε) 2 K (highResolutionBeta f) := by let A : (ScoreSpace ε → LabelSpace K) → Set ℝ := fun g => {v : ℝ | ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} have hεle : ε ≤ 1 - ε := by linarith [hOverlap.2] have hAne (g : ScoreSpace ε → LabelSpace K) : (A g).Nonempty := by let z : Fin K → Fin 2 → ℝ := fun _ _ => ε refine ⟨pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z, z, ?_, rfl⟩ intro r s exact ⟨le_rfl, hεle⟩ have hreleaseNe : ∃ g : ScoreSpace ε → LabelSpace K, Measurable g := by let r0 : LabelSpace K := ⟨0, hK⟩ exact ⟨fun _ => r0, measurable_const⟩ have hflatBelow : BddBelow {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ v ∈ A g} := by refine ⟨0, ?_⟩ rintro v ⟨g, hg, z, hz, rfl⟩ exact highResolution_pairedPartitionCost_nonneg f hOverlap hfpos (realScoreCell g) (measurableRelease_intervalPartition g hg) z hz have hflatten : sInf {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ v = sInf (A g)} = sInf {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ v ∈ A g} := sInf_feasibleFiberInfs_eq_sInf_feasibleValues (fun g : ScoreSpace ε → LabelSpace K => Measurable g) A hreleaseNe (fun g hg => hAne g) hflatBelow have houter : {d : ℝ | ∃ g ∈ kLabelReleases ε K, d = worstCaseAmbiguity H g} = {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ v = sInf (A g)} := by ext v constructor · rintro ⟨g, hg, rfl⟩ change Measurable g at hg refine ⟨g, hg, ?_⟩ exact worstCaseAmbiguity_eq_highResolutionObjective H f hDensity g hg hOverlap hfcont hfpos · rintro ⟨g, hg, rfl⟩ refine ⟨g, ?_, ?_⟩ · exact hg · symm exact worstCaseAmbiguity_eq_highResolutionObjective H f hDensity g hg hOverlap hfcont hfpos unfold optimalKAmbiguity optimalPairedCost rw [houter, hflatten] change sInf {v : ℝ | ∃ g : ScoreSpace ε → LabelSpace K, Measurable g ∧ ∃ z : Fin K → Fin 2 → ℝ, (∀ r s, z r s ∈ Icc ε (1 - ε)) ∧ v = pairedPartitionCost 2 K (highResolutionBeta f) (realScoreCell g) z} = _ rw [measurableReleaseValues_eq_intervalPartitionValues f]
CausalSmith.PartialID.UnlinkedPropensityAte.optimalKAmbiguity_eq_optimalPairedCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOptimal.lean:104
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionOrderedCost 2 declarations Cost bound for the ordered paired-companding release.

Cost bound for the ordered paired-companding release.

theorem highResolutionOrderedRelease_worstCaseAmbiguity_le_compandingCost

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf Mf :
ℝ
f :
ScoreSpace ε → ℝ
hDensity :
hOverlap :
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
Proof (Lean source)
lemma highResolutionOrderedRelease_worstCaseAmbiguity_le_compandingCost {ε mf Mf : ℝ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hDensity : BoundedScoreDensity H f mf Mf) (hOverlap : Overlap ε) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) : worstCaseAmbiguity H (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) ≤ pairedPartitionCost 2 k (highResolutionBeta f) (pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f)) (pairedCompandingMidpoint ε (1 - ε) 2 k (highResolutionBeta f)) := by let g := highResolutionOrderedRelease hOverlap f hfcont hfpos k hk let B := pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f) let z := pairedCompandingMidpoint ε (1 - ε) 2 k (highResolutionBeta f) have hg : Measurable g := highResolutionOrderedRelease_measurable hOverlap f hfcont hfpos k hk have hB : IsIntervalPartition ε (1 - ε) k B := highResolutionCompandingCell_partition hOverlap f hfcont hfpos k hk have hz : ∀ r s, z r s ∈ Icc ε (1 - ε) := pairedCompandingMidpoint_mem_Icc ε (1 - ε) (by linarith [hOverlap.2]) 2 k hk (highResolutionBeta f) have hcellNonneg (r : LabelSpace k) (s : Fin 2) (w : ℝ) (hw : w ∈ Icc ε (1 - ε)) : 0 ≤ ∫ x in realScoreCell g r, highResolutionBeta f s x w * |x - w| := by rw [highResolutionOrderedRelease_realScoreCell hOverlap f hfcont hfpos k hk r] apply integral_nonneg_of_ae filter_upwards [ae_restrict_mem (hB.1 r)] with x hx have hβ := highResolutionBeta_pos hOverlap f hfpos s x w (by rw [← hB.2.2] exact Set.mem_iUnion_of_mem r hx) hw exact mul_nonneg hβ.le (abs_nonneg _) have hinfLe (r : LabelSpace k) (s : Fin 2) : sInf {v : ℝ | ∃ w ∈ Icc ε (1 - ε), v = ∫ x in realScoreCell g r, highResolutionBeta f s x w * |x - w|} ≤ ∫ x in realScoreCell g r, highResolutionBeta f s x (z r s) * |x - z r s| := by apply csInf_le · refine ⟨0, ?_⟩ rintro v ⟨w, hw, rfl⟩ exact hcellNonneg r s w hw · exact ⟨z r s, hz r s, rfl⟩ rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] calc (∑ r : LabelSpace k, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r)) ≤ ∑ r : LabelSpace k, ((∫ x in realScoreCell g r, highResolutionBeta f 1 x (z r 1) * |x - z r 1|) + ∫ x in realScoreCell g r, highResolutionBeta f 0 x (z r 0) * |x - z r 0|) := by apply Finset.sum_le_sum intro r hr rw [sum_cellAbsoluteDeviation_eq_highResolutionInfs H f hDensity g hg r hOverlap hfpos] exact add_le_add (hinfLe r 1) (hinfLe r 0) _ = pairedPartitionCost 2 k (highResolutionBeta f) B z := by unfold pairedPartitionCost simp only [Fin.sum_univ_two] dsimp only [g] simp_rw [highResolutionOrderedRelease_realScoreCell hOverlap f hfcont hfpos k hk] apply Finset.sum_congr rfl intro r hr ring
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionOrderedRelease_worstCaseAmbiguity_le_compandingCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedCost.lean:16
theorem optimalKAmbiguity_le_highResolutionOrderedRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
≤ worstCaseAmbiguity H (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk)
Proof (Lean source)
lemma optimalKAmbiguity_le_highResolutionOrderedRelease {ε : ℝ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) : optimalKAmbiguity ε k H ≤ worstCaseAmbiguity H (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) := by let g := highResolutionOrderedRelease hOverlap f hfcont hfpos k hk have hg : Measurable g := highResolutionOrderedRelease_measurable hOverlap f hfcont hfpos k hk unfold optimalKAmbiguity apply csInf_le · refine ⟨0, ?_⟩ rintro d ⟨q, hq, rfl⟩ rw [(worstCaseAmbiguity_eq H q hOverlap hq).1] exact Finset.sum_nonneg fun r hr => add_nonneg (cellAbsoluteDeviation_nonneg H q hOverlap true r) (cellAbsoluteDeviation_nonneg H q hOverlap false r) · exact ⟨g, hg, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.optimalKAmbiguity_le_highResolutionOrderedRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedCost.lean:87
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionOrderedRelease 5 declarations The measurable ordered release induced by the paired companding cells.

The measurable ordered release induced by the paired companding cells.

theorem highResolutionCompandingCell_partition

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
IsIntervalPartition ε (1 - ε) k (pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f))
Proof (Lean source)
lemma highResolutionCompandingCell_partition {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) : IsIntervalPartition ε (1 - ε) k (pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f)) := by let boundary : ℕ → ℝ := fun j => pairedBoundary ε (1 - ε) 2 k j (highResolutionBeta f) have hab : ε < 1 - ε := by linarith [hOverlap.2] have hmono : ∀ i j, i ≤ j → j ≤ k → boundary i ≤ boundary j := by intro i j hij hj exact pairedBoundary_mono ε (1 - ε) hab.le 2 k i j hk hij hj (highResolutionBeta f) have hpart := orderedIntervalCells_partition boundary k hk hmono have hzero : boundary 0 = ε := pairedBoundary_zero ε (1 - ε) hab.le 2 k (highResolutionBeta f) have hlast : boundary k = 1 - ε := pairedBoundary_last ε (1 - ε) hab 2 k (by norm_num) hk (highResolutionBeta f) (highResolutionBeta_continuousOn hOverlap f hfcont) (highResolutionBeta_pos hOverlap f hfpos) rw [hzero, hlast] at hpart exact hpart
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionCompandingCell_partition · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedRelease.lean:16
def highResolutionOrderedRelease

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
highResolutionOrderedRelease hOverlap f hfcont hfpos k hk :
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionOrderedRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedRelease.lean:41
theorem highResolutionOrderedRelease_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
Measurable (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk)
Proof (Lean source)
lemma highResolutionOrderedRelease_measurable {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) : Measurable (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) := by unfold highResolutionOrderedRelease exact intervalPartitionRelease_measurable _ _
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionOrderedRelease_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedRelease.lean:50
theorem highResolutionOrderedRelease_realScoreCell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
r :
realScoreCell (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) r
Proof (Lean source)
lemma highResolutionOrderedRelease_realScoreCell {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) (r : LabelSpace k) : realScoreCell (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) r = pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f) r := by unfold highResolutionOrderedRelease exact realScoreCell_intervalPartitionRelease _ _ r
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionOrderedRelease_realScoreCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedRelease.lean:59
theorem highResolutionOrderedRelease_cell_ordConnected

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
f :
ScoreSpace ε → ℝ
hfcont :
hfpos :
∀ e, 0 < f e
k :
ℕ
hk :
0 < k
r :
(cell (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) r).OrdConnected
Proof (Lean source)
lemma highResolutionOrderedRelease_cell_ordConnected {ε : ℝ} (hOverlap : Overlap ε) (f : ScoreSpace ε → ℝ) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) (k : ℕ) (hk : 0 < k) (r : LabelSpace k) : (cell (highResolutionOrderedRelease hOverlap f hfcont hfpos k hk) r).OrdConnected := by let B := pairedCompandingCell ε (1 - ε) 2 k (highResolutionBeta f) let hB := highResolutionCompandingCell_partition hOverlap f hfcont hfpos k hk have hBorder : (B r).OrdConnected := by dsimp [B, pairedCompandingCell] split_ifs · exact ordConnected_Icc · exact ordConnected_Ico rw [ordConnected_iff] intro x hx y hy hxy z hz change highResolutionOrderedRelease hOverlap f hfcont hfpos k hk z = r have hxB : (x : ℝ) ∈ B r := by exact (intervalPartitionRelease_eq_iff B hB x r).mp hx have hyB : (y : ℝ) ∈ B r := by exact (intervalPartitionRelease_eq_iff B hB y r).mp hy apply (intervalPartitionRelease_eq_iff B hB z r).mpr rw [ordConnected_iff] at hBorder exact hBorder (x : ℝ) hxB (y : ℝ) hyB hxy ⟨hz.1, hz.2⟩
CausalSmith.PartialID.UnlinkedPropensityAte.highResolutionOrderedRelease_cell_ordConnected · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionOrderedRelease.lean:70
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.HighResolutionPartitionRelease 6 declarations Equivalence between measurable finite score partitions and releases.

Equivalence between measurable finite score partitions and releases.

def intervalPartitionRelease

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
e :
intervalPartitionRelease B hB e :
by have he : (e : ℝ) ∈ ⋃ r, B r := by rw [hB.2.2] exact e.property exact choose (Set.mem_iUnion.mp he)
CausalSmith.PartialID.UnlinkedPropensityAte.intervalPartitionRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:14
theorem intervalPartitionRelease_mem

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
e :
(e : ℝ) ∈ B (intervalPartitionRelease B hB e)
Proof (Lean source)
lemma intervalPartitionRelease_mem {ε : ℝ} {K : ℕ} (B : Fin K → Set ℝ) (hB : IsIntervalPartition ε (1 - ε) K B) (e : ScoreSpace ε) : (e : ℝ) ∈ B (intervalPartitionRelease B hB e) := by unfold intervalPartitionRelease exact Classical.choose_spec (Set.mem_iUnion.mp (by rw [hB.2.2] exact e.property))
CausalSmith.PartialID.UnlinkedPropensityAte.intervalPartitionRelease_mem · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:23
theorem intervalPartitionRelease_eq_iff

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
e :
r :
intervalPartitionRelease B hB e = r ↔ (e : ℝ) ∈ B r
Proof (Lean source)
lemma intervalPartitionRelease_eq_iff {ε : ℝ} {K : ℕ} (B : Fin K → Set ℝ) (hB : IsIntervalPartition ε (1 - ε) K B) (e : ScoreSpace ε) (r : LabelSpace K) : intervalPartitionRelease B hB e = r ↔ (e : ℝ) ∈ B r := by constructor · intro h simpa [h] using intervalPartitionRelease_mem B hB e · intro her by_contra hne have hdis := hB.2.1 (intervalPartitionRelease B hB e) r hne exact Set.disjoint_left.mp hdis (intervalPartitionRelease_mem B hB e) her
CausalSmith.PartialID.UnlinkedPropensityAte.intervalPartitionRelease_eq_iff · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:34
theorem intervalPartitionRelease_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
Proof (Lean source)
lemma intervalPartitionRelease_measurable {ε : ℝ} {K : ℕ} (B : Fin K → Set ℝ) (hB : IsIntervalPartition ε (1 - ε) K B) : Measurable (intervalPartitionRelease B hB) := by apply measurable_to_countable' intro r have hpre : intervalPartitionRelease B hB ⁻¹' {r} = (Subtype.val : ScoreSpace ε → ℝ) ⁻¹' B r := by ext e simp only [Set.mem_preimage, Set.mem_singleton_iff] exact intervalPartitionRelease_eq_iff B hB e r rw [hpre] exact (hB.1 r).preimage measurable_subtype_coe
CausalSmith.PartialID.UnlinkedPropensityAte.intervalPartitionRelease_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:49
theorem realScoreCell_intervalPartitionRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
B :
Fin K → Set ℝ
hB :
IsIntervalPartition ε (1 - ε) K B
r :
Proof (Lean source)
lemma realScoreCell_intervalPartitionRelease {ε : ℝ} {K : ℕ} (B : Fin K → Set ℝ) (hB : IsIntervalPartition ε (1 - ε) K B) (r : LabelSpace K) : realScoreCell (intervalPartitionRelease B hB) r = B r := by ext x constructor · rintro ⟨e, he, rfl⟩ exact (intervalPartitionRelease_eq_iff B hB e r).mp he · intro hx have hxUnion : x ∈ ⋃ j, B j := Set.mem_iUnion_of_mem r hx have hxIcc : x ∈ Icc ε (1 - ε) := by rw [← hB.2.2] exact hxUnion let e : ScoreSpace ε := ⟨x, hxIcc⟩ refine ⟨e, ?_, rfl⟩ exact (intervalPartitionRelease_eq_iff B hB e r).mpr hx
CausalSmith.PartialID.UnlinkedPropensityAte.realScoreCell_intervalPartitionRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:64
theorem measurableRelease_intervalPartition

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.measurableRelease_intervalPartition · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/HighResolutionPartitionRelease.lean:83
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.Inference 11 declarations Finite-sample honest intervals for the known-score experiment.

Finite-sample honest intervals for the known-score experiment.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
n K :
ℕ
TrialSample n K :
Type
CausalSmith.PartialID.UnlinkedPropensityAte.TrialSample · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:17

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
n K :
ℕ
lo :
TrialSample n K → ℝ
hi :
TrialSample n K → ℝ
measurable_lo :
measurable_hi :
lower_bound :
∀ x, -1 ≤ lo x
ordered :
∀ x, lo x ≤ hi x
upper_bound :
∀ x, hi x ≤ 1
CausalSmith.PartialID.UnlinkedPropensityAte.IntervalProcedure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:21
def contains

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
K :
ℕ
shared
n :
ℕ
shared
x :
θ :
ℝ
contains C x θ :
Prop
θ ∈ Icc (C.lo x) (C.hi x)
CausalSmith.PartialID.UnlinkedPropensityAte.IntervalProcedure.contains · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:30
def length

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
K :
ℕ
shared
n :
ℕ
shared
x :
length C x :
ℝ
C.hi x - C.lo x
CausalSmith.PartialID.UnlinkedPropensityAte.IntervalProcedure.length · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:33
def equalWidthMidpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
r :
equalWidthMidpoint ε K r :
ℝ
ε + ((r.val : ℝ) + 1 / 2) * (1 - 2 * ε) / K
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthMidpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:37

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
n K :
ℕ
x :
midpointWeightedCenter ε n K x :
ℝ
(n : ℝ)⁻¹ * ∑ i : Fin n, if (x i).2.1 then ((x i).2.2 : ℝ) / equalWidthMidpoint ε K (x i).1 else -((x i).2.2 : ℝ) / (1 - equalWidthMidpoint ε K (x i).1)
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedCenter · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:41

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε α :
ℝ
n K :
ℕ
midpointWeightedRadius ε α n K :
ℝ
(4 / ε) * sqrt (log (4 / α) / n) + (1 - 2 * ε) / (2 * K * ε * (1 - ε))
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRadius · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:50

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
x :
ℝ
clampATE x :
ℝ
max (-1) (min 1 x)
CausalSmith.PartialID.UnlinkedPropensityAte.clampATE · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:54
def IIDTrialSampling

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
K :
ℕ
shared
n :
ℕ
shared
trialLaw :
P :
IIDTrialSampling trialLaw :
Prop
trialLaw P = Measure.pi (fun _ : Fin n => releasedLaw P)
CausalSmith.PartialID.UnlinkedPropensityAte.IIDTrialSampling · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:58
def honestProcedures

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
n K :
ℕ
H :
α :
ℝ
honestProcedures n K H α :
{gC | gC.1 ∈ kLabelReleases ε K ∧ ∀ P ∈ CausalLaws H gC.1, 1 - α ≤ (Measure.pi (fun _ : Fin n => releasedLaw P)).real {x | gC.2.contains x (ate P)}}
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedures · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:65
def minimaxHonestLength

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
shared
n K :
ℕ
H :
α :
ℝ
minimaxHonestLength n K H α :
ℝ
sInf {v : ℝ | ∃ gC ∈ honestProcedures n K H α, v = sSup {u : ℝ | ∃ P ∈ CausalLaws H gC.1, u = ∫ x, gC.2.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}}
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Inference.lean:75
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.InferenceMidpointBias 5 declarations Population bias of the equal-width midpoint inverse-propensity statistic.

Population bias of the equal-width midpoint inverse-propensity statistic.

def midpointWeightedRow

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
z :
midpointWeightedRow ε K z :
ℝ
if z.2.1 then (z.2.2 : ℝ) / equalWidthMidpoint ε K z.1 else -(z.2.2 : ℝ) / (1 - equalWidthMidpoint ε K z.1)
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRow · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointBias.lean:17
theorem midpointWeightedCenter_eq_rowMean

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
n K :
ℕ
x :
midpointWeightedCenter ε n K x = (n : ℝ)⁻¹ * ∑ i : Fin n, midpointWeightedRow ε K (x i)
Proof (Lean source)
lemma midpointWeightedCenter_eq_rowMean (ε : ℝ) (n K : ℕ) (x : TrialSample n K) : midpointWeightedCenter ε n K x = (n : ℝ)⁻¹ * ∑ i : Fin n, midpointWeightedRow ε K (x i) := by rfl
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedCenter_eq_rowMean · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointBias.lean:24
theorem score_sub_equalWidthMidpoint_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
K :
ℕ
hK :
0 < K
e :
|(e : ℝ) - equalWidthMidpoint ε K (equalWidthRelease ε K hK e)| ≤ (1 - 2 * ε) / (2 * K)
Proof (Lean source)
lemma score_sub_equalWidthMidpoint_abs_le {ε : ℝ} (hOverlap : Overlap ε) (K : ℕ) (hK : 0 < K) (e : ScoreSpace ε) : |(e : ℝ) - equalWidthMidpoint ε K (equalWidthRelease ε K hK e)| ≤ (1 - 2 * ε) / (2 * K) := by let r := equalWidthRelease ε K hK e have he : e ∈ cell (equalWidthRelease ε K hK) r := by rfl have hb := equalWidthRelease_cell_subset_closedBin hOverlap hK r he have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have hw : 0 ≤ (1 - 2 * ε) / K := div_nonneg (by linarith [hOverlap.2]) hKreal.le have hhalf : (1 - 2 * ε) / (2 * K) = ((1 - 2 * ε) / K) / 2 := by field_simp rw [abs_le] rw [hhalf] constructor <;> dsimp [equalWidthMidpoint, r] at hb ⊢ <;> ring_nf at hb ⊢ <;> linarith
CausalSmith.PartialID.UnlinkedPropensityAte.score_sub_equalWidthMidpoint_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointBias.lean:31
theorem equalWidthMidpoint_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
K :
ℕ
hK :
0 < K
r :
equalWidthMidpoint ε K r ∈ Icc ε (1 - ε)
Proof (Lean source)
lemma equalWidthMidpoint_mem_Icc {ε : ℝ} (hOverlap : Overlap ε) (K : ℕ) (hK : 0 < K) (r : LabelSpace K) : equalWidthMidpoint ε K r ∈ Icc ε (1 - ε) := by have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have hwidth : 0 < 1 - 2 * ε := by linarith [hOverlap.2] have hr0 : 0 ≤ (r : ℝ) := by positivity have hrK : (r : ℝ) + (1 / 2 : ℝ) ≤ (K : ℝ) := by have hrCast : (r : ℝ) + 1 ≤ (K : ℝ) := by exact_mod_cast (Nat.succ_le_iff.mpr r.isLt) linarith constructor · unfold equalWidthMidpoint apply le_add_of_nonneg_right exact div_nonneg (mul_nonneg (by linarith) hwidth.le) hKreal.le · unfold equalWidthMidpoint have hratio : ((r : ℝ) + (1 / 2 : ℝ)) / K ≤ 1 := (div_le_one hKreal).mpr hrK calc ε + ((r : ℕ) + (1 / 2 : ℝ)) * (1 - 2 * ε) / K = ε + (((r : ℝ) + (1 / 2 : ℝ)) / K) * (1 - 2 * ε) := by ring _ ≤ ε + 1 * (1 - 2 * ε) := by gcongr _ ≤ 1 - ε := by ring_nf; linarith
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthMidpoint_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointBias.lean:52
theorem midpointWeightedRow_integral_sub_ate_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
K :
ℕ
hK :
0 < K
H :
P :
hP :
P ∈ CausalLaws H (equalWidthRelease ε K hK)
|(∫ z, midpointWeightedRow ε K z ∂releasedLaw P) - ate P|
≤ (1 - 2 * ε) / (2 * K * ε * (1 - ε))
Proof (Lean source)
lemma midpointWeightedRow_integral_sub_ate_abs_le {ε : ℝ} (hOverlap : Overlap ε) (K : ℕ) (hK : 0 < K) (H : Measure (ScoreSpace ε)) (P : Measure (FullRow ε K)) (hP : P ∈ CausalLaws H (equalWidthRelease ε K hK)) : |(∫ z, midpointWeightedRow ε K z ∂releasedLaw P) - ate P| ≤ (1 - 2 * ε) / (2 * K * ε * (1 - ε)) := by letI : IsProbabilityMeasure P := hP.1 let μ := P.map (latentTriple (ε := ε) (J := K)) have hlatent : Measurable (latentTriple (ε := ε) (J := K)) := by unfold latentTriple score outcome0 outcome1 fun_prop letI : IsProbabilityMeasure μ := Measure.isProbabilityMeasure_map hlatent.aemeasurable let B := (1 - 2 * ε) / (2 * K * ε * (1 - ε)) have hB0 : 0 ≤ B := by dsimp [B] apply div_nonneg · linarith [hOverlap.2] · have hε1 : 0 < 1 - ε := by linarith [hOverlap.2] have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK exact (mul_pos (mul_pos (mul_pos (by norm_num) hKreal) hOverlap.1) hε1).le have hbiasInt : Integrable (midpointLatentBias ε K hK) μ := by apply Integrable.of_bound (midpointLatentBias_measurable ε K hK).aestronglyMeasurable B filter_upwards [] with x rw [Real.norm_eq_abs] exact midpointLatentBias_abs_le hOverlap K hK x rw [midpoint_populationBias_eq_integral hOverlap K hK P hP.2.randomizedAssignment hP.2.consistency hP.2.deterministicRelease] change |∫ x, midpointLatentBias ε K hK x ∂μ| ≤ B calc |∫ x, midpointLatentBias ε K hK x ∂μ| ≤ ∫ x, |midpointLatentBias ε K hK x| ∂μ := MeasureTheory.abs_integral_le_integral_abs _ ≤ ∫ _x, B ∂μ := by apply integral_mono hbiasInt.abs (integrable_const B) exact midpointLatentBias_abs_le hOverlap K hK _ = B := by simp
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRow_integral_sub_ate_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointBias.lean:368
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.InferenceMidpointConcentration 2 declarations Product-law concentration of the equal-width midpoint statistic.

Product-law concentration of the equal-width midpoint statistic.

theorem midpointWeightedRow_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
K :
ℕ
hK :
0 < K
z :
midpointWeightedRow ε K z ∈ Icc (-ε⁻¹) ε⁻¹
Proof (Lean source)
lemma midpointWeightedRow_mem_Icc {ε : ℝ} (hOverlap : Overlap ε) (K : ℕ) (hK : 0 < K) (z : Observation K) : midpointWeightedRow ε K z ∈ Icc (-ε⁻¹) ε⁻¹ := by have hm := equalWidthMidpoint_mem_Icc hOverlap K hK z.1 have hε : 0 < ε := hOverlap.1 have hm0 : 0 < equalWidthMidpoint ε K z.1 := hε.trans_le hm.1 have hm1 : 0 < 1 - equalWidthMidpoint ε K z.1 := by linarith [hm.2, hOverlap.1] by_cases ha : z.2.1 = true · simp only [midpointWeightedRow, ha, ↓reduceIte] constructor · exact (div_nonneg z.2.2.property.1 hm0.le).trans' (neg_nonpos.mpr (inv_nonneg.mpr hε.le)) · have hinv := (inv_le_inv₀ hm0 hε).mpr hm.1 calc (z.2.2 : ℝ) / equalWidthMidpoint ε K z.1 ≤ 1 / equalWidthMidpoint ε K z.1 := div_le_div_of_nonneg_right z.2.2.property.2 hm0.le _ ≤ ε⁻¹ := by simpa [one_div] using hinv · have ha' : z.2.1 = false := Bool.eq_false_of_not_eq_true ha simp only [midpointWeightedRow, ha', Bool.false_eq_true, ↓reduceIte] have hmLower : ε ≤ 1 - equalWidthMidpoint ε K z.1 := by linarith [hm.2] have hinv := (inv_le_inv₀ hm1 hε).mpr hmLower have hy : (z.2.2 : ℝ) / (1 - equalWidthMidpoint ε K z.1) ≤ ε⁻¹ := by calc (z.2.2 : ℝ) / (1 - equalWidthMidpoint ε K z.1) ≤ 1 / (1 - equalWidthMidpoint ε K z.1) := div_le_div_of_nonneg_right z.2.2.property.2 hm1.le _ ≤ ε⁻¹ := by simpa [one_div] using hinv rw [neg_div] constructor · exact neg_le_neg hy · exact (neg_nonpos.mpr (div_nonneg z.2.2.property.1 hm1.le)).trans (inv_nonneg.mpr hε.le)
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRow_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointConcentration.lean:25
theorem midpointWeightedCenter_deviation_probability_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
K n :
ℕ
hK :
0 < K
hn :
0 < n
(Measure.pi (fun _ : Fin n => P)).real {x | (4 / ε) * sqrt (log (4 / α) / n) ≤ |midpointWeightedCenter ε n K x - ∫ z, midpointWeightedRow ε K z ∂P|}
≤ α
Proof (Lean source)
lemma midpointWeightedCenter_deviation_probability_le {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (K n : ℕ) (hK : 0 < K) (hn : 0 < n) (P : Measure (Observation K)) [IsProbabilityMeasure P] : (Measure.pi (fun _ : Fin n => P)).real {x | (4 / ε) * sqrt (log (4 / α) / n) ≤ |midpointWeightedCenter ε n K x - ∫ z, midpointWeightedRow ε K z ∂P|} ≤ α := by let S := Causalean.Stat.iidSample_infinitePi P let ψ : (ℕ → Observation K) → (Fin n → Observation K) := fun ω k => S.Z k ω let t := (4 / ε) * sqrt (log (4 / α) / n) let A : Set (Fin n → Observation K) := {x | t ≤ |midpointWeightedCenter ε n K x - ∫ z, midpointWeightedRow ε K z ∂P|} have hψ : Measurable ψ := Causalean.Stat.iidSample_finN_measurable S n have hA : MeasurableSet A := by dsimp [A, t] apply measurableSet_le measurable_const have hcenter : Measurable (midpointWeightedCenter ε n K) := by rw [show midpointWeightedCenter ε n K = fun x : TrialSample n K => (n : ℝ)⁻¹ * ∑ i : Fin n, midpointWeightedRow ε K (x i) from funext (midpointWeightedCenter_eq_rowMean ε n K)] exact measurable_const.mul (Finset.measurable_fun_sum univ fun i _ => (midpointWeightedRow_measurable' ε K).comp (measurable_pi_apply i)) exact (hcenter.sub measurable_const).abs have hpush : (Measure.infinitePi (fun _ : ℕ => P)).map ψ = Measure.pi (fun _ : Fin n => P) := Causalean.Stat.iidSample_finN_pushforward S n have hmeasure : (Measure.infinitePi (fun _ : ℕ => P)).real (ψ ⁻¹' A) = (Measure.pi (fun _ : Fin n => P)).real A := by simp only [measureReal_def] rw [← hpush, Measure.map_apply hψ hA] have hevent : ψ ⁻¹' A = {ω | t ≤ |S.sampleMean (midpointWeightedRow ε K) n ω - ∫ z, midpointWeightedRow ε K z ∂P|} := by ext ω dsimp [A, ψ, t, sampleMean] rw [midpointWeightedCenter_eq_rowMean] rw [Fin.sum_univ_eq_sum_range (fun i => midpointWeightedRow ε K (S.Z i ω)) n] have ht0 : 0 ≤ t := by dsimp [t] exact mul_nonneg (div_nonneg (by norm_num) hOverlap.1.le) (Real.sqrt_nonneg _) have htail := hoeffding_abs_ge S (midpointWeightedRow_measurable' ε K) (a := -ε⁻¹) (b := ε⁻¹) (by have hi : 0 < ε⁻¹ := inv_pos.mpr hOverlap.1; linarith) (ae_of_all P (midpointWeightedRow_mem_Icc hOverlap K hK)) n hn ht0 have hrhs := midpointRadius_hoeffding_rhs_le hOverlap hα n hn change (Measure.pi (fun _ : Fin n => P)).real A ≤ α rw [← hmeasure, hevent] exact htail.trans hrhs
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedCenter_deviation_probability_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointConcentration.lean:101
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.InferenceMidpointProcedure 16 declarations The explicit midpoint-weighted honest interval procedure.

The explicit midpoint-weighted honest interval procedure.

theorem midpointWeightedRow_measurable''

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
Proof (Lean source)
lemma midpointWeightedRow_measurable'' (ε : ℝ) (K : ℕ) : Measurable (midpointWeightedRow ε K) := by unfold midpointWeightedRow equalWidthMidpoint apply Measurable.ite · exact measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const · fun_prop · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRow_measurable'' · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:14
theorem midpointWeightedCenter_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
n K :
ℕ
Proof (Lean source)
lemma midpointWeightedCenter_measurable (ε : ℝ) (n K : ℕ) : Measurable (midpointWeightedCenter ε n K) := by rw [show midpointWeightedCenter ε n K = fun x : TrialSample n K => (n : ℝ)⁻¹ * ∑ i : Fin n, midpointWeightedRow ε K (x i) from funext (midpointWeightedCenter_eq_rowMean ε n K)] exact measurable_const.mul (Finset.measurable_fun_sum univ fun i _ => (midpointWeightedRow_measurable'' ε K).comp (measurable_pi_apply i))
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedCenter_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:22
theorem clampATE_measurable

This result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma clampATE_measurable : Measurable clampATE := by unfold clampATE fun_prop
theorem clampATE_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x :
ℝ
clampATE x ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma clampATE_mem_Icc (x : ℝ) : clampATE x ∈ Icc (-1 : ℝ) 1 := by unfold clampATE exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _ )⟩
theorem clampATE_mono

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y :
ℝ
hxy :
x ≤ y
Proof (Lean source)
lemma clampATE_mono {x y : ℝ} (hxy : x ≤ y) : clampATE x ≤ clampATE y := by unfold clampATE exact max_le_max (le_refl (-1 : ℝ)) (min_le_min (le_refl (1 : ℝ)) hxy)
theorem clampATE_abs_sub_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x y :
ℝ
|clampATE x - clampATE y| ≤ |x - y|
Proof (Lean source)
lemma clampATE_abs_sub_le (x y : ℝ) : |clampATE x - clampATE y| ≤ |x - y| := by unfold clampATE calc |max (-1) (min 1 x) - max (-1) (min 1 y)| = |max (min 1 x) (-1) - max (min 1 y) (-1)| := by rw [max_comm (-1), max_comm (-1)] _ ≤ |min 1 x - min 1 y| := abs_max_sub_max_le_abs _ _ _ _ ≤ |x - y| := by simpa using (abs_min_sub_min_le_max (1 : ℝ) x 1 y)
theorem midpointWeightedRadius_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
0 ≤ midpointWeightedRadius ε α n K
Proof (Lean source)
lemma midpointWeightedRadius_nonneg {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) : 0 ≤ midpointWeightedRadius ε α n K := by unfold midpointWeightedRadius have hlog : 0 ≤ log (4 / α) := by apply Real.log_nonneg rw [le_div_iff₀ hα.1] linarith [hα.2] have hnR : 0 ≤ (n : ℝ) := by positivity have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have hε1 : 0 < 1 - ε := by linarith [hOverlap.2] apply add_nonneg · exact mul_nonneg (div_nonneg (by norm_num) hOverlap.1.le) (Real.sqrt_nonneg _) · apply div_nonneg · linarith [hOverlap.2] · exact (mul_pos (mul_pos (mul_pos (by norm_num) hKreal) hOverlap.1) hε1).le
CausalSmith.PartialID.UnlinkedPropensityAte.midpointWeightedRadius_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:54
def midpointInterval

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
midpointInterval hOverlap hα n K hn hK :
clause 1
clause 2
clause 3
measurable_lo := clampATE_measurable.comp ((midpointWeightedCenter_measurable ε n K).sub measurable_const)
clause 4
measurable_hi := clampATE_measurable.comp ((midpointWeightedCenter_measurable ε n K).add measurable_const)
clause 5
lower_bound x := (clampATE_mem_Icc _).1
clause 6
ordered x := clampATE_mono (by have hr := midpointWeightedRadius_nonneg hOverlap hα n K hn hK linarith)
clause 7
upper_bound x := (clampATE_mem_Icc _).2
theorem midpointInterval_lo

Given overlap, the miscoverage range, positive sample and label sizes, and a released sample, the midpoint interval's lower endpoint is the clamped midpoint-weighted center minus its prescribed radius.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
x :
(midpointInterval hOverlap hα n K hn hK).lo x
Proof (Lean source)
@[simp] lemma midpointInterval_lo {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) (x : TrialSample n K) : (midpointInterval hOverlap hα n K hn hK).lo x = clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K) := rfl
theorem midpointInterval_hi

Given overlap, the miscoverage range, positive sample and label sizes, and a released sample, the midpoint interval's upper endpoint is the clamped midpoint-weighted center plus its prescribed radius.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
x :
(midpointInterval hOverlap hα n K hn hK).hi x
Proof (Lean source)
@[simp] lemma midpointInterval_hi {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) (x : TrialSample n K) : (midpointInterval hOverlap hα n K hn hK).hi x = clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K) := rfl
theorem midpointInterval_length_le_two_radius

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
x :
(midpointInterval hOverlap hα n K hn hK).length x ≤ 2 * midpointWeightedRadius ε α n K
Proof (Lean source)
lemma midpointInterval_length_le_two_radius {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) (x : TrialSample n K) : (midpointInterval hOverlap hα n K hn hK).length x ≤ 2 * midpointWeightedRadius ε α n K := by unfold IntervalProcedure.length rw [midpointInterval_lo, midpointInterval_hi] have hord := (midpointInterval hOverlap hα n K hn hK).ordered x calc clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K) - clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K) ≤ |clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K) - clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K)| := le_abs_self _ _ ≤ |(midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K) - (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K)| := clampATE_abs_sub_le _ _ _ = 2 * midpointWeightedRadius ε α n K := by rw [abs_of_nonneg] · ring · have := midpointWeightedRadius_nonneg hOverlap hα n K hn hK linarith
CausalSmith.PartialID.UnlinkedPropensityAte.midpointInterval_length_le_two_radius · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:141
theorem equalWidth_midpointInterval_honest

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
(equalWidthRelease ε K hK, midpointInterval hOverlap hα n K hn hK) ∈ honestProcedures n K H α
Proof (Lean source)
lemma equalWidth_midpointInterval_honest {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (n K : ℕ) (hn : 0 < n) (hK : 0 < K) : (equalWidthRelease ε K hK, midpointInterval hOverlap hα n K hn hK) ∈ honestProcedures n K H α := by refine ⟨equalWidthRelease_measurable ε K hK, ?_⟩ intro P hP letI : IsProbabilityMeasure P := hP.1 let Q := releasedLaw P have hrecord : Measurable (releasedRecord (ε := ε) (J := K)) := by unfold releasedRecord label arm observed fun_prop letI : IsProbabilityMeasure Q := by dsimp [Q, releasedLaw] exact Measure.isProbabilityMeasure_map hrecord.aemeasurable let μ := Measure.pi (fun _ : Fin n => Q) letI : IsProbabilityMeasure μ := by dsimp [μ] infer_instance let t := (4 / ε) * sqrt (log (4 / α) / n) let m := ∫ z, midpointWeightedRow ε K z ∂Q let bad : Set (TrialSample n K) := {x | t ≤ |midpointWeightedCenter ε n K x - m|} have hbadMeas : MeasurableSet bad := by dsimp [bad, t, m] exact measurableSet_le measurable_const ((midpointWeightedCenter_measurable ε n K).sub measurable_const).abs have hbad : μ.real bad ≤ α := by dsimp [μ, bad, t, m, Q] exact midpointWeightedCenter_deviation_probability_le hOverlap hα K n hK hn (releasedLaw P) have hgoodProb : 1 - α ≤ μ.real badᶜ := by rw [MeasureTheory.measureReal_compl hbadMeas] rw [MeasureTheory.probReal_univ] linarith apply hgoodProb.trans refine measureReal_mono ?_ (measure_ne_top μ _) intro x hx have hxdev : |midpointWeightedCenter ε n K x - m| < t := by exact not_le.mp hx have hbias := midpointWeightedRow_integral_sub_ate_abs_le hOverlap K hK H P hP change |m - ate P| ≤ (1 - 2 * ε) / (2 * K * ε * (1 - ε)) at hbias have hdist : |midpointWeightedCenter ε n K x - ate P| ≤ midpointWeightedRadius ε α n K := by calc |midpointWeightedCenter ε n K x - ate P| ≤ |midpointWeightedCenter ε n K x - m| + |m - ate P| := abs_sub_le _ _ _ _ ≤ t + (1 - 2 * ε) / (2 * K * ε * (1 - ε)) := add_le_add hxdev.le hbias _ = midpointWeightedRadius ε α n K := by rfl have hbounds := abs_le.mp hdist have hθ := ate_mem_Icc P change ate P ∈ Icc ((midpointInterval hOverlap hα n K hn hK).lo x) ((midpointInterval hOverlap hα n K hn hK).hi x) rw [midpointInterval_lo, midpointInterval_hi] exact clampATE_interval_contains hθ (by linarith) (by linarith)
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidth_midpointInterval_honest · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:165
def midpointLengthConstant

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε α :
ℝ
midpointLengthConstant ε α :
ℝ
(1 - 2 * ε) / (ε * (1 - ε)) + (8 / ε) * sqrt (log (4 / α))
CausalSmith.PartialID.UnlinkedPropensityAte.midpointLengthConstant · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:229
theorem two_midpointWeightedRadius_le_rate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
Proof (Lean source)
lemma two_midpointWeightedRadius_le_rate {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) : 2 * midpointWeightedRadius ε α n K ≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by have hlog : 0 ≤ log (4 / α) := by apply Real.log_nonneg rw [le_div_iff₀ hα.1] linarith [hα.2] have hε : 0 < ε := hOverlap.1 have hε1 : 0 < 1 - ε := by linarith [hOverlap.2] have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have hnreal : 0 < (n : ℝ) := by exact_mod_cast hn let D := (1 - 2 * ε) / (ε * (1 - ε)) let A := (8 / ε) * sqrt (log (4 / α)) have hD : 0 ≤ D := by dsimp [D] exact div_nonneg (by linarith [hOverlap.2]) (mul_pos hε hε1).le have hA : 0 ≤ A := by dsimp [A] exact mul_nonneg (div_nonneg (by norm_num) hε.le) (Real.sqrt_nonneg _) have hKinv : 0 ≤ (K : ℝ)⁻¹ := inv_nonneg.mpr hKreal.le have hninv : 0 ≤ (sqrt (n : ℝ))⁻¹ := inv_nonneg.mpr (Real.sqrt_nonneg _) have hradius : 2 * midpointWeightedRadius ε α n K = A * (sqrt (n : ℝ))⁻¹ + D * (K : ℝ)⁻¹ := by unfold midpointWeightedRadius rw [Real.sqrt_div hlog] dsimp [A, D] field_simp ring rw [hradius] change A * (sqrt (n : ℝ))⁻¹ + D * (K : ℝ)⁻¹ ≤ (D + A) * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) nlinarith [mul_nonneg hD hninv, mul_nonneg hA hKinv]
CausalSmith.PartialID.UnlinkedPropensityAte.two_midpointWeightedRadius_le_rate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:233
theorem midpointInterval_expectedLength_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
(∫ x, (midpointInterval hOverlap hα n K hn hK).length x ∂Measure.pi (fun _ : Fin n => Q))
≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
Proof (Lean source)
lemma midpointInterval_expectedLength_le {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (n K : ℕ) (hn : 0 < n) (hK : 0 < K) (Q : Measure (Observation K)) [IsProbabilityMeasure Q] : (∫ x, (midpointInterval hOverlap hα n K hn hK).length x ∂Measure.pi (fun _ : Fin n => Q)) ≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by let C := midpointInterval hOverlap hα n K hn hK let μ := Measure.pi (fun _ : Fin n => Q) letI : IsProbabilityMeasure μ := by dsimp [μ] infer_instance have hlenInt : Integrable C.length μ := by apply Integrable.of_bound (C.measurable_hi.sub C.measurable_lo).aestronglyMeasurable 2 filter_upwards [] with x have hlo := C.lower_bound x have hord := C.ordered x have hhi := C.upper_bound x change |C.hi x - C.lo x| ≤ 2 rw [abs_of_nonneg (sub_nonneg.mpr hord)] linarith have hpoint (x : TrialSample n K) : C.length x ≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by exact (midpointInterval_length_le_two_radius hOverlap hα n K hn hK x).trans (two_midpointWeightedRadius_le_rate hOverlap hα n K hn hK) change (∫ x, C.length x ∂μ) ≤ _ calc (∫ x, C.length x ∂μ) ≤ ∫ _x, midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ∂μ := by apply integral_mono hlenInt (integrable_const _) exact hpoint _ = midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by simp
CausalSmith.PartialID.UnlinkedPropensityAte.midpointInterval_expectedLength_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:272
theorem exists_equalWidth_midpointInterval

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
∃ CI : IntervalProcedure n K,
(equalWidthRelease ε K hK, CI) ∈ honestProcedures n K H α
conclusion 1
x :
CI.lo x = clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K)
CI.hi x = clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K)
conclusion 2
P ∈ CausalLaws H (equalWidthRelease ε K hK) :
(∫ x, CI.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P)))
≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
Proof (Lean source)
lemma exists_equalWidth_midpointInterval {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (n K : ℕ) (hn : 0 < n) (hK : 0 < K) : ∃ CI : IntervalProcedure n K, (equalWidthRelease ε K hK, CI) ∈ honestProcedures n K H α ∧ (∀ x, CI.lo x = clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K) ∧ CI.hi x = clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K)) ∧ ∀ P ∈ CausalLaws H (equalWidthRelease ε K hK), (∫ x, CI.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))) ≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by let CI := midpointInterval hOverlap hα n K hn hK refine ⟨CI, equalWidth_midpointInterval_honest hOverlap hα H n K hn hK, ?_, ?_⟩ · intro x exact ⟨rfl, rfl⟩ · intro P hP letI : IsProbabilityMeasure P := hP.1 have hrecord : Measurable (releasedRecord (ε := ε) (J := K)) := by unfold releasedRecord label arm observed fun_prop letI : IsProbabilityMeasure (releasedLaw P) := by unfold releasedLaw exact Measure.isProbabilityMeasure_map hrecord.aemeasurable exact midpointInterval_expectedLength_le hOverlap hα n K hn hK (releasedLaw P)
CausalSmith.PartialID.UnlinkedPropensityAte.exists_equalWidth_midpointInterval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/InferenceMidpointProcedure.lean:310
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.KLabelDefinitions 2 declarations Equal width finite label releases.

Equal width finite label releases.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
hK :
0 < K
e :
equalWidthRelease ε K hK e :
⟨min (Nat.floor ((K : ℝ) * ((e : ℝ) - ε) / (1 - 2 * ε))) (K - 1), by omega⟩
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelDefinitions.lean:14
theorem equalWidthRelease_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
hK :
0 < K
Proof (Lean source)
lemma equalWidthRelease_measurable (ε : ℝ) (K : ℕ) (hK : 0 < K) : Measurable (equalWidthRelease ε K hK) := by let f : ℕ → Fin K := fun n => ⟨min n (K - 1), by omega⟩ have hf : Measurable f := measurable_of_countable f have hfloor : Measurable (fun e : ScoreSpace ε => Nat.floor ((K : ℝ) * ((e : ℝ) - ε) / (1 - 2 * ε))) := Measurable.nat_floor (by fun_prop) convert hf.comp hfloor using 1 funext e rfl
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthRelease_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelDefinitions.lean:21
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.KLabelFiniteGeometry 9 declarations This file records the two-arm algebra used to turn cellwise reciprocal-score deviations into ordinary absolute score deviations.

Finite label reciprocal-score geometry

This file records the two-arm algebra used to turn cellwise reciprocal-score deviations into ordinary absolute score deviations.

theorem equalWidthRelease_cell_subset_closedBin

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
hOverlap :
hK :
0 < K
r :
cell (equalWidthRelease ε K hK) r ⊆ {e : ScoreSpace ε | ε + (r : ℕ) * ((1 - 2 * ε) / K) ≤ (e : ℝ) ∧ (e : ℝ) ≤ ε + ((r : ℕ) + 1) * ((1 - 2 * ε) / K)}
Proof (Lean source)
lemma equalWidthRelease_cell_subset_closedBin {ε : ℝ} {K : ℕ} (hOverlap : Overlap ε) (hK : 0 < K) (r : LabelSpace K) : cell (equalWidthRelease ε K hK) r ⊆ {e : ScoreSpace ε | ε + (r : ℕ) * ((1 - 2 * ε) / K) ≤ (e : ℝ) ∧ (e : ℝ) ≤ ε + ((r : ℕ) + 1) * ((1 - 2 * ε) / K)} := by intro e he let L : ℝ := 1 - 2 * ε let t : ℝ := (K : ℝ) * ((e : ℝ) - ε) / L have hL : 0 < L := by dsimp [L]; linarith [hOverlap.2] have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have ht0 : 0 ≤ t := by dsimp [t] exact div_nonneg (mul_nonneg hKreal.le (sub_nonneg.mpr e.property.1)) hL.le have hmin : min (Nat.floor t) (K - 1) = (r : ℕ) := by have := congrArg val he simpa [cell, equalWidthRelease, t, L] using this have hrfloor : (r : ℕ) ≤ Nat.floor t := by omega have hlowerT : (r : ℝ) ≤ t := by have hcast : ((r : ℕ) : ℝ) ≤ (Nat.floor t : ℕ) := by exact_mod_cast hrfloor exact hcast.trans (Nat.floor_le ht0) have hlower : ε + (r : ℕ) * (L / K) ≤ (e : ℝ) := by dsimp [t] at hlowerT have h := (mul_le_mul_of_nonneg_right hlowerT (div_nonneg hL.le hKreal.le)) field_simp at h ⊢ nlinarith have hupper : (e : ℝ) ≤ ε + ((r : ℕ) + 1) * (L / K) := by by_cases hr : (r : ℕ) = K - 1 · have heUpper := e.property.2 rw [hr] have hKsub : (K - 1 : ℕ) + 1 = K := by omega have hKcast : ((K - 1 : ℕ) : ℝ) + 1 = (K : ℝ) := by exact_mod_cast hKsub rw [hKcast] field_simp dsimp [L] linarith · have hfloor : Nat.floor t = (r : ℕ) := by omega have htUpper : t < (r : ℕ) + 1 := by rw [← hfloor] exact Nat.lt_floor_add_one t dsimp [t] at htUpper have h := (mul_lt_mul_of_pos_right htUpper (div_pos hL hKreal)) field_simp at h ⊢ nlinarith simpa [L] using ⟨hlower, hupper⟩
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthRelease_cell_subset_closedBin · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:21
def equalWidthBinMidpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
hK :
0 < K
hOverlap :
r :
equalWidthBinMidpoint ε K hK hOverlap r :
⟨ε
+ ((r : ℕ) + (1 / 2 : ℝ)) * ((1 - 2 * ε) / K), by have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK have hwidth : 0 < 1
- 2 * ε := by linarith [hOverlap.2] have hr0 : 0
≤ (r : ℝ) := by positivity have hrK : (r : ℝ)
+ (1 / 2 : ℝ) ≤ (K : ℝ) := by have hrCast : (r : ℝ)
+ 1
≤ (K : ℝ) := by exact_mod_cast (Nat.succ_le_iff.mpr r.isLt) linarith constructor · exact le_add_of_nonneg_right (mul_nonneg (by linarith) (div_nonneg hwidth.le hKreal.le)) · have hratio : ((r : ℝ) + (1 / 2 : ℝ)) / K ≤ 1 := (div_le_one hKreal).mpr hrK calc ε
+ ((r : ℕ) + (1 / 2 : ℝ)) * ((1 - 2 * ε) / K) = ε
+ (((r : ℝ) + (1 / 2 : ℝ)) / K) * (1 - 2 * ε) := by ring _ ≤ ε
+ 1 * (1 - 2 * ε) := by gcongr _ ≤ 1
- ε := by ring_nf; linarith ⟩
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthBinMidpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:70
theorem equalWidthBinMidpoint_val

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
hK :
0 < K
hOverlap :
r :
(equalWidthBinMidpoint ε K hK hOverlap r : ℝ)
= ε + ((r : ℕ) + (1 / 2 : ℝ)) * ((1 - 2 * ε) / K)
Proof (Lean source)
lemma equalWidthBinMidpoint_val (ε : ℝ) (K : ℕ) (hK : 0 < K) (hOverlap : Overlap ε) (r : LabelSpace K) : (equalWidthBinMidpoint ε K hK hOverlap r : ℝ) = ε + ((r : ℕ) + (1 / 2 : ℝ)) * ((1 - 2 * ε) / K) := by rfl
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthBinMidpoint_val · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:95
theorem cellAbsoluteDeviation_le_center

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
a :
r :
c :
ℝ
hc :
c ∈ Icc ((1 - ε)⁻¹) ε⁻¹
cellAbsoluteDeviation H g a r ≤ ∫ e in cell g r, |1 - c * armProb a e| ∂H
Proof (Lean source)
lemma cellAbsoluteDeviation_le_center {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (a : ArmSpace) (r : LabelSpace J) (c : ℝ) (hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹) : cellAbsoluteDeviation H g a r ≤ ∫ e in cell g r, |1 - c * armProb a e| ∂H := by unfold cellAbsoluteDeviation apply csInf_le · refine ⟨0, ?_⟩ rintro v ⟨d, hd, rfl⟩ exact integral_nonneg fun _ => abs_nonneg _ · exact ⟨c, hc, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_le_center · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:102
theorem sum_cellAbsoluteDeviation_le_commonCenterCandidates

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
r :
z :
≤ (∫ e in cell g r, |1 - (z : ℝ)⁻¹ * armProb true e| ∂H)
+ ∫ e in cell g r, |1
- (1 - (z : ℝ))⁻¹ * armProb false e| ∂H
Proof (Lean source)
lemma sum_cellAbsoluteDeviation_le_commonCenterCandidates {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (r : LabelSpace J) (z : ScoreSpace ε) : cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r ≤ (∫ e in cell g r, |1 - (z : ℝ)⁻¹ * armProb true e| ∂H) + ∫ e in cell g r, |1 - (1 - (z : ℝ))⁻¹ * armProb false e| ∂H := by have hz0 : 0 < (z : ℝ) := hOverlap.1.trans_le z.property.1 have hz1 : (z : ℝ) < 1 := z.property.2.trans_lt (by linarith [hOverlap.1]) have hε1 : 0 < 1 - ε := by linarith [hOverlap.1, hOverlap.2] have hzCenter : (z : ℝ)⁻¹ ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := ⟨(inv_le_inv₀ hε1 hz0).mpr z.property.2, (inv_le_inv₀ hz0 hOverlap.1).mpr z.property.1⟩ have hcontrolLower : ε ≤ 1 - (z : ℝ) := by linarith [z.property.2] have hcontrolUpper : 1 - (z : ℝ) ≤ 1 - ε := by linarith [z.property.1] have hcontrolCenter : (1 - (z : ℝ))⁻¹ ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := ⟨(inv_le_inv₀ hε1 (by linarith)).mpr hcontrolUpper, (inv_le_inv₀ (by linarith) hOverlap.1).mpr hcontrolLower⟩ exact add_le_add (cellAbsoluteDeviation_le_center H g true r (z : ℝ)⁻¹ hzCenter) (cellAbsoluteDeviation_le_center H g false r (1 - (z : ℝ))⁻¹ hcontrolCenter)
CausalSmith.PartialID.UnlinkedPropensityAte.sum_cellAbsoluteDeviation_le_commonCenterCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:116
theorem sum_arm_reciprocalDeviation_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
x z :
ℝ
hz0 :
0 < z
hz1 :
z < 1
|1 - z⁻¹ * x| + |1 - (1 - z)⁻¹ * (1 - x)| = (z * (1 - z))⁻¹ * |x - z|
Proof (Lean source)
lemma sum_arm_reciprocalDeviation_eq {x z : ℝ} (hz0 : 0 < z) (hz1 : z < 1) : |1 - z⁻¹ * x| + |1 - (1 - z)⁻¹ * (1 - x)| = (z * (1 - z))⁻¹ * |x - z| := by have h1z : 0 < 1 - z := by linarith have hzInv : 0 ≤ z⁻¹ := inv_nonneg.mpr hz0.le have h1zInv : 0 ≤ (1 - z)⁻¹ := inv_nonneg.mpr h1z.le have hfirst : |1 - z⁻¹ * x| = z⁻¹ * |x - z| := by calc |1 - z⁻¹ * x| = |z⁻¹ * (z - x)| := by congr 1 field_simp _ = |z⁻¹| * |z - x| := abs_mul _ _ _ = z⁻¹ * |x - z| := by rw [abs_of_nonneg hzInv, abs_sub_comm] have hsecond : |1 - (1 - z)⁻¹ * (1 - x)| = (1 - z)⁻¹ * |x - z| := by calc |1 - (1 - z)⁻¹ * (1 - x)| = |(1 - z)⁻¹ * (x - z)| := by congr 1 field_simp ring _ = |(1 - z)⁻¹| * |x - z| := abs_mul _ _ _ = (1 - z)⁻¹ * |x - z| := by rw [abs_of_nonneg h1zInv] rw [hfirst, hsecond, ← add_mul] congr 1 field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_arm_reciprocalDeviation_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:140
theorem sum_arm_reciprocalCoefficient_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε z :
ℝ
hOverlap :
hz :
z ∈ Icc ε (1 - ε)
(z * (1 - z))⁻¹ ≤ (ε * (1 - ε))⁻¹
Proof (Lean source)
lemma sum_arm_reciprocalCoefficient_le {ε z : ℝ} (hOverlap : Overlap ε) (hz : z ∈ Icc ε (1 - ε)) : (z * (1 - z))⁻¹ ≤ (ε * (1 - ε))⁻¹ := by have hε1 : 0 < 1 - ε := by linarith [hOverlap.1, hOverlap.2] have hz0 : 0 < z := hOverlap.1.trans_le hz.1 have hz1 : z < 1 := hz.2.trans_lt (by linarith [hOverlap.1]) have hprod : ε * (1 - ε) ≤ z * (1 - z) := by have hnonneg : 0 ≤ (z - ε) * (1 - ε - z) := mul_nonneg (sub_nonneg.mpr hz.1) (sub_nonneg.mpr hz.2) nlinarith exact (inv_le_inv₀ (mul_pos hz0 (by linarith)) (mul_pos hOverlap.1 hε1)).mpr hprod
CausalSmith.PartialID.UnlinkedPropensityAte.sum_arm_reciprocalCoefficient_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:170
theorem sum_arm_reciprocalDeviation_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε x z :
ℝ
hOverlap :
hz :
z ∈ Icc ε (1 - ε)
|1 - z⁻¹ * x| + |1 - (1 - z)⁻¹ * (1 - x)| ≤ (ε * (1 - ε))⁻¹ * |x - z|
Proof (Lean source)
lemma sum_arm_reciprocalDeviation_le {ε x z : ℝ} (hOverlap : Overlap ε) (hz : z ∈ Icc ε (1 - ε)) : |1 - z⁻¹ * x| + |1 - (1 - z)⁻¹ * (1 - x)| ≤ (ε * (1 - ε))⁻¹ * |x - z| := by rw [sum_arm_reciprocalDeviation_eq (hOverlap.1.trans_le hz.1) (hz.2.trans_lt (by linarith [hOverlap.1]))] exact mul_le_mul_of_nonneg_right (sum_arm_reciprocalCoefficient_le hOverlap hz) (abs_nonneg _)
CausalSmith.PartialID.UnlinkedPropensityAte.sum_arm_reciprocalDeviation_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:184
theorem sum_cellAbsoluteDeviation_le_centeredScoreIntegral

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
hOverlap :
r :
z :
≤ (ε * (1 - ε))⁻¹ * ∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H
Proof (Lean source)
lemma sum_cellAbsoluteDeviation_le_centeredScoreIntegral {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hOverlap : Overlap ε) (r : LabelSpace J) (z : ScoreSpace ε) : cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r ≤ (ε * (1 - ε))⁻¹ * ∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H := by have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have hpBounds (a : ArmSpace) (e : ScoreSpace ε) : 0 ≤ armProb a e ∧ armProb a e ≤ 1 := by rcases e.property with ⟨he0, he1⟩ have he0' : 0 ≤ (e : ℝ) := hOverlap.1.le.trans he0 have he1' : (e : ℝ) ≤ 1 := he1.trans (by linarith [hOverlap.1]) cases a · simp only [armProb, Bool.false_eq_true, ↓reduceIte] exact ⟨by linarith, by linarith⟩ · simp only [armProb, ↓reduceIte] exact ⟨he0', he1'⟩ have hcandidateInt (a : ArmSpace) (c : ℝ) : IntegrableOn (fun e : ScoreSpace ε => |1 - c * armProb a e|) (cell g r) H := by apply Integrable.of_bound (by cases a <;> simp [armProb] <;> fun_prop) (1 + |c|) filter_upwards [] with e calc ‖|1 - c * armProb a e|‖ = |1 - c * armProb a e| := by simp _ ≤ |1| + |c * armProb a e| := abs_sub _ _ _ ≤ 1 + |c| := by rw [abs_one, abs_mul] have hmul := mul_le_of_le_one_right (abs_nonneg c) (abs_le.mpr ⟨by linarith [(hpBounds a e).1], (hpBounds a e).2⟩) linarith have hscoreInt : IntegrableOn (fun e : ScoreSpace ε => |(e : ℝ) - (z : ℝ)|) (cell g r) H := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with e have he := e.property have hz := z.property have hwidth : 1 - 2 * ε < 1 := by linarith [hOverlap.1] rw [Real.norm_eq_abs, abs_abs] exact abs_le.mpr ⟨by linarith [he.1, he.2, hz.1, hz.2], by linarith [he.1, he.2, hz.1, hz.2]⟩ have hrightInt : IntegrableOn (fun e : ScoreSpace ε => (ε * (1 - ε))⁻¹ * |(e : ℝ) - (z : ℝ)|) (cell g r) H := hscoreInt.const_mul _ calc cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r ≤ (∫ e in cell g r, |1 - (z : ℝ)⁻¹ * armProb true e| ∂H) + ∫ e in cell g r, |1 - (1 - (z : ℝ))⁻¹ * armProb false e| ∂H := sum_cellAbsoluteDeviation_le_commonCenterCandidates H g hOverlap r z _ = ∫ e in cell g r, (|1 - (z : ℝ)⁻¹ * armProb true e| + |1 - (1 - (z : ℝ))⁻¹ * armProb false e|) ∂H := by rw [integral_add (hcandidateInt true (z : ℝ)⁻¹) (hcandidateInt false (1 - (z : ℝ))⁻¹)] _ ≤ ∫ e in cell g r, (ε * (1 - ε))⁻¹ * |(e : ℝ) - (z : ℝ)| ∂H := by apply integral_mono ((hcandidateInt true (z : ℝ)⁻¹).add (hcandidateInt false (1 - (z : ℝ))⁻¹)) hrightInt intro e simpa [armProb] using sum_arm_reciprocalDeviation_le hOverlap z.property (x := (e : ℝ)) _ = (ε * (1 - ε))⁻¹ * ∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H := by rw [integral_const_mul]
CausalSmith.PartialID.UnlinkedPropensityAte.sum_cellAbsoluteDeviation_le_centeredScoreIntegral · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteGeometry.lean:194
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.KLabelFiniteLower 3 declarations Measure geometry for finite-label lower bounds under arbitrary measurable cells.

Measure geometry for finite-label lower bounds under arbitrary measurable cells.

theorem boundedCell_absDeviation_tail_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b z t :
ℝ
B :
Set ℝ
hBmeas :
hBsub :
B ⊆ Icc a b
ht :
0 ≤ t
volume.real B - 2 * t ≤ (volume.restrict B).real {x : ℝ | t < |x - z|}
Proof (Lean source)
lemma boundedCell_absDeviation_tail_lower {a b z t : ℝ} {B : Set ℝ} (hBmeas : MeasurableSet B) (hBsub : B ⊆ Icc a b) (ht : 0 ≤ t) : volume.real B - 2 * t ≤ (volume.restrict B).real {x : ℝ | t < |x - z|} := by let C : Set ℝ := Icc (z - t) (z + t) let T : Set ℝ := B ∩ {x : ℝ | t < |x - z|} have htailMeas : MeasurableSet {x : ℝ | t < |x - z|} := by exact measurableSet_lt measurable_const ((measurable_id.sub measurable_const).norm) have hTmeas : MeasurableSet T := hBmeas.inter htailMeas have hcover : B ⊆ C ∪ T := by intro x hx by_cases hxt : t < |x - z| · exact mem_union_right C ⟨hx, hxt⟩ · left dsimp [C] rw [mem_Icc] have habs : |x - z| ≤ t := le_of_not_gt hxt exact ⟨by linarith [neg_le_abs (x - z)], by linarith [le_abs_self (x - z)]⟩ have hBfinite : volume B ≠ ∞ := (measure_ne_top_of_subset hBsub measure_Icc_lt_top.ne) have hTfinite : volume T ≠ ∞ := (measure_ne_top_of_subset inter_subset_left hBfinite) have hCfinite : volume C ≠ ∞ := measure_Icc_lt_top.ne have hUnionFinite : volume (C ∪ T) ≠ ∞ := (measure_union_lt_top hCfinite.lt_top hTfinite.lt_top).ne have hmass : volume.real B ≤ volume.real C + volume.real T := (measureReal_mono hcover hUnionFinite).trans (measureReal_union_le C T) have hCmass : volume.real C = 2 * t := by dsimp [C] rw [Real.volume_real_Icc_of_le (by linarith)] ring have hTmass : volume.real T = (volume.restrict B).real {x : ℝ | t < |x - z|} := by rw [Measure.real_def, Measure.real_def, Measure.restrict_apply htailMeas] rw [inter_comm] rw [hCmass, hTmass] at hmass linarith
CausalSmith.PartialID.UnlinkedPropensityAte.boundedCell_absDeviation_tail_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteLower.lean:22
theorem sum_cellMass_sq_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
K :
ℕ
hK :
0 < K
m :
Fin K → ℝ
(∑ j, m j) ^ 2 / K ≤ ∑ j, (m j) ^ 2
Proof (Lean source)
lemma sum_cellMass_sq_lower (K : ℕ) (hK : 0 < K) (m : Fin K → ℝ) : (∑ j, m j) ^ 2 / K ≤ ∑ j, (m j) ^ 2 := by have h := sq_sum_le_card_mul_sum_sq (s := univ) (f := m) simp only [Finset.card_univ, Fintype.card_fin] at h have hKreal : 0 < (K : ℝ) := by exact_mod_cast hK apply (div_le_iff₀ hKreal).2 simpa [mul_comm] using h
CausalSmith.PartialID.UnlinkedPropensityAte.sum_cellMass_sq_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteLower.lean:62
theorem boundedCell_absDeviation_integral_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b z :
ℝ
B :
Set ℝ
hBmeas :
hBsub :
B ⊆ Icc a b
volume.real B ^ 2 / 4 ≤ ∫ x in B, |x - z|
Proof (Lean source)
lemma boundedCell_absDeviation_integral_lower {a b z : ℝ} {B : Set ℝ} (hBmeas : MeasurableSet B) (hBsub : B ⊆ Icc a b) : volume.real B ^ 2 / 4 ≤ ∫ x in B, |x - z| := by let μ : Measure ℝ := volume.restrict B let q : ℝ → ℝ := fun t => μ.real {x : ℝ | t < |x - z|} have hμfinite : μ univ ≠ ∞ := by dsimp [μ] rw [Measure.restrict_apply_univ] exact measure_ne_top_of_subset hBsub measure_Icc_lt_top.ne let _ : IsFiniteMeasure μ := ⟨hμfinite.lt_top⟩ have hInt : Integrable (fun x : ℝ => |x - z|) μ := by apply Integrable.of_bound (by fun_prop) (|a| + |b| + |z| + 1) filter_upwards [ae_restrict_mem hBmeas] with x hx have hxI := hBsub hx have hxabs : |x| ≤ |a| + |b| := by apply abs_le.mpr constructor · calc -(|a| + |b|) ≤ -|a| := by linarith [abs_nonneg b] _ ≤ a := neg_abs_le a _ ≤ x := hxI.1 · calc x ≤ b := hxI.2 _ ≤ |b| := le_abs_self b _ ≤ |a| + |b| := by linarith [abs_nonneg a] calc ‖|x - z|‖ = |x - z| := by simp _ ≤ |x| + |z| := abs_sub x z _ ≤ |a| + |b| + |z| + 1 := by linarith have hnonneg : 0 ≤ᵐ[μ] (fun x : ℝ => |x - z|) := Eventually.of_forall fun x => abs_nonneg _ have hqmeas : Measurable q := by apply Measurable.ennreal_toReal exact Antitone.measurable fun s t hst => measure_mono fun _ hx => hst.trans_lt hx have hqnonneg : ∀ t, 0 ≤ q t := fun _ => measureReal_nonneg have hlayer := lintegral_eq_lintegral_meas_lt μ hnonneg hInt.aemeasurable have hqLIntegral : (∫⁻ t in Ioi (0 : ℝ), ofReal (q t)) = ∫⁻ t in Ioi (0 : ℝ), μ {x : ℝ | t < |x - z|} := by apply setLIntegral_congr_fun measurableSet_Ioi intro t ht dsimp [q] rw [Measure.real_def, ENNReal.ofReal_toReal] exact measure_ne_top_of_subset (subset_univ _) hμfinite have hqIntegralFinite : (∫⁻ t in Ioi (0 : ℝ), ofReal (q t)) < ∞ := by rw [hqLIntegral, ← hlayer] exact hInt.lintegral_lt_top have hqInt : IntegrableOn q (Ioi (0 : ℝ)) := by refine ⟨hqmeas.aestronglyMeasurable, ?_⟩ rw [hasFiniteIntegral_iff_norm] simpa [Real.norm_eq_abs, abs_of_nonneg (hqnonneg _), ENNReal.ofReal_eq_coe_nnreal] using hqIntegralFinite have hlayerReal := hInt.integral_eq_integral_meas_lt hnonneg change volume.real B ^ 2 / 4 ≤ ∫ x, |x - z| ∂μ rw [hlayerReal] let m : ℝ := volume.real B have hm : 0 ≤ m := measureReal_nonneg have hbaseInt : IntegrableOn (fun t : ℝ => m - 2 * t) (Ioc 0 (m / 2)) := by exact ((continuous_const.sub (continuous_const.mul continuous_id)).integrableOn_Icc).mono_set Ioc_subset_Icc_self have htailInt : IntegrableOn q (Ioc 0 (m / 2)) := hqInt.mono_set Ioc_subset_Ioi_self have hmono : (∫ t in Ioc 0 (m / 2), m - 2 * t) ≤ ∫ t in Ioc 0 (m / 2), q t := by apply integral_mono_ae hbaseInt htailInt filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht dsimp [q, μ, m] exact boundedCell_absDeviation_tail_lower hBmeas hBsub ht.1.le have hsubset : (∫ t in Ioc 0 (m / 2), q t) ≤ ∫ t in Ioi 0, q t := by exact integral_mono_measure (Measure.restrict_mono_set volume Ioc_subset_Ioi_self) (Eventually.of_forall fun t => hqnonneg t) hqInt have hbase : (∫ t in Ioc 0 (m / 2), m - 2 * t) = m ^ 2 / 4 := by rw [← intervalIntegral.integral_of_le (by linarith)] rw [intervalIntegral.integral_sub] · rw [intervalIntegral.integral_const_mul] rw [integral_id] simp [intervalIntegral.integral_const, smul_eq_mul] ring · exact continuous_const.intervalIntegrable 0 (m / 2) · exact (continuous_const.mul continuous_id).intervalIntegrable 0 (m / 2) dsimp [m] at hbase rw [← hbase] exact hmono.trans hsubset
CausalSmith.PartialID.UnlinkedPropensityAte.boundedCell_absDeviation_integral_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelFiniteLower.lean:71
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.KLabelRateLower 11 declarations Transfer of finite-cell Lebesgue quantization lower bounds to score-law ambiguity.

Transfer of finite-cell Lebesgue quantization lower bounds to score-law ambiguity.

theorem rateLower_scoreBaseMeasure_isFinite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
IsFiniteMeasure ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))
Proof (Lean source)
lemma rateLower_scoreBaseMeasure_isFinite (ε : ℝ) : IsFiniteMeasure ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)) := by refine ⟨?_⟩ rw [(MeasurableEmbedding.subtype_coe measurableSet_Icc).comap_apply] rw [image_univ, Subtype.range_coe_subtype] simp only [Set.ofPred_mem_eq] rw [Real.volume_Icc] finiteness
CausalSmith.PartialID.UnlinkedPropensityAte.rateLower_scoreBaseMeasure_isFinite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:19
def realScoreCell

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
g :
r :
realScoreCell g r :
Set ℝ
val '' cell g r
CausalSmith.PartialID.UnlinkedPropensityAte.realScoreCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:30
theorem realScoreCell_intervalPartition

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
Proof (Lean source)
lemma realScoreCell_intervalPartition {ε : ℝ} {K : ℕ} (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) : IsIntervalPartition ε (1 - ε) K (realScoreCell g) := by have hcoe : MeasurableEmbedding (Subtype.val : ScoreSpace ε → ℝ) := MeasurableEmbedding.subtype_coe measurableSet_Icc refine ⟨?_, ?_, ?_⟩ · intro r apply hcoe.measurableSet_image' exact measurableSet_eq_fun hg measurable_const · intro i j hij apply Set.disjoint_left.mpr intro x hxi hxj rcases hxi with ⟨ei, hei, rfl⟩ rcases hxj with ⟨ej, hej, heq⟩ have heij : ei = ej := Subtype.ext heq.symm subst ej exact hij (hei.symm.trans hej) · ext x constructor · intro hx rcases mem_iUnion.mp hx with ⟨r, e, he, rfl⟩ exact e.property · intro hx let e : ScoreSpace ε := ⟨x, hx⟩ exact mem_iUnion_of_mem (g e) ⟨e, rfl, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.realScoreCell_intervalPartition · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:35
theorem scoreBase_setIntegral_abs_eq_realScoreCell

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
r :
z :
ℝ
(∫ e in cell g r, |(e : ℝ) - z| ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)))
= ∫ x in realScoreCell g r, |x - z|
Proof (Lean source)
lemma scoreBase_setIntegral_abs_eq_realScoreCell {ε : ℝ} {K : ℕ} (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (z : ℝ) : (∫ e in cell g r, |(e : ℝ) - z| ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))) = ∫ x in realScoreCell g r, |x - z| := by let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have himageMeas : MeasurableSet (realScoreCell g r) := (MeasurableEmbedding.subtype_coe measurableSet_Icc).measurableSet_image' hcell have hmap := MeasureTheory.setIntegral_map (μ := μ) (g := (Subtype.val : ScoreSpace ε → ℝ)) (f := fun x : ℝ => |x - z|) (s := realScoreCell g r) himageMeas (by fun_prop) measurable_subtype_coe.aemeasurable have hmapMeasure : Measure.map (Subtype.val : ScoreSpace ε → ℝ) μ = volume.restrict (Icc ε (1 - ε)) := map_comap_subtype_coe measurableSet_Icc volume rw [hmapMeasure] at hmap have himageSub : realScoreCell g r ⊆ Icc ε (1 - ε) := by rintro x ⟨e, he, rfl⟩ exact e.property have hrestrict : (volume.restrict (Icc ε (1 - ε))).restrict (realScoreCell g r) = volume.restrict (realScoreCell g r) := Measure.restrict_restrict_of_subset himageSub have hpreimage : cell g r = (Subtype.val : ScoreSpace ε → ℝ) ⁻¹' (realScoreCell g r) := by ext e constructor · intro he exact ⟨e, he, rfl⟩ · rintro ⟨e', he', heq⟩ simpa [Subtype.ext heq] using he' rw [hpreimage] rw [← hmap] change (∫ x, |x - z| ∂(volume.restrict (Icc ε (1 - ε))).restrict (realScoreCell g r)) = _ rw [hrestrict]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreBase_setIntegral_abs_eq_realScoreCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:62
theorem setIntegral_lowerScoreDensity_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
H :
f :
ScoreSpace ε → ℝ
mf :
ℝ
hmf :
0 < mf
hf :
s :
hs :
φ :
ScoreSpace ε → ℝ
hφ :
IntegrableOn φ s ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))
hφH :
hφnonneg :
∀ e ∈ s, 0 ≤ φ e
mf * (∫ e in s, φ e ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)))
≤ ∫ e in s, φ e ∂H
Proof (Lean source)
lemma setIntegral_lowerScoreDensity_lower {ε : ℝ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (mf : ℝ) (hmf : 0 < mf) (hf : LowerScoreDensity H f mf) (s : Set (ScoreSpace ε)) (hs : MeasurableSet s) (φ : ScoreSpace ε → ℝ) (hφ : IntegrableOn φ s ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))) (hφH : IntegrableOn φ s H) (hφnonneg : ∀ e ∈ s, 0 ≤ φ e) : mf * (∫ e in s, φ e ∂((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ))) ≤ ∫ e in s, φ e ∂H := by let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) let _ : IsFiniteMeasure μ := rateLower_scoreBaseMeasure_isFinite ε have hfMeas : Measurable f := hf.densityLower.1 have hfLower : ∀ᵐ e ∂μ, mf ≤ f e := hf.densityLower.2.2 have hfNonneg : ∀ᵐ e ∂μ, 0 ≤ f e := hfLower.mono fun _ he => hmf.le.trans he have hindicatorInt : Integrable (s.indicator φ) μ := hφ.integrable_indicator hs have hleft : Integrable (fun e => mf * s.indicator φ e) μ := hindicatorInt.const_mul mf have hright : Integrable (fun e => f e * s.indicator φ e) μ := by have hwith : Integrable (s.indicator φ) (μ.withDensity fun e => ofReal (f e)) := by rw [← hf.densityLower.2.1] exact hφH.integrable_indicator hs have hweighted := (integrable_withDensity_iff_integrable_smul' hfMeas.ennreal_ofReal (Eventually.of_forall fun _ => by finiteness)).mp hwith apply hweighted.congr filter_upwards [hfNonneg] with e he simp only [smul_eq_mul, ENNReal.toReal_ofReal he] rw [← integral_indicator hs, ← integral_indicator hs] rw [hf.densityLower.2.1, integral_withDensity_eq_integral_toReal_smul hfMeas.ennreal_ofReal (Eventually.of_forall fun _ => by finiteness)] simp only [smul_eq_mul] calc mf * ∫ e, s.indicator φ e ∂μ = ∫ e, mf * s.indicator φ e ∂μ := by rw [integral_const_mul] _ ≤ ∫ e, f e * s.indicator φ e ∂μ := by apply integral_mono_ae hleft hright filter_upwards [hfLower] with e he by_cases hes : e ∈ s · simp only [Set.indicator_of_mem hes] exact mul_le_mul_of_nonneg_right he (hφnonneg e hes) · simp [hes] _ = ∫ e, (ofReal (f e)).toReal * s.indicator φ e ∂μ := by apply integral_congr_ae filter_upwards [hfNonneg] with e he rw [ENNReal.toReal_ofReal he]
CausalSmith.PartialID.UnlinkedPropensityAte.setIntegral_lowerScoreDensity_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:103
theorem scoreCell_absDeviation_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
mf :
ℝ
_hOverlap :
hmf :
0 < mf
hf :
g :
hg :
r :
z :
ℝ
mf * (volume.real (realScoreCell g r) ^ 2 / 4) ≤ ∫ e in cell g r, |(e : ℝ) - z| ∂H
Proof (Lean source)
lemma scoreCell_absDeviation_lower {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (mf : ℝ) (_hOverlap : Overlap ε) (hmf : 0 < mf) (hf : LowerScoreDensity H f mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (r : LabelSpace K) (z : ℝ) : mf * (volume.real (realScoreCell g r) ^ 2 / 4) ≤ ∫ e in cell g r, |(e : ℝ) - z| ∂H := by letI : IsProbabilityMeasure H := hf.probability let μ : Measure (ScoreSpace ε) := (volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ) let _ : IsFiniteMeasure μ := rateLower_scoreBaseMeasure_isFinite ε have hcell : MeasurableSet (cell g r) := measurableSet_eq_fun hg measurable_const have hInt : IntegrableOn (fun e : ScoreSpace ε => |(e : ℝ) - z|) (cell g r) μ := by apply Integrable.of_bound (by fun_prop) (|ε| + |1 - ε| + |z| + 1) filter_upwards [] with e have he := e.property rw [Real.norm_eq_abs, abs_abs] calc |(e : ℝ) - z| ≤ |(e : ℝ)| + |z| := abs_sub _ _ _ ≤ |ε| + |1 - ε| + |z| + 1 := by have heabs : |(e : ℝ)| ≤ |ε| + |1 - ε| := by apply abs_le.mpr constructor · calc -(|ε| + |1 - ε|) ≤ -|ε| := by linarith [abs_nonneg (1 - ε)] _ ≤ ε := neg_abs_le ε _ ≤ (e : ℝ) := he.1 · calc (e : ℝ) ≤ 1 - ε := he.2 _ ≤ |1 - ε| := le_abs_self (1 - ε) _ ≤ |ε| + |1 - ε| := by linarith [abs_nonneg ε] linarith have hdensity := setIntegral_lowerScoreDensity_lower H f mf hmf hf (cell g r) hcell (fun e => |(e : ℝ) - z|) hInt (by apply Integrable.of_bound (by fun_prop) (|ε| + |1 - ε| + |z| + 1) filter_upwards [] with e have he := e.property rw [Real.norm_eq_abs, abs_abs] have heabs : |(e : ℝ)| ≤ |ε| + |1 - ε| := by apply abs_le.mpr constructor · calc -(|ε| + |1 - ε|) ≤ -|ε| := by linarith [abs_nonneg (1 - ε)] _ ≤ ε := neg_abs_le ε _ ≤ (e : ℝ) := he.1 · calc (e : ℝ) ≤ 1 - ε := he.2 _ ≤ |1 - ε| := le_abs_self (1 - ε) _ ≤ |ε| + |1 - ε| := by linarith [abs_nonneg ε] linarith [abs_sub (e : ℝ) z]) (fun _ _ => abs_nonneg _) rw [scoreBase_setIntegral_abs_eq_realScoreCell g hg r z] at hdensity have hgeom := boundedCell_absDeviation_integral_lower (z := z) ((realScoreCell_intervalPartition g hg).1 r) (fun x hx => by rcases hx with ⟨e, he, rfl⟩ exact e.property) calc mf * (volume.real (realScoreCell g r) ^ 2 / 4) ≤ mf * ∫ x in realScoreCell g r, |x - z| := mul_le_mul_of_nonneg_left hgeom hmf.le _ ≤ ∫ e in cell g r, |(e : ℝ) - z| ∂H := hdensity
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCell_absDeviation_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:159
def reciprocalCenterScore

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a :
c :
ℝ
reciprocalCenterScore a c :
ℝ
if a then c⁻¹ else 1 - c⁻¹
CausalSmith.PartialID.UnlinkedPropensityAte.reciprocalCenterScore · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:225
theorem reciprocalDeviation_eq_scoreDistance

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε c :
ℝ
hOverlap :
hc :
c ∈ Icc ((1 - ε)⁻¹) ε⁻¹
a :
e :
|1 - c * armProb a e| = c * |(e : ℝ) - reciprocalCenterScore a c|
Proof (Lean source)
lemma reciprocalDeviation_eq_scoreDistance {ε c : ℝ} (hOverlap : Overlap ε) (hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹) (a : ArmSpace) (e : ScoreSpace ε) : |1 - c * armProb a e| = c * |(e : ℝ) - reciprocalCenterScore a c| := by have hcpos : 0 < c := (inv_pos.mpr (by linarith [hOverlap.2])).trans_le hc.1 have hcne : c ≠ 0 := hcpos.ne' cases a · simp only [armProb, Bool.false_eq_true, ↓reduceIte, reciprocalCenterScore] calc |1 - c * (1 - (e : ℝ))| = |c * ((e : ℝ) - (1 - c⁻¹))| := by congr 1 field_simp ring _ = |c| * |(e : ℝ) - (1 - c⁻¹)| := abs_mul _ _ _ = c * |(e : ℝ) - (1 - c⁻¹)| := by rw [abs_of_pos hcpos] · simp only [armProb, ↓reduceIte, reciprocalCenterScore] calc |1 - c * (e : ℝ)| = |c * ((e : ℝ) - c⁻¹)| := by rw [abs_eq_abs] right field_simp ring _ = |c| * |(e : ℝ) - c⁻¹| := abs_mul _ _ _ = c * |(e : ℝ) - c⁻¹| := by rw [abs_of_pos hcpos]
CausalSmith.PartialID.UnlinkedPropensityAte.reciprocalDeviation_eq_scoreDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:229
theorem cellAbsoluteDeviation_lower_cellLengthSq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
H :
f :
ScoreSpace ε → ℝ
mf :
ℝ
hOverlap :
hmf :
0 < mf
hf :
g :
hg :
a :
r :
mf * volume.real (realScoreCell g r) ^ 2 / (4 * (1 - ε)) ≤ cellAbsoluteDeviation H g a r
Proof (Lean source)
lemma cellAbsoluteDeviation_lower_cellLengthSq {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (mf : ℝ) (hOverlap : Overlap ε) (hmf : 0 < mf) (hf : LowerScoreDensity H f mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace K) : mf * volume.real (realScoreCell g r) ^ 2 / (4 * (1 - ε)) ≤ cellAbsoluteDeviation H g a r := by have hε1 : 0 < 1 - ε := by linarith [hOverlap.2] unfold cellAbsoluteDeviation apply le_csInf · let c : ℝ := ε⁻¹ refine ⟨∫ e in cell g r, |1 - c * armProb a e| ∂H, c, ?_, rfl⟩ dsimp [c] constructor · exact (inv_le_inv₀ hε1 hOverlap.1).mpr (by linarith [hOverlap.2]) · rfl · rintro v ⟨c, hc, rfl⟩ have hcpos : 0 < c := (inv_pos.mpr hε1).trans_le hc.1 let z : ℝ := reciprocalCenterScore a c have hscore := scoreCell_absDeviation_lower H f mf hOverlap hmf hf g hg r z have hrewrite : (∫ e in cell g r, |1 - c * armProb a e| ∂H) = c * ∫ e in cell g r, |(e : ℝ) - z| ∂H := by rw [← integral_const_mul] apply setIntegral_congr_fun (measurableSet_eq_fun hg measurable_const) intro e he exact reciprocalDeviation_eq_scoreDistance hOverlap hc a e rw [hrewrite] have hcoeff : (1 - ε)⁻¹ ≤ c := hc.1 have hdistNonneg : 0 ≤ ∫ e in cell g r, |(e : ℝ) - z| ∂H := integral_nonneg fun _ => abs_nonneg _ calc mf * volume.real (realScoreCell g r) ^ 2 / (4 * (1 - ε)) = (1 - ε)⁻¹ * (mf * (volume.real (realScoreCell g r) ^ 2 / 4)) := by field_simp _ ≤ (1 - ε)⁻¹ * (∫ e in cell g r, |(e : ℝ) - z| ∂H) := mul_le_mul_of_nonneg_left hscore (inv_nonneg.mpr hε1.le) _ ≤ c * (∫ e in cell g r, |(e : ℝ) - z| ∂H) := mul_le_mul_of_nonneg_right hcoeff hdistNonneg
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_lower_cellLengthSq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:256
theorem worstCaseAmbiguity_finiteLabel_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
mf :
ℝ
hOverlap :
hmf :
0 < mf
K :
ℕ
hK :
0 < K
f :
ScoreSpace ε → ℝ
hf :
g :
hg :
mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ worstCaseAmbiguity H g
Proof (Lean source)
lemma worstCaseAmbiguity_finiteLabel_lower {ε : ℝ} (mf : ℝ) (hOverlap : Overlap ε) (hmf : 0 < mf) (K : ℕ) (hK : 0 < K) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hf : LowerScoreDensity H f mf) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) : mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ worstCaseAmbiguity H g := by let m : Fin K → ℝ := fun r => volume.real (realScoreCell g r) have hpart := realScoreCell_intervalPartition g hg have hsum : (∑ r, m r) = 1 - 2 * ε := by dsimp [m] calc (∑ r, volume.real (realScoreCell g r)) = volume.real (⋃ r, realScoreCell g r) := (measureReal_iUnion_fintype (fun i j hij => hpart.2.1 i j hij) hpart.1 (fun r => measure_ne_top_of_subset (fun x hx => by rcases hx with ⟨e, he, rfl⟩ exact e.property) measure_Icc_lt_top.ne)).symm _ = volume.real (Icc ε (1 - ε)) := by rw [hpart.2.2] _ = 1 - 2 * ε := by rw [Real.volume_real_Icc_of_le (by linarith [hOverlap.2])] ring have hε1 : 0 < 1 - ε := by linarith [hOverlap.2] have hqpos : 0 < mf / (1 - ε) := div_pos hmf hε1 have hsq := sum_cellMass_sq_lower K hK m have hcells : mf / (1 - ε) * (∑ r, (m r) ^ 2 / 2) ≤ ∑ r, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) := by rw [Finset.mul_sum] apply Finset.sum_le_sum intro r hr have ht := cellAbsoluteDeviation_lower_cellLengthSq H f mf hOverlap hmf hf g hg true r have hc := cellAbsoluteDeviation_lower_cellLengthSq H f mf hOverlap hmf hf g hg false r dsimp [m] calc mf / (1 - ε) * (volume.real (realScoreCell g r) ^ 2 / 2) = mf * volume.real (realScoreCell g r) ^ 2 / (4 * (1 - ε)) + mf * volume.real (realScoreCell g r) ^ 2 / (4 * (1 - ε)) := by field_simp ring _ ≤ cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r := add_le_add ht hc have hgeom : mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ mf / (1 - ε) * (∑ r, (m r) ^ 2 / 2) := by rw [← hsum] have hhalf : (∑ r, m r) ^ 2 / (2 * K) ≤ ∑ r, (m r) ^ 2 / 2 := by calc (∑ r, m r) ^ 2 / (2 * K) = ((∑ r, m r) ^ 2 / K) / 2 := by field_simp _ ≤ (∑ r, (m r) ^ 2) / 2 := div_le_div_of_nonneg_right hsq (by norm_num) _ = ∑ r, (m r) ^ 2 / 2 := by rw [Finset.sum_div] calc mf * (∑ r, m r) ^ 2 / (2 * (1 - ε) * K) = mf / (1 - ε) * ((∑ r, m r) ^ 2 / (2 * K)) := by field_simp _ ≤ mf / (1 - ε) * (∑ r, (m r) ^ 2 / 2) := mul_le_mul_of_nonneg_left hhalf hqpos.le rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] exact hgeom.trans hcells
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_finiteLabel_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:299
theorem optimalKAmbiguity_finiteLabel_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
mf :
ℝ
hOverlap :
hmf :
0 < mf
K :
ℕ
hK :
0 < K
f :
ScoreSpace ε → ℝ
hf :
mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ optimalKAmbiguity ε K H
Proof (Lean source)
lemma optimalKAmbiguity_finiteLabel_lower {ε : ℝ} (mf : ℝ) (hOverlap : Overlap ε) (hmf : 0 < mf) (K : ℕ) (hK : 0 < K) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hf : LowerScoreDensity H f mf) : mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ optimalKAmbiguity ε K H := by unfold optimalKAmbiguity apply le_csInf · let r0 : LabelSpace K := ⟨0, hK⟩ let g0 : ScoreSpace ε → LabelSpace K := fun _ => r0 refine ⟨worstCaseAmbiguity H g0, g0, ?_, rfl⟩ exact measurable_const · rintro d ⟨g, hg, rfl⟩ exact worstCaseAmbiguity_finiteLabel_lower mf hOverlap hmf K hK H f hf g hg
CausalSmith.PartialID.UnlinkedPropensityAte.optimalKAmbiguity_finiteLabel_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/KLabelRateLower.lean:369
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthFiniteLabel 4 declarations Finite-label identification lower bounds for honest released-trial intervals.

Finite-label identification lower bounds for honest released-trial intervals.

theorem honestProcedure_fairEndpoint_expectedLength_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K n :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hHonest :
(g, C) ∈ honestProcedures n K H α
∃ P ∈ CausalLaws H g,
(1 - 2 * α) * worstCaseAmbiguity H g
≤ ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))
Proof (Lean source)
lemma honestProcedure_fairEndpoint_expectedLength_lower {ε : ℝ} {K n : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (C : IntervalProcedure n K) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hHonest : (g, C) ∈ honestProcedures n K H α) : ∃ P ∈ CausalLaws H g, (1 - 2 * α) * worstCaseAmbiguity H g ≤ ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P)) := by rcases (worstCaseAmbiguity_eq H g hOverlap hg).2.2.2 with ⟨Pminus, Pplus, hminusProb, hplusProb, hminusComp, hplusComp, _hminus, _hplus, hgap⟩ have hminusLaw : Pminus ∈ CausalLaws H g := by refine ⟨hminusProb, ?_⟩ exact { probability := hminusComp.probability measurableRelease := hminusComp.measurableRelease scoreMarginal := hminusComp.scoreMarginal randomizedAssignment := hminusComp.randomizedAssignment consistency := hminusComp.consistency deterministicRelease := hminusComp.deterministicRelease } have hplusLaw : Pplus ∈ CausalLaws H g := by refine ⟨hplusProb, ?_⟩ exact { probability := hplusComp.probability measurableRelease := hplusComp.measurableRelease scoreMarginal := hplusComp.scoreMarginal randomizedAssignment := hplusComp.randomizedAssignment consistency := hplusComp.consistency deterministicRelease := hplusComp.deterministicRelease } let Prel := halfOutcomeReleasedLaw H g let Q := Measure.pi (fun _ : Fin n => Prel) let _ : IsProbabilityMeasure Pminus := hminusProb let _ : IsProbabilityMeasure (releasedLaw Pminus) := @Measure.isProbabilityMeasure_map _ _ _ _ Pminus hminusProb _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure Prel := by dsimp [Prel] rw [← hminusComp.releasedLaw] infer_instance let _ : IsProbabilityMeasure Q := inferInstance have hcoverMinus : 1 - α ≤ Q.real {x | C.contains x (ate Pminus)} := by change 1 - α ≤ (Measure.pi (fun _ : Fin n => halfOutcomeReleasedLaw H g)).real {x | C.contains x (ate Pminus)} rw [← hminusComp.releasedLaw] exact hHonest.2 Pminus hminusLaw have hcoverPlus : 1 - α ≤ Q.real {x | C.contains x (ate Pplus)} := by change 1 - α ≤ (Measure.pi (fun _ : Fin n => halfOutcomeReleasedLaw H g)).real {x | C.contains x (ate Pplus)} rw [← hplusComp.releasedLaw] exact hHonest.2 Pplus hplusLaw have horder : ate Pminus ≤ ate Pplus := by rw [← sub_nonneg] rw [hgap] rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] exact Finset.sum_nonneg fun r _ => add_nonneg (cellAbsoluteDeviation_nonneg H g hOverlap true r) (cellAbsoluteDeviation_nonneg H g hOverlap false r) have htest := intervalProcedure_twoPoint_expectedLength C Q Q (ate Pminus) (ate Pplus) α horder hcoverMinus hcoverPlus have htv : tvDist Q Q = 0 := by simp [tvDist] refine ⟨Pminus, hminusLaw, ?_⟩ calc (1 - 2 * α) * worstCaseAmbiguity H g = (ate Pplus - ate Pminus) * (1 - 2 * α - tvDist Q Q) := by rw [hgap, htv]; ring _ ≤ ∫ x, C.length x ∂Q := htest _ = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw Pminus)) := by dsimp [Q, Prel] rw [hminusComp.releasedLaw]
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedure_fairEndpoint_expectedLength_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabel.lean:16
theorem intervalProcedure_expectedLength_le_two

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
(∫ x, C.length x ∂Q) ≤ 2
Proof (Lean source)
lemma intervalProcedure_expectedLength_le_two {K n : ℕ} (C : IntervalProcedure n K) (Q : Measure (TrialSample n K)) [IsProbabilityMeasure Q] : (∫ x, C.length x ∂Q) ≤ 2 := by have hlenMeas : Measurable C.length := C.measurable_hi.sub C.measurable_lo have hlenNonneg (x : TrialSample n K) : 0 ≤ C.length x := sub_nonneg.mpr (C.ordered x) have hlenBound (x : TrialSample n K) : C.length x ≤ 2 := by dsimp [IntervalProcedure.length] linarith [C.lower_bound x, C.upper_bound x] have hlenInt : Integrable C.length Q := by apply Integrable.of_bound hlenMeas.aestronglyMeasurable 2 filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (hlenNonneg x)] exact hlenBound x have hmono := integral_mono hlenInt (integrable_const 2) hlenBound simpa [probReal_univ] using hmono
CausalSmith.PartialID.UnlinkedPropensityAte.intervalProcedure_expectedLength_le_two · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabel.lean:97
theorem honestProcedure_worstCaseExpectedLength_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K n :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hHonest :
(g, C) ∈ honestProcedures n K H α
(1 - 2 * α) * worstCaseAmbiguity H g
≤ sSup {u : ℝ | ∃ P ∈ CausalLaws H g, u = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}
Proof (Lean source)
lemma honestProcedure_worstCaseExpectedLength_lower {ε : ℝ} {K n : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (C : IntervalProcedure n K) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hHonest : (g, C) ∈ honestProcedures n K H α) : (1 - 2 * α) * worstCaseAmbiguity H g ≤ sSup {u : ℝ | ∃ P ∈ CausalLaws H g, u = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))} := by let U : Set ℝ := {u : ℝ | ∃ P ∈ CausalLaws H g, u = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))} obtain ⟨P, hP, hlen⟩ := honestProcedure_fairEndpoint_expectedLength_lower H g C hOverlap hg α hHonest have hUbd : BddAbove U := by refine ⟨2, ?_⟩ rintro u ⟨Q, hQ, rfl⟩ let _ : IsProbabilityMeasure Q := hQ.1 let _ : IsProbabilityMeasure (releasedLaw Q) := @Measure.isProbabilityMeasure_map _ _ _ _ Q hQ.1 _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure (Measure.pi (fun _ : Fin n => releasedLaw Q)) := inferInstance exact intervalProcedure_expectedLength_le_two C _ exact hlen.trans (le_csSup hUbd ⟨P, hP, rfl⟩)
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedure_worstCaseExpectedLength_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabel.lean:116
theorem honestProcedure_finiteLabel_expectedLength_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
mf :
ℝ
hOverlap :
hmf :
0 < mf
K :
ℕ
hK :
0 < K
f :
ScoreSpace ε → ℝ
hf :
n :
ℕ
α :
ℝ
hα :
α ≤ 1 / 2
g :
hg :
hHonest :
(g, C) ∈ honestProcedures n K H α
(1 - 2 * α) * (mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K))
≤ sSup {u : ℝ | ∃ P ∈ CausalLaws H g, u = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}
Proof (Lean source)
lemma honestProcedure_finiteLabel_expectedLength_lower {ε : ℝ} (mf : ℝ) (hOverlap : Overlap ε) (hmf : 0 < mf) (K : ℕ) (hK : 0 < K) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hf : LowerScoreDensity H f mf) (n : ℕ) (α : ℝ) (hα : α ≤ 1 / 2) (g : ScoreSpace ε → LabelSpace K) (C : IntervalProcedure n K) (hg : Measurable g) (hHonest : (g, C) ∈ honestProcedures n K H α) : (1 - 2 * α) * (mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K)) ≤ sSup {u : ℝ | ∃ P ∈ CausalLaws H g, u = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))} := by have hamb := worstCaseAmbiguity_finiteLabel_lower mf hOverlap hmf K hK H f hf g hg exact (mul_le_mul_of_nonneg_left hamb (by linarith)).trans (honestProcedure_worstCaseExpectedLength_lower H g C hOverlap hg α hHonest)
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedure_finiteLabel_expectedLength_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabel.lean:146
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthFiniteLabelOuter 4 declarations Outer-infimum finite-label lower bounds for honest confidence intervals.

Outer-infimum finite-label lower bounds for honest confidence intervals.

def fullATEIntervalProcedure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
n K :
ℕ
fullATEIntervalProcedure n K :
clause 1
lo := fun _ => -1
clause 2
hi := fun _ => 1
clause 3
measurable_lo := measurable_const
clause 4
measurable_hi := measurable_const
clause 5
lower_bound := fun _ => le_rfl
clause 6
ordered := fun _ => by norm_num
clause 7
upper_bound := fun _ => le_rfl
theorem ate_mem_Icc_of_probability

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
ate P ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma ate_mem_Icc_of_probability {ε : ℝ} {K : ℕ} (P : Measure (FullRow ε K)) [IsProbabilityMeasure P] : ate P ∈ Icc (-1 : ℝ) 1 := by let d : FullRow ε K → ℝ := fun ω => (outcome1 ω : ℝ) - (outcome0 ω : ℝ) have hdMeas : Measurable d := by dsimp [d] unfold outcome1 outcome0 fun_prop have hdBounds (ω : FullRow ε K) : -1 ≤ d ω ∧ d ω ≤ 1 := by have h0 := (outcome0 ω).property have h1 := (outcome1 ω).property change 0 ≤ (outcome0 ω : ℝ) ∧ (outcome0 ω : ℝ) ≤ 1 at h0 change 0 ≤ (outcome1 ω : ℝ) ∧ (outcome1 ω : ℝ) ≤ 1 at h1 dsimp [d] constructor <;> linarith have hdInt : Integrable d P := by apply Integrable.of_bound hdMeas.aestronglyMeasurable 1 filter_upwards with ω rw [Real.norm_eq_abs] exact abs_le.mpr (hdBounds ω) have hlower := integral_mono (integrable_const (-1 : ℝ)) hdInt (fun ω => (hdBounds ω).1) have hupper := integral_mono hdInt (integrable_const (1 : ℝ)) (fun ω => (hdBounds ω).2) constructor · simpa [ate, d, probReal_univ] using hlower · simpa [ate, d, probReal_univ] using hupper
CausalSmith.PartialID.UnlinkedPropensityAte.ate_mem_Icc_of_probability · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabelOuter.lean:24
theorem fullATEIntervalProcedure_honest

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K n :
ℕ
H :
g :
hg :
α :
ℝ
hα :
0 ≤ α
Proof (Lean source)
lemma fullATEIntervalProcedure_honest {ε : ℝ} {K n : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (α : ℝ) (hα : 0 ≤ α) : (g, fullATEIntervalProcedure n K) ∈ honestProcedures n K H α := by refine ⟨hg, ?_⟩ intro P hP let _ : IsProbabilityMeasure P := hP.1 let _ : IsProbabilityMeasure (releasedLaw P) := @Measure.isProbabilityMeasure_map _ _ _ _ P hP.1 _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure (Measure.pi (fun _ : Fin n => releasedLaw P)) := inferInstance have hate := ate_mem_Icc_of_probability P have hevent : {x | (fullATEIntervalProcedure n K).contains x (ate P)} = univ := by ext x simp [IntervalProcedure.contains, fullATEIntervalProcedure, hate.1, hate.2] rw [hevent, probReal_univ] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.fullATEIntervalProcedure_honest · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabelOuter.lean:53
theorem minimaxHonestLength_finiteLabel_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε mf α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
hmf :
0 < mf
H :
f :
ScoreSpace ε → ℝ
hDensity :
n K :
ℕ
_hn :
0 < n
hK :
0 < K
(1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ minimaxHonestLength n K H α
Proof (Lean source)
lemma minimaxHonestLength_finiteLabel_lower {ε mf α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (hmf : 0 < mf) (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) [IsProbabilityMeasure H] (hDensity : LowerScoreDensity H f mf) (n K : ℕ) (_hn : 0 < n) (hK : 0 < K) : (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ minimaxHonestLength n K H α := by let V : Set ℝ := {v : ℝ | ∃ gC ∈ honestProcedures n K H α, v = sSup {u : ℝ | ∃ P ∈ CausalLaws H gC.1, u = ∫ x, gC.2.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}} have hVne : V.Nonempty := by let r0 : LabelSpace K := ⟨0, hK⟩ let g0 : ScoreSpace ε → LabelSpace K := fun _ => r0 let C0 := fullATEIntervalProcedure n K have hg0 : Measurable g0 := measurable_const have hC0 : (g0, C0) ∈ honestProcedures n K H α := fullATEIntervalProcedure_honest H g0 hg0 α hα.1.le exact ⟨sSup {u : ℝ | ∃ P ∈ CausalLaws H g0, u = ∫ x, C0.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}, ⟨(g0, C0), hC0, rfl⟩⟩ unfold minimaxHonestLength change _ ≤ sInf V apply le_csInf hVne rintro v ⟨gC, hgC, rfl⟩ have hlower := honestProcedure_finiteLabel_expectedLength_lower mf hOverlap hmf K hK H f hDensity n α hα.2.le gC.1 gC.2 hgC.1 hgC calc (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) = (1 - 2 * α) * (mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K)) := by ring _ ≤ _ := hlower
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength_finiteLabel_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthFiniteLabelOuter.lean:78
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthRateAssembly 1 declarations Algebraic assembly of the finite-label and sampling lower rates.

Algebraic assembly of the finite-label and sampling lower rates.

theorem minimaxHonestLength_rate_assembly

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α mf L :
ℝ
n K :
ℕ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
hmf :
0 < mf
hn :
0 < n
hK :
0 < K
hLabel :
((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) * (K : ℝ)⁻¹ ≤ L
hSampling :
trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ L
A :
(1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))
c :
min A B / 2
0 < c
c * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ≤ L
Proof (Lean source)
lemma minimaxHonestLength_rate_assembly {ε α mf L : ℝ} {n K : ℕ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (hmf : 0 < mf) (hn : 0 < n) (hK : 0 < K) (hLabel : ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) * (K : ℝ)⁻¹ ≤ L) (hSampling : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ L) : let A := (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε)) let B := trialCertificate α let c := min A B / 2 0 < c ∧ c * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ≤ L := by dsimp have hβ : 0 < 1 - 2 * α := by linarith [hα.2] have hgap : 0 < 1 - 2 * ε := by linarith [hOverlap.2] have hden : 0 < 1 - ε := by linarith [hOverlap.2] have hA : 0 < (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε)) := by positivity have hlog : 0 < log (1 + (1 - 2 * α) ^ 2) := by exact Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hB : 0 < trialCertificate α := by unfold trialCertificate positivity have hc : 0 < min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2 := div_pos (lt_min hA hB) (by norm_num) refine ⟨hc, ?_⟩ have hKinv : 0 ≤ (K : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_pos.mpr hK).le have hninv : 0 ≤ (sqrt (n : ℝ))⁻¹ := inv_nonneg.mpr (Real.sqrt_pos.2 (Nat.cast_pos.mpr hn)).le have hLabelHalf : (min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2) * (K : ℝ)⁻¹ ≤ L / 2 := by calc _ ≤ (((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) / 2) * (K : ℝ)⁻¹ := mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_right (min_le_left _ _) (by norm_num)) hKinv _ = ((((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) * (K : ℝ)⁻¹) / 2) := by ring _ ≤ L / 2 := by linarith have hSamplingHalf : (min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2) * (sqrt (n : ℝ))⁻¹ ≤ L / 2 := by calc _ ≤ (trialCertificate α / 2) * (sqrt (n : ℝ))⁻¹ := mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_right (min_le_right _ _) (by norm_num)) hninv _ = (trialCertificate α * (sqrt (n : ℝ))⁻¹) / 2 := by ring _ ≤ L / 2 := by linarith calc (min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2) * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) = (min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2) * (K : ℝ)⁻¹ + (min ((1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε))) (trialCertificate α) / 2) * (sqrt (n : ℝ))⁻¹ := by ring _ ≤ L / 2 + L / 2 := add_le_add hLabelHalf hSamplingHalf _ = L := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength_rate_assembly · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthRateAssembly.lean:12
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthSamplingLower 3 declarations Fixed-score sampling lower bound for honest interval length.

Fixed-score sampling lower bound for honest interval length.

theorem honestProcedure_sampling_baseline_expectedLength_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K n :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
hn :
0 < n
hHonest :
(g, C) ∈ honestProcedures n K H α
P₀ :
trialCertificate α * (sqrt (n : ℝ))⁻¹
≤ ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P₀))
Proof (Lean source)
lemma honestProcedure_sampling_baseline_expectedLength_lower {ε : ℝ} {K n : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (C : IntervalProcedure n K) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (hn : 0 < n) (hHonest : (g, C) ∈ honestProcedures n K H α) : let P₀ := directSamplingFullLaw H g (1 / 2) trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P₀)) := by dsimp let β : ℝ := 1 - 2 * α let u : ℝ := sqrt (log (1 + β ^ 2) / (n : ℝ)) / 2 let P₀ := directSamplingFullLaw H g (1 / 2) let P₁ := directSamplingFullLaw H g (1 / 2 + u) let Q₀ := Measure.pi (fun _ : Fin n => releasedLaw P₀) let Q₁ := Measure.pi (fun _ : Fin n => releasedLaw P₁) have hcal := trial_calibrated_perturbation α hα n hn change 0 < u ∧ |u| < 1 / 2 ∧ (1 + 4 * u ^ 2) ^ n ≤ 1 + β ^ 2 at hcal rcases hcal with ⟨hu0, hu, hpow⟩ have hub := abs_lt.mp hu have hP0 : P₀ ∈ CausalLaws H g := by dsimp [P₀] exact directSamplingFullLaw_mem_causalLaws H g hg hOverlap (1 / 2) (by norm_num) (by norm_num) have hP1 : P₁ ∈ CausalLaws H g := by dsimp only [P₁] exact directSamplingFullLaw_mem_causalLaws H g hg hOverlap _ (by linarith) (by linarith) let _ : IsProbabilityMeasure P₀ := hP0.1 let _ : IsProbabilityMeasure P₁ := hP1.1 let _ : IsProbabilityMeasure (releasedLaw P₀) := @Measure.isProbabilityMeasure_map _ _ _ _ P₀ hP0.1 _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure (releasedLaw P₁) := @Measure.isProbabilityMeasure_map _ _ _ _ P₁ hP1.1 _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure Q₀ := inferInstance let _ : IsProbabilityMeasure Q₁ := inferInstance have hate0 : ate P₀ = 1 / 2 := by dsimp [P₀] exact directSamplingFullLaw_ate H g hg hOverlap (1 / 2) (by norm_num) (by norm_num) have hate1 : ate P₁ = 1 / 2 + u := by dsimp [P₁] exact directSamplingFullLaw_ate H g hg hOverlap (1 / 2 + u) (by linarith) (by linarith) have hcover0 : 1 - α ≤ Q₀.real {x | C.contains x (1 / 2)} := by rw [← hate0] exact hHonest.2 P₀ hP0 have hcover1 : 1 - α ≤ Q₁.real {x | C.contains x (1 / 2 + u)} := by rw [← hate1] exact hHonest.2 P₁ hP1 have htv : tvDist Q₀ Q₁ ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := by rw [tvDist_symm] dsimp [Q₀, Q₁, P₀, P₁] exact directSampling_productReleased_tv_bound H g hg hOverlap u hu n have hβ0 : 0 < β := by dsimp [β]; linarith [hα.2] have htvhalf : tvDist Q₀ Q₁ ≤ β / 2 := by calc _ ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := htv _ ≤ (1 / 2 : ℝ) * sqrt (β ^ 2) := by apply mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt ?_) (by norm_num) linarith _ = β / 2 := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hβ0]; ring have hlen := intervalProcedure_twoPoint_expectedLength C Q₀ Q₁ (1 / 2) (1 / 2 + u) α (by linarith) hcover0 hcover1 have hcoef : β * u / 2 ≤ u * (1 - 2 * α - tvDist Q₀ Q₁) := by dsimp [β] at htvhalf ⊢ nlinarith [mul_nonneg hu0.le (show 0 ≤ 1 - 2 * α - 2 * tvDist Q₀ Q₁ by linarith)] have hident := trial_calibrated_coefficient α n change β * u / 2 = trialCertificate α * (sqrt (n : ℝ))⁻¹ at hident rw [← hident] change β * u / 2 ≤ ∫ x, C.length x ∂Q₀ have hlen' : u * (1 - 2 * α - tvDist Q₀ Q₁) ≤ ∫ x, C.length x ∂Q₀ := by convert hlen using 1 ring exact hcoef.trans hlen'
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedure_sampling_baseline_expectedLength_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingLower.lean:15
theorem honestProcedure_sampling_worstCaseExpectedLength_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K n :
ℕ
g :
hOverlap :
hg :
α :
ℝ
hα :
0 < α ∧ α < 1 / 2
hn :
0 < n
hHonest :
(g, C) ∈ honestProcedures n K H α
trialCertificate α * (sqrt (n : ℝ))⁻¹
≤ sSup {v : ℝ | ∃ P ∈ CausalLaws H g, v = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}
Proof (Lean source)
lemma honestProcedure_sampling_worstCaseExpectedLength_lower {ε : ℝ} {K n : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (C : IntervalProcedure n K) (hOverlap : Overlap ε) (hg : Measurable g) (α : ℝ) (hα : 0 < α ∧ α < 1 / 2) (hn : 0 < n) (hHonest : (g, C) ∈ honestProcedures n K H α) : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ sSup {v : ℝ | ∃ P ∈ CausalLaws H g, v = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))} := by let P₀ := directSamplingFullLaw H g (1 / 2) have hP0 : P₀ ∈ CausalLaws H g := by dsimp [P₀] exact directSamplingFullLaw_mem_causalLaws H g hg hOverlap (1 / 2) (by norm_num) (by norm_num) have hlower := honestProcedure_sampling_baseline_expectedLength_lower H g C hOverlap hg α hα hn hHonest have hBdd : BddAbove {v : ℝ | ∃ P ∈ CausalLaws H g, v = ∫ x, C.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))} := by refine ⟨2, ?_⟩ rintro v ⟨P, hP, rfl⟩ let _ : IsProbabilityMeasure P := hP.1 let _ : IsProbabilityMeasure (releasedLaw P) := @Measure.isProbabilityMeasure_map _ _ _ _ P hP.1 _ (by exact (by unfold releasedRecord label arm observed fun_prop : Measurable (releasedRecord (ε := ε) (J := K))).aemeasurable) let _ : IsProbabilityMeasure (Measure.pi (fun _ : Fin n => releasedLaw P)) := inferInstance exact intervalProcedure_expectedLength_le_two C _ exact hlower.trans (le_csSup hBdd ⟨P₀, hP0, rfl⟩)
CausalSmith.PartialID.UnlinkedPropensityAte.honestProcedure_sampling_worstCaseExpectedLength_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingLower.lean:108
theorem minimaxHonestLength_sampling_lower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
n K :
ℕ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
hn :
0 < n
hK :
0 < K
trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ minimaxHonestLength n K H α
Proof (Lean source)
lemma minimaxHonestLength_sampling_lower {ε α : ℝ} {n K : ℕ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (hn : 0 < n) (hK : 0 < K) : trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ minimaxHonestLength n K H α := by let V : Set ℝ := {v : ℝ | ∃ gC ∈ honestProcedures n K H α, v = sSup {u : ℝ | ∃ P ∈ CausalLaws H gC.1, u = ∫ x, gC.2.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}} have hVne : V.Nonempty := by let r0 : LabelSpace K := ⟨0, hK⟩ let g0 : ScoreSpace ε → LabelSpace K := fun _ => r0 let C0 := fullATEIntervalProcedure n K have hg0 : Measurable g0 := measurable_const have hC0 : (g0, C0) ∈ honestProcedures n K H α := fullATEIntervalProcedure_honest H g0 hg0 α hα.1.le exact ⟨sSup {u : ℝ | ∃ P ∈ CausalLaws H g0, u = ∫ x, C0.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))}, ⟨(g0, C0), hC0, rfl⟩⟩ unfold minimaxHonestLength change _ ≤ sInf V apply le_csInf hVne rintro v ⟨gC, hgC, rfl⟩ exact honestProcedure_sampling_worstCaseExpectedLength_lower H gC.1 gC.2 hOverlap hgC.1 α hα hn hgC
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength_sampling_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingLower.lean:144
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthSamplingPair 21 declarations Bernoulli sampling perturbations over an arbitrary fixed score law.

Bernoulli sampling perturbations over an arbitrary fixed score law.

def samplingArmOutcomeLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a :
p :
ℝ
samplingArmOutcomeLaw a p :
if a then trialOutcomeLaw p else Measure.dirac trialZeroOutcome
def directSamplingLatentLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
H :
p :
ℝ
directSamplingLatentLaw H p :
H.prod ((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p))
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingLatentLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:21
def directSamplingFullLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
H :
g :
p :
ℝ
directSamplingFullLaw H g p :
theorem directSamplingLatentLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingLatentLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:35
theorem directSamplingAssignmentMeasures_sum

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
H :
p :
ℝ
hOverlap :
Proof (Lean source)
lemma directSamplingAssignmentMeasures_sum {ε : ℝ} (H : Measure (ScoreSpace ε)) (p : ℝ) (hOverlap : Overlap ε) : (directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity false) + (directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity true) = directSamplingLatentLaw H p := by rw [← withDensity_add_left (by change Measurable (fun q : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) => ofReal (1 - (q.1 : ℝ))) fun_prop)] have hfun : reconstructedAssignmentDensity false + reconstructedAssignmentDensity true = (1 : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) → ENNReal) := by funext q exact directSamplingAssignmentDensity_sum hOverlap q rw [hfun, withDensity_one]
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingAssignmentMeasures_sum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:56
theorem directSamplingFullLaw_map_latentTriple

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
H :
g :
hg :
hOverlap :
p :
ℝ
Proof (Lean source)
lemma directSamplingFullLaw_map_latentTriple {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) : (directSamplingFullLaw H g p).map latentTriple = directSamplingLatentLaw H p := by unfold directSamplingFullLaw rw [Measure.map_add _ _ (by unfold latentTriple score outcome0 outcome1; fun_prop), Measure.map_map (by unfold latentTriple score outcome0 outcome1; fun_prop) (reconstructedFullRow_measurable g hg false), Measure.map_map (by unfold latentTriple score outcome0 outcome1; fun_prop) (reconstructedFullRow_measurable g hg true)] have hfun (a : ArmSpace) : latentTriple ∘ reconstructedFullRow g a = id := by funext q cases a <;> rfl rw [hfun false, hfun true, Measure.map_id, Measure.map_id] change (directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity false) + (directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity true) = directSamplingLatentLaw H p exact directSamplingAssignmentMeasures_sum H p hOverlap
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_map_latentTriple · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:75
theorem directSamplingFullLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma directSamplingFullLaw_isProbabilityMeasure {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : IsProbabilityMeasure (directSamplingFullLaw H g p) := by let _ : IsProbabilityMeasure (directSamplingLatentLaw H p) := directSamplingLatentLaw_isProbabilityMeasure H p hp0 hp1 rw [isProbabilityMeasure_iff] unfold directSamplingFullLaw rw [Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hg false) MeasurableSet.univ, Measure.map_apply (reconstructedFullRow_measurable g hg true) MeasurableSet.univ] simp only [preimage_univ] rw [← Measure.add_apply, directSamplingAssignmentMeasures_sum H p hOverlap] exact isProbabilityMeasure_iff.mp inferInstance
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:97
theorem directSamplingFullLaw_scoreMarginal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma directSamplingFullLaw_scoreMarginal {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : ScoreMarginal (directSamplingFullLaw H g p) H := by let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 unfold ScoreMarginal directSamplingFullLaw rw [Measure.map_add _ _ (by unfold score; fun_prop), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg false), Measure.map_map (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg true)] have hfun (a : ArmSpace) : score ∘ reconstructedFullRow g a = fst := by funext q rfl rw [hfun false, hfun true, ← Measure.map_add _ _ measurable_fst, directSamplingAssignmentMeasures_sum H p hOverlap] unfold directSamplingLatentLaw rw [Measure.map_fst_prod] simp
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_scoreMarginal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:113
theorem directSamplingFullLaw_consistency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
H :
g :
hg :
p :
ℝ
Consistency (directSamplingFullLaw H g p)
Proof (Lean source)
lemma directSamplingFullLaw_consistency {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (p : ℝ) : Consistency (directSamplingFullLaw H g p) := by unfold Consistency directSamplingFullLaw rw [ae_add_measure_iff] constructor · rw [ae_map_iff (reconstructedFullRow_measurable g hg false).aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε K | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with q rfl · rw [ae_map_iff (reconstructedFullRow_measurable g hg true).aemeasurable (by exact measurableSet_eq_fun (by unfold observed; fun_prop) (by have hcond : MeasurableSet {ω : FullRow ε K | arm ω = true} := measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const exact Measurable.ite hcond (by unfold outcome1; fun_prop) (by unfold outcome0; fun_prop)))] filter_upwards [] with q rfl
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_consistency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:136
theorem directSamplingFullLaw_deterministicRelease

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
H :
g :
hg :
p :
ℝ
Proof (Lean source)
lemma directSamplingFullLaw_deterministicRelease {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (p : ℝ) : DeterministicRelease g (directSamplingFullLaw H g p) := by unfold DeterministicRelease directSamplingFullLaw rw [ae_add_measure_iff] constructor · rw [ae_map_iff (reconstructedFullRow_measurable g hg false).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)))] filter_upwards [] with q rfl · rw [ae_map_iff (reconstructedFullRow_measurable g hg true).aemeasurable (by exact measurableSet_eq_fun (by unfold label; fun_prop) (hg.comp (by unfold score; fun_prop)))] filter_upwards [] with q rfl
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_deterministicRelease · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:162
theorem directSamplingFullLaw_randomizedAssignment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma directSamplingFullLaw_randomizedAssignment {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : RandomizedAssignment (directSamplingFullLaw H g p) := by intro B hB let L := directSamplingLatentLaw H p let M₀ := L.withDensity (reconstructedAssignmentDensity false) let M₁ := L.withDensity (reconstructedAssignmentDensity true) let D : Set (ScoreSpace ε × (OutcomeSpace × OutcomeSpace)) := {q | (q.1, q.2.1, q.2.2) ∈ B} have hD : MeasurableSet D := hB.preimage (by fun_prop) let S : Set (FullRow ε K) := {ω | arm ω = true ∧ (score ω, outcome0 ω, outcome1 ω) ∈ B} let T : Set (FullRow ε K) := {ω | (score ω, outcome0 ω, outcome1 ω) ∈ B} have hS : MeasurableSet S := (measurableSet_eq_fun (by unfold arm; fun_prop) measurable_const).inter (hB.preimage (by unfold score outcome0 outcome1; fun_prop)) have hT : MeasurableSet T := hB.preimage (by unfold score outcome0 outcome1; fun_prop) have hpre0S : reconstructedFullRow g false ⁻¹' S = ∅ := by ext q simp [S, reconstructedFullRow, arm] have hpre1S : reconstructedFullRow g true ⁻¹' S = D := by ext q simp [S, D, reconstructedFullRow, arm, score, outcome0, outcome1] have hpre0T : reconstructedFullRow g false ⁻¹' T = D := by ext q simp [T, D, reconstructedFullRow, score, outcome0, outcome1] have hpre1T : reconstructedFullRow g true ⁻¹' T = D := by ext q simp [T, D, reconstructedFullRow, score, outcome0, outcome1] let _ : IsFiniteMeasure M₀ := directSamplingComponent_finite H hOverlap p hp0 hp1 false let _ : IsFiniteMeasure M₁ := directSamplingComponent_finite H hOverlap p hp0 hp1 true have hmap0 : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hg false) MeasurableSet.univ] exact measure_lt_top M₀ Set.univ ⟩ have hmap1 : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := ⟨by rw [Measure.map_apply (reconstructedFullRow_measurable g hg true) MeasurableSet.univ] exact measure_lt_top M₁ Set.univ ⟩ change (directSamplingFullLaw H g p).real S = ∫ ω in T, (score ω : ℝ) ∂directSamplingFullLaw H g p have hleft : (directSamplingFullLaw H g p).real S = ∫ q in D, (q.1 : ℝ) ∂L := by unfold directSamplingFullLaw rw [Measure.real_def, Measure.add_apply, Measure.map_apply (reconstructedFullRow_measurable g hg false) hS, Measure.map_apply (reconstructedFullRow_measurable g hg true) hS, hpre0S, hpre1S, measure_empty, zero_add] change M₁.real D = _ exact directSamplingAssignmentTrue_real H hOverlap p hp0 hp1 D hD rw [hleft] unfold directSamplingFullLaw let _ : IsFiniteMeasure (M₀.map (reconstructedFullRow g false)) := hmap0 let _ : IsFiniteMeasure (M₁.map (reconstructedFullRow g true)) := hmap1 rw [Measure.restrict_add, integral_add_measure (samplingFullScore_integrable_finite _).integrableOn (samplingFullScore_integrable_finite _).integrableOn, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg false).aemeasurable, setIntegral_map hT (by unfold score; fun_prop) (reconstructedFullRow_measurable g hg true).aemeasurable, hpre0T, hpre1T] change (∫ q in D, (q.1 : ℝ) ∂L) = (∫ q in D, (q.1 : ℝ) ∂M₀) + (∫ q in D, (q.1 : ℝ) ∂M₁) rw [← integral_add_measure (samplingLatentScore_integrable_finite M₀).integrableOn (samplingLatentScore_integrable_finite M₁).integrableOn] rw [← Measure.restrict_add, directSamplingAssignmentMeasures_sum H p hOverlap]
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_randomizedAssignment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:276
theorem directSamplingFullLaw_ate

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
ate (directSamplingFullLaw H g p) = p
Proof (Lean source)
lemma directSamplingFullLaw_ate {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : ate (directSamplingFullLaw H g p) = p := by let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 let _ : IsProbabilityMeasure (directSamplingLatentLaw H p) := directSamplingLatentLaw_isProbabilityMeasure H p hp0 hp1 let _ : IsProbabilityMeasure (directSamplingFullLaw H g p) := directSamplingFullLaw_isProbabilityMeasure H g hg hOverlap p hp0 hp1 have hlatentInt : Integrable (fun q : ScoreSpace ε × (OutcomeSpace × OutcomeSpace) => (q.2.2 : ℝ) - (q.2.1 : ℝ)) (directSamplingLatentLaw H p) := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with q rw [Real.norm_eq_abs] have h0 := q.2.1.property have h1 := q.2.2.property change 0 ≤ (q.2.1 : ℝ) ∧ (q.2.1 : ℝ) ≤ 1 at h0 change 0 ≤ (q.2.2 : ℝ) ∧ (q.2.2 : ℝ) ≤ 1 at h1 exact abs_le.mpr ⟨by linarith [h0.1, h1.2], by linarith [h0.2, h1.1]⟩ have houtInt : Integrable (fun q : OutcomeSpace × OutcomeSpace => (q.2 : ℝ) - (q.1 : ℝ)) ((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p)) := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with q rw [Real.norm_eq_abs] have h0 := q.1.property have h1 := q.2.property change 0 ≤ (q.1 : ℝ) ∧ (q.1 : ℝ) ≤ 1 at h0 change 0 ≤ (q.2 : ℝ) ∧ (q.2 : ℝ) ≤ 1 at h1 exact abs_le.mpr ⟨by linarith [h0.1, h1.2], by linarith [h0.2, h1.1]⟩ have hlatentMeas : Measurable (latentTriple (ε := ε) (J := K)) := by unfold latentTriple score outcome0 outcome1 fun_prop calc ate (directSamplingFullLaw H g p) = ∫ q : ScoreSpace ε × (OutcomeSpace × OutcomeSpace), ((q.2.2 : ℝ) - (q.2.1 : ℝ)) ∂directSamplingLatentLaw H p := by unfold ate rw [← directSamplingFullLaw_map_latentTriple H g hg hOverlap p] rw [integral_map hlatentMeas.aemeasurable (by fun_prop)] rfl _ = ∫ e : ScoreSpace ε, (∫ q : OutcomeSpace × OutcomeSpace, ((q.2 : ℝ) - (q.1 : ℝ)) ∂((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p))) ∂H := by unfold directSamplingLatentLaw exact integral_prod _ hlatentInt _ = ∫ q : OutcomeSpace × OutcomeSpace, ((q.2 : ℝ) - (q.1 : ℝ)) ∂((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p)) := by simp [probReal_univ] _ = ∫ y : OutcomeSpace, (y : ℝ) ∂(trialOutcomeLaw p) := by rw [integral_prod _ houtInt] simp [trialZeroOutcome] _ = p := trialOutcomeLaw_mean p hp0 hp1
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_ate · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:354
theorem directSamplingFullLaw_mem_causalLaws

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma directSamplingFullLaw_mem_causalLaws {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : directSamplingFullLaw H g p ∈ CausalLaws H g := by have hprob := directSamplingFullLaw_isProbabilityMeasure H g hg hOverlap p hp0 hp1 refine ⟨hprob, ?_⟩ exact { probability := hprob measurableRelease := hg scoreMarginal := directSamplingFullLaw_scoreMarginal H g hg hOverlap p hp0 hp1 randomizedAssignment := directSamplingFullLaw_randomizedAssignment H g hg hOverlap p hp0 hp1 consistency := directSamplingFullLaw_consistency H g hg p deterministicRelease := directSamplingFullLaw_deterministicRelease H g hg p }
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_mem_causalLaws · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:417
theorem directSamplingLatentLaw_withDensity

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
H :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
a :
= (H.withDensity (fun e => ofReal (armProb a e))).prod ((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p))
Proof (Lean source)
lemma directSamplingLatentLaw_withDensity {ε : ℝ} (H : Measure (ScoreSpace ε)) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (a : ArmSpace) : (directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity a) = (H.withDensity (fun e => ofReal (armProb a e))).prod ((Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p)) := by let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 unfold directSamplingLatentLaw reconstructedAssignmentDensity symm apply prod_withDensity_left cases a <;> simp only [armProb, Bool.false_eq_true, ↓reduceIte] <;> fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingLatentLaw_withDensity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:436
theorem directSamplingReleasedComponent

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
a :
= ((H.withDensity (fun e => ofReal (armProb a e))).prod (samplingArmOutcomeLaw a p)).map (fun q => (g q.1, a, q.2))
Proof (Lean source)
lemma directSamplingReleasedComponent {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (a : ArmSpace) : (((directSamplingLatentLaw H p).withDensity (reconstructedAssignmentDensity a)).map (reconstructedFullRow g a)).map releasedRecord = ((H.withDensity (fun e => ofReal (armProb a e))).prod (samplingArmOutcomeLaw a p)).map (fun q => (g q.1, a, q.2)) := by let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 rw [Measure.map_map (by unfold releasedRecord label arm observed; fun_prop) (reconstructedFullRow_measurable g hg a)] rw [directSamplingLatentLaw_withDensity H p hp0 hp1 a] let μ := H.withDensity (fun e => ofReal (armProb a e)) let ν := (Measure.dirac trialZeroOutcome).prod (trialOutcomeLaw p) let s : OutcomeSpace × OutcomeSpace → OutcomeSpace := fun q => if a then q.2 else q.1 have hs : Measurable s := by cases a <;> simp [s] <;> fun_prop have hselect : ν.map s = samplingArmOutcomeLaw a p := by cases a · simp only [s, Bool.false_eq_true, ↓reduceIte, samplingArmOutcomeLaw] rw [Measure.map_fst_prod] simp · simp only [s, ↓reduceIte, samplingArmOutcomeLaw] rw [Measure.map_snd_prod] simp rw [← hselect] have hprod : μ.prod (ν.map s) = (μ.prod ν).map (map id s) := by calc μ.prod (ν.map s) = (μ.map id).prod (ν.map s) := by rw [Measure.map_id] _ = (μ.prod ν).map (map id s) := Measure.map_prod_map μ ν measurable_id hs rw [hprod, Measure.map_map (by fun_prop) (measurable_id.prodMap hs)] congr 1
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingReleasedComponent · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:451
theorem directSamplingFullLaw_releasedComponents

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
= ((H.withDensity (fun e => ofReal (armProb false e))).prod (samplingArmOutcomeLaw false p)).map (fun q => (g q.1, false, q.2))
+ ((H.withDensity (fun e => ofReal (armProb true e))).prod (samplingArmOutcomeLaw true p)).map (fun q => (g q.1, true, q.2))
Proof (Lean source)
lemma directSamplingFullLaw_releasedComponents {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : releasedLaw (directSamplingFullLaw H g p) = ((H.withDensity (fun e => ofReal (armProb false e))).prod (samplingArmOutcomeLaw false p)).map (fun q => (g q.1, false, q.2)) + ((H.withDensity (fun e => ofReal (armProb true e))).prod (samplingArmOutcomeLaw true p)).map (fun q => (g q.1, true, q.2)) := by unfold releasedLaw directSamplingFullLaw rw [Measure.map_add _ _ (by unfold releasedRecord label arm observed; fun_prop)] rw [directSamplingReleasedComponent H g hg p hp0 hp1 false, directSamplingReleasedComponent H g hg p hp0 hp1 true]
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_releasedComponents · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:491
def samplingDesignLaw

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
K :
ℕ
H :
g :
samplingDesignLaw H g :
def samplingReadout

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
K :
ℕ
samplingReadout :
fun z => (z.2.1, z.2.2, if z.2.2 then z.1 else trialZeroOutcome)
theorem samplingReadout_measurable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
K :
ℕ
Proof (Lean source)
lemma samplingReadout_measurable {K : ℕ} : Measurable (samplingReadout (K := K)) := by unfold samplingReadout have hcond : MeasurableSet {z : OutcomeSpace × (LabelSpace K × ArmSpace) | z.2.2 = true} := measurableSet_eq_fun (measurable_snd.comp measurable_snd) measurable_const have hobs : Measurable (fun z : OutcomeSpace × (LabelSpace K × ArmSpace) => if z.2.2 then z.1 else trialZeroOutcome) := Measurable.ite hcond measurable_fst measurable_const fun_prop (disch := assumption)
CausalSmith.PartialID.UnlinkedPropensityAte.samplingReadout_measurable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:518
theorem samplingDesignLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
Proof (Lean source)
lemma samplingDesignLaw_isProbabilityMeasure {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) : IsProbabilityMeasure (samplingDesignLaw H g) := by have hmeas (a : ArmSpace) : Measurable (fun e : ScoreSpace ε => ofReal (armProb a e)) := by cases a · change Measurable (fun e : ScoreSpace ε => ofReal (1 - (e : ℝ))) fun_prop · change Measurable (fun e : ScoreSpace ε => ofReal (e : ℝ)) fun_prop have hsum : H.withDensity (fun e => ofReal (armProb false e)) + H.withDensity (fun e => ofReal (armProb true e)) = H := by rw [← withDensity_add_left (hmeas false)] have hfun : (fun e : ScoreSpace ε => ofReal (armProb false e)) + (fun e => ofReal (armProb true e)) = 1 := by funext e exact directSamplingAssignmentDensity_sum hOverlap (e, (trialZeroOutcome, trialZeroOutcome)) rw [hfun, withDensity_one] apply isProbabilityMeasure_iff.mpr unfold samplingDesignLaw randomizedKeyLaw scoreAssignedKeyLaw rw [Measure.add_apply, Measure.map_apply (by fun_prop) MeasurableSet.univ, Measure.map_apply (by fun_prop) MeasurableSet.univ] simp only [preimage_univ] rw [← Measure.add_apply, hsum] exact isProbabilityMeasure_iff.mp inferInstance
CausalSmith.PartialID.UnlinkedPropensityAte.samplingDesignLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:531
theorem directSamplingFullLaw_releasedLaw

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
p :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
Proof (Lean source)
lemma directSamplingFullLaw_releasedLaw {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (p : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) : releasedLaw (directSamplingFullLaw H g p) = ((trialOutcomeLaw p).prod (samplingDesignLaw H g)).map samplingReadout := by let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 rw [directSamplingFullLaw_releasedComponents H g hg p hp0 hp1] unfold samplingDesignLaw randomizedKeyLaw rw [Measure.prod_add, Measure.map_add _ _ samplingReadout_measurable] rw [← directSamplingReleasedComponent_design H g hg p hp0 hp1 false, ← directSamplingReleasedComponent_design H g hg p hp0 hp1 true]
CausalSmith.PartialID.UnlinkedPropensityAte.directSamplingFullLaw_releasedLaw · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingPair.lean:633
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthSamplingTV 2 declarations Product total-variation bound for the arbitrary-score sampling pair.

Product total-variation bound for the arbitrary-score sampling pair.

theorem directSampling_productReleased_tv_le_latent

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
p q :
ℝ
hp0 :
0 ≤ p
hp1 :
p ≤ 1
hq0 :
0 ≤ q
hq1 :
q ≤ 1
n :
ℕ
tvDist (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g p))) (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g q)))
≤ tvDist (Measure.pi (fun _ : Fin n => (trialOutcomeLaw p).prod (samplingDesignLaw H g))) (Measure.pi (fun _ : Fin n => (trialOutcomeLaw q).prod (samplingDesignLaw H g)))
Proof (Lean source)
lemma directSampling_productReleased_tv_le_latent {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (p q : ℝ) (hp0 : 0 ≤ p) (hp1 : p ≤ 1) (hq0 : 0 ≤ q) (hq1 : q ≤ 1) (n : ℕ) : tvDist (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g p))) (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g q))) ≤ tvDist (Measure.pi (fun _ : Fin n => (trialOutcomeLaw p).prod (samplingDesignLaw H g))) (Measure.pi (fun _ : Fin n => (trialOutcomeLaw q).prod (samplingDesignLaw H g))) := by let f : OutcomeSpace × (LabelSpace K × ArmSpace) → Observation K := samplingReadout have hf : Measurable f := samplingReadout_measurable let _ : IsProbabilityMeasure (samplingDesignLaw H g) := samplingDesignLaw_isProbabilityMeasure H g hg hOverlap let _ : IsProbabilityMeasure (trialOutcomeLaw p) := trialOutcomeLaw_isProbabilityMeasure p hp0 hp1 let _ : IsProbabilityMeasure (trialOutcomeLaw q) := trialOutcomeLaw_isProbabilityMeasure q hq0 hq1 have hmap (r : ℝ) (hr0 : 0 ≤ r) (hr1 : r ≤ 1) : Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g r)) = (Measure.pi (fun _ : Fin n => (trialOutcomeLaw r).prod (samplingDesignLaw H g))).map (fun z i => f (z i)) := by let _ : IsProbabilityMeasure (trialOutcomeLaw r) := trialOutcomeLaw_isProbabilityMeasure r hr0 hr1 rw [Measure.pi_map_pi (fun _ => hf.aemeasurable)] simp only [directSamplingFullLaw_releasedLaw H g hg r hr0 hr1] rfl rw [hmap p hp0 hp1, hmap q hq0 hq1] exact trialReadout_tv_le _ _ _ (measurable_pi_lambda _ fun _ => hf.comp (measurable_pi_apply _))
CausalSmith.PartialID.UnlinkedPropensityAte.directSampling_productReleased_tv_le_latent · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingTV.lean:14
theorem directSampling_productReleased_tv_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hg :
hOverlap :
u :
ℝ
hu :
|u| < 1 / 2
n :
ℕ
tvDist (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g (1 / 2 + u)))) (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g (1 / 2))))
≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1)
Proof (Lean source)
lemma directSampling_productReleased_tv_bound {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hg : Measurable g) (hOverlap : Overlap ε) (u : ℝ) (hu : |u| < 1 / 2) (n : ℕ) : tvDist (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g (1 / 2 + u)))) (Measure.pi (fun _ : Fin n => releasedLaw (directSamplingFullLaw H g (1 / 2)))) ≤ (1 / 2 : ℝ) * sqrt ((1 + 4 * u ^ 2) ^ n - 1) := by have hub := abs_lt.mp hu let ρ := samplingDesignLaw H g let μ := (trialOutcomeLaw (1 / 2 + u)).prod ρ let ν := (trialOutcomeLaw (1 / 2)).prod ρ let _ : IsProbabilityMeasure (trialOutcomeLaw (1 / 2 + u)) := trialOutcomeLaw_isProbabilityMeasure _ (by linarith) (by linarith) let _ : IsProbabilityMeasure (trialOutcomeLaw (1 / 2)) := trialOutcomeLaw_isProbabilityMeasure _ (by norm_num) (by norm_num) let _ : IsProbabilityMeasure ρ := samplingDesignLaw_isProbabilityMeasure H g hg hOverlap have h := trialOutcomeLaw_ac_integrable_center u have hac : μ ≪ ν := h.1.prod (Measure.AbsolutelyContinuous.refl ρ) have hint : Integrable (fun z => ((μ.rnDeriv ν z).toReal - 1) ^ 2) ν := trial_ancillary_integrable _ _ ρ h.1 h.2 calc _ ≤ tvDist (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) := directSampling_productReleased_tv_le_latent H g hg hOverlap (1 / 2 + u) (1 / 2) (by linarith) (by linarith) (by norm_num) (by norm_num) n _ ≤ (1 / 2 : ℝ) * sqrt ((1 + chiSqDiv μ ν) ^ n - 1) := trialProduct_tv_le_of_chisq μ ν hac hint n _ = _ := by change (1 / 2 : ℝ) * sqrt ((1 + chiSqDiv ((trialOutcomeLaw (1 / 2 + u)).prod ρ) ((trialOutcomeLaw (1 / 2)).prod ρ)) ^ n - 1) = _ rw [chiSqDiv_prod_ancillary (trialOutcomeLaw (1 / 2 + u)) (trialOutcomeLaw (1 / 2)) ρ h.1 h.2] rw [trialOutcomeLaw_chisq_center u hu]
CausalSmith.PartialID.UnlinkedPropensityAte.directSampling_productReleased_tv_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthSamplingTV.lean:55
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthTesting 1 declarations Two-point testing lower bounds for ordinary released-trial confidence intervals.

Two-point testing lower bounds for ordinary released-trial confidence intervals.

theorem intervalProcedure_twoPoint_expectedLength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
K n :
ℕ
θ0 θ1 α :
ℝ
hθ :
θ0 ≤ θ1
hcover0 :
1 - α ≤ Q0.real {x | C.contains x θ0}
hcover1 :
1 - α ≤ Q1.real {x | C.contains x θ1}
(θ1 - θ0) * (1 - 2 * α - tvDist Q0 Q1) ≤ ∫ x, C.length x ∂Q0
Proof (Lean source)
lemma intervalProcedure_twoPoint_expectedLength {K n : ℕ} (C : IntervalProcedure n K) (Q0 Q1 : Measure (TrialSample n K)) [IsProbabilityMeasure Q0] [IsProbabilityMeasure Q1] (θ0 θ1 α : ℝ) (hθ : θ0 ≤ θ1) (hcover0 : 1 - α ≤ Q0.real {x | C.contains x θ0}) (hcover1 : 1 - α ≤ Q1.real {x | C.contains x θ1}) : (θ1 - θ0) * (1 - 2 * α - tvDist Q0 Q1) ≤ ∫ x, C.length x ∂Q0 := by let A0 : Set (TrialSample n K) := {x | C.contains x θ0} let A1 : Set (TrialSample n K) := {x | C.contains x θ1} let I := A0 ∩ A1 have hA (θ : ℝ) : MeasurableSet {x | C.contains x θ} := by change MeasurableSet {x | C.lo x ≤ θ ∧ θ ≤ C.hi x} exact (measurableSet_le C.measurable_lo measurable_const).inter (measurableSet_le measurable_const C.measurable_hi) have hA0 : MeasurableSet A0 := hA θ0 have hA1 : MeasurableSet A1 := hA θ1 have hI : MeasurableSet I := hA0.inter hA1 have htransfer : 1 - α - tvDist Q0 Q1 ≤ Q0.real A1 := by have htv := measureReal_sub_le_tvDist (μ := Q0) (ν := Q1) hA1 dsimp [A1] at htv linarith have hmass : 1 - 2 * α - tvDist Q0 Q1 ≤ Q0.real I := by have hu : Q0.real (A0 ∪ A1) ≤ 1 := measureReal_le_one have hsum := measureReal_union_add_inter (μ := Q0) (s := A0) (t := A1) hA1 (measure_ne_top Q0 A0) (measure_ne_top Q0 A1) change Q0.real (A0 ∪ A1) + Q0.real I = Q0.real A0 + Q0.real A1 at hsum linarith have hlenMeas : Measurable C.length := C.measurable_hi.sub C.measurable_lo have hlenNonneg (x : TrialSample n K) : 0 ≤ C.length x := sub_nonneg.mpr (C.ordered x) have hlenBound (x : TrialSample n K) : C.length x ≤ 2 := by dsimp [IntervalProcedure.length] linarith [C.lower_bound x, C.upper_bound x] have hlenInt : Integrable C.length Q0 := by apply Integrable.of_bound hlenMeas.aestronglyMeasurable 2 filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (hlenNonneg x)] exact hlenBound x have hindInt : Integrable (I.indicator (fun _ => θ1 - θ0)) Q0 := (integrable_const _).indicator hI have hpoint (x : TrialSample n K) : I.indicator (fun _ => θ1 - θ0) x ≤ C.length x := by by_cases hx : x ∈ I · rw [Set.indicator_of_mem hx] have hx0 : C.lo x ≤ θ0 ∧ θ0 ≤ C.hi x := hx.1 have hx1 : C.lo x ≤ θ1 ∧ θ1 ≤ C.hi x := hx.2 dsimp [IntervalProcedure.length] linarith · rw [Set.indicator_of_notMem hx] exact hlenNonneg x have hmono := integral_mono hindInt hlenInt hpoint rw [integral_indicator_const (θ1 - θ0) hI] at hmono simp only [smul_eq_mul] at hmono rw [mul_comm (Q0.real I) (θ1 - θ0)] at hmono exact (mul_le_mul_of_nonneg_left hmass (sub_nonneg.mpr hθ)).trans hmono
CausalSmith.PartialID.UnlinkedPropensityAte.intervalProcedure_twoPoint_expectedLength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthTesting.lean:15
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.MinimaxHonestLengthUpper 1 declarations Outer-infimum upper bound from the explicit midpoint interval.

Outer-infimum upper bound from the explicit midpoint interval.

theorem minimaxHonestLength_midpoint_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
n K :
ℕ
hn :
0 < n
hK :
0 < K
≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
Proof (Lean source)
lemma minimaxHonestLength_midpoint_upper {ε α : ℝ} (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (n K : ℕ) (hn : 0 < n) (hK : 0 < K) : minimaxHonestLength n K H α ≤ midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) := by let CI := midpointInterval hOverlap hα n K hn hK let R := midpointLengthConstant ε α * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) let V : Set ℝ := {v : ℝ | ∃ gC ∈ honestProcedures n K H α, v = sSup {u : ℝ | ∃ P ∈ CausalLaws H gC.1, u = ∫ x, gC.2.length x ∂Measure.pi (fun _ : Fin n => releasedLaw P)}} have hVbelow : BddBelow V := by refine ⟨0, ?_⟩ rintro v ⟨gC, hgC, rfl⟩ exact innerExpectedLengthSup_nonneg H gC.1 gC.2 have hhonest : (equalWidthRelease ε K hK, CI) ∈ honestProcedures n K H α := equalWidth_midpointInterval_honest hOverlap hα H n K hn hK let U : Set ℝ := {u : ℝ | ∃ P ∈ CausalLaws H (equalWidthRelease ε K hK), u = ∫ x, CI.length x ∂Measure.pi (fun _ : Fin n => releasedLaw P)} have hUne : U.Nonempty := by obtain ⟨P, hP⟩ := equalWidth_causalLaws_nonempty hOverlap H K hK refine ⟨∫ x, CI.length x ∂Measure.pi (fun _ : Fin n => releasedLaw P), P, hP, rfl⟩ have hUsup : sSup U ≤ R := by apply csSup_le hUne rintro u ⟨P, hP, rfl⟩ letI : IsProbabilityMeasure P := hP.1 have hrecord : Measurable (releasedRecord (ε := ε) (J := K)) := by unfold releasedRecord label arm observed fun_prop letI : IsProbabilityMeasure (releasedLaw P) := by unfold releasedLaw exact Measure.isProbabilityMeasure_map hrecord.aemeasurable exact midpointInterval_expectedLength_le hOverlap hα n K hn hK (releasedLaw P) unfold minimaxHonestLength change sInf V ≤ R calc sInf V ≤ sSup U := by apply csInf_le hVbelow exact ⟨(equalWidthRelease ε K hK, CI), hhonest, rfl⟩ _ ≤ R := hUsup
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength_midpoint_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/MinimaxHonestLengthUpper.lean:101
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.Projection 19 declarations Joint empirical-measure projection for external score-log inference.

Joint empirical-measure projection for external score-log inference.

def ArmCellArray

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
α :
ArmCellArray J α :
Type u_1
CausalSmith.PartialID.UnlinkedPropensityAte.ArmCellArray · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:15
def empiricalTrialCells

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J n :
ℕ
x :
empiricalTrialCells x :
fun a r => ((n : ENNReal)⁻¹) • ∑ i : Fin n, if (x i).1 = r ∧
(x i).2.1 = a then Measure.dirac (x i).2.2 else 0
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalTrialCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:19
def empiricalScoreCells

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J m :
ℕ
g :
x :
Fin m → ScoreSpace ε
empiricalScoreCells g x :
fun a r
=> ∑ j : Fin m, if g (x j) = r then ((ofReal (armProb a (x j))) / m) • Measure.dirac (x j) else 0
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalScoreCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:26
def outcomeCDFDistance

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
outcomeCDFDistance μ ν :
ℝ
|μ.real univ
- ν.real univ|
+ ∫ t in (0 : ℝ)..1, |(μ {y | (y : ℝ) ≤ t}).toReal
- (ν {y | (y : ℝ) ≤ t}).toReal|
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:35
def scoreCDFDistance

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
μ ν :
scoreCDFDistance μ ν :
ℝ
|μ.real univ
- ν.real univ|
+ ∫ t in ε..(1 - ε), |(μ {e | (e : ℝ) ≤ t}).toReal
- (ν {e | (e : ℝ) ≤ t}).toReal|
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCDFDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:41

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
σ :
a r :
ProjectionCompatible lam σ :
Prop
(lam a r).real univ = (σ a r).real univ
CausalSmith.PartialID.UnlinkedPropensityAte.ProjectionCompatible · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:48
def projectedArmEndpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
σ :
a :
upper :
projectedArmEndpoint lam σ a upper :
ℝ
∑ r : LabelSpace J, let q := (lam a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam a r univ)⁻¹ • (lam a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ a r univ)⁻¹ • (σ a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:53
def rationalOutcomePoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
q :
ℚ
rationalOutcomePoint q :
⟨max 0 (min 1 (q : ℝ)), by constructor · exact le_max_left _ _ · exact max_le (by norm_num) (min_le_left _ _)⟩
CausalSmith.PartialID.UnlinkedPropensityAte.rationalOutcomePoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:69
def rationalScorePoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
q :
ℚ
rationalScorePoint ε hOverlap q :
⟨ε + (1 - 2 * ε) * (rationalOutcomePoint q : ℝ), by have hwidth : 0
≤ 1
- 2 * ε := by dsimp [Overlap] at hOverlap linarith [hOverlap.2] have hq := (rationalOutcomePoint q).property constructor · have hm := mul_nonneg hwidth hq.1 linarith · have hm := mul_le_mul_of_nonneg_left hq.2 hwidth linarith⟩
CausalSmith.PartialID.UnlinkedPropensityAte.rationalScorePoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:76
def rationalOutcomeMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
l :
List (ℚ × ℚ)
rationalOutcomeMeasure l :
(l.map (fun p => ofReal (p.2 : ℝ) • Measure.dirac (rationalOutcomePoint p.1))).sum
CausalSmith.PartialID.UnlinkedPropensityAte.rationalOutcomeMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:90
def rationalScoreMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
l :
List (ℚ × ℚ)
rationalScoreMeasure ε hOverlap l :
(l.map (fun p => ofReal (p.2 : ℝ) • Measure.dirac (rationalScorePoint ε hOverlap p.1))).sum
CausalSmith.PartialID.UnlinkedPropensityAte.rationalScoreMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:94
def rationalArraySieve

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
rationalArraySieve ε J :
by classical exact if hOverlap : Overlap ε then range (fun code : (ArmSpace → LabelSpace J → List (ℚ × ℚ)) × (ArmSpace → LabelSpace J → List (ℚ × ℚ)) => (fun a r => rationalOutcomeMeasure (code.1 a r), fun a r => rationalScoreMeasure ε hOverlap (code.2 a r))) ∩ {b | ProjectionCompatible b.1 b.2} else ∅
CausalSmith.PartialID.UnlinkedPropensityAte.rationalArraySieve · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:100
def projectionCandidates

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
projectionCandidates g α x :
{b | (∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤) ∧ ProjectionCompatible b.1 b.2 ∧ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r)) ≤ 4 * J / (α * sqrt n) ∧ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r)) ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)}
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:113
def sievedProjectionCandidates

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
sievedProjectionCandidates g α x :
CausalSmith.PartialID.UnlinkedPropensityAte.sievedProjectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:127
theorem countable_rationalArraySieve Lemma countable_rationalArraySieve in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
(rationalArraySieve ε J).Countable
Proof (Lean source)
lemma countable_rationalArraySieve (ε : ℝ) (J : ℕ) : (rationalArraySieve ε J).Countable := by classical unfold rationalArraySieve split_ifs · exact (Set.countable_range _).mono Set.inter_subset_left · exact Set.countable_empty
CausalSmith.PartialID.UnlinkedPropensityAte.countable_rationalArraySieve · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:134
theorem countable_sievedProjectionCandidates Lemma countable_sievedProjectionCandidates in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
(sievedProjectionCandidates g α x).Countable
Proof (Lean source)
lemma countable_sievedProjectionCandidates {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : (sievedProjectionCandidates g α x).Countable := by exact (countable_rationalArraySieve ε J).mono Set.inter_subset_right
CausalSmith.PartialID.UnlinkedPropensityAte.countable_sievedProjectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:143
def projectedATEInterval

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
σ :
projectedATEInterval lam σ :
Set ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEInterval · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:150
def sievedTotalizedProjectionCI

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
sievedTotalizedProjectionCI g α x :
Set ℝ
by classical let B := sievedProjectionCandidates g α x let C := Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ B, projectedATEInterval b.1 b.2)) exact if B.Nonempty ∧
C.Nonempty then C else {0}
CausalSmith.PartialID.UnlinkedPropensityAte.sievedTotalizedProjectionCI · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:158
def externalProjectionCI

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
externalProjectionCI g α x :
Set ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Projection.lean:169
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionCandidateStability 3 declarations Candidate-to-population endpoint stability for the external projection.

Candidate-to-population endpoint stability for the external projection.

theorem projectionCandidate_armEndpoint_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
σ :
hb :
hfinLam :
∀ a r, IsFiniteMeasure (lam a r)
hfinσ :
∀ a r, IsFiniteMeasure (σ a r)
hcompat :
a :
upper :
|projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper|
≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)))
Proof (Lean source)
lemma projectionCandidate_armEndpoint_abs_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (hfinLam : ∀ a r, IsFiniteMeasure (lam a r)) (hfinσ : ∀ a r, IsFiniteMeasure (σ a r)) (hcompat : ProjectionCompatible lam σ) (a : ArmSpace) (upper : Bool) : |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r))) := by have hfinB₁ : ∀ a r, IsFiniteMeasure (b.1 a r) := fun a r => ⟨(hb.1 a r).1⟩ have hfinB₂ : ∀ a r, IsFiniteMeasure (b.2 a r) := fun a r => ⟨(hb.1 a r).2⟩ have hε : 0 < ε := hOverlap.1 have hL : 0 ≤ ε⁻¹ + (ε ^ 2)⁻¹ := by positivity have hArm : ∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * ((∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) := by intro a upper exact projectedArmEndpoint_abs_le_of_compatible_cells hOverlap b.1 lam b.2 σ hfinB₁ hfinLam hfinB₂ hfinσ hb.2.1 hcompat a upper have hEndpoint := projectedArmEndpoint_abs_le_of_armBounds hOverlap b.1 lam b.2 σ (ε⁻¹ + (ε ^ 2)⁻¹) hL hArm a upper have hDistance := projectionCandidate_populationDistance_le_of_populationFinite g α hOverlap x b lam σ hb (fun a r => (hfinLam a r).measure_univ_lt_top) (fun a r => (hfinσ a r).measure_univ_lt_top) exact hEndpoint.trans (mul_le_mul_of_nonneg_left hDistance hL)
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_armEndpoint_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCandidateStability.lean:14
theorem projectionCandidate_populationArmEndpoint_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
PH :
hPH :
PH ∈ ExternalLaws g
x :
hb :
a :
upper :
|projectedArmEndpoint b.1 b.2 a upper
≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r)))
Proof (Lean source)
lemma projectionCandidate_populationArmEndpoint_abs_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (a : ArmSpace) (upper : Bool) : |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) a upper| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r))) := by haveI : IsProbabilityMeasure PH.2 := hPH.2.1 haveI : IsProbabilityMeasure (releasedLaw PH.1) := by unfold releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.1 _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable have hfin := projectionPopulationCells_finite PH.2 g (releasedLaw PH.1) hPH.2.2.overlap hPH.2.2.measurableRelease exact projectionCandidate_armEndpoint_abs_le g α hPH.2.2.overlap x b (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) hb hfin.1 hfin.2 (projectionCompatible_populationCells PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH) hPH.2.2.overlap) a upper
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_populationArmEndpoint_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCandidateStability.lean:63
theorem projectionCandidate_populationATEInterval_subset

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
PH :
hPH :
PH ∈ ExternalLaws g
x :
hb :
δ :
(ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r)))
Proof (Lean source)
lemma projectionCandidate_populationATEInterval_subset {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) : let δ := (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r))) projectedATEInterval b.1 b.2 ⊆ Icc ((projectedArmEndpoint (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) true false - projectedArmEndpoint (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) false true) - 2 * δ) ((projectedArmEndpoint (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) true true - projectedArmEndpoint (trialPopulationCells (releasedLaw PH.1)) (scorePopulationCells PH.2 g) false false) + 2 * δ) := by dsimp apply projectedATEInterval_subset_of_armEndpoint_bounds intro a upper exact projectionCandidate_populationArmEndpoint_abs_le g α PH hPH x b hb a upper
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_populationATEInterval_subset · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCandidateStability.lean:100
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionCellStability 4 declarations Cellwise stability of the quantile product used by the projected arm endpoint.

Cellwise stability of the quantile product used by the projected arm endpoint.

theorem projectedCellSummand_abs_le_of_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
upper :
σ σ' :
hcompat :
μ.real univ = σ.real univ
hcompat' :
μ'.real univ = σ'.real univ
hp :
0 < μ.real univ
hp' :
0 < μ'.real univ
|μ.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u))
- μ'.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ' univ)⁻¹ • μ').map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' univ)⁻¹ • σ').map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u))|
≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ')
Proof (Lean source)
lemma projectedCellSummand_abs_le_of_pos {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) (μ μ' : Measure OutcomeSpace) (σ σ' : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure μ'] [IsFiniteMeasure σ] [IsFiniteMeasure σ'] (hcompat : μ.real univ = σ.real univ) (hcompat' : μ'.real univ = σ'.real univ) (hp : 0 < μ.real univ) (hp' : 0 < μ'.real univ) : |μ.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u)) - μ'.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ' univ)⁻¹ • μ').map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' univ)⁻¹ • σ').map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u))| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ') := by let Y : Measure ℝ := ((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ)) let Y' : Measure ℝ := ((μ' univ)⁻¹ • μ').map (fun y : OutcomeSpace => (y : ℝ)) let W : Measure ℝ := ((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹) let W' : Measure ℝ := ((σ' univ)⁻¹ • σ').map (fun e => (armProb a e)⁻¹) let A : ℝ := ∫ u in (0 : ℝ)..1, quantile Y u * quantile W (if upper then u else 1 - u) let A' : ℝ := ∫ u in (0 : ℝ)..1, quantile Y' u * quantile W' (if upper then u else 1 - u) have hσp : 0 < σ.real univ := hcompat ▸ hp have hσp' : 0 < σ'.real univ := hcompat' ▸ hp' letI : IsProbabilityMeasure Y := by dsimp [Y] rw [map_normalized_subtype_eq_finiteNormalize μ hp] infer_instance letI : IsProbabilityMeasure Y' := by dsimp [Y'] rw [map_normalized_subtype_eq_finiteNormalize μ' hp'] infer_instance letI : IsProbabilityMeasure W := by dsimp [W] rw [map_normalized_inverseArmProb_eq_finiteNormalize_map a σ hσp] exact Measure.isProbabilityMeasure_map (measurable_projectionInverseArmProbReal a).aemeasurable letI : IsProbabilityMeasure W' := by dsimp [W'] rw [map_normalized_inverseArmProb_eq_finiteNormalize_map a σ' hσp'] exact Measure.isProbabilityMeasure_map (measurable_projectionInverseArmProbReal a).aemeasurable have hYs : Y (Icc 0 1)ᶜ = 0 := by dsimp [Y] exact normalizedOutcome_support μ hp have hYs' : Y' (Icc 0 1)ᶜ = 0 := by dsimp [Y'] exact normalizedOutcome_support μ' hp' have hWs : W (Icc 0 ε⁻¹)ᶜ = 0 := by dsimp [W] exact normalizedInverseArmProb_support hOverlap a σ hσp have hWs' : W' (Icc 0 ε⁻¹)ᶜ = 0 := by dsimp [W'] exact normalizedInverseArmProb_support hOverlap a σ' hσp' have hεinv : 0 ≤ ε⁻¹ := (inv_pos.mpr hOverlap.1).le have hε2inv : 0 ≤ (ε ^ 2)⁻¹ := by positivity have hAb : |A| ≤ ε⁻¹ := by dsimp [A] simpa using abs_quantile_product_integral_le Y W (by norm_num) hεinv hYs hWs upper have hAb' : |A'| ≤ ε⁻¹ := by dsimp [A'] simpa using abs_quantile_product_integral_le Y' W' (by norm_num) hεinv hYs' hWs' upper let DY : ℝ := ∫ u in (0 : ℝ)..1, |quantile Y u - quantile Y' u| let DW : ℝ := ∫ u in (0 : ℝ)..1, |quantile W u - quantile W' u| let O : ℝ := ∫ t in (0 : ℝ)..1, |(μ {y | (y : ℝ) ≤ t}).toReal - (μ' {y | (y : ℝ) ≤ t}).toReal| let S : ℝ := ∫ t in ε..(1 - ε), |(σ {e | (e : ℝ) ≤ t}).toReal - (σ' {e | (e : ℝ) ≤ t}).toReal| let d : ℝ := |μ.real univ - μ'.real univ| have hDY : 0 ≤ DY := by dsimp [DY] exact intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => abs_nonneg _) have hDW : 0 ≤ DW := by dsimp [DW] exact intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => abs_nonneg _) have hO : 0 ≤ O := by dsimp [O] exact intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => abs_nonneg _) have hS : 0 ≤ S := by dsimp [S] exact intervalIntegral.integral_nonneg (by linarith [hOverlap.2]) (fun _ _ => abs_nonneg _) have hd : 0 ≤ d := abs_nonneg _ have hout : min (μ.real univ) (μ'.real univ) * DY ≤ O + d := by dsimp [DY, O, d, Y, Y'] simpa using finite_mass_subtype_quantile_transport_le (by norm_num) μ μ' hp hp' have hscore : min (μ.real univ) (μ'.real univ) * (∫ u in (0 : ℝ)..1, |quantile (((σ univ)⁻¹ • σ).map (fun e : ScoreSpace ε => (e : ℝ))) u - quantile (((σ' univ)⁻¹ • σ').map (fun e : ScoreSpace ε => (e : ℝ))) u|) ≤ S + (1 - 2 * ε) * d := by have h := finite_mass_subtype_quantile_transport_le (by linarith [hOverlap.2] : ε ≤ 1 - ε) σ σ' hσp hσp' rw [← hcompat, ← hcompat'] at h simpa [S, d, sub_sub, two_mul, Measure.map_smul] using h have hpush : DW ≤ (ε ^ 2)⁻¹ * (∫ u in (0 : ℝ)..1, |quantile (((σ univ)⁻¹ • σ).map (fun e : ScoreSpace ε => (e : ℝ))) u - quantile (((σ' univ)⁻¹ • σ').map (fun e : ScoreSpace ε => (e : ℝ))) u|) := by dsimp [DW, W, W'] exact inverseArmProb_quantile_distance_le hOverlap a σ σ' hσp hσp' have hwidth : 0 ≤ 1 - 2 * ε ∧ 1 - 2 * ε ≤ 1 := by constructor <;> linarith [hOverlap.1, hOverlap.2] have hweight : min (μ.real univ) (μ'.real univ) * DW ≤ (ε ^ 2)⁻¹ * (S + d) := by have hmin : 0 ≤ min (μ.real univ) (μ'.real univ) := le_min measureReal_nonneg measureReal_nonneg calc _ ≤ min (μ.real univ) (μ'.real univ) * ((ε ^ 2)⁻¹ * ∫ u in (0 : ℝ)..1, |quantile (((σ univ)⁻¹ • σ).map (fun e : ScoreSpace ε => (e : ℝ))) u - quantile (((σ' univ)⁻¹ • σ').map (fun e : ScoreSpace ε => (e : ℝ))) u|) := mul_le_mul_of_nonneg_left hpush hmin _ = (ε ^ 2)⁻¹ * (min (μ.real univ) (μ'.real univ) * ∫ u in (0 : ℝ)..1, |quantile (((σ univ)⁻¹ • σ).map (fun e : ScoreSpace ε => (e : ℝ))) u - quantile (((σ' univ)⁻¹ • σ').map (fun e : ScoreSpace ε => (e : ℝ))) u|) := by ring _ ≤ (ε ^ 2)⁻¹ * (S + (1 - 2 * ε) * d) := mul_le_mul_of_nonneg_left hscore hε2inv _ ≤ (ε ^ 2)⁻¹ * (S + d) := by gcongr nlinarith [mul_nonneg hd (sub_nonneg.mpr hwidth.2)] have hprod : |A - A'| ≤ ε⁻¹ * DY + DW := by dsimp [A, A', DY, DW] simpa using quantile_product_integral_stability Y Y' W W' (by norm_num) hεinv hYs hYs' hWs hWs' upper have hmin : 0 ≤ min (μ.real univ) (μ'.real univ) := le_min measureReal_nonneg measureReal_nonneg have hprodScaled : min (μ.real univ) (μ'.real univ) * |A - A'| ≤ ε⁻¹ * (O + d) + (ε ^ 2)⁻¹ * (S + d) := by calc _ ≤ min (μ.real univ) (μ'.real univ) * (ε⁻¹ * DY + DW) := mul_le_mul_of_nonneg_left hprod hmin _ = ε⁻¹ * (min (μ.real univ) (μ'.real univ) * DY) + min (μ.real univ) (μ'.real univ) * DW := by ring _ ≤ ε⁻¹ * (O + d) + (ε ^ 2)⁻¹ * (S + d) := add_le_add (mul_le_mul_of_nonneg_left hout hεinv) hweight have hscale : |μ.real univ * A - μ'.real univ * A'| ≤ min (μ.real univ) (μ'.real univ) * |A - A'| + ε⁻¹ * |μ.real univ - μ'.real univ| := abs_mass_mul_sub_mass_mul_le (p := μ.real univ) (q := μ'.real univ) (A := A) (A' := A') (B := ε⁻¹) measureReal_nonneg measureReal_nonneg hAb hAb' change |μ.real univ * A - μ'.real univ * A'| ≤ _ calc _ ≤ min (μ.real univ) (μ'.real univ) * |A - A'| + ε⁻¹ * |μ.real univ - μ'.real univ| := hscale _ ≤ (ε⁻¹ * (O + d) + (ε ^ 2)⁻¹ * (S + d)) + ε⁻¹ * d := add_le_add hprodScaled le_rfl _ ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * ((d + O) + (d + S)) := by nlinarith [mul_nonneg hεinv hS, mul_nonneg hε2inv hO, mul_nonneg hε2inv hd] _ = (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ') := by unfold outcomeCDFDistance scoreCDFDistance rw [← hcompat, ← hcompat']
CausalSmith.PartialID.UnlinkedPropensityAte.projectedCellSummand_abs_le_of_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellStability.lean:16
theorem projectedCellTerm_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
upper :
σ :
hcompat :
μ.real univ = σ.real univ
hp :
0 < μ.real univ
|μ.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u))|
≤ ε⁻¹ * μ.real univ
Proof (Lean source)
lemma projectedCellTerm_abs_le {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) (μ : Measure OutcomeSpace) (σ : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure σ] (hcompat : μ.real univ = σ.real univ) (hp : 0 < μ.real univ) : |μ.real univ * (∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u))| ≤ ε⁻¹ * μ.real univ := by let Y : Measure ℝ := ((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ)) let W : Measure ℝ := ((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹) have hσp : 0 < σ.real univ := hcompat ▸ hp letI : IsProbabilityMeasure Y := by dsimp [Y] rw [map_normalized_subtype_eq_finiteNormalize μ hp] infer_instance letI : IsProbabilityMeasure W := by dsimp [W] rw [map_normalized_inverseArmProb_eq_finiteNormalize_map a σ hσp] exact Measure.isProbabilityMeasure_map (measurable_projectionInverseArmProbReal a).aemeasurable have hY : Y (Icc 0 1)ᶜ = 0 := by dsimp [Y] exact normalizedOutcome_support μ hp have hW : W (Icc 0 ε⁻¹)ᶜ = 0 := by dsimp [W] exact normalizedInverseArmProb_support hOverlap a σ hσp have hI : |∫ u in (0 : ℝ)..1, quantile Y u * quantile W (if upper then u else 1 - u)| ≤ ε⁻¹ := by simpa using abs_quantile_product_integral_le Y W (by norm_num) (inv_pos.mpr hOverlap.1).le hY hW upper rw [abs_mul, abs_of_pos hp] have hmul := mul_le_mul_of_nonneg_left hI hp.le dsimp only [Y, W] at hmul simpa only [mul_comm] using hmul
CausalSmith.PartialID.UnlinkedPropensityAte.projectedCellTerm_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellStability.lean:192
theorem projectedCellSummand_abs_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
upper :
σ σ' :
hcompat :
μ.real univ = σ.real univ
hcompat' :
μ'.real univ = σ'.real univ
|(let q := μ.real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)
- (let q := μ'.real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((μ' univ)⁻¹ • μ').map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' univ)⁻¹ • σ').map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)|
≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ')
Proof (Lean source)
lemma projectedCellSummand_abs_le {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) (μ μ' : Measure OutcomeSpace) (σ σ' : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure μ'] [IsFiniteMeasure σ] [IsFiniteMeasure σ'] (hcompat : μ.real univ = σ.real univ) (hcompat' : μ'.real univ = σ'.real univ) : |(let q := μ.real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0) - (let q := μ'.real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((μ' univ)⁻¹ • μ').map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' univ)⁻¹ • σ').map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ') := by have hL : 0 ≤ ε⁻¹ + (ε ^ 2)⁻¹ := add_nonneg (inv_pos.mpr hOverlap.1).le (by positivity) have hout0 := outcomeCDFDistance_nonneg μ μ' have hscore0 := scoreCDFDistance_nonneg hOverlap σ σ' by_cases hp : 0 < μ.real univ · by_cases hp' : 0 < μ'.real univ · simpa [hp, hp'] using projectedCellSummand_abs_le_of_pos hOverlap a upper μ μ' σ σ' hcompat hcompat' hp hp' · have hq' : μ'.real univ = 0 := le_antisymm (le_of_not_gt hp') measureReal_nonneg simp only [hp, hp', if_true, if_false, sub_zero] have hterm := projectedCellTerm_abs_le hOverlap a upper μ σ hcompat hp have hmass : μ.real univ ≤ outcomeCDFDistance μ μ' := by unfold outcomeCDFDistance rw [hq', sub_zero, abs_of_pos hp] have hi : 0 ≤ ∫ t in (0 : ℝ)..1, |(μ {y | (y : ℝ) ≤ t}).toReal - (μ' {y | (y : ℝ) ≤ t}).toReal| := intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => abs_nonneg _) linarith calc _ ≤ ε⁻¹ * μ.real univ := hterm _ ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * μ.real univ := by exact mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (by positivity : 0 ≤ (ε ^ 2)⁻¹)) hp.le _ ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ') := by gcongr linarith · have hq : μ.real univ = 0 := le_antisymm (le_of_not_gt hp) measureReal_nonneg by_cases hp' : 0 < μ'.real univ · simp only [hp, hp', if_true, if_false, zero_sub, abs_neg] have hterm := projectedCellTerm_abs_le hOverlap a upper μ' σ' hcompat' hp' have hmass : μ'.real univ ≤ outcomeCDFDistance μ μ' := by unfold outcomeCDFDistance rw [hq, zero_sub, abs_neg, abs_of_pos hp'] have hi : 0 ≤ ∫ t in (0 : ℝ)..1, |(μ {y | (y : ℝ) ≤ t}).toReal - (μ' {y | (y : ℝ) ≤ t}).toReal| := intervalIntegral.integral_nonneg (by norm_num) (fun _ _ => abs_nonneg _) linarith calc _ ≤ ε⁻¹ * μ'.real univ := hterm _ ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * μ'.real univ := by exact mul_le_mul_of_nonneg_right (le_add_of_nonneg_right (by positivity : 0 ≤ (ε ^ 2)⁻¹)) hp'.le _ ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * (outcomeCDFDistance μ μ' + scoreCDFDistance σ σ') := by gcongr linarith · simp only [hp, hp', if_true, if_false, sub_self, abs_zero] exact mul_nonneg hL (add_nonneg hout0 hscore0)
CausalSmith.PartialID.UnlinkedPropensityAte.projectedCellSummand_abs_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellStability.lean:232
theorem projectedArmEndpoint_abs_le_of_compatible_cells

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
lam lam' :
σ σ' :
hfinLam :
∀ a r, IsFiniteMeasure (lam a r)
hfinLam' :
∀ a r, IsFiniteMeasure (lam' a r)
hfinσ :
∀ a r, IsFiniteMeasure (σ a r)
hfinσ' :
∀ a r, IsFiniteMeasure (σ' a r)
hcompat :
hcompat' :
a :
upper :
|projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper|
≤ (ε⁻¹ + (ε ^ 2)⁻¹) * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r))
Proof (Lean source)
lemma projectedArmEndpoint_abs_le_of_compatible_cells {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (lam lam' : ArmCellArray J OutcomeSpace) (σ σ' : ArmCellArray J (ScoreSpace ε)) (hfinLam : ∀ a r, IsFiniteMeasure (lam a r)) (hfinLam' : ∀ a r, IsFiniteMeasure (lam' a r)) (hfinσ : ∀ a r, IsFiniteMeasure (σ a r)) (hfinσ' : ∀ a r, IsFiniteMeasure (σ' a r)) (hcompat : ProjectionCompatible lam σ) (hcompat' : ProjectionCompatible lam' σ') (a : ArmSpace) (upper : Bool) : |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ (ε⁻¹ + (ε ^ 2)⁻¹) * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r)) := by apply projectedArmEndpoint_abs_le_of_cellBounds lam lam' σ σ' a upper (ε⁻¹ + (ε ^ 2)⁻¹) intro r letI : IsFiniteMeasure (lam a r) := hfinLam a r letI : IsFiniteMeasure (lam' a r) := hfinLam' a r letI : IsFiniteMeasure (σ a r) := hfinσ a r letI : IsFiniteMeasure (σ' a r) := hfinσ' a r exact projectedCellSummand_abs_le hOverlap a upper (lam a r) (lam' a r) (σ a r) (σ' a r) (hcompat a r) (hcompat' a r)
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_abs_le_of_compatible_cells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellStability.lean:311
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionCellTransport 16 declarations Finite-measure transport, inverse-weight pushforward, and product-integral lemmas used by projected-cell stability.

Finite-measure transport, inverse-weight pushforward, and product-integral lemmas used by projected-cell stability.

def projectionInverseArmProbReal

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a :
x :
ℝ
projectionInverseArmProbReal a x :
ℝ
if a then x⁻¹ else (1 - x)⁻¹
CausalSmith.PartialID.UnlinkedPropensityAte.projectionInverseArmProbReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:20
theorem projectionInverseArmProbReal_coe

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
a :
e :
projectionInverseArmProbReal a (e : ℝ) = (armProb a e)⁻¹
Proof (Lean source)
lemma projectionInverseArmProbReal_coe {ε : ℝ} (a : ArmSpace) (e : ScoreSpace ε) : projectionInverseArmProbReal a (e : ℝ) = (armProb a e)⁻¹ := by cases a <;> rfl
CausalSmith.PartialID.UnlinkedPropensityAte.projectionInverseArmProbReal_coe · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:24
theorem measurable_projectionInverseArmProbReal

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a :
Proof (Lean source)
lemma measurable_projectionInverseArmProbReal (a : ArmSpace) : Measurable (projectionInverseArmProbReal a) := by cases a · exact (measurable_const.sub measurable_id).inv · exact measurable_id.inv
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionInverseArmProbReal · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:29
theorem projectionInverseArmProbReal_lipschitzOn

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
x :
ℝ
hx :
x ∈ Icc ε (1 - ε)
y :
ℝ
hy :
y ∈ Icc ε (1 - ε)
≤ (ε ^ 2)⁻¹ * |x - y|
Proof (Lean source)
lemma projectionInverseArmProbReal_lipschitzOn {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (x : ℝ) (hx : x ∈ Icc ε (1 - ε)) (y : ℝ) (hy : y ∈ Icc ε (1 - ε)) : |projectionInverseArmProbReal a x - projectionInverseArmProbReal a y| ≤ (ε ^ 2)⁻¹ * |x - y| := by let ex : ScoreSpace ε := ⟨x, hx⟩ let ey : ScoreSpace ε := ⟨y, hy⟩ have h := projectionInverseArmProb_lipschitz hOverlap a ex ey cases a <;> simpa [ex, ey, projectionInverseArmProbReal, armProb] using h
CausalSmith.PartialID.UnlinkedPropensityAte.projectionInverseArmProbReal_lipschitzOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:36
theorem real_univ_map_subtype_val

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
α :
Set ℝ
(μ.map (fun x : α => (x : ℝ))).real univ = μ.real univ
Proof (Lean source)
lemma real_univ_map_subtype_val {α : Set ℝ} (μ : Measure α) [IsFiniteMeasure μ] : (μ.map (fun x : α => (x : ℝ))).real univ = μ.real univ := by rw [Measure.real, Measure.real, Measure.map_apply (by fun_prop) MeasurableSet.univ] simp
CausalSmith.PartialID.UnlinkedPropensityAte.real_univ_map_subtype_val · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:47
theorem map_subtype_val_support_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
μ :
Measure (Icc a b)
(μ.map (fun x : Icc a b => (x : ℝ))) (Icc a b)ᶜ = 0
Proof (Lean source)
lemma map_subtype_val_support_Icc {a b : ℝ} (μ : Measure (Icc a b)) : (μ.map (fun x : Icc a b => (x : ℝ))) (Icc a b)ᶜ = 0 := by rw [Measure.map_apply (by fun_prop) measurableSet_Icc.compl] simp
CausalSmith.PartialID.UnlinkedPropensityAte.map_subtype_val_support_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:53
theorem map_normalized_subtype_eq_finiteNormalize

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
α :
Set ℝ
hp :
0 < μ.real univ
((μ univ)⁻¹ • μ).map (fun x : α => (x : ℝ))
= (FiniteMeasure.normalize (⟨μ.map (fun x : α => (x : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) : Measure ℝ)
Proof (Lean source)
lemma map_normalized_subtype_eq_finiteNormalize {α : Set ℝ} (μ : Measure α) [IsFiniteMeasure μ] (hp : 0 < μ.real univ) : ((μ univ)⁻¹ • μ).map (fun x : α => (x : ℝ)) = (FiniteMeasure.normalize (⟨μ.map (fun x : α => (x : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) : Measure ℝ) := by let μR : FiniteMeasure ℝ := ⟨μ.map (fun x : α => (x : ℝ)), inferInstance⟩ have hmass : (μR.mass : ℝ) = μ.real univ := by change (μ.map (fun x : α => (x : ℝ))).real univ = μ.real univ exact real_univ_map_subtype_val μ have hμR : μR ≠ 0 := by intro h have : (μR.mass : ℝ) = 0 := by simp [h] linarith rw [Measure.map_smul, μR.toMeasure_normalize_eq_of_nonzero hμR] change (μ univ)⁻¹ • μ.map (fun x : α => (x : ℝ)) = (μR.mass⁻¹ : NNReal) • (μR : Measure ℝ) have hmassENN : μ univ = (μR.mass : ENNReal) := by dsimp [μR, FiniteMeasure.mass] rw [Measure.map_apply (by fun_prop) MeasurableSet.univ] simp rw [hmassENN] have hmass0 : μR.mass ≠ 0 := by intro h exact hμR ((FiniteMeasure.mass_zero_iff μR).mp h) change (μR.mass : ENNReal)⁻¹ • (μR : Measure ℝ) = ((μR.mass⁻¹ : NNReal) : ENNReal) • (μR : Measure ℝ) rw [ENNReal.coe_inv hmass0]
CausalSmith.PartialID.UnlinkedPropensityAte.map_normalized_subtype_eq_finiteNormalize · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:59
theorem finite_mass_subtype_quantile_transport_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
μ ν :
hp :
0 < μ.real univ
hq :
0 < ν.real univ
min (μ.real univ) (ν.real univ) * (∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun x : Icc a b => (x : ℝ))) u - quantile (((ν univ)⁻¹ • ν).map (fun x : Icc a b => (x : ℝ))) u|)
≤ (∫ t in a..b, |(μ {x | (x : ℝ) ≤ t}).toReal - (ν {x | (x : ℝ) ≤ t}).toReal|)
+ (b - a) * |μ.real univ
- ν.real univ|
Proof (Lean source)
lemma finite_mass_subtype_quantile_transport_le {a b : ℝ} (hab : a ≤ b) (μ ν : Measure (Icc a b)) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hp : 0 < μ.real univ) (hq : 0 < ν.real univ) : min (μ.real univ) (ν.real univ) * (∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun x : Icc a b => (x : ℝ))) u - quantile (((ν univ)⁻¹ • ν).map (fun x : Icc a b => (x : ℝ))) u|) ≤ (∫ t in a..b, |(μ {x | (x : ℝ) ≤ t}).toReal - (ν {x | (x : ℝ) ≤ t}).toReal|) + (b - a) * |μ.real univ - ν.real univ| := by let μR : FiniteMeasure ℝ := ⟨μ.map (fun x : Icc a b => (x : ℝ)), inferInstance⟩ let νR : FiniteMeasure ℝ := ⟨ν.map (fun x : Icc a b => (x : ℝ)), inferInstance⟩ have hμmass : (μR.mass : ℝ) = μ.real univ := by change (μ.map (fun x : Icc a b => (x : ℝ))).real univ = μ.real univ exact real_univ_map_subtype_val μ have hνmass : (νR.mass : ℝ) = ν.real univ := by change (ν.map (fun x : Icc a b => (x : ℝ))).real univ = ν.real univ exact real_univ_map_subtype_val ν have htransport := finite_mass_quantile_transport_le μR νR hab (hμmass.symm ▸ hp) (hνmass.symm ▸ hq) (map_subtype_val_support_Icc μ) (map_subtype_val_support_Icc ν) rw [← map_normalized_subtype_eq_finiteNormalize μ hp, ← map_normalized_subtype_eq_finiteNormalize ν hq] at htransport rw [hμmass, hνmass] at htransport have hμcdf (t : ℝ) : (μ.map (fun x : Icc a b => (x : ℝ))) (Iic t) = μ {x | (x : ℝ) ≤ t} := by rw [Measure.map_apply (by fun_prop) measurableSet_Iic] rfl have hνcdf (t : ℝ) : (ν.map (fun x : Icc a b => (x : ℝ))) (Iic t) = ν {x | (x : ℝ) ≤ t} := by rw [Measure.map_apply (by fun_prop) measurableSet_Iic] rfl simpa only [μR, νR, FiniteMeasure.toMeasure_mk, hμcdf, hνcdf] using htransport
CausalSmith.PartialID.UnlinkedPropensityAte.finite_mass_subtype_quantile_transport_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:89
theorem inverseArmProb_quantile_distance_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
hp :
0 < μ.real univ
hq :
0 < ν.real univ
(∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun e => (armProb a e)⁻¹)) u - quantile (((ν univ)⁻¹ • ν).map (fun e => (armProb a e)⁻¹)) u|)
≤ (ε ^ 2)⁻¹ * ∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun e : ScoreSpace ε => (e : ℝ))) u
- quantile (((ν univ)⁻¹ • ν).map (fun e : ScoreSpace ε => (e : ℝ))) u|
Proof (Lean source)
lemma inverseArmProb_quantile_distance_le {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (μ ν : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hp : 0 < μ.real univ) (hq : 0 < ν.real univ) : (∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun e => (armProb a e)⁻¹)) u - quantile (((ν univ)⁻¹ • ν).map (fun e => (armProb a e)⁻¹)) u|) ≤ (ε ^ 2)⁻¹ * ∫ u in (0 : ℝ)..1, |quantile (((μ univ)⁻¹ • μ).map (fun e : ScoreSpace ε => (e : ℝ))) u - quantile (((ν univ)⁻¹ • ν).map (fun e : ScoreSpace ε => (e : ℝ))) u| := by let μR : FiniteMeasure ℝ := ⟨μ.map (fun e : ScoreSpace ε => (e : ℝ)), inferInstance⟩ let νR : FiniteMeasure ℝ := ⟨ν.map (fun e : ScoreSpace ε => (e : ℝ)), inferInstance⟩ let μP : Measure ℝ := FiniteMeasure.normalize μR let νP : Measure ℝ := FiniteMeasure.normalize νR letI : IsProbabilityMeasure μP := by dsimp [μP]; infer_instance letI : IsProbabilityMeasure νP := by dsimp [νP]; infer_instance have hpush := quantile_pushforward_lipschitzOn μP νP (by linarith [hOverlap.2] : ε ≤ 1 - ε) (by dsimp [μP] exact normalize_support_Icc μR (by rw [show (μR.mass : ℝ) = μ.real univ by change (μ.map (fun e : ScoreSpace ε => (e : ℝ))).real univ = μ.real univ exact real_univ_map_subtype_val μ] exact hp) (map_subtype_val_support_Icc μ)) (by dsimp [νP] exact normalize_support_Icc νR (by rw [show (νR.mass : ℝ) = ν.real univ by change (ν.map (fun e : ScoreSpace ε => (e : ℝ))).real univ = ν.real univ exact real_univ_map_subtype_val ν] exact hq) (map_subtype_val_support_Icc ν)) (by positivity : 0 ≤ (ε ^ 2)⁻¹) (projectionInverseArmProbReal a) (measurable_projectionInverseArmProbReal a) (projectionInverseArmProbReal_lipschitzOn hOverlap a) have hμnorm := map_normalized_subtype_eq_finiteNormalize μ hp have hνnorm := map_normalized_subtype_eq_finiteNormalize ν hq change _ ≤ _ dsimp [μP, νP] at hpush rw [← hμnorm, ← hνnorm] at hpush rw [Measure.map_map (measurable_projectionInverseArmProbReal a) (by fun_prop), Measure.map_map (measurable_projectionInverseArmProbReal a) (by fun_prop)] at hpush have hfun : projectionInverseArmProbReal a ∘ (fun e : ScoreSpace ε => (e : ℝ)) = fun e => (armProb a e)⁻¹ := by funext e exact projectionInverseArmProbReal_coe a e rw [hfun] at hpush exact hpush
CausalSmith.PartialID.UnlinkedPropensityAte.inverseArmProb_quantile_distance_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:131
theorem quantile_product_integral_stability

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hμ :
μ (Icc 0 A)ᶜ = 0
hμ' :
μ' (Icc 0 A)ᶜ = 0
hν :
ν (Icc 0 B)ᶜ = 0
hν' :
ν' (Icc 0 B)ᶜ = 0
upper :
|(∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (if upper then u else 1 - u))
- ∫ u in (0 : ℝ)..1, quantile μ' u * quantile ν' (if upper then u else 1 - u)|
≤ B * (∫ u in (0 : ℝ)..1, |quantile μ u - quantile μ' u|)
+ A * (∫ u in (0 : ℝ)..1, |quantile ν u - quantile ν' u|)
Proof (Lean source)
lemma quantile_product_integral_stability (μ μ' ν ν' : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] [IsProbabilityMeasure ν] [IsProbabilityMeasure ν'] {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hμ : μ (Icc 0 A)ᶜ = 0) (hμ' : μ' (Icc 0 A)ᶜ = 0) (hν : ν (Icc 0 B)ᶜ = 0) (hν' : ν' (Icc 0 B)ᶜ = 0) (upper : Bool) : |(∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (if upper then u else 1 - u)) - ∫ u in (0 : ℝ)..1, quantile μ' u * quantile ν' (if upper then u else 1 - u)| ≤ B * (∫ u in (0 : ℝ)..1, |quantile μ u - quantile μ' u|) + A * (∫ u in (0 : ℝ)..1, |quantile ν u - quantile ν' u|) := by let s : ℝ → ℝ := if upper then id else fun u => 1 - u have hsmeas : Measurable s := by cases upper <;> simp [s] <;> fun_prop have hsmap : Causalean.Stat.unifOI.map s = unifOI := by cases upper · simpa [s] using map_one_sub_unifOI · simp [s] have hsp : MeasurePreserving s unifOI unifOI := ⟨hsmeas, hsmap⟩ have hs_apply (u : ℝ) : s u = if upper then u else 1 - u := by cases upper <;> rfl have hμb := quantile_mem_Icc_ae μ hμ have hμb' := quantile_mem_Icc_ae μ' hμ' have hνb := hsp.quasiMeasurePreserving.tendsto_ae.eventually (quantile_mem_Icc_ae ν hν) have hνb' := hsp.quasiMeasurePreserving.tendsto_ae.eventually (quantile_mem_Icc_ae ν' hν') have hμi : Integrable (quantile μ) unifOI := by apply (integrable_const A).mono' · exact (aemeasurable_quantile_unifOI μ).aestronglyMeasurable · filter_upwards [hμb] with u hu simpa [Real.norm_eq_abs, abs_of_nonneg hu.1] using hu.2 have hμi' : Integrable (quantile μ') unifOI := by apply (integrable_const A).mono' · exact (aemeasurable_quantile_unifOI μ').aestronglyMeasurable · filter_upwards [hμb'] with u hu simpa [Real.norm_eq_abs, abs_of_nonneg hu.1] using hu.2 have hνae : AEMeasurable (fun u => quantile ν (s u)) unifOI := by have h := aemeasurable_quantile_unifOI ν rw [← hsmap] at h exact h.comp_measurable hsmeas have hνae' : AEMeasurable (fun u => quantile ν' (s u)) unifOI := by have h := aemeasurable_quantile_unifOI ν' rw [← hsmap] at h exact h.comp_measurable hsmeas have hνi : Integrable (fun u => quantile ν (s u)) unifOI := by apply (integrable_const B).mono' hνae.aestronglyMeasurable filter_upwards [hνb] with u hu simpa [Real.norm_eq_abs, abs_of_nonneg hu.1] using hu.2 have hνi' : Integrable (fun u => quantile ν' (s u)) unifOI := by apply (integrable_const B).mono' hνae'.aestronglyMeasurable filter_upwards [hνb'] with u hu simpa [Real.norm_eq_abs, abs_of_nonneg hu.1] using hu.2 have hprod : Integrable (fun u => quantile μ u * quantile ν (s u)) unifOI := by apply (integrable_const (A * B)).mono' · exact ((aemeasurable_quantile_unifOI μ).mul hνae).aestronglyMeasurable · filter_upwards [hμb, hνb] with u hy hw rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hy.1 hw.1)] exact mul_le_mul hy.2 hw.2 hw.1 hA have hprod' : Integrable (fun u => quantile μ' u * quantile ν' (s u)) unifOI := by apply (integrable_const (A * B)).mono' · exact ((aemeasurable_quantile_unifOI μ').mul hνae').aestronglyMeasurable · filter_upwards [hμb', hνb'] with u hy hw rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hy.1 hw.1)] exact mul_le_mul hy.2 hw.2 hw.1 hA have hdy : Integrable (fun u => |quantile μ u - quantile μ' u|) unifOI := (hμi.sub hμi').abs have hdw : Integrable (fun u => |quantile ν (s u) - quantile ν' (s u)|) unifOI := (hνi.sub hνi').abs have hdw_eq : (∫ u, |quantile ν (s u) - quantile ν' (s u)| ∂Causalean.Stat.unifOI) = ∫ u, |quantile ν u - quantile ν' u| ∂Causalean.Stat.unifOI := by let f : ℝ → ℝ := fun u => |quantile ν u - quantile ν' u| have hf : AEStronglyMeasurable f (Causalean.Stat.unifOI.map s) := by rw [hsmap] exact ((aemeasurable_quantile_unifOI ν).sub (aemeasurable_quantile_unifOI ν')).norm.aestronglyMeasurable have hmap := integral_map hsmeas.aemeasurable hf rw [hsmap] at hmap exact hmap.symm have hpoint : ∀ᵐ u ∂Causalean.Stat.unifOI, |quantile μ u * quantile ν (s u) - quantile μ' u * quantile ν' (s u)| ≤ B * |quantile μ u - quantile μ' u| + A * |quantile ν (s u) - quantile ν' (s u)| := by filter_upwards [hμb', hνb] with u hy' hw calc _ = |(quantile μ u - quantile μ' u) * quantile ν (s u) + quantile μ' u * (quantile ν (s u) - quantile ν' (s u))| := by ring_nf _ ≤ |(quantile μ u - quantile μ' u) * quantile ν (s u)| + |quantile μ' u * (quantile ν (s u) - quantile ν' (s u))| := abs_add_le _ _ _ ≤ _ := by rw [abs_mul, abs_mul, abs_of_nonneg hw.1, abs_of_nonneg hy'.1] apply add_le_add · simpa [mul_comm] using (mul_le_mul_of_nonneg_left hw.2 (abs_nonneg (quantile μ u - quantile μ' u))) · exact mul_le_mul_of_nonneg_right hy'.2 (abs_nonneg _) have hrest : volume.restrict (Ioc (0 : ℝ) 1) = unifOI := by rw [unifOI, restrict_Ioo_eq_restrict_Ioc] simp_rw [hs_apply] at hprod hprod' hdy hdw hdw_eq hpoint rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest] rw [← integral_sub hprod hprod'] calc |∫ u, (quantile μ u * quantile ν (if upper then u else 1 - u) - quantile μ' u * quantile ν' (if upper then u else 1 - u)) ∂Causalean.Stat.unifOI| ≤ ∫ u, |quantile μ u * quantile ν (if upper then u else 1 - u) - quantile μ' u * quantile ν' (if upper then u else 1 - u)| ∂Causalean.Stat.unifOI := by simpa only [Real.norm_eq_abs] using (norm_integral_le_integral_norm (μ := unifOI) (f := fun u => quantile μ u * quantile ν (if upper then u else 1 - u) - quantile μ' u * quantile ν' (if upper then u else 1 - u))) _ ≤ ∫ u, (B * |quantile μ u - quantile μ' u| + A * |quantile ν (if upper then u else 1 - u) - quantile ν' (if upper then u else 1 - u)|) ∂Causalean.Stat.unifOI := integral_mono_ae (hprod.sub hprod').abs (hdy.const_mul B |>.add (hdw.const_mul A)) hpoint _ = B * ∫ u, |quantile μ u - quantile μ' u| ∂Causalean.Stat.unifOI + A * ∫ u, |quantile ν u - quantile ν' u| ∂Causalean.Stat.unifOI := by rw [integral_add (hdy.const_mul B) (hdw.const_mul A), integral_const_mul, integral_const_mul] rw [← hdw_eq]
CausalSmith.PartialID.UnlinkedPropensityAte.quantile_product_integral_stability · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:190
theorem normalizedOutcome_support

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
hp :
0 < μ.real univ
(((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) (Icc 0 1)ᶜ = 0
Proof (Lean source)
lemma normalizedOutcome_support (μ : Measure OutcomeSpace) [IsFiniteMeasure μ] (hp : 0 < μ.real univ) : (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) (Icc 0 1)ᶜ = 0 := by rw [map_normalized_subtype_eq_finiteNormalize μ hp] apply normalize_support_Icc (⟨μ.map (fun y : OutcomeSpace => (y : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) · rw [show (FiniteMeasure.mass (⟨μ.map (fun y : OutcomeSpace => (y : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) : ℝ) = μ.real univ by change (μ.map (fun y : OutcomeSpace => (y : ℝ))).real univ = μ.real univ exact real_univ_map_subtype_val μ] exact hp · exact map_subtype_val_support_Icc μ
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedOutcome_support · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:356
theorem measurable_inverseArmProb

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
a :
Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹)
Proof (Lean source)
lemma measurable_inverseArmProb {ε : ℝ} (a : ArmSpace) : Measurable (fun e : ScoreSpace ε => (armProb a e)⁻¹) := by rw [show (fun e : ScoreSpace ε => (armProb a e)⁻¹) = projectionInverseArmProbReal a ∘ (fun e : ScoreSpace ε => (e : ℝ)) by funext e exact (projectionInverseArmProbReal_coe a e).symm] exact (measurable_projectionInverseArmProbReal a).comp (by fun_prop)
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_inverseArmProb · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:372
theorem normalizedInverseArmProb_support

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
hp :
0 < σ.real univ
(((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (Icc 0 ε⁻¹)ᶜ = 0
Proof (Lean source)
lemma normalizedInverseArmProb_support {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (σ : Measure (ScoreSpace ε)) [IsFiniteMeasure σ] (hp : 0 < σ.real univ) : (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (Icc 0 ε⁻¹)ᶜ = 0 := by rw [Measure.map_apply (measurable_inverseArmProb a) measurableSet_Icc.compl] have hpre : (fun e : ScoreSpace ε => (armProb a e)⁻¹) ⁻¹' (Icc 0 ε⁻¹)ᶜ = ∅ := by ext e have hb := projectionArmProb_bounds hOverlap a e have hpos : 0 < armProb a e := lt_of_lt_of_le hOverlap.1 hb.1 have hinv : (armProb a e)⁻¹ ≤ ε⁻¹ := (inv_le_inv₀ hpos hOverlap.1).2 hb.1 simp only [mem_preimage, mem_compl_iff, mem_Icc, mem_empty_iff_false, iff_false] exact fun h => h ⟨(inv_pos.mpr hpos).le, hinv⟩ rw [hpre] simp
CausalSmith.PartialID.UnlinkedPropensityAte.normalizedInverseArmProb_support · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:381
theorem map_normalized_inverseArmProb_eq_finiteNormalize_map

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
a :
hp :
0 < σ.real univ
((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)
= (FiniteMeasure.normalize (⟨σ.map (fun e : ScoreSpace ε => (e : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) : Measure ℝ).map (projectionInverseArmProbReal a)
Proof (Lean source)
lemma map_normalized_inverseArmProb_eq_finiteNormalize_map {ε : ℝ} (a : ArmSpace) (σ : Measure (ScoreSpace ε)) [IsFiniteMeasure σ] (hp : 0 < σ.real univ) : ((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹) = (FiniteMeasure.normalize (⟨σ.map (fun e : ScoreSpace ε => (e : ℝ)), inferInstance⟩ : FiniteMeasure ℝ) : Measure ℝ).map (projectionInverseArmProbReal a) := by have hnorm := map_normalized_subtype_eq_finiteNormalize σ hp calc ((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹) = (((σ univ)⁻¹ • σ).map (fun e : ScoreSpace ε => (e : ℝ))).map (projectionInverseArmProbReal a) := by rw [Measure.map_map (measurable_projectionInverseArmProbReal a) (by fun_prop)] congr 1 funext e exact (projectionInverseArmProbReal_coe a e).symm _ = _ := by rw [hnorm]
CausalSmith.PartialID.UnlinkedPropensityAte.map_normalized_inverseArmProb_eq_finiteNormalize_map · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:398
theorem abs_quantile_product_integral_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hμ :
μ (Icc 0 A)ᶜ = 0
hν :
ν (Icc 0 B)ᶜ = 0
upper :
|∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (if upper then u else 1 - u)|
≤ A * B
Proof (Lean source)
lemma abs_quantile_product_integral_le (μ ν : Measure ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (hμ : μ (Icc 0 A)ᶜ = 0) (hν : ν (Icc 0 B)ᶜ = 0) (upper : Bool) : |∫ u in (0 : ℝ)..1, quantile μ u * quantile ν (if upper then u else 1 - u)| ≤ A * B := by let s : ℝ → ℝ := if upper then id else fun u => 1 - u have hsmeas : Measurable s := by cases upper <;> simp [s] <;> fun_prop have hsmap : Causalean.Stat.unifOI.map s = unifOI := by cases upper · simpa [s] using map_one_sub_unifOI · simp [s] have hsp : MeasurePreserving s unifOI unifOI := ⟨hsmeas, hsmap⟩ have hs_apply (u : ℝ) : s u = if upper then u else 1 - u := by cases upper <;> rfl have hy := quantile_mem_Icc_ae μ hμ have hw := hsp.quasiMeasurePreserving.tendsto_ae.eventually (quantile_mem_Icc_ae ν hν) have hwae : AEMeasurable (fun u => quantile ν (s u)) unifOI := by have h := aemeasurable_quantile_unifOI ν rw [← hsmap] at h exact h.comp_measurable hsmeas have hprod : Integrable (fun u => quantile μ u * quantile ν (s u)) unifOI := by apply (integrable_const (A * B)).mono' · exact ((aemeasurable_quantile_unifOI μ).mul hwae).aestronglyMeasurable · filter_upwards [hy, hw] with u hyu hwu rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hyu.1 hwu.1)] exact mul_le_mul hyu.2 hwu.2 hwu.1 hA have hnonneg : 0 ≤ ∫ u, quantile μ u * quantile ν (s u) ∂Causalean.Stat.unifOI := integral_nonneg_of_ae (by filter_upwards [hy, hw] with u hyu hwu exact mul_nonneg hyu.1 hwu.1) have hupper : (∫ u, quantile μ u * quantile ν (s u) ∂Causalean.Stat.unifOI) ≤ A * B := by calc _ ≤ ∫ _ : ℝ, A * B ∂Causalean.Stat.unifOI := integral_mono_ae hprod (integrable_const (A * B)) (by filter_upwards [hy, hw] with u hyu hwu exact mul_le_mul hyu.2 hwu.2 hwu.1 hA) _ = A * B := by simp have hrest : volume.restrict (Ioc (0 : ℝ) 1) = unifOI := by rw [unifOI, restrict_Ioo_eq_restrict_Ioc] simp_rw [hs_apply] at hnonneg hupper rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest, abs_of_nonneg hnonneg] exact hupper
CausalSmith.PartialID.UnlinkedPropensityAte.abs_quantile_product_integral_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:417
theorem abs_mass_mul_sub_mass_mul_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
p q A A' B :
ℝ
hp :
0 ≤ p
hq :
0 ≤ q
hA :
|A| ≤ B
hA' :
|A'| ≤ B
|p * A - q * A'| ≤ min p q * |A - A'| + B * |p - q|
Proof (Lean source)
lemma abs_mass_mul_sub_mass_mul_le {p q A A' B : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) (hA : |A| ≤ B) (hA' : |A'| ≤ B) : |p * A - q * A'| ≤ min p q * |A - A'| + B * |p - q| := by rcases le_total p q with hpq | hqp · rw [min_eq_left hpq] have hid : p * A - q * A' = p * (A - A') + (p - q) * A' := by ring rw [hid] calc _ ≤ |p * (A - A')| + |(p - q) * A'| := abs_add_le _ _ _ = p * |A - A'| + |p - q| * |A'| := by rw [abs_mul, abs_mul, abs_of_nonneg hp] _ ≤ p * |A - A'| + |p - q| * B := add_le_add le_rfl (mul_le_mul_of_nonneg_left hA' (abs_nonneg _)) _ = _ := by ring · rw [min_eq_right hqp] have hid : p * A - q * A' = q * (A - A') + (p - q) * A := by ring rw [hid] calc _ ≤ |q * (A - A')| + |(p - q) * A| := abs_add_le _ _ _ = q * |A - A'| + |p - q| * |A| := by rw [abs_mul, abs_mul, abs_of_nonneg hq] _ ≤ q * |A - A'| + |p - q| * B := add_le_add le_rfl (mul_le_mul_of_nonneg_left hA (abs_nonneg _)) _ = _ := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.abs_mass_mul_sub_mass_mul_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCellTransport.lean:473
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionCoverage 6 declarations Coverage of the atom-valid external projection interval.

Coverage of the atom-valid external projection interval.

theorem projectedArmEndpoint_lower_le_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
σ :
hfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcompat :
a :
Proof (Lean source)
lemma projectedArmEndpoint_lower_le_upper {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hfinite : ∀ a r, (lam a r) Set.univ < ⊤ ∧ (σ a r) Set.univ < ⊤) (hcompat : ProjectionCompatible lam σ) (a : ArmSpace) : projectedArmEndpoint lam σ a false ≤ projectedArmEndpoint lam σ a true := by unfold projectedArmEndpoint apply Finset.sum_le_sum intro r _ letI : IsFiniteMeasure (lam a r) := ⟨(hfinite a r).1⟩ letI : IsFiniteMeasure (σ a r) := ⟨(hfinite a r).2⟩ let q := (lam a r).real Set.univ by_cases hq : 0 < q · dsimp [q] at hq simp only [hq, if_pos, Bool.false_eq_true, if_false, if_true] exact mul_le_mul_of_nonneg_left (cell_lower_le_upper_of_overlap hOverlap a (lam a r) (σ a r) hq (hcompat a r)) hq.le · dsimp [q] at hq simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_lower_le_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:16
theorem projectedATEInterval_mem_closure_of_sieve_approx

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
σ :
hOverlap :
happrox :
∀ η : ℝ
if
0 < η
then
∃ b ∈ sievedProjectionCandidates g α x,
∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| < η
t :
ℝ
ht :
t ∈ closure (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2)
Proof (Lean source)
lemma projectedATEInterval_mem_closure_of_sieve_approx {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hOverlap : Overlap ε) (happrox : ∀ η : ℝ, 0 < η → ∃ b ∈ sievedProjectionCandidates g α x, ∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| < η) {t : ℝ} (ht : t ∈ projectedATEInterval lam σ) : t ∈ closure (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2) := by classical let L := projectedArmEndpoint lam σ true false - projectedArmEndpoint lam σ false true let U := projectedArmEndpoint lam σ true true - projectedArmEndpoint lam σ false false have ht' : L ≤ t ∧ t ≤ U := ht apply Metric.mem_closure_iff.mpr intro δ hδ obtain ⟨b, hb, hnear⟩ := happrox (δ / 4) (by positivity) let B := projectedArmEndpoint b.1 b.2 true false - projectedArmEndpoint b.1 b.2 false true let V := projectedArmEndpoint b.1 b.2 true true - projectedArmEndpoint b.1 b.2 false false have hfinite : ∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤ := hb.1.1 have hcompat : ProjectionCompatible b.1 b.2 := hb.1.2.1 have horder : B ≤ V := by have h₁ := projectedArmEndpoint_lower_le_upper hOverlap b.1 b.2 hfinite hcompat true have h₀ := projectedArmEndpoint_lower_le_upper hOverlap b.1 b.2 hfinite hcompat false dsimp [B, V] linarith have hB : |B - L| < δ / 2 := by have h₁ := hnear true false have h₀ := hnear false true dsimp [B, L] rw [abs_lt] at h₁ h₀ ⊢ constructor <;> linarith have hV : |V - U| < δ / 2 := by have h₁ := hnear true true have h₀ := hnear false false dsimp [V, U] rw [abs_lt] at h₁ h₀ ⊢ constructor <;> linarith let z := min (max t B) V have hz : z ∈ projectedATEInterval b.1 b.2 := by change B ≤ z ∧ z ≤ V dsimp [z] exact ⟨le_min (le_max_right _ _) horder, min_le_right _ _⟩ have hdist : dist t z < δ := by rw [Real.dist_eq] by_cases hlow : t < B · have hzeq : z = B := by simp [z, max_eq_right hlow.le, min_eq_left horder] rw [hzeq, abs_lt] at * constructor <;> linarith [hB.1, hB.2, ht'.1] · by_cases hhigh : V < t · have hzeq : z = V := by have hmax : max t B = t := max_eq_left (le_of_not_gt hlow) simp [z, hmax, min_eq_right hhigh.le] rw [hzeq, abs_lt] at * constructor <;> linarith [hV.1, hV.2, ht'.2] · have hzeq : z = t := by have hmax : max t B = t := max_eq_left (le_of_not_gt hlow) simp [z, hmax, min_eq_left (le_of_not_gt hhigh)] rw [hzeq] simpa using hδ exact ⟨z, Set.mem_iUnion.mpr ⟨b, Set.mem_iUnion.mpr ⟨hb, hz⟩⟩, hdist⟩
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEInterval_mem_closure_of_sieve_approx · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:40
theorem projection_strict_population_approximants

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
σ :
hfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcompat :
hout :
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) < 4 * J / (α * sqrt n)
hscore :
(∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) < 2 * J * (2 - 2 * ε) / (α * sqrt m)
η :
ℝ
0 < η
∃ b ∈ sievedProjectionCandidates g α x,
∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| < η
Proof (Lean source)
lemma projection_strict_population_approximants {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤) (hcompat : ProjectionCompatible lam σ) (hout : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) < 4 * J / (α * sqrt n)) (hscore : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) < 2 * J * (2 - 2 * ε) / (α * sqrt m)) : ∀ η : ℝ, 0 < η → ∃ b ∈ sievedProjectionCandidates g α x, ∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| < η := by classical intro η hη let L : ℝ := ε⁻¹ + (ε ^ 2)⁻¹ have hLpos : 0 < L := by dsimp [L] have hε := hOverlap.1 positivity have hL : 0 ≤ L := hLpos.le let rout : ℝ := 4 * J / (α * sqrt n) let rscore : ℝ := 2 * J * (2 - 2 * ε) / (α * sqrt m) let sout : ℝ := ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r) let sscore : ℝ := ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r) let δ := min (rout - sout) (min (rscore - sscore) (η / (L + 1))) / 2 have hδ : 0 < δ := by dsimp [δ] have h₁ : 0 < rout - sout := sub_pos.mpr hout have h₂ : 0 < rscore - sscore := sub_pos.mpr hscore exact div_pos (lt_min h₁ (lt_min h₂ (div_pos hη (by linarith)))) (by norm_num) have houtδ : sout + δ ≤ rout := by have hm := min_le_left (rout - sout) (min (rscore - sscore) (η / (L + 1))) dsimp [δ] linarith have hscoreδ : sscore + δ ≤ rscore := by have hm := min_le_left (rscore - sscore) (η / (L + 1)) have hm' := min_le_right (rout - sout) (min (rscore - sscore) (η / (L + 1))) dsimp [δ] linarith obtain ⟨b, hb, hdist⟩ := exists_sievedProjectionCandidate_close_of_slack hOverlap g α x lam σ hfinite hcompat δ hδ houtδ hscoreδ refine ⟨b, hb, ?_⟩ have hLδ : L * δ < η := by have hm := min_le_right (rscore - sscore) (η / (L + 1)) have hm' := min_le_right (rout - sout) (min (rscore - sscore) (η / (L + 1))) have hδbound : δ ≤ η / (L + 1) := by have hmin : 0 ≤ min (rout - sout) (min (rscore - sscore) (η / (L + 1))) := by dsimp [δ] at hδ linarith dsimp [δ] linarith have hden : 0 < L + 1 := by linarith have hratio : L * (η / (L + 1)) < η := by have hcancel : (L + 1) * (η / (L + 1)) = η := by field_simp nlinarith [div_pos hη hden] exact (mul_le_mul_of_nonneg_left hδbound hL).trans_lt hratio have hfiniteB : ∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤ := hb.1.1 have hcompatB : ProjectionCompatible b.1 b.2 := hb.1.2.1 intro a upper have hendpoint := projectedArmEndpoint_abs_le_of_compatible_cells hOverlap lam b.1 σ b.2 (fun a r => ⟨(hfinite a r).1⟩) (fun a r => ⟨(hfiniteB a r).1⟩) (fun a r => ⟨(hfinite a r).2⟩) (fun a r => ⟨(hfiniteB a r).2⟩) hcompat hcompatB a upper have hpair : (∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (b.1 a r)) + (∑ r : LabelSpace J, scoreCDFDistance (σ a r) (b.2 a r)) < δ := by have hnonneg (a : ArmSpace) : 0 ≤ (∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (b.1 a r)) + (∑ r : LabelSpace J, scoreCDFDistance (σ a r) (b.2 a r)) := by apply add_nonneg · exact Finset.sum_nonneg (fun r _ => outcomeCDFDistance_nonneg _ _) · exact Finset.sum_nonneg (fun r _ => scoreCDFDistance_nonneg hOverlap _ _) simp only [Finset.sum_add_distrib, Fintype.sum_bool] at hdist cases a <;> linarith [hnonneg false, hnonneg true] rw [abs_sub_comm] exact hendpoint.trans_lt ((mul_lt_mul_of_pos_left hpair hLpos).trans hLδ)
CausalSmith.PartialID.UnlinkedPropensityAte.projection_strict_population_approximants · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:117
theorem projection_strictBall_ate_mem_CI Lemma projection_strictBall_ate_mem_CI in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
PH :
hPH :
PH ∈ ExternalLaws g
x :
hout :
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (trialPopulationCells (releasedLaw PH.1) a r) (empiricalTrialCells x.1 a r)) < 4 * J / (α * sqrt n)
hscore :
(∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (scorePopulationCells PH.2 g a r) (empiricalScoreCells g x.2 a r)) < 2 * J * (2 - 2 * ε) / (α * sqrt m)
ate PH.1 ∈ sievedTotalizedProjectionCI g α x
Proof (Lean source)
lemma projection_strictBall_ate_mem_CI {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (x : ExternalSample ε J n m) (hout : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (trialPopulationCells (releasedLaw PH.1) a r) (empiricalTrialCells x.1 a r)) < 4 * J / (α * sqrt n)) (hscore : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (scorePopulationCells PH.2 g a r) (empiricalScoreCells g x.2 a r)) < 2 * J * (2 - 2 * ε) / (α * sqrt m)) : ate PH.1 ∈ sievedTotalizedProjectionCI g α x := by classical let lam := trialPopulationCells (releasedLaw PH.1) let σ := scorePopulationCells PH.2 g let hMass := externalLawCellMasses g PH hPH haveI : IsProbabilityMeasure PH.2 := hPH.2.1 haveI : IsProbabilityMeasure (releasedLaw PH.1) := by unfold releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.1 _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable have hfin := projectionPopulationCells_finite PH.2 g (releasedLaw PH.1) hPH.2.2.overlap hPH.2.2.measurableRelease have hfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤ := by intro a r exact ⟨(hfin.1 a r).measure_univ_lt_top, (hfin.2 a r).measure_univ_lt_top⟩ have hcompat : ProjectionCompatible lam σ := projectionCompatible_populationCells PH.2 g (releasedLaw PH.1) hMass hPH.2.2.overlap have happrox := projection_strict_population_approximants g α hPH.2.2.overlap x lam σ hfinite hcompat hout hscore have hC : ate PH.1 ∈ closure (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2) := by apply projectedATEInterval_mem_closure_of_sieve_approx g α x lam σ hPH.2.2.overlap happrox have hLaw : CompatibleCausalLaw PH.2 g (releasedLaw PH.1) PH.1 := ⟨hPH.1, hPH.2.2.measurableRelease, hPH.2.2.scoreMarginal, hPH.2.2.randomizedAssignment, hPH.2.2.consistency, hPH.2.2.deterministicRelease, rfl⟩ have hθ := compatible_ate_mem_sharpATESet PH.2 g (releasedLaw PH.1) PH.1 hLaw hPH.2.2.overlap change ate PH.1 ∈ Icc (muLower PH.2 g (releasedLaw PH.1) hMass true - muUpper PH.2 g (releasedLaw PH.1) hMass false) (muUpper PH.2 g (releasedLaw PH.1) hMass true - muLower PH.2 g (releasedLaw PH.1) hMass false) at hθ dsimp [projectedATEInterval, lam, σ] rw [projectedArmEndpoint_population_eq PH.2 g (releasedLaw PH.1) hMass hPH.2.2.overlap true false, projectedArmEndpoint_population_eq PH.2 g (releasedLaw PH.1) hMass hPH.2.2.overlap false true, projectedArmEndpoint_population_eq PH.2 g (releasedLaw PH.1) hMass hPH.2.2.overlap true true, projectedArmEndpoint_population_eq PH.2 g (releasedLaw PH.1) hMass hPH.2.2.overlap false false] simpa using hθ have hB : (sievedProjectionCandidates g α x).Nonempty := by obtain ⟨b, hb, _⟩ := happrox 1 (by norm_num) exact ⟨b, hb⟩ have hclip : ate PH.1 ∈ Icc (-1 : ℝ) 1 := by letI : IsProbabilityMeasure PH.1 := hPH.1 exact externalATE_mem_Icc PH.1 have hCHull : ate PH.1 ∈ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2)) := closure_mono (subset_convexHull ℝ _) hC have hne : (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty := ⟨ate PH.1, hclip, hCHull⟩ unfold sievedTotalizedProjectionCI simpa [hB, hne] using (show ate PH.1 ∈ Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2)) from ⟨hclip, hCHull⟩)
CausalSmith.PartialID.UnlinkedPropensityAte.projection_strictBall_ate_mem_CI · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:207
theorem externalProjectionIntervalProcedure_honest

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
hg :
hn :
0 < n
hm :
0 < m
hα :
0 < α
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
Proof (Lean source)
lemma externalProjectionIntervalProcedure_honest {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (hn : 0 < n) (hm : 0 < m) (hα : 0 < α) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) : externalProjectionIntervalProcedure g α hOverlap hg ∈ externalHonestProcedures g Qj α := by intro PH hPH let μ := releasedLaw PH.1 let H := PH.2 let F : ExternalSample ε J n m → ℝ := fun x => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells μ a r) let G : ExternalSample ε J n m → ℝ := fun x => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells H g a r) letI : IsProbabilityMeasure PH.1 := hPH.1 letI : IsProbabilityMeasure H := hPH.2.1 letI : IsProbabilityMeasure μ := by unfold μ releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.1 _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable letI : IsProbabilityMeasure (Qj PH.1 PH.2) := externalLaw_jointExperiment_probability g Qj hTrial hLog hInd PH hPH have hfin := projectionPopulationCells_finite H g μ hPH.2.2.overlap hPH.2.2.measurableRelease have hFTmeas : Measurable (fun x : TrialSample n J => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) := by apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ letI : IsFiniteMeasure (trialPopulationCells μ a r) := hfin.1 a r simpa only [outcomeCDFDistance, abs_sub_comm] using measurable_outcomeCDFDistance_empirical (trialPopulationCells μ a r) (measure_lt_top _ _) a r have hGTmeas : Measurable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) := by apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ letI : IsFiniteMeasure (scorePopulationCells H g a r) := hfin.2 a r simpa only [scoreCDFDistance, abs_sub_comm] using measurable_scoreCDFDistance_empirical hPH.2.2.overlap g hPH.2.2.measurableRelease (scorePopulationCells H g a r) (measure_lt_top _ _) a r have hFm : Measurable F := hFTmeas.comp measurable_fst have hGm : Measurable G := hGTmeas.comp measurable_snd have hFpi : Integrable (fun x : TrialSample n J => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) (Measure.pi fun _ : Fin n => μ) := by exact integrable_finsetSum _ (fun a _ => integrable_finsetSum _ (fun r _ => integrable_outcomeCDFDistance_population_pi μ hn a r)) have hGpi : Integrable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) (Measure.pi fun _ : Fin m => H) := by exact integrable_finsetSum _ (fun a _ => integrable_finsetSum _ (fun r _ => integrable_scoreCDFDistance_population_pi hPH.2.2.overlap H g hPH.2.2.measurableRelease hm a r)) have hF : Integrable F (Qj PH.1 PH.2) := by have hmap : Measure.map fst (Qj PH.1 PH.2) = Measure.pi (fun _ : Fin n => μ) := by simpa [μ] using hTrial PH hPH rw [← hmap] at hFpi simpa [F, Function.comp_def] using hFpi.comp_aemeasurable measurable_fst.aemeasurable have hG : Integrable G (Qj PH.1 PH.2) := by have hmap : Measure.map snd (Qj PH.1 PH.2) = Measure.pi (fun _ : Fin m => H) := by simpa [H] using hLog PH hPH rw [← hmap] at hGpi simpa [G, Function.comp_def] using hGpi.comp_aemeasurable measurable_snd.aemeasurable have hFmean : ∫ x, F x ∂Qj PH.1 PH.2 ≤ 2 * J / sqrt n := by exact externalJointTrial_meanDistance_le g Qj hTrial PH hPH hn (by simpa [μ] using hFTmeas) (fun a r => integrable_outcomeCDFDistance_population_pi μ hn a r) have hGmean : ∫ x, G x ∂Qj PH.1 PH.2 ≤ J * (2 - 2 * ε) / sqrt m := by exact externalJointLog_meanDistance_le g Qj hLog PH hPH hm (by simpa [H] using hGTmeas) (fun a r => integrable_scoreCDFDistance_population_pi hPH.2.2.overlap H g hPH.2.2.measurableRelease hm a r) have hJ : 0 < J := by letI : Nonempty (FullRow ε J) := nonempty_of_isProbabilityMeasure PH.1 obtain ⟨ω⟩ := ‹Nonempty (FullRow ε J)› exact lt_of_le_of_lt (zero_le _) (label ω).isLt have hprob := projection_strictBall_probability_at_paper_radii (Qj PH.1 PH.2) F G hFm hGm hF hG (Filter.Eventually.of_forall (fun x => Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => outcomeCDFDistance_nonneg _ _)))) (Filter.Eventually.of_forall (fun x => Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => scoreCDFDistance_nonneg hOverlap _ _)))) J n m hJ hn hm α ε hα hOverlap.2 hFmean hGmean have hsubset : {x | F x < 4 * J / (α * sqrt n) ∧ G x < 2 * J * (2 - 2 * ε) / (α * sqrt m)} ⊆ {x | (externalProjectionIntervalProcedure g α hOverlap hg).contains x (ate PH.1)} := by intro x hx change F x < _ ∧ G x < _ at hx have hout : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (trialPopulationCells μ a r) (empiricalTrialCells x.1 a r)) < 4 * J / (α * sqrt n) := by convert hx.1 using 1 apply Finset.sum_congr rfl intro a _ apply Finset.sum_congr rfl intro r _ exact outcomeCDFDistance_symm _ _ have hscore : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (scorePopulationCells H g a r) (empiricalScoreCells g x.2 a r)) < 2 * J * (2 - 2 * ε) / (α * sqrt m) := by convert hx.2 using 1 apply Finset.sum_congr rfl intro a _ apply Finset.sum_congr rfl intro r _ exact scoreCDFDistance_symm _ _ have hmem := projection_strictBall_ate_mem_CI g α PH hPH x hout hscore rw [← externalProjectionIntervalProcedure_Icc g α hOverlap hg x] at hmem exact hmem rw [← jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd PH hPH] exact hprob.trans (measureReal_mono hsubset)
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_honest · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:293
theorem externalExcessRisk_le_of_honest_uniform_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
hg :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
hC :
R :
ℝ
hR :
0 ≤ R
hbound :
∀ PH,
∀ hPH : PH ∈ ExternalLaws g,
(∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj PH.1 PH.2))
≤ R
externalExcessRisk g Qj α ≤ R
Proof (Lean source)
lemma externalExcessRisk_le_of_honest_uniform_bound {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (C : ExternalIntervalProcedure ε J n m) (hC : C ∈ externalHonestProcedures g Qj α) (R : ℝ) (hR : 0 ≤ R) (hbound : ∀ PH, ∀ hPH : PH ∈ ExternalLaws g, (∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj PH.1 PH.2)) ≤ R) : externalExcessRisk g Qj α ≤ R := by let P : Measure (FullRow ε J) := trialCenterFullLaw g hOverlap (1 / 2) let H : Measure (ScoreSpace ε) := Measure.dirac (trialCenterScore hOverlap) have hPH : (P, H) ∈ ExternalLaws g := ⟨trialCenterFullLaw_isProbabilityMeasure g hOverlap _ (by norm_num) (by norm_num), inferInstance, trialCenterFullLaw_externalScoreLaw g hOverlap hg _ (by norm_num) (by norm_num)⟩ let U (C : ExternalIntervalProcedure ε J n m) : Set ℝ := {u | ∃ PH, ∃ hPH : PH ∈ ExternalLaws g, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(externalExperiment n m PH.1 PH.2)} have hUbd (C : ExternalIntervalProcedure ε J n m) : BddAbove (U C) := by refine ⟨2, ?_⟩ rintro u ⟨PH, hPH', rfl⟩ simpa only [jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd PH hPH'] using externalExcessIntegral_le_two g Qj hTrial hLog hInd C PH hPH' have hUne (C : ExternalIntervalProcedure ε J n m) : (U C).Nonempty := by exact ⟨_, ⟨(P, H), hPH, rfl⟩⟩ have hUlower (C : ExternalIntervalProcedure ε J n m) : 0 ≤ sSup (U C) := by obtain ⟨u, hu⟩ := hUne C rcases hu with ⟨PH, hPH', rfl⟩ exact (integral_nonneg (fun _ => le_max_left _ _)).trans (le_csSup (hUbd C) ⟨PH, hPH', rfl⟩) have hRiskBd : BddBelow {v : ℝ | ∃ C ∈ externalHonestProcedures g Qj α, v = sSup (U C)} := by refine ⟨0, ?_⟩ rintro v ⟨C, hC', rfl⟩ exact hUlower C have hUupper : sSup (U C) ≤ R := by apply csSup_le (hUne C) rintro v ⟨PH, hPH', rfl⟩ simpa only [jointTrialLog_eq_externalExperiment g Qj hTrial hLog hInd PH hPH'] using hbound PH hPH' unfold externalExcessRisk have hmem : sSup (U C) ∈ {v : ℝ | ∃ C ∈ externalHonestProcedures g Qj α, v = sSup (U C)} := ⟨C, hC, rfl⟩ exact (csInf_le hRiskBd hmem).trans hUupper
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_le_of_honest_uniform_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionCoverage.lean:438
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionDistanceTriangle 7 declarations Triangle bounds for the finite-measure CDF distances in the external projection.

Triangle bounds for the finite-measure CDF distances in the external projection.

theorem projectionFiniteCDF_intervalIntegrable Lemma projectionFiniteCDF_intervalIntegrable in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
X :
ν :
hν :
ν univ < ⊤
v :
X → ℝ
a b :
ℝ
hab :
a ≤ b
IntervalIntegrable (fun t : ℝ => ν.real {x | v x ≤ t}) volume a b
Proof (Lean source)
lemma projectionFiniteCDF_intervalIntegrable {X : Type*} [MeasurableSpace X] (ν : Measure X) (hν : ν univ < ⊤) (v : X → ℝ) {a b : ℝ} (hab : a ≤ b) : IntervalIntegrable (fun t : ℝ => ν.real {x | v x ≤ t}) volume a b := by have hInt : IntegrableOn (fun t : ℝ => ν.real {x | v x ≤ t}) (Icc a b) volume := by apply Integrable.of_bound (measurable_projectionFiniteCDF ν hν v).aestronglyMeasurable (ν.real univ) filter_upwards [] with t have hle : ν {x | v x ≤ t} ≤ ν univ := measure_mono (Set.subset_univ _) have hreal : ν.real {x | v x ≤ t} ≤ ν.real univ := by exact ENNReal.toReal_mono (ne_of_lt hν) hle rw [Real.norm_eq_abs, abs_of_nonneg measureReal_nonneg] exact hreal exact (intervalIntegrable_iff_integrableOn_Icc_of_le hab).mpr hInt
CausalSmith.PartialID.UnlinkedPropensityAte.projectionFiniteCDF_intervalIntegrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:14
theorem projectionFiniteCDF_absDiff_intervalIntegrable Lemma projectionFiniteCDF_absDiff_intervalIntegrable in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
X :
μ ν :
hμ :
μ univ < ⊤
hν :
ν univ < ⊤
v :
X → ℝ
a b :
ℝ
hab :
a ≤ b
IntervalIntegrable (fun t : ℝ => |(μ {x | v x ≤ t}).toReal - (ν {x | v x ≤ t}).toReal|) volume a b
Proof (Lean source)
lemma projectionFiniteCDF_absDiff_intervalIntegrable {X : Type*} [MeasurableSpace X] (μ ν : Measure X) (hμ : μ univ < ⊤) (hν : ν univ < ⊤) (v : X → ℝ) {a b : ℝ} (hab : a ≤ b) : IntervalIntegrable (fun t : ℝ => |(μ {x | v x ≤ t}).toReal - (ν {x | v x ≤ t}).toReal|) volume a b := by exact ((projectionFiniteCDF_intervalIntegrable μ hμ v hab).sub (projectionFiniteCDF_intervalIntegrable ν hν v hab)).abs
CausalSmith.PartialID.UnlinkedPropensityAte.projectionFiniteCDF_absDiff_intervalIntegrable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:33
theorem projectionIntegratedAbs_triangle Lemma projectionIntegratedAbs_triangle in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
F G H :
ℝ → ℝ
hFG :
IntervalIntegrable (fun t => |F t - G t|) volume a b
hGH :
IntervalIntegrable (fun t => |G t - H t|) volume a b
hFH :
IntervalIntegrable (fun t => |F t - H t|) volume a b
(∫ t in a..b, |F t - H t|) ≤ (∫ t in a..b, |F t - G t|) + (∫ t in a..b, |G t - H t|)
Proof (Lean source)
lemma projectionIntegratedAbs_triangle {a b : ℝ} (hab : a ≤ b) (F G H : ℝ → ℝ) (hFG : IntervalIntegrable (fun t => |F t - G t|) volume a b) (hGH : IntervalIntegrable (fun t => |G t - H t|) volume a b) (hFH : IntervalIntegrable (fun t => |F t - H t|) volume a b) : (∫ t in a..b, |F t - H t|) ≤ (∫ t in a..b, |F t - G t|) + (∫ t in a..b, |G t - H t|) := by rw [← intervalIntegral.integral_add hFG hGH] apply intervalIntegral.integral_mono_on hab hFH (hFG.add hGH) intro t _ calc |F t - H t| = |(F t - G t) + (G t - H t)| := by congr 1; ring _ ≤ |F t - G t| + |G t - H t| := abs_add_le _ _
CausalSmith.PartialID.UnlinkedPropensityAte.projectionIntegratedAbs_triangle · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:44
theorem outcomeCDFDistance_triangle Lemma outcomeCDFDistance_triangle in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
μ ν ξ :
hμ :
μ univ < ⊤
hν :
ν univ < ⊤
hξ :
ξ univ < ⊤
Proof (Lean source)
lemma outcomeCDFDistance_triangle (μ ν ξ : Measure OutcomeSpace) (hμ : μ univ < ⊤) (hν : ν univ < ⊤) (hξ : ξ univ < ⊤) : outcomeCDFDistance μ ξ ≤ outcomeCDFDistance μ ν + outcomeCDFDistance ν ξ := by have hmass := abs_sub_le (μ.real univ) (ν.real univ) (ξ.real univ) have hcdf := projectionIntegratedAbs_triangle (by norm_num : (0 : ℝ) ≤ 1) (fun t => (μ {y | (y : ℝ) ≤ t}).toReal) (fun t => (ν {y | (y : ℝ) ≤ t}).toReal) (fun t => (ξ {y | (y : ℝ) ≤ t}).toReal) (projectionFiniteCDF_absDiff_intervalIntegrable μ ν hμ hν (fun y : OutcomeSpace => (y : ℝ)) (by norm_num)) (projectionFiniteCDF_absDiff_intervalIntegrable ν ξ hν hξ (fun y : OutcomeSpace => (y : ℝ)) (by norm_num)) (projectionFiniteCDF_absDiff_intervalIntegrable μ ξ hμ hξ (fun y : OutcomeSpace => (y : ℝ)) (by norm_num)) dsimp [outcomeCDFDistance] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance_triangle · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:61
theorem scoreCDFDistance_triangle

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
μ ν ξ :
hμ :
μ univ < ⊤
hν :
ν univ < ⊤
hξ :
ξ univ < ⊤
Proof (Lean source)
lemma scoreCDFDistance_triangle {ε : ℝ} (hOverlap : Overlap ε) (μ ν ξ : Measure (ScoreSpace ε)) (hμ : μ univ < ⊤) (hν : ν univ < ⊤) (hξ : ξ univ < ⊤) : scoreCDFDistance μ ξ ≤ scoreCDFDistance μ ν + scoreCDFDistance ν ξ := by have hab : ε ≤ 1 - ε := by dsimp [Overlap] at hOverlap; linarith [hOverlap.2] have hmass := abs_sub_le (μ.real univ) (ν.real univ) (ξ.real univ) have hcdf := projectionIntegratedAbs_triangle hab (fun t => (μ {e | (e : ℝ) ≤ t}).toReal) (fun t => (ν {e | (e : ℝ) ≤ t}).toReal) (fun t => (ξ {e | (e : ℝ) ≤ t}).toReal) (projectionFiniteCDF_absDiff_intervalIntegrable μ ν hμ hν (fun e : ScoreSpace ε => (e : ℝ)) hab) (projectionFiniteCDF_absDiff_intervalIntegrable ν ξ hν hξ (fun e : ScoreSpace ε => (e : ℝ)) hab) (projectionFiniteCDF_absDiff_intervalIntegrable μ ξ hμ hξ (fun e : ScoreSpace ε => (e : ℝ)) hab) dsimp [scoreCDFDistance] linarith
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCDFDistance_triangle · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:83
theorem projectionCandidate_populationDistance_le_of_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
σ :
hb :
htrialEmp :
∀ a r, (empiricalTrialCells x.1 a r) univ < ⊤
hscoreEmp :
∀ a r, (empiricalScoreCells g x.2 a r) univ < ⊤
htrialPop :
∀ a r, (lam a r) univ < ⊤
hscorePop :
∀ a r, (σ a r) univ < ⊤
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r))
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r))
≤ 4 * J / (α * sqrt n)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r))
+ 2 * J * (2 - 2 * ε) / (α * sqrt m)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r))
Proof (Lean source)
lemma projectionCandidate_populationDistance_le_of_finite {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (htrialEmp : ∀ a r, (empiricalTrialCells x.1 a r) univ < ⊤) (hscoreEmp : ∀ a r, (empiricalScoreCells g x.2 a r) univ < ⊤) (htrialPop : ∀ a r, (lam a r) univ < ⊤) (hscorePop : ∀ a r, (σ a r) univ < ⊤) : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) ≤ 4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) := by apply projectionCandidate_populationDistance_le g α x b lam σ hb · intro a r exact outcomeCDFDistance_triangle _ _ _ (hb.1 a r).1 (htrialEmp a r) (htrialPop a r) · intro a r exact scoreCDFDistance_triangle hOverlap _ _ _ (hb.1 a r).2 (hscoreEmp a r) (hscorePop a r)
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_populationDistance_le_of_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:106
theorem projectionCandidate_populationDistance_le_of_populationFinite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
σ :
hb :
htrialPop :
∀ a r, (lam a r) univ < ⊤
hscorePop :
∀ a r, (σ a r) univ < ⊤
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r))
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r))
≤ 4 * J / (α * sqrt n)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r))
+ 2 * J * (2 - 2 * ε) / (α * sqrt m)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r))
Proof (Lean source)
lemma projectionCandidate_populationDistance_le_of_populationFinite {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (htrialPop : ∀ a r, (lam a r) univ < ⊤) (hscorePop : ∀ a r, (σ a r) univ < ⊤) : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) ≤ 4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) := by exact projectionCandidate_populationDistance_le_of_finite g α hOverlap x b lam σ hb (empiricalTrialCells_finite x.1) (empiricalScoreCells_finite g x.2) htrialPop hscorePop
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_populationDistance_le_of_populationFinite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionDistanceTriangle.lean:139
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEmpirical 20 declarations This file records the finite-sample identities behind the trial half of the projection radius.

Empirical trial cell coordinates

This file records the finite-sample identities behind the trial half of the projection radius. A cell cumulative mass is a measurable finite average of coordinate indicators, and under the i.i.d. product law its expectation is the corresponding population cell mass.

def trialCellFrequency

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J n :
ℕ
a :
r :
x :
trialCellFrequency a r B x :
ℝ
by classical exact (n : ℝ)⁻¹ * ∑ i : Fin n, if (x i).1 = r ∧
(x i).2.1 = a ∧
(x i).2.2 ∈ B then (1 : ℝ) else 0
CausalSmith.PartialID.UnlinkedPropensityAte.trialCellFrequency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:26
theorem empiricalTrialCells_real_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
a :
r :
hB :
x :
Proof (Lean source)
lemma empiricalTrialCells_real_apply {J n : ℕ} (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) (x : TrialSample n J) : (empiricalTrialCells x a r).real B = trialCellFrequency a r B x := by classical unfold empiricalTrialCells trialCellFrequency Measure.real rw [Measure.smul_apply, Measure.coe_finsetSum, Finset.sum_apply, smul_eq_mul, ENNReal.toReal_mul, ENNReal.toReal_inv, ENNReal.toReal_natCast] congr 1 rw [ENNReal.toReal_sum] · apply Finset.sum_congr rfl intro i _ by_cases hcell : (x i).1 = r ∧ (x i).2.1 = a · simp only [hcell, and_self, ↓reduceIte] rw [Measure.dirac_apply' _ hB] by_cases hmem : (x i).2.2 ∈ B <;> simp [indicator, hmem] · simp only [hcell, ↓reduceIte, Measure.coe_zero, Pi.zero_apply, ENNReal.toReal_zero] have hfull : ¬((x i).1 = r ∧ (x i).2.1 = a ∧ (x i).2.2 ∈ B) := by intro h exact hcell ⟨h.1, h.2.1⟩ simp [hfull] · intro i _ by_cases hcell : (x i).1 = r ∧ (x i).2.1 = a · by_cases hmem : (x i).2.2 ∈ B <;> simp [hcell, hmem, indicator] · simp [hcell]
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalTrialCells_real_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:33
theorem measurable_trialCellFrequency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
a :
r :
hB :
Proof (Lean source)
@[fun_prop] lemma measurable_trialCellFrequency {J n : ℕ} (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : Measurable (trialCellFrequency (n := n) a r B) := by classical unfold trialCellFrequency apply Measurable.const_mul apply Finset.measurable_sum intro i _ have hi : Measurable (fun x : TrialSample n J => x i) := measurable_pi_apply i apply Measurable.ite · exact (measurableSet_eq_fun hi.fst (measurable_const : Measurable (fun _ : TrialSample n J => r))).inter ((measurableSet_eq_fun hi.snd.fst (measurable_const : Measurable (fun _ : TrialSample n J => a))).inter (hB.preimage hi.snd.snd)) · fun_prop · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_trialCellFrequency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:60
theorem measurable_empiricalTrialCells_real_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
a :
r :
hB :
Measurable (fun x : TrialSample n J => (empiricalTrialCells x a r).real B)
Proof (Lean source)
@[fun_prop] lemma measurable_empiricalTrialCells_real_apply {J n : ℕ} (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : Measurable (fun x : TrialSample n J => (empiricalTrialCells x a r).real B) := by rw [show (fun x : TrialSample n J => (empiricalTrialCells x a r).real B) = trialCellFrequency a r B by funext x exact empiricalTrialCells_real_apply a r B hB x] exact measurable_trialCellFrequency a r B hB
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_empiricalTrialCells_real_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:80
theorem measurable_empiricalTrialCellCDF

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
a :
r :
t :
ℝ
Measurable (fun x : TrialSample n J => (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t})
Proof (Lean source)
@[fun_prop] lemma measurable_empiricalTrialCellCDF {J n : ℕ} (a : ArmSpace) (r : LabelSpace J) (t : ℝ) : Measurable (fun x : TrialSample n J => (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t}) := by apply measurable_empiricalTrialCells_real_apply exact measurableSet_le (by fun_prop) measurable_const
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_empiricalTrialCellCDF · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:91
theorem integral_trialCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
hB :
∫ x, trialCellFrequency a r B x ∂Measure.pi (fun _ : Fin n => μ)
= μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}
Proof (Lean source)
lemma integral_trialCellFrequency_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : ∫ x, trialCellFrequency a r B x ∂Measure.pi (fun _ : Fin n => μ) = μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} := by classical let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} have hC : MeasurableSet C := by change MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} have hz : Measurable (fun z : Observation J => z) := measurable_id exact (measurableSet_eq_fun hz.fst (measurable_const : Measurable (fun _ : Observation J => r))).inter ((measurableSet_eq_fun hz.snd.fst (measurable_const : Measurable (fun _ : Observation J => a))).inter (hB.preimage hz.snd.snd)) have hcoord (i : Fin n) : Integrable (fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) (Measure.pi fun _ : Fin n => μ) := by have hm : Measurable (fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) := Measurable.ite (hC.preimage (measurable_pi_apply i)) measurable_const measurable_const exact Integrable.of_bound hm.aestronglyMeasurable 1 (Filter.Eventually.of_forall fun x => by by_cases hx : x i ∈ C <;> simp [hx]) unfold trialCellFrequency rw [MeasureTheory.integral_const_mul] change (n : ℝ)⁻¹ * ∫ x : TrialSample n J, ∑ i : Fin n, if x i ∈ C then (1 : ℝ) else 0 ∂Measure.pi (fun _ : Fin n => μ) = μ.real C rw [MeasureTheory.integral_finsetSum univ (fun i _ => hcoord i)] have heach (i : Fin n) : ∫ x : TrialSample n J, (if x i ∈ C then (1 : ℝ) else 0) ∂Measure.pi (fun _ : Fin n => μ) = μ.real C := by calc (∫ x : TrialSample n J, (if x i ∈ C then (1 : ℝ) else 0) ∂Measure.pi (fun _ : Fin n => μ)) = ∫ x : TrialSample n J, C.indicator (fun _ => (1 : ℝ)) (x i) ∂Measure.pi (fun _ : Fin n => μ) := by apply integral_congr_ae filter_upwards [] with x simp [indicator] _ = ∫ z : Observation J, C.indicator (fun _ => (1 : ℝ)) z ∂μ := by rw [MeasureTheory.integral_comp_eval (μ := fun _ : Fin n => μ) (i := i)] exact (measurable_const.indicator hC).aestronglyMeasurable _ = μ.real C := MeasureTheory.integral_indicator_one hC simp_rw [heach] simp [Nat.ne_of_gt hn]
CausalSmith.PartialID.UnlinkedPropensityAte.integral_trialCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:100
theorem empiricalScoreCells_real_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
g :
a :
r :
B :
hB :
x :
Fin m → ScoreSpace ε
= ∑ j : Fin m, {j | g (x j) = r ∧ x j ∈ B}.indicator (fun j => toReal (ofReal (armProb a (x j)) / m)) j
Proof (Lean source)
lemma empiricalScoreCells_real_apply {ε : ℝ} {J m : ℕ} (g : ScoreSpace ε → LabelSpace J) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) (x : Fin m → ScoreSpace ε) : (empiricalScoreCells g x a r).real B = ∑ j : Fin m, {j | g (x j) = r ∧ x j ∈ B}.indicator (fun j => toReal (ofReal (armProb a (x j)) / m)) j := by classical unfold empiricalScoreCells Measure.real rw [Measure.coe_finsetSum, Finset.sum_apply, ENNReal.toReal_sum] · apply Finset.sum_congr rfl intro j _ by_cases hr : g (x j) = r · simp only [hr, ↓reduceIte, Measure.smul_apply] rw [Measure.dirac_apply' _ hB] by_cases hmem : x j ∈ B <;> simp [indicator, hr, hmem, ENNReal.toReal_div] · simp [hr] · intro j _ by_cases hr : g (x j) = r · by_cases hmem : x j ∈ B · simp only [hr, ↓reduceIte, Measure.smul_apply] rw [Measure.dirac_apply' _ hB] simp only [indicator, if_pos hmem, Pi.one_apply, smul_eq_mul, mul_one] by_cases hm : m = 0 · subst m exact elim0 j · exact ne_of_lt (ENNReal.div_lt_top ENNReal.ofReal_ne_top (by simp [hm])) · simp [hr, hmem] · simp [hr]
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalScoreCells_real_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:149
theorem variance_scoreCellIndicator

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
g :
hg :
a :
r :
B :
hB :
variance ({e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a)) H
≤ 1 / 4
Proof (Lean source)
lemma variance_scoreCellIndicator {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : variance ({e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a)) H ≤ 1 / 4 := by classical have hcell : MeasurableSet {e : ScoreSpace ε | g e = r ∧ e ∈ B} := (measurableSet_eq_fun hg measurable_const).inter hB have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hm : Measurable ({e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a)) := hp.indicator hcell have hb : ∀ e : ScoreSpace ε, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r ∧ e ∈ B · simpa [indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [indicator, he] have hv := ProbabilityTheory.variance_le_sq_of_bounded (μ := H) (a := 0) (b := 1) (Filter.Eventually.of_forall hb) hm.aemeasurable norm_num at hv exact hv
CausalSmith.PartialID.UnlinkedPropensityAte.variance_scoreCellIndicator · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:181
theorem variance_trialCellIndicator_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
i :
Fin n
a :
r :
hB :
variance (fun x : TrialSample n J => {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}.indicator (fun _ => (1 : ℝ)) (x i)) (Measure.pi fun _ : Fin n => μ)
≤ 1 / 4
Proof (Lean source)
lemma variance_trialCellIndicator_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (i : Fin n) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : variance (fun x : TrialSample n J => {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}.indicator (fun _ => (1 : ℝ)) (x i)) (Measure.pi fun _ : Fin n => μ) ≤ 1 / 4 := by classical let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} have hC : MeasurableSet C := by exact (measurableSet_eq_fun measurable_fst measurable_const).inter ((measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const).inter (hB.preimage (measurable_snd.comp measurable_snd))) have hm : Measurable (fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) := by exact Measurable.ite (hC.preimage (measurable_pi_apply i)) measurable_const measurable_const have hb : ∀ x : TrialSample n J, (if x i ∈ C then (1 : ℝ) else 0) ∈ Icc (0 : ℝ) 1 := by intro x by_cases hx : x i ∈ C <;> simp [hx] have hv := ProbabilityTheory.variance_le_sq_of_bounded (μ := Measure.pi fun _ : Fin n => μ) (X := fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) (a := 0) (b := 1) (Filter.Eventually.of_forall hb) hm.aemeasurable norm_num at hv simpa [indicator, C] using hv
CausalSmith.PartialID.UnlinkedPropensityAte.variance_trialCellIndicator_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:213
theorem variance_trialCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
hB :
variance (trialCellFrequency a r B) (Measure.pi fun _ : Fin n => μ)
≤ 1 / (4 * n)
Proof (Lean source)
lemma variance_trialCellFrequency_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : variance (trialCellFrequency a r B) (Measure.pi fun _ : Fin n => μ) ≤ 1 / (4 * n) := by classical let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} let F : Observation J → ℝ := C.indicator (fun _ => 1) have hC : MeasurableSet C := by exact (measurableSet_eq_fun measurable_fst measurable_const).inter ((measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const).inter (hB.preimage (measurable_snd.comp measurable_snd))) have hF : Measurable F := measurable_const.indicator hC have hbound : ∀ z, F z ∈ Icc (0 : ℝ) 1 := by intro z by_cases hz : z ∈ C <;> simp [F, hz] have hlp : MemLp F 2 μ := memLp_of_bounded (Filter.Eventually.of_forall hbound) hF.aestronglyMeasurable 2 have hvar : variance F μ ≤ 1 / 4 := by have hv := ProbabilityTheory.variance_le_sq_of_bounded (μ := μ) (X := F) (a := 0) (b := 1) (Filter.Eventually.of_forall hbound) hF.aemeasurable norm_num at hv exact hv have hmain := iid_average_variance_fintype (ι := Fin n) μ F hlp have hfun : trialCellFrequency a r B = (fun x : TrialSample n J => (n : ℝ)⁻¹ * ∑ i : Fin n, F (x i)) := by funext x unfold trialCellFrequency F C congr 1 apply Finset.sum_congr rfl intro i _ simp only [indicator] rfl rw [hfun] simp only [Fintype.card_fin] at hmain rw [hmain] have hn0 : (0 : ℝ) ≤ (n : ℝ)⁻¹ := by positivity calc (n : ℝ)⁻¹ * variance F μ ≤ (n : ℝ)⁻¹ * (1 / 4) := mul_le_mul_of_nonneg_left hvar hn0 _ = 1 / (4 * n) := by field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.variance_trialCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:246
def scoreCellFrequency

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J m :
ℕ
g :
a :
r :
B :
x :
Fin m → ScoreSpace ε
scoreCellFrequency g a r B x :
ℝ
(m : ℝ)⁻¹ * ∑ j : Fin m, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) (x j)
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCellFrequency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:294
theorem empiricalScoreCells_real_eq_scoreCellFrequency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
a :
r :
B :
hB :
x :
Fin m → ScoreSpace ε
Proof (Lean source)
lemma empiricalScoreCells_real_eq_scoreCellFrequency {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) (x : Fin m → ScoreSpace ε) : (empiricalScoreCells g x a r).real B = scoreCellFrequency g a r B x := by classical rw [empiricalScoreCells_real_apply g a r B hB x] unfold scoreCellFrequency rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ by_cases hj : g (x j) = r ∧ x j ∈ B · simp only [indicator] rw [ENNReal.toReal_div, ENNReal.toReal_ofReal (le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a (x j)).1), ENNReal.toReal_natCast] simp [hj, div_eq_mul_inv, mul_comm] · simp [indicator, hj]
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalScoreCells_real_eq_scoreCellFrequency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:302
theorem measurable_scoreCellFrequency

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
g :
hg :
a :
r :
B :
hB :
Measurable (scoreCellFrequency (m := m) g a r B)
Proof (Lean source)
@[fun_prop] lemma measurable_scoreCellFrequency {ε : ℝ} {J m : ℕ} (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : Measurable (scoreCellFrequency (m := m) g a r B) := by have hcell : MeasurableSet {e : ScoreSpace ε | g e = r ∧ e ∈ B} := (measurableSet_eq_fun hg measurable_const).inter hB have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop unfold scoreCellFrequency apply Measurable.const_mul apply Finset.measurable_sum intro j _ exact (hp.indicator hcell).comp (measurable_pi_apply j)
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_scoreCellFrequency · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:324
theorem integral_scoreCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
∫ x, scoreCellFrequency g a r B x ∂Measure.pi (fun _ : Fin m => H)
= ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H
Proof (Lean source)
lemma integral_scoreCellFrequency_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : ∫ x, scoreCellFrequency g a r B x ∂Measure.pi (fun _ : Fin m => H) = ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H := by let F : ScoreSpace ε → ℝ := {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) have hcell : MeasurableSet {e : ScoreSpace ε | g e = r ∧ e ∈ B} := (measurableSet_eq_fun hg measurable_const).inter hB have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable F := hp.indicator hcell have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r ∧ e ∈ B · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hInt : Integrable F H := Integrable.of_bound hF.aestronglyMeasurable 1 (Filter.Eventually.of_forall fun e => by have he := hbound e simpa [Real.norm_eq_abs, abs_of_nonneg he.1] using he.2) have hcoord (j : Fin m) : Integrable (fun x : Fin m → ScoreSpace ε => F (x j)) (Measure.pi fun _ : Fin m => H) := MeasureTheory.integrable_comp_eval hInt change (∫ x : Fin m → ScoreSpace ε, (m : ℝ)⁻¹ * ∑ j : Fin m, F (x j) ∂Measure.pi (fun _ : Fin m => H)) = ∫ e, F e ∂H rw [MeasureTheory.integral_const_mul, MeasureTheory.integral_finsetSum univ (fun j _ => hcoord j)] have heach (j : Fin m) : ∫ x : Fin m → ScoreSpace ε, F (x j) ∂Measure.pi (fun _ : Fin m => H) = ∫ e, F e ∂H := by rw [MeasureTheory.integral_comp_eval (μ := fun _ : Fin m => H) (i := j)] exact hF.aestronglyMeasurable simp_rw [heach] simp [Nat.ne_of_gt hm]
CausalSmith.PartialID.UnlinkedPropensityAte.integral_scoreCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:343
theorem integral_empiricalScoreCells_real_apply_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
∫ x, (empiricalScoreCells g x a r).real B ∂Measure.pi (fun _ : Fin m => H)
= ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H
Proof (Lean source)
lemma integral_empiricalScoreCells_real_apply_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : ∫ x, (empiricalScoreCells g x a r).real B ∂Measure.pi (fun _ : Fin m => H) = ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H := by simpa only [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r B hB] using integral_scoreCellFrequency_pi hOverlap H g hg hm a r B hB
CausalSmith.PartialID.UnlinkedPropensityAte.integral_empiricalScoreCells_real_apply_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:390
theorem variance_scoreCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
variance (scoreCellFrequency g a r B) (Measure.pi fun _ : Fin m => H)
≤ 1 / (4 * m)
Proof (Lean source)
lemma variance_scoreCellFrequency_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : variance (scoreCellFrequency g a r B) (Measure.pi fun _ : Fin m => H) ≤ 1 / (4 * m) := by let F : ScoreSpace ε → ℝ := {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) have hcell : MeasurableSet {e : ScoreSpace ε | g e = r ∧ e ∈ B} := (measurableSet_eq_fun hg measurable_const).inter hB have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable F := hp.indicator hcell have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r ∧ e ∈ B · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hlp : MemLp F 2 H := memLp_of_bounded (Filter.Eventually.of_forall hbound) hF.aestronglyMeasurable 2 have hvar : variance F H ≤ 1 / 4 := by simpa [F] using variance_scoreCellIndicator hOverlap H g hg a r B hB have hmain := iid_average_variance_fintype (ι := Fin m) H F hlp change variance (fun x : Fin m → ScoreSpace ε => (m : ℝ)⁻¹ * ∑ j : Fin m, F (x j)) (Measure.pi fun _ : Fin m => H) ≤ 1 / (4 * m) simp only [Fintype.card_fin] at hmain rw [hmain] calc (m : ℝ)⁻¹ * variance F H ≤ (m : ℝ)⁻¹ * (1 / 4) := mul_le_mul_of_nonneg_left hvar (by positivity) _ = 1 / (4 * m) := by field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.variance_scoreCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:403
theorem variance_empiricalScoreCells_real_apply_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
variance (fun x : Fin m → ScoreSpace ε => (empiricalScoreCells g x a r).real B) (Measure.pi fun _ : Fin m => H)
≤ 1 / (4 * m)
Proof (Lean source)
lemma variance_empiricalScoreCells_real_apply_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : variance (fun x : Fin m → ScoreSpace ε => (empiricalScoreCells g x a r).real B) (Measure.pi fun _ : Fin m => H) ≤ 1 / (4 * m) := by simpa only [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r B hB] using variance_scoreCellFrequency_pi hOverlap H g hg hm a r B hB
CausalSmith.PartialID.UnlinkedPropensityAte.variance_empiricalScoreCells_real_apply_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:444
theorem projectionMeanAbs_le_sqrt_variance Lemma projectionMeanAbs_le_sqrt_variance in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Ω :
X :
Ω → ℝ
hX :
MemLp X 2 μ
∫ x, |X x - ∫ y, X y ∂μ| ∂μ ≤ sqrt (variance X μ)
Proof (Lean source)
lemma projectionMeanAbs_le_sqrt_variance {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (X : Ω → ℝ) (hX : MemLp X 2 μ) : ∫ x, |X x - ∫ y, X y ∂μ| ∂μ ≤ sqrt (variance X μ) := by let Z : Ω → ℝ := fun x => X x - ∫ y, X y ∂μ have hZ : MemLp Z 2 μ := hX.sub (memLp_const _) have hOne : MemLp (fun _ : Ω => (1 : ℝ)) 2 μ := memLp_const _ have hh : (2 : ℝ).HolderConjugate 2 := by rw [Real.holderConjugate_iff] norm_num have hZ' : MemLp Z (ofReal (2 : ℝ)) μ := by simpa using hZ have hOne' : MemLp (fun _ : Ω => (1 : ℝ)) (ofReal (2 : ℝ)) μ := by simpa using hOne have h := integral_mul_norm_le_Lp_mul_Lq hh hZ' hOne' simp only [norm_one, mul_one, integral_const, smul_eq_mul, mul_one, Real.one_rpow, Real.norm_eq_abs] at h rw [show μ.real univ = 1 from isProbabilityMeasure_iff_real.mp inferInstance, Real.one_rpow, mul_one] at h rw [ProbabilityTheory.variance_eq_integral hX.1.aemeasurable] simpa [Z, sq_abs, Real.sqrt_eq_rpow, div_eq_mul_inv] using h
CausalSmith.PartialID.UnlinkedPropensityAte.projectionMeanAbs_le_sqrt_variance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:457
theorem projectionMeanAbs_le_inv_two_sqrt Lemma projectionMeanAbs_le_inv_two_sqrt in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Ω :
X :
Ω → ℝ
N :
ℕ
hN :
0 < N
hX :
MemLp X 2 μ
hvar :
variance X μ ≤ 1 / (4 * N)
∫ x, |X x - ∫ y, X y ∂μ| ∂μ ≤ 1 / (2 * sqrt N)
Proof (Lean source)
lemma projectionMeanAbs_le_inv_two_sqrt {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (X : Ω → ℝ) (N : ℕ) (hN : 0 < N) (hX : MemLp X 2 μ) (hvar : variance X μ ≤ 1 / (4 * N)) : ∫ x, |X x - ∫ y, X y ∂μ| ∂μ ≤ 1 / (2 * sqrt N) := by have hcs := projectionMeanAbs_le_sqrt_variance μ X hX have hs := Real.sqrt_le_sqrt hvar have hN' : (0 : ℝ) < N := by exact_mod_cast hN have hsimp : sqrt (1 / (4 * (N : ℝ))) = 1 / (2 * sqrt N) := by rw [Real.sqrt_div (by positivity), Real.sqrt_mul (by positivity)] simp only [show sqrt (4 : ℝ) = 2 by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.sqrt_sq (by norm_num)]] simp only [Real.sqrt_one] calc ∫ x, |X x - ∫ y, X y ∂μ| ∂μ ≤ sqrt (variance X μ) := hcs _ ≤ sqrt (1 / (4 * N)) := hs _ = 1 / (2 * sqrt N) := hsimp
CausalSmith.PartialID.UnlinkedPropensityAte.projectionMeanAbs_le_inv_two_sqrt · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:481
theorem meanAbs_trialCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
hB :
∫ x, |trialCellFrequency a r B x
- μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}| ∂Measure.pi (fun _ : Fin n => μ)
≤ 1 / (2 * sqrt n)
Proof (Lean source)
lemma meanAbs_trialCellFrequency_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : ∫ x, |trialCellFrequency a r B x - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}| ∂Measure.pi (fun _ : Fin n => μ) ≤ 1 / (2 * sqrt n) := by classical let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} have hC : MeasurableSet C := by exact (measurableSet_eq_fun measurable_fst measurable_const).inter ((measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const).inter (hB.preimage (measurable_snd.comp measurable_snd))) have hcoord (i : Fin n) : MemLp (fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) 2 (Measure.pi fun _ : Fin n => μ) := by have hm : Measurable (fun x : TrialSample n J => if x i ∈ C then (1 : ℝ) else 0) := Measurable.ite (hC.preimage (measurable_pi_apply i)) measurable_const measurable_const have hb : ∀ x : TrialSample n J, (if x i ∈ C then (1 : ℝ) else 0) ∈ Icc (0 : ℝ) 1 := by intro x by_cases hx : x i ∈ C <;> simp [hx] exact memLp_of_bounded (Filter.Eventually.of_forall hb) hm.aestronglyMeasurable 2 have hX : MemLp (trialCellFrequency a r B) 2 (Measure.pi fun _ : Fin n => μ) := by have hs := memLp_finsetSum univ (fun i _ => hcoord i) have hs' := hs.const_mul (n : ℝ)⁻¹ unfold trialCellFrequency simpa only [C, Set.mem_ofPred_eq] using hs' rw [← integral_trialCellFrequency_pi μ hn a r B hB] exact projectionMeanAbs_le_inv_two_sqrt (Measure.pi fun _ : Fin n => μ) (trialCellFrequency a r B) n hn hX (variance_trialCellFrequency_pi μ hn a r B hB)
CausalSmith.PartialID.UnlinkedPropensityAte.meanAbs_trialCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpirical.lean:503
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEmpiricalFinite 2 declarations Finite mass of the empirical submeasures used in the projection.

Finite mass of the empirical submeasures used in the projection.

theorem empiricalTrialCells_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
x :
a :
r :
Proof (Lean source)
lemma empiricalTrialCells_finite {J n : ℕ} (x : TrialSample n J) (a : ArmSpace) (r : LabelSpace J) : (empiricalTrialCells x a r) univ < ⊤ := by classical by_cases hn : n = 0 · subst n simp [empiricalTrialCells] unfold empiricalTrialCells simp only [Measure.smul_apply, Measure.coe_finsetSum, Finset.sum_apply] apply ENNReal.mul_lt_top · simp [Nat.pos_of_ne_zero hn] · apply ENNReal.sum_lt_top.mpr intro i _ split_ifs <;> simp
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalTrialCells_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalFinite.lean:12
theorem empiricalScoreCells_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
g :
x :
Fin m → ScoreSpace ε
a :
r :
(empiricalScoreCells g x a r) univ < ⊤
Proof (Lean source)
lemma empiricalScoreCells_finite {ε : ℝ} {J m : ℕ} (g : ScoreSpace ε → LabelSpace J) (x : Fin m → ScoreSpace ε) (a : ArmSpace) (r : LabelSpace J) : (empiricalScoreCells g x a r) univ < ⊤ := by classical unfold empiricalScoreCells simp only [Measure.coe_finsetSum, Finset.sum_apply] apply ENNReal.sum_lt_top.mpr intro i _ split_ifs · simp only [Measure.smul_apply, Measure.dirac_apply' _ MeasurableSet.univ, indicator, Set.mem_univ, if_pos, Pi.one_apply, smul_eq_mul, mul_one] exact ENNReal.div_lt_top ENNReal.ofReal_ne_top (by have hm : 0 < m := lt_of_le_of_lt (zero_le i.val) i.isLt exact_mod_cast (Nat.ne_of_gt hm)) · simp
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalScoreCells_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalFinite.lean:29
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEmpiricalMean 4 declarations Expected absolute coordinate errors for the empirical projection.

Expected absolute coordinate errors for the empirical projection.

theorem meanAbs_scoreCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
∫ x, |scoreCellFrequency g a r B x
- ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)
≤ 1 / (2 * sqrt m)
Proof (Lean source)
lemma meanAbs_scoreCellFrequency_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : ∫ x, |scoreCellFrequency g a r B x - ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H) ≤ 1 / (2 * sqrt m) := by let C : Set (ScoreSpace ε) := {e | g e = r ∧ e ∈ B} let F : ScoreSpace ε → ℝ := C.indicator (armProb a) have hC : MeasurableSet C := (measurableSet_eq_fun hg measurable_const).inter hB have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable F := hp.indicator hC have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : e ∈ C · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hlp : MemLp F 2 H := memLp_of_bounded (Filter.Eventually.of_forall hbound) hF.aestronglyMeasurable 2 have hcoord (j : Fin m) : MemLp (fun x : Fin m → ScoreSpace ε => F (x j)) 2 (Measure.pi fun _ : Fin m => H) := by exact hlp.comp_measurePreserving (measurePreserving_eval (fun _ : Fin m => H) j) have hX : MemLp (scoreCellFrequency g a r B) 2 (Measure.pi fun _ : Fin m => H) := by have hs := memLp_finsetSum univ (fun j _ => hcoord j) have hs' := hs.const_mul (m : ℝ)⁻¹ unfold scoreCellFrequency simpa only [F, C] using hs' rw [← integral_scoreCellFrequency_pi hOverlap H g hg hm a r B hB] exact projectionMeanAbs_le_inv_two_sqrt (Measure.pi fun _ : Fin m => H) (scoreCellFrequency g a r B) m hm hX (variance_scoreCellFrequency_pi hOverlap H g hg hm a r B hB)
CausalSmith.PartialID.UnlinkedPropensityAte.meanAbs_scoreCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalMean.lean:16
theorem meanAbs_empiricalScoreCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
B :
hB :
∫ x, |(empiricalScoreCells g x a r).real B
- ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)
≤ 1 / (2 * sqrt m)
Proof (Lean source)
lemma meanAbs_empiricalScoreCells_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : ∫ x, |(empiricalScoreCells g x a r).real B - ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H) ≤ 1 / (2 * sqrt m) := by simpa only [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r B hB] using meanAbs_scoreCellFrequency_pi hOverlap H g hg hm a r B hB
CausalSmith.PartialID.UnlinkedPropensityAte.meanAbs_empiricalScoreCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalMean.lean:59
theorem sum_meanAbs_trialCellFrequency_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
hB :
∀ a r, MeasurableSet (B a r)
(∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x, |trialCellFrequency a r (B a r) x - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B a r}| ∂Measure.pi (fun _ : Fin n => μ))
≤ J / sqrt n
Proof (Lean source)
lemma sum_meanAbs_trialCellFrequency_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (B : ArmSpace → LabelSpace J → Set OutcomeSpace) (hB : ∀ a r, MeasurableSet (B a r)) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x, |trialCellFrequency a r (B a r) x - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B a r}| ∂Measure.pi (fun _ : Fin n => μ)) ≤ J / sqrt n := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, (1 / (2 * sqrt n) : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanAbs_trialCellFrequency_pi μ hn a r (B a r) (hB a r) _ = J / sqrt n := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanAbs_trialCellFrequency_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalMean.lean:72
theorem sum_meanAbs_empiricalScoreCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
B :
hB :
∀ a r, MeasurableSet (B a r)
(∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x, |(empiricalScoreCells g x a r).real (B a r) - ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B a r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H))
≤ J / sqrt m
Proof (Lean source)
lemma sum_meanAbs_empiricalScoreCells_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (B : ArmSpace → LabelSpace J → Set (ScoreSpace ε)) (hB : ∀ a r, MeasurableSet (B a r)) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x, |(empiricalScoreCells g x a r).real (B a r) - ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B a r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)) ≤ J / sqrt m := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, (1 / (2 * sqrt m) : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanAbs_empiricalScoreCells_pi hOverlap H g hg hm a r (B a r) (hB a r) _ = J / sqrt m := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] field_simp ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanAbs_empiricalScoreCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEmpiricalMean.lean:96
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEndpointAlgebra 7 declarations Endpoint algebra for the external projection candidate envelope.

Endpoint algebra for the external projection candidate envelope.

theorem projectedArmEndpoint_abs_le_of_cellBounds

Given the endpoint arrays, arm, endpoint direction, bound, and cellwise endpoint differences, this result bounds the absolute difference of the corresponding projected arm endpoints.

Formal statement
ε :
ℝ
J :
ℕ
lam lam' :
σ σ' :
a :
upper :
L :
ℝ
hcell :
∀ r : LabelSpace J,
|(let q := (lam a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam a r univ)⁻¹ • (lam a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ a r univ)⁻¹ • (σ a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)
- (let q := (lam' a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam' a r univ)⁻¹ • (lam' a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' a r univ)⁻¹ • (σ' a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)|
≤ L * (outcomeCDFDistance (lam a r) (lam' a r) + scoreCDFDistance (σ a r) (σ' a r))
|projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper|
≤ L * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r))
Proof (Lean source)
lemma projectedArmEndpoint_abs_le_of_cellBounds {ε : ℝ} {J : ℕ} (lam lam' : ArmCellArray J OutcomeSpace) (σ σ' : ArmCellArray J (ScoreSpace ε)) (a : ArmSpace) (upper : Bool) (L : ℝ) (hcell : ∀ r : LabelSpace J, |(let q := (lam a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam a r univ)⁻¹ • (lam a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ a r univ)⁻¹ • (σ a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0) - (let q := (lam' a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam' a r univ)⁻¹ • (lam' a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' a r univ)⁻¹ • (σ' a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)| ≤ L * (outcomeCDFDistance (lam a r) (lam' a r) + scoreCDFDistance (σ a r) (σ' a r))) : |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ L * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r)) := by unfold projectedArmEndpoint rw [← Finset.sum_sub_distrib] calc _ ≤ ∑ r : LabelSpace J, |(let q := (lam a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam a r univ)⁻¹ • (lam a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ a r univ)⁻¹ • (σ a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0) - (let q := (lam' a r).real univ if 0 < q then q * ∫ u in (0 : ℝ)..1, quantile (((lam' a r univ)⁻¹ • (lam' a r)).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ' a r univ)⁻¹ • (σ' a r)).map (fun e => (armProb a e)⁻¹)) (if upper then u else 1 - u) else 0)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ r : LabelSpace J, L * (outcomeCDFDistance (lam a r) (lam' a r) + scoreCDFDistance (σ a r) (σ' a r)) := Finset.sum_le_sum (fun r _ => hcell r) _ = _ := by simp only [← Finset.mul_sum, Finset.sum_add_distrib]
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_abs_le_of_cellBounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:12
theorem projectionCandidate_populationDistance_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
σ :
hb :
htrial :
∀ a r,
outcomeCDFDistance (b.1 a r) (lam a r)
≤ outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r)
hscore :
∀ a r,
scoreCDFDistance (b.2 a r) (σ a r)
≤ scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r)
+ scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r))
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r))
≤ 4 * J / (α * sqrt n)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r))
+ 2 * J * (2 - 2 * ε) / (α * sqrt m)
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r))
Proof (Lean source)
lemma projectionCandidate_populationDistance_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (htrial : ∀ a r, outcomeCDFDistance (b.1 a r) (lam a r) ≤ outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r) + outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) (hscore : ∀ a r, scoreCDFDistance (b.2 a r) (σ a r) ≤ scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r) + scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) ≤ 4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) := by have hbt := hb.2.2.1 have hbs := hb.2.2.2 have ht : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) ≤ 4 * J / (α * sqrt n) + ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r) := by calc _ ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r) + outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact htrial a r _ = (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (lam a r)) := by simp only [Finset.sum_add_distrib] _ ≤ _ := add_le_add hbt le_rfl have hs : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m) + ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r) := by calc _ ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, (scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r) + scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact hscore a r _ = (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (σ a r)) := by simp only [Finset.sum_add_distrib] _ ≤ _ := add_le_add hbs le_rfl linarith
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_populationDistance_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:78
theorem projectedATEInterval_subset_of_armEndpoint_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
lam lam' :
σ σ' :
δ :
ℝ
h :
∀ a upper, |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ δ
Proof (Lean source)
lemma projectedATEInterval_subset_of_armEndpoint_bounds {ε : ℝ} {J : ℕ} (lam lam' : ArmCellArray J OutcomeSpace) (σ σ' : ArmCellArray J (ScoreSpace ε)) {δ : ℝ} (h : ∀ a upper, |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ δ) : projectedATEInterval lam σ ⊆ Icc ((projectedArmEndpoint lam' σ' true false - projectedArmEndpoint lam' σ' false true) - 2 * δ) ((projectedArmEndpoint lam' σ' true true - projectedArmEndpoint lam' σ' false false) + 2 * δ) := by intro z hz change projectedArmEndpoint lam σ true false - projectedArmEndpoint lam σ false true ≤ z ∧ z ≤ projectedArmEndpoint lam σ true true - projectedArmEndpoint lam σ false false at hz have h₁ := (abs_le.mp (h true false)) have h₂ := (abs_le.mp (h false true)) have h₃ := (abs_le.mp (h true true)) have h₄ := (abs_le.mp (h false false)) change _ ≤ z ∧ z ≤ _ constructor <;> linarith
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEInterval_subset_of_armEndpoint_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:150
theorem externalProjectionCI_excessLength_le_of_armEndpoint_bounds Lemma externalProjectionCI_excessLength_le_of_armEndpoint_bounds in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
σ :
δ :
ℝ
hδ :
0 ≤ δ
hclip :
(sievedProjectionCandidates g α x).Nonempty → (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty
hendpoint :
∀ b ∈ sievedProjectionCandidates g α x,
∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| ≤ δ
∃ lo hi : ℝ,
conclusion 1
conclusion 2
Proof (Lean source)
lemma externalProjectionCI_excessLength_le_of_armEndpoint_bounds {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) {δ : ℝ} (hδ : 0 ≤ δ) (hLU : projectedArmEndpoint lam σ true false - projectedArmEndpoint lam σ false true ≤ projectedArmEndpoint lam σ true true - projectedArmEndpoint lam σ false false) (hclip : (sievedProjectionCandidates g α x).Nonempty → (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty) (hendpoint : ∀ b ∈ sievedProjectionCandidates g α x, ∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint lam σ a upper| ≤ δ) : ∃ lo hi : ℝ, sievedTotalizedProjectionCI g α x = Icc lo hi ∧ max 0 ((hi - lo) - ((projectedArmEndpoint lam σ true true - projectedArmEndpoint lam σ false false) - (projectedArmEndpoint lam σ true false - projectedArmEndpoint lam σ false true))) ≤ 4 * δ := by have hEach : ∀ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2 ⊆ Icc ((projectedArmEndpoint lam σ true false - projectedArmEndpoint lam σ false true) - 2 * δ) ((projectedArmEndpoint lam σ true true - projectedArmEndpoint lam σ false false) + 2 * δ) := by intro b hb exact projectedATEInterval_subset_of_armEndpoint_bounds b.1 lam b.2 σ (hendpoint b hb) have h := externalProjectionCI_excessLength_le_of_candidate_envelopes g α x hLU (by linarith : 0 ≤ 2 * δ) hclip hEach obtain ⟨lo, hi, heq, hbound⟩ := h refine ⟨lo, hi, heq, ?_⟩ simpa only [show 2 * (2 * δ) = 4 * δ by ring] using hbound
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_excessLength_le_of_armEndpoint_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:177
theorem outcomeCDFDistance_nonneg Lemma outcomeCDFDistance_nonneg in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
0 ≤ outcomeCDFDistance μ ν
Proof (Lean source)
lemma outcomeCDFDistance_nonneg (μ ν : Measure OutcomeSpace) : 0 ≤ outcomeCDFDistance μ ν := by unfold outcomeCDFDistance apply add_nonneg (abs_nonneg _) apply intervalIntegral.integral_nonneg (by norm_num) intro t _ exact abs_nonneg _
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:220
theorem scoreCDFDistance_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
μ ν :
0 ≤ scoreCDFDistance μ ν
Proof (Lean source)
lemma scoreCDFDistance_nonneg {ε : ℝ} (hOverlap : Overlap ε) (μ ν : Measure (ScoreSpace ε)) : 0 ≤ scoreCDFDistance μ ν := by unfold scoreCDFDistance apply add_nonneg (abs_nonneg _) apply intervalIntegral.integral_nonneg (by linarith [hOverlap.2]) intro t _ exact abs_nonneg _
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCDFDistance_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:230
theorem projectedArmEndpoint_abs_le_of_armBounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
lam lam' :
σ σ' :
L :
ℝ
hL :
0 ≤ L
hArm :
∀ a upper,
|projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper|
≤ L * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r))
a :
upper :
|projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper|
≤ L * ((∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r))
Proof (Lean source)
lemma projectedArmEndpoint_abs_le_of_armBounds {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (lam lam' : ArmCellArray J OutcomeSpace) (σ σ' : ArmCellArray J (ScoreSpace ε)) (L : ℝ) (hL : 0 ≤ L) (hArm : ∀ a upper, |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ L * ((∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r))) (a : ArmSpace) (upper : Bool) : |projectedArmEndpoint lam σ a upper - projectedArmEndpoint lam' σ' a upper| ≤ L * ((∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) + ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r)) := by have ht (a' : ArmSpace) : 0 ≤ ∑ r : LabelSpace J, outcomeCDFDistance (lam a' r) (lam' a' r) := Finset.sum_nonneg (fun r _ => outcomeCDFDistance_nonneg _ _) have hs (a' : ArmSpace) : 0 ≤ ∑ r : LabelSpace J, scoreCDFDistance (σ a' r) (σ' a' r) := Finset.sum_nonneg (fun r _ => scoreCDFDistance_nonneg hOverlap _ _) have htAll : (∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (lam' a r)) ≤ ∑ a' : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a' r) (lam' a' r) := by cases a <;> simp only [Fintype.sum_bool] <;> linarith [ht true, ht false] have hsAll : (∑ r : LabelSpace J, scoreCDFDistance (σ a r) (σ' a r)) ≤ ∑ a' : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a' r) (σ' a' r) := by cases a <;> simp only [Fintype.sum_bool] <;> linarith [hs true, hs false] exact (hArm a upper).trans (mul_le_mul_of_nonneg_left (add_le_add htAll hsAll) hL)
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_abs_le_of_armBounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointAlgebra.lean:241
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEndpointBounds 15 declarations Samplewise bounds and unconditional measurability for projection endpoints.

Samplewise bounds and unconditional measurability for projection endpoints.

The zero pair of cell arrays is a finite compatible reference. Candidate stability against this reference uniformly bounds every admitted arm endpoint, and hence both ATE endpoints, for each fixed external sample.

def projectionZeroReferenceRadius

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
projectionZeroReferenceRadius g α x :
ℝ
(ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) 0) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) 0))
CausalSmith.PartialID.UnlinkedPropensityAte.projectionZeroReferenceRadius · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:22
theorem projectedArmEndpoint_zero

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
a :
upper :
projectedArmEndpoint (J := J) (fun _ : ArmSpace => fun _ : LabelSpace J => (0 : Measure OutcomeSpace)) (fun _ : ArmSpace => fun _ : LabelSpace J => (0 : Measure (ScoreSpace ε))) a upper
= 0
Proof (Lean source)
lemma projectedArmEndpoint_zero {ε : ℝ} {J : ℕ} (a : ArmSpace) (upper : Bool) : projectedArmEndpoint (J := J) (fun _ : ArmSpace => fun _ : LabelSpace J => (0 : Measure OutcomeSpace)) (fun _ : ArmSpace => fun _ : LabelSpace J => (0 : Measure (ScoreSpace ε))) a upper = 0 := by simp [projectedArmEndpoint, Measure.real]
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_zero · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:35
theorem projectionCandidate_armEndpoint_abs_le_zeroReference

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
hb :
a :
upper :
Proof (Lean source)
lemma projectionCandidate_armEndpoint_abs_le_zeroReference {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) (a : ArmSpace) (upper : Bool) : |projectedArmEndpoint b.1 b.2 a upper| ≤ projectionZeroReferenceRadius g α x := by let lam : ArmCellArray J OutcomeSpace := fun _ _ => 0 let σ : ArmCellArray J (ScoreSpace ε) := fun _ _ => 0 have hfinLam : ∀ a r, IsFiniteMeasure (lam a r) := by intro a r dsimp [lam] infer_instance have hfinσ : ∀ a r, IsFiniteMeasure (σ a r) := by intro a r dsimp [σ] infer_instance have hcompat : ProjectionCompatible lam σ := by intro a r simp [lam, σ, Measure.real] have h := projectionCandidate_armEndpoint_abs_le g α hOverlap x b lam σ hb hfinLam hfinσ hcompat a upper rw [show projectedArmEndpoint lam σ a upper = 0 by exact projectedArmEndpoint_zero a upper] at h simpa only [sub_zero, projectionZeroReferenceRadius, lam, σ] using h
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_armEndpoint_abs_le_zeroReference · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:44
theorem projectionCandidate_ATEEndpoints_abs_le_zeroReference

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
hb :
Proof (Lean source)
lemma projectionCandidate_ATEEndpoints_abs_le_zeroReference {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hb : b ∈ projectionCandidates g α x) : |projectedArmEndpoint b.1 b.2 true false - projectedArmEndpoint b.1 b.2 false true| ≤ 2 * projectionZeroReferenceRadius g α x ∧ |projectedArmEndpoint b.1 b.2 true true - projectedArmEndpoint b.1 b.2 false false| ≤ 2 * projectionZeroReferenceRadius g α x := by have hbound (a : ArmSpace) (upper : Bool) := projectionCandidate_armEndpoint_abs_le_zeroReference g α hOverlap x b hb a upper constructor · exact (abs_sub _ _).trans (by linarith [hbound true false, hbound false true]) · exact (abs_sub _ _).trans (by linarith [hbound true true, hbound false false])
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_ATEEndpoints_abs_le_zeroReference · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:73
theorem bddBelow_projectedATEIntervalLower_active

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
Proof (Lean source)
lemma bddBelow_projectedATEIntervalLower_active {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) : BddBelow (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x) := by refine ⟨-2 * projectionZeroReferenceRadius g α x, ?_⟩ intro z hz obtain ⟨b, hb, rfl⟩ := hz rw [mem_activeSievedProjectionCandidates_iff] at hb have hcand : b ∈ projectionCandidates g α x := hb.1.1 have habs := (projectionCandidate_ATEEndpoints_abs_le_zeroReference g α hOverlap x b hcand).1 have hmem : projectedATEIntervalLower b ∈ projectedATEInterval b.1 b.2 := by rw [projectedATEInterval_eq_Icc_endpoints] exact ⟨le_rfl, hb.2⟩ change projectedATEIntervalLower b ∈ Icc (projectedArmEndpoint b.1 b.2 true false - projectedArmEndpoint b.1 b.2 false true) (projectedArmEndpoint b.1 b.2 true true - projectedArmEndpoint b.1 b.2 false false) at hmem linarith [neg_le_of_abs_le habs, hmem.1]
CausalSmith.PartialID.UnlinkedPropensityAte.bddBelow_projectedATEIntervalLower_active · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:93
theorem bddAbove_projectedATEIntervalUpper_active

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
Proof (Lean source)
lemma bddAbove_projectedATEIntervalUpper_active {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) : BddAbove (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x) := by refine ⟨2 * projectionZeroReferenceRadius g α x, ?_⟩ intro z hz obtain ⟨b, hb, rfl⟩ := hz rw [mem_activeSievedProjectionCandidates_iff] at hb have hcand : b ∈ projectionCandidates g α x := hb.1.1 have habs := (projectionCandidate_ATEEndpoints_abs_le_zeroReference g α hOverlap x b hcand).2 have hmem : projectedATEIntervalUpper b ∈ projectedATEInterval b.1 b.2 := by rw [projectedATEInterval_eq_Icc_endpoints] exact ⟨hb.2, le_rfl⟩ change projectedATEIntervalUpper b ∈ Icc (projectedArmEndpoint b.1 b.2 true false - projectedArmEndpoint b.1 b.2 false true) (projectedArmEndpoint b.1 b.2 true true - projectedArmEndpoint b.1 b.2 false false) at hmem linarith [le_abs_self (projectedArmEndpoint b.1 b.2 true true - projectedArmEndpoint b.1 b.2 false false), hmem.2, habs]
CausalSmith.PartialID.UnlinkedPropensityAte.bddAbove_projectedATEIntervalUpper_active · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:117
theorem measurable_projectionActiveLowerInf

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_projectionActiveLowerInf {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) : Measurable (fun x : ExternalSample ε J n m => sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) := measurable_sInf_activeSievedProjectionCandidates hOverlap g hg α (bddBelow_projectedATEIntervalLower_active g α hOverlap)
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionActiveLowerInf · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:142
theorem measurable_projectionActiveUpperSup

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_projectionActiveUpperSup {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) : Measurable (fun x : ExternalSample ε J n m => sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) := measurable_sSup_activeSievedProjectionCandidates hOverlap g hg α (bddAbove_projectedATEIntervalUpper_active g α hOverlap)
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionActiveUpperSup · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:154
def externalProjectionLower

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
externalProjectionLower g α x :
ℝ
by classical exact let A := activeSievedProjectionCandidates g α x let L := sInf (projectedATEIntervalLower '' A) let U := sSup (projectedATEIntervalUpper '' A) if A.Nonempty ∧
max (-1) L ≤ min 1 U then max (-1) L else 0
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionLower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:166
def externalProjectionUpper

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
externalProjectionUpper g α x :
ℝ
by classical exact let A := activeSievedProjectionCandidates g α x let L := sInf (projectedATEIntervalLower '' A) let U := sSup (projectedATEIntervalUpper '' A) if A.Nonempty ∧
max (-1) L ≤ min 1 U then min 1 U else 0
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:178
theorem measurable_externalProjectionLower

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Measurable (externalProjectionLower (n := n) (m := m) g α)
Proof (Lean source)
@[fun_prop] lemma measurable_externalProjectionLower {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) : Measurable (externalProjectionLower (n := n) (m := m) g α) := by classical have hL := measurable_projectionActiveLowerInf (n := n) (m := m) hOverlap g hg α have hU := measurable_projectionActiveUpperSup (n := n) (m := m) hOverlap g hg α have hN := measurableSet_activeSievedProjectionCandidates_nonempty (n := n) (m := m) hOverlap g hg α have hclip : MeasurableSet {x : ExternalSample ε J n m | max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) ≤ min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x))} := measurableSet_le (measurable_const.max hL) (measurable_const.min hU) change Measurable (fun x : ExternalSample ε J n m => if (activeSievedProjectionCandidates g α x).Nonempty ∧ max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) ≤ min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) then max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) else 0) exact (measurable_const.max hL).ite (hN.inter hclip) (measurable_const : Measurable (fun _ : ExternalSample ε J n m => (0 : ℝ)))
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_externalProjectionLower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:190
theorem measurable_externalProjectionUpper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Measurable (externalProjectionUpper (n := n) (m := m) g α)
Proof (Lean source)
@[fun_prop] lemma measurable_externalProjectionUpper {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) : Measurable (externalProjectionUpper (n := n) (m := m) g α) := by classical have hL := measurable_projectionActiveLowerInf (n := n) (m := m) hOverlap g hg α have hU := measurable_projectionActiveUpperSup (n := n) (m := m) hOverlap g hg α have hN := measurableSet_activeSievedProjectionCandidates_nonempty (n := n) (m := m) hOverlap g hg α have hclip : MeasurableSet {x : ExternalSample ε J n m | max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) ≤ min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x))} := measurableSet_le (measurable_const.max hL) (measurable_const.min hU) change Measurable (fun x : ExternalSample ε J n m => if (activeSievedProjectionCandidates g α x).Nonempty ∧ max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) ≤ min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) then min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) else 0) exact (measurable_const.min hU).ite (hN.inter hclip) (measurable_const : Measurable (fun _ : ExternalSample ε J n m => (0 : ℝ)))
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_externalProjectionUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:221
theorem externalProjectionCI_eq_selectedEndpoints

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
x :
Proof (Lean source)
lemma externalProjectionCI_eq_selectedEndpoints {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (x : ExternalSample ε J n m) : sievedTotalizedProjectionCI g α x = Icc (externalProjectionLower g α x) (externalProjectionUpper g α x) := by classical by_cases hA : (activeSievedProjectionCandidates g α x).Nonempty · rw [externalProjectionCI_eq_explicit_endpoints g α x hA (bddBelow_projectedATEIntervalLower_active g α hOverlap x) (bddAbove_projectedATEIntervalUpper_active g α hOverlap x)] simp only [externalProjectionLower, externalProjectionUpper, hA, true_and] split_ifs <;> simp · have hunion : (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2) = ∅ := by ext z constructor · simp only [Set.mem_iUnion] rintro ⟨b, hb, hz⟩ rw [projectedATEInterval_eq_Icc_endpoints] at hz exact hA ⟨b, (mem_activeSievedProjectionCandidates_iff).2 ⟨hb, hz.1.trans hz.2⟩⟩ · intro hz simpa using hz rw [sievedTotalizedProjectionCI] simp only [hunion, convexHull_empty, closure_empty, Set.inter_empty, Set.not_nonempty_empty, and_false, ↓reduceIte] simp [externalProjectionLower, externalProjectionUpper, hA]
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_eq_selectedEndpoints · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:252
def externalProjectionIntervalProcedure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
hg :
externalProjectionIntervalProcedure g α hOverlap hg :
clause 1
clause 2
clause 3
measurable_lo := measurable_externalProjectionLower hOverlap g hg α
clause 4
measurable_hi := measurable_externalProjectionUpper hOverlap g hg α
clause 5
lower_bound := by intro x have hCI := externalProjectionCI_eq_selectedEndpoints g α hOverlap x obtain ⟨z, hz⟩ := externalProjectionCI_nonempty g α x rw [hCI] at hz have hloMem : externalProjectionLower g α x ∈ sievedTotalizedProjectionCI g α x := by rw [hCI] exact ⟨le_rfl, hz.1.trans hz.2⟩ exact (externalProjectionCI_subset_Icc g α x hloMem).1
clause 6
ordered := by intro x have hCI := externalProjectionCI_eq_selectedEndpoints g α hOverlap x obtain ⟨z, hz⟩ := externalProjectionCI_nonempty g α x rw [hCI] at hz exact hz.1.trans hz.2
clause 7
upper_bound := by intro x have hCI := externalProjectionCI_eq_selectedEndpoints g α hOverlap x obtain ⟨z, hz⟩ := externalProjectionCI_nonempty g α x rw [hCI] at hz have hhiMem : externalProjectionUpper g α x ∈ sievedTotalizedProjectionCI g α x := by rw [hCI] exact ⟨hz.1.trans hz.2, le_rfl⟩ exact (externalProjectionCI_subset_Icc g α x hhiMem).2
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:283
theorem externalProjectionIntervalProcedure_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
hOverlap :
hg :
x :
Proof (Lean source)
lemma externalProjectionIntervalProcedure_Icc {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (x : ExternalSample ε J n m) : Icc ((externalProjectionIntervalProcedure g α hOverlap hg).lo x) ((externalProjectionIntervalProcedure g α hOverlap hg).hi x) = sievedTotalizedProjectionCI g α x := by exact (externalProjectionCI_eq_selectedEndpoints g α hOverlap x).symm
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointBounds.lean:319
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEndpointGeometryMeasurable 11 declarations Closed convex hull geometry for unions of real intervals.

Closed convex hull geometry for unions of real intervals.

The main theorem identifies the closed convex hull of a nonempty bounded union of intervals with the interval between the infimum of its active lower endpoints and the supremum of its active upper endpoints. Empty intervals are discarded.

def activeIntervalIndices

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ι :
Type*
I :
Set ι
l u :
ι → ℝ
activeIntervalIndices I l u :
Set ι
{i ∈ I | l i ≤ u i}
def intervalFamilyUnion

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ι :
Type*
I :
Set ι
l u :
ι → ℝ
intervalFamilyUnion I l u :
Set ℝ
⋃ i ∈ I, Icc (l i) (u i)
theorem intervalFamilyUnion_eq_active

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ι :
Type*
I :
Set ι
l u :
ι → ℝ
Proof (Lean source)
lemma intervalFamilyUnion_eq_active {ι : Type*} (I : Set ι) (l u : ι → ℝ) : intervalFamilyUnion I l u = intervalFamilyUnion (activeIntervalIndices I l u) l u := by ext z simp only [intervalFamilyUnion, activeIntervalIndices, Set.mem_iUnion, Set.mem_Icc, Set.mem_sep_iff] constructor · rintro ⟨i, hi, hlz, hzu⟩ exact ⟨i, ⟨hi, hlz.trans hzu⟩, hlz, hzu⟩ · rintro ⟨i, ⟨hi, _⟩, hlz, hzu⟩ exact ⟨i, hi, hlz, hzu⟩
CausalSmith.PartialID.UnlinkedPropensityAte.intervalFamilyUnion_eq_active · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:30
theorem closure_convexHull_intervalFamilyUnion_eq_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ι :
Type*
I :
Set ι
l u :
ι → ℝ
hne :
(activeIntervalIndices I l u).Nonempty
hbelow :
habove :
Proof (Lean source)
lemma closure_convexHull_intervalFamilyUnion_eq_Icc {ι : Type*} (I : Set ι) (l u : ι → ℝ) (hne : (activeIntervalIndices I l u).Nonempty) (hbelow : BddBelow (l '' activeIntervalIndices I l u)) (habove : BddAbove (u '' activeIntervalIndices I l u)) : closure (convexHull ℝ (intervalFamilyUnion I l u)) = Icc (sInf (l '' activeIntervalIndices I l u)) (sSup (u '' activeIntervalIndices I l u)) := by let A := activeIntervalIndices I l u let R := intervalFamilyUnion I l u let L := sInf (l '' A) let U := sSup (u '' A) have hneL : (l '' A).Nonempty := hne.image l have hneU : (u '' A).Nonempty := hne.image u have hRactive : R = intervalFamilyUnion A l u := intervalFamilyUnion_eq_active I l u have hRsub : R ⊆ Icc L U := by rw [hRactive] intro z hz simp only [intervalFamilyUnion, Set.mem_iUnion, Set.mem_Icc] at hz obtain ⟨i, hiA, hlz, hzu⟩ := hz have hli : L ≤ l i := by exact csInf_le hbelow ⟨i, hiA, rfl⟩ have hui : u i ≤ U := by exact le_csSup habove ⟨i, hiA, rfl⟩ exact ⟨hli.trans hlz, hzu.trans hui⟩ have hforward : closure (convexHull ℝ R) ⊆ Icc L U := closure_minimal (convexHull_min hRsub (convex_Icc L U)) isClosed_Icc have hLmem : L ∈ closure (convexHull ℝ R) := by have hLclosure : L ∈ closure (l '' A) := csInf_mem_closure hneL hbelow apply closure_mono _ hLclosure intro z hz obtain ⟨i, hiA, rfl⟩ := hz apply subset_convexHull ℝ rw [hRactive] simp only [intervalFamilyUnion, Set.mem_iUnion, Set.mem_Icc] exact ⟨i, hiA, le_rfl, hiA.2⟩ have hUmem : U ∈ closure (convexHull ℝ R) := by have hUclosure : U ∈ closure (u '' A) := csSup_mem_closure hneU habove apply closure_mono _ hUclosure intro z hz obtain ⟨i, hiA, rfl⟩ := hz apply subset_convexHull ℝ rw [hRactive] simp only [intervalFamilyUnion, Set.mem_iUnion, Set.mem_Icc] exact ⟨i, hiA, hiA.2, le_rfl⟩ have hLU : L ≤ U := by obtain ⟨i, hiA⟩ := hne exact (csInf_le hbelow ⟨i, hiA, rfl⟩).trans (hiA.2.trans (le_csSup habove ⟨i, hiA, rfl⟩)) have hreverse : Icc L U ⊆ closure (convexHull ℝ R) := by rw [← segment_eq_Icc hLU] exact (convex_convexHull ℝ R).closure.segment_subset hLmem hUmem exact Set.Subset.antisymm hforward hreverse
CausalSmith.PartialID.UnlinkedPropensityAte.closure_convexHull_intervalFamilyUnion_eq_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:42
def activeSievedProjectionCandidates

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
activeSievedProjectionCandidates g α x :
CausalSmith.PartialID.UnlinkedPropensityAte.activeSievedProjectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:98
theorem mem_activeSievedProjectionCandidates_iff

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
α :
ℝ
x :
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.mem_activeSievedProjectionCandidates_iff · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:107
theorem closure_convexHull_sievedProjectionIntervals_eq_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.closure_convexHull_sievedProjectionIntervals_eq_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:117
theorem externalProjectionCI_eq_explicit_endpoints

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
hne :
= if max (-1) L ≤ min 1 U then Icc (max (-1) L) (min 1 U) else {0}
Proof (Lean source)
lemma externalProjectionCI_eq_explicit_endpoints {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (hne : (activeSievedProjectionCandidates g α x).Nonempty) (hbelow : BddBelow (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) (habove : BddAbove (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) : let L := sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x) let U := sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x) sievedTotalizedProjectionCI g α x = if max (-1) L ≤ min 1 U then Icc (max (-1) L) (min 1 U) else {0} := by dsimp only have hraw := closure_convexHull_sievedProjectionIntervals_eq_Icc g α x hne hbelow habove have hB : (sievedProjectionCandidates g α x).Nonempty := by obtain ⟨b, hb, _⟩ := hne exact ⟨b, hb⟩ have hclip : Icc (-1 : ℝ) 1 ∩ Icc (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) = Icc (max (-1) (sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x))) (min 1 (sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x))) := by ext z simp only [Set.mem_inter_iff, Set.mem_Icc] constructor · rintro ⟨⟨hzneg, hzone⟩, hzL, hzU⟩ exact ⟨max_le hzneg hzL, le_min hzone hzU⟩ · rintro ⟨hzL, hzU⟩ exact ⟨⟨le_trans (le_max_left _ _) hzL, le_trans hzU (min_le_left _ _)⟩, le_trans (le_max_right _ _) hzL, le_trans hzU (min_le_right _ _)⟩ rw [sievedTotalizedProjectionCI] rw [hraw, hclip] simp only [hB, Set.nonempty_Icc, true_and]
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_eq_explicit_endpoints · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:141
theorem measurableSet_activeSievedProjectionCandidates_nonempty

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Proof (Lean source)
lemma measurableSet_activeSievedProjectionCandidates_nonempty {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) : MeasurableSet {x : ExternalSample ε J n m | (activeSievedProjectionCandidates g α x).Nonempty} := by let S := {b ∈ rationalArraySieve ε J | projectedATEIntervalLower b ≤ projectedATEIntervalUpper b} have hS : S.Countable := (countable_rationalArraySieve ε J).mono (Set.sep_subset _ _) have hmeas : MeasurableSet (⋃ b ∈ S, {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x}) := by exact MeasurableSet.biUnion hS fun b _ => measurableSet_mem_projectionCandidates hOverlap g hg α b have heq : {x : ExternalSample ε J n m | (activeSievedProjectionCandidates g α x).Nonempty} = ⋃ b ∈ S, {x | b ∈ projectionCandidates g α x} := by ext x simp only [Set.mem_ofPred_eq, Set.mem_iUnion, Set.nonempty_def, activeSievedProjectionCandidates, activeIntervalIndices, sievedProjectionCandidates, Set.mem_inter_iff, S] aesop rw [heq] exact hmeas
CausalSmith.PartialID.UnlinkedPropensityAte.measurableSet_activeSievedProjectionCandidates_nonempty · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:190
theorem measurable_sInf_activeSievedProjectionCandidates

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_sInf_activeSievedProjectionCandidates {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) (hbelow : ∀ x : ExternalSample ε J n m, BddBelow (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) : Measurable (fun x : ExternalSample ε J n m => sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) := by apply measurable_of_Iio intro q let N : Set (ExternalSample ε J n m) := {x | (activeSievedProjectionCandidates g α x).Nonempty} let E : Set (ExternalSample ε J n m) := {x | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ projectedATEIntervalLower b < q} have hN : MeasurableSet N := measurableSet_activeSievedProjectionCandidates_nonempty hOverlap g hg α have hE : MeasurableSet E := measurableSet_exists_sievedCandidate_lower_lt hOverlap g hg α q have heq : (fun x : ExternalSample ε J n m => sInf (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x)) ⁻¹' Iio q = (N ∩ E) ∪ (Nᶜ ∩ if 0 < q then univ else ∅) := by ext x by_cases hx : (activeSievedProjectionCandidates g α x).Nonempty · have himage : (projectedATEIntervalLower '' activeSievedProjectionCandidates g α x).Nonempty := hx.image projectedATEIntervalLower rw [Set.mem_preimage, Set.mem_Iio, csInf_lt_iff (hbelow x) himage] constructor · rintro ⟨z, ⟨b, hb, rfl⟩, hlt⟩ apply Set.mem_union_left constructor · exact hx · exact ⟨b, hb.1, hb.2, hlt⟩ · intro hrhs rcases hrhs with hmain | hfallback · obtain ⟨b, hb, hord, hlt⟩ := hmain.2 exact ⟨projectedATEIntervalLower b, ⟨b, ⟨hb, hord⟩, rfl⟩, hlt⟩ · exact False.elim (hfallback.1 hx) · have hempty : projectedATEIntervalLower '' activeSievedProjectionCandidates g α x = ∅ := Set.image_eq_empty.mpr (Set.not_nonempty_iff_eq_empty.mp hx) by_cases hq : 0 < q <;> simp [Set.mem_preimage, hempty, N, E, hx, hq] rw [heq] exact (hN.inter hE).union (hN.compl.inter (by split_ifs <;> measurability))
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_sInf_activeSievedProjectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:217
theorem measurable_sSup_activeSievedProjectionCandidates

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_sSup_activeSievedProjectionCandidates {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) (habove : ∀ x : ExternalSample ε J n m, BddAbove (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) : Measurable (fun x : ExternalSample ε J n m => sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) := by apply measurable_of_Iic intro q let N : Set (ExternalSample ε J n m) := {x | (activeSievedProjectionCandidates g α x).Nonempty} let E : Set (ExternalSample ε J n m) := {x | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ q < projectedATEIntervalUpper b} have hN : MeasurableSet N := measurableSet_activeSievedProjectionCandidates_nonempty hOverlap g hg α have hE : MeasurableSet E := measurableSet_exists_sievedCandidate_lt_upper hOverlap g hg α q have heq : (fun x : ExternalSample ε J n m => sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x)) ⁻¹' Iic q = (N ∩ Eᶜ) ∪ (Nᶜ ∩ if 0 ≤ q then univ else ∅) := by ext x by_cases hx : (activeSievedProjectionCandidates g α x).Nonempty · have himage : (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x).Nonempty := hx.image projectedATEIntervalUpper rw [Set.mem_preimage, Set.mem_Iic] have hnot : sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x) ≤ q ↔ ¬q < sSup (projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x) := not_lt.symm rw [hnot, lt_csSup_iff (habove x) himage] constructor · intro hno apply Set.mem_union_left refine ⟨hx, ?_⟩ intro hE_mem obtain ⟨b, hb, hord, hlt⟩ := hE_mem exact hno ⟨projectedATEIntervalUpper b, ⟨b, ⟨hb, hord⟩, rfl⟩, hlt⟩ · intro hrhs hex obtain ⟨z, ⟨b, hb, rfl⟩, hqz⟩ := hex rcases hrhs with hmain | hfallback · exact hmain.2 ⟨b, hb.1, hb.2, hqz⟩ · exact False.elim (hfallback.1 hx) · have hempty : projectedATEIntervalUpper '' activeSievedProjectionCandidates g α x = ∅ := Set.image_eq_empty.mpr (Set.not_nonempty_iff_eq_empty.mp hx) by_cases hq : 0 ≤ q <;> simp [Set.mem_preimage, hempty, N, E, hx, hq] rw [heq] exact (hN.inter hE.compl).union (hN.compl.inter (by split_ifs <;> measurability))
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_sSup_activeSievedProjectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointGeometryMeasurable.lean:271
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionEndpointMeasurable 12 declarations Measurability infrastructure for the endpoints of the external projection interval.

Measurability infrastructure for the endpoints of the external projection interval.

The rational sieve is countable. This file first proves that admission of each fixed sieve element is a measurable event of the external sample; these are the coordinate facts needed to form measurable countable endpoint envelopes.

theorem measurable_outcomeCDFDistance_empirical

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hμ :
μ univ < ⊤
a :
r :
Proof (Lean source)
@[fun_prop] lemma measurable_outcomeCDFDistance_empirical {J n : ℕ} (μ : Measure OutcomeSpace) (hμ : μ univ < ⊤) (a : ArmSpace) (r : LabelSpace J) : Measurable (fun x : TrialSample n J => outcomeCDFDistance μ (empiricalTrialCells x a r)) := by have hmass : Measurable (fun x : TrialSample n J => |μ.real univ - (empiricalTrialCells x a r).real univ|) := (measurable_const.sub (measurable_empiricalTrialCells_real_apply a r univ MeasurableSet.univ)).abs have hjoint : Measurable (fun p : TrialSample n J × ℝ => |μ.real {y | (y : ℝ) ≤ p.2} - (empiricalTrialCells p.1 a r).real {y | (y : ℝ) ≤ p.2}|) := (((measurable_projectionFiniteCDF μ hμ (fun y : OutcomeSpace => (y : ℝ))).comp measurable_snd).sub (measurable_empiricalTrialCellCDF_joint a r)).abs have hint : Measurable (fun x : TrialSample n J => ∫ t in (0 : ℝ)..1, |μ.real {y | (y : ℝ) ≤ t} - (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t}|) := by rw [show (fun x : TrialSample n J => ∫ t in (0 : ℝ)..1, |μ.real {y | (y : ℝ) ≤ t} - (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t}|) = fun x => ∫ t, |μ.real {y | (y : ℝ) ≤ t} - (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t}| ∂(volume.restrict (Ioc 0 1)) by funext x rw [intervalIntegral.integral_of_le (by norm_num)]] exact (hjoint.stronglyMeasurable.integral_prod_right' (ν := volume.restrict (Ioc 0 1))).measurable exact hmass.add hint
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_outcomeCDFDistance_empirical · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:23
theorem measurable_scoreCDFDistance_empirical

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
σ :
hσ :
σ univ < ⊤
a :
r :
Measurable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance σ (empiricalScoreCells g x a r))
Proof (Lean source)
@[fun_prop] lemma measurable_scoreCDFDistance_empirical {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (σ : Measure (ScoreSpace ε)) (hσ : σ Set.univ < ⊤) (a : ArmSpace) (r : LabelSpace J) : Measurable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance σ (empiricalScoreCells g x a r)) := by have hmassEval : Measurable (fun x : Fin m → ScoreSpace ε => (empiricalScoreCells g x a r).real Set.univ) := by rw [show (fun x : Fin m → ScoreSpace ε => (empiricalScoreCells g x a r).real Set.univ) = scoreCellFrequency g a r Set.univ by funext x exact empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r Set.univ MeasurableSet.univ x] exact measurable_scoreCellFrequency g hg a r Set.univ MeasurableSet.univ have hmass : Measurable (fun x : Fin m → ScoreSpace ε => |σ.real Set.univ - (empiricalScoreCells g x a r).real Set.univ|) := (measurable_const.sub hmassEval).abs have hjoint : Measurable (fun p : (Fin m → ScoreSpace ε) × ℝ => |σ.real {e | (e : ℝ) ≤ p.2} - (empiricalScoreCells g p.1 a r).real {e | (e : ℝ) ≤ p.2}|) := (((measurable_projectionFiniteCDF σ hσ (fun e : ScoreSpace ε => (e : ℝ))).comp measurable_snd).sub (measurable_empiricalScoreCellCDF_joint hOverlap g hg a r)).abs have hε : ε ≤ 1 - ε := by dsimp [Overlap] at hOverlap linarith [hOverlap.2] have hint : Measurable (fun x : Fin m → ScoreSpace ε => ∫ t in ε..(1 - ε), |σ.real {e | (e : ℝ) ≤ t} - (empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t}|) := by rw [show (fun x : Fin m → ScoreSpace ε => ∫ t in ε..(1 - ε), |σ.real {e | (e : ℝ) ≤ t} - (empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t}|) = fun x => ∫ t, |σ.real {e | (e : ℝ) ≤ t} - (empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t}| ∂(volume.restrict (Ioc ε (1 - ε))) by funext x rw [intervalIntegral.integral_of_le hε]] exact (hjoint.stronglyMeasurable.integral_prod_right' (ν := volume.restrict (Ioc ε (1 - ε)))).measurable exact hmass.add hint
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_scoreCDFDistance_empirical · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:58
def projectionTrialDistance

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
x :
projectionTrialDistance b x :
ℝ
∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r)
CausalSmith.PartialID.UnlinkedPropensityAte.projectionTrialDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:105
def projectionScoreDistance

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
x :
projectionScoreDistance g b x :
ℝ
∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r)
CausalSmith.PartialID.UnlinkedPropensityAte.projectionScoreDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:113
theorem measurable_projectionTrialDistance

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hfin :
∀ a r, (b.1 a r) univ < ⊤
Measurable (projectionTrialDistance (n := n) (m := m) b)
Proof (Lean source)
@[fun_prop] lemma measurable_projectionTrialDistance {ε : ℝ} {J n m : ℕ} (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hfin : ∀ a r, (b.1 a r) univ < ⊤) : Measurable (projectionTrialDistance (n := n) (m := m) b) := by unfold projectionTrialDistance apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ exact (measurable_outcomeCDFDistance_empirical (b.1 a r) (hfin a r) a r).comp measurable_fst
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionTrialDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:122
theorem measurable_projectionScoreDistance

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
hfin :
∀ a r, (b.2 a r) univ < ⊤
Measurable (projectionScoreDistance (n := n) (m := m) g b)
Proof (Lean source)
@[fun_prop] lemma measurable_projectionScoreDistance {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hfin : ∀ a r, (b.2 a r) univ < ⊤) : Measurable (projectionScoreDistance (n := n) (m := m) g b) := by unfold projectionScoreDistance apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ exact (measurable_scoreCDFDistance_empirical hOverlap g hg (b.2 a r) (hfin a r) a r).comp measurable_snd
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionScoreDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:136
theorem measurableSet_mem_projectionCandidates

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α :
ℝ
MeasurableSet {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x}
Proof (Lean source)
lemma measurableSet_mem_projectionCandidates {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α : ℝ) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) : MeasurableSet {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x} := by classical by_cases hfin : ∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤ · by_cases hcompat : ProjectionCompatible b.1 b.2 · have htrial : Measurable (projectionTrialDistance (n := n) (m := m) b) := measurable_projectionTrialDistance b (fun a r => (hfin a r).1) have hscore : Measurable (projectionScoreDistance (n := n) (m := m) g b) := measurable_projectionScoreDistance hOverlap g hg b (fun a r => (hfin a r).2) have heq : {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x} = {x | projectionTrialDistance b x ≤ 4 * J / (α * sqrt n)} ∩ {x | projectionScoreDistance g b x ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)} := by ext x simp only [projectionCandidates, Set.mem_ofPred_eq, Set.mem_inter_iff, projectionTrialDistance, projectionScoreDistance] constructor · intro hx exact hx.2.2 · intro hx exact ⟨hfin, hcompat, hx⟩ rw [heq] exact (measurableSet_le htrial measurable_const).inter (measurableSet_le hscore measurable_const) · have heq : {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x} = ∅ := by ext x simp only [projectionCandidates, Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] intro hx exact hcompat hx.2.1 rw [heq] exact MeasurableSet.empty · have heq : {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x} = ∅ := by ext x simp only [projectionCandidates, Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] intro hx exact hfin hx.1 rw [heq] exact MeasurableSet.empty
CausalSmith.PartialID.UnlinkedPropensityAte.measurableSet_mem_projectionCandidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:152
def projectedATEIntervalLower

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
projectedATEIntervalLower b :
ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEIntervalLower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:200
def projectedATEIntervalUpper

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
projectedATEIntervalUpper b :
ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEIntervalUpper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:207
theorem projectedATEInterval_eq_Icc_endpoints

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.projectedATEInterval_eq_Icc_endpoints · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:214
theorem measurableSet_exists_sievedCandidate_lower_lt

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α q :
ℝ
Proof (Lean source)
lemma measurableSet_exists_sievedCandidate_lower_lt {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α q : ℝ) : MeasurableSet {x : ExternalSample ε J n m | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ projectedATEIntervalLower b < q} := by let S := {b ∈ rationalArraySieve ε J | projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ projectedATEIntervalLower b < q} have hS : S.Countable := (countable_rationalArraySieve ε J).mono (Set.sep_subset _ _) have hmeas : MeasurableSet (⋃ b ∈ S, {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x}) := by exact MeasurableSet.biUnion hS fun b _ => measurableSet_mem_projectionCandidates hOverlap g hg α b have heq : {x : ExternalSample ε J n m | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ projectedATEIntervalLower b < q} = ⋃ b ∈ S, {x | b ∈ projectionCandidates g α x} := by ext x simp only [Set.mem_ofPred_eq, Set.mem_iUnion, sievedProjectionCandidates, Set.mem_inter_iff, S] aesop rw [heq] exact hmeas
CausalSmith.PartialID.UnlinkedPropensityAte.measurableSet_exists_sievedCandidate_lower_lt · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:221
theorem measurableSet_exists_sievedCandidate_lt_upper

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
hg :
α q :
ℝ
Proof (Lean source)
lemma measurableSet_exists_sievedCandidate_lt_upper {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (α q : ℝ) : MeasurableSet {x : ExternalSample ε J n m | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ q < projectedATEIntervalUpper b} := by let S := {b ∈ rationalArraySieve ε J | projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ q < projectedATEIntervalUpper b} have hS : S.Countable := (countable_rationalArraySieve ε J).mono (Set.sep_subset _ _) have hmeas : MeasurableSet (⋃ b ∈ S, {x : ExternalSample ε J n m | b ∈ projectionCandidates g α x}) := by exact MeasurableSet.biUnion hS fun b _ => measurableSet_mem_projectionCandidates hOverlap g hg α b have heq : {x : ExternalSample ε J n m | ∃ b ∈ sievedProjectionCandidates g α x, projectedATEIntervalLower b ≤ projectedATEIntervalUpper b ∧ q < projectedATEIntervalUpper b} = ⋃ b ∈ S, {x | b ∈ projectionCandidates g α x} := by ext x simp only [Set.mem_ofPred_eq, Set.mem_iUnion, sievedProjectionCandidates, Set.mem_inter_iff, S] aesop rw [heq] exact hmeas
CausalSmith.PartialID.UnlinkedPropensityAte.measurableSet_exists_sievedCandidate_lt_upper · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionEndpointMeasurable.lean:251
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionGeometry 15 declarations Deterministic geometry of the external projection confidence set.

Deterministic geometry of the external projection confidence set.

The results here use only the clipping, convex-hull, closure, and singleton-fallback operations in sievedTotalizedProjectionCI. They do not impose or derive statistical coverage.

theorem projectionArmProb_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
e :
conclusion 1
ε ≤ armProb a e
conclusion 2
armProb a e ≤ 1
Proof (Lean source)
lemma projectionArmProb_bounds {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (e : ScoreSpace ε) : ε ≤ armProb a e ∧ armProb a e ≤ 1 := by rcases e.property with ⟨he₁, he₂⟩ rcases hOverlap with ⟨hε, hε'⟩ cases a <;> simp only [armProb, Bool.false_eq_true, ↓reduceIte] <;> constructor <;> linarith
CausalSmith.PartialID.UnlinkedPropensityAte.projectionArmProb_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:21
theorem projectionArmProb_diff_abs

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
a :
e e' :
|armProb a e - armProb a e'| = |(e : ℝ) - (e' : ℝ)|
Proof (Lean source)
lemma projectionArmProb_diff_abs {ε : ℝ} (a : ArmSpace) (e e' : ScoreSpace ε) : |armProb a e - armProb a e'| = |(e : ℝ) - (e' : ℝ)| := by cases a · simp only [armProb, Bool.false_eq_true, ↓reduceIte] have h : (1 - (e : ℝ)) - (1 - (e' : ℝ)) = -((e : ℝ) - (e' : ℝ)) := by ring rw [h, abs_neg] · rfl
CausalSmith.PartialID.UnlinkedPropensityAte.projectionArmProb_diff_abs · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:30
theorem projectionInverseArmProb_lipschitz

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
e e' :
|(armProb a e)⁻¹ - (armProb a e')⁻¹| ≤ (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)|
Proof (Lean source)
lemma projectionInverseArmProb_lipschitz {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (e e' : ScoreSpace ε) : |(armProb a e)⁻¹ - (armProb a e')⁻¹| ≤ (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)| := by have hp := (projectionArmProb_bounds hOverlap a e).1 have hq := (projectionArmProb_bounds hOverlap a e').1 have hε : 0 < ε := hOverlap.1 have hpp : 0 < armProb a e := lt_of_lt_of_le hε hp have hqq : 0 < armProb a e' := lt_of_lt_of_le hε hq rw [inv_sub_inv (ne_of_gt hpp) (ne_of_gt hqq), abs_div, abs_mul, abs_of_pos hpp, abs_of_pos hqq] rw [abs_sub_comm, projectionArmProb_diff_abs] have hden : ε ^ 2 ≤ armProb a e * armProb a e' := by nlinarith have hnum : 0 ≤ |(e : ℝ) - (e' : ℝ)| := abs_nonneg _ have hfrac : |(e : ℝ) - (e' : ℝ)| / (armProb a e * armProb a e') ≤ |(e : ℝ) - (e' : ℝ)| / ε ^ 2 := div_le_div_of_nonneg_left hnum (sq_pos_of_pos hε) hden calc |(e : ℝ) - (e' : ℝ)| / (armProb a e * armProb a e') ≤ |(e : ℝ) - (e' : ℝ)| / ε ^ 2 := hfrac _ = (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)| := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.projectionInverseArmProb_lipschitz · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:42
theorem projectionCost_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
e e' :
y y' :
conclusion 1
0 ≤ (y : ℝ) / armProb a e
conclusion 2
(y : ℝ) / armProb a e ≤ ε⁻¹
conclusion 3
|(y : ℝ) / armProb a e - (y' : ℝ) / armProb a e'|
≤ ε⁻¹ * |(y : ℝ) - (y' : ℝ)| + (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)|
Proof (Lean source)
lemma projectionCost_bounds {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (e e' : ScoreSpace ε) (y y' : OutcomeSpace) : 0 ≤ (y : ℝ) / armProb a e ∧ (y : ℝ) / armProb a e ≤ ε⁻¹ ∧ |(y : ℝ) / armProb a e - (y' : ℝ) / armProb a e'| ≤ ε⁻¹ * |(y : ℝ) - (y' : ℝ)| + (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)| := by have hp := (projectionArmProb_bounds hOverlap a e).1 have hq := (projectionArmProb_bounds hOverlap a e').1 have hε : 0 < ε := hOverlap.1 have hpp : 0 < armProb a e := lt_of_lt_of_le hε hp have hqq : 0 < armProb a e' := lt_of_lt_of_le hε hq have hpinv : (armProb a e)⁻¹ ≤ ε⁻¹ := (inv_le_inv₀ hpp hε).2 hp have hdiff := projectionInverseArmProb_lipschitz hOverlap a e e' refine ⟨div_nonneg y.property.1 (le_of_lt hpp), ?_, ?_⟩ · calc (y : ℝ) / armProb a e = (y : ℝ) * (armProb a e)⁻¹ := div_eq_mul_inv _ _ _ ≤ 1 * (armProb a e)⁻¹ := mul_le_mul_of_nonneg_right y.property.2 (le_of_lt (inv_pos.mpr hpp)) _ ≤ ε⁻¹ := by simpa using hpinv · have hrewrite : (y : ℝ) / armProb a e - (y' : ℝ) / armProb a e' = ((y : ℝ) - y') * (armProb a e)⁻¹ + (y' : ℝ) * ((armProb a e)⁻¹ - (armProb a e')⁻¹) := by simp only [div_eq_mul_inv] ring rw [hrewrite] have hfirst : |((y : ℝ) - y') * (armProb a e)⁻¹| ≤ ε⁻¹ * |(y : ℝ) - y'| := by rw [abs_mul, abs_of_pos (inv_pos.mpr hpp)] calc |(y : ℝ) - y'| * (armProb a e)⁻¹ ≤ |(y : ℝ) - y'| * ε⁻¹ := mul_le_mul_of_nonneg_left hpinv (abs_nonneg _) _ = ε⁻¹ * |(y : ℝ) - y'| := mul_comm _ _ have hsecond : |(y' : ℝ) * ((armProb a e)⁻¹ - (armProb a e')⁻¹)| ≤ (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)| := by rw [abs_mul, abs_of_nonneg y'.property.1] calc (y' : ℝ) * |(armProb a e)⁻¹ - (armProb a e')⁻¹| ≤ 1 * |(armProb a e)⁻¹ - (armProb a e')⁻¹| := mul_le_mul_of_nonneg_right y'.property.2 (abs_nonneg _) _ = |(armProb a e)⁻¹ - (armProb a e')⁻¹| := one_mul _ _ ≤ (ε ^ 2)⁻¹ * |(e : ℝ) - (e' : ℝ)| := hdiff exact (abs_add_le _ _).trans (add_le_add hfirst hsecond)
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCost_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:66
theorem closure_convexHull_subset_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
Set ℝ
lo hi :
ℝ
hS :
S ⊆ Icc lo hi
closure (convexHull ℝ S) ⊆ Icc lo hi
Proof (Lean source)
lemma closure_convexHull_subset_Icc {S : Set ℝ} {lo hi : ℝ} (hS : S ⊆ Icc lo hi) : closure (convexHull ℝ S) ⊆ Icc lo hi := closure_minimal (convexHull_min hS (convex_Icc lo hi)) isClosed_Icc
CausalSmith.PartialID.UnlinkedPropensityAte.closure_convexHull_subset_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:112
theorem clippedClosureConvexHull_subset_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
Set ℝ
lo hi :
ℝ
hS :
S ⊆ Icc lo hi
Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ S) ⊆ Icc (max (-1) lo) (min 1 hi)
Proof (Lean source)
lemma clippedClosureConvexHull_subset_Icc {S : Set ℝ} {lo hi : ℝ} (hS : S ⊆ Icc lo hi) : Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ S) ⊆ Icc (max (-1) lo) (min 1 hi) := by intro z hz have hzEnvelope := closure_convexHull_subset_Icc hS hz.2 exact ⟨max_le hz.1.1 hzEnvelope.1, le_min hz.1.2 hzEnvelope.2⟩
CausalSmith.PartialID.UnlinkedPropensityAte.clippedClosureConvexHull_subset_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:118
theorem projection_strictBalls_closure_of_dense Lemma projection_strictBalls_closure_of_dense in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
X :
hD :
f h :
X → ℝ
hf :
hh :
rn rm :
ℝ
x :
X
hfn :
f x < rn
hhm :
h x < rm
x ∈ closure {y : X | y ∈ D ∧ f y ≤ rn ∧ h y ≤ rm}
Proof (Lean source)
lemma projection_strictBalls_closure_of_dense {X : Type*} [TopologicalSpace X] {D : Set X} (hD : Dense D) {f h : X → ℝ} (hf : Continuous f) (hh : Continuous h) {rn rm : ℝ} {x : X} (hfn : f x < rn) (hhm : h x < rm) : x ∈ closure {y : X | y ∈ D ∧ f y ≤ rn ∧ h y ≤ rm} := by let U : Set X := {y | f y < rn ∧ h y < rm} have hU : IsOpen U := (isOpen_lt hf continuous_const).inter (isOpen_lt hh continuous_const) have hxU : x ∈ U := ⟨hfn, hhm⟩ have hsub : U ∩ D ⊆ {y : X | y ∈ D ∧ f y ≤ rn ∧ h y ≤ rm} := by intro y hy exact ⟨hy.2, hy.1.1.le, hy.1.2.le⟩ exact closure_mono hsub (hD.open_subset_closure_inter hU hxU)
CausalSmith.PartialID.UnlinkedPropensityAte.projection_strictBalls_closure_of_dense · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:128
theorem externalProjectionCI_nonempty

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
(sievedTotalizedProjectionCI g α x).Nonempty
Proof (Lean source)
lemma externalProjectionCI_nonempty {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : (sievedTotalizedProjectionCI g α x).Nonempty := by classical rw [sievedTotalizedProjectionCI] split_ifs with h · exact h.2 · exact singleton_nonempty 0
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_nonempty · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:143
theorem externalProjectionCI_subset_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
sievedTotalizedProjectionCI g α x ⊆ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma externalProjectionCI_subset_Icc {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : sievedTotalizedProjectionCI g α x ⊆ Icc (-1 : ℝ) 1 := by classical rw [sievedTotalizedProjectionCI] split_ifs · exact inter_subset_left · simp
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_subset_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:154
theorem isClosed_externalProjectionCI

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
Proof (Lean source)
lemma isClosed_externalProjectionCI {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : IsClosed (sievedTotalizedProjectionCI g α x) := by classical rw [sievedTotalizedProjectionCI] split_ifs · exact isClosed_Icc.inter isClosed_closure · exact isClosed_singleton
CausalSmith.PartialID.UnlinkedPropensityAte.isClosed_externalProjectionCI · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:165
theorem convex_externalProjectionCI

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
Proof (Lean source)
lemma convex_externalProjectionCI {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : Convex ℝ (sievedTotalizedProjectionCI g α x) := by classical rw [sievedTotalizedProjectionCI] split_ifs · exact (convex_Icc (-1 : ℝ) 1).inter (convex_convexHull ℝ _).closure · exact convex_singleton 0
CausalSmith.PartialID.UnlinkedPropensityAte.convex_externalProjectionCI · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:176
theorem externalProjectionCI_eq_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
∃ lo hi : ℝ,
conclusion 1
-1 ≤ lo
conclusion 2
lo ≤ hi
conclusion 3
hi ≤ 1
conclusion 4
sievedTotalizedProjectionCI g α x = Icc lo hi
Proof (Lean source)
lemma externalProjectionCI_eq_Icc {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) : ∃ lo hi : ℝ, -1 ≤ lo ∧ lo ≤ hi ∧ hi ≤ 1 ∧ sievedTotalizedProjectionCI g α x = Icc lo hi := by let S := sievedTotalizedProjectionCI g α x have hne : S.Nonempty := externalProjectionCI_nonempty g α x have hclosed : IsClosed S := isClosed_externalProjectionCI g α x have hconvex : Convex ℝ S := convex_externalProjectionCI g α x have hclip : S ⊆ Icc (-1 : ℝ) 1 := externalProjectionCI_subset_Icc g α x have hbelow : BddBelow S := ⟨-1, fun z hz => (hclip hz).1⟩ have habove : BddAbove S := ⟨1, fun z hz => (hclip hz).2⟩ have hloMem : sInf S ∈ S := hclosed.csInf_mem hne hbelow have hhiMem : sSup S ∈ S := hclosed.csSup_mem hne habove have hconnected : IsConnected S := ⟨hne, hconvex.isPreconnected⟩ refine ⟨sInf S, sSup S, (hclip hloMem).1, ?_, (hclip hhiMem).2, ?_⟩ · exact csInf_le hbelow hhiMem · exact eq_Icc_csInf_csSup_of_connected_bdd_closed hconnected hbelow habove hclosed
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_eq_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:187
theorem externalProjectionCI_excessLength_le_of_envelope Lemma externalProjectionCI_excessLength_le_of_envelope in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
L U δ :
ℝ
hδ :
0 ≤ δ
henv :
sievedTotalizedProjectionCI g α x ⊆ Icc (L - δ) (U + δ)
∃ lo hi : ℝ,
conclusion 1
conclusion 2
max 0 ((hi - lo) - (U - L)) ≤ 2 * δ
Proof (Lean source)
lemma externalProjectionCI_excessLength_le_of_envelope {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) {L U δ : ℝ} (hδ : 0 ≤ δ) (henv : sievedTotalizedProjectionCI g α x ⊆ Icc (L - δ) (U + δ)) : ∃ lo hi : ℝ, sievedTotalizedProjectionCI g α x = Icc lo hi ∧ max 0 ((hi - lo) - (U - L)) ≤ 2 * δ := by obtain ⟨lo, hi, _, hlohi, _, heq⟩ := externalProjectionCI_eq_Icc g α x have hlo : L - δ ≤ lo := (henv (heq ▸ Set.left_mem_Icc.mpr hlohi)).1 have hhi : hi ≤ U + δ := (henv (heq ▸ Set.right_mem_Icc.mpr hlohi)).2 refine ⟨lo, hi, heq, ?_⟩ apply max_le (by linarith) linarith
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_excessLength_le_of_envelope · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:209
theorem externalProjectionCI_subset_envelope_of_candidates Lemma externalProjectionCI_subset_envelope_of_candidates in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
L U :
ℝ
hB :
(sievedProjectionCandidates g α x).Nonempty
hC :
(Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty
hEach :
∀ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2 ⊆ Icc L U
sievedTotalizedProjectionCI g α x ⊆ Icc (max (-1) L) (min 1 U)
Proof (Lean source)
lemma externalProjectionCI_subset_envelope_of_candidates {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) {L U : ℝ} (hB : (sievedProjectionCandidates g α x).Nonempty) (hC : (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty) (hEach : ∀ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2 ⊆ Icc L U) : sievedTotalizedProjectionCI g α x ⊆ Icc (max (-1) L) (min 1 U) := by have hUnion : (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2) ⊆ Icc L U := by intro z hz rcases Set.mem_iUnion.mp hz with ⟨b, hz⟩ rcases Set.mem_iUnion.mp hz with ⟨hb, hz⟩ exact hEach b hb hz unfold sievedTotalizedProjectionCI dsimp rw [if_pos ⟨hB, hC⟩] exact clippedClosureConvexHull_subset_Icc hUnion
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_subset_envelope_of_candidates · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:225
theorem externalProjectionCI_excessLength_le_of_candidate_envelopes Lemma externalProjectionCI_excessLength_le_of_candidate_envelopes in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
x :
L U δ :
ℝ
hLU :
L ≤ U
hδ :
0 ≤ δ
hclip :
(sievedProjectionCandidates g α x).Nonempty → (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty
hEach :
∀ b ∈ sievedProjectionCandidates g α x,
projectedATEInterval b.1 b.2 ⊆ Icc (L - δ) (U + δ)
∃ lo hi : ℝ,
conclusion 1
conclusion 2
max 0 ((hi - lo) - (U - L)) ≤ 2 * δ
Proof (Lean source)
lemma externalProjectionCI_excessLength_le_of_candidate_envelopes {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) {L U δ : ℝ} (hLU : L ≤ U) (hδ : 0 ≤ δ) (hclip : (sievedProjectionCandidates g α x).Nonempty → (Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2))).Nonempty) (hEach : ∀ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2 ⊆ Icc (L - δ) (U + δ)) : ∃ lo hi : ℝ, sievedTotalizedProjectionCI g α x = Icc lo hi ∧ max 0 ((hi - lo) - (U - L)) ≤ 2 * δ := by classical by_cases hB : (sievedProjectionCandidates g α x).Nonempty · have henv := externalProjectionCI_subset_envelope_of_candidates g α x hB (hclip hB) hEach have henv' : sievedTotalizedProjectionCI g α x ⊆ Icc (L - δ) (U + δ) := by intro z hz have hz' := henv hz exact ⟨le_trans (le_max_right _ _) hz'.1, le_trans hz'.2 (min_le_right _ _)⟩ exact externalProjectionCI_excessLength_le_of_envelope g α x hδ henv' · have heq : sievedTotalizedProjectionCI g α x = {0} := by unfold sievedTotalizedProjectionCI simp [hB] refine ⟨0, 0, ?_, ?_⟩ · simpa only [Set.Icc_self] using heq · simp only [sub_self, zero_sub] apply max_le (by linarith) (by linarith)
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionCI_excessLength_le_of_candidate_envelopes · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionGeometry.lean:250
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionInference 9 declarations Probability bounds for the two empirical distances in the external projection.

Probability bounds for the two empirical distances in the external projection.

theorem externalNormalizer_mul_rootSum Lemma externalNormalizer_mul_rootSum in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
n m :
ℕ
hn :
0 < n
hm :
0 < m
externalNormalizer n m * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) = 1
Proof (Lean source)
lemma externalNormalizer_mul_rootSum (n m : ℕ) (hn : 0 < n) (hm : 0 < m) : externalNormalizer n m * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) = 1 := by have hsn : 0 < sqrt (n : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hn) have hsm : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (Nat.cast_pos.mpr hm) unfold externalNormalizer field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizer_mul_rootSum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:14
theorem externalNormalizedRisk_le_of_rootSum_bound

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α C :
ℝ
hn :
0 < n
hm :
0 < m
hR :
externalExcessRisk g Qj α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)
Proof (Lean source)
lemma externalNormalizedRisk_le_of_rootSum_bound {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (α C : ℝ) (hn : 0 < n) (hm : 0 < m) (hR : externalExcessRisk g Qj α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)) : externalNormalizedRisk g Qj α ≤ C := by have hnorm : 0 ≤ externalNormalizer n m := by unfold externalNormalizer positivity unfold externalNormalizedRisk calc externalNormalizer n m * externalExcessRisk g Qj α ≤ externalNormalizer n m * (C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)) := mul_le_mul_of_nonneg_left hR hnorm _ = C := by rw [mul_left_comm, externalNormalizer_mul_rootSum n m hn hm, mul_one]
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizedRisk_le_of_rootSum_bound · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:27
theorem externalJointLaw_eq_experiment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
Qj PH.1 PH.2 = externalExperiment n m PH.1 PH.2
Proof (Lean source)
lemma externalJointLaw_eq_experiment {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) : Qj PH.1 PH.2 = externalExperiment n m PH.1 PH.2 := by rw [hInd PH hPH, hTrial PH hPH, hLog PH hPH] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.externalJointLaw_eq_experiment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:50
theorem externalJointTrial_integral_eq_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
PH :
hPH :
PH ∈ ExternalLaws g
F :
TrialSample n J → ℝ
hF :
∫ x, F x.1 ∂Qj PH.1 PH.2 = ∫ x, F x ∂Measure.pi (fun _ : Fin n => releasedLaw PH.1)
Proof (Lean source)
lemma externalJointTrial_integral_eq_pi {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (F : TrialSample n J → ℝ) (hF : Measurable F) : ∫ x, F x.1 ∂Qj PH.1 PH.2 = ∫ x, F x ∂Measure.pi (fun _ : Fin n => releasedLaw PH.1) := by rw [← integral_map measurable_fst.aemeasurable hF.aestronglyMeasurable, hTrial PH hPH]
CausalSmith.PartialID.UnlinkedPropensityAte.externalJointTrial_integral_eq_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:64
theorem externalJointLog_integral_eq_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
F :
(Fin m → ScoreSpace ε) → ℝ
hF :
∫ x, F x.2 ∂Qj PH.1 PH.2 = ∫ x, F x ∂Measure.pi (fun _ : Fin m => PH.2)
Proof (Lean source)
lemma externalJointLog_integral_eq_pi {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hLog : ExternalLogIID g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (F : (Fin m → ScoreSpace ε) → ℝ) (hF : Measurable F) : ∫ x, F x.2 ∂Qj PH.1 PH.2 = ∫ x, F x ∂Measure.pi (fun _ : Fin m => PH.2) := by rw [← integral_map measurable_snd.aemeasurable hF.aestronglyMeasurable, hLog PH hPH]
CausalSmith.PartialID.UnlinkedPropensityAte.externalJointLog_integral_eq_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:79
theorem externalJointTrial_meanDistance_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
PH :
hPH :
PH ∈ ExternalLaws g
hn :
0 < n
hMeas :
hInt :
∀ a r,
Integrable (fun x : TrialSample n J => outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells (releasedLaw PH.1) a r)) (Measure.pi (fun _ : Fin n => releasedLaw PH.1))
(∫ x, (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) ∂Qj PH.1 PH.2)
≤ 2 * J / sqrt n
Proof (Lean source)
lemma externalJointTrial_meanDistance_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (hn : 0 < n) (hMeas : Measurable (fun x : TrialSample n J => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells (releasedLaw PH.1) a r))) (hInt : ∀ a r, Integrable (fun x : TrialSample n J => outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells (releasedLaw PH.1) a r)) (Measure.pi (fun _ : Fin n => releasedLaw PH.1))) : (∫ x, (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) ∂Qj PH.1 PH.2) ≤ 2 * J / sqrt n := by haveI : IsProbabilityMeasure (releasedLaw PH.1) := by unfold releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.1 _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable rw [externalJointTrial_integral_eq_pi g Qj hTrial PH hPH _ hMeas] rw [integral_finsetSum] · calc _ = ∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : TrialSample n J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells (releasedLaw PH.1) a r) ∂Measure.pi (fun _ : Fin n => releasedLaw PH.1) := by apply Finset.sum_congr rfl intro a _ rw [integral_finsetSum] intro r _ exact hInt a r _ ≤ _ := sum_meanOutcomeCDFDistance_trialPopulationCells_pi (releasedLaw PH.1) hn · intro a _ exact integrable_finsetSum _ (fun r _ => hInt a r)
CausalSmith.PartialID.UnlinkedPropensityAte.externalJointTrial_meanDistance_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:94
theorem externalJointLog_meanDistance_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
hm :
0 < m
hMeas :
Measurable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells PH.2 g a r))
hInt :
∀ a r,
Integrable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells PH.2 g a r)) (Measure.pi (fun _ : Fin m => PH.2))
(∫ x, (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r)) ∂Qj PH.1 PH.2)
≤ J * (2 - 2 * ε) / sqrt m
Proof (Lean source)
lemma externalJointLog_meanDistance_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hLog : ExternalLogIID g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (hm : 0 < m) (hMeas : Measurable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells PH.2 g a r))) (hInt : ∀ a r, Integrable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells PH.2 g a r)) (Measure.pi (fun _ : Fin m => PH.2))) : (∫ x, (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r)) ∂Qj PH.1 PH.2) ≤ J * (2 - 2 * ε) / sqrt m := by have : IsProbabilityMeasure PH.2 := hPH.2.1 rw [externalJointLog_integral_eq_pi g Qj hLog PH hPH _ hMeas] rw [integral_finsetSum] · calc _ = ∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : Fin m → ScoreSpace ε, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells PH.2 g a r) ∂Measure.pi (fun _ : Fin m => PH.2) := by apply Finset.sum_congr rfl intro a _ rw [integral_finsetSum] intro r _ exact hInt a r _ ≤ _ := sum_meanScoreCDFDistance_scorePopulationCells_pi hPH.2.2.overlap PH.2 g hPH.2.2.measurableRelease hm · intro a _ exact integrable_finsetSum _ (fun r _ => hInt a r)
CausalSmith.PartialID.UnlinkedPropensityAte.externalJointLog_meanDistance_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:138
theorem projection_twoSource_strictBall_probability Lemma projection_twoSource_strictBall_probability in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Ω :
F G :
Ω → ℝ
hFm :
hGm :
hF :
hG :
hFnonneg :
∀ᵐ x ∂μ, 0 ≤ F x
hGnonneg :
∀ᵐ x ∂μ, 0 ≤ G x
α rn rm :
ℝ
hrn :
0 < rn
hrm :
0 < rm
hFmean :
∫ x, F x ∂μ ≤ α * rn / 2
hGmean :
∫ x, G x ∂μ ≤ α * rm / 2
1 - α ≤ μ.real {x | F x < rn ∧ G x < rm}
Proof (Lean source)
lemma projection_twoSource_strictBall_probability {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (F G : Ω → ℝ) (hFm : Measurable F) (hGm : Measurable G) (hF : Integrable F μ) (hG : Integrable G μ) (hFnonneg : ∀ᵐ x ∂μ, 0 ≤ F x) (hGnonneg : ∀ᵐ x ∂μ, 0 ≤ G x) (α rn rm : ℝ) (hrn : 0 < rn) (hrm : 0 < rm) (hFmean : ∫ x, F x ∂μ ≤ α * rn / 2) (hGmean : ∫ x, G x ∂μ ≤ α * rm / 2) : 1 - α ≤ μ.real {x | F x < rn ∧ G x < rm} := by have htailF := mul_meas_ge_le_integral_of_nonneg hFnonneg hF rn have htailG := mul_meas_ge_le_integral_of_nonneg hGnonneg hG rm have hFsmall : μ.real {x | rn ≤ F x} ≤ α / 2 := by calc _ ≤ (α * rn / 2) / rn := (le_div_iff₀ hrn).2 (by nlinarith [htailF, hFmean]) _ = α / 2 := by field_simp have hGsmall : μ.real {x | rm ≤ G x} ≤ α / 2 := by calc _ ≤ (α * rm / 2) / rm := (le_div_iff₀ hrm).2 (by nlinarith [htailG, hGmean]) _ = α / 2 := by field_simp have hbad : μ.real ({x | rn ≤ F x} ∪ {x | rm ≤ G x}) ≤ α := by calc _ ≤ μ.real {x | rn ≤ F x} + μ.real {x | rm ≤ G x} := measureReal_union_le _ _ _ ≤ α := by linarith have hevent : {x | F x < rn ∧ G x < rm} = ({x | rn ≤ F x} ∪ {x | rm ≤ G x})ᶜ := by ext x simp only [mem_ofPred_eq, mem_compl_iff, mem_union] push Not rfl rw [hevent, probReal_compl_eq_one_sub] · linarith · exact (measurableSet_le measurable_const hFm).union (measurableSet_le measurable_const hGm)
CausalSmith.PartialID.UnlinkedPropensityAte.projection_twoSource_strictBall_probability · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:178
theorem projection_strictBall_probability_at_paper_radii Lemma projection_strictBall_probability_at_paper_radii in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Ω :
F G :
Ω → ℝ
hFm :
hGm :
hF :
hG :
hFnonneg :
∀ᵐ x ∂μ, 0 ≤ F x
hGnonneg :
∀ᵐ x ∂μ, 0 ≤ G x
J n m :
ℕ
hJ :
0 < J
hn :
0 < n
hm :
0 < m
α ε :
ℝ
hα :
0 < α
hε :
ε < 1 / 2
hFmean :
∫ x, F x ∂μ ≤ 2 * J / sqrt n
hGmean :
∫ x, G x ∂μ ≤ J * (2 - 2 * ε) / sqrt m
1 - α
≤ μ.real {x | F x < 4 * J / (α * sqrt n) ∧ G x < 2 * J * (2 - 2 * ε) / (α * sqrt m)}
Proof (Lean source)
lemma projection_strictBall_probability_at_paper_radii {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (F G : Ω → ℝ) (hFm : Measurable F) (hGm : Measurable G) (hF : Integrable F μ) (hG : Integrable G μ) (hFnonneg : ∀ᵐ x ∂μ, 0 ≤ F x) (hGnonneg : ∀ᵐ x ∂μ, 0 ≤ G x) (J n m : ℕ) (hJ : 0 < J) (hn : 0 < n) (hm : 0 < m) (α ε : ℝ) (hα : 0 < α) (hε : ε < 1 / 2) (hFmean : ∫ x, F x ∂μ ≤ 2 * J / sqrt n) (hGmean : ∫ x, G x ∂μ ≤ J * (2 - 2 * ε) / sqrt m) : 1 - α ≤ μ.real {x | F x < 4 * J / (α * sqrt n) ∧ G x < 2 * J * (2 - 2 * ε) / (α * sqrt m)} := by have hsn : 0 < sqrt (n : ℝ) := Real.sqrt_pos.2 (by exact_mod_cast hn) have hsm : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 (by exact_mod_cast hm) have hJ' : (0 : ℝ) < J := by exact_mod_cast hJ have hw : 0 < 2 - 2 * ε := by linarith have hrn : 0 < 4 * J / (α * sqrt n) := by positivity have hrm : 0 < 2 * J * (2 - 2 * ε) / (α * sqrt m) := by positivity apply projection_twoSource_strictBall_probability μ F G hFm hGm hF hG hFnonneg hGnonneg α _ _ hrn hrm · convert hFmean using 1 <;> field_simp <;> norm_num · convert hGmean using 1 <;> field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.projection_strictBall_probability_at_paper_radii · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionInference.lean:215
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionIntegrated 14 declarations Integration of pointwise empirical CDF bounds over a compact support.

Integration of pointwise empirical CDF bounds over a compact support.

theorem measurable_projectionFiniteCDF Lemma measurable_projectionFiniteCDF in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
X :
ν :
hν :
ν univ < ⊤
v :
X → ℝ
Measurable (fun t : ℝ => ν.real {x | v x ≤ t})
Proof (Lean source)
lemma measurable_projectionFiniteCDF {X : Type*} [MeasurableSpace X] (ν : Measure X) (hν : ν univ < ⊤) (v : X → ℝ) : Measurable (fun t : ℝ => ν.real {x | v x ≤ t}) := by apply Monotone.measurable intro s t hst apply ENNReal.toReal_mono · exact ne_of_lt (lt_of_le_of_lt (measure_mono (by intro x hx exact trivial)) hν) · exact measure_mono (by intro x hx exact le_trans hx hst)
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_projectionFiniteCDF · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:15
theorem measurable_empiricalTrialCellCDF_joint

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
a :
r :
Measurable (fun p : TrialSample n J × ℝ => (empiricalTrialCells p.1 a r).real {y | (y : ℝ) ≤ p.2})
Proof (Lean source)
lemma measurable_empiricalTrialCellCDF_joint {J n : ℕ} (a : ArmSpace) (r : LabelSpace J) : Measurable (fun p : TrialSample n J × ℝ => (empiricalTrialCells p.1 a r).real {y | (y : ℝ) ≤ p.2}) := by classical have heq : (fun p : TrialSample n J × ℝ => (empiricalTrialCells p.1 a r).real {y | (y : ℝ) ≤ p.2}) = fun p => (n : ℝ)⁻¹ * ∑ i : Fin n, if (p.1 i).1 = r ∧ (p.1 i).2.1 = a ∧ ((p.1 i).2.2 : ℝ) ≤ p.2 then (1 : ℝ) else 0 := by funext p rw [empiricalTrialCells_real_apply a r _ (measurableSet_le (by fun_prop) measurable_const)] rfl rw [heq] apply Measurable.const_mul apply Finset.measurable_sum intro i _ apply Measurable.ite · have hi : Measurable (fun p : TrialSample n J × ℝ => p.1 i) := (measurable_pi_apply i).comp measurable_fst simpa only [Set.ofPred_and, Set.inter_assoc, Function.comp_apply] using ((measurableSet_eq_fun hi.fst (measurable_const : Measurable (fun _ : TrialSample n J × ℝ => r))).inter (measurableSet_eq_fun hi.snd.fst (measurable_const : Measurable (fun _ : TrialSample n J × ℝ => a)))).inter (measurableSet_le (measurable_subtype_coe.comp hi.snd.snd) measurable_snd) · exact measurable_const · exact measurable_const
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_empiricalTrialCellCDF_joint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:30
theorem measurable_trialPopulationCellCDF

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Measurable (fun t : ℝ => μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t})
Proof (Lean source)
lemma measurable_trialPopulationCellCDF {J : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (a : ArmSpace) (r : LabelSpace J) : Measurable (fun t : ℝ => μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}) := by let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a} have hC : MeasurableSet C := by exact (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_snd.fst) measurable_const) have hfin : (μ.restrict C) univ < ⊤ := by simp have h := measurable_projectionFiniteCDF (μ.restrict C) hfin (fun z : Observation J => (z.2.2 : ℝ)) convert h using 1 funext t unfold Measure.real have hB : MeasurableSet {x : Observation J | (x.2.2 : ℝ) ≤ t} := measurableSet_le (measurable_subtype_coe.comp measurable_snd.snd) measurable_const rw [Measure.restrict_apply hB] have hset : {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t} = {x | (x.2.2 : ℝ) ≤ t} ∩ C := by ext z change (z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t) ↔ ((z.2.2 : ℝ) ≤ t ∧ z.1 = r ∧ z.2.1 = a) tauto rw [hset]
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_trialPopulationCellCDF · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:62
theorem empiricalTrialCellCDF_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
x :
t :
ℝ
(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma empiricalTrialCellCDF_mem_Icc {J n : ℕ} (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) (x : TrialSample n J) (t : ℝ) : (empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} ∈ Icc (0 : ℝ) 1 := by rw [empiricalTrialCells_real_apply a r _ (measurableSet_le (by fun_prop) measurable_const)] unfold trialCellFrequency have hterm (i : Fin n) : (if (x i).1 = r ∧ (x i).2.1 = a ∧ ((x i).2.2 : ℝ) ≤ t then (1 : ℝ) else 0) ∈ Icc (0 : ℝ) 1 := by split_ifs <;> norm_num have hs0 : 0 ≤ ∑ i : Fin n, (if (x i).1 = r ∧ (x i).2.1 = a ∧ ((x i).2.2 : ℝ) ≤ t then (1 : ℝ) else 0) := Finset.sum_nonneg (fun i _ => (hterm i).1) have hs1 : (∑ i : Fin n, (if (x i).1 = r ∧ (x i).2.1 = a ∧ ((x i).2.2 : ℝ) ≤ t then (1 : ℝ) else 0)) ≤ n := by calc _ ≤ ∑ _i : Fin n, (1 : ℝ) := Finset.sum_le_sum (fun i _ => (hterm i).2) _ = n := by simp have hn' : (0 : ℝ) < n := Nat.cast_pos.mpr hn constructor · exact mul_nonneg (inv_nonneg.mpr (le_of_lt hn')) hs0 · exact (inv_mul_le_iff₀ hn').mpr (by simpa [mul_comm] using hs1)
CausalSmith.PartialID.UnlinkedPropensityAte.empiricalTrialCellCDF_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:91
theorem trialPopulationCellCDF_mem_Icc

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
a :
r :
t :
ℝ
μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t} ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma trialPopulationCellCDF_mem_Icc {J : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (a : ArmSpace) (r : LabelSpace J) (t : ℝ) : μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t} ∈ Icc (0 : ℝ) 1 := by constructor · exact ENNReal.toReal_nonneg · unfold Measure.real have hm := measure_mono (μ := μ) (Set.subset_univ {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}) have hfin : μ univ ≠ ⊤ := by simp have := ENNReal.toReal_mono hfin hm simpa [isProbabilityMeasure_iff_real.mp inferInstance] using this
CausalSmith.PartialID.UnlinkedPropensityAte.trialPopulationCellCDF_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:118
theorem integrable_empiricalTrialCellCDF_joint

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
Integrable (uncurry (fun (x : TrialSample n J) (t : ℝ) => |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|)) ((Measure.pi fun _ : Fin n => μ).prod (volume.restrict (Ioc 0 1)))
Proof (Lean source)
lemma integrable_empiricalTrialCellCDF_joint {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) : Integrable (uncurry (fun (x : TrialSample n J) (t : ℝ) => |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|)) ((Measure.pi fun _ : Fin n => μ).prod (volume.restrict (Ioc 0 1))) := by have hm : Measurable (uncurry (fun (x : TrialSample n J) (t : ℝ) => |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|)) := (measurable_empiricalTrialCellCDF_joint a r |>.sub ((measurable_trialPopulationCellCDF μ a r).comp measurable_snd)).abs apply Integrable.of_bound hm.aestronglyMeasurable 1 apply Filter.Eventually.of_forall rintro ⟨x, t⟩ have hx := empiricalTrialCellCDF_mem_Icc hn a r x t have hp := trialPopulationCellCDF_mem_Icc μ a r t dsimp rw [abs_abs] apply abs_le.mpr constructor <;> linarith [hx.1, hx.2, hp.1, hp.2]
CausalSmith.PartialID.UnlinkedPropensityAte.integrable_empiricalTrialCellCDF_joint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:134
theorem projectionExpectedIntegratedError_le Lemma projectionExpectedIntegratedError_le in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Ω :
μ :
a b c :
ℝ
hab :
a ≤ b
F :
Ω → ℝ → ℝ
hF :
Integrable (uncurry F) (μ.prod (volume.restrict (Ioc a b)))
hpoint :
∀ t ∈ Ioc a b, ∫ x, F x t ∂μ ≤ c
∫ x, (∫ t in a..b, F x t) ∂μ ≤ (b - a) * c
Proof (Lean source)
lemma projectionExpectedIntegratedError_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [SFinite μ] (a b c : ℝ) (hab : a ≤ b) (F : Ω → ℝ → ℝ) (hF : Integrable (uncurry F) (μ.prod (volume.restrict (Ioc a b)))) (hpoint : ∀ t ∈ Ioc a b, ∫ x, F x t ∂μ ≤ c) : ∫ x, (∫ t in a..b, F x t) ∂μ ≤ (b - a) * c := by simp_rw [intervalIntegral.integral_of_le hab] have hswap := MeasureTheory.integral_integral_swap hF rw [hswap] have hconst : Integrable (fun _ : ℝ => c) (volume.restrict (Ioc a b)) := integrable_const _ have hright : (∫ t in Ioc a b, (∫ x, F x t ∂μ)) ≤ ∫ t in Ioc a b, c := by apply integral_mono_ae · exact hF.integral_prod_right · exact hconst · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht exact hpoint t ht calc (∫ t in Ioc a b, ∫ x, F x t ∂μ) ≤ ∫ t in Ioc a b, c := hright _ = (b - a) * c := by rw [← intervalIntegral.integral_of_le hab, intervalIntegral.integral_const] simp
CausalSmith.PartialID.UnlinkedPropensityAte.projectionExpectedIntegratedError_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:160
theorem meanIntegratedAbs_empiricalTrialCellCDF_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
∫ x, (∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) ∂Measure.pi (fun _ : Fin n => μ)
≤ 1 / (2 * sqrt n)
Proof (Lean source)
lemma meanIntegratedAbs_empiricalTrialCellCDF_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) : ∫ x, (∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) ∂Measure.pi (fun _ : Fin n => μ) ≤ 1 / (2 * sqrt n) := by have hpoint (t : ℝ) (_ht : t ∈ Ioc (0 : ℝ) 1) : ∫ x, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}| ∂Measure.pi (fun _ : Fin n => μ) ≤ 1 / (2 * sqrt n) := by have hB : MeasurableSet {y : OutcomeSpace | (y : ℝ) ≤ t} := measurableSet_le (by fun_prop) measurable_const simpa only [empiricalTrialCells_real_apply a r _ hB, Set.mem_ofPred_eq] using meanAbs_trialCellFrequency_pi μ hn a r _ hB have h := projectionExpectedIntegratedError_le (Measure.pi fun _ : Fin n => μ) 0 1 (1 / (2 * sqrt n)) (by norm_num) _ (integrable_empiricalTrialCellCDF_joint μ hn a r) hpoint simpa using h
CausalSmith.PartialID.UnlinkedPropensityAte.meanIntegratedAbs_empiricalTrialCellCDF_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:186
theorem measurable_empiricalScoreCellCDF_joint

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
a :
r :
Measurable (fun p : (Fin m → ScoreSpace ε) × ℝ => (empiricalScoreCells g p.1 a r).real {e | (e : ℝ) ≤ p.2})
Proof (Lean source)
lemma measurable_empiricalScoreCellCDF_joint {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) : Measurable (fun p : (Fin m → ScoreSpace ε) × ℝ => (empiricalScoreCells g p.1 a r).real {e | (e : ℝ) ≤ p.2}) := by classical have heq : (fun p : (Fin m → ScoreSpace ε) × ℝ => (empiricalScoreCells g p.1 a r).real {e | (e : ℝ) ≤ p.2}) = fun p => (m : ℝ)⁻¹ * ∑ j : Fin m, if g (p.1 j) = r ∧ ((p.1 j : ScoreSpace ε) : ℝ) ≤ p.2 then armProb a (p.1 j) else 0 := by funext p rw [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r _ (measurableSet_le (by fun_prop) measurable_const)] unfold scoreCellFrequency congr 1 apply Finset.sum_congr rfl intro j _ by_cases hj : g (p.1 j) = r ∧ ((p.1 j : ScoreSpace ε) : ℝ) ≤ p.2 · simp [indicator, hj] · simp [indicator, hj] rw [heq] apply Measurable.const_mul apply Finset.measurable_sum intro j _ have hj : Measurable (fun p : (Fin m → ScoreSpace ε) × ℝ => p.1 j) := (measurable_pi_apply j).comp measurable_fst have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop apply Measurable.ite · exact (measurableSet_eq_fun (hg.comp hj) measurable_const).inter (measurableSet_le (measurable_subtype_coe.comp hj) measurable_snd) · exact hp.comp hj · exact measurable_const
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_empiricalScoreCellCDF_joint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:208
theorem measurable_scorePopulationCellCDF

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
hg :
a :
r :
Measurable (fun t : ℝ => ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H)
Proof (Lean source)
lemma measurable_scorePopulationCellCDF {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) : Measurable (fun t : ℝ => ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H) := by have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable (fun p : ℝ × ScoreSpace ε => {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ p.1}.indicator (armProb a) p.2) := by apply Measurable.indicator · exact hp.comp measurable_snd · exact (measurableSet_eq_fun (hg.comp measurable_snd) measurable_const).inter (measurableSet_le (measurable_subtype_coe.comp measurable_snd) measurable_fst) exact (hF.stronglyMeasurable.integral_prod_right' (ν := H)).measurable
CausalSmith.PartialID.UnlinkedPropensityAte.measurable_scorePopulationCellCDF · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:246
theorem integrable_empiricalScoreCellCDF_joint

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
Integrable (uncurry (fun (x : Fin m → ScoreSpace ε) (t : ℝ) => |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|)) ((Measure.pi fun _ : Fin m => H).prod (volume.restrict (Ioc ε (1 - ε))))
Proof (Lean source)
lemma integrable_empiricalScoreCellCDF_joint {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) : Integrable (uncurry (fun (x : Fin m → ScoreSpace ε) (t : ℝ) => |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|)) ((Measure.pi fun _ : Fin m => H).prod (volume.restrict (Ioc ε (1 - ε)))) := by have hmeas : Measurable (uncurry (fun (x : Fin m → ScoreSpace ε) (t : ℝ) => |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|)) := (measurable_empiricalScoreCellCDF_joint hOverlap g hg a r |>.sub ((measurable_scorePopulationCellCDF H g hg a r).comp measurable_snd)).abs apply Integrable.of_bound hmeas.aestronglyMeasurable 2 apply Filter.Eventually.of_forall rintro ⟨x, t⟩ have hB : MeasurableSet {e : ScoreSpace ε | (e : ℝ) ≤ t} := measurableSet_le (by fun_prop) measurable_const dsimp rw [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r _ hB] have hp : ∀ e : ScoreSpace ε, 0 ≤ armProb a e ∧ armProb a e ≤ 1 := by intro e exact ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩ have hpop : 0 ≤ ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H := by apply integral_nonneg intro e by_cases he : g e = r ∧ (e : ℝ) ≤ t <;> simp [indicator, he, (hp e).1] have hpop1 : (∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H) ≤ 1 := by calc _ ≤ ∫ _e : ScoreSpace ε, (1 : ℝ) ∂H := by apply integral_mono_of_nonneg · exact Filter.Eventually.of_forall (fun e => by by_cases he : g e = r ∧ (e : ℝ) ≤ t <;> simp [indicator, he, (hp e).1]) · exact integrable_const _ · exact Filter.Eventually.of_forall (fun e => by by_cases he : g e = r ∧ (e : ℝ) ≤ t <;> simp [indicator, he, (hp e).2]) _ = 1 := by simp have hsample : 0 ≤ scoreCellFrequency g a r {e | (e : ℝ) ≤ t} x ∧ scoreCellFrequency g a r {e | (e : ℝ) ≤ t} x ≤ 1 := by unfold scoreCellFrequency have hs (j : Fin m) : 0 ≤ {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) (x j) ∧ {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) (x j) ≤ 1 := by by_cases he : g (x j) = r ∧ ((x j : ScoreSpace ε) : ℝ) ≤ t <;> simp [indicator, he, (hp (x j)).1, (hp (x j)).2] have hn : (0 : ℝ) < m := Nat.cast_pos.mpr hm constructor · exact mul_nonneg (inv_nonneg.mpr (le_of_lt hn)) (Finset.sum_nonneg (fun j _ => (hs j).1)) · apply (inv_mul_le_iff₀ hn).mpr simpa using (Finset.sum_le_sum (fun j _ => (hs j).2) : (∑ j : Fin m, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) (x j)) ≤ ∑ _j : Fin m, (1 : ℝ)) rw [abs_abs] apply abs_le.mpr constructor <;> linarith [hsample.1, hsample.2, hpop, hpop1]
CausalSmith.PartialID.UnlinkedPropensityAte.integrable_empiricalScoreCellCDF_joint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:267
theorem meanIntegratedAbs_empiricalScoreCellCDF_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
∫ x, (∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) ∂Measure.pi (fun _ : Fin m => H)
≤ (1 - 2 * ε) / (2 * sqrt m)
Proof (Lean source)
lemma meanIntegratedAbs_empiricalScoreCellCDF_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) : ∫ x, (∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) ∂Measure.pi (fun _ : Fin m => H) ≤ (1 - 2 * ε) / (2 * sqrt m) := by have hpoint (t : ℝ) (_ht : t ∈ Ioc ε (1 - ε)) : ∫ x, |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H) ≤ 1 / (2 * sqrt m) := by have hB : MeasurableSet {e : ScoreSpace ε | (e : ℝ) ≤ t} := measurableSet_le (by fun_prop) measurable_const exact meanAbs_empiricalScoreCells_pi hOverlap H g hg hm a r _ hB have hε : ε ≤ 1 - ε := by linarith [hOverlap.2] have h := projectionExpectedIntegratedError_le (Measure.pi fun _ : Fin m => H) ε (1 - ε) (1 / (2 * sqrt m)) hε _ (integrable_empiricalScoreCellCDF_joint hOverlap H g hg hm a r) hpoint convert h using 1 ring
CausalSmith.PartialID.UnlinkedPropensityAte.meanIntegratedAbs_empiricalScoreCellCDF_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:338
theorem sum_meanTrialCellCDFError_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
(∑ a : ArmSpace, ∑ r : LabelSpace J, ((∫ x : TrialSample n J, |(empiricalTrialCells x a r).real univ - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a}| ∂Measure.pi (fun _ : Fin n => μ)) + (∫ x : TrialSample n J, (∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) ∂Measure.pi (fun _ : Fin n => μ))))
≤ 2 * J / sqrt n
Proof (Lean source)
lemma sum_meanTrialCellCDFError_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ((∫ x : TrialSample n J, |(empiricalTrialCells x a r).real univ - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a}| ∂Measure.pi (fun _ : Fin n => μ)) + (∫ x : TrialSample n J, (∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) ∂Measure.pi (fun _ : Fin n => μ)))) ≤ 2 * J / sqrt n := by have hmass : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : TrialSample n J, |(empiricalTrialCells x a r).real univ - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a}| ∂Measure.pi (fun _ : Fin n => μ)) ≤ J / sqrt n := by simpa only [empiricalTrialCells_real_apply _ _ univ MeasurableSet.univ, Set.mem_univ, and_true] using sum_meanAbs_trialCellFrequency_pi μ hn (fun _ _ => univ) (fun _ _ => MeasurableSet.univ) have hcdf : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : TrialSample n J, (∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) ∂Measure.pi (fun _ : Fin n => μ)) ≤ J / sqrt n := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, (1 / (2 * sqrt n) : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanIntegratedAbs_empiricalTrialCellCDF_pi μ hn a r _ = J / sqrt n := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] field_simp ring simp_rw [Finset.sum_add_distrib] calc _ ≤ J / sqrt n + J / sqrt n := add_le_add hmass hcdf _ = 2 * J / sqrt n := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanTrialCellCDFError_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:366
theorem sum_meanScoreCellCDFError_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
(∑ a : ArmSpace, ∑ r : LabelSpace J, ((∫ x : Fin m → ScoreSpace ε, |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)) + (∫ x : Fin m → ScoreSpace ε, (∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) ∂Measure.pi (fun _ : Fin m => H))))
≤ J * (2 - 2 * ε) / sqrt m
Proof (Lean source)
lemma sum_meanScoreCellCDFError_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ((∫ x : Fin m → ScoreSpace ε, |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)) + (∫ x : Fin m → ScoreSpace ε, (∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) ∂Measure.pi (fun _ : Fin m => H)))) ≤ J * (2 - 2 * ε) / sqrt m := by have hmass : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : Fin m → ScoreSpace ε, |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)) ≤ J / sqrt m := by simpa only [Set.mem_univ, and_true] using sum_meanAbs_empiricalScoreCells_pi hOverlap H g hg hm (fun _ _ => univ) (fun _ _ => MeasurableSet.univ) have hcdf : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : Fin m → ScoreSpace ε, (∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) ∂Measure.pi (fun _ : Fin m => H)) ≤ J * (1 - 2 * ε) / sqrt m := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, ((1 - 2 * ε) / (2 * sqrt m) : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanIntegratedAbs_empiricalScoreCellCDF_pi hOverlap H g hg hm a r _ = J * (1 - 2 * ε) / sqrt m := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] field_simp ring simp_rw [Finset.sum_add_distrib] calc _ ≤ J / sqrt m + J * (1 - 2 * ε) / sqrt m := add_le_add hmass hcdf _ = J * (2 - 2 * ε) / sqrt m := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanScoreCellCDFError_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionIntegrated.lean:408
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionPopulation 6 declarations Population arm-cell finite measures underlying the external projection.

Population arm-cell finite measures underlying the external projection.

def trialPopulationCells

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
J :
ℕ
μ :
a :
r :
trialPopulationCells μ a r :
(μ.restrict {z | z.1 = r ∧ z.2.1 = a}).map (fun z => z.2.2)
CausalSmith.PartialID.UnlinkedPropensityAte.trialPopulationCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:14
theorem trialPopulationCells_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
μ :
a :
r :
hB :
trialPopulationCells μ a r B = μ {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}
Proof (Lean source)
lemma trialPopulationCells_apply {J : ℕ} (μ : Measure (Observation J)) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : trialPopulationCells μ a r B = μ {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} := by rw [trialPopulationCells, Measure.map_apply measurable_snd.snd hB, Measure.restrict_apply (hB.preimage measurable_snd.snd)] congr 1 ext z simp only [Set.mem_inter_iff, Set.mem_preimage, Set.mem_ofPred_eq] tauto
CausalSmith.PartialID.UnlinkedPropensityAte.trialPopulationCells_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:20
theorem trialPopulationCells_real_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
μ :
a :
r :
hB :
(trialPopulationCells μ a r).real B = μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B}
Proof (Lean source)
lemma trialPopulationCells_real_apply {J : ℕ} (μ : Measure (Observation J)) (a : ArmSpace) (r : LabelSpace J) (B : Set OutcomeSpace) (hB : MeasurableSet B) : (trialPopulationCells μ a r).real B = μ.real {z | z.1 = r ∧ z.2.1 = a ∧ z.2.2 ∈ B} := by unfold Measure.real rw [trialPopulationCells_apply μ a r B hB]
CausalSmith.PartialID.UnlinkedPropensityAte.trialPopulationCells_real_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:34
theorem outcomeCDFDistance_trialPopulationCells

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
μ :
x :
a :
r :
- μ.real {z | z.1 = r ∧ z.2.1 = a}|
+ ∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t}
- μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|
Proof (Lean source)
lemma outcomeCDFDistance_trialPopulationCells {J n : ℕ} (μ : Measure (Observation J)) (x : TrialSample n J) (a : ArmSpace) (r : LabelSpace J) : outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r) = |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}| + ∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}| := by unfold outcomeCDFDistance rw [trialPopulationCells_real_apply μ a r univ MeasurableSet.univ] simp only [Set.mem_univ, and_true] congr 1 apply intervalIntegral.integral_congr intro t _ change |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - (trialPopulationCells μ a r).real {y | (y : ℝ) ≤ t}| = _ rw [trialPopulationCells_real_apply μ a r _ (measurableSet_le (by fun_prop) measurable_const)] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance_trialPopulationCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:44
theorem meanOutcomeCDFDistance_trialPopulationCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
∫ x : TrialSample n J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r) ∂Measure.pi (fun _ : Fin n => μ)
≤ 1 / sqrt n
Proof (Lean source)
lemma meanOutcomeCDFDistance_trialPopulationCells_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) : ∫ x : TrialSample n J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r) ∂Measure.pi (fun _ : Fin n => μ) ≤ 1 / sqrt n := by have hmass : Integrable (fun x : TrialSample n J => |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}|) (Measure.pi fun _ : Fin n => μ) := by have hmeas : Measurable (fun x : TrialSample n J => |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}|) := by exact ((measurable_empiricalTrialCells_real_apply a r univ MeasurableSet.univ).sub measurable_const).abs apply Integrable.of_bound hmeas.aestronglyMeasurable 1 apply Filter.Eventually.of_forall intro x have hset : {y : OutcomeSpace | (y : ℝ) ≤ 1} = univ := by ext y simp [y.property.2] have hx := empiricalTrialCellCDF_mem_Icc hn a r x 1 have hp := trialPopulationCellCDF_mem_Icc μ a r 1 rw [hset] at hx have hpop : {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ 1} = {z | z.1 = r ∧ z.2.1 = a} := by ext z simp [z.2.2.property.2] rw [hpop] at hp dsimp rw [abs_abs] apply abs_le.mpr constructor <;> linarith [hx.1, hx.2, hp.1, hp.2] have hcdf : Integrable (fun x : TrialSample n J => ∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) (Measure.pi fun _ : Fin n => μ) := by convert (integrable_empiricalTrialCellCDF_joint μ hn a r).integral_prod_left using 1 funext x rw [intervalIntegral.integral_of_le (by norm_num)] rfl simp_rw [outcomeCDFDistance_trialPopulationCells] rw [integral_add hmass hcdf] have h₁ := meanAbs_trialCellFrequency_pi μ hn a r univ MeasurableSet.univ have h₂ := meanIntegratedAbs_empiricalTrialCellCDF_pi μ hn a r have h₁' : (∫ x : TrialSample n J, |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}| ∂Measure.pi (fun _ : Fin n => μ)) ≤ 1 / (2 * sqrt n) := by simpa only [empiricalTrialCells_real_apply a r univ MeasurableSet.univ, Set.mem_univ, and_true] using h₁ calc _ ≤ 1 / (2 * sqrt n) + 1 / (2 * sqrt n) := add_le_add h₁' h₂ _ = 1 / sqrt n := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.meanOutcomeCDFDistance_trialPopulationCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:67
theorem sum_meanOutcomeCDFDistance_trialPopulationCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
(∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : TrialSample n J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r) ∂Measure.pi (fun _ : Fin n => μ))
≤ 2 * J / sqrt n
Proof (Lean source)
lemma sum_meanOutcomeCDFDistance_trialPopulationCells_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : TrialSample n J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r) ∂Measure.pi (fun _ : Fin n => μ)) ≤ 2 * J / Real.sqrt n := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, (1 / Real.sqrt n : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanOutcomeCDFDistance_trialPopulationCells_pi μ hn a r _ = 2 * J / Real.sqrt n := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanOutcomeCDFDistance_trialPopulationCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionPopulation.lean:125
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionRiskEnvelope 4 declarations Population identification and deterministic excess-length bounds for the external projection interval.

Population identification and deterministic excess-length bounds for the external projection interval.

theorem projectedArmEndpoint_population_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
upper :
= if upper then muUpper H g Prel hMass a else muLower H g Prel hMass a
Proof (Lean source)
lemma projectedArmEndpoint_population_eq {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) (upper : Bool) : projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) a upper = if upper then muUpper H g Prel hMass a else muLower H g Prel hMass a := by unfold projectedArmEndpoint cases upper with | false => simp only [Bool.false_eq_true, ↓reduceIte] unfold muLower apply Finset.sum_congr rfl intro r _ have hmass : (trialPopulationCells Prel a r).real univ = armCellMass H g a r := by rw [trialPopulationCells_real_apply Prel a r univ MeasurableSet.univ] simpa only [Set.mem_univ, and_true] using hMass.2.2.2 a r rw [hmass] by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos, if_pos] rw [normalized_trialPopulationCell_eq_armCellOutcomeLaw H g Prel hMass a r hq, normalized_scorePopulationCell_eq_armCellWeightLaw H g Prel hMass hOverlap a r hq] · simp [hq] | true => simp only [↓reduceIte] unfold muUpper apply Finset.sum_congr rfl intro r _ have hmass : (trialPopulationCells Prel a r).real univ = armCellMass H g a r := by rw [trialPopulationCells_real_apply Prel a r univ MeasurableSet.univ] simpa only [Set.mem_univ, and_true] using hMass.2.2.2 a r rw [hmass] by_cases hq : 0 < armCellMass H g a r · simp only [hq, dif_pos, if_pos] rw [normalized_trialPopulationCell_eq_armCellOutcomeLaw H g Prel hMass a r hq, normalized_scorePopulationCell_eq_armCellWeightLaw H g Prel hMass hOverlap a r hq] · simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.projectedArmEndpoint_population_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskEnvelope.lean:89
theorem projectedPopulationATESpan_eq_sharpATELength

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.projectedPopulationATESpan_eq_sharpATELength · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskEnvelope.lean:132
theorem externalProjectionIntervalProcedure_excessLength_le_of_endpoint_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
H :
g :
Prel :
hMass :
α :
ℝ
hOverlap :
hg :
x :
δ :
ℝ
hδ :
0 ≤ δ
hSharp :
0 ≤ sharpATELength H g Prel hMass
max 0 ((externalProjectionIntervalProcedure g α hOverlap hg).length x - sharpATELength H g Prel hMass)
≤ 4 * δ
Proof (Lean source)
lemma externalProjectionIntervalProcedure_excessLength_le_of_endpoint_bounds {ε : ℝ} {J n m : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (x : ExternalSample ε J n m) {δ : ℝ} (hδ : 0 ≤ δ) (hSharp : 0 ≤ sharpATELength H g Prel hMass) (hendpoint : ∀ b ∈ sievedProjectionCandidates g α x, ∀ a upper, |projectedArmEndpoint b.1 b.2 a upper - projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) a upper| ≤ δ) : max 0 ((externalProjectionIntervalProcedure g α hOverlap hg).length x - sharpATELength H g Prel hMass) ≤ 4 * δ := by classical let C := Icc (-1 : ℝ) 1 ∩ closure (convexHull ℝ (⋃ b ∈ sievedProjectionCandidates g α x, projectedATEInterval b.1 b.2)) by_cases hC : C.Nonempty · have hLU : projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) true false - projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) false true ≤ projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) true true - projectedArmEndpoint (trialPopulationCells Prel) (scorePopulationCells H g) false false := by have hspan := projectedPopulationATESpan_eq_sharpATELength H g Prel hMass hOverlap linarith have hbound := externalProjectionCI_excessLength_le_of_armEndpoint_bounds g α x (trialPopulationCells Prel) (scorePopulationCells H g) hδ hLU (fun _ => hC) hendpoint obtain ⟨lo, hi, heq, hb⟩ := hbound have hne := externalProjectionCI_nonempty g α x have hlohi : lo ≤ hi := by obtain ⟨z, hz⟩ := hne rw [heq] at hz exact hz.1.trans hz.2 let CI : ExternalIntervalProcedure ε J n m := externalProjectionIntervalProcedure g α hOverlap hg have hproc : Icc (CI.lo x) (CI.hi x) = sievedTotalizedProjectionCI g α x := externalProjectionIntervalProcedure_Icc g α hOverlap hg x have hprocord : CI.lo x ≤ CI.hi x := CI.ordered x have hlo : CI.lo x = lo := by apply le_antisymm · have hz : lo ∈ Icc (CI.lo x) (CI.hi x) := by rw [hproc, heq] exact Set.left_mem_Icc.mpr hlohi exact hz.1 · have hz : CI.lo x ∈ Icc lo hi := by rw [← heq, ← hproc] exact Set.left_mem_Icc.mpr hprocord exact hz.1 have hhi : CI.hi x = hi := by apply le_antisymm · have hz : CI.hi x ∈ Icc lo hi := by rw [← heq, ← hproc] exact Set.right_mem_Icc.mpr hprocord exact hz.2 · have hz : hi ∈ Icc (CI.lo x) (CI.hi x) := by rw [hproc, heq] exact Set.right_mem_Icc.mpr hlohi exact hz.2 simpa [ExternalIntervalProcedure.length, CI, hlo, hhi, projectedPopulationATESpan_eq_sharpATELength H g Prel hMass hOverlap] using hb · have hfallback : sievedTotalizedProjectionCI g α x = {0} := by rw [sievedTotalizedProjectionCI] change (if (sievedProjectionCandidates g α x).Nonempty ∧ C.Nonempty then C else {0}) = {0} simp [hC] let CI : ExternalIntervalProcedure ε J n m := externalProjectionIntervalProcedure g α hOverlap hg have hproc : Icc (CI.lo x) (CI.hi x) = sievedTotalizedProjectionCI g α x := externalProjectionIntervalProcedure_Icc g α hOverlap hg x have hlo : CI.lo x = 0 := by have hz : CI.lo x ∈ sievedTotalizedProjectionCI g α x := by rw [← hproc] exact Set.left_mem_Icc.mpr (CI.ordered x) simpa [hfallback] using hz have hhi : CI.hi x = 0 := by have hz : CI.hi x ∈ sievedTotalizedProjectionCI g α x := by rw [← hproc] exact Set.right_mem_Icc.mpr (CI.ordered x) simpa [hfallback] using hz simp only [ExternalIntervalProcedure.length, CI, hlo, hhi, sub_self] rw [max_eq_left] · exact mul_nonneg (by norm_num) hδ · linarith
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_excessLength_le_of_endpoint_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskEnvelope.lean:152
theorem externalProjectionIntervalProcedure_population_excessLength_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
α :
ℝ
PH :
hPH :
PH ∈ ExternalLaws g
x :
hα :
0 < α
hn :
0 < n
hm :
0 < m
hSharp :
0 ≤ sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)
δ :
(ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r)))
max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH))
≤ 4 * δ
Proof (Lean source)
lemma externalProjectionIntervalProcedure_population_excessLength_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (x : ExternalSample ε J n m) (hα : 0 < α) (hn : 0 < n) (hm : 0 < m) (hSharp : 0 ≤ sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) : let δ := (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r)) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r))) max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ≤ 4 * δ := by dsimp only have hOverlap := hPH.2.2.overlap have hout : 0 ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells (releasedLaw PH.1) a r) := Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => outcomeCDFDistance_nonneg _ _)) have hscore : 0 ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells PH.2 g a r) := Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => scoreCDFDistance_nonneg hOverlap _ _)) have htrialRadius : 0 ≤ 4 * J / (α * sqrt n) := by positivity have hwidth : 0 ≤ 2 - 2 * ε := by linarith [hOverlap.2] have hsqrtm : 0 < sqrt m := Real.sqrt_pos.2 (by exact_mod_cast hm) have hlogRadius : 0 ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m) := by exact div_nonneg (mul_nonneg (mul_nonneg (by positivity) (by positivity)) hwidth) (mul_nonneg hα.le hsqrtm.le) have hL : 0 ≤ ε⁻¹ + (ε ^ 2)⁻¹ := add_nonneg (inv_nonneg.mpr hOverlap.1.le) (inv_nonneg.mpr (sq_nonneg ε)) apply externalProjectionIntervalProcedure_excessLength_le_of_endpoint_bounds PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH) α hOverlap hPH.2.2.measurableRelease x · exact mul_nonneg hL (by linarith) · exact hSharp · intro b hb a upper exact projectionCandidate_populationArmEndpoint_abs_le g α PH hPH x b hb.1 a upper
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_population_excessLength_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskEnvelope.lean:244
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionRiskExpectation 4 declarations Expected excess-length bounds obtained by integrating the deterministic projection-risk envelope.

Expected excess-length bounds obtained by integrating the deterministic projection-risk envelope.

theorem integrable_outcomeCDFDistance_population_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J n :
ℕ
hn :
0 < n
a :
r :
Integrable (fun x : TrialSample n J => outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) (Measure.pi fun _ : Fin n => μ)
Proof (Lean source)
lemma integrable_outcomeCDFDistance_population_pi {J n : ℕ} (μ : Measure (Observation J)) [IsProbabilityMeasure μ] (hn : 0 < n) (a : ArmSpace) (r : LabelSpace J) : Integrable (fun x : TrialSample n J => outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) (Measure.pi fun _ : Fin n => μ) := by have hmass : Integrable (fun x : TrialSample n J => |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}|) (Measure.pi fun _ : Fin n => μ) := by have hmeas : Measurable (fun x : TrialSample n J => |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}|) := by exact ((measurable_empiricalTrialCells_real_apply a r univ MeasurableSet.univ).sub measurable_const).abs apply Integrable.of_bound hmeas.aestronglyMeasurable 1 apply Filter.Eventually.of_forall intro x have hset : {y : OutcomeSpace | (y : ℝ) ≤ 1} = univ := by ext y simp [y.property.2] have hx := empiricalTrialCellCDF_mem_Icc hn a r x 1 have hp := trialPopulationCellCDF_mem_Icc μ a r 1 rw [hset] at hx have hpop : {z : Observation J | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ 1} = {z | z.1 = r ∧ z.2.1 = a} := by ext z simp [z.2.2.property.2] rw [hpop] at hp dsimp rw [abs_abs] apply abs_le.mpr constructor <;> linarith [hx.1, hx.2, hp.1, hp.2] have hcdf : Integrable (fun x : TrialSample n J => ∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}|) (Measure.pi fun _ : Fin n => μ) := by convert (integrable_empiricalTrialCellCDF_joint μ hn a r).integral_prod_left using 1 funext x rw [intervalIntegral.integral_of_le (by norm_num)] rfl rw [show (fun x : TrialSample n J => outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) = fun x => |(empiricalTrialCells x a r).real univ - μ.real {z | z.1 = r ∧ z.2.1 = a}| + ∫ t in (0 : ℝ)..1, |(empiricalTrialCells x a r).real {y | (y : ℝ) ≤ t} - μ.real {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ≤ t}| by funext x exact outcomeCDFDistance_trialPopulationCells μ x a r] exact hmass.add hcdf
CausalSmith.PartialID.UnlinkedPropensityAte.integrable_outcomeCDFDistance_population_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskExpectation.lean:19
theorem integrable_scoreCDFDistance_population_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
Integrable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) (Measure.pi fun _ : Fin m => H)
Proof (Lean source)
lemma integrable_scoreCDFDistance_population_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) : Integrable (fun x : Fin m → ScoreSpace ε => scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) (Measure.pi fun _ : Fin m => H) := by have hmass : Integrable (fun x : Fin m → ScoreSpace ε => |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H|) (Measure.pi fun _ : Fin m => H) := by let F : ScoreSpace ε → ℝ := {e : ScoreSpace ε | g e = r}.indicator (armProb a) have hC : MeasurableSet {e : ScoreSpace ε | g e = r} := measurableSet_eq_fun hg measurable_const have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable F := hp.indicator hC have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hlp : MemLp F 2 H := memLp_of_bounded (Filter.Eventually.of_forall hbound) hF.aestronglyMeasurable 2 have hcoord (j : Fin m) : MemLp (fun x : Fin m → ScoreSpace ε => F (x j)) 2 (Measure.pi fun _ : Fin m => H) := hlp.comp_measurePreserving (measurePreserving_eval (fun _ : Fin m => H) j) have hX : MemLp (scoreCellFrequency g a r univ) 2 (Measure.pi fun _ : Fin m => H) := by have hs := memLp_finsetSum univ (fun j _ => hcoord j) have hs' := hs.const_mul (m : ℝ)⁻¹ unfold scoreCellFrequency simpa only [F, Set.mem_univ, and_true] using hs' have hXi : Integrable (scoreCellFrequency g a r univ) (Measure.pi fun _ : Fin m => H) := memLp_one_iff_integrable.mp (hX.mono_exponent (by norm_num)) have hconst : Integrable (fun _ : Fin m → ScoreSpace ε => ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H) (Measure.pi fun _ : Fin m => H) := integrable_const _ convert (hXi.sub hconst).abs using 1 funext x rw [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r univ MeasurableSet.univ] rfl have hcdf : Integrable (fun x : Fin m → ScoreSpace ε => ∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) (Measure.pi fun _ : Fin m => H) := by convert (integrable_empiricalScoreCellCDF_joint hOverlap H g hg hm a r).integral_prod_left using 1 funext x rw [intervalIntegral.integral_of_le (by linarith [hOverlap.2])] rfl rw [show (fun x : Fin m → ScoreSpace ε => scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) = fun x => |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| + ∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H| by funext x exact scoreCDFDistance_scorePopulationCells hOverlap H g hg x a r] exact hmass.add hcdf
CausalSmith.PartialID.UnlinkedPropensityAte.integrable_scoreCDFDistance_population_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskExpectation.lean:75
theorem externalProjectionIntervalProcedure_population_meanExcessLength_le_of_sharp_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
hn :
0 < n
hm :
0 < m
α :
ℝ
hα :
0 < α
hSharp :
0 ≤ sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)
∫ x, max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2
≤ 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m)
Proof (Lean source)
lemma externalProjectionIntervalProcedure_population_meanExcessLength_le_of_sharp_nonneg {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (hn : 0 < n) (hm : 0 < m) (α : ℝ) (hα : 0 < α) (hSharp : 0 ≤ sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) : ∫ x, max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2 ≤ 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m) := by let μ := releasedLaw PH.1 let H := PH.2 let F : ExternalSample ε J n m → ℝ := fun x => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x.1 a r) (trialPopulationCells μ a r) let G : ExternalSample ε J n m → ℝ := fun x => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x.2 a r) (scorePopulationCells H g a r) haveI : IsProbabilityMeasure PH.1 := hPH.1 haveI : IsProbabilityMeasure H := hPH.2.1 haveI : IsProbabilityMeasure μ := by unfold μ releasedLaw exact @Measure.isProbabilityMeasure_map _ _ _ _ PH.1 hPH.1 _ (by unfold releasedRecord label arm observed; fun_prop : Measurable (releasedRecord (ε := ε) (J := J))).aemeasurable haveI : IsProbabilityMeasure (Qj PH.1 PH.2) := by rw [externalJointLaw_eq_experiment g Qj hTrial hLog hInd PH hPH] dsimp [externalExperiment] infer_instance have hfin := projectionPopulationCells_finite H g μ hPH.2.2.overlap hPH.2.2.measurableRelease have hFTmeas : Measurable (fun x : TrialSample n J => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) := by apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ letI : IsFiniteMeasure (trialPopulationCells μ a r) := hfin.1 a r simpa only [outcomeCDFDistance, abs_sub_comm] using measurable_outcomeCDFDistance_empirical (trialPopulationCells μ a r) (measure_lt_top _ _) a r have hGTmeas : Measurable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) := by apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro r _ letI : IsFiniteMeasure (scorePopulationCells H g a r) := hfin.2 a r simpa only [scoreCDFDistance, abs_sub_comm] using measurable_scoreCDFDistance_empirical hPH.2.2.overlap g hPH.2.2.measurableRelease (scorePopulationCells H g a r) (measure_lt_top _ _) a r have hFmeas : Measurable F := by exact hFTmeas.comp measurable_fst have hGmeas : Measurable G := by exact hGTmeas.comp measurable_snd have hFpi : Integrable (fun x : TrialSample n J => ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (empiricalTrialCells x a r) (trialPopulationCells μ a r)) (Measure.pi fun _ : Fin n => μ) := by exact integrable_finsetSum _ (fun a _ => integrable_finsetSum _ (fun r _ => integrable_outcomeCDFDistance_population_pi μ hn a r)) have hGpi : Integrable (fun x : Fin m → ScoreSpace ε => ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r)) (Measure.pi fun _ : Fin m => H) := by exact integrable_finsetSum _ (fun a _ => integrable_finsetSum _ (fun r _ => integrable_scoreCDFDistance_population_pi hPH.2.2.overlap H g hPH.2.2.measurableRelease hm a r)) have hFint : Integrable F (Qj PH.1 PH.2) := by have hmap : Measure.map fst (Qj PH.1 PH.2) = Measure.pi (fun _ : Fin n => μ) := by simpa [μ] using hTrial PH hPH rw [← hmap] at hFpi simpa [F, Function.comp_def] using hFpi.comp_aemeasurable measurable_fst.aemeasurable have hGint : Integrable G (Qj PH.1 PH.2) := by have hmap : Measure.map snd (Qj PH.1 PH.2) = Measure.pi (fun _ : Fin m => H) := by simpa [H] using hLog PH hPH rw [← hmap] at hGpi simpa [G, Function.comp_def] using hGpi.comp_aemeasurable measurable_snd.aemeasurable have hFmean : ∫ x, F x ∂Qj PH.1 PH.2 ≤ 2 * J / sqrt n := by exact externalJointTrial_meanDistance_le g Qj hTrial PH hPH hn (by simpa [μ] using hFTmeas) (fun a r => integrable_outcomeCDFDistance_population_pi μ hn a r) have hGmean : ∫ x, G x ∂Qj PH.1 PH.2 ≤ J * (2 - 2 * ε) / sqrt m := by exact externalJointLog_meanDistance_le g Qj hLog PH hPH hm (by simpa [H] using hGTmeas) (fun a r => integrable_scoreCDFDistance_population_pi hPH.2.2.overlap H g hPH.2.2.measurableRelease hm a r) let C : ExternalIntervalProcedure ε J n m := externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease let S := sharpATELength H g μ (externalLawCellMasses g PH hPH) have hleftMeas : Measurable (fun x => max 0 (C.length x - S)) := by exact measurable_const.max ((C.measurable_hi.sub C.measurable_lo).sub measurable_const) have hleftInt : Integrable (fun x => max 0 (C.length x - S)) (Qj PH.1 PH.2) := by apply Integrable.of_bound hleftMeas.aestronglyMeasurable 2 apply Filter.Eventually.of_forall intro x rw [Real.norm_eq_abs, abs_of_nonneg (le_max_left _ _)] apply max_le (by norm_num) dsimp [C, ExternalIntervalProcedure.length, S] linarith [C.lower_bound x, C.upper_bound x, hSharp] have hL : 0 ≤ ε⁻¹ + (ε ^ 2)⁻¹ := add_nonneg (inv_nonneg.mpr hPH.2.2.overlap.1.le) (inv_nonneg.mpr (sq_nonneg ε)) let R : ExternalSample ε J n m → ℝ := fun x => 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + F x + 2 * J * (2 - 2 * ε) / (α * sqrt m) + G x) have hRint : Integrable R (Qj PH.1 PH.2) := by dsimp [R] fun_prop have hpoint : ∀ x, max 0 (C.length x - S) ≤ R x := by intro x simpa [C, S, R, F, G, μ, H, mul_assoc] using externalProjectionIntervalProcedure_population_excessLength_le g α PH hPH x hα hn hm hSharp calc ∫ x, max 0 (C.length x - S) ∂Qj PH.1 PH.2 ≤ ∫ x, R x ∂Qj PH.1 PH.2 := integral_mono hleftInt hRint hpoint _ = 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + (∫ x, F x ∂Qj PH.1 PH.2) + 2 * J * (2 - 2 * ε) / (α * sqrt m) + (∫ x, G x ∂Qj PH.1 PH.2)) := by dsimp [R] rw [integral_const_mul] congr 1 rw [integral_add (f := fun a => 4 * J / (α * sqrt n) + F a + 2 * J * (2 - 2 * ε) / (α * sqrt m)) (g := G) (((integrable_const _).add hFint).add (integrable_const _)) hGint, integral_add (f := fun a => 4 * J / (α * sqrt n) + F a) (g := fun _ => 2 * J * (2 - 2 * ε) / (α * sqrt m)) ((integrable_const _).add hFint) (integrable_const _), integral_add (f := fun _ => 4 * J / (α * sqrt n)) (g := F) (integrable_const _) hFint] simp _ ≤ 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m) := by exact mul_le_mul_of_nonneg_left (by linarith) (mul_nonneg (by norm_num) hL)
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_population_meanExcessLength_le_of_sharp_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskExpectation.lean:150
theorem externalProjectionIntervalProcedure_population_meanExcessLength_le

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
g :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
hTrial :
hLog :
PH :
hPH :
PH ∈ ExternalLaws g
hn :
0 < n
hm :
0 < m
α :
ℝ
hα :
0 < α
∫ x, max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2
≤ 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m)
Proof (Lean source)
theorem externalProjectionIntervalProcedure_population_meanExcessLength_le {ε : ℝ} {J n m : ℕ} (g : ScoreSpace ε → LabelSpace J) (Qj : Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : JointTrialIID g Qj) (hLog : ExternalLogIID g Qj) (hInd : ExternalLogIndependent g Qj) (PH : Measure (FullRow ε J) × Measure (ScoreSpace ε)) (hPH : PH ∈ ExternalLaws g) (hn : 0 < n) (hm : 0 < m) (α : ℝ) (hα : 0 < α) : ∫ x, max 0 ((externalProjectionIntervalProcedure g α hPH.2.2.overlap hPH.2.2.measurableRelease).length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂Qj PH.1 PH.2 ≤ 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m) := by apply externalProjectionIntervalProcedure_population_meanExcessLength_le_of_sharp_nonneg g Qj hTrial hLog hInd PH hPH hn hm α hα exact sharpATELength_nonneg_of_overlap PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH) hPH.2.2.overlap
CausalSmith.PartialID.UnlinkedPropensityAte.externalProjectionIntervalProcedure_population_meanExcessLength_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionRiskExpectation.lean:323
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionScorePopulation 7 declarations Population weighted score-cell submeasures for the external projection.

Population weighted score-cell submeasures for the external projection.

def scorePopulationCells

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
H :
g :
a :
r :
scorePopulationCells H g a r :
H.withDensity (fun e => ofReal (if g e = r then armProb a e else 0))
CausalSmith.PartialID.UnlinkedPropensityAte.scorePopulationCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:14
theorem scorePopulationCells_real_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
g :
hg :
a :
r :
B :
hB :
= ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H
Proof (Lean source)
lemma scorePopulationCells_real_apply {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (a : ArmSpace) (r : LabelSpace J) (B : Set (ScoreSpace ε)) (hB : MeasurableSet B) : (scorePopulationCells H g a r).real B = ∫ e, {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) e ∂H := by let F : ScoreSpace ε → ℝ := {e : ScoreSpace ε | g e = r ∧ e ∈ B}.indicator (armProb a) have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hC : MeasurableSet {e : ScoreSpace ε | g e = r ∧ e ∈ B} := (measurableSet_eq_fun hg measurable_const).inter hB have hF : Measurable F := hp.indicator hC have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r ∧ e ∈ B · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hInt : Integrable F H := by apply Integrable.of_bound hF.aestronglyMeasurable 1 apply Filter.Eventually.of_forall intro e simpa [Real.norm_eq_abs, abs_of_nonneg (hbound e).1] using (hbound e).2 unfold scorePopulationCells Measure.real rw [withDensity_apply _ hB] have hlin : (∫⁻ e in B, ofReal (if g e = r then armProb a e else 0) ∂H) = ∫⁻ e, ofReal (F e) ∂H := by rw [← lintegral_indicator hB] apply lintegral_congr intro e by_cases he : g e = r <;> by_cases heB : e ∈ B <;> simp [F, indicator, he, heB] rw [hlin, ← ofReal_integral_eq_lintegral_ofReal hInt (Filter.Eventually.of_forall (fun e => (hbound e).1))] rw [ENNReal.toReal_ofReal (integral_nonneg (fun e => (hbound e).1))]
CausalSmith.PartialID.UnlinkedPropensityAte.scorePopulationCells_real_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:21
theorem scoreCDFDistance_scorePopulationCells

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
x :
Fin m → ScoreSpace ε
a :
r :
- ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H|
+ ∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t}
- ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|
Proof (Lean source)
lemma scoreCDFDistance_scorePopulationCells {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (x : Fin m → ScoreSpace ε) (a : ArmSpace) (r : LabelSpace J) : scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r) = |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| + ∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H| := by unfold scoreCDFDistance rw [scorePopulationCells_real_apply hOverlap H g hg a r univ MeasurableSet.univ] simp only [Set.mem_univ, and_true] congr 1 apply intervalIntegral.integral_congr intro t _ change |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - (scorePopulationCells H g a r).real {e | (e : ℝ) ≤ t}| = _ rw [show (scorePopulationCells H g a r).real {e | (e : ℝ) ≤ t} = ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H from scorePopulationCells_real_apply hOverlap H g hg a r _ (measurableSet_le (by fun_prop) measurable_const)]
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCDFDistance_scorePopulationCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:64
theorem meanScoreCDFDistance_scorePopulationCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
a :
r :
∫ x : Fin m → ScoreSpace ε, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r) ∂Measure.pi (fun _ : Fin m => H)
≤ (1 - ε) / sqrt m
Proof (Lean source)
lemma meanScoreCDFDistance_scorePopulationCells_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) (a : ArmSpace) (r : LabelSpace J) : ∫ x : Fin m → ScoreSpace ε, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r) ∂Measure.pi (fun _ : Fin m => H) ≤ (1 - ε) / sqrt m := by have hmass : Integrable (fun x : Fin m → ScoreSpace ε => |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H|) (Measure.pi fun _ : Fin m => H) := by let F : ScoreSpace ε → ℝ := {e : ScoreSpace ε | g e = r}.indicator (armProb a) have hC : MeasurableSet {e : ScoreSpace ε | g e = r} := measurableSet_eq_fun hg measurable_const have hp : Measurable (armProb a : ScoreSpace ε → ℝ) := by unfold armProb cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> fun_prop have hF : Measurable F := hp.indicator hC have hbound : ∀ e, F e ∈ Icc (0 : ℝ) 1 := by intro e by_cases he : g e = r · simpa [F, indicator, he] using (show armProb a e ∈ Icc (0 : ℝ) 1 from ⟨le_trans (le_of_lt hOverlap.1) (projectionArmProb_bounds hOverlap a e).1, (projectionArmProb_bounds hOverlap a e).2⟩) · simp [F, he] have hlp : MemLp F 2 H := memLp_of_bounded (Filter.Eventually.of_forall hbound) hF.aestronglyMeasurable 2 have hcoord (j : Fin m) : MemLp (fun x : Fin m → ScoreSpace ε => F (x j)) 2 (Measure.pi fun _ : Fin m => H) := hlp.comp_measurePreserving (measurePreserving_eval (fun _ : Fin m => H) j) have hX : MemLp (scoreCellFrequency g a r univ) 2 (Measure.pi fun _ : Fin m => H) := by have hs := memLp_finsetSum univ (fun j _ => hcoord j) have hs' := hs.const_mul (m : ℝ)⁻¹ unfold scoreCellFrequency simpa only [F, Set.mem_univ, and_true] using hs' have hXi : Integrable (scoreCellFrequency g a r univ) (Measure.pi fun _ : Fin m => H) := memLp_one_iff_integrable.mp (hX.mono_exponent (by norm_num)) have hconst : Integrable (fun _ : Fin m → ScoreSpace ε => ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H) (Measure.pi fun _ : Fin m => H) := integrable_const _ convert (hXi.sub hconst).abs using 1 funext x rw [empiricalScoreCells_real_eq_scoreCellFrequency hOverlap g a r univ MeasurableSet.univ] rfl have hcdf : Integrable (fun x : Fin m → ScoreSpace ε => ∫ t in ε..(1 - ε), |(empiricalScoreCells g x a r).real {e | (e : ℝ) ≤ t} - ∫ e, {e : ScoreSpace ε | g e = r ∧ (e : ℝ) ≤ t}.indicator (armProb a) e ∂H|) (Measure.pi fun _ : Fin m => H) := by convert (integrable_empiricalScoreCellCDF_joint hOverlap H g hg hm a r).integral_prod_left using 1 funext x rw [intervalIntegral.integral_of_le (by linarith [hOverlap.2])] rfl simp_rw [scoreCDFDistance_scorePopulationCells hOverlap H g hg] rw [integral_add hmass hcdf] have h₁ := meanAbs_empiricalScoreCells_pi hOverlap H g hg hm a r univ MeasurableSet.univ have h₂ := meanIntegratedAbs_empiricalScoreCellCDF_pi hOverlap H g hg hm a r have h₁' : (∫ x : Fin m → ScoreSpace ε, |(empiricalScoreCells g x a r).real univ - ∫ e, {e : ScoreSpace ε | g e = r}.indicator (armProb a) e ∂H| ∂Measure.pi (fun _ : Fin m => H)) ≤ 1 / (2 * sqrt m) := by simpa only [Set.mem_univ, and_true] using h₁ calc _ ≤ 1 / (2 * sqrt m) + (1 - 2 * ε) / (2 * sqrt m) := add_le_add h₁' h₂ _ = (1 - ε) / sqrt m := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.meanScoreCDFDistance_scorePopulationCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:92
theorem sum_meanScoreCDFDistance_scorePopulationCells_pi

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J m :
ℕ
hOverlap :
g :
hg :
hm :
0 < m
(∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : Fin m → ScoreSpace ε, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r) ∂Measure.pi (fun _ : Fin m => H))
≤ J * (2 - 2 * ε) / sqrt m
Proof (Lean source)
lemma sum_meanScoreCDFDistance_scorePopulationCells_pi {ε : ℝ} {J m : ℕ} (hOverlap : Overlap ε) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace J) (hg : Measurable g) (hm : 0 < m) : (∑ a : ArmSpace, ∑ r : LabelSpace J, ∫ x : Fin m → ScoreSpace ε, scoreCDFDistance (empiricalScoreCells g x a r) (scorePopulationCells H g a r) ∂Measure.pi (fun _ : Fin m => H)) ≤ J * (2 - 2 * ε) / Real.sqrt m := by calc _ ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, ((1 - ε) / Real.sqrt m : ℝ) := by apply Finset.sum_le_sum intro a _ apply Finset.sum_le_sum intro r _ exact meanScoreCDFDistance_scorePopulationCells_pi hOverlap H g hg hm a r _ = J * (2 - 2 * ε) / Real.sqrt m := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, Fintype.card_bool, nsmul_eq_mul] ring
CausalSmith.PartialID.UnlinkedPropensityAte.sum_meanScoreCDFDistance_scorePopulationCells_pi · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:172
theorem projectionCompatible_populationCells

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
μ :
hOverlap :
Proof (Lean source)
lemma projectionCompatible_populationCells {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (μ : Measure (Observation J)) (h : CompatibleCellMasses H g μ) (hOverlap : Overlap ε) : ProjectionCompatible (trialPopulationCells μ) (scorePopulationCells H g) := by haveI : IsProbabilityMeasure H := h.1 intro a r rw [trialPopulationCells_real_apply μ a r univ MeasurableSet.univ] simp only [Set.mem_univ, and_true] rw [scorePopulationCells_real_apply hOverlap H g h.2.2.1 a r univ MeasurableSet.univ] simp only [Set.mem_univ, and_true] rw [h.2.2.2 a r] simp only [armCellMass, cell] rw [← integral_indicator (measurableSet_eq_fun h.2.2.1 measurable_const)]
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCompatible_populationCells · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:196
theorem projectionPopulationCells_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
μ :
hOverlap :
hg :
conclusion 1
a r :
conclusion 2
a r :
Proof (Lean source)
lemma projectionPopulationCells_finite {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (μ : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure μ] (hOverlap : Overlap ε) (hg : Measurable g) : (∀ a r, IsFiniteMeasure (trialPopulationCells μ a r)) ∧ ∀ a r, IsFiniteMeasure (scorePopulationCells H g a r) := by constructor · intro a r unfold trialPopulationCells infer_instance · intro a r let F : ScoreSpace ε → ℝ := fun e => if g e = r then armProb a e else 0 have hF : Measurable F := by have hcell : MeasurableSet {e : ScoreSpace ε | g e = r} := measurableSet_eq_fun hg measurable_const dsimp [F, armProb] cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> exact Measurable.ite hcell (by fun_prop) measurable_const have hbound : ∀ e, |F e| ≤ 1 := by intro e by_cases he : g e = r · have hp := projectionArmProb_bounds hOverlap a e simpa [F, he, abs_of_nonneg (le_trans hOverlap.1.le hp.1)] using hp.2 · simp [F, he] have hInt : Integrable F H := by apply Integrable.of_bound hF.aestronglyMeasurable 1 exact Filter.Eventually.of_forall (fun e => by simpa [Real.norm_eq_abs] using hbound e) unfold scorePopulationCells exact isFiniteMeasure_withDensity_ofReal hInt.hasFiniteIntegral
CausalSmith.PartialID.UnlinkedPropensityAte.projectionPopulationCells_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionScorePopulation.lean:213
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionSharpLength 3 declarations Nonnegativity of the population projection span under overlap.

Nonnegativity of the population projection span under overlap.

theorem cell_lower_le_upper_of_overlap

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
a :
σ :
hp :
0 < μ.real univ
hmass :
μ.real univ = σ.real univ
(∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (1 - u))
≤ ∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) u
Proof (Lean source)
lemma cell_lower_le_upper_of_overlap {ε : ℝ} (hOverlap : Overlap ε) (a : ArmSpace) (μ : Measure OutcomeSpace) (σ : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure σ] (hp : 0 < μ.real univ) (hmass : μ.real univ = σ.real univ) : (∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) (1 - u)) ≤ ∫ u in (0 : ℝ)..1, quantile (((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ))) u * quantile (((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹)) u := by let Y : Measure ℝ := ((μ univ)⁻¹ • μ).map (fun y : OutcomeSpace => (y : ℝ)) let W : Measure ℝ := ((σ univ)⁻¹ • σ).map (fun e => (armProb a e)⁻¹) have hσp : 0 < σ.real univ := by rw [← hmass]; exact hp letI : IsProbabilityMeasure Y := by dsimp [Y] rw [map_normalized_subtype_eq_finiteNormalize μ hp] infer_instance letI : IsProbabilityMeasure W := by dsimp [W] rw [map_normalized_inverseArmProb_eq_finiteNormalize_map a σ hσp] exact Measure.isProbabilityMeasure_map (measurable_projectionInverseArmProbReal a).aemeasurable have hYs : Y (Icc 0 1)ᶜ = 0 := by exact normalizedOutcome_support μ hp have hWs : W (Icc 0 ε⁻¹)ᶜ = 0 := by exact normalizedInverseArmProb_support hOverlap a σ hσp have hY2 : MemLp (fun x : ℝ => x) 2 Y := by apply memLp_of_bounded · filter_upwards [show ∀ᵐ x ∂Y, x ∈ Icc (0 : ℝ) 1 by rw [ae_iff]; exact hYs] with x hx exact hx · fun_prop have hW2 : MemLp (fun x : ℝ => x) 2 W := by apply memLp_of_bounded · filter_upwards [show ∀ᵐ x ∂W, x ∈ Icc (0 : ℝ) ε⁻¹ by rw [ae_iff]; exact hWs] with x hx exact hx · fun_prop have hopt := countermonotone_le_product_expectation (isCoupling_comonotoneCoupling Y W) hY2 hW2 have hrest : volume.restrict (Ioc (0 : ℝ) 1) = unifOI := by rw [unifOI, restrict_Ioo_eq_restrict_Ioc] have hcounter : (∫ p, p.1 * p.2 ∂(Causalean.Stat.countermonotoneCoupling Y W)) = ∫ u in (0 : ℝ)..1, quantile Y u * quantile W (1 - u) := by unfold Causalean.Stat.countermonotoneCoupling let r : ℝ → ℝ := fun u => 1 - u have hr : Measurable r := measurable_const.sub measurable_id have hWmap : AEMeasurable (quantile W) (Causalean.Stat.unifOI.map r) := by simpa [r, map_one_sub_unifOI] using (aemeasurable_quantile_unifOI W) have hWr : AEMeasurable (fun u : ℝ => quantile W (1 - u)) unifOI := by simpa [r, Function.comp_def] using hWmap.comp_measurable hr rw [MeasureTheory.integral_map] · rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest] · exact (aemeasurable_quantile_unifOI Y).prodMk hWr · fun_prop have hcomono : (∫ p, p.1 * p.2 ∂(comonotoneCoupling Y W)) = ∫ u in (0 : ℝ)..1, quantile Y u * quantile W u := by rw [product_expectation_comonotoneCoupling Y W hY2 hW2, ← integral_Ioc_eq_integral_Ioo, intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), hrest] rw [hcounter, hcomono] at hopt simpa [Y, W] using hopt
CausalSmith.PartialID.UnlinkedPropensityAte.cell_lower_le_upper_of_overlap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSharpLength.lean:17
theorem muLower_le_muUpper_of_overlap

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
a :
muLower H g Prel hMass a ≤ muUpper H g Prel hMass a
Proof (Lean source)
lemma muLower_le_muUpper_of_overlap {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) (a : ArmSpace) : muLower H g Prel hMass a ≤ muUpper H g Prel hMass a := by letI : IsProbabilityMeasure H := hMass.1 letI : IsProbabilityMeasure Prel := hMass.2.1 have hfin := projectionPopulationCells_finite H g Prel hOverlap hMass.2.2.1 have hl := projectedArmEndpoint_population_eq H g Prel hMass hOverlap a false have hu := projectedArmEndpoint_population_eq H g Prel hMass hOverlap a true simp only [Bool.false_eq_true, if_false] at hl simp only [if_true] at hu rw [← hl, ← hu] unfold projectedArmEndpoint apply Finset.sum_le_sum intro r _ letI : IsFiniteMeasure (trialPopulationCells Prel a r) := hfin.1 a r letI : IsFiniteMeasure (scorePopulationCells H g a r) := hfin.2 a r let q := (trialPopulationCells Prel a r).real univ by_cases hq : 0 < q · dsimp [q] at hq simp only [hq, if_pos] apply mul_le_mul_of_nonneg_left · apply cell_lower_le_upper_of_overlap hOverlap a (trialPopulationCells Prel a r) (scorePopulationCells H g a r) hq exact projectionCompatible_populationCells H g Prel hMass hOverlap a r · exact le_of_lt hq · dsimp [q] at hq simp [hq]
CausalSmith.PartialID.UnlinkedPropensityAte.muLower_le_muUpper_of_overlap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSharpLength.lean:96
theorem sharpATELength_nonneg_of_overlap

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hMass :
hOverlap :
0 ≤ sharpATELength H g Prel hMass
Proof (Lean source)
theorem sharpATELength_nonneg_of_overlap {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) (hMass : CompatibleCellMasses H g Prel) (hOverlap : Overlap ε) : 0 ≤ sharpATELength H g Prel hMass := by have h₀ := muLower_le_muUpper_of_overlap H g Prel hMass hOverlap false have h₁ := muLower_le_muUpper_of_overlap H g Prel hMass hOverlap true unfold sharpATELength linarith
CausalSmith.PartialID.UnlinkedPropensityAte.sharpATELength_nonneg_of_overlap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSharpLength.lean:127
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionSieveApproximation 1 declarations Arbitrarily close finite candidates inside strict projection balls.

Arbitrarily close finite candidates inside strict projection balls.

theorem exists_sievedProjectionCandidate_close_of_slack

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
α :
ℝ
x :
σ :
hfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcompat :
η :
ℝ
hη :
0 < η
hout :
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r))
+ η
≤ 4 * J / (α * sqrt n)
hscore :
(∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r))
+ η
≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)
∃ b ∈ sievedProjectionCandidates g α x,
(∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η
Proof (Lean source)
lemma exists_sievedProjectionCandidate_close_of_slack {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤) (hcompat : ProjectionCompatible lam σ) (η : ℝ) (hη : 0 < η) (hout : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) + η ≤ 4 * J / (α * sqrt n)) (hscore : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) + η ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)) : ∃ b ∈ sievedProjectionCandidates g α x, (∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η := by classical obtain ⟨code, hsieve, hcompatB, hdist⟩ := exists_rationalSieveArray_close hOverlap lam σ hfinite hcompat η hη let b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε) := ((fun a r => synchronizedRationalOutcomeMeasure (code a r)), (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))) have hbfinite : ∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤ := by intro a r exact ⟨synchronizedRationalOutcomeMeasure_finite (code a r), synchronizedRationalScoreMeasure_finite hOverlap (code a r)⟩ have hnonnegOut : 0 ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (b.1 a r) := Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => outcomeCDFDistance_nonneg _ _)) have hnonnegScore : 0 ≤ ∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (b.2 a r) := Finset.sum_nonneg (fun a _ => Finset.sum_nonneg (fun r _ => scoreCDFDistance_nonneg hOverlap _ _)) have houtClose : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) ≤ 4 * J / (α * sqrt n) := by simp_rw [outcomeCDFDistance_symm (b.1 _ _) (lam _ _)] have hdist' : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (b.1 a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (b.2 a r)) < η := by simpa only [b, Finset.sum_add_distrib] using hdist linarith have hscoreClose : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m) := by simp_rw [scoreCDFDistance_symm (b.2 _ _) (σ _ _)] have hdist' : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (b.1 a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (b.2 a r)) < η := by simpa only [b, Finset.sum_add_distrib] using hdist linarith refine ⟨b, ?_, ?_⟩ · exact ⟨projectionCandidate_of_strict_population_slack hOverlap g α x lam σ b hbfinite hcompatB hfinite houtClose hscoreClose, hsieve⟩ · exact hdist
CausalSmith.PartialID.UnlinkedPropensityAte.exists_sievedProjectionCandidate_close_of_slack · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveApproximation.lean:14
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionSieveDensity 10 declarations Exact-mass rational encodings for the external projection sieve.

Exact-mass rational encodings for the external projection sieve.

The outcome and score locations may differ, but every atom uses one shared rational weight. This supplies the synchronized finite arrays needed by an eventual density argument for the equal-mass projection candidates.

def ProjectionRationalAtom

This definition introduces the corresponding mathematical object.

Definition (Lean source)
ProjectionRationalAtom :
Type
ℚ × ℚ × ℚ
CausalSmith.PartialID.UnlinkedPropensityAte.ProjectionRationalAtom · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:19
def synchronizedRationalOutcomeMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
synchronizedRationalOutcomeMeasure l :
rationalOutcomeMeasure (l.map fun p => (p.1, p.2.2))
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalOutcomeMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:22
def synchronizedRationalScoreMeasure

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
synchronizedRationalScoreMeasure ε hOverlap l :
rationalScoreMeasure ε hOverlap (l.map fun p => (p.2.1, p.2.2))
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalScoreMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:27
theorem rationalOutcomeMeasure_apply_univ

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
l :
List (ℚ × ℚ)
rationalOutcomeMeasure l univ = (l.map fun p => ofReal (p.2 : ℝ)).sum
Proof (Lean source)
lemma rationalOutcomeMeasure_apply_univ (l : List (ℚ × ℚ)) : rationalOutcomeMeasure l univ = (l.map fun p => ofReal (p.2 : ℝ)).sum := by induction l with | nil => simp [rationalOutcomeMeasure] | cons p l ih => change (ofReal (p.2 : ℝ) • Measure.dirac (rationalOutcomePoint p.1)) univ + rationalOutcomeMeasure l univ = ofReal (p.2 : ℝ) + (l.map fun p => ofReal (p.2 : ℝ)).sum rw [ih] simp
CausalSmith.PartialID.UnlinkedPropensityAte.rationalOutcomeMeasure_apply_univ · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:32
theorem rationalScoreMeasure_apply_univ

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
l :
List (ℚ × ℚ)
rationalScoreMeasure ε hOverlap l univ = (l.map fun p => ofReal (p.2 : ℝ)).sum
Proof (Lean source)
lemma rationalScoreMeasure_apply_univ {ε : ℝ} (hOverlap : Overlap ε) (l : List (ℚ × ℚ)) : rationalScoreMeasure ε hOverlap l univ = (l.map fun p => ofReal (p.2 : ℝ)).sum := by induction l with | nil => simp [rationalScoreMeasure] | cons p l ih => change (ofReal (p.2 : ℝ) • Measure.dirac (rationalScorePoint ε hOverlap p.1)) univ + rationalScoreMeasure ε hOverlap l univ = ofReal (p.2 : ℝ) + (l.map fun p => ofReal (p.2 : ℝ)).sum rw [ih] simp
CausalSmith.PartialID.UnlinkedPropensityAte.rationalScoreMeasure_apply_univ · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:47
theorem synchronizedRationalMeasure_mass_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
Proof (Lean source)
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalMeasure_mass_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:63
theorem synchronizedRationalArray_compatible

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
ProjectionCompatible (fun a r => synchronizedRationalOutcomeMeasure (code a r)) (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))
Proof (Lean source)
lemma synchronizedRationalArray_compatible {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (code : ArmSpace → LabelSpace J → List ProjectionRationalAtom) : ProjectionCompatible (fun a r => synchronizedRationalOutcomeMeasure (code a r)) (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r)) := by intro a r exact congrArg toReal (synchronizedRationalMeasure_mass_eq hOverlap (code a r))
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalArray_compatible · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:76
theorem synchronizedRationalArray_mem_sieve

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
((fun a r => synchronizedRationalOutcomeMeasure (code a r)), (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))) ∈ rationalArraySieve ε J
Proof (Lean source)
lemma synchronizedRationalArray_mem_sieve {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (code : ArmSpace → LabelSpace J → List ProjectionRationalAtom) : ((fun a r => synchronizedRationalOutcomeMeasure (code a r)), (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))) ∈ rationalArraySieve ε J := by classical unfold rationalArraySieve simp only [dif_pos hOverlap, Set.mem_inter_iff, Set.mem_range, Set.mem_setOf_eq] constructor · refine ⟨((fun a r => (code a r).map fun p => (p.1, p.2.2)), (fun a r => (code a r).map fun p => (p.2.1, p.2.2))), ?_⟩ rfl · exact synchronizedRationalArray_compatible hOverlap code
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalArray_mem_sieve · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:87
theorem synchronizedRationalOutcomeMeasure_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma synchronizedRationalOutcomeMeasure_finite (l : List ProjectionRationalAtom) : synchronizedRationalOutcomeMeasure l univ < ⊤ := by rw [synchronizedRationalOutcomeMeasure, rationalOutcomeMeasure_apply_univ] induction l with | nil => simp | cons p l ih => simp only [List.map_cons, List.sum_cons, ENNReal.add_lt_top] exact ⟨ENNReal.ofReal_lt_top, ih⟩
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalOutcomeMeasure_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:103
theorem synchronizedRationalScoreMeasure_finite

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
Proof (Lean source)
lemma synchronizedRationalScoreMeasure_finite {ε : ℝ} (hOverlap : Overlap ε) (l : List ProjectionRationalAtom) : synchronizedRationalScoreMeasure ε hOverlap l univ < ⊤ := by rw [synchronizedRationalScoreMeasure, rationalScoreMeasure_apply_univ hOverlap] induction l with | nil => simp | cons p l ih => simp only [List.map_cons, List.sum_cons, ENNReal.add_lt_top] exact ⟨ENNReal.ofReal_lt_top, ih⟩
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedRationalScoreMeasure_finite · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensity.lean:114
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.ProjectionSieveDensityBridge 27 declarations Bridge from synchronized real-line atomic approximation to the paper's compact-carrier projection sieve.

Bridge from synchronized real-line atomic approximation to the paper's compact-carrier projection sieve.

theorem outcomeCDFDistance_eq_realCdfDistance

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
= cdfDistance 0 1 (μ.map (fun y : OutcomeSpace => (y : ℝ))) (ν.map (fun y : OutcomeSpace => (y : ℝ)))
Proof (Lean source)
lemma outcomeCDFDistance_eq_realCdfDistance (μ ν : Measure OutcomeSpace) : outcomeCDFDistance μ ν = cdfDistance 0 1 (μ.map (fun y : OutcomeSpace => (y : ℝ))) (ν.map (fun y : OutcomeSpace => (y : ℝ))) := by unfold outcomeCDFDistance cdfDistance rw [Measure.real_def, Measure.real_def, Measure.real_def, Measure.real_def] rw [Measure.map_apply (by fun_prop : Measurable fun y : OutcomeSpace => (y : ℝ)) MeasurableSet.univ, Measure.map_apply (by fun_prop : Measurable fun y : OutcomeSpace => (y : ℝ)) MeasurableSet.univ] simp only [preimage_univ] congr 1 apply intervalIntegral.integral_congr intro t ht dsimp simp only [Measure.real_def] rw [Measure.map_apply (by fun_prop : Measurable fun y : OutcomeSpace => (y : ℝ)) measurableSet_Iic, Measure.map_apply (by fun_prop : Measurable fun y : OutcomeSpace => (y : ℝ)) measurableSet_Iic] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance_eq_realCdfDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:16
theorem scoreCDFDistance_eq_realCdfDistance

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
μ ν :
= cdfDistance ε (1 - ε) (μ.map (fun e : ScoreSpace ε => (e : ℝ))) (ν.map (fun e : ScoreSpace ε => (e : ℝ)))
Proof (Lean source)
lemma scoreCDFDistance_eq_realCdfDistance {ε : ℝ} (μ ν : Measure (ScoreSpace ε)) : scoreCDFDistance μ ν = cdfDistance ε (1 - ε) (μ.map (fun e : ScoreSpace ε => (e : ℝ))) (ν.map (fun e : ScoreSpace ε => (e : ℝ))) := by unfold scoreCDFDistance cdfDistance rw [Measure.real_def, Measure.real_def, Measure.real_def, Measure.real_def] rw [Measure.map_apply (by fun_prop : Measurable fun e : ScoreSpace ε => (e : ℝ)) MeasurableSet.univ, Measure.map_apply (by fun_prop : Measurable fun e : ScoreSpace ε => (e : ℝ)) MeasurableSet.univ] simp only [preimage_univ] congr 1 apply intervalIntegral.integral_congr intro t ht dsimp simp only [Measure.real_def] rw [Measure.map_apply (by fun_prop : Measurable fun e : ScoreSpace ε => (e : ℝ)) measurableSet_Iic, Measure.map_apply (by fun_prop : Measurable fun e : ScoreSpace ε => (e : ℝ)) measurableSet_Iic] rfl
CausalSmith.PartialID.UnlinkedPropensityAte.scoreCDFDistance_eq_realCdfDistance · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:39
def realOutcomePoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
x :
ℝ
realOutcomePoint x :
⟨max 0 (min 1 x), by constructor · exact le_max_left _ _ · exact max_le (by norm_num) (min_le_left _ _)⟩
theorem realOutcomePoint_continuous

This result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma realOutcomePoint_continuous : Continuous realOutcomePoint := by unfold realOutcomePoint exact Continuous.subtype_mk (continuous_const.max (continuous_const.min continuous_id)) _
CausalSmith.PartialID.UnlinkedPropensityAte.realOutcomePoint_continuous · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:69
theorem realOutcomePoint_surjective

This result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma realOutcomePoint_surjective : Surjective realOutcomePoint := by intro y refine ⟨(y : ℝ), ?_⟩ apply Subtype.ext simp [realOutcomePoint, y.property.1, y.property.2]
CausalSmith.PartialID.UnlinkedPropensityAte.realOutcomePoint_surjective · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:74
theorem rationalOutcomePoint_denseRange

This result establishes the stated mathematical conclusion.

Formal statement
DenseRange (rationalOutcomePoint : ℚ → OutcomeSpace)
Proof (Lean source)
lemma rationalOutcomePoint_denseRange : DenseRange (rationalOutcomePoint : ℚ → OutcomeSpace) := by have h := DenseRange.comp realOutcomePoint_surjective.denseRange (Rat.denseRange_cast : DenseRange ((↑) : ℚ → ℝ)) realOutcomePoint_continuous convert h using 1 funext q rfl
CausalSmith.PartialID.UnlinkedPropensityAte.rationalOutcomePoint_denseRange · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:80
def outcomeToScore

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
outcomeToScore hOverlap y :
⟨ε + (1 - 2 * ε) * (y : ℝ), by have hw : 0
≤ 1
- 2 * ε := by linarith [hOverlap.2] constructor · nlinarith [y.property.1] · nlinarith [y.property.2]⟩
theorem outcomeToScore_continuous

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
Proof (Lean source)
lemma outcomeToScore_continuous {ε : ℝ} (hOverlap : Overlap ε) : Continuous (outcomeToScore hOverlap) := by unfold outcomeToScore exact Continuous.subtype_mk (by fun_prop) _
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeToScore_continuous · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:97
theorem outcomeToScore_surjective

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
Proof (Lean source)
lemma outcomeToScore_surjective {ε : ℝ} (hOverlap : Overlap ε) : Surjective (outcomeToScore hOverlap) := by intro e have hw : 0 < 1 - 2 * ε := by linarith [hOverlap.2] let y : OutcomeSpace := ⟨((e : ℝ) - ε) / (1 - 2 * ε), by constructor · exact div_nonneg (sub_nonneg.mpr e.property.1) hw.le · apply (div_le_one hw).2 linarith [e.property.2]⟩ refine ⟨y, ?_⟩ apply Subtype.ext change ε + (1 - 2 * ε) * (((e : ℝ) - ε) / (1 - 2 * ε)) = (e : ℝ) have hcancel : (1 - 2 * ε) * (((e : ℝ) - ε) / (1 - 2 * ε)) = (e : ℝ) - ε := by exact mul_div_cancel₀ _ (ne_of_gt hw) linarith
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeToScore_surjective · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:102
theorem rationalScorePoint_denseRange

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
DenseRange (rationalScorePoint ε hOverlap : ℚ → ScoreSpace ε)
Proof (Lean source)
lemma rationalScorePoint_denseRange {ε : ℝ} (hOverlap : Overlap ε) : DenseRange (rationalScorePoint ε hOverlap : ℚ → ScoreSpace ε) := by have h := DenseRange.comp (outcomeToScore_surjective hOverlap).denseRange rationalOutcomePoint_denseRange (outcomeToScore_continuous hOverlap) convert h using 1 funext q rfl
CausalSmith.PartialID.UnlinkedPropensityAte.rationalScorePoint_denseRange · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:119
def outcomeSieveLocations

This definition introduces the corresponding mathematical object.

Definition (Lean source)
outcomeSieveLocations :
Set ℝ
range (fun q : ℚ => (rationalOutcomePoint q : ℝ))
def scoreSieveLocations

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
hOverlap :
scoreSieveLocations hOverlap :
Set ℝ
range (fun q : ℚ => (rationalScorePoint ε hOverlap q : ℝ))
theorem outcomeSieveLocations_countable

This result establishes the stated mathematical conclusion.

Formal statement
outcomeSieveLocations.Countable
Proof (Lean source)
lemma outcomeSieveLocations_countable : outcomeSieveLocations.Countable := by unfold outcomeSieveLocations exact Set.countable_range _
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeSieveLocations_countable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:135
theorem scoreSieveLocations_countable

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
(scoreSieveLocations hOverlap).Countable
Proof (Lean source)
lemma scoreSieveLocations_countable {ε : ℝ} (hOverlap : Overlap ε) : (scoreSieveLocations hOverlap).Countable := by unfold scoreSieveLocations exact Set.countable_range _
CausalSmith.PartialID.UnlinkedPropensityAte.scoreSieveLocations_countable · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:139
theorem outcomeSieveLocations_subset

This result establishes the stated mathematical conclusion.

Formal statement
outcomeSieveLocations ⊆ Icc (0 : ℝ) 1
Proof (Lean source)
lemma outcomeSieveLocations_subset : outcomeSieveLocations ⊆ Icc (0 : ℝ) 1 := by rintro x ⟨q, rfl⟩ exact (rationalOutcomePoint q).property
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeSieveLocations_subset · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:144
theorem scoreSieveLocations_subset

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
scoreSieveLocations hOverlap ⊆ Icc ε (1 - ε)
Proof (Lean source)
lemma scoreSieveLocations_subset {ε : ℝ} (hOverlap : Overlap ε) : scoreSieveLocations hOverlap ⊆ Icc ε (1 - ε) := by rintro x ⟨q, rfl⟩ exact (rationalScorePoint ε hOverlap q).property
CausalSmith.PartialID.UnlinkedPropensityAte.scoreSieveLocations_subset · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:148
theorem outcomeSieveLocations_dense

This result establishes the stated mathematical conclusion.

Formal statement
Dense ((Subtype.val : OutcomeSpace → ℝ) ⁻¹' outcomeSieveLocations)
Proof (Lean source)
lemma outcomeSieveLocations_dense : Dense ((Subtype.val : OutcomeSpace → ℝ) ⁻¹' outcomeSieveLocations) := by have heq : ((Subtype.val : OutcomeSpace → ℝ) ⁻¹' outcomeSieveLocations) = range (rationalOutcomePoint : ℚ → OutcomeSpace) := by ext y constructor · rintro ⟨q, hq⟩ exact ⟨q, Subtype.ext hq⟩ · rintro ⟨q, rfl⟩ exact ⟨q, rfl⟩ rw [heq] exact rationalOutcomePoint_denseRange
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeSieveLocations_dense · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:153
theorem scoreSieveLocations_dense

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
Dense ((Subtype.val : ScoreSpace ε → ℝ) ⁻¹' scoreSieveLocations hOverlap)
Proof (Lean source)
lemma scoreSieveLocations_dense {ε : ℝ} (hOverlap : Overlap ε) : Dense ((Subtype.val : ScoreSpace ε → ℝ) ⁻¹' scoreSieveLocations hOverlap) := by have heq : ((Subtype.val : ScoreSpace ε → ℝ) ⁻¹' scoreSieveLocations hOverlap) = range (rationalScorePoint ε hOverlap : ℚ → ScoreSpace ε) := by ext e constructor · rintro ⟨q, hq⟩ exact ⟨q, Subtype.ext hq⟩ · rintro ⟨q, rfl⟩ exact ⟨q, rfl⟩ rw [heq] exact rationalScorePoint_denseRange hOverlap
CausalSmith.PartialID.UnlinkedPropensityAte.scoreSieveLocations_dense · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:166
theorem exists_synchronized_sieveLocations_cell_approx

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
ν :
hmass :
μ.real univ = ν.real univ
η :
ℝ
hη :
0 < η
∃ (N : ℕ) (hN : 0 < N) (q : ℚ),
0 ≤ q
conclusion 1
∃ (x : Fin N → outcomeSieveLocations) (y : Fin N → scoreSieveLocations hOverlap),
(equalAtomMeasure N (q : ℝ) (fun i => (x i : ℝ))).real univ
= (q : ℝ)
(equalAtomMeasure N (q : ℝ) (fun i => (y i : ℝ))).real univ
= (q : ℝ)
cdfDistance 0 1 (μ.map (fun z : OutcomeSpace => (z : ℝ))) (equalAtomMeasure N (q : ℝ) (fun i => (x i : ℝ)))
+ cdfDistance ε (1 - ε) (ν.map (fun z : ScoreSpace ε => (z : ℝ))) (equalAtomMeasure N (q : ℝ) (fun i => (y i : ℝ))) < η
Proof (Lean source)
lemma exists_synchronized_sieveLocations_cell_approx {ε : ℝ} (hOverlap : Overlap ε) (μ : Measure OutcomeSpace) (ν : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hmass : μ.real univ = ν.real univ) (η : ℝ) (hη : 0 < η) : ∃ (N : ℕ) (hN : 0 < N) (q : ℚ), 0 ≤ q ∧ ∃ (x : Fin N → outcomeSieveLocations) (y : Fin N → scoreSieveLocations hOverlap), (equalAtomMeasure N (q : ℝ) (fun i => (x i : ℝ))).real univ = (q : ℝ) ∧ (equalAtomMeasure N (q : ℝ) (fun i => (y i : ℝ))).real univ = (q : ℝ) ∧ cdfDistance 0 1 (μ.map (fun z : OutcomeSpace => (z : ℝ))) (equalAtomMeasure N (q : ℝ) (fun i => (x i : ℝ))) + cdfDistance ε (1 - ε) (ν.map (fun z : ScoreSpace ε => (z : ℝ))) (equalAtomMeasure N (q : ℝ) (fun i => (y i : ℝ))) < η := by let μr : Measure ℝ := μ.map (fun z : OutcomeSpace => (z : ℝ)) let νr : Measure ℝ := ν.map (fun z : ScoreSpace ε => (z : ℝ)) letI : IsFiniteMeasure μr := Measure.isFiniteMeasure_map μ _ letI : IsFiniteMeasure νr := Measure.isFiniteMeasure_map ν _ have hμ : μr (Icc (0 : ℝ) 1)ᶜ = 0 := by rw [Measure.map_apply (by fun_prop : Measurable fun z : OutcomeSpace => (z : ℝ)) measurableSet_Icc.compl] have he : (fun z : OutcomeSpace => (z : ℝ)) ⁻¹' (Icc (0 : ℝ) 1)ᶜ = ∅ := by ext z simp [z.property] simp [he] have hν : νr (Icc ε (1 - ε))ᶜ = 0 := by rw [Measure.map_apply (by fun_prop : Measurable fun z : ScoreSpace ε => (z : ℝ)) measurableSet_Icc.compl] have he : (fun z : ScoreSpace ε => (z : ℝ)) ⁻¹' (Icc ε (1 - ε))ᶜ = ∅ := by ext z simp [z.property] simp [he] have hm : μr.real univ = νr.real univ := by simp only [μr, νr, Measure.real_def] rw [Measure.map_apply (by fun_prop : Measurable fun z : OutcomeSpace => (z : ℝ)) MeasurableSet.univ, Measure.map_apply (by fun_prop : Measurable fun z : ScoreSpace ε => (z : ℝ)) MeasurableSet.univ] simpa only [preimage_univ, ← Measure.real_def] using hmass exact exists_synchronized_rational_equalAtom_approx μr νr 0 1 ε (1 - ε) (by norm_num) (by linarith [hOverlap.2]) hμ hν hm outcomeSieveLocations (scoreSieveLocations hOverlap) outcomeSieveLocations_dense (scoreSieveLocations_dense hOverlap) η hη
CausalSmith.PartialID.UnlinkedPropensityAte.exists_synchronized_sieveLocations_cell_approx · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:180
theorem synchronizedOutcome_map_eq_equalAtom

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
N :
ℕ
q :
ℚ
x y :
Fin N → ℚ
(synchronizedRationalOutcomeMeasure (List.ofFn fun i : Fin N => (x i, y i, q / N))).map (fun z : OutcomeSpace => (z : ℝ))
= equalAtomMeasure N (q : ℝ) (fun i => (rationalOutcomePoint (x i) : ℝ))
Proof (Lean source)
lemma synchronizedOutcome_map_eq_equalAtom {N : ℕ} (q : ℚ) (x y : Fin N → ℚ) : (synchronizedRationalOutcomeMeasure (List.ofFn fun i : Fin N => (x i, y i, q / N))).map (fun z : OutcomeSpace => (z : ℝ)) = equalAtomMeasure N (q : ℝ) (fun i => (rationalOutcomePoint (x i) : ℝ)) := by unfold synchronizedRationalOutcomeMeasure rationalOutcomeMeasure equalAtomMeasure simp only [List.map_ofFn, List.sum_ofFn] let f : OutcomeSpace → ℝ := fun z => (z : ℝ) let M : Fin N → Measure OutcomeSpace := fun i => ofReal ((q / N : ℚ) : ℝ) • Measure.dirac (rationalOutcomePoint (x i)) change (∑ i, M i).map f = _ have hmap (s : Finset (Fin N)) : (∑ i ∈ s, M i).map f = ∑ i ∈ s, (M i).map f := by induction s using Finset.induction_on with | empty => simp | insert a s ha ih => simp only [Finset.sum_insert ha] rw [Measure.map_add _ _ (by fun_prop : Measurable f), ih] rw [show (∑ i : Fin N, M i).map f = ∑ i : Fin N, (M i).map f by simpa using hmap univ] apply Finset.sum_congr rfl intro i hi rw [Measure.map_smul, Measure.map_dirac'] · simp [f, Rat.cast_div, Rat.cast_natCast] · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedOutcome_map_eq_equalAtom · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:232
theorem synchronizedScore_map_eq_equalAtom

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
N :
ℕ
q :
ℚ
x y :
Fin N → ℚ
(synchronizedRationalScoreMeasure ε hOverlap (List.ofFn fun i : Fin N => (x i, y i, q / N))).map (fun z : ScoreSpace ε => (z : ℝ))
= equalAtomMeasure N (q : ℝ) (fun i => (rationalScorePoint ε hOverlap (y i) : ℝ))
Proof (Lean source)
lemma synchronizedScore_map_eq_equalAtom {ε : ℝ} (hOverlap : Overlap ε) {N : ℕ} (q : ℚ) (x y : Fin N → ℚ) : (synchronizedRationalScoreMeasure ε hOverlap (List.ofFn fun i : Fin N => (x i, y i, q / N))).map (fun z : ScoreSpace ε => (z : ℝ)) = equalAtomMeasure N (q : ℝ) (fun i => (rationalScorePoint ε hOverlap (y i) : ℝ)) := by unfold synchronizedRationalScoreMeasure rationalScoreMeasure equalAtomMeasure simp only [List.map_ofFn, List.sum_ofFn] let f : ScoreSpace ε → ℝ := fun z => (z : ℝ) let M : Fin N → Measure (ScoreSpace ε) := fun i => ofReal ((q / N : ℚ) : ℝ) • Measure.dirac (rationalScorePoint ε hOverlap (y i)) change (∑ i, M i).map f = _ have hmap (s : Finset (Fin N)) : (∑ i ∈ s, M i).map f = ∑ i ∈ s, (M i).map f := by induction s using Finset.induction_on with | empty => simp | insert a s ha ih => simp only [Finset.sum_insert ha] rw [Measure.map_add _ _ (by fun_prop : Measurable f), ih] rw [show (∑ i : Fin N, M i).map f = ∑ i : Fin N, (M i).map f by simpa using hmap univ] apply Finset.sum_congr rfl intro i hi rw [Measure.map_smul, Measure.map_dirac'] · simp [f, Rat.cast_div, Rat.cast_natCast] · fun_prop
CausalSmith.PartialID.UnlinkedPropensityAte.synchronizedScore_map_eq_equalAtom · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:262
theorem exists_synchronizedRationalCode_cell_approx

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
hOverlap :
ν :
hmass :
μ.real univ = ν.real univ
η :
ℝ
hη :
0 < η
Proof (Lean source)
lemma exists_synchronizedRationalCode_cell_approx {ε : ℝ} (hOverlap : Overlap ε) (μ : Measure OutcomeSpace) (ν : Measure (ScoreSpace ε)) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (hmass : μ.real univ = ν.real univ) (η : ℝ) (hη : 0 < η) : ∃ code : List ProjectionRationalAtom, outcomeCDFDistance μ (synchronizedRationalOutcomeMeasure code) + scoreCDFDistance ν (synchronizedRationalScoreMeasure ε hOverlap code) < η := by classical obtain ⟨N, hN, q, hq, x, y, hmx, hmy, hdist⟩ := exists_synchronized_sieveLocations_cell_approx hOverlap μ ν hmass η hη let xq : Fin N → ℚ := fun i => choose (x i).property let yq : Fin N → ℚ := fun i => choose (y i).property have hx (i : Fin N) : (rationalOutcomePoint (xq i) : ℝ) = (x i : ℝ) := Classical.choose_spec (x i).property have hy (i : Fin N) : (rationalScorePoint ε hOverlap (yq i) : ℝ) = (y i : ℝ) := Classical.choose_spec (y i).property let code : List ProjectionRationalAtom := List.ofFn fun i : Fin N => (xq i, yq i, q / N) refine ⟨code, ?_⟩ have hout : (synchronizedRationalOutcomeMeasure code).map (fun z : OutcomeSpace => (z : ℝ)) = equalAtomMeasure N (q : ℝ) (fun i => (x i : ℝ)) := by rw [show code = List.ofFn (fun i : Fin N => (xq i, yq i, q / N)) from rfl, synchronizedOutcome_map_eq_equalAtom] congr 1 funext i exact hx i have hscore : (synchronizedRationalScoreMeasure ε hOverlap code).map (fun z : ScoreSpace ε => (z : ℝ)) = equalAtomMeasure N (q : ℝ) (fun i => (y i : ℝ)) := by rw [show code = List.ofFn (fun i : Fin N => (xq i, yq i, q / N)) from rfl, synchronizedScore_map_eq_equalAtom] congr 1 funext i exact hy i rw [outcomeCDFDistance_eq_realCdfDistance, scoreCDFDistance_eq_realCdfDistance, hout, hscore] exact hdist
CausalSmith.PartialID.UnlinkedPropensityAte.exists_synchronizedRationalCode_cell_approx · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:292
theorem exists_rationalSieveArray_close

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
σ :
hfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcompat :
η :
ℝ
hη :
0 < η
let b := ((fun a r => synchronizedRationalOutcomeMeasure (code a r)), (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))) b ∈ rationalArraySieve ε J ∧
(∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η
Proof (Lean source)
lemma exists_rationalSieveArray_close {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤) (hcompat : ProjectionCompatible lam σ) (η : ℝ) (hη : 0 < η) : ∃ code : ArmSpace → LabelSpace J → List ProjectionRationalAtom, let b := ((fun a r => synchronizedRationalOutcomeMeasure (code a r)), (fun a r => synchronizedRationalScoreMeasure ε hOverlap (code a r))) b ∈ rationalArraySieve ε J ∧ ProjectionCompatible b.1 b.2 ∧ (∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η := by classical let δ : ℝ := η / (2 * (J + 1)) have hδ : 0 < δ := by dsimp [δ]; positivity have hcell (a : ArmSpace) (r : LabelSpace J) : ∃ code : List ProjectionRationalAtom, outcomeCDFDistance (lam a r) (synchronizedRationalOutcomeMeasure code) + scoreCDFDistance (σ a r) (synchronizedRationalScoreMeasure ε hOverlap code) < δ := by letI : IsFiniteMeasure (lam a r) := ⟨(hfinite a r).1⟩ letI : IsFiniteMeasure (σ a r) := ⟨(hfinite a r).2⟩ exact exists_synchronizedRationalCode_cell_approx hOverlap (lam a r) (σ a r) (hcompat a r) δ hδ let code : ArmSpace → LabelSpace J → List ProjectionRationalAtom := fun a r => choose (hcell a r) have hbound (a : ArmSpace) (r : LabelSpace J) := Classical.choose_spec (hcell a r) refine ⟨code, synchronizedRationalArray_mem_sieve hOverlap code, synchronizedRationalArray_compatible hOverlap code, ?_⟩ have hsum : (∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (synchronizedRationalOutcomeMeasure (code a r)) + scoreCDFDistance (σ a r) (synchronizedRationalScoreMeasure ε hOverlap (code a r)))) ≤ ∑ a : ArmSpace, ∑ _r : LabelSpace J, δ := by apply Finset.sum_le_sum intro a ha apply Finset.sum_le_sum intro r hr exact (hbound a r).le have hcard : (∑ a : ArmSpace, ∑ _r : LabelSpace J, δ) = (2 * (J : ℝ)) * δ := by simp ring rw [hcard] at hsum calc _ ≤ (2 * (J : ℝ)) * δ := hsum _ < η := by dsimp [δ] have hden : (0 : ℝ) < 2 * ((J : ℝ) + 1) := by positivity calc 2 * (J : ℝ) * (η / (2 * ((J : ℝ) + 1))) = (2 * (J : ℝ) * η) / (2 * ((J : ℝ) + 1)) := by ring _ < η := (div_lt_iff₀ hden).2 (by nlinarith [hη])
CausalSmith.PartialID.UnlinkedPropensityAte.exists_rationalSieveArray_close · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:336
theorem outcomeCDFDistance_symm

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
Proof (Lean source)
lemma outcomeCDFDistance_symm (μ ν : Measure OutcomeSpace) : outcomeCDFDistance μ ν = outcomeCDFDistance ν μ := by unfold outcomeCDFDistance rw [abs_sub_comm] congr 1 apply intervalIntegral.integral_congr intro t ht dsimp rw [abs_sub_comm]
CausalSmith.PartialID.UnlinkedPropensityAte.outcomeCDFDistance_symm · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:393
theorem scoreCDFDistance_symm

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
μ ν :
Proof (Lean source)
lemma scoreCDFDistance_symm {ε : ℝ} (μ ν : Measure (ScoreSpace ε)) : scoreCDFDistance μ ν = scoreCDFDistance ν μ := by unfold scoreCDFDistance rw [abs_sub_comm] congr 1 apply intervalIntegral.integral_congr intro t ht dsimp rw [abs_sub_comm]
theorem projectionCandidate_of_strict_population_slack

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J n m :
ℕ
hOverlap :
g :
α :
ℝ
x :
σ :
hbfinite :
∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤
hcompat :
hlamfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcloseOut :
(∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r))
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r))
≤ 4 * J / (α * sqrt n)
hcloseScore :
(∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r))
+ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r))
≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)
Proof (Lean source)
lemma projectionCandidate_of_strict_population_slack {ε : ℝ} {J n m : ℕ} (hOverlap : Overlap ε) (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (x : ExternalSample ε J n m) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (b : ArmCellArray J OutcomeSpace × ArmCellArray J (ScoreSpace ε)) (hbfinite : ∀ a r, (b.1 a r) univ < ⊤ ∧ (b.2 a r) univ < ⊤) (hcompat : ProjectionCompatible b.1 b.2) (hlamfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤) (hcloseOut : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) ≤ 4 * J / (α * sqrt n)) (hcloseScore : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) ≤ 2 * J * (2 - 2 * ε) / (α * sqrt m)) : b ∈ projectionCandidates g α x := by refine ⟨hbfinite, hcompat, ?_, ?_⟩ · have htri (a : ArmSpace) (r : LabelSpace J) := outcomeCDFDistance_triangle (b.1 a r) (lam a r) (empiricalTrialCells x.1 a r) (hbfinite a r).1 (hlamfinite a r).1 (empiricalTrialCells_finite x.1 a r) have hsum : (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (empiricalTrialCells x.1 a r)) ≤ (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (b.1 a r) (lam a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, outcomeCDFDistance (lam a r) (empiricalTrialCells x.1 a r)) := by simp_rw [← Finset.sum_add_distrib] apply Finset.sum_le_sum intro a ha apply Finset.sum_le_sum intro r hr exact htri a r exact hsum.trans hcloseOut · have htri (a : ArmSpace) (r : LabelSpace J) := scoreCDFDistance_triangle hOverlap (b.2 a r) (σ a r) (empiricalScoreCells g x.2 a r) (hbfinite a r).2 (hlamfinite a r).2 (empiricalScoreCells_finite g x.2 a r) have hsum : (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (empiricalScoreCells g x.2 a r)) ≤ (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (b.2 a r) (σ a r)) + (∑ a : ArmSpace, ∑ r : LabelSpace J, scoreCDFDistance (σ a r) (empiricalScoreCells g x.2 a r)) := by simp_rw [← Finset.sum_add_distrib] apply Finset.sum_le_sum intro a ha apply Finset.sum_le_sum intro r hr exact htri a r exact hsum.trans hcloseScore
CausalSmith.PartialID.UnlinkedPropensityAte.projectionCandidate_of_strict_population_slack · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/ProjectionSieveDensityBridge.lean:414
theorem rationalSieve_dense

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
hOverlap :
σ :
hfinite :
∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤
hcompat :
η :
ℝ
hη :
0 < η
∃ b ∈ rationalArraySieve ε J,
conclusion 1
conclusion 2
(∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η
Proof (Lean source)
lemma rationalSieve_dense {ε : ℝ} {J : ℕ} (hOverlap : Overlap ε) (lam : ArmCellArray J OutcomeSpace) (σ : ArmCellArray J (ScoreSpace ε)) (hfinite : ∀ a r, (lam a r) univ < ⊤ ∧ (σ a r) univ < ⊤) (hcompat : ProjectionCompatible lam σ) (η : ℝ) (hη : 0 < η) : ∃ b ∈ rationalArraySieve ε J, ProjectionCompatible b.1 b.2 ∧ (∑ a : ArmSpace, ∑ r : LabelSpace J, (outcomeCDFDistance (lam a r) (b.1 a r) + scoreCDFDistance (σ a r) (b.2 a r))) < η := by obtain ⟨code, hb, hc, hd⟩ := exists_rationalSieveArray_close hOverlap lam σ hfinite hcompat η hη exact ⟨_, hb, hc, hd⟩
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.Helpers.Quantization 26 declarations Paired scalar quantization with a common measurable partition.

Paired scalar quantization with a common measurable partition.

def pairedPartitionCost

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
B :
Fin k → Set ℝ
z :
Fin k → Fin S → ℝ
pairedPartitionCost S k β B z :
ℝ
∑ j : Fin k, ∑ s : Fin S, ∫ x in B j, β s x (z j s) * |x - z j s|
CausalSmith.PartialID.UnlinkedPropensityAte.pairedPartitionCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:20
def optimalPairedCost

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a b :
ℝ
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
optimalPairedCost a b S k β :
ℝ
sInf {v : ℝ | ∃ (B : Fin k → Set ℝ) (z : Fin k → Fin S → ℝ), IsIntervalPartition a b k B ∧ (∀ j s, z j s ∈ Icc a b) ∧ v = pairedPartitionCost S k β B z}
CausalSmith.PartialID.UnlinkedPropensityAte.optimalPairedCost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:26
def pairedDiagonalWeight

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
S :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
x :
ℝ
pairedDiagonalWeight S β x :
ℝ
∑ s : Fin S, β s x x
CausalSmith.PartialID.UnlinkedPropensityAte.pairedDiagonalWeight · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:34
theorem pairedDiagonalWeight_pos Lemma pairedDiagonalWeight_pos in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
S :
ℕ
hS :
0 < S
β :
Fin S → ℝ → ℝ → ℝ
hpos :
∀ s x z
if
x ∈ Icc a b
and
z ∈ Icc a b
then
0 < β s x z
x :
ℝ
hx :
x ∈ Icc a b
Proof (Lean source)
lemma pairedDiagonalWeight_pos (a b : ℝ) (S : ℕ) (hS : 0 < S) (β : Fin S → ℝ → ℝ → ℝ) (hpos : ∀ s x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β s x z) (x : ℝ) (hx : x ∈ Icc a b) : 0 < pairedDiagonalWeight S β x := by unfold pairedDiagonalWeight have : Nonempty (Fin S) := Fin.pos_iff_nonempty.mp hS exact Finset.sum_pos (fun s _ => hpos s x x hx hx) univ_nonempty
CausalSmith.PartialID.UnlinkedPropensityAte.pairedDiagonalWeight_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:40
theorem pairedDiagonalWeight_continuousOn Lemma pairedDiagonalWeight_continuousOn in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
S :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
hcont :
∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)
Proof (Lean source)
lemma pairedDiagonalWeight_continuousOn (a b : ℝ) (S : ℕ) (β : Fin S → ℝ → ℝ → ℝ) (hcont : ∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)) : ContinuousOn (pairedDiagonalWeight S β) (Icc a b) := by unfold pairedDiagonalWeight apply continuousOn_finsetSum intro s hs exact (hcont s).comp (continuousOn_id.prodMk continuousOn_id) (fun x hx => ⟨hx, hx⟩)
CausalSmith.PartialID.UnlinkedPropensityAte.pairedDiagonalWeight_continuousOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:51
theorem pairedDiagonalWeight_uniform_bounds Lemma pairedDiagonalWeight_uniform_bounds in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
S :
ℕ
hS :
0 < S
β :
Fin S → ℝ → ℝ → ℝ
hcont :
∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Set.Icc a b ×ˢ Set.Icc a b)
hpos :
∀ s x z
if
x ∈ Set.Icc a b
and
z ∈ Set.Icc a b
then
0 < β s x z
∃ c C : ℝ,
0 < c
conclusion 1
x ∈ Set.Icc a b :
Proof (Lean source)
lemma pairedDiagonalWeight_uniform_bounds (a b : ℝ) (S : ℕ) (hS : 0 < S) (β : Fin S → ℝ → ℝ → ℝ) (hcont : ∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)) (hpos : ∀ s x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β s x z) : ∃ c C : ℝ, 0 < c ∧ ∀ x ∈ Icc a b, c ≤ pairedDiagonalWeight S β x ∧ pairedDiagonalWeight S β x ≤ C := by have hc := pairedDiagonalWeight_continuousOn a b S β hcont obtain ⟨c, hcpos, hclower⟩ := isCompact_Icc.exists_forall_le' hc (fun x hx => pairedDiagonalWeight_pos a b S hS β hpos x hx) obtain ⟨C, hC⟩ := isCompact_Icc.exists_bound_of_continuousOn hc refine ⟨c, C, hcpos, ?_⟩ intro x hx exact ⟨hclower x hx, le_trans (le_abs_self _) (by simpa using hC x hx)⟩
CausalSmith.PartialID.UnlinkedPropensityAte.pairedDiagonalWeight_uniform_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:65
theorem pairedCoefficient_uniform_bounds Lemma pairedCoefficient_uniform_bounds in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
β :
ℝ → ℝ → ℝ
hcont :
ContinuousOn (fun p : ℝ × ℝ => β p.1 p.2) (Set.Icc a b ×ˢ Set.Icc a b)
hpos :
∀ x z
if
x ∈ Set.Icc a b
and
z ∈ Set.Icc a b
then
0 < β x z
∃ c C : ℝ,
0 < c
conclusion 1
x ∈ Set.Icc a b :
z ∈ Set.Icc a b :
c ≤ β x z
β x z ≤ C
Proof (Lean source)
lemma pairedCoefficient_uniform_bounds (a b : ℝ) (hab : a ≤ b) (β : ℝ → ℝ → ℝ) (hcont : ContinuousOn (fun p : ℝ × ℝ => β p.1 p.2) (Icc a b ×ˢ Icc a b)) (hpos : ∀ x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β x z) : ∃ c C : ℝ, 0 < c ∧ ∀ x ∈ Icc a b, ∀ z ∈ Icc a b, c ≤ β x z ∧ β x z ≤ C := by have hcompact : IsCompact (Icc a b ×ˢ Icc a b) := isCompact_Icc.prod isCompact_Icc have hne : (Icc a b ×ˢ Icc a b).Nonempty := ⟨(a, a), ⟨⟨le_refl a, hab⟩, ⟨le_refl a, hab⟩⟩⟩ obtain ⟨c, hcpos, hclower⟩ := hcompact.exists_forall_le' hcont (fun p hp => hpos p.1 p.2 hp.1 hp.2) obtain ⟨C, hC⟩ := hcompact.exists_bound_of_continuousOn hcont refine ⟨c, C, hcpos, ?_⟩ intro x hx z hz exact ⟨hclower (x, z) ⟨hx, hz⟩, le_trans (le_abs_self _) (by simpa using hC (x, z) ⟨hx, hz⟩)⟩
CausalSmith.PartialID.UnlinkedPropensityAte.pairedCoefficient_uniform_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:84
theorem pairedCoefficients_uniform_bounds Lemma pairedCoefficients_uniform_bounds in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S :
ℕ
hS :
0 < S
β :
Fin S → ℝ → ℝ → ℝ
hcont :
∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Set.Icc a b ×ˢ Set.Icc a b)
hpos :
∀ s x z
if
x ∈ Set.Icc a b
and
z ∈ Set.Icc a b
then
0 < β s x z
∃ c C : ℝ,
0 < c
conclusion 1
s :
x ∈ Set.Icc a b :
z ∈ Set.Icc a b :
c ≤ β s x z
β s x z ≤ C
Proof (Lean source)
lemma pairedCoefficients_uniform_bounds (a b : ℝ) (hab : a ≤ b) (S : ℕ) (hS : 0 < S) (β : Fin S → ℝ → ℝ → ℝ) (hcont : ∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)) (hpos : ∀ s x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β s x z) : ∃ c C : ℝ, 0 < c ∧ ∀ s, ∀ x ∈ Icc a b, ∀ z ∈ Icc a b, c ≤ β s x z ∧ β s x z ≤ C := by classical have hsingle : ∀ s : Fin S, ∃ c C : ℝ, 0 < c ∧ ∀ x ∈ Icc a b, ∀ z ∈ Icc a b, c ≤ β s x z ∧ β s x z ≤ C := by intro s exact pairedCoefficient_uniform_bounds a b hab (β s) (hcont s) (hpos s) choose c C hc hbound using hsingle have hne : (Finset.univ : Finset (Fin S)).Nonempty := Finset.univ_nonempty_iff.mpr (Fin.pos_iff_nonempty.mp hS) obtain ⟨smin, _, hmin⟩ := Finset.exists_min_image Finset.univ c hne obtain ⟨smax, _, hmax⟩ := Finset.exists_max_image Finset.univ C hne refine ⟨c smin, C smax, hc smin, ?_⟩ intro s x hx z hz have hsmin := hmin s (Finset.mem_univ s) have hsmax := hmax s (Finset.mem_univ s) exact ⟨hsmin.trans (hbound s x hx z hz).1, (hbound s x hx z hz).2.trans hsmax⟩
CausalSmith.PartialID.UnlinkedPropensityAte.pairedCoefficients_uniform_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:105
def pairedBoundary

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a b :
ℝ
S k j :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
pairedBoundary a b S k j β :
ℝ
sInf {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * (∫ t in a..b, sqrt (pairedDiagonalWeight S β t)) ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)}
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBoundary · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:132

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
pairedBoundary a b S k 0 β = a
Proof (Lean source)
lemma pairedBoundary_zero (a b : ℝ) (hab : a ≤ b) (S k : ℕ) (β : Fin S → ℝ → ℝ → ℝ) : pairedBoundary a b S k 0 β = a := by unfold pairedBoundary apply IsLeast.csInf_eq constructor · simp [hab] · rintro x ⟨hx, _⟩ exact hx.1
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBoundary_zero · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:141

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S k j :
ℕ
hk :
0 < k
hj :
j ≤ k
β :
Fin S → ℝ → ℝ → ℝ
pairedBoundary a b S k j β ∈ Icc a b
Proof (Lean source)
lemma pairedBoundary_mem_Icc (a b : ℝ) (hab : a ≤ b) (S k j : ℕ) (hk : 0 < k) (hj : j ≤ k) (β : Fin S → ℝ → ℝ → ℝ) : pairedBoundary a b S k j β ∈ Icc a b := by let I : ℝ := ∫ t in a..b, sqrt (pairedDiagonalWeight S β t) have hI : 0 ≤ I := intervalIntegral.integral_nonneg_of_forall hab (fun t => Real.sqrt_nonneg _) have hjk : (j : ℝ) / k ≤ 1 := by apply (div_le_one (by exact_mod_cast hk)).mpr exact_mod_cast hj have hratio : 0 ≤ (j : ℝ) / k := by positivity have hfeasible : b ∈ {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} := by refine ⟨⟨hab, le_refl b⟩, ?_⟩ simpa [I] using mul_le_of_le_one_left hI hjk have hlower : a ≤ sInf {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} := by apply le_csInf ⟨b, hfeasible⟩ rintro x ⟨hx, _⟩ exact hx.1 have hupper : sInf {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} ≤ b := by apply csInf_le ⟨a, ?_⟩ hfeasible rintro x ⟨hx, _⟩ exact hx.1 exact ⟨hlower, hupper⟩
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBoundary_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:153

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S k i j :
ℕ
hk :
0 < k
hij :
i ≤ j
hj :
j ≤ k
β :
Fin S → ℝ → ℝ → ℝ
pairedBoundary a b S k i β ≤ pairedBoundary a b S k j β
Proof (Lean source)
lemma pairedBoundary_mono (a b : ℝ) (hab : a ≤ b) (S k i j : ℕ) (hk : 0 < k) (hij : i ≤ j) (hj : j ≤ k) (β : Fin S → ℝ → ℝ → ℝ) : pairedBoundary a b S k i β ≤ pairedBoundary a b S k j β := by let I : ℝ := ∫ t in a..b, sqrt (pairedDiagonalWeight S β t) have hI : 0 ≤ I := intervalIntegral.integral_nonneg_of_forall hab (fun t => Real.sqrt_nonneg _) have hsubset : {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} ⊆ {x : ℝ | x ∈ Icc a b ∧ (i : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} := by rintro x ⟨hx, hbound⟩ refine ⟨hx, ?_⟩ have hratio : (i : ℝ) / k ≤ (j : ℝ) / k := by apply div_le_div_of_nonneg_right (by exact_mod_cast hij) exact_mod_cast hk.le exact (mul_le_mul_of_nonneg_right hratio hI).trans hbound unfold pairedBoundary change sInf {x : ℝ | x ∈ Icc a b ∧ (i : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} ≤ sInf {x : ℝ | x ∈ Icc a b ∧ (j : ℝ) / k * I ≤ ∫ t in a..x, sqrt (pairedDiagonalWeight S β t)} apply le_csInf · refine ⟨b, ?_⟩ have hjk : (j : ℝ) / k ≤ 1 := (div_le_one (by exact_mod_cast hk)).mpr (by exact_mod_cast hj) exact ⟨⟨hab, le_refl b⟩, by simpa [I] using mul_le_of_le_one_left hI hjk⟩ · intro x hx apply csInf_le · exact ⟨a, fun y hy => hy.1.1⟩ · exact hsubset hx
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBoundary_mono · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:182

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a < b
S k :
ℕ
hS :
0 < S
hk :
0 < k
β :
Fin S → ℝ → ℝ → ℝ
hcont :
∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)
hpos :
∀ s x z
if
x ∈ Icc a b
and
z ∈ Icc a b
then
0 < β s x z
pairedBoundary a b S k k β = b
Proof (Lean source)
lemma pairedBoundary_last (a b : ℝ) (hab : a < b) (S k : ℕ) (hS : 0 < S) (hk : 0 < k) (β : Fin S → ℝ → ℝ → ℝ) (hcont : ∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)) (hpos : ∀ s x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β s x z) : pairedBoundary a b S k k β = b := by let f : ℝ → ℝ := fun t => sqrt (pairedDiagonalWeight S β t) have hf : ContinuousOn f (Icc a b) := by exact Real.continuous_sqrt.continuousOn.comp (pairedDiagonalWeight_continuousOn a b S β hcont) (fun _ _ => Set.mem_univ _) have hfp : ∀ x ∈ Icc a b, 0 < f x := by intro x hx exact Real.sqrt_pos.2 (pairedDiagonalWeight_pos a b S hS β hpos x hx) have hratio : (k : ℝ) / k = 1 := div_self (by exact_mod_cast (Nat.ne_of_gt hk)) have hset : {x : ℝ | x ∈ Icc a b ∧ (k : ℝ) / k * (∫ t in a..b, f t) ≤ ∫ t in a..x, f t} = {b} := by ext x simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff] constructor · rintro ⟨hx, htarget⟩ by_contra hne have hxb : x < b := lt_of_le_of_ne hx.2 hne have hfxb : ContinuousOn f (Icc x b) := hf.mono (Set.Icc_subset_Icc_left hx.1) have hposxb : 0 < ∫ t in x..b, f t := by apply intervalIntegral.integral_pos hxb hfxb · intro t ht exact (hfp t ⟨hx.1.trans ht.1.le, ht.2⟩).le · exact ⟨x, ⟨le_refl x, hxb.le⟩, hfp x hx⟩ have hfax : IntervalIntegrable f volume a x := (hf.mono (Set.Icc_subset_Icc_right hx.2)).intervalIntegrable_of_Icc hx.1 have hfxb' : IntervalIntegrable f volume x b := hfxb.intervalIntegrable_of_Icc hxb.le have hadd := intervalIntegral.integral_add_adjacent_intervals hfax hfxb' rw [hratio, one_mul] at htarget linarith · intro h subst x refine ⟨⟨hab.le, le_refl b⟩, ?_⟩ rw [hratio, one_mul] unfold pairedBoundary change sInf {x : ℝ | x ∈ Icc a b ∧ (k : ℝ) / k * (∫ t in a..b, f t) ≤ ∫ t in a..x, f t} = b rw [hset] simp
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBoundary_last · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:218
def pairedCompandingCell

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a b :
ℝ
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
j :
Fin k
pairedCompandingCell a b S k β j :
Set ℝ
if j.val + 1
= k then Icc (pairedBoundary a b S k j.val β) (pairedBoundary a b S k (j.val + 1) β) else Ico (pairedBoundary a b S k j.val β) (pairedBoundary a b S k (j.val + 1) β)
CausalSmith.PartialID.UnlinkedPropensityAte.pairedCompandingCell · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:269
def pairedCompandingMidpoint

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
a b :
ℝ
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
j :
Fin k
_s :
Fin S
pairedCompandingMidpoint a b S k β j _s :
ℝ
(pairedBoundary a b S k j.val β + pairedBoundary a b S k (j.val + 1) β) / 2
CausalSmith.PartialID.UnlinkedPropensityAte.pairedCompandingMidpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:279
theorem pairedCompandingMidpoint_mem_Icc Lemma pairedCompandingMidpoint_mem_Icc in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S k :
ℕ
hk :
0 < k
β :
Fin S → ℝ → ℝ → ℝ
j s :
pairedCompandingMidpoint a b S k β j s ∈ Icc a b
Proof (Lean source)
lemma pairedCompandingMidpoint_mem_Icc (a b : ℝ) (hab : a ≤ b) (S k : ℕ) (hk : 0 < k) (β : Fin S → ℝ → ℝ → ℝ) : ∀ j s, pairedCompandingMidpoint a b S k β j s ∈ Icc a b := by intro j s have hleft := pairedBoundary_mem_Icc a b hab S k j.val hk (le_of_lt j.isLt) β have hright := pairedBoundary_mem_Icc a b hab S k (j.val + 1) hk j.isLt β unfold pairedCompandingMidpoint constructor <;> linarith [hleft.1, hleft.2, hright.1, hright.2]
CausalSmith.PartialID.UnlinkedPropensityAte.pairedCompandingMidpoint_mem_Icc · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:286
theorem abs_deviation_integral_midpoint Lemma abs_deviation_integral_midpoint in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
(∫ x in a..b, |x - (a + b) / 2|) = (b - a) ^ 2 / 4
Proof (Lean source)
lemma abs_deviation_integral_midpoint (a b : ℝ) (hab : a ≤ b) : (∫ x in a..b, |x - (a + b) / 2|) = (b - a) ^ 2 / 4 := by let m : ℝ := (a + b) / 2 have ham : a ≤ m := by dsimp [m]; linarith have hmb : m ≤ b := by dsimp [m]; linarith have hleft : (∫ x in a..m, |x - m|) = m * (m - a) - (m ^ 2 - a ^ 2) / 2 := by have heq : ∀ x ∈ uIcc a m, |x - m| = m - x := by intro x hx rw [Set.uIcc_of_le ham] at hx rw [abs_of_nonpos (by linarith [hx.2])] ring rw [intervalIntegral.integral_congr heq] rw [intervalIntegral.integral_sub] · simp [intervalIntegral.integral_const, integral_id, smul_eq_mul] ring · exact continuous_const.intervalIntegrable a m · exact continuous_id.intervalIntegrable a m have hright : (∫ x in m..b, |x - m|) = (b ^ 2 - m ^ 2) / 2 - m * (b - m) := by have heq : ∀ x ∈ uIcc m b, |x - m| = x - m := by intro x hx rw [Set.uIcc_of_le hmb] at hx exact abs_of_nonneg (by linarith [hx.1]) rw [intervalIntegral.integral_congr heq] rw [intervalIntegral.integral_sub] · simp [intervalIntegral.integral_const, integral_id, smul_eq_mul] ring · exact continuous_id.intervalIntegrable m b · exact continuous_const.intervalIntegrable m b have hi₁ : IntervalIntegrable (fun x : ℝ => |x - m|) volume a m := (by fun_prop : Continuous (fun x : ℝ => |x - m|)).intervalIntegrable a m have hi₂ : IntervalIntegrable (fun x : ℝ => |x - m|) volume m b := (by fun_prop : Continuous (fun x : ℝ => |x - m|)).intervalIntegrable m b change (∫ x in a..b, |x - m|) = _ rw [(intervalIntegral.integral_add_adjacent_intervals hi₁ hi₂).symm, hleft, hright] dsimp [m] ring
CausalSmith.PartialID.UnlinkedPropensityAte.abs_deviation_integral_midpoint · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:297
theorem pairedWeightedAbsDeviation_lower Lemma pairedWeightedAbsDeviation_lower in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
ℕ
γ :
Fin S → ℝ
z :
Fin S → ℝ
x :
ℝ
hγ :
∀ s, 0 ≤ γ s
|(∑ s, γ s) * x - ∑ s, γ s * z s| ≤ ∑ s, γ s * |x - z s|
Proof (Lean source)
lemma pairedWeightedAbsDeviation_lower {S : ℕ} (γ : Fin S → ℝ) (z : Fin S → ℝ) (x : ℝ) (hγ : ∀ s, 0 ≤ γ s) : |(∑ s, γ s) * x - ∑ s, γ s * z s| ≤ ∑ s, γ s * |x - z s| := by have hsum : (∑ s, γ s) * x - ∑ s, γ s * z s = ∑ s, γ s * (x - z s) := by rw [Finset.sum_mul, ← Finset.sum_sub_distrib] congr 1 funext s ring rw [hsum] calc |∑ s, γ s * (x - z s)| ≤ ∑ s, |γ s * (x - z s)| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ s, γ s * |x - z s| := by apply Finset.sum_congr rfl intro s hs rw [abs_mul, abs_of_nonneg (hγ s)]
CausalSmith.PartialID.UnlinkedPropensityAte.pairedWeightedAbsDeviation_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:339
theorem pairedBadPoint_cost_lower Lemma pairedBadPoint_cost_lower in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
z :
Fin S → ℝ
x c δ :
ℝ
hc :
0 ≤ c
hδ :
0 ≤ δ
hβ :
∀ s, c ≤ β s x (z s)
hbad :
∃ s, δ ≤ |x - z s|
c * δ ≤ ∑ s : Fin S, β s x (z s) * |x - z s|
Proof (Lean source)
lemma pairedBadPoint_cost_lower {S : ℕ} (β : Fin S → ℝ → ℝ → ℝ) (z : Fin S → ℝ) (x c δ : ℝ) (hc : 0 ≤ c) (hδ : 0 ≤ δ) (hβ : ∀ s, c ≤ β s x (z s)) (hbad : ∃ s, δ ≤ |x - z s|) : c * δ ≤ ∑ s : Fin S, β s x (z s) * |x - z s| := by obtain ⟨s, hs⟩ := hbad have hsingle : c * δ ≤ β s x (z s) * |x - z s| := mul_le_mul (hβ s) hs hδ (hc.trans (hβ s)) have hnonneg : ∀ t : Fin S, 0 ≤ β t x (z t) * |x - z t| := by intro t exact mul_nonneg (hc.trans (hβ t)) (abs_nonneg _) exact hsingle.trans (Finset.single_le_sum (fun t _ => hnonneg t) (Finset.mem_univ s))
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBadPoint_cost_lower · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:360
theorem pairedGoodCell_diameter Lemma pairedGoodCell_diameter in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
ℕ
hS :
0 < S
z :
Fin S → ℝ
x y δ :
ℝ
hx :
∀ s, |x - z s| ≤ δ
hy :
∀ s, |y - z s| ≤ δ
|x - y| ≤ 2 * δ
Proof (Lean source)
lemma pairedGoodCell_diameter {S : ℕ} (hS : 0 < S) (z : Fin S → ℝ) (x y δ : ℝ) (hx : ∀ s, |x - z s| ≤ δ) (hy : ∀ s, |y - z s| ≤ δ) : |x - y| ≤ 2 * δ := by let s : Fin S := ⟨0, hS⟩ calc |x - y| = |(x - z s) + (z s - y)| := by ring _ ≤ |x - z s| + |z s - y| := abs_add_le _ _ _ ≤ δ + δ := add_le_add (hx s) (by simpa [abs_sub_comm] using hy s) _ = 2 * δ := by ring
CausalSmith.PartialID.UnlinkedPropensityAte.pairedGoodCell_diameter · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:377
theorem pairedBadSet_measure_cost Lemma pairedBadSet_measure_cost in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
z :
Fin S → ℝ
G :
Set ℝ
c δ :
ℝ
hG :
hGfinite :
volume G < ⊤
hc :
0 ≤ c
hδ :
0 ≤ δ
hβ :
∀ x ∈ G, ∀ s, c ≤ β s x (z s)
hbad :
∀ x ∈ G, ∃ s, δ ≤ |x - z s|
hInt :
IntegrableOn (fun x => ∑ s : Fin S, β s x (z s) * |x - z s|) G volume
c * δ * volume.real G ≤ ∫ x in G, ∑ s : Fin S, β s x (z s) * |x - z s|
Proof (Lean source)
lemma pairedBadSet_measure_cost {S : ℕ} (β : Fin S → ℝ → ℝ → ℝ) (z : Fin S → ℝ) (G : Set ℝ) (c δ : ℝ) (hG : MeasurableSet G) (hGfinite : volume G < ⊤) (hc : 0 ≤ c) (hδ : 0 ≤ δ) (hβ : ∀ x ∈ G, ∀ s, c ≤ β s x (z s)) (hbad : ∀ x ∈ G, ∃ s, δ ≤ |x - z s|) (hInt : IntegrableOn (fun x => ∑ s : Fin S, β s x (z s) * |x - z s|) G volume) : c * δ * volume.real G ≤ ∫ x in G, ∑ s : Fin S, β s x (z s) * |x - z s| := by have : IsFiniteMeasure (volume.restrict G) := ⟨by simpa using hGfinite⟩ have hmono := integral_mono_ae (integrable_const (c * δ)) hInt (by filter_upwards [ae_restrict_mem hG] with x hx exact pairedBadPoint_cost_lower β z x c δ hc hδ (hβ x hx) (hbad x hx)) simpa [Measure.real_def, smul_eq_mul, mul_comm] using hmono
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBadSet_measure_cost · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:391
theorem pairedBadSet_measure_le Lemma pairedBadSet_measure_le in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
S :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
z :
Fin S → ℝ
G :
Set ℝ
c δ C :
ℝ
k :
ℕ
hG :
hGfinite :
volume G < ⊤
hc :
0 < c
hδ :
0 < δ
hk :
0 < k
hβ :
∀ x ∈ G, ∀ s, c ≤ β s x (z s)
hbad :
∀ x ∈ G, ∃ s, δ ≤ |x - z s|
hInt :
IntegrableOn (fun x => ∑ s : Fin S, β s x (z s) * |x - z s|) G volume
hcost :
(∫ x in G, ∑ s : Fin S, β s x (z s) * |x - z s|) ≤ C / k
volume.real G ≤ C / (c * δ * k)
Proof (Lean source)
lemma pairedBadSet_measure_le {S : ℕ} (β : Fin S → ℝ → ℝ → ℝ) (z : Fin S → ℝ) (G : Set ℝ) (c δ C : ℝ) (k : ℕ) (hG : MeasurableSet G) (hGfinite : volume G < ⊤) (hc : 0 < c) (hδ : 0 < δ) (hk : 0 < k) (hβ : ∀ x ∈ G, ∀ s, c ≤ β s x (z s)) (hbad : ∀ x ∈ G, ∃ s, δ ≤ |x - z s|) (hInt : IntegrableOn (fun x => ∑ s : Fin S, β s x (z s) * |x - z s|) G volume) (hcost : (∫ x in G, ∑ s : Fin S, β s x (z s) * |x - z s|) ≤ C / k) : volume.real G ≤ C / (c * δ * k) := by have hbound := pairedBadSet_measure_cost β z G c δ hG hGfinite hc.le hδ.le hβ hbad hInt have hcdk : 0 < c * δ * k := by positivity apply (le_div_iff₀ hcdk).2 calc volume.real G * (c * δ * k) = (c * δ * volume.real G) * k := by ring _ ≤ (C / k) * k := mul_le_mul_of_nonneg_right (hbound.trans hcost) (by positivity) _ = C := by field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.pairedBadSet_measure_le · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:410
theorem pairedPartitionCost_nonneg Lemma pairedPartitionCost_nonneg in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
B :
Fin k → Set ℝ
z :
Fin k → Fin S → ℝ
hB :
hz :
∀ j s, z j s ∈ Icc a b
hβ :
∀ s x y
if
x ∈ Icc a b
and
y ∈ Icc a b
then
0 ≤ β s x y
0 ≤ pairedPartitionCost S k β B z
Proof (Lean source)
lemma pairedPartitionCost_nonneg (a b : ℝ) (S k : ℕ) (β : Fin S → ℝ → ℝ → ℝ) (B : Fin k → Set ℝ) (z : Fin k → Fin S → ℝ) (hB : IsIntervalPartition a b k B) (hz : ∀ j s, z j s ∈ Icc a b) (hβ : ∀ s x y, x ∈ Icc a b → y ∈ Icc a b → 0 ≤ β s x y) : 0 ≤ pairedPartitionCost S k β B z := by unfold pairedPartitionCost apply Finset.sum_nonneg intro j hj apply Finset.sum_nonneg intro s hs apply integral_nonneg_of_ae filter_upwards [ae_restrict_mem (hB.1 j)] with x hx have hxI : x ∈ Icc a b := by rw [← hB.2.2] exact Set.mem_iUnion_of_mem j hx exact mul_nonneg (hβ s x (z j s) hxI (hz j s)) (abs_nonneg _)
CausalSmith.PartialID.UnlinkedPropensityAte.pairedPartitionCost_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:431
theorem optimalPairedCost_nonneg Lemma optimalPairedCost_nonneg in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a ≤ b
S k :
ℕ
hk :
0 < k
β :
Fin S → ℝ → ℝ → ℝ
hβ :
∀ s x y
if
x ∈ Icc a b
and
y ∈ Icc a b
then
0 ≤ β s x y
0 ≤ optimalPairedCost a b S k β
Proof (Lean source)
lemma optimalPairedCost_nonneg (a b : ℝ) (hab : a ≤ b) (S k : ℕ) (hk : 0 < k) (β : Fin S → ℝ → ℝ → ℝ) (hβ : ∀ s x y, x ∈ Set.Icc a b → y ∈ Set.Icc a b → 0 ≤ β s x y) : 0 ≤ optimalPairedCost a b S k β := by unfold optimalPairedCost apply le_csInf · let j₀ : Fin k := ⟨0, hk⟩ let B : Fin k → Set ℝ := fun j => if j = j₀ then Set.Icc a b else ∅ let z : Fin k → Fin S → ℝ := fun _ _ => a refine ⟨pairedPartitionCost S k β B z, B, z, ?_, ?_, rfl⟩ · refine ⟨?_, ?_, ?_⟩ · intro j dsimp [B] split_ifs <;> measurability · intro i j hij by_cases hi : i = j₀ · by_cases hj : j = j₀ · exact (hij (hi.trans hj.symm)).elim · simp [B, hi, hj] · simp [B, hi] · ext x simp [B, j₀] · intro j s exact ⟨le_refl a, hab⟩ · rintro v ⟨B, z, hB, hz, rfl⟩ exact pairedPartitionCost_nonneg a b S k β B z hB hz hβ
CausalSmith.PartialID.UnlinkedPropensityAte.optimalPairedCost_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:452
theorem optimalPairedCost_le_feasible Lemma optimalPairedCost_le_feasible in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
S k :
ℕ
β :
Fin S → ℝ → ℝ → ℝ
B :
Fin k → Set ℝ
z :
Fin k → Fin S → ℝ
hB :
hz :
∀ j s, z j s ∈ Icc a b
hβ :
∀ s x y
if
x ∈ Icc a b
and
y ∈ Icc a b
then
0 ≤ β s x y
optimalPairedCost a b S k β ≤ pairedPartitionCost S k β B z
Proof (Lean source)
lemma optimalPairedCost_le_feasible (a b : ℝ) (S k : ℕ) (β : Fin S → ℝ → ℝ → ℝ) (B : Fin k → Set ℝ) (z : Fin k → Fin S → ℝ) (hB : IsIntervalPartition a b k B) (hz : ∀ j s, z j s ∈ Icc a b) (hβ : ∀ s x y, x ∈ Icc a b → y ∈ Icc a b → 0 ≤ β s x y) : optimalPairedCost a b S k β ≤ pairedPartitionCost S k β B z := by unfold optimalPairedCost apply csInf_le · refine ⟨0, ?_⟩ rintro v ⟨B', z', hB', hz', rfl⟩ exact pairedPartitionCost_nonneg a b S k β B' z' hB' hz' hβ · exact ⟨B, z, hB, hz, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.optimalPairedCost_le_feasible · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:481
theorem pairedQuantization_tendsto Lemma 3 in the paper ↗

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
a b :
ℝ
hab :
a < b
S :
ℕ
hS :
0 < S
β :
Fin S → ℝ → ℝ → ℝ
hcont :
∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)
hpos :
∀ s x z
if
x ∈ Icc a b
and
z ∈ Icc a b
then
0 < β s x z
conclusion 1
Tendsto (fun k : ℕ => (k : ℝ) * optimalPairedCost a b S k β) atTop (nhds ((1 / 4 : ℝ) * (∫ x in a..b, sqrt (pairedDiagonalWeight S β x)) ^ 2))
conclusion 2
Tendsto (fun k : ℕ => (k : ℝ) * pairedPartitionCost S k β (pairedCompandingCell a b S k β) (pairedCompandingMidpoint a b S k β)) atTop (nhds ((1 / 4 : ℝ) * (∫ x in a..b, sqrt (pairedDiagonalWeight S β x)) ^ 2))
conclusion 3
k :
0 < k
j s :
pairedCompandingMidpoint a b S k β j s ∈ Icc a b
Proof (Lean source)
lemma pairedQuantization_tendsto (a b : ℝ) (hab : a < b) (S : ℕ) (hS : 0 < S) (β : Fin S → ℝ → ℝ → ℝ) (hcont : ∀ s, ContinuousOn (fun p : ℝ × ℝ => β s p.1 p.2) (Icc a b ×ˢ Icc a b)) (hpos : ∀ s x z, x ∈ Icc a b → z ∈ Icc a b → 0 < β s x z) : Tendsto (fun k : ℕ => (k : ℝ) * optimalPairedCost a b S k β) atTop (nhds ((1 / 4 : ℝ) * (∫ x in a..b, sqrt (pairedDiagonalWeight S β x)) ^ 2)) ∧ Tendsto (fun k : ℕ => (k : ℝ) * pairedPartitionCost S k β (pairedCompandingCell a b S k β) (pairedCompandingMidpoint a b S k β)) atTop (nhds ((1 / 4 : ℝ) * (∫ x in a..b, sqrt (pairedDiagonalWeight S β x)) ^ 2)) ∧ (∀ k, 0 < k → IsIntervalPartition a b k (pairedCompandingCell a b S k β) ∧ ∀ j s, pairedCompandingMidpoint a b S k β j s ∈ Icc a b) := by refine ⟨?_, ?_, ?_⟩ · exact optimal_scaled_cost_tendsto a b hab S hS β hcont hpos · exact companding_scaled_cost_tendsto a b hab S hS β hcont hpos · intro k hk refine ⟨?_, pairedCompandingMidpoint_mem_Icc a b hab.le S k hk β⟩ let f : ℕ → ℝ := fun j => pairedBoundary a b S k j β have hm : ∀ i j, i ≤ j → j ≤ k → f i ≤ f j := by intro i j hij hj exact pairedBoundary_mono a b hab.le S k i j hk hij hj β have hpart := orderedIntervalCells_partition f k hk hm have hzero : f 0 = a := pairedBoundary_zero a b hab.le S k β have hlast : f k = b := pairedBoundary_last a b hab S k hS hk β hcont hpos rw [hzero, hlast] at hpart change IsIntervalPartition a b k (fun j : Fin k => if j.val + 1 = k then Icc (pairedBoundary a b S k j.val β) (pairedBoundary a b S k (j.val + 1) β) else Ico (pairedBoundary a b S k j.val β) (pairedBoundary a b S k (j.val + 1) β)) exact hpart
CausalSmith.PartialID.UnlinkedPropensityAte.pairedQuantization_tendsto · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/Helpers/Quantization.lean:497
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.OpenQuestions 4 declarations Open normalized external-score limit question.

Open normalized external-score limit question.

def externalHonestProceduresOn

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
X :
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalHonestProceduresOn X Qj α :
{C | ∀ PH ∈ X, 1 - α ≤ (Qj PH.1 PH.2).real {x | C.contains x (ate PH.1)}}
CausalSmith.PartialID.UnlinkedPropensityAte.externalHonestProceduresOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/OpenQuestions.lean:13
def externalExcessRiskOn

For the external model, subclass, sampling law, and miscoverage inputs, this definition gives the minimax expected positive excess length with honesty and the risk supremum restricted to the same subclass.

Definition (Lean source)
ε :
ℝ
J n m :
ℕ
g :
X :
hX :
X ⊆ ExternalLaws g
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalExcessRiskOn g X hX Qj α :
ℝ
sInf {v : ℝ | ∃ C ∈ externalHonestProceduresOn X Qj α, v = sSup {u : ℝ | ∃ PH, ∃ hPH : PH ∈ X, u = ∫ x, max 0 (C.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH (hX hPH))) ∂(Qj PH.1 PH.2)}}
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRiskOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/OpenQuestions.lean:23
def externalNormalizedRiskOn

For the sample sizes, external model, subclass, sampling law, and miscoverage inputs, this definition normalizes the subclass-restricted excess risk by the two-sample root-rate factor.

Definition (Lean source)
ε :
ℝ
J :
ℕ
n m :
ℕ
g :
X :
hX :
X ⊆ ExternalLaws g
Qj :
Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)
α :
ℝ
externalNormalizedRiskOn n m g X hX Qj α :
ℝ
CausalSmith.PartialID.UnlinkedPropensityAte.externalNormalizedRiskOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/OpenQuestions.lean:37
def ExternalSharpLimitQuestion

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
J :
ℕ
g :
α :
ℝ
_hg :
_hα :
0 < α ∧ α < 1 / 2
ExternalSharpLimitQuestion g α _hg _hα :
"For each rho>0, determine the liminf and limsup of T_{n,m,alpha}(g) \ as n,m→∞ and n/m→rho over ExternalLaws(g), using the product \ externalExperiment and uniformly honest procedures. Decide whether the \ values coincide and compute their common sharp value if so. If the full-class \ sharp limit fails, identify an explicitly defined regular subclass of \ ExternalLaws(g), state its regularity conditions, and determine its common \ sharp limit for every rho>0. Restrict both uniform honesty and the supremum \ in expected excess length to that same subclass. Use the external projection \ handle to construct an attaining procedure or counterexample. This is an open \ request, not an assertion or a greatest-subclass claim."
CausalSmith.PartialID.UnlinkedPropensityAte.ExternalSharpLimitQuestion · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/OpenQuestions.lean:47
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TAllLabelAmbiguity 2 declarations Exact worst-case ATE ambiguity for arbitrary measurable release cells.

Exact worst-case ATE ambiguity for arbitrary measurable release cells.

theorem halfOutcome_endpoint_attainment

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
Proof (Lean source)
lemma halfOutcome_endpoint_attainment {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : (∃ P : Measure (FullRow ε J), IsProbabilityMeasure P ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) P) ∧ (∃ Pminus Pplus : Measure (FullRow ε J), IsProbabilityMeasure Pminus ∧ IsProbabilityMeasure Pplus ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) Pminus ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) Pplus ∧ ate Pminus = muLower H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) true - muUpper H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) false ∧ ate Pplus = muUpper H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) true - muLower H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) false ∧ ate Pplus - ate Pminus = sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg)) := by exact compatible_endpointGap_eq_sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) hOverlap
CausalSmith.PartialID.UnlinkedPropensityAte.halfOutcome_endpoint_attainment · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TAllLabelAmbiguity.lean:16
theorem worstCaseAmbiguity_eq

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
Proof (Lean source)
theorem worstCaseAmbiguity_eq {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : worstCaseAmbiguity H g = ∑ r : LabelSpace J, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) ∧ (∃ P : Measure (FullRow ε J), IsProbabilityMeasure P ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) P) ∧ sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) = worstCaseAmbiguity H g ∧ (∃ Pminus Pplus : Measure (FullRow ε J), IsProbabilityMeasure Pminus ∧ IsProbabilityMeasure Pplus ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) Pminus ∧ CompatibleCausalLaw H g (halfOutcomeReleasedLaw H g) Pplus ∧ ate Pminus = muLower H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) true - muUpper H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) false ∧ ate Pplus = muUpper H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) true - muLower H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) false ∧ ate Pplus - ate Pminus = worstCaseAmbiguity H g) := by let S : ℝ := ∑ r : LabelSpace J, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r) have hupper : worstCaseAmbiguity H g ≤ S := worstCaseAmbiguity_le_sum_cellAbsoluteDeviation H g hOverlap hg have hfair : sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) = S := halfOutcome_sharpATELength_eq_sum_cellAbsoluteDeviation H g hOverlap hg rcases halfOutcome_endpoint_attainment H g hOverlap hg with ⟨hexists, hendpoint⟩ rcases hexists with ⟨P, hPprob, hPcomp⟩ have hPrandom : RandomizedCausalLaw H g P := { probability := hPcomp.probability measurableRelease := hPcomp.measurableRelease scoreMarginal := hPcomp.scoreMarginal randomizedAssignment := hPcomp.randomizedAssignment consistency := hPcomp.consistency deterministicRelease := hPcomp.deterministicRelease } let A : Set ℝ := {d : ℝ | ∃ P : Measure (FullRow ε J), ∃ (_hprob : IsProbabilityMeasure P), ∃ hP : RandomizedCausalLaw H g P, d = sharpATELength H g (releasedLaw P) (compatibleCellMasses_of_randomizedCausalLaw H g P hP)} have hAbdd : BddAbove A := by refine ⟨S, ?_⟩ rintro d ⟨Q, hQprob, hQ, rfl⟩ exact randomizedCausalLaw_sharpATELength_le_sum_cellAbsoluteDeviation H g hOverlap Q hQ have hfairMem : sharpATELength H g (halfOutcomeReleasedLaw H g) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg) ∈ A := by refine ⟨P, hPprob, hPrandom, ?_⟩ exact (sharpATELength_congr_releasedMeasure H g (releasedLaw P) (halfOutcomeReleasedLaw H g) hPcomp.releasedLaw (compatibleCellMasses_of_randomizedCausalLaw H g P hPrandom) (halfOutcomeReleasedLaw_cellMasses H g hOverlap hg)).symm have hlower : S ≤ worstCaseAmbiguity H g := by rw [← hfair] unfold worstCaseAmbiguity exact le_csSup hAbdd hfairMem have heq : worstCaseAmbiguity H g = S := le_antisymm hupper hlower refine ⟨heq, ⟨P, hPprob, hPcomp⟩, hfair.trans heq.symm, ?_⟩ rcases hendpoint with ⟨Pminus, Pplus, hminusProb, hplusProb, hminusComp, hplusComp, hminus, hplus, hgap⟩ exact ⟨Pminus, Pplus, hminusProb, hplusProb, hminusComp, hplusComp, hminus, hplus, hgap.trans (hfair.trans heq.symm)⟩
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_eq · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TAllLabelAmbiguity.lean:54
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TCompatibility 9 declarations Compatibility of a released law with a randomized causal population.

Compatibility of a released law with a randomized causal population.

theorem compatibility_armCellMass_sum

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
r :
(∑ a : ArmSpace, armCellMass H g a r) = H.real (cell g r)
Proof (Lean source)
lemma compatibility_armCellMass_sum {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (r : LabelSpace J) : (∑ a : ArmSpace, armCellMass H g a r) = H.real (cell g r) := by have hint : IntegrableOn (fun e : ScoreSpace ε => (e : ℝ)) (cell g r) H := by apply Integrable.of_bound (by fun_prop) (|ε| + |1 - ε| + 1) filter_upwards [] with e change |(e : ℝ)| ≤ |ε| + |1 - ε| + 1 rcases e.property with ⟨he₁, he₂⟩ have h₁ := neg_le_abs ε have h₂ := le_abs_self (1 - ε) have h₃ := neg_le_abs (1 - ε) have h₄ := le_abs_self ε exact abs_le.mpr ⟨by linarith, by linarith⟩ simp only [Fintype.sum_bool, armCellMass, armProb, Bool.false_eq_true, ↓reduceIte] rw [integral_sub (integrable_const 1) hint] simp
CausalSmith.PartialID.UnlinkedPropensityAte.compatibility_armCellMass_sum · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:14
theorem releasedLabelMass_sum_arms

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
r :
Prel.real {z | z.1 = r} = ∑ a : ArmSpace, Prel.real {z | z.1 = r ∧ z.2.1 = a}
Proof (Lean source)
lemma releasedLabelMass_sum_arms {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] (r : LabelSpace J) : Prel.real {z | z.1 = r} = ∑ a : ArmSpace, Prel.real {z | z.1 = r ∧ z.2.1 = a} := by let S : Set (Observation J) := {z | z.1 = r} let T : Set (Observation J) := {z | z.2.1 = true} have hT : MeasurableSet T := measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const have h := measureReal_inter_add_sdiff (μ := Prel) (s := S) (t := T) hT have hST : S ∩ T = {z | z.1 = r ∧ z.2.1 = true} := by ext z simp [S, T] have hSD : S \ T = {z | z.1 = r ∧ z.2.1 = false} := by ext z simp [S, T, Bool.not_eq_true] rw [hST, hSD] at h simpa [S, Fintype.sum_bool] using h.symm
CausalSmith.PartialID.UnlinkedPropensityAte.releasedLabelMass_sum_arms · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:35
theorem compatibleCellMasses_of_label_treated

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
hg :
h :
∀ r : LabelSpace J,
Prel.real {z | z.1 = r} = H.real (cell g r) ∧
Prel.real {z | z.1 = r ∧ z.2.1 = true} = armCellMass H g true r
Proof (Lean source)
lemma compatibleCellMasses_of_label_treated {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] [IsProbabilityMeasure Prel] (hg : Measurable g) (h : ∀ r : LabelSpace J, Prel.real {z | z.1 = r} = H.real (cell g r) ∧ Prel.real {z | z.1 = r ∧ z.2.1 = true} = armCellMass H g true r) : CompatibleCellMasses H g Prel := by refine ⟨inferInstance, inferInstance, hg, ?_⟩ intro a r cases a · have hlabel := (h r).1 have htreated := (h r).2 have hsum := compatibility_armCellMass_sum H g r have hreleased := releasedLabelMass_sum_arms Prel r simp only [Fintype.sum_bool] at hsum hreleased linarith · exact (h r).2
CausalSmith.PartialID.UnlinkedPropensityAte.compatibleCellMasses_of_label_treated · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:56
theorem armCellMass_lower_overlap

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
ε * H.real (cell g r) ≤ armCellMass H g a r
Proof (Lean source)
lemma armCellMass_lower_overlap {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : ε * H.real (cell g r) ≤ armCellMass H g a r := by have hInt : IntegrableOn (fun e : ScoreSpace ε => armProb a e) (cell g r) H := by apply Integrable.of_bound (by cases a <;> simp only [armProb, Bool.false_eq_true, ↓reduceIte] <;> fun_prop) 1 filter_upwards [] with e rcases e.property with ⟨he₁, he₂⟩ rcases hOverlap with ⟨hε, hε'⟩ change |armProb a e| ≤ 1 cases a <;> simp [armProb, abs_le] <;> constructor <;> linarith have hMono : (∫ _ in cell g r, ε ∂H) ≤ ∫ e in cell g r, armProb a e ∂H := by apply integral_mono (integrable_const ε) hInt intro e rcases e.property with ⟨he₁, he₂⟩ rcases hOverlap with ⟨hε, hε'⟩ cases a <;> simp [armProb] <;> linarith simpa [armCellMass, Measure.real_def, mul_comm] using hMono
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_lower_overlap · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:77
theorem armCellMass_pos_of_cellMass_pos

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
hcell :
0 < H.real (cell g r)
0 < armCellMass H g a r
Proof (Lean source)
lemma armCellMass_pos_of_cellMass_pos {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (hcell : 0 < H.real (cell g r)) : 0 < armCellMass H g a r := by have hbound := armCellMass_lower_overlap H g hOverlap a r exact lt_of_lt_of_le (mul_pos hOverlap.1 hcell) hbound
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_pos_of_cellMass_pos · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:101
theorem armCellMass_eq_zero_iff_cellMass_eq_zero

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
armCellMass H g a r = 0 ↔ H.real (cell g r) = 0
Proof (Lean source)
lemma armCellMass_eq_zero_iff_cellMass_eq_zero {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : armCellMass H g a r = 0 ↔ H.real (cell g r) = 0 := by have h₀ := armCellMass_lower_overlap H g hOverlap false r have h₁ := armCellMass_lower_overlap H g hOverlap true r have hsum := compatibility_armCellMass_sum H g r have hmass : 0 ≤ H.real (cell g r) := measureReal_nonneg simp only [Fintype.sum_bool] at hsum constructor · intro h by_contra hne have hp : 0 < H.real (cell g r) := lt_of_le_of_ne hmass (Ne.symm hne) have := armCellMass_pos_of_cellMass_pos H g hOverlap a r hp linarith · intro h rw [h] at h₀ h₁ hsum cases a <;> simp_all <;> linarith
CausalSmith.PartialID.UnlinkedPropensityAte.armCellMass_eq_zero_iff_cellMass_eq_zero · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:112
theorem armCellOutcomeLaw_isProbabilityMeasure

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
a :
r :
hq :
0 < Prel.real {z | z.1 = r ∧ z.2.1 = a}
Proof (Lean source)
lemma armCellOutcomeLaw_isProbabilityMeasure {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] (a : ArmSpace) (r : LabelSpace J) (hq : 0 < Prel.real {z | z.1 = r ∧ z.2.1 = a}) : IsProbabilityMeasure (armCellOutcomeLaw Prel inferInstance a r hq) := by let C : Set (Observation J) := {z | z.1 = r ∧ z.2.1 = a} have hC : Prel C ≠ 0 := (measureReal_ne_zero_iff).mp (ne_of_gt hq) have hcond : IsProbabilityMeasure (cond Prel C) := ProbabilityTheory.cond_isProbabilityMeasure hC have hmap : Measurable (fun z : Observation J => (z.2.2 : ℝ)) := by fun_prop unfold armCellOutcomeLaw change IsProbabilityMeasure ((Prel C)⁻¹ • ((Prel.restrict C).map (fun z : Observation J => (z.2.2 : ℝ)))) rw [← Measure.map_smul] exact @Measure.isProbabilityMeasure_map _ _ _ _ _ hcond _ hmap.aemeasurable
CausalSmith.PartialID.UnlinkedPropensityAte.armCellOutcomeLaw_isProbabilityMeasure · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:134
theorem armCellOutcomeLaw_apply

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
J :
ℕ
a :
r :
hq :
0 < Prel.real {z | z.1 = r ∧ z.2.1 = a}
B :
Set ℝ
hB :
= (Prel {z | z.1 = r ∧ z.2.1 = a})⁻¹ * Prel {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ∈ B}
Proof (Lean source)
lemma armCellOutcomeLaw_apply {J : ℕ} (Prel : Measure (Observation J)) [IsProbabilityMeasure Prel] (a : ArmSpace) (r : LabelSpace J) (hq : 0 < Prel.real {z | z.1 = r ∧ z.2.1 = a}) (B : Set ℝ) (hB : MeasurableSet B) : armCellOutcomeLaw Prel inferInstance a r hq B = (Prel {z | z.1 = r ∧ z.2.1 = a})⁻¹ * Prel {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ∈ B} := by have hm : Measurable (fun z : Observation J => (z.2.2 : ℝ)) := by fun_prop have hC : MeasurableSet {z : Observation J | z.1 = r ∧ z.2.1 = a} := (measurableSet_eq_fun measurable_fst measurable_const).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) simp only [armCellOutcomeLaw, Measure.smul_apply] rw [Measure.map_apply hm hB, Measure.restrict_apply (hm hB)] have hset : (fun z : Observation J => (z.2.2 : ℝ)) ⁻¹' B ∩ {z | z.1 = r ∧ z.2.1 = a} = {z | z.1 = r ∧ z.2.1 = a ∧ (z.2.2 : ℝ) ∈ B} := by ext z simp only [Set.mem_inter_iff, Set.mem_preimage, Set.mem_ofPred_eq] tauto rw [hset] simp only [smul_eq_mul]
CausalSmith.PartialID.UnlinkedPropensityAte.armCellOutcomeLaw_apply · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:153
theorem compatible_nonempty_iff

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
Prel :
@realizes H(probability normalization)
@realizes Prel(probability normalization)
hOverlap :
hg :
(∃ P : Measure (FullRow ε J), IsProbabilityMeasure P ∧ CompatibleCausalLaw H g Prel P)
↔ ∀ r : LabelSpace J, Prel.real {z | z.1 = r} = H.real (cell g r) ∧ Prel.real {z | z.1 = r ∧ z.2.1 = true} = armCellMass H g true r
Proof (Lean source)
theorem compatible_nonempty_iff {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (Prel : Measure (Observation J)) [IsProbabilityMeasure H] -- @realizes H(probability normalization) [IsProbabilityMeasure Prel] -- @realizes Prel(probability normalization) (hOverlap : Overlap ε) (hg : Measurable g) : (∃ P : Measure (FullRow ε J), IsProbabilityMeasure P ∧ CompatibleCausalLaw H g Prel P) ↔ ∀ r : LabelSpace J, Prel.real {z | z.1 = r} = H.real (cell g r) ∧ Prel.real {z | z.1 = r ∧ z.2.1 = true} = armCellMass H g true r := by constructor · rintro ⟨P, _, hP⟩ r have hMass := compatibleCellMasses_of_compatibleCausalLaw H g Prel P hP constructor · rw [releasedLabelMass_sum_arms] simp_rw [hMass.2.2.2] exact (compatibility_armCellMass_sum H g r) · exact hMass.2.2.2 true r · intro h have hMass : CompatibleCellMasses H g Prel := compatibleCellMasses_of_label_treated H g Prel hg h let P := reconstructedFullLaw H g Prel hg refine ⟨P, reconstructedFullLaw_isProbabilityMeasure H g Prel hg hOverlap, ?_⟩ exact reconstructedFullLaw_compatibleCausalLaw H g Prel hg hMass hOverlap
CausalSmith.PartialID.UnlinkedPropensityAte.compatible_nonempty_iff · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TCompatibility.lean:179
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TExternalScoreRootOrder 1 declarations Root-two-sample order for the external score-log experiment.

Root-two-sample order for the external score-log experiment.

theorem externalExcessRisk_root_order

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
g :
α :
ℝ
hOverlap :
hg :
hα :
0 < α ∧ α < 1 / 2
@realizes alpha(miscoverage range)
Qj :
∀ n m
if
then
hTrial :
∀ (n m : ℕ), JointTrialIID g (Qj n m)
hLog :
∀ (n m : ℕ), ExternalLogIID g (Qj n m)
hInd :
∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)
conclusion 2
∃ C : ℝ,
0 < C
n m :
ℕ
0 < n
0 < m
trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α
externalExcessRisk g (Qj n m) α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)
∃ CI : ExternalIntervalProcedure ε J n m,
CI ∈ externalHonestProcedures g (Qj n m) α
x :
Icc (CI.lo x) (CI.hi x) = externalProjectionCI g α x
PH :
hPH :
PH ∈ ExternalLaws g
(∫ x, max 0 (CI.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj n m PH.1 PH.2))
≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)
conclusion 3
≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop
conclusion 4
∃ C : ℝ,
0 < C
ρ :
ℝ
0 < ρ
max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))
≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ)
liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ)
≤ limsup (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ)
limsup (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ≤ C
0 < max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))
Proof (Lean source)
theorem externalExcessRisk_root_order {ε : ℝ} {J : ℕ} (g : ScoreSpace ε → LabelSpace J) (α : ℝ) (hOverlap : Overlap ε) (hg : Measurable g) (hα : 0 < α ∧ α < 1 / 2) -- @realizes alpha(miscoverage range) (Qj : ∀ n m, Measure (FullRow ε J) → Measure (ScoreSpace ε) → Measure (ExternalSample ε J n m)) (hTrial : ∀ (n m : ℕ), JointTrialIID g (Qj n m)) (hLog : ∀ (n m : ℕ), ExternalLogIID g (Qj n m)) (hInd : ∀ (n m : ℕ), ExternalLogIndependent g (Qj n m)) : (0 < fiberTripleSeparation g ∧ fiberTripleSeparation g ≤ 1) ∧ (∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 0 < n → 0 < m → -- @realizes n(positive trial size) @realizes m(positive log size) trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α ∧ externalExcessRisk g (Qj n m) α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) ∧ ∃ CI : ExternalIntervalProcedure ε J n m, CI ∈ externalHonestProcedures g (Qj n m) α ∧ (∀ x, Icc (CI.lo x) (CI.hi x) = externalProjectionCI g α x) ∧ ∀ PH, ∀ hPH : PH ∈ ExternalLaws g, (∫ x, max 0 (CI.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj n m PH.1 PH.2)) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹)) ∧ (logCertificate g α ≤ liminf (fun m : ℕ => sInf {v : ℝ | ∃ n : ℕ, 0 < n ∧ v = sqrt (m : ℝ) * externalExcessRisk g (Qj n m) α}) atTop ∧ 0 < logCertificate g α) ∧ (∃ C : ℝ, 0 < C ∧ ∀ ρ : ℝ, 0 < ρ → -- @realizes rho(positive asymptotic ratio) max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ)) ≤ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ∧ liminf (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ≤ limsup (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ∧ limsup (fun nm : ℕ × ℕ => externalNormalizedRisk g (Qj nm.1 nm.2) α) (ratioFilter ρ) ≤ C ∧ 0 < max (trialCertificate α / (1 + sqrt ρ)) (logCertificate g α * sqrt ρ / (1 + sqrt ρ))) := by have hLower := externalExcessRisk_lower_certificates g α hOverlap hg hα Qj hTrial hLog hInd have hRate : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 0 < n → 0 < m → trialCertificate α * (sqrt (n : ℝ))⁻¹ ≤ externalExcessRisk g (Qj n m) α ∧ externalExcessRisk g (Qj n m) α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) ∧ ∃ CI : ExternalIntervalProcedure ε J n m, CI ∈ externalHonestProcedures g (Qj n m) α ∧ (∀ x, Icc (CI.lo x) (CI.hi x) = externalProjectionCI g α x) ∧ ∀ PH, ∀ hPH : PH ∈ ExternalLaws g, (∫ x, max 0 (CI.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj n m PH.1 PH.2)) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := by let L : ℝ := 4 * (ε⁻¹ + (ε ^ 2)⁻¹) let A : ℝ := L * (4 * J / α + 2 * J) let B : ℝ := L * (2 * J * (2 - 2 * ε) / α + J * (2 - 2 * ε)) let C : ℝ := A + B + 1 have hε : 0 < ε := hOverlap.1 have hαpos : 0 < α := hα.1 have hw : 0 < 2 - 2 * ε := by linarith [hOverlap.2] have hL : 0 ≤ L := by dsimp [L]; positivity have hA : 0 ≤ A := by dsimp [A] exact mul_nonneg hL (by positivity) have hB : 0 ≤ B := by dsimp [B] exact mul_nonneg hL (by positivity) have hC : 0 < C := by dsimp [C]; linarith have hscale (n m : ℕ) (hn : 0 < n) (hm : 0 < m) : 4 * (ε⁻¹ + (ε ^ 2)⁻¹) * (4 * J / (α * sqrt n) + 2 * J / sqrt n + 2 * J * (2 - 2 * ε) / (α * sqrt m) + J * (2 - 2 * ε) / sqrt m) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := by have hAn : A ≤ C := by dsimp [C]; linarith have hBm : B ≤ C := by dsimp [C]; linarith calc _ = A * (sqrt (n : ℝ))⁻¹ + B * (sqrt (m : ℝ))⁻¹ := by dsimp [A, B, L] simp only [div_eq_mul_inv, mul_inv_rev] ring _ ≤ C * (sqrt (n : ℝ))⁻¹ + C * (sqrt (m : ℝ))⁻¹ := add_le_add (mul_le_mul_of_nonneg_right hAn (by positivity)) (mul_le_mul_of_nonneg_right hBm (by positivity)) _ = _ := by ring refine ⟨C, hC, ?_⟩ intro n m hn hm let CI : ExternalIntervalProcedure ε J n m := externalProjectionIntervalProcedure g α hOverlap hg have hCI : CI ∈ externalHonestProcedures g (Qj n m) α := externalProjectionIntervalProcedure_honest g α hOverlap hg hn hm hα.1 (Qj n m) (hTrial n m) (hLog n m) (hInd n m) have hExp : ∀ PH, ∀ hPH : PH ∈ ExternalLaws g, (∫ x, max 0 (CI.length x - sharpATELength PH.2 g (releasedLaw PH.1) (externalLawCellMasses g PH hPH)) ∂(Qj n m PH.1 PH.2)) ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := by intro PH hPH exact (externalProjectionIntervalProcedure_population_meanExcessLength_le g (Qj n m) (hTrial n m) (hLog n m) (hInd n m) PH hPH hn hm α hα.1).trans (hscale n m hn hm) have hRisk : externalExcessRisk g (Qj n m) α ≤ C * ((sqrt (n : ℝ))⁻¹ + (sqrt (m : ℝ))⁻¹) := externalExcessRisk_le_of_honest_uniform_bound g α hOverlap hg (Qj n m) (hTrial n m) (hLog n m) (hInd n m) CI hCI _ (by positivity) hExp refine ⟨hLower.2.1 n m hn hm, hRisk, CI, hCI, ?_, hExp⟩ intro x exact externalProjectionIntervalProcedure_Icc g α hOverlap hg x refine ⟨hLower.1, hRate, hLower.2.2.1, ?_⟩ obtain ⟨C, hC, hRate⟩ := hRate refine ⟨C, hC, ?_⟩ intro ρ hρ let risk : ℕ × ℕ → ℝ := fun nm => externalNormalizedRisk g (Qj nm.1 nm.2) α have hPoint : ∀ nm : ℕ × ℕ, 0 < nm.1 → 0 < nm.2 → risk nm ≤ C := by intro nm hn hm have hsum : 0 < (sqrt (nm.1 : ℝ))⁻¹ + (sqrt (nm.2 : ℝ))⁻¹ := by positivity have hb := (hRate nm.1 nm.2 hn hm).2.1 dsimp [risk, externalNormalizedRisk, externalNormalizer] calc ((sqrt (nm.1 : ℝ))⁻¹ + (sqrt (nm.2 : ℝ))⁻¹)⁻¹ * externalExcessRisk g (Qj nm.1 nm.2) α ≤ ((sqrt (nm.1 : ℝ))⁻¹ + (sqrt (nm.2 : ℝ))⁻¹)⁻¹ * (C * ((sqrt (nm.1 : ℝ))⁻¹ + (sqrt (nm.2 : ℝ))⁻¹)) := mul_le_mul_of_nonneg_left hb (by positivity) _ = C := by field_simp have hEvUpper : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, risk nm ≤ C := by filter_upwards [ratioFilter_eventually_pos ρ] with nm hnm exact hPoint nm hnm.1 hnm.2 have hEvLower : ∀ᶠ nm : ℕ × ℕ in ratioFilter ρ, 0 ≤ risk nm := by filter_upwards [ratioFilter_eventually_pos ρ] with nm hnm have htrial := (hRate nm.1 nm.2 hnm.1 hnm.2).1 have hcert : 0 ≤ trialCertificate α := (externalCertificate_constants_pos g α hOverlap hα).1.le have hrisk : 0 ≤ externalExcessRisk g (Qj nm.1 nm.2) α := le_trans (mul_nonneg hcert (by positivity)) htrial exact mul_nonneg (by dsimp [externalNormalizer]; positivity) hrisk haveI : (ratioFilter ρ).NeBot := ratioFilter_neBot ρ hρ have hBddAbove : IsBoundedUnder (· ≤ ·) (ratioFilter ρ) risk := isBoundedUnder_of_eventually_le hEvUpper have hBddBelow : IsBoundedUnder (· ≥ ·) (ratioFilter ρ) risk := isBoundedUnder_of_eventually_ge hEvLower have hLimsup : limsup risk (ratioFilter ρ) ≤ C := limsup_le_of_le hBddBelow.isCoboundedUnder_le hEvUpper refine ⟨(hLower.2.2.2 ρ hρ).1, ?_, hLimsup, (hLower.2.2.2 ρ hρ).2⟩ exact liminf_le_limsup
CausalSmith.PartialID.UnlinkedPropensityAte.externalExcessRisk_root_order · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TExternalScoreRootOrder.lean:18
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TKLabelRate 3 declarations Uniform inverse-label bounds under a density floor, and an upper bound for every score law.

Uniform inverse-label bounds under a density floor, and an upper bound for every score law.

theorem worstCaseAmbiguity_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
g :
hOverlap :
hg :
Proof (Lean source)
lemma worstCaseAmbiguity_nonneg {ε : ℝ} {K : ℕ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (g : ScoreSpace ε → LabelSpace K) (hOverlap : Overlap ε) (hg : Measurable g) : 0 ≤ worstCaseAmbiguity H g := by rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] apply Finset.sum_nonneg intro r _ exact add_nonneg (cellAbsoluteDeviation_nonneg H g hOverlap true r) (cellAbsoluteDeviation_nonneg H g hOverlap false r)
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TKLabelRate.lean:17
theorem equalWidthRelease_worstCaseAmbiguity_le_all

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
K :
ℕ
hOverlap :
hK :
0 < K
worstCaseAmbiguity H (equalWidthRelease ε K hK) ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K)
Proof (Lean source)
lemma equalWidthRelease_worstCaseAmbiguity_le_all {ε : ℝ} {K : ℕ} (hOverlap : Overlap ε) (hK : 0 < K) (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] : worstCaseAmbiguity H (equalWidthRelease ε K hK) ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K) := by let g := equalWidthRelease ε K hK let B : ℝ := (1 - 2 * ε) / (2 * K) let C : ℝ := (ε * (1 - ε))⁻¹ have hg : Measurable g := equalWidthRelease_measurable ε K hK have hB : 0 ≤ B := by dsimp [B] apply div_nonneg · linarith [hOverlap.2] · positivity have hC : 0 ≤ C := by dsimp [C] exact inv_nonneg.mpr (mul_nonneg hOverlap.1.le (by linarith [hOverlap.2])) have hcell (r : LabelSpace K) : cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r ≤ C * B * H.real (cell g r) := by let z := equalWidthBinMidpoint ε K hK hOverlap r have hdist (e : ScoreSpace ε) (he : e ∈ cell g r) : |(e : ℝ) - (z : ℝ)| ≤ B := by have hb := equalWidthRelease_cell_subset_closedBin hOverlap hK r he rcases hb with ⟨hl, hu⟩ have hz : (z : ℝ) = ε + ((r : ℕ) + (1 / 2 : ℝ)) * ((1 - 2 * ε) / K) := equalWidthBinMidpoint_val ε K hK hOverlap r rw [hz] dsimp [B] at ⊢ rw [abs_le] constructor <;> ring_nf at hl hu ⊢ <;> linarith have hint : IntegrableOn (fun e : ScoreSpace ε => |(e : ℝ) - (z : ℝ)|) (cell g r) H := by apply Integrable.of_bound (by fun_prop) 1 filter_upwards [] with e have he := e.property have hz := z.property rw [Real.norm_eq_abs, abs_abs] exact abs_le.mpr ⟨by linarith [he.1, he.2, hz.1, hz.2, hOverlap.1], by linarith [he.1, he.2, hz.1, hz.2, hOverlap.1]⟩ have hbound : (∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H) ≤ B * H.real (cell g r) := by calc (∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H) ≤ ∫ _e in cell g r, B ∂H := by apply setIntegral_mono_on hint (integrable_const B) (measurableSet_eq_fun hg measurable_const) exact hdist _ = B * H.real (cell g r) := by simp [mul_comm] calc cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r ≤ C * ∫ e in cell g r, |(e : ℝ) - (z : ℝ)| ∂H := sum_cellAbsoluteDeviation_le_centeredScoreIntegral H g hg hOverlap r z _ ≤ C * (B * H.real (cell g r)) := mul_le_mul_of_nonneg_left hbound hC _ = C * B * H.real (cell g r) := by ring rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] calc (∑ r : LabelSpace K, (cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r)) ≤ ∑ r : LabelSpace K, C * B * H.real (cell g r) := by apply Finset.sum_le_sum intro r _ exact hcell r _ = C * B * ∑ r : LabelSpace K, H.real (cell g r) := by rw [← Finset.mul_sum] _ = C * B := by have h := MeasureTheory.sum_measureReal_preimage_singleton (μ := H) (s := univ) (f := g) (by intro r hr; exact measurableSet_eq_fun hg measurable_const) have htotal : (∑ r : LabelSpace K, H.real (cell g r)) = 1 := by simpa [cell, preimage, Set.mem_singleton_iff] using h rw [htotal, mul_one] _ = (1 - 2 * ε) / (2 * ε * (1 - ε) * K) := by dsimp [B, C] have hε : ε ≠ 0 := hOverlap.1.ne' have hε1 : 1 - ε ≠ 0 := by linarith [hOverlap.2] have hKr : (K : ℝ) ≠ 0 := by exact_mod_cast hK.ne' field_simp
CausalSmith.PartialID.UnlinkedPropensityAte.equalWidthRelease_worstCaseAmbiguity_le_all · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TKLabelRate.lean:29
theorem optimalKAmbiguity_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
mf :
ℝ
hOverlap :
hmf :
0 < mf
@realizes mf(positive density floor)
K :
ℕ
hK :
0 < K
conclusion 1
H :
f :
ScoreSpace ε → ℝ
mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ optimalKAmbiguity ε K H
conclusion 2
optimalKAmbiguity ε K H ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K)
worstCaseAmbiguity H (equalWidthRelease ε K hK) ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K)
Proof (Lean source)
theorem optimalKAmbiguity_bounds {ε : ℝ} (mf : ℝ) (hOverlap : Overlap ε) (hmf : 0 < mf) -- @realizes mf(positive density floor) (K : ℕ) (hK : 0 < K) -- @realizes K(positive label budget) : (∀ (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ), LowerScoreDensity H f mf → mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * K) ≤ optimalKAmbiguity ε K H) ∧ (∀ (H : Measure (ScoreSpace ε)), IsProbabilityMeasure H → optimalKAmbiguity ε K H ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K) ∧ Measurable (equalWidthRelease ε K hK) ∧ worstCaseAmbiguity H (equalWidthRelease ε K hK) ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K)) := by constructor · intro H f hDensity letI : IsProbabilityMeasure H := hDensity.probability exact optimalKAmbiguity_finiteLabel_lower mf hOverlap hmf K hK H f hDensity · intro H hH letI : IsProbabilityMeasure H := hH have heqMeas : Measurable (equalWidthRelease ε K hK) := equalWidthRelease_measurable ε K hK have heqUpper := equalWidthRelease_worstCaseAmbiguity_le_all hOverlap hK H have hoptimalUpper : optimalKAmbiguity ε K H ≤ (1 - 2 * ε) / (2 * ε * (1 - ε) * K) := by unfold optimalKAmbiguity calc sInf {d : ℝ | ∃ g ∈ kLabelReleases ε K, d = worstCaseAmbiguity H g} ≤ worstCaseAmbiguity H (equalWidthRelease ε K hK) := by apply csInf_le · refine ⟨0, ?_⟩ rintro d ⟨g, hg, rfl⟩ exact worstCaseAmbiguity_nonneg H g hOverlap hg · exact ⟨equalWidthRelease ε K hK, heqMeas, rfl⟩ _ ≤ _ := heqUpper exact ⟨hoptimalUpper, heqMeas, heqUpper⟩
CausalSmith.PartialID.UnlinkedPropensityAte.optimalKAmbiguity_bounds · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TKLabelRate.lean:114
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TMinimaxHonestLength 1 declarations Known-score minimax honest confidence-length order.

Known-score minimax honest confidence-length order.

theorem minimaxHonestLength_order

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε α :
ℝ
hOverlap :
hα :
0 < α ∧ α < 1 / 2
∃ C samplingConstant : ℝ,
0 < C
0 < samplingConstant
conclusion 1
H :
n K :
ℕ
_hn :
0 < n
_hK :
0 < K
samplingConstant * (sqrt (n : ℝ))⁻¹ ≤ minimaxHonestLength n K H α
conclusion 2
mf :
ℝ
_hmf :
0 < mf
∃ c : ℝ,
0 < c
H :
f :
ScoreSpace ε → ℝ
_hDensity :
n K :
ℕ
_hn :
0 < n
hK :
0 < K
c * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ≤ minimaxHonestLength n K H α
minimaxHonestLength n K H α ≤ C * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
∃ CI : IntervalProcedure n K,
(equalWidthRelease ε K hK, CI) ∈ honestProcedures n K H α
x :
CI.lo x = clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K)
CI.hi x = clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K)
P ∈ CausalLaws H (equalWidthRelease ε K hK) :
(∫ x, CI.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P)))
≤ C * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹)
Proof (Lean source)
theorem minimaxHonestLength_order (ε α : ℝ) (hOverlap : Overlap ε) (hα : 0 < α ∧ α < 1 / 2) -- @realizes alpha(miscoverage range) : ∃ C samplingConstant : ℝ, 0 < C ∧ 0 < samplingConstant ∧ (∀ (H : Measure (ScoreSpace ε)) (_hH : IsProbabilityMeasure H) (n K : ℕ) (_hn : 0 < n) (_hK : 0 < K), samplingConstant * (sqrt (n : ℝ))⁻¹ ≤ minimaxHonestLength n K H α) ∧ (∀ (mf : ℝ) (_hmf : 0 < mf), -- @realizes mf(positive density floor) ∃ c : ℝ, 0 < c ∧ ∀ (H : Measure (ScoreSpace ε)) (f : ScoreSpace ε → ℝ) (_hH : IsProbabilityMeasure H) (_hDensity : LowerScoreDensity H f mf) (n K : ℕ) (_hn : 0 < n) (hK : 0 < K), -- @realizes n(positive trial sample size) @realizes K(positive label budget) c * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ≤ minimaxHonestLength n K H α ∧ minimaxHonestLength n K H α ≤ C * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹) ∧ (∃ CI : IntervalProcedure n K, (equalWidthRelease ε K hK, CI) ∈ honestProcedures n K H α ∧ (∀ x, CI.lo x = clampATE (midpointWeightedCenter ε n K x - midpointWeightedRadius ε α n K) ∧ CI.hi x = clampATE (midpointWeightedCenter ε n K x + midpointWeightedRadius ε α n K)) ∧ ∀ P ∈ CausalLaws H (equalWidthRelease ε K hK), (∫ x, CI.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))) ≤ C * ((K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹))) := by let B : ℝ := trialCertificate α let U : ℝ := midpointLengthConstant ε α let C : ℝ := max B U have hβ : 0 < 1 - 2 * α := by linarith [hα.2] have hlog : 0 < log (1 + (1 - 2 * α) ^ 2) := by exact Real.log_pos (by nlinarith [sq_pos_of_pos hβ]) have hB : 0 < B := by dsimp [B] unfold trialCertificate positivity have hC : 0 < C := lt_of_lt_of_le hB (le_max_left B U) refine ⟨C, B, hC, hB, ?_, ?_⟩ · intro H hH n K hn hK let _ : IsProbabilityMeasure H := hH simpa [B] using (minimaxHonestLength_sampling_lower hOverlap hα H hn hK) · intro mf hmf let A : ℝ := (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε)) let c : ℝ := min A B / 2 have hgap : 0 < 1 - 2 * ε := by linarith [hOverlap.2] have hden : 0 < 1 - ε := by linarith [hOverlap.2] have hA : 0 < A := by dsimp [A] positivity have hc : 0 < c := by dsimp [c] exact div_pos (lt_min hA hB) (by norm_num) refine ⟨c, hc, ?_⟩ intro H f hH hDensity n K hn hK let _ : IsProbabilityMeasure H := hH let R : ℝ := (K : ℝ)⁻¹ + (sqrt (n : ℝ))⁻¹ have hFinite := minimaxHonestLength_finiteLabel_lower hOverlap hα hmf H f hDensity n K hn hK have hLabel : A * (K : ℝ)⁻¹ ≤ minimaxHonestLength n K H α := by have hKne : (K : ℝ) ≠ 0 := ne_of_gt (Nat.cast_pos.mpr hK) have hdene : 1 - ε ≠ 0 := ne_of_gt hden calc A * (K : ℝ)⁻¹ = (1 - 2 * α) * mf * (1 - 2 * ε) ^ 2 / (2 * (1 - ε) * (K : ℝ)) := by dsimp [A] field_simp _ ≤ minimaxHonestLength n K H α := hFinite have hSampling := minimaxHonestLength_sampling_lower hOverlap hα H hn hK have hLowerAssembly := minimaxHonestLength_rate_assembly hOverlap hα hmf hn hK hLabel hSampling dsimp [A, B, c] at hLowerAssembly have hLower : c * R ≤ minimaxHonestLength n K H α := by simpa [c, A, B, R] using hLowerAssembly.2 have hUpperAll := minimaxHonestLength_midpoint_upper hOverlap hα H n K hn hK have hUC : U ≤ C := le_max_right B U have hR : 0 ≤ R := by dsimp [R] positivity have hUpper : minimaxHonestLength n K H α ≤ C * R := by calc minimaxHonestLength n K H α ≤ U * R := by simpa [U, R] using hUpperAll _ ≤ C * R := mul_le_mul_of_nonneg_right hUC hR obtain ⟨CI, hCI, hformula, hCIU⟩ := exists_equalWidth_midpointInterval hOverlap hα H n K hn hK refine ⟨by simpa [R] using hLower, by simpa [R] using hUpper, CI, hCI, hformula, ?_⟩ intro P hP calc (∫ x, CI.length x ∂(Measure.pi (fun _ : Fin n => releasedLaw P))) ≤ U * R := by simpa [U, R] using hCIU P hP _ ≤ C * R := mul_le_mul_of_nonneg_right hUC hR
CausalSmith.PartialID.UnlinkedPropensityAte.minimaxHonestLength_order · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TMinimaxHonestLength.lean:15
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TSharpHighResolutionConstant 3 declarations Sharp high-resolution constant and ordered companding releases.

Sharp high-resolution constant and ordered companding releases.

For the specified mathematical inputs, this definition introduces the corresponding object.

Definition (Lean source)
ε :
ℝ
H :
f :
ScoreSpace ε → ℝ
K :
ℕ
compandingAmbiguity H f K :
ℝ
if hK : 0 < K then worstCaseAmbiguity H (compandingRelease f K hK) else 0
CausalSmith.PartialID.UnlinkedPropensityAte.compandingAmbiguity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TSharpHighResolutionConstant.lean:15
theorem exists_boundedScoreDensity_of_continuous

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
f :
ScoreSpace ε → ℝ
hOverlap :
hDensity :
H
= ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)).withDensity (fun e => ofReal (f e))
hfcont :
hfpos :
∀ e, 0 < f e
∃ mf Mf : ℝ, BoundedScoreDensity H f mf Mf
Proof (Lean source)
lemma exists_boundedScoreDensity_of_continuous {ε : ℝ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hOverlap : Overlap ε) (hDensity : H = ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)).withDensity (fun e => ofReal (f e))) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) : ∃ mf Mf : ℝ, BoundedScoreDensity H f mf Mf := by have hne : (Set.univ : Set (ScoreSpace ε)).Nonempty := ⟨⟨ε, ⟨le_refl _, by linarith [hOverlap.2]⟩⟩, Set.mem_univ _⟩ obtain ⟨mf, hmf, hmf_le⟩ := isCompact_univ.exists_forall_le' hfcont.continuousOn (fun e _ => hfpos e) obtain ⟨Mf, hMf⟩ := isCompact_univ.exists_bound_of_continuousOn hfcont.continuousOn refine ⟨mf, Mf, ⟨inferInstance, ?_, ?_⟩⟩ · refine ⟨hfcont.measurable, hDensity, ?_⟩ exact Filter.Eventually.of_forall (fun e => hmf_le e (Set.mem_univ e)) · exact Filter.Eventually.of_forall (fun e => (le_abs_self _).trans (by simpa using hMf e (Set.mem_univ e)))
CausalSmith.PartialID.UnlinkedPropensityAte.exists_boundedScoreDensity_of_continuous · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TSharpHighResolutionConstant.lean:20
theorem tendsto_K_mul_optimalKAmbiguity

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
f :
ScoreSpace ε → ℝ
hDensity :
H
= ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)).withDensity (fun e => ofReal (f e))
hOverlap :
hfcont :
hfpos :
∀ e, 0 < f e
conclusion 1
Tendsto (fun K : ℕ => (K : ℝ) * optimalKAmbiguity ε K H) atTop (nhds ((1 / 4 : ℝ) * (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))) ^ 2))
conclusion 2
∃ gK : (K : ℕ) → (hK : 0 < K) → ScoreSpace ε → LabelSpace K,
Tendsto (fun K : ℕ => (K : ℝ) * (if hK : 0 < K then worstCaseAmbiguity H (gK K hK) else 0)) atTop (nhds ((1 / 4 : ℝ) * (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))) ^ 2))
K (hK : 0 < K) :
Measurable (gK K hK)
r :
x z :
x ∈ cell (gK K hK) r
z ∈ cell (gK K hK) r
y :
x ≤ y
y ≤ z
y ∈ cell (gK K hK) r
Proof (Lean source)
theorem tendsto_K_mul_optimalKAmbiguity {ε : ℝ} (H : Measure (ScoreSpace ε)) [IsProbabilityMeasure H] (f : ScoreSpace ε → ℝ) (hDensity : H = ((volume : Measure ℝ).comap (Subtype.val : ScoreSpace ε → ℝ)).withDensity (fun e => ofReal (f e))) (hOverlap : Overlap ε) (hfcont : Continuous f) (hfpos : ∀ e, 0 < f e) : Tendsto (fun K : ℕ => (K : ℝ) * optimalKAmbiguity ε K H) atTop (nhds ((1 / 4 : ℝ) * (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))) ^ 2)) ∧ (∃ gK : (K : ℕ) → (hK : 0 < K) → ScoreSpace ε → LabelSpace K, Tendsto (fun K : ℕ => (K : ℝ) * (if hK : 0 < K then worstCaseAmbiguity H (gK K hK) else 0)) atTop (nhds ((1 / 4 : ℝ) * (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))) ^ 2)) ∧ ∀ K (hK : 0 < K), Measurable (gK K hK) ∧ ∀ r : LabelSpace K, ∀ x z : ScoreSpace ε, x ∈ cell (gK K hK) r → z ∈ cell (gK K hK) r → ∀ y : ScoreSpace ε, x ≤ y → y ≤ z → y ∈ cell (gK K hK) r) := by obtain ⟨mf, Mf, hBounded⟩ := exists_boundedScoreDensity_of_continuous H f hOverlap hDensity hfcont hfpos have hab : ε < 1 - ε := by linarith [hOverlap.2] have hquant := pairedQuantization_tendsto ε (1 - ε) hab 2 (by norm_num) (highResolutionBeta f) (highResolutionBeta_continuousOn hOverlap f hfcont) (highResolutionBeta_pos hOverlap f hfpos) have hdiag : (∫ t in ε..(1 - ε), sqrt (pairedDiagonalWeight 2 (highResolutionBeta f) t)) = ∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t))) := by apply intervalIntegral.integral_congr intro t ht change sqrt (pairedDiagonalWeight 2 (highResolutionBeta f) t) = sqrt (densityExtension f t / (t * (1 - t))) rw [highResolutionBeta_diagonal hOverlap f t] simpa only [Set.uIcc_of_le hab.le] using ht rw [hdiag] at hquant have hoptEq : (fun K : ℕ => (K : ℝ) * optimalKAmbiguity ε K H) =ᶠ[atTop] (fun K : ℕ => (K : ℝ) * optimalPairedCost ε (1 - ε) 2 K (highResolutionBeta f)) := by apply (eventually_atTop.2 ⟨1, ?_⟩) intro K hK change (K : ℝ) * optimalKAmbiguity ε K H = (K : ℝ) * optimalPairedCost ε (1 - ε) 2 K (highResolutionBeta f) rw [optimalKAmbiguity_eq_optimalPairedCost H f hBounded hOverlap hfcont hfpos (Nat.zero_lt_of_lt hK)] have hopt : Tendsto (fun K : ℕ => (K : ℝ) * optimalKAmbiguity ε K H) atTop (nhds ((1 / 4 : ℝ) * (∫ t in ε..(1 - ε), sqrt (densityExtension f t / (t * (1 - t)))) ^ 2)) := hquant.1.congr' hoptEq.symm refine ⟨hopt, ?_⟩ let gK : (K : ℕ) → (hK : 0 < K) → ScoreSpace ε → LabelSpace K := fun K hK => highResolutionOrderedRelease hOverlap f hfcont hfpos K hK refine ⟨gK, ?_, ?_⟩ · let middle : ℕ → ℝ := fun K => (K : ℝ) * (if hK : 0 < K then worstCaseAmbiguity H (gK K hK) else 0) let upper : ℕ → ℝ := fun K => (K : ℝ) * pairedPartitionCost 2 K (highResolutionBeta f) (pairedCompandingCell ε (1 - ε) 2 K (highResolutionBeta f)) (pairedCompandingMidpoint ε (1 - ε) 2 K (highResolutionBeta f)) have hlower : ∀ K : ℕ, (K : ℝ) * optimalKAmbiguity ε K H ≤ middle K := by intro K by_cases hK : 0 < K · simp only [middle, dif_pos hK] exact mul_le_mul_of_nonneg_left (optimalKAmbiguity_le_highResolutionOrderedRelease H hOverlap f hfcont hfpos K hK) (Nat.cast_nonneg K) · have hK0 : K = 0 := by omega subst K simp [middle] have hupper : ∀ K : ℕ, middle K ≤ upper K := by intro K by_cases hK : 0 < K · simp only [middle, dif_pos hK, upper] exact mul_le_mul_of_nonneg_left (highResolutionOrderedRelease_worstCaseAmbiguity_le_compandingCost H f hBounded hOverlap hfcont hfpos K hK) (Nat.cast_nonneg K) · have hK0 : K = 0 := by omega subst K simp [middle, upper] exact hopt.squeeze hquant.2.1 hlower hupper · intro K hK refine ⟨highResolutionOrderedRelease_measurable hOverlap f hfcont hfpos K hK, ?_⟩ intro r x z hx hz y hxy hyz exact (highResolutionOrderedRelease_cell_ordConnected hOverlap f hfcont hfpos K hK r).out hx hz ⟨hxy, hyz⟩
CausalSmith.PartialID.UnlinkedPropensityAte.tendsto_K_mul_optimalKAmbiguity · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TSharpHighResolutionConstant.lean:44
CausalSmith.PartialID.PID_UnlinkedPropensityAte_Research.TUniversalPointIdentification 9 declarations Universal point identification is equivalent to score recovery from the label.

Universal point identification is equivalent to score recovery from the label.

theorem cellAbsoluteDeviation_nonneg

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
0 ≤ cellAbsoluteDeviation H g a r
Proof (Lean source)
lemma cellAbsoluteDeviation_nonneg {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) : 0 ≤ cellAbsoluteDeviation H g a r := by unfold cellAbsoluteDeviation apply le_csInf · refine ⟨_, ε⁻¹, ?_, rfl⟩ rcases hOverlap with ⟨hε, hεhalf⟩ constructor · simpa only [one_div] using (one_div_le_one_div_of_le hε (show ε ≤ 1 - ε by linarith)) · exact le_refl _ · rintro v ⟨c, hc, rfl⟩ exact integral_nonneg (fun e => abs_nonneg _)
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_nonneg · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:12
theorem cellAbsoluteDeviation_le_integral

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
a :
r :
c :
ℝ
hc :
c ∈ Icc ((1 - ε)⁻¹) ε⁻¹
cellAbsoluteDeviation H g a r ≤ ∫ e in cell g r, |1 - c * armProb a e| ∂H
Proof (Lean source)
lemma cellAbsoluteDeviation_le_integral {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (a : ArmSpace) (r : LabelSpace J) (c : ℝ) (hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹) : cellAbsoluteDeviation H g a r ≤ ∫ e in cell g r, |1 - c * armProb a e| ∂H := by unfold cellAbsoluteDeviation apply csInf_le · refine ⟨0, ?_⟩ rintro v ⟨d, hd, rfl⟩ exact integral_nonneg (fun e => abs_nonneg _) · exact ⟨c, hc, rfl⟩
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_le_integral · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:30
theorem cellAbsoluteDeviation_zero_of_ae

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
c :
ℝ
hc :
c ∈ Icc ((1 - ε)⁻¹) ε⁻¹
hae :
∀ᵐ e ∂(H.restrict (cell g r)), 1 - c * armProb a e = 0
Proof (Lean source)
lemma cellAbsoluteDeviation_zero_of_ae {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (c : ℝ) (hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹) (hae : ∀ᵐ e ∂(H.restrict (cell g r)), 1 - c * armProb a e = 0) : cellAbsoluteDeviation H g a r = 0 := by apply le_antisymm · calc cellAbsoluteDeviation H g a r ≤ ∫ e in cell g r, |1 - c * armProb a e| ∂H := cellAbsoluteDeviation_le_integral H g a r c hc _ = 0 := by apply integral_eq_zero_of_ae filter_upwards [hae] with e he simp [he] · exact cellAbsoluteDeviation_nonneg H g hOverlap a r
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_zero_of_ae · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:45
theorem armProb_bounds

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
a :
x :
conclusion 1
ε ≤ armProb a x
conclusion 2
armProb a x ≤ 1 - ε
Proof (Lean source)
lemma armProb_bounds {ε : ℝ} (a : ArmSpace) (x : ScoreSpace ε) : ε ≤ armProb a x ∧ armProb a x ≤ 1 - ε := by rcases x.property with ⟨hxlo, hxhi⟩ cases a <;> simp [armProb] <;> constructor <;> linarith
theorem cellAbsoluteDeviation_zero_of_cellwiseAE

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
a :
r :
x :
hae :
∀ᵐ e ∂(H.restrict (cell g r)), e = x
Proof (Lean source)
lemma cellAbsoluteDeviation_zero_of_cellwiseAE {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (a : ArmSpace) (r : LabelSpace J) (x : ScoreSpace ε) (hae : ∀ᵐ e ∂(H.restrict (cell g r)), e = x) : cellAbsoluteDeviation H g a r = 0 := by have hb := armProb_bounds a x have hp : 0 < armProb a x := lt_of_lt_of_le hOverlap.1 hb.1 let c : ℝ := (armProb a x)⁻¹ have hc : c ∈ Icc ((1 - ε)⁻¹) ε⁻¹ := by constructor · simpa only [one_div, c] using (one_div_le_one_div_of_le hp hb.2) · simpa only [one_div, c] using (one_div_le_one_div_of_le hOverlap.1 hb.1) apply cellAbsoluteDeviation_zero_of_ae H g hOverlap a r c hc filter_upwards [hae] with e he simp [he, c, inv_mul_cancel₀ hp.ne']
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_zero_of_cellwiseAE · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:71
theorem cellDeviationIntegral_continuousOn

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
r :
ContinuousOn (fun c : ℝ => ∫ e in cell g r, |1 - c * armProb true e| ∂H) (Icc ((1 - ε)⁻¹) ε⁻¹)
Proof (Lean source)
lemma cellDeviationIntegral_continuousOn {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (r : LabelSpace J) : ContinuousOn (fun c : ℝ => ∫ e in cell g r, |1 - c * armProb true e| ∂H) (Icc ((1 - ε)⁻¹) ε⁻¹) := by let μ := H.restrict (cell g r) let F : ℝ → ScoreSpace ε → ℝ := fun c e => |1 - c * armProb true e| have hcont : ContinuousOn (fun c => ∫ e, F c e ∂μ) (Icc ((1 - ε)⁻¹) ε⁻¹) := by apply continuousOn_of_dominated (bound := fun _ => 1 + ε⁻¹) · intro c hc dsimp [F] simp only [armProb, ↓reduceIte] fun_prop · intro c hc filter_upwards [] with e have hp := armProb_bounds true e have hp0 : 0 ≤ armProb true e := le_trans (le_of_lt hOverlap.1) hp.1 have hp1 : armProb true e ≤ 1 := by linarith [hOverlap.1] have hc0 : 0 ≤ c := le_trans (le_of_lt (inv_pos.mpr (by linarith [hOverlap.2] : 0 < 1 - ε))) (Set.mem_Icc.mp hc).1 have hc1 : c ≤ ε⁻¹ := (Set.mem_Icc.mp hc).2 dsimp [F] simp only [abs_abs] have hprod0 : 0 ≤ c * armProb true e := mul_nonneg hc0 hp0 have hprod1 : c * armProb true e ≤ ε⁻¹ := by calc c * armProb true e ≤ c * 1 := mul_le_mul_of_nonneg_left hp1 hc0 _ = c := by ring _ ≤ ε⁻¹ := hc1 exact abs_le.mpr ⟨by linarith, by linarith⟩ · exact integrable_const _ · filter_upwards [] with e dsimp [F] fun_prop simpa only [μ, F] using hcont
CausalSmith.PartialID.UnlinkedPropensityAte.cellDeviationIntegral_continuousOn · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:92
theorem cellAbsoluteDeviation_minimizer

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
r :
∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹,
cellAbsoluteDeviation H g true r = ∫ e in cell g r, |1 - c * armProb true e| ∂H
Proof (Lean source)
lemma cellAbsoluteDeviation_minimizer {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (r : LabelSpace J) : ∃ c ∈ Icc ((1 - ε)⁻¹) ε⁻¹, cellAbsoluteDeviation H g true r = ∫ e in cell g r, |1 - c * armProb true e| ∂H := by have hεle : ε ≤ 1 - ε := by linarith [hOverlap.2] have hIcc : (1 - ε)⁻¹ ≤ ε⁻¹ := by simpa only [one_div] using one_div_le_one_div_of_le hOverlap.1 hεle let s := Icc ((1 - ε)⁻¹) ε⁻¹ let f : ℝ → ℝ := fun c => ∫ e in cell g r, |1 - c * armProb true e| ∂H have hs : s.Nonempty := ⟨(1 - ε)⁻¹, ⟨le_refl _, hIcc⟩⟩ obtain ⟨c, hc, heq⟩ := (isCompact_Icc.exists_sInf_image_eq hs (cellDeviationIntegral_continuousOn H g hOverlap r)) refine ⟨c, hc, ?_⟩ have hset : {v : ℝ | ∃ c ∈ s, v = f c} = f '' s := by ext v simp only [Set.mem_ofPred_eq, Set.mem_image] constructor · rintro ⟨c, hc, rfl⟩ exact ⟨c, hc, rfl⟩ · rintro ⟨c, hc, rfl⟩ exact ⟨c, hc, rfl⟩ change sInf {v : ℝ | ∃ c ∈ s, v = f c} = f c rw [hset] exact heq
CausalSmith.PartialID.UnlinkedPropensityAte.cellAbsoluteDeviation_minimizer · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:135
theorem scoreRecovery_iff_cellwiseAE

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
(∃ h : LabelSpace J → ScoreSpace ε, Measurable h ∧ ∀ᵐ e ∂H, e = h (g e))
↔ (∀ r : LabelSpace J, 0 < H (cell g r) → ∃ x : ScoreSpace ε, ∀ᵐ e ∂(H.restrict (cell g r)), e = x)
Proof (Lean source)
lemma scoreRecovery_iff_cellwiseAE {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) (hOverlap : Overlap ε) (hg : Measurable g) : (∃ h : LabelSpace J → ScoreSpace ε, Measurable h ∧ ∀ᵐ e ∂H, e = h (g e)) ↔ (∀ r : LabelSpace J, 0 < H (cell g r) → ∃ x : ScoreSpace ε, ∀ᵐ e ∂(H.restrict (cell g r)), e = x) := by classical constructor · rintro ⟨h, _, hae⟩ r _ refine ⟨h r, ?_⟩ filter_upwards [ae_restrict_of_ae hae, self_mem_ae_restrict (measurableSet_eq_fun hg measurable_const)] with e he hr exact he.trans (congrArg h hr) · intro hs have hx₀ : ε ≤ 1 - ε := by rcases hOverlap with ⟨_, hε⟩ linarith let x₀ : ScoreSpace ε := ⟨ε, ⟨le_refl _, hx₀⟩⟩ let h : LabelSpace J → ScoreSpace ε := fun r => if hr : 0 < H (cell g r) then choose (hs r hr) else x₀ refine ⟨h, measurable_of_finite _, ?_⟩ have hae : ∀ r : LabelSpace J, ∀ᵐ e ∂H, e ∈ cell g r → e = h r := by intro r by_cases hr : 0 < H (cell g r) · have hspec := Classical.choose_spec (hs r hr) have hspec' := (ae_restrict_iff' (μ := H) (s := cell g r) (measurableSet_eq_fun hg measurable_const)).mp hspec simpa [h, hr] using hspec' · have hz : H (cell g r) = 0 := le_antisymm (le_of_not_gt hr) bot_le have hzero : H.restrict (cell g r) = 0 := Measure.restrict_eq_zero.mpr hz have htriv : ∀ᵐ e ∂(H.restrict (cell g r)), e = h r := by rw [hzero] simp exact (ae_restrict_iff' (measurableSet_eq_fun hg measurable_const)).mp htriv filter_upwards [Filter.eventually_all.mpr hae] with e he exact he (g e) (by simp [cell])
CausalSmith.PartialID.UnlinkedPropensityAte.scoreRecovery_iff_cellwiseAE · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:166
theorem worstCaseAmbiguity_eq_zero_iff

Given the stated mathematical inputs and assumptions, this result establishes the stated mathematical conclusion.

Formal statement
ε :
ℝ
J :
ℕ
H :
g :
hOverlap :
hg :
conclusion 1
= 0 ↔ ∃ h : LabelSpace J → ScoreSpace ε, Measurable h ∧ ∀ᵐ e ∂H, e = h (g e)
conclusion 2
= 0 ↔ ∀ r : LabelSpace J, 0 < H (cell g r) → ∃ x : ScoreSpace ε, ∀ᵐ e ∂(H.restrict (cell g r)), e = x
Proof (Lean source)
theorem worstCaseAmbiguity_eq_zero_iff {ε : ℝ} {J : ℕ} (H : Measure (ScoreSpace ε)) (g : ScoreSpace ε → LabelSpace J) [IsProbabilityMeasure H] (hOverlap : Overlap ε) (hg : Measurable g) : (worstCaseAmbiguity H g = 0 ↔ ∃ h : LabelSpace J → ScoreSpace ε, Measurable h ∧ ∀ᵐ e ∂H, e = h (g e)) ∧ (worstCaseAmbiguity H g = 0 ↔ ∀ r : LabelSpace J, 0 < H (cell g r) → ∃ x : ScoreSpace ε, ∀ᵐ e ∂(H.restrict (cell g r)), e = x) := by have hcell : worstCaseAmbiguity H g = 0 ↔ ∀ r : LabelSpace J, 0 < H (cell g r) → ∃ x : ScoreSpace ε, ∀ᵐ e ∂(H.restrict (cell g r)), e = x := by constructor · intro hzero have hsum := (worstCaseAmbiguity_eq H g hOverlap hg).1 rw [hsum] at hzero have hterm : ∀ r : LabelSpace J, cellAbsoluteDeviation H g true r + cellAbsoluteDeviation H g false r = 0 := by intro r have hnonneg (s : LabelSpace J) : 0 ≤ cellAbsoluteDeviation H g true s + cellAbsoluteDeviation H g false s := add_nonneg (cellAbsoluteDeviation_nonneg H g hOverlap true s) (cellAbsoluteDeviation_nonneg H g hOverlap false s) exact (Finset.sum_eq_zero_iff_of_nonneg (s := univ) (f := fun s : LabelSpace J => cellAbsoluteDeviation H g true s + cellAbsoluteDeviation H g false s) (by intro s hs; exact hnonneg s)).mp hzero r (Finset.mem_univ r) intro r hr have hdev : cellAbsoluteDeviation H g true r = 0 := by have hnonneg := cellAbsoluteDeviation_nonneg H g hOverlap false r have hnonneg' := cellAbsoluteDeviation_nonneg H g hOverlap true r linarith [hterm r] obtain ⟨c, hc, hmin⟩ := cellAbsoluteDeviation_minimizer H g hOverlap r have hint : IntegrableOn (fun e : ScoreSpace ε => |1 - c * armProb true e|) (cell g r) H := by apply Integrable.of_bound (C := 1 + |c|) (by simp only [armProb, ↓reduceIte]; fun_prop) filter_upwards [] with e have hp := armProb_bounds true e have hp0 : 0 ≤ armProb true e := le_trans (le_of_lt hOverlap.1) hp.1 have hp1 : armProb true e ≤ 1 := by linarith [hOverlap.1] change ‖|1 - c * armProb true e|‖ ≤ 1 + |c| rw [Real.norm_eq_abs, abs_abs] calc |1 - c * armProb true e| ≤ |(1 : ℝ)| + |c * armProb true e| := by simpa only [sub_zero, zero_sub, abs_neg] using (abs_sub_le (1 : ℝ) 0 (c * armProb true e)) _ = 1 + |c| * armProb true e := by rw [abs_mul, abs_of_nonneg hp0] norm_num _ ≤ 1 + |c| := by nlinarith [abs_nonneg c] have hae : ∀ᵐ e ∂(H.restrict (cell g r)), |1 - c * armProb true e| = 0 := (setIntegral_eq_zero_iff_of_nonneg_ae (Filter.Eventually.of_forall (fun e => abs_nonneg _)) hint).mp (hmin ▸ hdev) obtain ⟨x, _, hx⟩ := Measure.exists_mem_of_measure_ne_zero_of_ae hr.ne' hae refine ⟨x, ?_⟩ have hcpos : 0 < c := lt_of_lt_of_le (inv_pos.mpr (by linarith [hOverlap.2] : 0 < 1 - ε)) hc.1 filter_upwards [hae] with e he apply Subtype.ext have hxe : 1 - c * (x : ℝ) = 0 := by simpa [armProb] using (abs_eq_zero.mp hx) have hee : 1 - c * (e : ℝ) = 0 := by simpa [armProb] using (abs_eq_zero.mp he) have hmul : c * (e : ℝ) = c * (x : ℝ) := by linarith exact mul_left_cancel₀ hcpos.ne' hmul · intro hs obtain ⟨h, _, hae⟩ := (scoreRecovery_iff_cellwiseAE H g hOverlap hg).2 hs rw [(worstCaseAmbiguity_eq H g hOverlap hg).1] apply Finset.sum_eq_zero intro r hr have hrAE : ∀ᵐ e ∂(H.restrict (cell g r)), e = h r := by filter_upwards [ae_restrict_of_ae hae, self_mem_ae_restrict (measurableSet_eq_fun hg measurable_const)] with e he hmem exact he.trans (congrArg h hmem) rw [cellAbsoluteDeviation_zero_of_cellwiseAE H g hOverlap true r (h r) hrAE, cellAbsoluteDeviation_zero_of_cellwiseAE H g hOverlap false r (h r) hrAE] ring exact ⟨hcell.trans (scoreRecovery_iff_cellwiseAE H g hOverlap hg).symm, hcell⟩
CausalSmith.PartialID.UnlinkedPropensityAte.worstCaseAmbiguity_eq_zero_iff · CausalSmith/PartialID/PID_UnlinkedPropensityAte_Research/TUniversalPointIdentification.lean:207