Formalization: Outcome-free Records and the Minimax Precision of Conditional Treatment Effect Estimation

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 (44d8edc) — statements may have moved since the audit.

CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Basic 60 declarations Two-channel point-CATE annotation frontier: Basic constructions and obligations.

Basic

Two-channel point-CATE annotation frontier: Basic constructions and obligations.

Euclidean covariates, with coordinatewise cube support. Given the specified input d, cov is the corresponding construction.

Definition (Lean source)
d :
ℕ
Cov d :
Type
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Cov · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:32

Closed design cube. Given the specified input d, cube is the corresponding construction.

Definition (Lean source)
d :
ℕ
cube d :
Set (Cov d)
{x | ∀ i, x i ∈ Icc 0 1}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:34

Given the specified input d, x0 is the corresponding construction.

Definition (Lean source)
d :
ℕ
x0 d :
Cov d
toLp 2 (fun _ => 1 / 2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.x0 · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:36
def uniformLaw

Given the specified input d, uniform law is the corresponding construction.

Definition (Lean source)
d :
ℕ
uniformLaw d :
Measure (Cov d)
volume.restrict (cube d)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniformLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:38
def FullRecord

Given the specified input d, full record is the corresponding construction.

Definition (Lean source)
d :
ℕ
FullRecord d :
Type
Cov d × Bool × Bool × Bool
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.FullRecord · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:40
def bit

Given the specified input a, bit is the corresponding construction.

Definition (Lean source)
a :
bit a :
ℝ
if a then 1 else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:43

Given the specified input d, the specified input w, observed is the corresponding construction.

Definition (Lean source)
d :
ℕ
w :
observed w :
Cov d × Bool × Bool
(w.1, w.2.1, if w.2.1 then w.2.2.2 else w.2.2.1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.observed · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:45
def bern

Given the specified input p, bern is the corresponding construction.

Definition (Lean source)
p :
ℝ
bern p :
ofReal (1-p) • Measure.dirac false + ofReal p • Measure.dirac true
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:48

Given the specified input p, the specified input hp, the measurable bern conclusion holds.

Formal statement
Ω :
p :
Ω → ℝ
hp :
Measurable (fun x => bern (p x))
Proof (Lean source)
@[fun_prop] lemma measurable_bern {Ω : Type*} [MeasurableSpace Ω] (p : Ω → ℝ) (hp : Measurable p) : Measurable (fun x => bern (p x)) := by unfold bern fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_bern · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:51
def bernKernel

Given the specified input p, the specified input hp, bern kernel is the corresponding construction.

Definition (Lean source)
Ω :
p :
Ω → ℝ
hp :
bernKernel p hp :
⟨fun x => bern (p x), measurable_bern p hp⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bernKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:56

A probability law with raw measurable conditional versions. Class membership below quantifies over admissible replacements with the same underlying measure.

Definition (Lean source)
d :
ℕ
law :
probability :
supported :
law {w | w.1 ∈ cube d} = 1
e :
Cov d → ℝ
mu0 :
Cov d → ℝ
mu1 :
Cov d → ℝ
measurable_e :
measurable_mu0 :
measurable_mu1 :
margin_e :
law.map (fun w => (w.1,w.2.1)) = (law.map fst) ⊗ₘ bernKernel e measurable_e
margin_mu0 :
law.map (fun w => (w.1,w.2.2.1)) = (law.map fst) ⊗ₘ bernKernel mu0 measurable_mu0
margin_mu1 :
law.map (fun w => (w.1,w.2.2.2)) = (law.map fst) ⊗ₘ bernKernel mu1 measurable_mu1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PrimitiveLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:59
def obsLaw

Given the specified input d, the specified input P, obs law is the corresponding construction.

Definition (Lean source)
d :
ℕ
P :
obsLaw P :
Measure (Cov d × Bool × Bool)
P.law.map observed
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.obsLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:75
def xaLaw

Given the specified input d, the specified input P, xa law is the corresponding construction.

Definition (Lean source)
d :
ℕ
P :
xaLaw P :
Measure (Cov d × Bool)
P.law.map (fun w => (w.1,w.2.1))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.xaLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:77
def rawContrast

Given the specified input d, the specified input P, the specified input x, raw contrast is the corresponding construction.

Definition (Lean source)
d :
ℕ
P :
x :
Cov d
rawContrast P x :
ℝ
P.mu1 x - P.mu0 x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rawContrast · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:79
def PublicDomain

The public parameter domain: the covariate dimension d is at least one, the propensity smoothness alpha and the control-mean smoothness beta lie in (0, 1], the effect smoothness gamma lies in [1, 3], the Hölder radius L exceeds one half, and the overlap level eps lies strictly between 0 and one half. All constants in the results may depend on these parameters.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
PublicDomain d alpha beta gamma L eps :
Prop
clause 1
1 ≤ d
clause 2
0 < alpha
clause 3
alpha ≤ 1
clause 4
0 < beta
clause 5
beta ≤ 1
clause 6
1 ≤ gamma
clause 7
gamma ≤ 3
clause 8
1/2 < L
clause 9
0 < eps
clause 10
eps < 1/2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PublicDomain · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:83
def multiOrder

multi order is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
κ :
Fin d → ℕ
multiOrder κ :
ℕ
∑ i, κ i
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.multiOrder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:91
def coordinateDirections

Given the specified input k, coordinate directions is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
κ :
Fin d → ℕ
k :
Fin (multiOrder κ)
coordinateDirections κ k :
Cov d
∑ i, if (∑ j ∈ Finset.univ.filter (fun j => j < i), κ j) ≤ k.val ∧
k.val < (∑ j ∈ Finset.univ.filter (fun j => j < i), κ j)
+ κ i then single i 1 else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinateDirections · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:93
def coordinatePartial

Given the specified input f, the specified input x, coordinate partial is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
f :
Cov d → ℝ
κ :
Fin d → ℕ
x :
Cov d
coordinatePartial f κ x :
ℝ
iteratedFDerivWithin ℝ (multiOrder κ) f (cube d) x (coordinateDirections κ)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:98
def holderNorm

Exact coordinate-partial Hölder norm, infinite when the required continuous derivatives do not exist. Given the specified input f, the specified input s, holder norm is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
f :
Cov d → ℝ
s :
ℝ
holderNorm f s :
ℝ≥0∞
if ContDiffOn ℝ (ceil s - 1 : ℕ) f (cube d) then max (⨆ (κ : Fin d → ℕ) (_ : multiOrder κ ≤ ceil s - 1) (x : Cov d) (_ : x ∈ cube d), ofReal |coordinatePartial f κ x|) (⨆ (κ : Fin d → ℕ) (_ : multiOrder κ = ceil s - 1) (x : Cov d) (_ : x ∈ cube d) (xp : Cov d) (_ : xp ∈ cube d) (_ : x ≠ xp), ofReal (|coordinatePartial f κ x - coordinatePartial f κ xp| / dist x xp ^ (s - (ceil s - 1 : ℕ)))) else ⊤
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:102

Given the specified input f, the specified input s, the specified input L, the specified input hL, the holder norm le iff conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
s L :
ℝ
hL :
0 ≤ L
holderNorm f s ≤ ofReal L ↔ ContDiffOn ℝ (ceil s - 1 : ℕ) f (cube d) ∧
(∀ κ, multiOrder κ ≤ ceil s - 1 → ∀ x ∈ cube d, |coordinatePartial f κ x| ≤ L) ∧
(∀ κ, multiOrder κ = ceil s - 1 → ∀ x ∈ cube d, ∀ xp ∈ cube d, x ≠ xp → |coordinatePartial f κ x - coordinatePartial f κ xp| ≤ L * dist x xp ^ (s - (ceil s - 1 : ℕ)))
Proof (Lean source)
lemma holderNorm_le_iff (f : Cov d → ℝ) (s L : ℝ) (hL : 0 ≤ L) : holderNorm f s ≤ ofReal L ↔ ContDiffOn ℝ (ceil s - 1 : ℕ) f (cube d) ∧ (∀ κ, multiOrder κ ≤ ceil s - 1 → ∀ x ∈ cube d, |coordinatePartial f κ x| ≤ L) ∧ (∀ κ, multiOrder κ = ceil s - 1 → ∀ x ∈ cube d, ∀ xp ∈ cube d, x ≠ xp → |coordinatePartial f κ x - coordinatePartial f κ xp| ≤ L * dist x xp ^ (s - (ceil s - 1 : ℕ))) := by unfold holderNorm by_cases hf : ContDiffOn ℝ (ceil s - 1 : ℕ) f (cube d) · rw [if_pos hf] simp only [max_le_iff, iSup_le_iff, ENNReal.ofReal_le_ofReal_iff hL] constructor · rintro ⟨hderiv, hseminorm⟩ refine ⟨hf, hderiv, ?_⟩ intro κ hκ x hx xp hxp hne exact (div_le_iff₀ (Real.rpow_pos_of_pos (dist_pos.mpr hne) _)).mp (hseminorm κ hκ x hx xp hxp hne) · rintro ⟨_, hderiv, hseminorm⟩ refine ⟨hderiv, ?_⟩ intro κ hκ x hx xp hxp hne exact (div_le_iff₀ (Real.rpow_pos_of_pos (dist_pos.mpr hne) _)).mpr (hseminorm κ hκ x hx xp hxp hne) · rw [if_neg hf] simp only [top_le_iff, ENNReal.ofReal_ne_top, false_iff] exact fun h => hf h.1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_le_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:112

The cube has a nonempty open interior, so within-cube derivatives are unique. Given the specified input d, the unique diff on cube conclusion holds.

Formal statement
d :
ℕ
UniqueDiffOn ℝ (cube d)
Proof (Lean source)
lemma uniqueDiffOn_cube (d : ℕ) : UniqueDiffOn ℝ (cube d) := by apply uniqueDiffOn_convex · intro x hx y hy a b ha hb hab intro i change 0 ≤ a * x i + b * y i ∧ a * x i + b * y i ≤ 1 constructor · exact add_nonneg (mul_nonneg ha (hx i).1) (mul_nonneg hb (hy i).1) · calc a * x i + b * y i ≤ a * 1 + b * 1 := add_le_add (mul_le_mul_of_nonneg_left (hx i).2 ha) (mul_le_mul_of_nonneg_left (hy i).2 hb) _ = 1 := by nlinarith · let U : Set (Cov d) := ⋂ i : Fin d, {x | x i ∈ Ioo (0 : ℝ) 1} have hU : IsOpen U := by apply isOpen_iInter_of_finite intro i exact isOpen_Ioo.preimage (by fun_prop) have hsub : U ⊆ cube d := by intro x hx i have hi := Set.mem_iInter.mp hx i exact ⟨hi.1.le, hi.2.le⟩ refine ⟨x0 d, interior_mono hsub ?_⟩ rw [hU.interior_eq] norm_num [U, x0]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniqueDiffOn_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:137

Coordinate partials of smooth functions add on the closed cube. Given the specified input f, the specified input g, the specified input N, the specified input hf, the specified input hg, the multi-index, its order bound, the specified input x, the specified input hx, the coordinate partial add conclusion holds.

Formal statement
d :
ℕ
shared
f g :
Cov d → ℝ
N :
ℕ
hf :
ContDiffOn ℝ N f (cube d)
hg :
ContDiffOn ℝ N g (cube d)
κ :
Fin d → ℕ
hκ :
multiOrder κ ≤ N
x :
Cov d
hx :
x ∈ cube d
coordinatePartial (fun x => f x + g x) κ x
= coordinatePartial f κ x + coordinatePartial g κ x
Proof (Lean source)
lemma coordinatePartial_add (f g : Cov d → ℝ) (N : ℕ) (hf : ContDiffOn ℝ N f (cube d)) (hg : ContDiffOn ℝ N g (cube d)) (κ : Fin d → ℕ) (hκ : multiOrder κ ≤ N) (x : Cov d) (hx : x ∈ cube d) : coordinatePartial (fun x => f x + g x) κ x = coordinatePartial f κ x + coordinatePartial g κ x := by unfold coordinatePartial rw [fun_iteratedFDerivWithin_add_apply ((hf.of_le (by exact_mod_cast hκ)) x hx) ((hg.of_le (by exact_mod_cast hκ)) x hx) (uniqueDiffOn_cube d) hx] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial_add · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:163

The exact extended Hölder norm obeys the triangle inequality. Given the specified input f, the specified input g, the specified input s, the holder norm add le conclusion holds.

Formal statement
d :
ℕ
shared
f g :
Cov d → ℝ
s :
ℝ
holderNorm (fun x => f x + g x) s ≤ holderNorm f s + holderNorm g s
Proof (Lean source)
lemma holderNorm_add_le (f g : Cov d → ℝ) (s : ℝ) : holderNorm (fun x => f x + g x) s ≤ holderNorm f s + holderNorm g s := by by_cases hfTop : holderNorm f s = ⊤ · simp [hfTop] by_cases hgTop : holderNorm g s = ⊤ · simp [hgTop] let A := (holderNorm f s).toReal let B := (holderNorm g s).toReal have hA : 0 ≤ A := ENNReal.toReal_nonneg have hB : 0 ≤ B := ENNReal.toReal_nonneg have hf := (holderNorm_le_iff f s A hA).mp (le_of_eq (ENNReal.ofReal_toReal hfTop).symm) have hg := (holderNorm_le_iff g s B hB).mp (le_of_eq (ENNReal.ofReal_toReal hgTop).symm) have hbound : holderNorm (fun x => f x + g x) s ≤ ofReal (A + B) := by apply (holderNorm_le_iff _ s (A + B) (add_nonneg hA hB)).mpr refine ⟨hf.1.add hg.1, ?_, ?_⟩ · intro κ hκ x hx rw [coordinatePartial_add f g _ hf.1 hg.1 κ hκ x hx] exact (abs_add_le _ _).trans (add_le_add (hf.2.1 κ hκ x hx) (hg.2.1 κ hκ x hx)) · intro κ hκ x hx xp hxp hne rw [coordinatePartial_add f g _ hf.1 hg.1 κ hκ.le x hx, coordinatePartial_add f g _ hf.1 hg.1 κ hκ.le xp hxp] calc |coordinatePartial f κ x + coordinatePartial g κ x - (coordinatePartial f κ xp + coordinatePartial g κ xp)| = |(coordinatePartial f κ x - coordinatePartial f κ xp) + (coordinatePartial g κ x - coordinatePartial g κ xp)| := by congr 1; ring _ ≤ |coordinatePartial f κ x - coordinatePartial f κ xp| + |coordinatePartial g κ x - coordinatePartial g κ xp| := abs_add_le _ _ _ ≤ A * dist x xp ^ (s - (ceil s - 1 : ℕ)) + B * dist x xp ^ (s - (ceil s - 1 : ℕ)) := add_le_add (hf.2.2 κ hκ x hx xp hxp hne) (hg.2.2 κ hκ x hx xp hxp hne) _ = (A + B) * dist x xp ^ (s - (ceil s - 1 : ℕ)) := by ring rw [ENNReal.ofReal_add hA hB] at hbound dsimp only [A, B] at hbound simpa only [ENNReal.ofReal_toReal hfTop, ENNReal.ofReal_toReal hgTop] using hbound
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_add_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:175
def UniformDesign

Given the specified input P, uniform design is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
UniformDesign P :
Prop
P.law.map fst = uniformLaw d
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.UniformDesign · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:214
def ConditionalExchangeability

Given the specified input P, conditional exchangeability is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
ConditionalExchangeability P :
Prop
∃ Γ : Kernel (Cov d) (Bool × Bool),
clause 1
clause 2
P.law.map (fun w => ((w.1,(w.2.2.1,w.2.2.2)),w.2.1))
= (P.law.map fst ⊗ₘ Γ) ⊗ₘ bernKernel (fun w : Cov d × (Bool × Bool) => P.e w.1) (P.measurable_e.comp measurable_fst)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ConditionalExchangeability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:217
def Overlap

The overlap condition at level eps: the overlap level eps is positive and, on the design cube, the law P has a propensity between eps and 1 − eps.

Definition (Lean source)
d :
ℕ
shared
eps :
ℝ
P :
Overlap eps P :
Prop
clause 1
0 < eps
clause 2
x ∈ cube d :
eps ≤ P.e x
P.e x ≤ 1 - eps
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Overlap · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:224
theorem unit

Under overlap at the overlap level eps, the propensity of the law P is a probability on the design cube.

Formal statement
d :
ℕ
shared
eps :
ℝ
P :
h :
Overlap eps P
x ∈ cube d :
conclusion 1
0 ≤ P.e x
conclusion 2
P.e x ≤ 1
Proof (Lean source)
lemma Overlap.unit {eps : ℝ} {P : PrimitiveLaw d} (h : Overlap eps P) : ∀ x ∈ cube d, 0 ≤ P.e x ∧ P.e x ≤ 1 := by intro x hx have hb := h.2 x hx constructor <;> linarith [h.1, hb.1, hb.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Overlap.unit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:228
def PropensityHolder

Witness-level propensity smoothness, applied by PrimitiveClass to its admissible W. Given the specified input alpha, the specified input L, the specified input W, propensity holder is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha L :
ℝ
W :
PropensityHolder alpha L W :
Prop
holderNorm W.e alpha ≤ ofReal L
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PropensityHolder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:235
def ControlHolder

Witness-level control-mean smoothness, applied by PrimitiveClass to its admissible W. Given the specified input beta, the specified input L, the specified input W, control holder is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
beta L :
ℝ
W :
ControlHolder beta L W :
Prop
holderNorm W.mu0 beta ≤ ofReal L
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ControlHolder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:238
def EffectHolder

Witness-level effect smoothness. After W is selected, rawContrast W agrees with the canonical tau on the cube. Given the specified input gamma, the specified input L, the specified input W, effect holder is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
gamma L :
ℝ
W :
EffectHolder gamma L W :
Prop
holderNorm (rawContrast W) gamma ≤ ofReal L
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.EffectHolder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:241
def ControlInterior

The control-arm mean range condition: on the design cube, the admissible version W has a control mean that is a probability, between 0 and 1.

Definition (Lean source)
d :
ℕ
shared
W :
x ∈ cube d :
ControlInterior W :
Prop
clause 1
0 ≤ W.mu0 x
clause 2
W.mu0 x ≤ 1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ControlInterior · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:245
def TreatedInterior

The treated-arm mean range condition: on the design cube, the admissible version W has a treated mean that is a probability, between 0 and 1.

Definition (Lean source)
d :
ℕ
shared
W :
x ∈ cube d :
TreatedInterior W :
Prop
clause 1
0 ≤ W.mu1 x
clause 2
W.mu1 x ≤ 1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.TreatedInterior · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:248
structure PrimitiveClass

Membership is existential over conditional-margin witnesses of the underlying law. The carrier's raw versions do not enter this predicate.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
versions :
∃ W : PrimitiveLaw d,
W.law = P.law ∧
Overlap eps W ∧
PropensityHolder alpha L W ∧
ControlHolder beta L W ∧
EffectHolder gamma L W ∧
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PrimitiveClass · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:251
def canonicalLaw

Designated admissible versions are selected from membership, never from the raw carrier. Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, canonical law is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
canonicalLaw P hP :
choose hP.versions
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.canonicalLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:260
theorem canonicalLaw_spec

Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the canonical law spec conclusion holds.

Formal statement
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
conclusion 1
(canonicalLaw P hP).law = P.law
conclusion 2
conclusion 4
conclusion 5
conclusion 6
conclusion 7
EffectHolder gamma L (canonicalLaw P hP)
conclusion 8
conclusion 9
Proof (Lean source)
lemma canonicalLaw_spec {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : (canonicalLaw P hP).law = P.law ∧ UniformDesign (canonicalLaw P hP) ∧ ConditionalExchangeability (canonicalLaw P hP) ∧ Overlap eps (canonicalLaw P hP) ∧ PropensityHolder alpha L (canonicalLaw P hP) ∧ ControlHolder beta L (canonicalLaw P hP) ∧ EffectHolder gamma L (canonicalLaw P hP) ∧ ControlInterior (canonicalLaw P hP) ∧ TreatedInterior (canonicalLaw P hP) := by exact Classical.choose_spec hP.versions
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.canonicalLaw_spec · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:265
theorem eps_pos

For a law P in the model class, the overlap level eps is positive.

Formal statement
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
0 < eps
Proof (Lean source)
lemma PrimitiveClass.eps_pos {alpha beta gamma L eps : ℝ} {P : PrimitiveLaw d} (hP : PrimitiveClass alpha beta gamma L eps P) : 0 < eps := (canonicalLaw_spec P hP).2.2.2.1.1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PrimitiveClass.eps_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:275
theorem eps_le_half

For a law P in the model class, the overlap level eps is at most one half, since the propensity at the cube centre lies between eps and 1 − eps.

Formal statement
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
eps ≤ 1/2
Proof (Lean source)
lemma PrimitiveClass.eps_le_half {alpha beta gamma L eps : ℝ} {P : PrimitiveLaw d} (hP : PrimitiveClass alpha beta gamma L eps P) : eps ≤ 1/2 := by have hx : x0 d ∈ cube d := by intro i; norm_num [x0, cube] have hb := (canonicalLaw_spec P hP).2.2.2.1.2 (x0 d) hx linarith [hb.1, hb.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PrimitiveClass.eps_le_half · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:280

The supplied propensity and arm means are admissible conditional-margin witnesses. Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, designated propensity is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
designatedPropensity P hP :
Cov d → ℝ
fun x => if x ∈ cube d then (canonicalLaw P hP).e x else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedPropensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:287
def designatedControl

Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, designated control is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
designatedControl P hP :
Cov d → ℝ
fun x => if x ∈ cube d then (canonicalLaw P hP).mu0 x else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedControl · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:291
def designatedTreated

Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, designated treated is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
designatedTreated P hP :
Cov d → ℝ
fun x => if x ∈ cube d then (canonicalLaw P hP).mu1 x else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedTreated · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:295

Canonical continuous contrast on the cube, obtained from admissible witnesses. Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input x, tau is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
x :
Cov d
tau P hP x :
ℝ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tau · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:299
theorem cube_subset_closure_interior Lemma cube_subset_closure_interior in the paper ↗

The closed cube has dense interior, including in dimension zero. Given the specified input d, the cube subset closure interior conclusion holds.

Formal statement
d :
ℕ
cube d ⊆ closure (interior (cube d))
Proof (Lean source)
lemma cube_subset_closure_interior (d : ℕ) : cube d ⊆ closure (interior (cube d)) := by let H := PiLp.homeomorph 2 (fun _ : Fin d => ℝ) have hc : cube d = H ⁻¹' pi univ (fun _ => Icc (0 : ℝ) 1) := by ext x; simp [cube, H, PiLp.homeomorph, Pi.le_def, forall_and] rw [hc, ← H.preimage_interior, ← H.preimage_closure] apply Set.preimage_mono rw [interior_pi_set Set.finite_univ, closure_pi_set] exact Set.pi_mono fun i _ => (closure_interior_Icc (by norm_num : (0 : ℝ) ≠ 1)).symm.subset
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cube_subset_closure_interior · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:304
theorem uniformLaw_continuous_versions Lemma uniformLaw_continuous_versions in the paper ↗

Uniform-design almost-everywhere equality determines continuous versions on the cube. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hfg, the uniform law continuous versions conclusion holds.

Formal statement
d :
ℕ
shared
f g :
Cov d → ℝ
hf :
ContinuousOn f (cube d)
hg :
ContinuousOn g (cube d)
hfg :
f =ᵐ[uniformLaw d] g
EqOn f g (cube d)
Proof (Lean source)
lemma uniformLaw_continuous_versions (f g : Cov d → ℝ) (hf : ContinuousOn f (cube d)) (hg : ContinuousOn g (cube d)) (hfg : f =ᵐ[uniformLaw d] g) : EqOn f g (cube d) := by exact MeasureTheory.Measure.eqOn_of_ae_eq hfg hf hg (cube_subset_closure_interior d)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniformLaw_continuous_versions · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:314
theorem holderNorm_continuousOn Lemma holderNorm_continuousOn in the paper ↗

Finite Hölder norm supplies continuity on the entire closed cube. Given the specified input f, the specified input s, the specified input L, the specified input h, the holder norm continuous on conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
s L :
ℝ
h :
holderNorm f s ≤ ofReal L
ContinuousOn f (cube d)
Proof (Lean source)
lemma holderNorm_continuousOn (f : Cov d → ℝ) (s L : ℝ) (h : holderNorm f s ≤ ofReal L) : ContinuousOn f (cube d) := by have hc : ContDiffOn ℝ (ceil s - 1 : ℕ) f (cube d) := by by_contra hn simp only [holderNorm, if_neg hn] at h exact ENNReal.ofReal_ne_top (top_le_iff.mp h) exact hc.continuousOn
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_continuousOn · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:320

Clamp a raw version only outside its probability range. Given the specified input p, version clip is the corresponding construction.

Definition (Lean source)
p :
ℝ
versionClip p :
ℝ
max 0 (min 1 p)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.versionClip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:329

Given the specified input p, the version clip mem conclusion holds.

Formal statement
p :
ℝ
versionClip p ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma versionClip_mem (p : ℝ) : versionClip p ∈ Icc (0 : ℝ) 1 := by exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.versionClip_mem · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:332

Given the specified input p, the specified input hp, the version clip eq conclusion holds.

Formal statement
p :
ℝ
hp :
p ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma versionClip_eq (p : ℝ) (hp : p ∈ Icc (0 : ℝ) 1) : versionClip p = p := by simp only [versionClip, min_eq_right hp.2, max_eq_right hp.1]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.versionClip_eq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:336

the measurable version clip conclusion holds.

Formal statement
Proof (Lean source)
@[fun_prop] lemma measurable_versionClip : Measurable versionClip := by unfold versionClip fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_versionClip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:340
theorem bernKernel_versionClip_markov Lemma bernKernel_versionClip_markov in the paper ↗

Clipped Bernoulli kernels are Markov kernels even when raw versions are unbounded. Given the specified input f, the specified input hf, the bern kernel version clip markov conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
hf :
IsMarkovKernel (bernKernel (fun x => versionClip (f x)) (by fun_prop))
Proof (Lean source)
lemma bernKernel_versionClip_markov (f : Cov d → ℝ) (hf : Measurable f) : IsMarkovKernel (bernKernel (fun x => versionClip (f x)) (by fun_prop)) := by constructor intro x constructor have hp := versionClip_mem (f x) simp only [bernKernel, Kernel.coe_mk, bern, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (sub_nonneg.mpr hp.2) hp.1] norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bernKernel_versionClip_markov · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:345
theorem bernKernel_sfinite_of_margin Lemma bernKernel_sfinite_of_margin in the paper ↗

A probability marginal rules out the zero fallback in composition-product. Given the specified input P, the specified input j, the specified input hj, the specified input f, the specified input hf, the specified input hm, the bern kernel sfinite of margin conclusion holds.

Formal statement
d :
ℕ
shared
P :
j :
hj :
f :
Cov d → ℝ
hf :
hm :
P.law.map (fun w => (w.1, j w)) = (P.law.map fst) ⊗ₘ bernKernel f hf
Proof (Lean source)
lemma bernKernel_sfinite_of_margin (P : PrimitiveLaw d) (j : FullRecord d → Bool) (hj : Measurable j) (f : Cov d → ℝ) (hf : Measurable f) (hm : P.law.map (fun w => (w.1, j w)) = (P.law.map fst) ⊗ₘ bernKernel f hf) : IsSFiniteKernel (bernKernel f hf) := by by_contra hn have hz : P.law.map (fun w => (w.1, j w)) = 0 := hm.trans (Measure.compProd_of_not_isSFiniteKernel _ _ hn) have hu := congrArg (fun μ : Measure (Cov d × Bool) => μ univ) hz rw [Measure.map_apply (by fun_prop) MeasurableSet.univ] at hu simp at hu
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bernKernel_sfinite_of_margin · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:357
theorem bern_margin_versions_unique Lemma bern_margin_versions_unique in the paper ↗

Conditional Bernoulli margins identify admissible continuous probability versions. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hfcont, the specified input hgcont, the specified input hfprob, the specified input hgprob, the specified input hm, the bern margin versions unique conclusion holds.

Formal statement
d :
ℕ
shared
f g :
Cov d → ℝ
hf :
hg :
hfcont :
ContinuousOn f (cube d)
hgcont :
ContinuousOn g (cube d)
hfprob :
∀ x ∈ cube d, f x ∈ Icc (0 : ℝ) 1
hgprob :
∀ x ∈ cube d, g x ∈ Icc (0 : ℝ) 1
hm :
(uniformLaw d) ⊗ₘ bernKernel f hf = (uniformLaw d) ⊗ₘ bernKernel g hg
EqOn f g (cube d)
Proof (Lean source)
lemma bern_margin_versions_unique (f g : Cov d → ℝ) (hf : Measurable f) (hg : Measurable g) [IsFiniteMeasure (uniformLaw d)] [IsSFiniteKernel (bernKernel f hf)] [IsSFiniteKernel (bernKernel g hg)] (hfcont : ContinuousOn f (cube d)) (hgcont : ContinuousOn g (cube d)) (hfprob : ∀ x ∈ cube d, f x ∈ Icc (0 : ℝ) 1) (hgprob : ∀ x ∈ cube d, g x ∈ Icc (0 : ℝ) 1) (hm : (uniformLaw d) ⊗ₘ bernKernel f hf = (uniformLaw d) ⊗ₘ bernKernel g hg) : EqOn f g (cube d) := by have hcube : MeasurableSet (cube d) := by have heq : cube d = ⋂ i : Fin d, (fun x : Cov d => x i) ⁻¹' Icc (0 : ℝ) 1 := by ext x; simp [cube] rw [heq] exact MeasurableSet.iInter fun i => measurableSet_Icc.preimage (by fun_prop) let fc := bernKernel (fun x => versionClip (f x)) (by fun_prop) let gc := bernKernel (fun x => versionClip (g x)) (by fun_prop) let : IsMarkovKernel fc := bernKernel_versionClip_markov f hf let : IsMarkovKernel gc := bernKernel_versionClip_markov g hg have hfc : bernKernel f hf =ᵐ[uniformLaw d] fc := by filter_upwards [ae_restrict_mem hcube] with x hx change bern (f x) = bern (versionClip (f x)) rw [versionClip_eq _ (hfprob x hx)] have hgc : bernKernel g hg =ᵐ[uniformLaw d] gc := by filter_upwards [ae_restrict_mem hcube] with x hx change bern (g x) = bern (versionClip (g x)) rw [versionClip_eq _ (hgprob x hx)] have heq : fc =ᵐ[uniformLaw d] gc := Kernel.ae_eq_of_compProd_eq ((Measure.compProd_congr hfc).symm.trans (hm.trans (Measure.compProd_congr hgc))) apply uniformLaw_continuous_versions f g hfcont hgcont filter_upwards [hfc, hgc, heq, ae_restrict_mem hcube] with x hfx hgx hx hxc have hb : bern (f x) = bern (g x) := hfx.trans (hx.trans hgx.symm) have ht := congrArg (fun μ : Measure Bool => μ {true}) hb simp [bern] at ht exact (ENNReal.ofReal_eq_ofReal_iff (hfprob x hxc).1 (hgprob x hxc).1).mp ht
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_margin_versions_unique · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:369
theorem admissible_versions_unique Lemma admissible_versions_unique in the paper ↗

Full support of the uniform design and continuity make admissible versions unique on the closed cube, including its boundary. Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input Q, the specified input hP, the specified input hQ, the specified input hlaw, the admissible versions unique conclusion holds.

Formal statement
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P Q :
hP :
PrimitiveClass alpha beta gamma L eps P
hQ :
PrimitiveClass alpha beta gamma L eps Q
hlaw :
P.law = Q.law
x ∈ cube d :
conclusion 1
conclusion 2
conclusion 3
conclusion 4
tau P hP x = tau Q hQ x
Proof (Lean source)
lemma admissible_versions_unique {alpha beta gamma L eps : ℝ} (P Q : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hQ : PrimitiveClass alpha beta gamma L eps Q) (hlaw : P.law = Q.law) : ∀ x ∈ cube d, designatedPropensity P hP x = designatedPropensity Q hQ x ∧ designatedControl P hP x = designatedControl Q hQ x ∧ designatedTreated P hP x = designatedTreated Q hQ x ∧ tau P hP x = tau Q hQ x := by let W := canonicalLaw P hP let V := canonicalLaw Q hQ have hW := canonicalLaw_spec P hP have hV := canonicalLaw_spec Q hQ have hWV : W.law = V.law := hW.1.trans (hlaw.trans hV.1.symm) have hWu : W.law.map fst = uniformLaw d := hW.2.1 have hVu : V.law.map fst = uniformLaw d := hV.2.1 let : IsFiniteMeasure (uniformLaw d) := by rw [← hWu] infer_instance let := bernKernel_sfinite_of_margin W (fun w => w.2.1) (by fun_prop) W.e W.measurable_e W.margin_e let := bernKernel_sfinite_of_margin V (fun w => w.2.1) (by fun_prop) V.e V.measurable_e V.margin_e let := bernKernel_sfinite_of_margin W (fun w => w.2.2.1) (by fun_prop) W.mu0 W.measurable_mu0 W.margin_mu0 let := bernKernel_sfinite_of_margin V (fun w => w.2.2.1) (by fun_prop) V.mu0 V.measurable_mu0 V.margin_mu0 let := bernKernel_sfinite_of_margin W (fun w => w.2.2.2) (by fun_prop) W.mu1 W.measurable_mu1 W.margin_mu1 let := bernKernel_sfinite_of_margin V (fun w => w.2.2.2) (by fun_prop) V.mu1 V.measurable_mu1 V.margin_mu1 have hWe : ContinuousOn W.e (cube d) := holderNorm_continuousOn _ _ _ hW.2.2.2.2.1 have hVe : ContinuousOn V.e (cube d) := holderNorm_continuousOn _ _ _ hV.2.2.2.2.1 have hW0 : ContinuousOn W.mu0 (cube d) := holderNorm_continuousOn _ _ _ hW.2.2.2.2.2.1 have hV0 : ContinuousOn V.mu0 (cube d) := holderNorm_continuousOn _ _ _ hV.2.2.2.2.2.1 have hW1 : ContinuousOn W.mu1 (cube d) := by have hc := (holderNorm_continuousOn _ _ _ hW.2.2.2.2.2.2.1).add hW0 change ContinuousOn (fun x => (W.mu1 x - W.mu0 x) + W.mu0 x) (cube d) at hc simpa only [Pi.add_apply, rawContrast, sub_add_cancel] using hc have hV1 : ContinuousOn V.mu1 (cube d) := by have hc := (holderNorm_continuousOn _ _ _ hV.2.2.2.2.2.2.1).add hV0 change ContinuousOn (fun x => (V.mu1 x - V.mu0 x) + V.mu0 x) (cube d) at hc simpa only [Pi.add_apply, rawContrast, sub_add_cancel] using hc have he : EqOn W.e V.e (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_e V.measurable_e hWe hVe · exact hW.2.2.2.1.unit · exact hV.2.2.2.1.unit · rw [← hWu, ← W.margin_e, hWV, V.margin_e, hVu] have h0 : EqOn W.mu0 V.mu0 (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_mu0 V.measurable_mu0 hW0 hV0 · intro x hx; have hb := hW.2.2.2.2.2.2.2.1 x hx; constructor <;> linarith [hb.1, hb.2] · intro x hx; have hb := hV.2.2.2.2.2.2.2.1 x hx; constructor <;> linarith [hb.1, hb.2] · rw [← hWu, ← W.margin_mu0, hWV, V.margin_mu0, hVu] have h1 : EqOn W.mu1 V.mu1 (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_mu1 V.measurable_mu1 hW1 hV1 · intro x hx; have hb := hW.2.2.2.2.2.2.2.2 x hx; constructor <;> linarith [hb.1, hb.2] · intro x hx; have hb := hV.2.2.2.2.2.2.2.2 x hx; constructor <;> linarith [hb.1, hb.2] · rw [← hWu, ← W.margin_mu1, hWV, V.margin_mu1, hVu] intro x hx have hex := he hx have h0x := h0 hx have h1x := h1 hx simpa only [designatedPropensity, designatedControl, designatedTreated, tau, if_pos hx] using (show W.e x = V.e x ∧ W.mu0 x = V.mu0 x ∧ W.mu1 x = V.mu1 x ∧ W.mu1 x - W.mu0 x = V.mu1 x - V.mu0 x from ⟨hex, h0x, h1x, congrArg₂ (fun a b : ℝ => a - b) h1x h0x⟩)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.admissible_versions_unique · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:404

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, big delta is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
bigDelta d alpha beta gamma :
ℝ
2*gamma + d + gamma*d/(alpha+beta)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bigDelta · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:464

Given the specified input d, the specified input gamma, s crit is the corresponding construction.

Definition (Lean source)
d :
ℕ
gamma :
ℝ
sCrit d gamma :
ℝ
gamma*d/(2*gamma+d)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sCrit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:466

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, q star is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
qStar d alpha beta gamma :
ℝ
gamma*d/((alpha+beta)*(2*gamma+d))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qStar · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:468

Given the specified input d, the specified input gamma, the specified input n, oracle rate is the corresponding construction.

Definition (Lean source)
d :
ℕ
gamma :
ℝ
n :
ℕ
oracleRate d gamma n :
ℝ
(n:ℝ)^(-(gamma/(2*gamma+d)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleRate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:470

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, upper rate is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
n m :
ℕ
upperRate d alpha beta gamma n m :
ℝ
max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.upperRate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:472
def sharpRate

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, sharp rate is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
n m :
ℕ
sharpRate d alpha beta gamma n m :
ℝ
max ((n:ℝ)^(-(gamma/(2*gamma+d)))) (((n:ℝ)*((n:ℝ)+m))^(-(gamma/(2*gamma+d+gamma*d/(alpha+beta)))))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpRate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:476

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, the sharp rate eq upper rate conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma :
ℝ
n m :
ℕ
sharpRate d alpha beta gamma n m = upperRate d alpha beta gamma n m
Proof (Lean source)
lemma sharpRate_eq_upperRate (d : ℕ) (alpha beta gamma : ℝ) (n m : ℕ) : sharpRate d alpha beta gamma n m = upperRate d alpha beta gamma n m := by rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpRate_eq_upperRate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:480

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input zeta, annotation region is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma zeta :
ℝ
annotationRegion d alpha beta gamma zeta :
Set (ℕ × ℕ)
{p | 2 ≤ p.1 ∧ sharpRate d alpha beta gamma p.1 p.2 ≤ zeta * oracleRate d gamma p.1}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotationRegion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Basic.lean:485
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Estimator 23 declarations Two-channel point-CATE annotation frontier: Estimator constructions and obligations.

Estimator

Two-channel point-CATE annotation frontier: Estimator constructions and obligations.

def treatmentRecords

Given the specified input D, treatment records is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
treatmentRecords D :
Fin (n+m) → Cov d × Bool
Fin.addCases (fun i => ((D.1 i).1, (D.1 i).2.1)) D.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.treatmentRecords · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:25
def outcomeCount

Given the specified input n, outcome count is the corresponding construction.

Definition (Lean source)
n :
ℕ
outcomeCount n :
ℕ
n/2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.outcomeCount · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:28
def treatmentCount

Given the specified input n, the specified input m, treatment count is the corresponding construction.

Definition (Lean source)
n m :
ℕ
treatmentCount n m :
ℕ
n+m-n/2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.treatmentCount · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:30
def roleSplit

Given the specified input n, the specified input m, role split is the corresponding construction.

Definition (Lean source)
n m :
ℕ
roleSplit n m :
Finset (Fin n) × Finset (Fin (n+m))
(Finset.univ.filter (fun j => j.val < n/2), Finset.univ.filter (fun i => n/2 ≤ i.val))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.roleSplit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:33
def etaHat

Given the specified input D, the specified input h, the specified input J, the specified input x, eta hat is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
x :
Cov d
etaHat D h J x :
ℝ
if x ∈ locCube d h then (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, locWeight h (D.1 j).1 * fineKernel d h J x (D.1 j).1 * bit (D.1 j).2.2 else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.etaHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:37
def rHat

Given the specified input D, the specified input h, the specified input J, the specified input u, r hat is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
u :
rHat D h J u :
ℝ
(outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, locWeight h (D.1 j).1 * coarseBasis h (D.1 j).1 u * bit (D.1 j).2.1 * bit (D.1 j).2.2
- (treatmentCount n m : ℝ)⁻¹ * ∑ i ∈ (roleSplit n m).2, locWeight h (treatmentRecords D i).1 * coarseBasis h (treatmentRecords D i).1 u * bit (treatmentRecords D i).2 * etaHat D h J (treatmentRecords D i).1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:42
def qRaw

Given the specified input D, the specified input h, the specified input J, the specified input u, the specified input v, q raw is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
u v :
qRaw D h J u v :
ℝ
(outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, locWeight h (D.1 j).1 * coarseBasis h (D.1 j).1 u * coarseBasis h (D.1 j).1 v * bit (D.1 j).2.1
- ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, locWeight h (treatmentRecords D i).1 * locWeight h (D.1 j).1 * coarseBasis h (treatmentRecords D i).1 u * coarseBasis h (D.1 j).1 v * bit (treatmentRecords D i).2 * bit (D.1 j).2.1 * fineKernel d h J (treatmentRecords D i).1 (D.1 j).1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qRaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:49
def qHat

Given the specified input D, the specified input h, the specified input J, q hat is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
qHat D h J :
Matrix (PolyIdx d) (PolyIdx d) ℝ
fun u v => (qRaw D h J u v + qRaw D h J v u)/2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:58
def rectMoments

Given the specified input D, the specified input h, the specified input J, rect moments is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
rectMoments D h J :
(PolyIdx d → ℝ) × Matrix (PolyIdx d) (PolyIdx d) ℝ
(rHat D h J, qHat D h J)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectMoments · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:62
def qPop

Given the specified input P, the specified input n, the specified input m, the specified input h, the specified input J, q pop is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
n m :
ℕ
h :
ℝ
J :
ℕ
qPop P n m h J :
Matrix (PolyIdx d) (PolyIdx d) ℝ
fun u v => ∫ w, qHat w.1 h J u v ∂experiment P n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qPop · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:65
def rBar

Given the specified input P, the specified input n, the specified input m, the specified input h, the specified input J, the specified input u, r bar is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
n m :
ℕ
h :
ℝ
J :
ℕ
u :
rBar P n m h J u :
ℝ
∫ w, rHat w.1 h J u ∂experiment P n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rBar · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:68

Given the specified input D, the specified input h, the specified input J, the specified input u, the r hat rectangular conclusion holds.

Formal statement
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
D :
Dataset d n m
h :
ℝ
J :
ℕ
u :
rHat D h J u
= (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, locWeight h (D.1 j).1 * coarseBasis h (D.1 j).1 u * bit (D.1 j).2.1 * bit (D.1 j).2.2
- ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, locWeight h (treatmentRecords D i).1 * locWeight h (D.1 j).1 * coarseBasis h (treatmentRecords D i).1 u * bit (treatmentRecords D i).2 * fineKernel d h J (treatmentRecords D i).1 (D.1 j).1 * bit (D.1 j).2.2
Proof (Lean source)
lemma rHat_rectangular (D : Dataset d n m) (h : ℝ) (J : ℕ) (u : PolyIdx d) : rHat D h J u = (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, locWeight h (D.1 j).1 * coarseBasis h (D.1 j).1 u * bit (D.1 j).2.1 * bit (D.1 j).2.2 - ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, locWeight h (treatmentRecords D i).1 * locWeight h (D.1 j).1 * coarseBasis h (treatmentRecords D i).1 u * bit (treatmentRecords D i).2 * fineKernel d h J (treatmentRecords D i).1 (D.1 j).1 * bit (D.1 j).2.2 := by unfold rHat congr 1 rw [mul_inv_rev] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi by_cases hx : (treatmentRecords D i).1 ∈ locCube d h · simp only [etaHat, if_pos hx] simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring · simp [etaHat, hx, locWeight]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rHat_rectangular · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:71
def lambdaMin

Given the specified input Q, lambda min is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
lambdaMin Q :
ℝ
sInf {c | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u * (Q.mulVec v) u}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.lambdaMin · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:95
def clip

Clipping to the effect range: a real number x is truncated to the interval from −1 to 1, the range of a difference of two probabilities.

Definition (Lean source)
x :
ℝ
clip x :
ℝ
max (-1) (min 1 x)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.clip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:98
def gramGuard

The Gram guard level for the overlap level eps: half of eps·(1 − eps), the smallest value of e·(1 − e) when the propensity e lies between eps and 1 − eps.

Definition (Lean source)
eps :
ℝ
gramGuard eps :
ℝ
eps * (1 - eps) / 2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gramGuard · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:100
theorem gramGuard_pos

For an overlap level eps that is positive and below one, the Gram guard level is positive.

Formal statement
eps :
ℝ
heps :
0 < eps
heps1 :
eps < 1
0 < gramGuard eps
Proof (Lean source)
lemma gramGuard_pos {eps : ℝ} (heps : 0 < eps) (heps1 : eps < 1) : 0 < gramGuard eps := by unfold gramGuard have : 0 < 1 - eps := by linarith positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gramGuard_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:103
theorem gramGuard_pos

Under the public parameter domain, the Gram guard level is positive for the overlap level eps.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
0 < gramGuard eps
Proof (Lean source)
lemma PublicDomain.gramGuard_pos {d : ℕ} {alpha beta gamma L eps : ℝ} (hdom : PublicDomain d alpha beta gamma L eps) : 0 < gramGuard eps := gramGuard_pos hdom.2.2.2.2.2.2.2.2.1 (by linarith [hdom.2.2.2.2.2.2.2.2.2])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PublicDomain.gramGuard_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:109

Given the overlap level eps, the specified input h, the specified input J, the specified input D, t hat is the corresponding construction: the clipped local-polynomial estimate when the smallest Rayleigh quotient of the empirical Gram matrix is at least the Gram guard level of eps, and zero otherwise.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
eps h :
ℝ
J :
ℕ
D :
Dataset d n m
tHat eps h J D :
ℝ
if gramGuard eps
≤ lambdaMin (qHat D h J) then clip (∑ u, r0 d h u * ((qHat D h J)⁻¹.mulVec (rHat D h J)) u) else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:115
def hStar

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, h star is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
n m :
ℕ
hStar d alpha beta gamma n m :
ℝ
(1/2) * max ((n:ℝ)^(-(1/(2*gamma+d)))) (((n:ℝ)*((n:ℝ)+m))^(-(1/bigDelta d alpha beta gamma)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hStar · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:120
def jStar

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, j star is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
n m :
ℕ
jStar d alpha beta gamma n m :
ℕ
ceil ((hStar d alpha beta gamma n m)^(-(max 0 (gamma/(alpha+beta)-1))))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.jStar · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:124

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, the specified input D, the overlap level eps, t up is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma eps :
ℝ
n m :
ℕ
D :
Dataset d n m
tUp d alpha beta gamma eps n m D :
ℝ
tHat eps (hStar d alpha beta gamma n m) (jStar d alpha beta gamma n m) D
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tUp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:128
def sharpDecision

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, the specified input w, the overlap level eps, sharp decision is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma eps :
ℝ
n m :
ℕ
w :
Sample d n m
sharpDecision d alpha beta gamma eps n m w :
ℝ
tUp d alpha beta gamma eps n m w.1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpDecision · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:132
def frontierHandle

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, the specified input m, the overlap level eps, frontier handle is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma eps :
ℝ
n m :
ℕ
frontierHandle d alpha beta gamma eps n m :
ℝ × (Sample d n m → ℝ)
(sharpRate d alpha beta gamma n m, sharpDecision d alpha beta gamma eps n m)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frontierHandle · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Estimator.lean:136
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Experiment 10 declarations Two-channel point-CATE annotation frontier: Experiment constructions and obligations.

Experiment

Two-channel point-CATE annotation frontier: Experiment constructions and obligations.

def Dataset

Given the specified input d, the specified input n, the specified input m, dataset is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
Dataset d n m :
Type
(Fin n → Cov d × Bool × Bool) × (Fin m → Cov d × Bool)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Dataset · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:28

Given the specified input d, the specified input n, the specified input m, sample is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
Sample d n m :
Type
Dataset d n m × ℝ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Sample · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:30

Given the specified input P, the specified input n, the specified input m, experiment is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
n m :
ℕ
experiment P n m :
Measure (Sample d n m)
((Measure.pi fun _ : Fin n => obsLaw P).prod (Measure.pi fun _ : Fin m => xaLaw P)).prod (volume.restrict (Icc 0 1))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:32

Given the specified input d, the specified input n, the specified input m, decision is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
Decision d n m :
Type
{T : Sample d n m → ℝ // Measurable T}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.Decision · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:36
def OracleDecision

Given the specified input d, the specified input n, the specified input m, oracle decision is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
OracleDecision d n m :
Type
{T : Sample d n m → (Cov d → ℝ) → ℝ // ∀ e, Measurable (fun w => T w e)}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.OracleDecision · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:38
def SampleLaw

Given the specified input P, the specified input n, the specified input m, sample law is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
n m :
ℕ
μ :
Measure (Sample d n m)
SampleLaw P n m μ :
Prop
μ = experiment P n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.SampleLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:42
def risk

Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input T, the specified input P, the specified input hP, risk is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
alpha beta gamma L eps :
ℝ
T :
Decision d n m
P :
hP :
PrimitiveClass alpha beta gamma L eps P
risk T P hP :
ℝ≥0∞
∫⁻ w, ofReal |T.1 w - tau P hP (x0 d)| ∂experiment P n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.risk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:45

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, the specified input T, the specified input P, class risk is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
T :
Decision d n m
P :
{P : PrimitiveLaw d // PrimitiveClass alpha beta gamma L eps P}
classRisk d alpha beta gamma L eps n m T P :
ℝ≥0∞
risk T P.1 P.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.classRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:49

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, minimax risk is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
minimaxRisk d alpha beta gamma L eps n m :
ℝ≥0∞
minimaxValueENNReal (classRisk d alpha beta gamma L eps n m)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.minimaxRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:53

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, oracle risk is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
oracleRisk d alpha beta gamma L eps n m :
ℝ≥0∞
minimaxValueENNReal (fun (T : OracleDecision d n m) (P : {P : PrimitiveLaw d // PrimitiveClass alpha beta gamma L eps P}) => ∫⁻ w, ofReal |T.1 w (designatedPropensity P.1 P.2) - tau P.1 P.2 (x0 d)| ∂experiment P.1 n m)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Experiment.lean:57
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.AnnotationImprovement 5 declarations The supervised-normalized frontier is a maximum of a vanishing oracle power and a negative power of the total-to-labeled count ratio.

Strict annotation improvement

The supervised-normalized frontier is a maximum of a vanishing oracle power and a negative power of the total-to-labeled count ratio.

theorem annotation_negative_power_zero_iff Lemma annotation_negative_power_zero_iff in the paper ↗

A negative power of an eventually positive sequence vanishes exactly when it diverges. Given the specified input f, the specified input a, the specified input ha, the specified input hf, the annotation negative power zero iff conclusion holds.

Formal statement
f :
ℕ → ℝ
a :
ℝ
ha :
0 < a
hf :
∀ᶠ n in atTop, 0 < f n
Tendsto (fun n => (f n)^(-a)) atTop (nhds 0) ↔ Tendsto f atTop atTop
Proof (Lean source)
lemma annotation_negative_power_zero_iff (f : ℕ → ℝ) (a : ℝ) (ha : 0 < a) (hf : ∀ᶠ n in atTop, 0 < f n) : Tendsto (fun n => (f n)^(-a)) atTop (nhds 0) ↔ Tendsto f atTop atTop := by constructor · intro h apply tendsto_atTop.2 intro b let x : ℝ := max 1 b have hx : 0 < x := lt_of_lt_of_le zero_lt_one (le_max_left _ _) have he : 0 < x^(-a) := Real.rpow_pos_of_pos hx _ filter_upwards [hf, h.eventually (gt_mem_nhds he)] with n hn hsmall have hi : (x^(-a))^(-(1/a)) = x := by rw [← Real.rpow_mul hx.le] have hid : (-a)*(-(1/a)) = 1 := by field_simp rw [hid, Real.rpow_one] have hb := (decreasing_power_threshold (f n) (x^(-a)) 1 a hn he zero_lt_one ha).mp (by simpa using hsmall.le) rw [hi] at hb exact (le_max_right 1 b).trans hb · intro h exact (tendsto_rpow_neg_atTop ha).comp h
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_negative_power_zero_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationImprovement.lean:18
theorem annotation_supervised_ratio_formula Lemma annotation_supervised_ratio_formula in the paper ↗

In the rough regime the normalized frontier is exactly the two powers in the roadmap. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hs, the specified input n, the specified input m, the specified input hn, the annotation supervised ratio formula conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hs :
alpha + beta < sCrit d gamma
n m :
ℕ
hn :
2 ≤ n
sharpRate d alpha beta gamma n m / sharpRate d alpha beta gamma n 0
= max ((n:ℝ)^(-(gamma/(2*gamma+d)-2*gamma/bigDelta d alpha beta gamma))) ((((n:ℝ)+m)/(n:ℝ))^(-(gamma/bigDelta d alpha beta gamma)))
Proof (Lean source)
lemma annotation_supervised_ratio_formula (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hs : alpha + beta < sCrit d gamma) (n m : ℕ) (hn : 2 ≤ n) : sharpRate d alpha beta gamma n m / sharpRate d alpha beta gamma n 0 = max ((n:ℝ)^(-(gamma/(2*gamma+d)-2*gamma/bigDelta d alpha beta gamma))) ((((n:ℝ)+m)/(n:ℝ))^(-(gamma/bigDelta d alpha beta gamma))) := by have hp : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have hN : 0 < (n:ℝ)+(m:ℝ) := by positivity rw [(supervised_rate_branches d alpha beta gamma L eps hdom n hn).1 hs] change max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) / _ = _ rw [← max_div_div_right (Real.rpow_pos_of_pos hp _).le] congr 1 · unfold oracleRate rw [← Real.rpow_sub hp] congr 1 ring · rw [Real.mul_rpow hp.le hN.le, Real.div_rpow hN.le hp.le] have hid : -(2*gamma/bigDelta d alpha beta gamma) = -(gamma/bigDelta d alpha beta gamma) + -(gamma/bigDelta d alpha beta gamma) := by ring rw [hid, Real.rpow_add hp] field_simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_supervised_ratio_formula · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationImprovement.lean:41
theorem annotation_improvement_exponent_pos Lemma annotation_improvement_exponent_pos in the paper ↗

The oracle-to-supervised decay exponent is positive precisely in the rough regime. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hs, the annotation improvement exponent pos conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hs :
alpha + beta < sCrit d gamma
0 < gamma/(2*gamma+d)-2*gamma/bigDelta d alpha beta gamma
Proof (Lean source)
lemma annotation_improvement_exponent_pos (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hs : alpha + beta < sCrit d gamma) : 0 < gamma/(2*gamma+d)-2*gamma/bigDelta d alpha beta gamma := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity have hq := qStar_gt_one d alpha beta gamma L eps hdom hs rw [(rate_exponent_identities d alpha beta gamma L eps hdom).2] have hD : 0 < (2*gamma+(d:ℝ))*(1+qStar d alpha beta gamma) := by positivity apply sub_pos.mpr apply (div_lt_div_iff₀ hD hA).mpr have hh : 2*(2*gamma+(d:ℝ)) < (2*gamma+(d:ℝ))*(1+qStar d alpha beta gamma) := by nlinarith convert mul_lt_mul_of_pos_left hh hg using 1 <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_improvement_exponent_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationImprovement.lean:65
theorem annotation_total_ratio_atTop_iff Lemma annotation_total_ratio_atTop_iff in the paper ↗

The total-to-labeled ratio diverges exactly when the auxiliary-to-labeled ratio does. Given the specified input mseq, the annotation total ratio at top iff conclusion holds.

Formal statement
mseq :
ℕ → ℕ
Tendsto (fun n : ℕ => ((n:ℝ)+mseq n)/(n:ℝ)) atTop atTop
↔ Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop
Proof (Lean source)
lemma annotation_total_ratio_atTop_iff (mseq : ℕ → ℕ) : Tendsto (fun n : ℕ => ((n:ℝ)+mseq n)/(n:ℝ)) atTop atTop ↔ Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop := by have hid : ∀ᶠ n : ℕ in atTop, ((n:ℝ)+mseq n)/(n:ℝ) = 1+(mseq n:ℝ)/(n:ℝ) := by filter_upwards [eventually_ge_atTop (2 : ℕ)] with n hn have hp : (n:ℝ) ≠ 0 := by exact_mod_cast (show n ≠ 0 by omega) rw [add_div, div_self hp] constructor · intro h apply tendsto_atTop.2 intro b filter_upwards [hid, (tendsto_atTop.1 h) (b+1)] with n hn hb rw [hn] at hb linarith · intro h apply tendsto_atTop.2 intro b filter_upwards [hid, (tendsto_atTop.1 h) (b-1)] with n hn hb rw [hn] linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_total_ratio_atTop_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationImprovement.lean:80
theorem annotation_rate_improvement_iff Lemma annotation_rate_improvement_iff in the paper ↗

Strict numerical improvement requires rough smoothness and a divergent auxiliary ratio. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input mseq, the annotation rate improvement iff conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
mseq :
ℕ → ℕ
Tendsto (fun n : ℕ => sharpRate d alpha beta gamma n (mseq n) / sharpRate d alpha beta gamma n 0) atTop (nhds 0)
↔ alpha + beta < sCrit d gamma ∧
Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop
Proof (Lean source)
lemma annotation_rate_improvement_iff (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (mseq : ℕ → ℕ) : Tendsto (fun n : ℕ => sharpRate d alpha beta gamma n (mseq n) / sharpRate d alpha beta gamma n 0) atTop (nhds 0) ↔ alpha + beta < sCrit d gamma ∧ Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha + beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by unfold bigDelta; positivity have ha : 0 < gamma/bigDelta d alpha beta gamma := div_pos hg hD have hpos : ∀ᶠ n : ℕ in atTop, 0 < ((n:ℝ)+mseq n)/(n:ℝ) := by filter_upwards [eventually_ge_atTop (2 : ℕ)] with n hn have hp : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) positivity by_cases hs : alpha + beta < sCrit d gamma · rw [and_iff_right hs, ← annotation_total_ratio_atTop_iff, ← annotation_negative_power_zero_iff _ _ ha hpos] have hform : (fun n : ℕ => sharpRate d alpha beta gamma n (mseq n) / sharpRate d alpha beta gamma n 0) =ᶠ[atTop] (fun n : ℕ => max ((n:ℝ)^(-(gamma/(2*gamma+d)-2*gamma/bigDelta d alpha beta gamma))) ((((n:ℝ)+mseq n)/(n:ℝ))^(-(gamma/bigDelta d alpha beta gamma)))) := by filter_upwards [eventually_ge_atTop (2 : ℕ)] with n hn exact annotation_supervised_ratio_formula d alpha beta gamma L eps hdom hs n (mseq n) hn rw [tendsto_congr' hform] constructor · intro h apply squeeze_zero (fun n => Real.rpow_nonneg (by positivity) _) (fun n => le_max_right _ _) h · intro h have horacle := (tendsto_rpow_neg_atTop (annotation_improvement_exponent_pos d alpha beta gamma L eps hdom hs)).comp (tendsto_natCast_atTop_atTop : Tendsto (fun n : ℕ => (n:ℝ)) atTop atTop) simpa using horacle.max h · have heq : (fun n : ℕ => sharpRate d alpha beta gamma n (mseq n) / sharpRate d alpha beta gamma n 0) =ᶠ[atTop] (fun _ => (1:ℝ)) := by filter_upwards [eventually_ge_atTop (2 : ℕ)] with n hn rw [(rate_branches d alpha beta gamma L eps hdom n (mseq n) hn).1 (le_of_not_gt hs), (rate_branches d alpha beta gamma L eps hdom n 0 hn).1 (le_of_not_gt hs)] have hp : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) exact div_self (Real.rpow_pos_of_pos hp _).ne' constructor · intro h have h1 : Tendsto (fun n : ℕ => sharpRate d alpha beta gamma n (mseq n) / sharpRate d alpha beta gamma n 0) atTop (nhds 1) := tendsto_const_nhds.congr' heq.symm have hh := tendsto_nhds_unique h h1 norm_num at hh · intro h exact (hs h.1).elim
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_rate_improvement_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationImprovement.lean:103
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.AnnotationLiminf 3 declarations The exact annotation threshold converts eventual oracle-order attainment into an eventual positive lower bound on the normalized total sample count.

Oracle attainment and positive liminf

The exact annotation threshold converts eventual oracle-order attainment into an eventual positive lower bound on the normalized total sample count.

A positive extended-real liminf is equivalent to an eventual positive real lower bound. Given the specified input f, the of real liminf pos iff conclusion holds.

Formal statement
f :
ℕ → ℝ
0 < liminf (fun n => ofReal (f n)) atTop ↔ ∃ c : ℝ, 0 < c ∧ ∀ᶠ n in atTop, c ≤ f n
Proof (Lean source)
lemma ofReal_liminf_pos_iff (f : ℕ → ℝ) : 0 < liminf (fun n => ofReal (f n)) atTop ↔ ∃ c : ℝ, 0 < c ∧ ∀ᶠ n in atTop, c ≤ f n := by constructor · intro h obtain ⟨c, hc, hcl⟩ := ENNReal.lt_iff_exists_add_pos_lt.mp h have hcR : 0 < (c : ℝ) := by exact_mod_cast hc have hcl' : ofReal (c : ℝ) < liminf (fun n => ofReal (f n)) atTop := by simpa using hcl refine ⟨c, hcR, ?_⟩ filter_upwards [eventually_lt_of_lt_liminf hcl'] with n hn exact (ENNReal.ofReal_lt_ofReal_iff_of_nonneg hcR.le).mp hn |>.le · rintro ⟨c, hc, h⟩ exact (ENNReal.ofReal_pos.mpr hc).trans_le (le_liminf_of_le (h := h.mono fun n hn => ENNReal.ofReal_le_ofReal hn))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ofReal_liminf_pos_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationLiminf.lean:18
theorem annotationRegion_count_iff Lemma annotationRegion_count_iff in the paper ↗

The annotation region is exactly a lower threshold on the normalized total count. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input m, the specified input hn, the specified input zeta, the specified input hz, the annotation region count iff conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n m :
ℕ
hn :
2 ≤ n
zeta :
ℝ
hz :
1 ≤ zeta
(n,m) ∈ annotationRegion d alpha beta gamma zeta
↔ zeta^(-(bigDelta d alpha beta gamma/gamma)) ≤ ((n:ℝ)+m)/(n:ℝ)^qStar d alpha beta gamma
Proof (Lean source)
lemma annotationRegion_count_iff (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n m : ℕ) (hn : 2 ≤ n) (zeta : ℝ) (hz : 1 ≤ zeta) : (n,m) ∈ annotationRegion d alpha beta gamma zeta ↔ zeta^(-(bigDelta d alpha beta gamma/gamma)) ≤ ((n:ℝ)+m)/(n:ℝ)^qStar d alpha beta gamma := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity have hD : 0 < bigDelta d alpha beta gamma := by unfold bigDelta; positivity have hnp : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have hN : 0 < (n:ℝ)+(m:ℝ) := by positivity have hzp : 0 < zeta := zero_lt_one.trans_le hz have ho : 0 < oracleRate d gamma n := Real.rpow_pos_of_pos hnp _ have hboundary : (oracleRate d gamma n)^(-(bigDelta d alpha beta gamma/gamma)) = (n:ℝ)*(n:ℝ)^qStar d alpha beta gamma := by unfold oracleRate rw [← Real.rpow_mul hnp.le] have he : -(gamma/(2*gamma+(d:ℝ)))*(-(bigDelta d alpha beta gamma/gamma)) = 1+qStar d alpha beta gamma := by rw [(rate_exponent_identities d alpha beta gamma L eps hdom).2] field_simp rw [he, Real.rpow_add hnp, Real.rpow_one] change (2 ≤ n ∧ max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) ≤ zeta*oracleRate d gamma n) ↔ _ rw [and_iff_right hn, max_le_iff, and_iff_right (le_mul_of_one_le_left ho.le hz)] rw [decreasing_power_threshold _ _ _ _ (mul_pos hnp hN) (mul_pos hzp ho) hD hg, Real.mul_rpow hzp.le ho.le, hboundary, le_div_iff₀ (Real.rpow_pos_of_pos hnp _)] constructor <;> intro h · nlinarith · nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotationRegion_count_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationLiminf.lean:35
theorem annotationRegion_liminf_iff Lemma annotationRegion_liminf_iff in the paper ↗

Some finite oracle tolerance is equivalent to a positive normalized-count liminf. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input mseq, the annotation region liminf iff conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
mseq :
ℕ → ℕ
(∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta)
↔ 0 < liminf (fun n : ℕ => ofReal (((n:ℝ)+mseq n)/(n:ℝ)^qStar d alpha beta gamma)) atTop
Proof (Lean source)
lemma annotationRegion_liminf_iff (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (mseq : ℕ → ℕ) : (∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta) ↔ 0 < liminf (fun n : ℕ => ofReal (((n:ℝ)+mseq n)/(n:ℝ)^qStar d alpha beta gamma)) atTop := by rw [ofReal_liminf_pos_iff] have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by unfold bigDelta; positivity constructor · rintro ⟨zeta, hz, hevent⟩ refine ⟨zeta^(-(bigDelta d alpha beta gamma/gamma)), Real.rpow_pos_of_pos (zero_lt_one.trans_le hz) _, ?_⟩ filter_upwards [hevent] with n hn exact (annotationRegion_count_iff d alpha beta gamma L eps hdom n (mseq n) hn.1 zeta hz).mp hn · rintro ⟨c, hc, hevent⟩ let zeta : ℝ := max 1 (c^(-(gamma/bigDelta d alpha beta gamma))) have hz : 1 ≤ zeta := le_max_left _ _ have hzc : zeta^(-(bigDelta d alpha beta gamma/gamma)) ≤ c := (decreasing_power_threshold zeta c gamma (bigDelta d alpha beta gamma) (zero_lt_one.trans_le hz) hc hg hD).mpr (le_max_right _ _) refine ⟨zeta, hz, ?_⟩ filter_upwards [hevent, eventually_ge_atTop (2 : ℕ)] with n hn hn2 exact (annotationRegion_count_iff d alpha beta gamma L eps hdom n (mseq n) hn2 zeta hz).mpr (hzc.trans hn)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotationRegion_liminf_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/AnnotationLiminf.lean:69
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.CitedGates 3 declarations Two-channel point-CATE annotation frontier: Helpers/CitedGates constructions and obligations.

Helpers/CitedGates

Two-channel point-CATE annotation frontier: Helpers/CitedGates constructions and obligations.

theorem PublishedFuzzyTesting

Kennedy, Balakrishnan, Robins and Wasserman (2024), Section 3, Lemma 1, absolute-loss specialization; citation handle cite:kennedybalakrishnanrobinswasserman2024-lemma1. Source: https://arxiv.org/html/2203.00837v4#Thmlemma1. This follows from the sharp absolute fuzzy-testing bound, applied to the two kernel ranges inside the ambient model. the published fuzzy testing conclusion holds.

Formal statement
Ω :
Type
shared
Z :
Type
shared
ω :
shared
B :
Kernel Z Ω
shared
C :
Kernel Z Ω
shared
v0 :
ℕ
shared
Model :
shared
Ψ :
Measure Ω → ℝ
shared
s0 :
ℝ
shared
u0 :
ℝ
shared
est :
(Fin v0 → Ω) → ℝ
shared
v0 :
ℕ
1 ≤ v0
Model :
(∀ z, B z ∈ Model)
(∀ z, C z ∈ Model)
Ψ :
Measure Ω → ℝ
s0 u0 :
ℝ
0 < s0
0 ≤ u0
u0 < 2
(∀ z z', s0 ≤ Ψ (B z) - Ψ (C z'))
hellingerSq (ω.bind (fun z => Measure.pi (fun _ : Fin v0 => B z))) (ω.bind (fun z => Measure.pi (fun _ : Fin v0 => C z)))
≤ u0
est :
(Fin v0 → Ω) → ℝ
ofReal ((s0/4)*(1-sqrt (u0*(1-u0/4))))
≤ ⨆ (P : Measure Ω) (_ : P ∈ Model), ∫⁻ w, ofReal |est w
- Ψ P| ∂Measure.pi (fun _ : Fin v0 => P)
Proof (Lean source)
lemma PublishedFuzzyTesting : ∀ (Ω Z : Type) [MeasurableSpace Ω] [MeasurableSpace Z] (ω : Measure Z) [IsProbabilityMeasure ω] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C] (v0 : ℕ), 1 ≤ v0 → ∀ (Model : Set (Measure Ω)), (∀ z, B z ∈ Model) → (∀ z, C z ∈ Model) → ∀ (Ψ : Measure Ω → ℝ) (s0 u0 : ℝ), 0 < s0 → 0 ≤ u0 → u0 < 2 → (∀ z z', s0 ≤ Ψ (B z) - Ψ (C z')) → hellingerSq (ω.bind (fun z => Measure.pi (fun _ : Fin v0 => B z))) (ω.bind (fun z => Measure.pi (fun _ : Fin v0 => C z))) ≤ u0 → ∀ (est : (Fin v0 → Ω) → ℝ), Measurable est → ofReal ((s0/4)*(1-sqrt (u0*(1-u0/4)))) ≤ ⨆ (P : Measure Ω) (_ : P ∈ Model), ∫⁻ w, ofReal |est w - Ψ P| ∂Measure.pi (fun _ : Fin v0 => P) := by intro Ω Z _ _ ω _ B C _ _ v0 _ Model hB hC Ψ s0 u0 hs hu hu2 hsep hhell est hest let M : Set (Measure Ω) := Set.range B ∪ Set.range C have hM : ∀ P ∈ M, IsProbabilityMeasure P := by intro P hP rcases hP with ⟨z, rfl⟩ | ⟨z, rfl⟩ <;> infer_instance have htest := absolute_fuzzy_testing_lower_bound_iid v0 ω B C M Ψ (fun z => Set.mem_union_left _ ⟨z, rfl⟩) (fun z => Set.mem_union_right _ ⟨z, rfl⟩) hs hu hu2 hsep hhell hest apply htest.trans apply iSup_le intro P have hP : P.1 ∈ Model := by rcases P.2 with ⟨z, hz⟩ | ⟨z, hz⟩ · rw [← hz] exact hB z · rw [← hz] exact hC z exact le_iSup_of_le P.1 (le_iSup_of_le hP le_rfl)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PublishedFuzzyTesting · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/CitedGates.lean:25
def kbrwBenchmarkRate

The numerical rate and smoothness split displayed in the published point-CATE benchmark. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input n, kbrw benchmark rate is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
n :
ℕ
kbrwBenchmarkRate d alpha beta gamma n :
ℝ
if (alpha+beta)/2 < ((d:ℝ)/4)/(1+(d:ℝ)/(2*gamma)) then (n:ℝ)^(-(1/(1+(d:ℝ)/(2*gamma)+(d:ℝ)/(4*((alpha+beta)/2))))) else (n:ℝ)^(-(1/(2+(d:ℝ)/gamma)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.kbrwBenchmarkRate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/CitedGates.lean:64
def PublishedCateBenchmark

Kennedy, Balakrishnan, Robins and Wasserman (2024), Section 3, Theorem 1: only the numerical exponents and smoothness cutoff at nuisance-average smoothness. Citation handle cite:kennedybalakrishnanrobinswasserman2024-theorem1; source https://arxiv.org/html/2203.00837v4#Thmtheorem1. This disclosed logical input asserts no source-model risk guarantee or minimax transfer. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, published cate benchmark is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma :
ℝ
PublishedCateBenchmark d alpha beta gamma :
Sort 0
1
≤ d → 0 < alpha → 0 < beta → 1 ≤ gamma → (1/(1+(d:ℝ)/(2*gamma)+(d:ℝ)/(4*((alpha+beta)/2))) = 2*gamma/(2*gamma+(d:ℝ)+gamma*(d:ℝ)/(alpha+beta))) ∧
(1/(2+(d:ℝ)/gamma) = gamma/(2*gamma+(d:ℝ))) ∧
((alpha+beta)/2 < ((d:ℝ)/4)/(1+(d:ℝ)/(2*gamma)) ↔ alpha+beta < gamma*(d:ℝ)/(2*gamma+(d:ℝ))) ∧
(∀ n : ℕ, 2 ≤ n → kbrwBenchmarkRate d alpha beta gamma n = max ((n:ℝ)^(-(gamma/(2*gamma+(d:ℝ))))) ((n:ℝ)^(-(2*gamma/(2*gamma+(d:ℝ)+gamma*(d:ℝ)/(alpha+beta))))))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PublishedCateBenchmark · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/CitedGates.lean:70
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.Hellinger 16 declarations Two-channel point-CATE annotation frontier: Helpers/Hellinger constructions and obligations.

Helpers/Hellinger

Two-channel point-CATE annotation frontier: Helpers/Hellinger constructions and obligations.

Given the specified input B, the specified input C, hellinger sq is the corresponding construction.

Definition (Lean source)
Ω :
B C :
hellingerSq B C :
ℝ
hellingerSqDensity (B+C) (fun w => (B.rnDeriv (B+C) w).toReal) (fun w => (C.rnDeriv (B+C) w).toReal)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:28
def HasConditionalDensities

A common s-finite reference kernel with jointly measurable conditional densities. Given the specified input Z, the specified input B, the specified input C, has conditional densities is the corresponding construction.

Definition (Lean source)
B C :
Kernel Z Ω
HasConditionalDensities B C :
Prop
∃ ξ : Kernel Z Ω,
clause 1
∃ f g : Z × Ω → ℝ≥0∞,
z :
B z = (ξ z).withDensity (fun w => f (z,w))
z :
C z = (ξ z).withDensity (fun w => g (z,w))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.HasConditionalDensities · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:32
theorem sqrt_difference_square_mul Lemma sqrt_difference_square_mul in the paper ↗

Square-root differences are homogeneous of degree one in their densities. Given the specified input a, the specified input b, the specified input c, the specified input ha, the specified input hb, the specified input hc, the sqrt difference square mul conclusion holds.

Formal statement
a b c :
ℝ
ha :
0 ≤ a
hb :
0 ≤ b
hc :
0 ≤ c
c * (sqrt a - sqrt b)^2 = (sqrt (a*c) - sqrt (b*c))^2
Proof (Lean source)
lemma sqrt_difference_square_mul (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) : c * (sqrt a - sqrt b)^2 = (sqrt (a*c) - sqrt (b*c))^2 := by rw [Real.sqrt_mul ha, Real.sqrt_mul hb] nlinarith [Real.sq_sqrt hc]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sqrt_difference_square_mul · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:39

The sum-of-laws definition agrees with any finite dominating reference measure. Given the specified input B, the specified input C, the specified input hB, the specified input hC, the hellinger sq eq density conclusion holds.

Formal statement
Ω :
hB :
B ≪ ξ
hC :
C ≪ ξ
= hellingerSqDensity ξ (fun x => (B.rnDeriv ξ x).toReal) (fun x => (C.rnDeriv ξ x).toReal)
Proof (Lean source)
lemma hellingerSq_eq_density {Ω : Type*} [MeasurableSpace Ω] (B C ξ : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure C] [IsFiniteMeasure ξ] (hB : B ≪ ξ) (hC : C ≪ ξ) : hellingerSq B C = hellingerSqDensity ξ (fun x => (B.rnDeriv ξ x).toReal) (fun x => (C.rnDeriv ξ x).toReal) := by have hsum : B+C ≪ ξ := hB.add_left hC have hBsum : B ≪ B+C := Measure.AbsolutelyContinuous.rfl.add_right C have hCsum : C ≪ B+C := Measure.AbsolutelyContinuous.rfl.add_right' B have hb := Measure.rnDeriv_mul_rnDeriv (κ := ξ) hBsum have hc := Measure.rnDeriv_mul_rnDeriv (κ := ξ) hCsum unfold hellingerSq hellingerSqDensity rw [← integral_toReal_rnDeriv_mul hsum] apply integral_congr_ae filter_upwards [hb, hc] with x hxB hxC have hrB : (B.rnDeriv ξ x).toReal = (B.rnDeriv (B+C) x).toReal * ((B+C).rnDeriv ξ x).toReal := by rw [← hxB, Pi.mul_apply, ENNReal.toReal_mul] have hrC : (C.rnDeriv ξ x).toReal = (C.rnDeriv (B+C) x).toReal * ((B+C).rnDeriv ξ x).toReal := by rw [← hxC, Pi.mul_apply, ENNReal.toReal_mul] rw [hrB, hrC] exact sqrt_difference_square_mul _ _ _ ENNReal.toReal_nonneg ENNReal.toReal_nonneg ENNReal.toReal_nonneg
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_eq_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:47

Products of integrable nonnegative densities represent products of their laws. Given the specified input E, the specified input B, the specified input f, the specified input hf, the specified input hf0, the specified input hB, the pi real density conclusion holds.

Formal statement
ι :
Type*
ι → Type*
∀ i, MeasurableSpace (E i)
μ B :
∀ i, Measure (E i)
∀ i, IsFiniteMeasure (μ i)
f :
∀ i
if
E i
then
ℝ
hf :
∀ i, Integrable (f i) (μ i)
hf0 :
∀ i x, 0 ≤ f i x
hB :
∀ i, B i = (μ i).withDensity (fun x => ofReal (f i x))
Measure.pi B = (Measure.pi μ).withDensity (fun x => ofReal (∏ i, f i (x i)))
Proof (Lean source)
lemma pi_real_density {ι : Type*} [Fintype ι] {E : ι → Type*} [∀ i, MeasurableSpace (E i)] (μ B : ∀ i, Measure (E i)) [∀ i, IsFiniteMeasure (μ i)] [∀ i, IsProbabilityMeasure (B i)] (f : ∀ i, E i → ℝ) (hf : ∀ i, Integrable (f i) (μ i)) (hf0 : ∀ i x, 0 ≤ f i x) (hB : ∀ i, B i = (μ i).withDensity (fun x => ofReal (f i x))) : Measure.pi B = (Measure.pi μ).withDensity (fun x => ofReal (∏ i, f i (x i))) := by classical apply Measure.pi_eq intro s hs rw [withDensity_apply _ (MeasurableSet.univ_pi hs)] rw [← ofReal_integral_eq_lintegral_ofReal (show Integrable (fun x => ∏ i, f i (x i)) ((Measure.pi μ).restrict (pi univ s)) from by rw [Measure.restrict_pi_pi] exact Integrable.fintype_prod_dep (fun i => (hf i).integrableOn)) (Filter.Eventually.of_forall (fun x => Finset.prod_nonneg (fun i _ => hf0 i (x i))))] rw [Measure.restrict_pi_pi, integral_fintype_prod_eq_prod] rw [ENNReal.ofReal_prod_of_nonneg (fun i _ => integral_nonneg (hf0 i))] apply Finset.prod_congr rfl intro i _ rw [hB i, withDensity_apply _ (hs i)] exact ofReal_integral_eq_lintegral_ofReal (hf i).integrableOn (Filter.Eventually.of_forall (hf0 i))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.pi_real_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:72

A finite absolutely continuous law has its real Radon--Nikodym density. Given the specified input B, the specified input hB, the real rn deriv density conclusion holds.

Formal statement
Ω :
hB :
B ≪ μ
B = μ.withDensity (fun x => ofReal (B.rnDeriv μ x).toReal)
Proof (Lean source)
lemma real_rnDeriv_density {Ω : Type*} [MeasurableSpace Ω] (B μ : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure μ] (hB : B ≪ μ) : B = μ.withDensity (fun x => ofReal (B.rnDeriv μ x).toReal) := by conv_lhs => rw [← Measure.withDensity_rnDeriv_eq B μ hB] apply withDensity_congr_ae filter_upwards [Measure.rnDeriv_lt_top B μ] with x hx exact (ENNReal.ofReal_toReal hx.ne).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.real_rnDeriv_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:97
theorem hellingerSq_real_density Lemma hellingerSq_real_density in the paper ↗

Explicit densities can be used in the sum-of-laws Hellinger definition. Given the specified input B, the specified input C, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hf0, the specified input hg0, the specified input hB, the specified input hC, the hellinger sq real density conclusion holds.

Formal statement
Ω :
f g :
Ω → ℝ
hf :
hg :
hf0 :
∀ x, 0 ≤ f x
hg0 :
∀ x, 0 ≤ g x
hB :
B = μ.withDensity (fun x => ofReal (f x))
hC :
C = μ.withDensity (fun x => ofReal (g x))
Proof (Lean source)
lemma hellingerSq_real_density {Ω : Type*} [MeasurableSpace Ω] (B C μ : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure C] [IsFiniteMeasure μ] (f g : Ω → ℝ) (hf : Measurable f) (hg : Measurable g) (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ x, 0 ≤ g x) (hB : B = μ.withDensity (fun x => ofReal (f x))) (hC : C = μ.withDensity (fun x => ofReal (g x))) : hellingerSq B C = hellingerSqDensity μ f g := by rw [hellingerSq_eq_density B C μ (hB ▸ withDensity_absolutelyContinuous μ _) (hC ▸ withDensity_absolutelyContinuous μ _)] have hb : B.rnDeriv μ =ᵐ[μ] fun x => ofReal (f x) := by rw [hB]; exact Measure.rnDeriv_withDensity μ (by fun_prop) have hc : C.rnDeriv μ =ᵐ[μ] fun x => ofReal (g x) := by rw [hC]; exact Measure.rnDeriv_withDensity μ (by fun_prop) apply integral_congr_ae filter_upwards [hb, hc] with x hxB hxC simp only [hxB, hxC, ENNReal.toReal_ofReal (hf0 x), ENNReal.toReal_ofReal (hg0 x)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_real_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:106
theorem densityAffinity_mem_unit Lemma densityAffinity_mem_unit in the paper ↗

Affinity of two normalized nonnegative densities lies in the unit interval. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hf0, the specified input hg0, the specified input hf1, the specified input hg1, the density affinity mem unit conclusion holds.

Formal statement
Ω :
μ :
f g :
Ω → ℝ
hf :
hg :
hf0 :
∀ x, 0 ≤ f x
hg0 :
∀ x, 0 ≤ g x
hf1 :
∫ x, f x ∂μ = 1
hg1 :
∫ x, g x ∂μ = 1
conclusion 1
0 ≤ densityAffinity μ f g
conclusion 2
densityAffinity μ f g ≤ 1
Proof (Lean source)
lemma densityAffinity_mem_unit {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (f g : Ω → ℝ) (hf : Integrable f μ) (hg : Integrable g μ) (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ x, 0 ≤ g x) (hf1 : ∫ x, f x ∂μ = 1) (hg1 : ∫ x, g x ∂μ = 1) : 0 ≤ densityAffinity μ f g ∧ densityAffinity μ f g ≤ 1 := by refine ⟨integral_nonneg (fun x => Real.sqrt_nonneg _), ?_⟩ have hid := Causalean.Stat.hellingerSqDensity_eq_two_mul_one_sub_affinity μ f g hf hg hf0 hg0 hf1 hg1 have hn : 0 ≤ hellingerSqDensity μ f g := integral_nonneg (fun x => sq_nonneg _) linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.densityAffinity_mem_unit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:125

Squared Hellinger distance subadditivity for finite products of probability laws. Given the specified input E, the specified input B, the specified input C, the hellinger sq pi le sum conclusion holds.

Formal statement
ι :
Type*
ι → Type*
∀ i, MeasurableSpace (E i)
B C :
∀ i, Measure (E i)
hellingerSq (Measure.pi B) (Measure.pi C) ≤ ∑ i, hellingerSq (B i) (C i)
Proof (Lean source)
lemma hellingerSq_pi_le_sum {ι : Type*} [Fintype ι] {E : ι → Type*} [∀ i, MeasurableSpace (E i)] (B C : ∀ i, Measure (E i)) [∀ i, IsProbabilityMeasure (B i)] [∀ i, IsProbabilityMeasure (C i)] : hellingerSq (Measure.pi B) (Measure.pi C) ≤ ∑ i, hellingerSq (B i) (C i) := by classical let μ := fun i => B i + C i let f := fun i x => (B i |>.rnDeriv (μ i) x).toReal let g := fun i x => (C i |>.rnDeriv (μ i) x).toReal have hBa (i : ι) : B i ≪ μ i := Measure.AbsolutelyContinuous.rfl.add_right _ have hCa (i : ι) : C i ≪ μ i := Measure.AbsolutelyContinuous.rfl.add_right' _ have hf (i : ι) : Integrable (f i) (μ i) := by fun_prop have hg (i : ι) : Integrable (g i) (μ i) := by fun_prop have hfm (i : ι) : Measurable (f i) := by fun_prop have hgm (i : ι) : Measurable (g i) := by fun_prop have hf0 (i : ι) (x : E i) : 0 ≤ f i x := ENNReal.toReal_nonneg have hg0 (i : ι) (x : E i) : 0 ≤ g i x := ENNReal.toReal_nonneg have hf1 (i : ι) : ∫ x, f i x ∂μ i = 1 := by dsimp [f]; rw [Measure.integral_toReal_rnDeriv (hBa i)]; simp have hg1 (i : ι) : ∫ x, g i x ∂μ i = 1 := by dsimp [g]; rw [Measure.integral_toReal_rnDeriv (hCa i)]; simp have hBd (i : ι) : B i = (μ i).withDensity (fun x => ofReal (f i x)) := real_rnDeriv_density _ _ (hBa i) have hCd (i : ι) : C i = (μ i).withDensity (fun x => ofReal (g i x)) := real_rnDeriv_density _ _ (hCa i) have hid (i : ι) : hellingerSq (B i) (C i) = 2 * (1 - densityAffinity (μ i) (f i) (g i)) := by rw [hellingerSq_real_density _ _ _ _ _ (hfm i) (hgm i) (hf0 i) (hg0 i) (hBd i) (hCd i)] exact hellingerSqDensity_eq_two_mul_one_sub_affinity _ _ _ (hf i) (hg i) (hf0 i) (hg0 i) (hf1 i) (hg1 i) rw [hellingerSq_real_density _ _ (Measure.pi μ) (fun x => ∏ i, f i (x i)) (fun x => ∏ i, g i (x i)) (by fun_prop) (by fun_prop) (fun x => Finset.prod_nonneg (fun i _ => hf0 i (x i))) (fun x => Finset.prod_nonneg (fun i _ => hg0 i (x i))) (pi_real_density μ B f hf hf0 hBd) (pi_real_density μ C g hg hg0 hCd)] rw [hellingerSqDensity_eq_two_mul_one_sub_affinity _ _ _ (Integrable.fintype_prod_dep hf) (Integrable.fintype_prod_dep hg) (fun x => Finset.prod_nonneg (fun i _ => hf0 i (x i))) (fun x => Finset.prod_nonneg (fun i _ => hg0 i (x i))) (by rw [integral_fintype_prod_eq_prod]; simp [hf1]) (by rw [integral_fintype_prod_eq_prod]; simp [hg1])] rw [densityAffinity_pi μ f g hf0 hg0] simp_rw [hid] rw [← Finset.mul_sum] apply mul_le_mul_of_nonneg_left _ (by norm_num : (0:ℝ) ≤ 2) exact one_sub_prod_le_sum _ (fun i => (densityAffinity_mem_unit _ _ _ (hf i) (hg i) (hf0 i) (hg0 i) (hf1 i) (hg1 i)).1) (fun i => (densityAffinity_mem_unit _ _ _ (hf i) (hg i) (hf0 i) (hg0 i) (hf1 i) (hg1 i)).2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_pi_le_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:139

Normalizing two measurable densities against their sum gives a bounded density. Given the specified input a, the specified input b, the density ratio le one conclusion holds.

Formal statement
a b :
ℝ≥0∞
a / (a+b) ≤ 1
Proof (Lean source)
lemma density_ratio_le_one (a b : ℝ≥0∞) : a / (a+b) ≤ 1 := (ENNReal.div_le_div_right (le_add_right le_rfl) _).trans ENNReal.div_self_le_one
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.density_ratio_le_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:189
theorem withDensity_density_ratio Lemma withDensity_density_ratio in the paper ↗

A law's density against the sum of two laws is the normalized original density. Given the specified input B, the specified input C, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hB, the specified input hC, the with density density ratio conclusion holds.

Formal statement
Ω :
f g :
Ω → ℝ≥0∞
hf :
hg :
hB :
B = ξ.withDensity f
hC :
C = ξ.withDensity g
(B+C).withDensity (fun x => f x / (f x+g x)) = B
Proof (Lean source)
lemma withDensity_density_ratio {Ω : Type*} [MeasurableSpace Ω] (B C ξ : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure C] (f g : Ω → ℝ≥0∞) (hf : Measurable f) (hg : Measurable g) (hB : B = ξ.withDensity f) (hC : C = ξ.withDensity g) : (B+C).withDensity (fun x => f x / (f x+g x)) = B := by have hsum : B+C = ξ.withDensity (fun x => f x+g x) := by rw [hB, hC, ← withDensity_add_left hf] rfl have hfin : ∫⁻ x, f x+g x ∂ξ ≠ ⊤ := by have ht : (B+C) univ ≠ ⊤ := measure_ne_top _ _ rwa [hsum, withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] at ht rw [hsum, ← withDensity_mul ξ (f := fun x => f x+g x) (g := fun x => f x/(f x+g x)) (by fun_prop) (by fun_prop), hB] apply withDensity_congr_ae filter_upwards [ae_lt_top (hf.add hg) hfin] with x hx exact ENNReal.mul_div_cancel' (fun hzero => by have h : f x ≤ f x+g x := le_add_right le_rfl change f x+g x = 0 at hzero rw [hzero] at h exact le_antisymm h bot_le) (fun htop => False.elim (hx.ne htop))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.withDensity_density_ratio · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:193
theorem integrable_sqrt_difference_bounded Lemma integrable_sqrt_difference_bounded in the paper ↗

Measurable densities bounded by one have integrable squared square-root differences. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hf0, the specified input hg0, the specified input hf1, the specified input hg1, the integrable sqrt difference bounded conclusion holds.

Formal statement
Ω :
f g :
Ω → ℝ
hf :
hg :
hf0 :
∀ x, 0 ≤ f x
hg0 :
∀ x, 0 ≤ g x
hf1 :
∀ x, f x ≤ 1
hg1 :
∀ x, g x ≤ 1
Integrable (fun x => (sqrt (f x) - sqrt (g x))^2) μ
Proof (Lean source)
lemma integrable_sqrt_difference_bounded {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ] (f g : Ω → ℝ) (hf : Measurable f) (hg : Measurable g) (hf0 : ∀ x, 0 ≤ f x) (hg0 : ∀ x, 0 ≤ g x) (hf1 : ∀ x, f x ≤ 1) (hg1 : ∀ x, g x ≤ 1) : Integrable (fun x => (sqrt (f x) - sqrt (g x))^2) μ := by apply (integrable_const (4:ℝ)).mono' (by fun_prop) apply Filter.Eventually.of_forall intro x rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hsf : sqrt (f x) ≤ 1 := by simpa using Real.sqrt_le_sqrt (hf1 x) have hsg : sqrt (g x) ≤ 1 := by simpa using Real.sqrt_le_sqrt (hg1 x) nlinarith [Real.sqrt_nonneg (f x), Real.sqrt_nonneg (g x)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.integrable_sqrt_difference_bounded · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:216
theorem hellingerSq_compProd_common Lemma hellingerSq_compProd_common in the paper ↗

Joint laws with a common marginal have the average conditional squared Hellinger distance. Given the specified input Z, the specified input B, the specified input C, the specified input hBC, the hellinger sq comp prod common conclusion holds.

Formal statement
hellingerSq (ν ⊗ₘ B) (ν ⊗ₘ C) = ∫ z, hellingerSq (B z) (C z) ∂ν
Proof (Lean source)
lemma hellingerSq_compProd_common {Z Ω : Type*} [MeasurableSpace Z] [MeasurableSpace Ω] (ν : Measure Z) [IsProbabilityMeasure ν] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C] (hBC : HasConditionalDensities B C) : hellingerSq (ν ⊗ₘ B) (ν ⊗ₘ C) = ∫ z, hellingerSq (B z) (C z) ∂ν := by obtain ⟨ξ, hξ, f, g, hf, hg, hB, hC⟩ := hBC let K := B+C let r : Z × Ω → ℝ≥0∞ := fun p => f p / (f p+g p) let s : Z × Ω → ℝ≥0∞ := fun p => g p / (f p+g p) have hr : Measurable r := by fun_prop have hs : Measurable s := by fun_prop have hr1 (p : Z × Ω) : r p ≤ 1 := density_ratio_le_one _ _ have hs1 (p : Z × Ω) : s p ≤ 1 := by simpa only [add_comm] using density_ratio_le_one (g p) (f p) have hrfin (p : Z × Ω) : r p ≠ ⊤ := ne_of_lt (lt_of_le_of_lt (hr1 p) (by simp)) have hsfin (p : Z × Ω) : s p ≠ ⊤ := ne_of_lt (lt_of_le_of_lt (hs1 p) (by simp)) have hBr (z : Z) : B z = (K z).withDensity (fun w => ofReal (r (z,w)).toReal) := by rw [show (fun w => ofReal (r (z,w)).toReal) = (fun w => r (z,w)) from funext (fun w => ENNReal.ofReal_toReal (hrfin (z,w)))] exact (withDensity_density_ratio (B z) (C z) (ξ z) _ _ (hf.comp measurable_prodMk_left) (hg.comp measurable_prodMk_left) (hB z) (hC z)).symm have hCs (z : Z) : C z = (K z).withDensity (fun w => ofReal (s (z,w)).toReal) := by rw [show (fun w => ofReal (s (z,w)).toReal) = (fun w => s (z,w)) from funext (fun w => ENNReal.ofReal_toReal (hsfin (z,w)))] simpa only [K, add_apply, Function.comp_def, add_comm, s] using (withDensity_density_ratio (C z) (B z) (ξ z) _ _ (hg.comp measurable_prodMk_left) (hf.comp measurable_prodMk_left) (hC z) (hB z)).symm have hKr : K.withDensity (fun z w => r (z,w)) = B := by ext z : 1 rw [Kernel.withDensity_apply _ hr] simpa only [ENNReal.ofReal_toReal (hrfin _)] using (hBr z).symm have hKs : K.withDensity (fun z w => s (z,w)) = C := by ext z : 1 rw [Kernel.withDensity_apply _ hs] simpa only [ENNReal.ofReal_toReal (hsfin _)] using (hCs z).symm have : IsFiniteKernel (K.withDensity (fun z w => r (z,w))) := by rw [hKr]; infer_instance have : IsFiniteKernel (K.withDensity (fun z w => s (z,w))) := by rw [hKs]; infer_instance have hjointB : ν ⊗ₘ B = (ν ⊗ₘ K).withDensity (fun p => ofReal (r p).toReal) := by rw [← hKr, Measure.compProd_withDensity hr] congr 1 funext p exact (ENNReal.ofReal_toReal (hrfin p)).symm have hjointC : ν ⊗ₘ C = (ν ⊗ₘ K).withDensity (fun p => ofReal (s p).toReal) := by rw [← hKs, Measure.compProd_withDensity hs] congr 1 funext p exact (ENNReal.ofReal_toReal (hsfin p)).symm have hrr1 (p : Z × Ω) : (r p).toReal ≤ 1 := by exact_mod_cast ENNReal.toReal_mono (by simp : (1:ℝ≥0∞) ≠ ⊤) (hr1 p) have hss1 (p : Z × Ω) : (s p).toReal ≤ 1 := by exact_mod_cast ENNReal.toReal_mono (by simp : (1:ℝ≥0∞) ≠ ⊤) (hs1 p) rw [hellingerSq_real_density _ _ (ν ⊗ₘ K) _ _ (by fun_prop) (by fun_prop) (fun _ => ENNReal.toReal_nonneg) (fun _ => ENNReal.toReal_nonneg) hjointB hjointC] unfold hellingerSqDensity rw [Measure.integral_compProd (integrable_sqrt_difference_bounded (ν ⊗ₘ K) (fun p => (r p).toReal) (fun p => (s p).toReal) (by fun_prop) (by fun_prop) (fun _ => ENNReal.toReal_nonneg) (fun _ => ENNReal.toReal_nonneg) hrr1 hss1)] apply integral_congr_ae apply Filter.Eventually.of_forall intro z exact (hellingerSq_real_density (B z) (C z) (K z) _ _ (by fun_prop) (by fun_prop) (fun _ => ENNReal.toReal_nonneg) (fun _ => ENNReal.toReal_nonneg) (hBr z) (hCs z)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_compProd_common · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:233
theorem hellingerSq_prod_common Lemma hellingerSq_prod_common in the paper ↗

Appending a common finite measure multiplies squared Hellinger distance by its mass. Given the specified input Z, the specified input B, the specified input C, the specified input G, the hellinger sq prod common conclusion holds.

Formal statement
hellingerSq (B.prod G) (C.prod G) = G.real univ * hellingerSq B C
Proof (Lean source)
lemma hellingerSq_prod_common {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] (B C : Measure Ω) (G : Measure Z) [IsFiniteMeasure B] [IsFiniteMeasure C] [IsFiniteMeasure G] : hellingerSq (B.prod G) (C.prod G) = G.real univ * hellingerSq B C := by have hB := rnDeriv_measure_compProd_left B (B+C) (Kernel.const Ω G) have hC := rnDeriv_measure_compProd_left C (B+C) (Kernel.const Ω G) simp only [Measure.compProd_const] at hB hC unfold hellingerSq hellingerSqDensity rw [← Measure.add_prod] calc _ = ∫ p : Ω × Z, (sqrt ((B.rnDeriv (B+C) p.1).toReal) - sqrt ((C.rnDeriv (B+C) p.1).toReal))^2 ∂(B+C).prod G := by apply integral_congr_ae filter_upwards [hB, hC] with p hpB hpC rw [hpB, hpC] _ = _ := integral_fun_fst (fun x => (sqrt ((B.rnDeriv (B+C) x).toReal) - sqrt ((C.rnDeriv (B+C) x).toReal))^2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_prod_common · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:299
theorem hellingerSq_prod_probability Lemma hellingerSq_prod_probability in the paper ↗

A common independent probability factor preserves squared Hellinger distance. Given the specified input Z, the specified input B, the specified input C, the specified input G, the hellinger sq prod probability conclusion holds.

Formal statement
hellingerSq (B.prod G) (C.prod G) = hellingerSq B C
Proof (Lean source)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_prod_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:320
theorem hellinger_block_calculus

the hellinger block calculus conclusion holds.

Formal statement
conclusion 1
ι :
Type
E :
ι → Type
∀ i, MeasurableSpace (E i)
B C :
∀ i, Measure (E i)
(∀ i, IsProbabilityMeasure (B i))
(∀ i, IsProbabilityMeasure (C i))
hellingerSq (Measure.pi B) (Measure.pi C) ≤ ∑ i, hellingerSq (B i) (C i)
conclusion 2
hellingerSq (ν ⊗ₘ B) (ν ⊗ₘ C) = ∫ z, hellingerSq (B z) (C z) ∂ν
conclusion 3
hellingerSq (B.prod G) (C.prod G) = hellingerSq B C
Proof (Lean source)
lemma hellinger_block_calculus : (∀ (ι : Type) [Fintype ι] (E : ι → Type) [∀ i, MeasurableSpace (E i)] (B C : ∀ i, Measure (E i)), (∀ i, IsProbabilityMeasure (B i)) → (∀ i, IsProbabilityMeasure (C i)) → hellingerSq (Measure.pi B) (Measure.pi C) ≤ ∑ i, hellingerSq (B i) (C i)) ∧ (∀ (Z Ω : Type) [MeasurableSpace Z] [MeasurableSpace Ω] (ν : Measure Z) [IsProbabilityMeasure ν] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C], HasConditionalDensities B C → hellingerSq (ν ⊗ₘ B) (ν ⊗ₘ C) = ∫ z, hellingerSq (B z) (C z) ∂ν) ∧ (∀ (Ω Z : Type) [MeasurableSpace Ω] [MeasurableSpace Z] (B C : Measure Ω) (G : Measure Z) [IsProbabilityMeasure B] [IsProbabilityMeasure C] [IsProbabilityMeasure G], hellingerSq (B.prod G) (C.prod G) = hellingerSq B C) := by refine ⟨?_, ?_, ?_⟩ · intro ι _ E _ B C hB hC have := hB have := hC exact hellingerSq_pi_le_sum B C · intro Z Ω _ _ ν _ B C _ _ hBC exact hellingerSq_compProd_common ν B C hBC · intro Ω Z _ _ B C G _ _ _ exact hellingerSq_prod_probability B C G
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellinger_block_calculus · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/Hellinger.lean:329
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.HolderAlgebra 4 declarations Algebraic bounds for the exact coordinate Hölder norm used by the marked priors.

Algebraic bounds for the exact coordinate Hölder norm used by the marked priors.

theorem coordinatePartial_const_mul Lemma coordinatePartial_const_mul in the paper ↗

Scalar multiplication commutes with each continuous coordinate partial on the cube. Given the specified input f, the specified input a, the specified input N, the specified input hf, the multi-index, its order bound, the specified input x, the specified input hx, the coordinate partial const mul conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
a :
ℝ
N :
ℕ
hf :
ContDiffOn ℝ N f (cube d)
κ :
Fin d → ℕ
hκ :
multiOrder κ ≤ N
x :
Cov d
hx :
x ∈ cube d
coordinatePartial (fun x => a * f x) κ x = a * coordinatePartial f κ x
Proof (Lean source)
lemma coordinatePartial_const_mul (f : Cov d → ℝ) (a : ℝ) (N : ℕ) (hf : ContDiffOn ℝ N f (cube d)) (κ : Fin d → ℕ) (hκ : multiOrder κ ≤ N) (x : Cov d) (hx : x ∈ cube d) : coordinatePartial (fun x => a * f x) κ x = a * coordinatePartial f κ x := by unfold coordinatePartial change (iteratedFDerivWithin ℝ (multiOrder κ) (a • f) (cube d) x) _ = _ rw [iteratedFDerivWithin_const_smul_apply ((hf.of_le (by exact_mod_cast hκ)) x hx) (uniqueDiffOn_cube d) hx] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial_const_mul · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/HolderAlgebra.lean:13
theorem holderNorm_const_mul_bound Lemma holderNorm_const_mul_bound in the paper ↗

A finite Hölder bound scales by the absolute value of a scalar. Given the specified input f, the specified input s, the specified input A, the specified input a, the specified input hA, the specified input hf, the holder norm const mul bound conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
s A a :
ℝ
hA :
0 ≤ A
hf :
holderNorm f s ≤ ofReal A
holderNorm (fun x => a * f x) s ≤ ofReal (|a| * A)
Proof (Lean source)
lemma holderNorm_const_mul_bound (f : Cov d → ℝ) (s A a : ℝ) (hA : 0 ≤ A) (hf : holderNorm f s ≤ ofReal A) : holderNorm (fun x => a * f x) s ≤ ofReal (|a| * A) := by have h := (holderNorm_le_iff f s A hA).mp hf apply (holderNorm_le_iff _ s (|a| * A) (mul_nonneg (abs_nonneg _) hA)).mpr refine ⟨contDiffOn_const.mul h.1, ?_, ?_⟩ · intro κ hκ x hx rw [coordinatePartial_const_mul f a _ h.1 κ hκ x hx, abs_mul] exact mul_le_mul_of_nonneg_left (h.2.1 κ hκ x hx) (abs_nonneg a) · intro κ hκ x hx y hy hxy rw [coordinatePartial_const_mul f a _ h.1 κ hκ.le x hx, coordinatePartial_const_mul f a _ h.1 κ hκ.le y hy, ← mul_sub, abs_mul] calc _ ≤ |a| * (A * dist x y ^ (s - (ceil s - 1 : ℕ))) := mul_le_mul_of_nonneg_left (h.2.2 κ hκ x hx y hy hxy) (abs_nonneg a) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_const_mul_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/HolderAlgebra.lean:24

Constant functions have Hölder norm at most their absolute value, at every order. Given the specified input c, the specified input s, the holder norm const bound conclusion holds.

Formal statement
d :
ℕ
shared
c s :
ℝ
holderNorm (fun _ : Cov d => c) s ≤ ofReal |c|
Proof (Lean source)
lemma holderNorm_const_bound (c s : ℝ) : holderNorm (fun _ : Cov d => c) s ≤ ofReal |c| := by have hc (k : ℕ) (v : Fin k → Cov d) (x : Cov d) : (iteratedFDerivWithin ℝ k (fun _ : Cov d => c) (cube d) x) v = if k = 0 then c else 0 := by cases k with | zero => simp | succ k => simp [iteratedFDerivWithin_const_of_ne (Nat.succ_ne_zero k)] have hp (κ : Fin d → ℕ) (x : Cov d) : coordinatePartial (fun _ : Cov d => c) κ x = if multiOrder κ = 0 then c else 0 := hc _ _ x apply (holderNorm_le_iff _ s |c| (abs_nonneg _)).mpr refine ⟨contDiffOn_const, ?_, ?_⟩ · intro κ hκ x hx rw [hp] split_ifs <;> simp · intro κ hκ x hx y hy hxy rw [hp, hp, sub_self, abs_zero] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_const_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/HolderAlgebra.lean:42

Adding two finite Hölder bounds adds their radii. Given the specified input f, the specified input g, the specified input s, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input hf, the specified input hg, the holder norm add bound conclusion holds.

Formal statement
d :
ℕ
shared
f g :
Cov d → ℝ
s A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hf :
holderNorm f s ≤ ofReal A
hg :
holderNorm g s ≤ ofReal B
holderNorm (fun x => f x + g x) s ≤ ofReal (A + B)
Proof (Lean source)
lemma holderNorm_add_bound (f g : Cov d → ℝ) (s A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hf : holderNorm f s ≤ ofReal A) (hg : holderNorm g s ≤ ofReal B) : holderNorm (fun x => f x + g x) s ≤ ofReal (A + B) := by exact (holderNorm_add_le f g s).trans ((add_le_add hf hg).trans_eq (ENNReal.ofReal_add hA hB).symm)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_add_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/HolderAlgebra.lean:63
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.IndependentExchangeability 2 declarations Conditional exchangeability for the explicit independent Bernoulli extension.

Conditional exchangeability for the explicit independent Bernoulli extension.

For Borel success-probability functions p and q, the two potential-outcome Bernoulli kernels are Borel jointly.

Formal statement
Ω :
p q :
Ω → ℝ
hp :
hq :
Measurable (fun x => (bern (p x)).prod (bern (q x)))
Proof (Lean source)
@[fun_prop] lemma measurable_bernPair {Ω : Type*} [MeasurableSpace Ω] (p q : Ω → ℝ) (hp : Measurable p) (hq : Measurable q) : Measurable (fun x => (bern (p x)).prod (bern (q x))) := by simp only [bern, Measure.prod_add, Measure.add_prod, Measure.prod_smul_right, Measure.prod_smul_left, Measure.dirac_prod_dirac] apply Measure.measurable_of_measurable_coe intro s hs simp only [Measure.add_apply, Measure.smul_apply, smul_eq_mul] fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_bernPair · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/IndependentExchangeability.lean:12
theorem independentPrimitive_exchangeability Lemma independentPrimitive_exchangeability in the paper ↗

The independent construction satisfies conditional exchangeability with its explicit product kernel for the two potential outcomes. Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent primitive exchangeability conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
Proof (Lean source)
lemma independentPrimitive_exchangeability {d : ℕ} (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : ConditionalExchangeability (independentPrimitive e p q he hp hq) := by letI := uniformLaw_probability d let E := fun x => probabilityClip (e x) let P := fun x => probabilityClip (p x) let Q := fun x => probabilityClip (q x) have hE : Measurable E := by fun_prop have hP : Measurable P := by fun_prop have hQ : Measurable Q := by fun_prop let Γ : Kernel (Cov d) (Bool × Bool) := ⟨fun x => (bern (P x)).prod (bern (Q x)), measurable_bernPair P Q hP hQ⟩ have hΓ : IsMarkovKernel Γ := by constructor intro x letI := bern_probability (P x) (probabilityClip_mem _) letI := bern_probability (Q x) (probabilityClip_mem _) change IsProbabilityMeasure ((bern (P x)).prod (bern (Q x))) infer_instance letI := hΓ let K := bernKernel (fun w : Cov d × (Bool × Bool) => E w.1) (hE.comp measurable_fst) have hK : IsMarkovKernel K := ⟨fun w => bern_probability _ (probabilityClip_mem _)⟩ letI := hK refine ⟨Γ, hΓ, ?_⟩ change (independentFullLaw e p q).map (fun w => ((w.1, (w.2.2.1, w.2.2.2)), w.2.1)) = ((independentFullLaw e p q).map fst ⊗ₘ Γ) ⊗ₘ K rw [independentFullLaw_covariates d e p q he hp hq] unfold independentFullLaw rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e p q he hp hq) (by fun_prop)] have hm : Measurable (fun x : Cov d => (((Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (p x))).prod (bern (probabilityClip (q x)))))).map (fun w : FullRecord d => ((w.1, (w.2.2.1, w.2.2.2)), w.2.1)))) := (Measure.measurable_map _ (by fun_prop)).comp (measurable_independentRecordKernel e p q he hp hq) ext s hs rw [Measure.bind_apply hs hm.aemeasurable, Measure.compProd_apply hs] rw [Measure.lintegral_compProd (K.measurable_kernel_prodMk_left hs)] apply lintegral_congr intro x change (((Measure.dirac x).prod ((bern (E x)).prod ((bern (P x)).prod (bern (Q x))))).map (fun w => ((w.1, (w.2.2.1, w.2.2.2)), w.2.1))) s = ∫⁻ y, bern (E x) {a | ((x,y),a) ∈ s} ∂(bern (P x)).prod (bern (Q x)) rw [Measure.map_apply (show Measurable (fun w : FullRecord d => ((w.1, (w.2.2.1, w.2.2.2)), w.2.1)) from by fun_prop) hs] simp only [bern, Measure.prod_add, Measure.add_prod, Measure.prod_smul_right, Measure.prod_smul_left, Measure.dirac_prod_dirac, Measure.add_apply, Measure.smul_apply, smul_eq_mul, lintegral_add_measure, lintegral_smul_measure, lintegral_dirac, Measure.dirac_apply] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentPrimitive_exchangeability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/IndependentExchangeability.lean:23
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial 1 declarations Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial constructions and obligations.

Helpers/LocalPolynomial

Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial constructions and obligations.

theorem local_polynomial_projection_facts

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the local polynomial projection facts conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h J :
0 < h
h ≤ 1/2
1 ≤ J
∃ theta : PolyIdx d → ℝ,
x ∈ locCube d h :
|tau P hP x - pv h theta x| ≤ C*h^gamma
sqrt (∑ u, theta u^2) ≤ C
pv h theta (x0 d) = tau P hP (x0 d)
x ∈ locCube d h :
pv h theta x = taylorPoly (tau P hP) (ceil gamma - 1) x
x ∈ locCube d h :
sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ C
x ∈ locCube d h :
(∫ xp, |fineKernel d h J x xp| ∂locLaw d h) ≤ C
(∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h))
= (card (PolyIdx d) : ℝ)*(J:ℝ)^d
u :
sqrt (∫ x, ((designatedPropensity P hP) x*coarseBasis h x u-projOp d h J (fun y => (designatedPropensity P hP) y*coarseBasis h y u) x)^2 ∂locLaw d h)
≤ C*(h/J)^alpha
sqrt (∫ x, ((designatedControl P hP) x-projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h)
≤ C*(h/J)^beta
Proof (Lean source)
lemma local_polynomial_projection_facts (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h J, 0 < h → h ≤ 1/2 → 1 ≤ J → (∃ theta : PolyIdx d → ℝ, (∀ x ∈ locCube d h, |tau P hP x - pv h theta x| ≤ C*h^gamma) ∧ sqrt (∑ u, theta u^2) ≤ C ∧ pv h theta (x0 d) = tau P hP (x0 d) ∧ (∀ x ∈ locCube d h, pv h theta x = taylorPoly (tau P hP) (ceil gamma - 1) x)) ∧ (∀ x ∈ locCube d h, sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ C) ∧ (∀ x ∈ locCube d h, (∫ xp, |fineKernel d h J x xp| ∂locLaw d h) ≤ C) ∧ (∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h)) = (card (PolyIdx d) : ℝ)*(J:ℝ)^d ∧ (∀ u : PolyIdx d, sqrt (∫ x, ((designatedPropensity P hP) x*coarseBasis h x u-projOp d h J (fun y => (designatedPropensity P hP) y*coarseBasis h y u) x)^2 ∂locLaw d h) ≤ C*(h/J)^alpha) ∧ sqrt (∫ x, ((designatedControl P hP) x-projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h) ≤ C*(h/J)^beta := by obtain ⟨Ct, hCt, ht⟩ := taylor_coefficient_bounds d alpha beta gamma L eps hdom obtain ⟨Cb, hCb, hb⟩ := kernel_basis_bounds d alpha beta gamma L eps hdom obtain ⟨Cr, hCr, hr⟩ := residual_projection_bounds d alpha beta gamma L eps hdom let C := max Ct (max Cb Cr) have hTC : Ct ≤ C := le_max_left _ _ have hBC : Cb ≤ C := (le_max_left Cb Cr).trans (le_max_right Ct _) have hRC : Cr ≤ C := (le_max_right Cb Cr).trans (le_max_right Ct _) refine ⟨C, hCt.trans_le hTC, ?_⟩ intro P hP h J hh hh' hJ obtain ⟨theta, herr, htheta, hcenter, htaylor⟩ := ht P hP h hh hh' obtain ⟨hcoarse, hrow, htrace⟩ := hb h J hh hh' hJ obtain ⟨he, hmu⟩ := hr P hP h J hh hh' hJ have hhgamma : 0 ≤ h ^ gamma := Real.rpow_nonneg hh.le _ have hdelta : 0 ≤ h / (J : ℝ) := div_nonneg hh.le (Nat.cast_nonneg J) refine ⟨⟨theta, ?_, htheta.trans hTC, hcenter, htaylor⟩, ?_, ?_, htrace, ?_, ?_⟩ · intro x hx exact (herr x hx).trans (mul_le_mul_of_nonneg_right hTC hhgamma) · intro x hx exact (hcoarse x hx).trans hBC · intro x hx exact (hrow x hx).trans hBC · intro u exact (he u).trans (mul_le_mul_of_nonneg_right hRC (Real.rpow_nonneg hdelta _)) · exact hmu.trans (mul_le_mul_of_nonneg_right hRC (Real.rpow_nonneg hdelta _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.local_polynomial_projection_facts · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial.lean:26
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.Basis 10 declarations Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Basis constructions and obligations.

Helpers/LocalPolynomial/Basis

Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Basis constructions and obligations.

Each of the three prescribed Legendre formulas is uniformly bounded on the reference interval. Given the specified input k, the specified input u, the specified input hu, the legendre abs le four conclusion holds.

Formal statement
k :
ℕ
u :
ℝ
hu :
|u| ≤ 1/2
|legendre k u| ≤ 4
Proof (Lean source)
lemma legendre_abs_le_four (k : ℕ) (u : ℝ) (hu : |u| ≤ 1/2) : |legendre k u| ≤ 4 := by have hu2 : u^2 ≤ 1/4 := by nlinarith [sq_abs u, mul_nonneg (sub_nonneg.mpr hu) (show 0 ≤ (1/2:ℝ)+|u| by positivity)] have hs12 := Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 12) have hs5 := Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5) have h12 : sqrt 12 ≤ 4 := by nlinarith [Real.sqrt_nonneg 12] have h5 : sqrt 5 ≤ 3 := by nlinarith [Real.sqrt_nonneg 5] unfold legendre split_ifs · norm_num · rw [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _)] nlinarith [Real.sqrt_nonneg 12, abs_nonneg u] · have hp : |6*u^2-1/2| ≤ 1 := by rw [abs_le] constructor <;> nlinarith [sq_nonneg u] rw [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _)] nlinarith [Real.sqrt_nonneg 5, abs_nonneg (6*u^2-1/2)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendre_abs_le_four · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:24

Scaling an admissible coarse window preserves the reference-interval bound. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the specified input u, the coarse basis abs bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
u :
|coarseBasis h x u| ≤ (4:ℝ)^d
Proof (Lean source)
lemma coarseBasis_abs_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) (u : PolyIdx d) : |coarseBasis h x u| ≤ (4:ℝ)^d := by unfold coarseBasis rw [Finset.abs_prod] calc _ ≤ ∏ i : Fin d, (4:ℝ) := by apply Finset.prod_le_prod (fun i _ => abs_nonneg _) intro i _ apply legendre_abs_le_four rw [abs_le] constructor · apply (le_div_iff₀ hh).2 have hi := (hx i).1 linarith · apply (div_le_iff₀ hh).2 have hi := (hx i).2 linarith _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coarseBasis_abs_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:45
theorem coarseBasis_vector_bound Lemma coarseBasis_vector_bound in the paper ↗

The finite coarse vector has a bound depending only on the public dimension. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the coarse basis vector bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2)
≤ sqrt (card (PolyIdx d):ℝ) * (4:ℝ)^d
Proof (Lean source)
lemma coarseBasis_vector_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) : sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ sqrt (card (PolyIdx d):ℝ) * (4:ℝ)^d := by have hs : (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 := by calc _ ≤ ∑ _u : PolyIdx d, ((4:ℝ)^d)^2 := by apply Finset.sum_le_sum intro u _ have hb := coarseBasis_abs_bound d h hh x hx u nlinarith [sq_abs (coarseBasis h x u), abs_nonneg (coarseBasis h x u), show 0 ≤ (4:ℝ)^d by positivity] _ = _ := by simp calc _ ≤ sqrt ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) := Real.sqrt_le_sqrt hs _ = _ := by rw [Real.sqrt_mul (Nat.cast_nonneg _), Real.sqrt_sq (by positivity)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coarseBasis_vector_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:66
theorem finite_orthonormal_kernel_square Lemma finite_orthonormal_kernel_square in the paper ↗

Expanding a finite orthonormal kernel gives its rank as the squared product-space norm. Given the specified input b, the specified input hb, the specified input ho, the finite orthonormal kernel square conclusion holds.

Formal statement
Ω ι :
μ :
b :
ι → Ω → ℝ
hb :
∀ i, MemLp (b i) 2 μ
ho :
∀ i j, (∫ x, b i x * b j x ∂μ) = if i = j then 1 else 0
(∫ p, (∑ i, b i p.1 * b i p.2)^2 ∂μ.prod μ) = card ι
Proof (Lean source)
lemma finite_orthonormal_kernel_square {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] (μ : Measure Ω) [SFinite μ] (b : ι → Ω → ℝ) (hb : ∀ i, MemLp (b i) 2 μ) (ho : ∀ i j, (∫ x, b i x * b j x ∂μ) = if i = j then 1 else 0) : (∫ p, (∑ i, b i p.1 * b i p.2)^2 ∂μ.prod μ) = card ι := by classical have hexpand (p : Ω × Ω) : (∑ i, b i p.1 * b i p.2)^2 = ∑ i, ∑ j, (b i p.1 * b j p.1) * (b i p.2 * b j p.2) := by simp only [pow_two, Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring have hi (i j : ι) : Integrable (fun p : Ω × Ω => (b i p.1 * b j p.1) * (b i p.2 * b j p.2)) (μ.prod μ) := ((hb i).integrable_mul (hb j)).mul_prod ((hb i).integrable_mul (hb j)) simp_rw [hexpand] rw [integral_finsetSum (f := fun i (p : Ω × Ω) => ∑ j, (b i p.1 * b j p.1) * (b i p.2 * b j p.2)) univ (fun i _ => integrable_finsetSum _ (fun j _ => hi i j))] have hinner (i : ι) : (∫ p : Ω × Ω, ∑ j, (b i p.1 * b j p.1) * (b i p.2 * b j p.2) ∂μ.prod μ) = 1 := by rw [integral_finsetSum (f := fun j (p : Ω × Ω) => (b i p.1 * b j p.1) * (b i p.2 * b j p.2)) univ (fun j _ => hi i j)] have hp (j : ι) : (∫ p : Ω × Ω, (b i p.1 * b j p.1) * (b i p.2 * b j p.2) ∂μ.prod μ) = (if i = j then (1:ℝ) else 0) := by rw [integral_prod_mul (fun x => b i x * b j x) (fun x => b i x * b j x), ho] split_ifs <;> norm_num simp_rw [hp] simp simp_rw [hinner] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_orthonormal_kernel_square · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:85
theorem fineKernel_square_integral Lemma fineKernel_square_integral in the paper ↗

The prescribed fine kernel has squared integral equal to its finite rank. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the fine kernel square integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
(∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h))
= (card (PolyIdx d):ℝ)*(J:ℝ)^d
Proof (Lean source)
lemma fineKernel_square_integral (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) : (∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h)) = (card (PolyIdx d):ℝ)*(J:ℝ)^d := by let : SFinite (locLaw d h) := by unfold locLaw; infer_instance unfold fineKernel rw [finite_orthonormal_kernel_square (locLaw d h) (fun i x => fineBasis h J x i) (fineBasis_memLp d h J hh hh' hJ) (fun i j => by have ho := fine_orthonormal d h J hh hh' hJ i j by_cases hij : i = j · simp only [if_pos hij] at ho ⊢; exact ho · simp only [if_neg hij] at ho ⊢; exact ho)] rw [fineIdx_card] push_cast rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineKernel_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:119

The assigned half-open cells are disjoint, including their last closed face. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input x, the specified input z, the specified input w, the specified input hz, the specified input hw, the cell index unique conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
x :
Cov d
z w :
Fin d → Fin J
hz :
x ∈ cell h J z
hw :
x ∈ cell h J w
z = w
Proof (Lean source)
lemma cell_index_unique (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (x : Cov d) (z w : Fin d → Fin J) (hz : x ∈ cell h J z) (hw : x ∈ cell h J w) : z = w := by have hJp : 0 < (J:ℝ) := by exact_mod_cast (show 0 < J by omega) have hd : 0 < h/J := div_pos hh hJp funext i apply Fin.ext have hzi := hz i have hwi := hw i by_contra hne rcases lt_or_gt_of_ne hne with hlt | hgt · have hn : ¬ (z i).val + 1 = J := by have := (w i).isLt; omega have hzw : (z i:ℝ)+1 ≤ (w i:ℝ) := by exact_mod_cast hlt simp only [if_neg hn] at hzi have hm := mul_le_mul_of_nonneg_right hzw hd.le linarith [hwi.1, hzi.2] · have hn : ¬ (w i).val + 1 = J := by have := (z i).isLt; omega have hwz : (w i:ℝ)+1 ≤ (z i:ℝ) := by exact_mod_cast hgt simp only [if_neg hn] at hwi have hm := mul_le_mul_of_nonneg_right hwz hd.le linarith [hzi.1, hwi.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cell_index_unique · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:137

Fine coordinates lie in the same reference interval after centering in their cell. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input x, the specified input u, the fine basis abs bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
x :
Cov d
u :
|fineBasis h J x u| ≤ sqrt ((J:ℝ)^d) * (4:ℝ)^d
Proof (Lean source)
lemma fineBasis_abs_bound (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (x : Cov d) (u : FineIdx d J) : |fineBasis h J x u| ≤ sqrt ((J:ℝ)^d) * (4:ℝ)^d := by have hJp : 0 < (J:ℝ) := by exact_mod_cast (show 0 < J by omega) have hd : 0 < h/J := div_pos hh hJp unfold fineBasis split_ifs with hx · rw [abs_mul, abs_of_nonneg (Real.sqrt_nonneg _), Finset.abs_prod] apply mul_le_mul_of_nonneg_left _ (Real.sqrt_nonneg _) calc _ ≤ ∏ i : Fin d, (4:ℝ) := by apply Finset.prod_le_prod (fun i _ => abs_nonneg _) intro i _ apply legendre_abs_le_four have hi := hx i have hu : x i ≤ 1/2-h/2+((u.1 i:ℝ)+1)*(h/J) := by split_ifs at hi with hn · have he : (u.1 i:ℝ)+1 = J := by exact_mod_cast hn rw [he] have he' : (J:ℝ)*(h/J) = h := by field_simp linarith [hi.2] · exact hi.2.le rw [abs_le] constructor · apply (le_div_iff₀ hd).2 linarith [hi.1] · apply (div_le_iff₀ hd).2 linarith _ = _ := by simp · simp only [abs_zero] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineBasis_abs_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:160
theorem fineBasis_abs_integral_bound Lemma fineBasis_abs_integral_bound in the paper ↗

Orthonormality of the cell's constant entry normalizes the absolute basis integral. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the fine basis abs integral bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u :
conclusion 1
Integrable (fun x => |fineBasis h J x u|) (locLaw d h)
conclusion 2
(∫ x, |fineBasis h J x u| ∂locLaw d h) ≤ (4:ℝ)^d / sqrt ((J:ℝ)^d)
Proof (Lean source)
lemma fineBasis_abs_integral_bound (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u : FineIdx d J) : Integrable (fun x => |fineBasis h J x u|) (locLaw d h) ∧ (∫ x, |fineBasis h J x u| ∂locLaw d h) ≤ (4:ℝ)^d / sqrt ((J:ℝ)^d) := by let z0 : PolyIdx d := ⟨fun _ => 0, by simp⟩ let b0 := fun x : Cov d => fineBasis h J x (u.1,z0) have hJp : 0 < (J:ℝ) := by exact_mod_cast (show 0 < J by omega) have hs : 0 < sqrt ((J:ℝ)^d) := Real.sqrt_pos.2 (by positivity) have hb0 : Integrable (fun x => (b0 x)^2) (locLaw d h) := (fineBasis_memLp d h J hh hh' hJ (u.1,z0)).integrable_sq have hb0norm : (∫ x, (b0 x)^2 ∂locLaw d h) = 1 := by have ho := fine_orthonormal d h J hh hh' hJ (u.1,z0) (u.1,z0) simpa only [b0, pow_two, ite_true] using ho have hpoint (x : Cov d) : |fineBasis h J x u| ≤ ((4:ℝ)^d / sqrt ((J:ℝ)^d)) * (b0 x)^2 := by by_cases hx : x ∈ cell h J u.1 · have he : b0 x = sqrt ((J:ℝ)^d) := by simp [b0, fineBasis, hx, z0, legendre] rw [he] have hc : ((4:ℝ)^d / sqrt ((J:ℝ)^d)) * (sqrt ((J:ℝ)^d))^2 = sqrt ((J:ℝ)^d) * (4:ℝ)^d := by field_simp rw [hc] exact fineBasis_abs_bound d h J hh hJ x u · simp [fineBasis, hx, b0] have hmajor := hb0.const_mul ((4:ℝ)^d / sqrt ((J:ℝ)^d)) have hint : Integrable (fun x => |fineBasis h J x u|) (locLaw d h) := by apply hmajor.mono' · fun_prop · exact Filter.Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs, abs_abs] using hpoint x) refine ⟨hint, ?_⟩ have hm := integral_mono hint hmajor hpoint rwa [integral_const_mul, hb0norm, mul_one] at hm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineBasis_abs_integral_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:193
theorem fineKernel_abs_row_bound Lemma fineKernel_abs_row_bound in the paper ↗

Only one cell contributes to a kernel row; its normalization cancels the grid scale. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input x, the fine kernel abs row bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
x :
Cov d
(∫ y, |fineKernel d h J x y| ∂locLaw d h) ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2
Proof (Lean source)
lemma fineKernel_abs_row_bound (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (x : Cov d) : (∫ y, |fineKernel d h J x y| ∂locLaw d h) ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 := by classical by_cases hex : ∃ z : Fin d → Fin J, x ∈ cell h J z · obtain ⟨z, hz⟩ := hex have hk (y : Cov d) : fineKernel d h J x y = ∑ u : PolyIdx d, fineBasis h J x (z,u) * fineBasis h J y (z,u) := by unfold fineKernel rw [Fintype.sum_prod_type] have hzero (w : Fin d → Fin J) (hw : w ≠ z) : (∑ u : PolyIdx d, fineBasis h J x (w,u) * fineBasis h J y (w,u)) = 0 := by have hn : x ∉ cell h J w := fun hw' => hw (cell_index_unique d h J hh hJ x w z hw' hz) simp [fineBasis, hn] exact Finset.sum_eq_single z (fun w _ hw => hzero w hw) (by simp) let F := fun y : Cov d => ∑ u : PolyIdx d, |fineBasis h J x (z,u)| * |fineBasis h J y (z,u)| have hF : Integrable F (locLaw d h) := integrable_finsetSum _ (fun u _ => (fineBasis_abs_integral_bound d h J hh hh' hJ (z,u)).1.const_mul _) have hpoint (y : Cov d) : |fineKernel d h J x y| ≤ F y := by rw [hk] simpa only [F, abs_mul] using Finset.abs_sum_le_sum_abs (fun u : PolyIdx d => fineBasis h J x (z,u) * fineBasis h J y (z,u)) Finset.univ have hint : Integrable (fun y => |fineKernel d h J x y|) (locLaw d h) := by apply hF.mono' · fun_prop · exact Filter.Eventually.of_forall (fun y => by simpa only [Real.norm_eq_abs, abs_abs] using hpoint y) calc _ ≤ ∫ y, F y ∂locLaw d h := integral_mono hint hF hpoint _ = ∑ u : PolyIdx d, |fineBasis h J x (z,u)| * (∫ y, |fineBasis h J y (z,u)| ∂locLaw d h) := by dsimp only [F] rw [integral_finsetSum (f := fun u y => |fineBasis h J x (z,u)| * |fineBasis h J y (z,u)|) Finset.univ (fun u _ => (fineBasis_abs_integral_bound d h J hh hh' hJ (z,u)).1.const_mul _)] simp_rw [integral_const_mul] _ ≤ ∑ _u : PolyIdx d, ((4:ℝ)^d)^2 := by apply Finset.sum_le_sum intro u _ have hu := fineBasis_abs_integral_bound d h J hh hh' hJ (z,u) have hb := fineBasis_abs_bound d h J hh hJ x (z,u) have hs : 0 < sqrt ((J:ℝ)^d) := Real.sqrt_pos.2 (pow_pos (by exact_mod_cast (show 0 < J by omega)) _) calc _ ≤ (sqrt ((J:ℝ)^d) * (4:ℝ)^d) * ((4:ℝ)^d / sqrt ((J:ℝ)^d)) := mul_le_mul hb hu.2 (integral_nonneg (fun y => abs_nonneg _)) (by positivity) _ = _ := by field_simp _ = _ := by simp · have hk (y : Cov d) : fineKernel d h J x y = 0 := by unfold fineKernel apply Finset.sum_eq_zero intro u _ have hn : x ∉ cell h J u.1 := fun hx => hex ⟨u.1,hx⟩ simp [fineBasis, hn] simp_rw [hk, abs_zero, integral_zero] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineKernel_abs_row_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:229

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the kernel basis bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
h J :
0 < h
h ≤ 1/2
1 ≤ J
x ∈ locCube d h :
sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ C
x ∈ locCube d h :
(∫ xp, |fineKernel d h J x xp| ∂locLaw d h) ≤ C
(∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h))
= (card (PolyIdx d):ℝ)*(J:ℝ)^d
Proof (Lean source)
lemma kernel_basis_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ h J, 0 < h → h ≤ 1/2 → 1 ≤ J → (∀ x ∈ locCube d h, sqrt (∑ u : PolyIdx d, (coarseBasis h x u)^2) ≤ C) ∧ (∀ x ∈ locCube d h, (∫ xp, |fineKernel d h J x xp| ∂locLaw d h) ≤ C) ∧ (∫ p, (fineKernel d h J p.1 p.2)^2 ∂(locLaw d h).prod (locLaw d h)) = (card (PolyIdx d):ℝ)*(J:ℝ)^d := by let B := sqrt (card (PolyIdx d):ℝ) * (4:ℝ)^d let C := (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 + 1 have hC : 0 < C := by dsimp [C]; positivity refine ⟨max (B+1) C, lt_of_lt_of_le hC (le_max_right _ _), ?_⟩ intro h J hh hh' hJ refine ⟨?_, ?_, fineKernel_square_integral d h J hh hh' hJ⟩ · intro x hx exact (coarseBasis_vector_bound d h hh x hx).trans ((by dsimp only [B]; linarith : B ≤ B+1).trans (le_max_left _ _)) · intro x hx exact (fineKernel_abs_row_bound d h J hh hh' hJ x).trans ((by dsimp only [C]; linarith : (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 ≤ C).trans (le_max_right _ _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.kernel_basis_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Basis.lean:288
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.CellPolynomial 5 declarations Affine changes of the degree-two Legendre basis preserve total degree.

# Polynomial copies on fine cells Affine changes of the degree-two Legendre basis preserve total degree. Thus cellwise scalar multiples of coarse polynomials belong to the fine space.

Triangular coefficients for a one-dimensional affine Legendre change. Given the specified input k, the specified input j, the specified input a, the specified input b, legendre affine coeff is the corresponding construction.

Definition (Lean source)
k j :
ℕ
a b :
ℝ
legendreAffineCoeff k j a b :
ℝ
if k
= 0 then (if j = 0 then 1 else 0) else if k = 1 then (if j = 0 then sqrt 12*a else if j = 1 then b else 0) else (if j = 0 then sqrt 5*(6*a^2+b^2/2-1/2) else if j = 1 then sqrt 5*sqrt 12*a*b else if j = 2 then b^2 else 0)
theorem legendre_affine_expansion Lemma legendre_affine_expansion in the paper ↗

An affine substitution in a Legendre entry uses only lower degrees. Given the specified input k, the specified input hk, the specified input a, the specified input b, the specified input t, the legendre affine expansion conclusion holds.

Formal statement
k :
ℕ
hk :
k ≤ 2
a b t :
ℝ
legendre k (a+b*t) = ∑ j ∈ range (k+1), legendreAffineCoeff k j a b * legendre j t
Proof (Lean source)
lemma legendre_affine_expansion (k : ℕ) (hk : k ≤ 2) (a b t : ℝ) : legendre k (a+b*t) = ∑ j ∈ range (k+1), legendreAffineCoeff k j a b * legendre j t := by interval_cases k <;> norm_num [legendre, legendreAffineCoeff, Finset.sum_range_succ] · ring · ring_nf rw [Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 12)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendre_affine_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/CellPolynomial.lean:22
theorem legendreAffineCoeff_above Lemma legendreAffineCoeff_above in the paper ↗

The change-of-basis matrix is triangular. Given the specified input k, the specified input j, the specified input hk, the specified input hj, the specified input a, the specified input b, the legendre affine coeff above conclusion holds.

Formal statement
k j :
ℕ
hk :
k ≤ 2
hj :
k < j
a b :
ℝ
Proof (Lean source)
lemma legendreAffineCoeff_above (k j : ℕ) (hk : k ≤ 2) (hj : k < j) (a b : ℝ) : legendreAffineCoeff k j a b = 0 := by interval_cases k · simp [legendreAffineCoeff, show j ≠ 0 by omega] · simp [legendreAffineCoeff, show j ≠ 0 by omega, show j ≠ 1 by omega] · simp [legendreAffineCoeff, show j ≠ 0 by omega, show j ≠ 1 by omega, show j ≠ 2 by omega]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendreAffineCoeff_above · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/CellPolynomial.lean:31
theorem legendre_tensor_affine_expansion Lemma legendre_tensor_affine_expansion in the paper ↗

The tensor expansion keeps only multiindices of total degree at most two. Given the specified input d, the specified input u, the specified input a, the specified input b, the specified input t, the legendre tensor affine expansion conclusion holds.

Formal statement
d :
ℕ
u :
a b t :
Fin d → ℝ
(∏ i, legendre (u.1 i) (a i+b i*t i))
= ∑ v : PolyIdx d, ∏ i, legendreAffineCoeff (u.1 i) (v.1 i) (a i) (b i) * legendre (v.1 i) (t i)
Proof (Lean source)
lemma legendre_tensor_affine_expansion {d : ℕ} (u : PolyIdx d) (a b t : Fin d → ℝ) : (∏ i, legendre (u.1 i) (a i+b i*t i)) = ∑ v : PolyIdx d, ∏ i, legendreAffineCoeff (u.1 i) (v.1 i) (a i) (b i) * legendre (v.1 i) (t i) := by classical have hu (i : Fin d) : u.1 i ≤ 2 := (Finset.single_le_sum (fun j _ => zero_le (u.1 j)) (Finset.mem_univ i)).trans u.2 simp_rw [legendre_affine_expansion _ (hu _) ] rw [Finset.prod_univ_sum] let s := piFinset (fun i => range (u.1 i+1)) have hs {v : Fin d → ℕ} : v ∈ s ↔ ∀ i, v i ≤ u.1 i := by simp [s, Fintype.mem_piFinset, Nat.lt_succ_iff] let toPoly := fun v (hv : v ∈ s) => (⟨v, (Finset.sum_le_sum (fun i _ => (hs.mp hv) i)).trans u.2⟩ : PolyIdx d) calc _ = ∑ v ∈ Finset.univ.filter (fun v : PolyIdx d => ∀ i, v.1 i ≤ u.1 i), ∏ i, legendreAffineCoeff (u.1 i) (v.1 i) (a i) (b i) * legendre (v.1 i) (t i) := by apply Finset.sum_bij toPoly · intro v hv simp only [mem_filter, Finset.mem_univ, true_and] exact hs.mp hv · intro v hv w hw he exact congrArg val he · intro v hv exact ⟨v.1, hs.mpr (Finset.mem_filter.mp hv).2, Subtype.ext (by rfl)⟩ · intro v hv rfl _ = _ := by apply Finset.sum_subset (filter_subset _ _) intro v _ hv have hn : ¬ ∀ i, v.1 i ≤ u.1 i := by simpa using hv obtain ⟨i, hi⟩ := not_forall.mp hn apply Finset.prod_eq_zero (Finset.mem_univ i) rw [legendreAffineCoeff_above _ _ (hu i) (Nat.lt_of_not_ge hi), zero_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendre_tensor_affine_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/CellPolynomial.lean:40
theorem cellwise_coarse_expansion Lemma cellwise_coarse_expansion in the paper ↗

A separate scalar on each cell times a coarse entry is a fine-basis expansion. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input u, the specified input c, the cellwise coarse expansion conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
u :
c :
(Fin d → Fin J) → ℝ
∃ v : FineIdx d J → ℝ,
∀ (z : Fin d → Fin J) (x : Cov d),
x ∈ cell h J z → (∑ i, fineBasis h J x i*v i) = c z*coarseBasis h x u
Proof (Lean source)
lemma cellwise_coarse_expansion {d : ℕ} (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (u : PolyIdx d) (c : (Fin d → Fin J) → ℝ) : ∃ v : FineIdx d J → ℝ, ∀ (z : Fin d → Fin J) (x : Cov d), x ∈ cell h J z → (∑ i, fineBasis h J x i*v i) = c z*coarseBasis h x u := by classical let center := fun (z : Fin d → Fin J) (i : Fin d) => 1/2-h/2+((z i:ℝ)+1/2)*(h/J) let a := fun z i => (center z i-1/2)/h let b : ℝ := 1/(J:ℝ) let coeff := fun z (w : PolyIdx d) => ∏ i, legendreAffineCoeff (u.1 i) (w.1 i) (a z i) b let root := sqrt ((J:ℝ)^d) have hj : (J:ℝ) ≠ 0 := by exact_mod_cast (show J ≠ 0 by omega) have hr : root ≠ 0 := (Real.sqrt_pos.mpr (by positivity : (0:ℝ) < (J:ℝ)^d)).ne' refine ⟨fun i => c i.1*coeff i.1 i.2/root, ?_⟩ intro z x hx rw [Fintype.sum_prod_type, Finset.sum_eq_single z] · have ht (i : Fin d) : a z i+b*((x i-center z i)/(h/J)) = (x i-1/2)/h := by dsimp [a, b] field_simp <;> ring have he := legendre_tensor_affine_expansion u (a z) (fun _ => b) (fun i => (x i-center z i)/(h/J)) simp_rw [ht] at he change coarseBasis h x u = _ at he rw [he, Finset.mul_sum] apply Finset.sum_congr rfl intro w _ simp only [fineBasis, hx, if_true] change root*(∏ i, legendre (w.1 i) ((x i-center z i)/(h/J)))* (c z*coeff z w/root) = _ rw [Finset.prod_mul_distrib] dsimp [coeff] field_simp simp only [mul_comm] ring · intro w _ hw have hn : x ∉ cell h J w := fun hw' => hw (cell_index_unique d h J hh hJ x w z hw' hx) simp [fineBasis, hn] · simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cellwise_coarse_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/CellPolynomial.lean:77
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.Residual 1 declarations Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Residual constructions and obligations.

Helpers/LocalPolynomial/Residual

Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Residual constructions and obligations.

theorem residual_projection_bounds Lemma residual_projection_bounds in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the residual projection bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h J :
0 < h
h ≤ 1/2
1 ≤ J
u :
sqrt (∫ x, ((designatedPropensity P hP) x*coarseBasis h x u-projOp d h J (fun y => (designatedPropensity P hP) y*coarseBasis h y u) x)^2 ∂locLaw d h)
≤ C*(h/J)^alpha
sqrt (∫ x, ((designatedControl P hP) x-projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h)
≤ C*(h/J)^beta
Proof (Lean source)
lemma residual_projection_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h J, 0 < h → h ≤ 1/2 → 1 ≤ J → (∀ u : PolyIdx d, sqrt (∫ x, ((designatedPropensity P hP) x*coarseBasis h x u-projOp d h J (fun y => (designatedPropensity P hP) y*coarseBasis h y u) x)^2 ∂locLaw d h) ≤ C*(h/J)^alpha) ∧ sqrt (∫ x, ((designatedControl P hP) x-projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h) ≤ C*(h/J)^beta := by obtain ⟨Cm, hCm, hm⟩ := control_projection_bounds d alpha beta gamma L eps hdom obtain ⟨Ce, hCe, he⟩ := propensity_projection_bounds d alpha beta gamma L eps hdom let C := max Ce Cm have heC : Ce ≤ C := le_max_left _ _ have hmC : Cm ≤ C := le_max_right _ _ refine ⟨C, hCe.trans_le heC, ?_⟩ intro P hP h J hh hh' hJ constructor · intro u exact (he P hP h J hh hh' hJ u).trans (mul_le_mul_of_nonneg_right heC (Real.rpow_nonneg (div_nonneg hh.le (Nat.cast_nonneg J)) _)) · exact (hm P hP h J hh hh' hJ).trans (mul_le_mul_of_nonneg_right hmC (Real.rpow_nonneg (div_nonneg hh.le (Nat.cast_nonneg J)) _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.residual_projection_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Residual.lean:23
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.ResidualControl 9 declarations Cell coverage, cell geometry, and the orthogonal best-approximation inequality used for the control-regression residual in the local polynomial roadmap.

# Cellwise control-regression approximation Cell coverage, cell geometry, and the orthogonal best-approximation inequality used for the control-regression residual in the local polynomial roadmap.

theorem localization_cell_cover Lemma localization_cell_cover in the paper ↗

The prescribed face assignments cover every point of the localization box. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input x, the specified input hx, the localization cell cover conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
x :
Cov d
hx :
x ∈ locCube d h
∃ z : Fin d → Fin J, x ∈ cell h J z
Proof (Lean source)
lemma localization_cell_cover {d : ℕ} (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (x : Cov d) (hx : x ∈ locCube d h) : ∃ z : Fin d → Fin J, x ∈ cell h J z := by have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj have hex (i : Fin d) : ∃ j : Fin J, 1/2-h/2+(j:ℝ)*(h/J) ≤ x i ∧ (if j.val+1 = J then x i ≤ 1/2+h/2 else x i < 1/2-h/2+((j:ℝ)+1)*(h/J)) := by let t := (x i-(1/2-h/2))/(h/J) have ht0 : 0 ≤ t := div_nonneg (by linarith [(hx i).1]) ht.le have htJ : t ≤ J := by apply (div_le_iff₀ ht).2 have he : (J:ℝ)*(h/J) = h := by field_simp dsimp [t] rw [he] linarith [(hx i).2] by_cases he : t = J · let j : Fin J := ⟨J-1, by omega⟩ have hjlast : j.val+1 = J := by dsimp [j]; omega have hjcast : (j:ℝ)+1 = J := by exact_mod_cast hjlast refine ⟨j, ?_, ?_⟩ · have hmul : (J:ℝ)*(h/J) = x i-(1/2-h/2) := by exact ((div_eq_iff ht.ne').mp he).symm have hle := mul_le_mul_of_nonneg_right (by linarith : (j:ℝ) ≤ J) ht.le linarith · simpa only [if_pos hjlast] using (hx i).2 · have hlt : t < J := lt_of_le_of_ne htJ he let j : Fin J := ⟨⌊t⌋₊, (Nat.floor_lt ht0).mpr hlt⟩ refine ⟨j, ?_, ?_⟩ · have hle := (le_div_iff₀ ht).mp (Nat.floor_le ht0) change (j:ℝ)*(h/J) ≤ x i-(1/2-h/2) at hle linarith · split_ifs with hjlast · exact (hx i).2 · have hle := (div_lt_iff₀ ht).mp (Nat.lt_floor_add_one t) change x i-(1/2-h/2) < ((j:ℝ)+1)*(h/J) at hle linarith choose z hz using hex exact ⟨z, hz⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.localization_cell_cover · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:17

Points in the same cell are separated by at most its side times √d. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the specified input x, the specified input y, the specified input hx, the specified input hy, the cell distance bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z :
Fin d → Fin J
x y :
Cov d
hx :
x ∈ cell h J z
hy :
y ∈ cell h J z
dist x y ≤ sqrt (d:ℝ)*(h/J)
Proof (Lean source)
lemma cell_distance_bound {d : ℕ} (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z : Fin d → Fin J) (x y : Cov d) (hx : x ∈ cell h J z) (hy : y ∈ cell h J z) : dist x y ≤ sqrt (d:ℝ)*(h/J) := by have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj have upper (w : Cov d) (hw : w ∈ cell h J z) (i : Fin d) : w i ≤ 1/2-h/2+((z i:ℝ)+1)*(h/J) := by have hi := (hw i).2 split_ifs at hi with he · have hc : (z i:ℝ)+1 = J := by exact_mod_cast he rw [hc] have hm : (J:ℝ)*(h/J) = h := by field_simp rw [hm] linarith · exact hi.le have hcoord (i : Fin d) : |x i-y i| ≤ h/J := by rw [abs_le] constructor <;> linarith [(hx i).1, (hy i).1, upper x hx i, upper y hy i] rw [EuclideanSpace.dist_eq] calc _ ≤ sqrt ((d:ℝ)*(h/J)^2) := by apply Real.sqrt_le_sqrt calc _ ≤ ∑ _i : Fin d, (h/J)^2 := by apply Finset.sum_le_sum intro i _ rw [Real.dist_eq] nlinarith [hcoord i, sq_abs (x i-y i), abs_nonneg (x i-y i)] _ = _ := by simp _ = _ := by rw [Real.sqrt_mul (Nat.cast_nonneg d), Real.sqrt_sq ht.le]
theorem projection_best_approximation Lemma projection_best_approximation in the paper ↗

Subtracting any fine-basis expansion leaves the same orthogonal residual. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the specified input v, the projection best approximation conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
v :
FineIdx d J → ℝ
(∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h)
≤ ∫ x, (f x-∑ i, fineBasis h J x i*v i)^2 ∂locLaw d h
Proof (Lean source)
lemma projection_best_approximation (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) (v : FineIdx d J → ℝ) : (∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h) ≤ ∫ x, (f x-∑ i, fineBasis h J x i*v i)^2 ∂locLaw d h := by let g := fun x => ∑ i, fineBasis h J x i*v i have hb := fineBasis_memLp d h J hh hh' hJ have hg : MemLp g 2 (locLaw d h) := memLp_finsetSum _ (fun i _ => (hb i).mul_const (v i)) have hcoef (i : FineIdx d J) : (∫ x, fineBasis h J x i*g x ∂locLaw d h) = v i := by simp only [g, Finset.mul_sum] simp_rw [← mul_assoc] rw [integral_finsetSum (f := fun j x => fineBasis h J x i*fineBasis h J x j*v j) univ (fun j _ => ((hb i).integrable_mul (hb j)).mul_const (v j))] simp_rw [integral_mul_const, fine_orthonormal d h J hh hh' hJ] simp have hproj (x : Cov d) : projOp d h J (fun y => f y-g y) x = projOp d h J f x-g x := by rw [projection_finite_expansion d h J hh hh' hJ (fun y => f y-g y) (hf.sub hg), projection_finite_expansion d h J hh hh' hJ _ hf] have hsub (i : FineIdx d J) : (∫ y, fineBasis h J y i*(f y-g y) ∂locLaw d h) = (∫ y, fineBasis h J y i*f y ∂locLaw d h)-v i := by simp_rw [mul_sub] rw [integral_sub (show Integrable (fun y => fineBasis h J y i*f y) (locLaw d h) from (hb i).integrable_mul hf) (show Integrable (fun y => fineBasis h J y i*g y) (locLaw d h) from (hb i).integrable_mul hg), hcoef] simp_rw [hsub, mul_sub, Finset.sum_sub_distrib] rfl have he := projection_pythagoras d h J hh hh' hJ (fun x => f x-g x) (hf.sub hg) simp_rw [hproj, show ∀ x, f x-g x-(projOp d h J f x-g x) = f x-projOp d h J f x by intro x; ring] at he have hn : 0 ≤ ∫ x, (projOp d h J (fun y => f y-g y) x)^2 ∂locLaw d h := integral_nonneg (fun _ => sq_nonneg _) simp_rw [hproj] at hn change (∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h) ≤ ∫ x, (f x-g x)^2 ∂locLaw d h linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projection_best_approximation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:92
theorem localization_probability Lemma localization_probability in the paper ↗

Coarse constant orthonormality normalizes the localization measure. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the localization probability conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
Proof (Lean source)
lemma localization_probability (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) : IsProbabilityMeasure (locLaw d h) := by let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ have ho := coarse_orthonormal d h hh hh' z z simp only [z, coarseBasis, legendre, ite_true, Finset.prod_const_one, one_mul] at ho apply isProbabilityMeasure_iff_real.mpr simpa only [integral_const, smul_eq_mul, mul_one] using ho
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.localization_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:129

Every cell centre belongs to its assigned cell. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the cell center mem conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z :
Fin d → Fin J
(toLp 2 (fun i => 1/2-h/2+((z i:ℝ)+1/2)*(h/J)) : Cov d) ∈ cell h J z
Proof (Lean source)
lemma cell_center_mem {d : ℕ} (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z : Fin d → Fin J) : (toLp 2 (fun i => 1/2-h/2+((z i:ℝ)+1/2)*(h/J)) : Cov d) ∈ cell h J z := by have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj intro i simp only [WithLp.ofLp_toLp] constructor · nlinarith · split_ifs with he · have hz : (z i:ℝ)+1 = J := by exact_mod_cast he have hm : (J:ℝ)*(h/J) = h := by field_simp nlinarith · nlinarith
theorem holder_control_projection_residual Lemma holder_control_projection_residual in the paper ↗

A bounded measurable Hölder function is approximated by cellwise constants with the precise fine-scale exponent in the paper's roadmap. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the specified input B, the specified input K, the specified input s, the specified input hK, the specified input hs, the specified input hB, the specified input hmod, the holder control projection residual conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
B K s :
ℝ
hK :
0 ≤ K
hs :
0 ≤ s
hB :
∀ x ∈ locCube d h, |f x| ≤ B
hmod :
∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |f x-f y| ≤ K*dist x y^s
sqrt (∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h) ≤ K*(sqrt (d:ℝ))^s*(h/J)^s
Proof (Lean source)
lemma holder_control_projection_residual (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : Measurable f) (B K s : ℝ) (hK : 0 ≤ K) (hs : 0 ≤ s) (hB : ∀ x ∈ locCube d h, |f x| ≤ B) (hmod : ∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |f x-f y| ≤ K*dist x y^s) : sqrt (∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h) ≤ K*(sqrt (d:ℝ))^s*(h/J)^s := by classical letI := localization_probability d h hh hh' have hae : ∀ᵐ x ∂locLaw d h, x ∈ locCube d h := by unfold locLaw apply Measure.ae_smul_measure exact ae_restrict_mem (isClosed_locCube d h).measurableSet have hf2 : MemLp f 2 (locLaw d h) := by exact (memLp_top_of_bound hf.aestronglyMeasurable B (hae.mono fun x hx => by simpa only [Real.norm_eq_abs] using hB x hx)).mono_exponent (by simp) let center := fun z : Fin d → Fin J => (toLp 2 (fun i => 1/2-h/2+((z i:ℝ)+1/2)*(h/J)) : Cov d) let z0 : PolyIdx d := ⟨fun _ => 0, by simp⟩ let v : FineIdx d J → ℝ := fun i => if i.2 = z0 then f (center i.1)/sqrt ((J:ℝ)^d) else 0 let g := fun x => ∑ i, fineBasis h J x i*v i have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj have hroot : 0 < sqrt ((J:ℝ)^d) := Real.sqrt_pos.mpr (by positivity) have hg : MemLp g 2 (locLaw d h) := memLp_finsetSum _ (fun i _ => (fineBasis_memLp d h J hh hh' hJ i).mul_const (v i)) have hcell (x : Cov d) (z : Fin d → Fin J) (hx : x ∈ cell h J z) : g x = f (center z) := by dsimp only [g] rw [Fintype.sum_prod_type] have hinner (w : Fin d → Fin J) : (∑ u : PolyIdx d, fineBasis h J x (w,u)*v (w,u)) = if x ∈ cell h J w then f (center w) else 0 := by simp [v, fineBasis, z0, legendre] split_ifs <;> simp [mul_div_cancel₀ _ hroot.ne'] simp_rw [hinner] rw [Finset.sum_eq_single z] · simp only [if_pos hx] · intro w _ hw have hn : x ∉ cell h J w := fun hw' => hw (cell_index_unique d h J hh hJ x w z hw' hx) simp only [if_neg hn] · simp let E := K*(sqrt (d:ℝ))^s*(h/J)^s have hE : 0 ≤ E := by dsimp [E]; positivity have herr : ∀ᵐ x ∂locLaw d h, |f x-g x| ≤ E := by filter_upwards [hae] with x hx obtain ⟨z, hz⟩ := localization_cell_cover h J hh hJ x hx have hc : center z ∈ cell h J z := cell_center_mem h J hh hJ z rw [hcell x z hz] calc _ ≤ K*dist x (center z)^s := hmod x hx _ (cell_subset_locCube h J hh hJ z hc) _ ≤ K*(sqrt (d:ℝ)*(h/J))^s := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (dist_nonneg) (cell_distance_bound h J hh hJ z x _ hz hc) hs) hK _ = E := by rw [Real.mul_rpow (Real.sqrt_nonneg _) ht.le]; dsimp [E]; ring have henergy : (∫ x, (f x-g x)^2 ∂locLaw d h) ≤ E^2 := by calc _ ≤ ∫ _x : Cov d, E^2 ∂locLaw d h := by apply integral_mono_ae (hf2.sub hg).integrable_sq (integrable_const _) filter_upwards [herr] with x hx change (f x-g x)^2 ≤ E^2 nlinarith [sq_abs (f x-g x), abs_nonneg (f x-g x)] _ = E^2 := by simp calc _ ≤ sqrt (∫ x, (f x-g x)^2 ∂locLaw d h) := Real.sqrt_le_sqrt (projection_best_approximation d h J hh hh' hJ f hf2 v) _ ≤ sqrt (E^2) := Real.sqrt_le_sqrt henergy _ = _ := Real.sqrt_sq hE
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holder_control_projection_residual · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:154
theorem measurable_designatedControl Lemma measurable_designatedControl in the paper ↗

For a primitive law P in the model class at overlap level eps, the designated control regression is globally Borel.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Proof (Lean source)
@[fun_prop] lemma measurable_designatedControl {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : Measurable (designatedControl P hP) := by unfold designatedControl have hc : MeasurableSet (cube d) := by unfold cube simp only [Set.ofPred_forall] apply MeasurableSet.iInter intro i exact measurableSet_Icc.preimage (by fun_prop) exact Measurable.ite hc (canonicalLaw P hP).measurable_mu0 measurable_const
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_designatedControl · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:226
theorem holderNorm_low_order_modulus Lemma holderNorm_low_order_modulus in the paper ↗

At exponents at most one, the frozen Hölder norm gives the function's modulus. Given the specified input d, the specified input f, the specified input s, the specified input L, the specified input hs, the specified input hs', the specified input hL, the specified input hf, the specified input x, the specified input y, the specified input hx, the specified input hy, the holder norm low order modulus conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
s L :
ℝ
hs :
0 < s
hs' :
s ≤ 1
hL :
0 ≤ L
hf :
holderNorm f s ≤ ofReal L
x y :
Cov d
hx :
x ∈ cube d
hy :
y ∈ cube d
|f x-f y| ≤ L*dist x y^s
Proof (Lean source)
lemma holderNorm_low_order_modulus {d : ℕ} (f : Cov d → ℝ) (s L : ℝ) (hs : 0 < s) (hs' : s ≤ 1) (hL : 0 ≤ L) (hf : holderNorm f s ≤ ofReal L) (x y : Cov d) (hx : x ∈ cube d) (hy : y ∈ cube d) : |f x-f y| ≤ L*dist x y^s := by have hp : ceil s-1 = 0 := by have hc : ceil s ≤ 1 := Nat.ceil_le.mpr (by simpa using hs') omega have hm := (holderNorm_le_iff f s L hL).mp hf by_cases he : x = y · subst y simp only [sub_self, abs_zero] positivity · have hh := hm.2.2 (fun _ => 0) (by simp [multiOrder, hp]) x hx y hy he simpa only [coordinatePartial_zero_index, hp, Nat.cast_zero, sub_zero] using hh
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_low_order_modulus · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:239
theorem control_projection_bounds Lemma control_projection_bounds in the paper ↗

The control-regression half of the residual estimates is fully derived from class membership and the prescribed cellwise constant construction. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the control projection bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h J :
0 < h
h ≤ 1/2
1 ≤ J
sqrt (∫ x, (designatedControl P hP x- projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h)
≤ C*(h/J)^beta
Proof (Lean source)
lemma control_projection_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h J, 0 < h → h ≤ 1/2 → 1 ≤ J → sqrt (∫ x, (designatedControl P hP x- projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h) ≤ C*(h/J)^beta := by have hL : 0 ≤ L := by linarith [hdom.2.2.2.2.2.2.2.1] let C := L*(sqrt (d:ℝ))^beta+1 refine ⟨C, by dsimp [C]; positivity, ?_⟩ intro P hP h J hh hh' hJ have hmu : ControlHolder beta L (canonicalLaw P hP) := (canonicalLaw_spec P hP).2.2.2.2.2.1 have hbound : ∀ x ∈ locCube d h, |designatedControl P hP x| ≤ L := by intro x hx have hxc := locCube_subset_cube d h hh' hx have hp : ceil beta-1 = 0 := by have hc : ceil beta ≤ 1 := Nat.ceil_le.mpr (by simpa using hdom.2.2.2.2.1) omega have hs := ((holderNorm_le_iff _ beta L hL).mp hmu).2.1 (fun _ => 0) (by simp [multiOrder, hp]) x hxc simpa only [coordinatePartial_zero_index, designatedControl, if_pos hxc] using hs have hmod : ∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |designatedControl P hP x-designatedControl P hP y| ≤ L*dist x y^beta := by intro x hx y hy have hxc := locCube_subset_cube d h hh' hx have hyc := locCube_subset_cube d h hh' hy simpa only [designatedControl, if_pos hxc, if_pos hyc] using holderNorm_low_order_modulus _ beta L hdom.2.2.2.1 hdom.2.2.2.2.1 hL hmu x y hxc hyc have hr := holder_control_projection_residual d h J hh hh' hJ _ (measurable_designatedControl P hP) L L beta hL hdom.2.2.2.1.le hbound hmod exact hr.trans (mul_le_mul_of_nonneg_right (by dsimp [C]; linarith) (Real.rpow_nonneg (div_nonneg hh.le (Nat.cast_nonneg J)) _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.control_projection_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualControl.lean:256
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.ResidualPropensity 2 declarations The cell-center propensity approximant retains the entire coarse polynomial.

# Propensity times coarse-polynomial residual The cell-center propensity approximant retains the entire coarse polynomial. Hölder continuity and orthogonal best approximation give the fine-scale bound for every coarse basis entry.

theorem holder_propensity_projection_residual Lemma holder_propensity_projection_residual in the paper ↗

Multiplication by a coarse entry preserves the cell-center approximation rate. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the specified input B, the specified input K, the specified input s, the specified input hK, the specified input hs, the specified input hB, the specified input hmod, the specified input u, the holder propensity projection residual conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
B K s :
ℝ
hK :
0 ≤ K
hs :
0 ≤ s
hB :
∀ x ∈ locCube d h, |f x| ≤ B
hmod :
∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |f x-f y| ≤ K*dist x y^s
u :
sqrt (∫ x, (f x*coarseBasis h x u- projOp d h J (fun y => f y*coarseBasis h y u) x)^2 ∂locLaw d h)
≤ (K*(sqrt (d:ℝ))^s*(4:ℝ)^d)*(h/J)^s
Proof (Lean source)
lemma holder_propensity_projection_residual (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : Measurable f) (B K s : ℝ) (hK : 0 ≤ K) (hs : 0 ≤ s) (hB : ∀ x ∈ locCube d h, |f x| ≤ B) (hmod : ∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |f x-f y| ≤ K*dist x y^s) (u : PolyIdx d) : sqrt (∫ x, (f x*coarseBasis h x u- projOp d h J (fun y => f y*coarseBasis h y u) x)^2 ∂locLaw d h) ≤ (K*(sqrt (d:ℝ))^s*(4:ℝ)^d)*(h/J)^s := by classical letI := localization_probability d h hh hh' have hae : ∀ᵐ x ∂locLaw d h, x ∈ locCube d h := by unfold locLaw apply Measure.ae_smul_measure exact ae_restrict_mem (isClosed_locCube d h).measurableSet let F := fun x => f x*coarseBasis h x u have hF2 : MemLp F 2 (locLaw d h) := by apply (memLp_top_of_bound (by fun_prop) (B*(4:ℝ)^d) ?_).mono_exponent (by simp) filter_upwards [hae] with x hx simp only [F, Real.norm_eq_abs, abs_mul] calc _ ≤ |f x| *(4:ℝ)^d := mul_le_mul_of_nonneg_left (coarseBasis_abs_bound d h hh x hx u) (abs_nonneg _) _ ≤ B*(4:ℝ)^d := mul_le_mul_of_nonneg_right (hB x hx) (by positivity) let center := fun z : Fin d → Fin J => (toLp 2 (fun i => 1/2-h/2+((z i:ℝ)+1/2)*(h/J)) : Cov d) obtain ⟨v, hv⟩ := cellwise_coarse_expansion h J hh hJ u (fun z => f (center z)) let g := fun x => ∑ i, fineBasis h J x i*v i have hg : MemLp g 2 (locLaw d h) := memLp_finsetSum _ (fun i _ => (fineBasis_memLp d h J hh hh' hJ i).mul_const (v i)) have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj let E := (K*(sqrt (d:ℝ))^s*(4:ℝ)^d)*(h/J)^s have hE : 0 ≤ E := by dsimp [E]; positivity have herr : ∀ᵐ x ∂locLaw d h, |F x-g x| ≤ E := by filter_upwards [hae] with x hx obtain ⟨z, hz⟩ := localization_cell_cover h J hh hJ x hx have hc : center z ∈ cell h J z := cell_center_mem h J hh hJ z change |f x*coarseBasis h x u-g x| ≤ E rw [show g x = f (center z)*coarseBasis h x u from hv z x hz, ← sub_mul, abs_mul] calc _ ≤ (K*dist x (center z)^s)*(4:ℝ)^d := mul_le_mul (hmod x hx _ (cell_subset_locCube h J hh hJ z hc)) (coarseBasis_abs_bound d h hh x hx u) (abs_nonneg _) (by positivity) _ ≤ (K*(sqrt (d:ℝ)*(h/J))^s)*(4:ℝ)^d := by apply mul_le_mul_of_nonneg_right _ (by positivity) exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow dist_nonneg (cell_distance_bound h J hh hJ z x _ hz hc) hs) hK _ = E := by rw [Real.mul_rpow (Real.sqrt_nonneg _) ht.le]; dsimp [E]; ring have henergy : (∫ x, (F x-g x)^2 ∂locLaw d h) ≤ E^2 := by calc _ ≤ ∫ _x : Cov d, E^2 ∂locLaw d h := by apply integral_mono_ae (hF2.sub hg).integrable_sq (integrable_const _) filter_upwards [herr] with x hx change (F x-g x)^2 ≤ E^2 nlinarith [sq_abs (F x-g x), abs_nonneg (F x-g x)] _ = E^2 := by simp calc _ ≤ sqrt (∫ x, (F x-g x)^2 ∂locLaw d h) := Real.sqrt_le_sqrt (projection_best_approximation d h J hh hh' hJ F hF2 v) _ ≤ sqrt (E^2) := Real.sqrt_le_sqrt henergy _ = _ := Real.sqrt_sq hE
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holder_propensity_projection_residual · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualPropensity.lean:16
theorem propensity_projection_bounds Lemma propensity_projection_bounds in the paper ↗

Class membership supplies the propensity residual bound uniformly in the coarse entry. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the propensity projection bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h J :
0 < h
h ≤ 1/2
1 ≤ J
u :
sqrt (∫ x, (designatedPropensity P hP x*coarseBasis h x u- projOp d h J (fun y => designatedPropensity P hP y*coarseBasis h y u) x)^2 ∂locLaw d h)
≤ C*(h/J)^alpha
Proof (Lean source)
lemma propensity_projection_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h J, 0 < h → h ≤ 1/2 → 1 ≤ J → ∀ u : PolyIdx d, sqrt (∫ x, (designatedPropensity P hP x*coarseBasis h x u- projOp d h J (fun y => designatedPropensity P hP y*coarseBasis h y u) x)^2 ∂locLaw d h) ≤ C*(h/J)^alpha := by have hL : 0 ≤ L := by linarith [hdom.2.2.2.2.2.2.2.1] let C := L*(sqrt (d:ℝ))^alpha*(4:ℝ)^d+1 refine ⟨C, by dsimp [C]; positivity, ?_⟩ intro P hP h J hh hh' hJ u have he : PropensityHolder alpha L (canonicalLaw P hP) := (canonicalLaw_spec P hP).2.2.2.2.1 have hbound : ∀ x ∈ locCube d h, |designatedPropensity P hP x| ≤ L := by intro x hx have hxc := locCube_subset_cube d h hh' hx have hp : ceil alpha-1 = 0 := by have hc : ceil alpha ≤ 1 := Nat.ceil_le.mpr (by simpa using hdom.2.2.1) omega have hs := ((holderNorm_le_iff _ alpha L hL).mp he).2.1 (fun _ => 0) (by simp [multiOrder, hp]) x hxc simpa only [coordinatePartial_zero_index, designatedPropensity, if_pos hxc] using hs have hmod : ∀ x ∈ locCube d h, ∀ y ∈ locCube d h, |designatedPropensity P hP x-designatedPropensity P hP y| ≤ L*dist x y^alpha := by intro x hx y hy have hxc := locCube_subset_cube d h hh' hx have hyc := locCube_subset_cube d h hh' hy simpa only [designatedPropensity, if_pos hxc, if_pos hyc] using holderNorm_low_order_modulus _ alpha L hdom.2.1 hdom.2.2.1 hL he x y hxc hyc have hr := holder_propensity_projection_residual d h J hh hh' hJ _ (measurable_designatedPropensity P hP) L L alpha hL hdom.2.1.le hbound hmod u exact hr.trans (mul_le_mul_of_nonneg_right (by dsimp [C]; linarith) (Real.rpow_nonneg (div_nonneg hh.le (Nat.cast_nonneg J)) _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.propensity_projection_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/ResidualPropensity.lean:80
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.LocalPolynomial.Taylor 11 declarations Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Taylor constructions and obligations.

Helpers/LocalPolynomial/Taylor

Two-channel point-CATE annotation frontier: Helpers/LocalPolynomial/Taylor constructions and obligations.

theorem coordinatePartial_zero_index Lemma coordinatePartial_zero_index in the paper ↗

The zero multi-index evaluates the zeroth within-cube derivative. Given the specified input d, the specified input f, the specified input x, the coordinate partial zero index conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
x :
Cov d
coordinatePartial f (fun _ => 0) x = f x
Proof (Lean source)
lemma coordinatePartial_zero_index (d : ℕ) (f : Cov d → ℝ) (x : Cov d) : coordinatePartial f (fun _ => 0) x = f x := by have he (k : ℕ) (hk : k = 0) (v : Fin k → Cov d) : iteratedFDerivWithin ℝ k f (cube d) x v = f x := by subst k simp exact he _ (by simp [multiOrder]) _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial_zero_index · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:24

The centre belongs to the design cube in every dimension. Given the specified input d, the x0 mem cube conclusion holds.

Formal statement
d :
ℕ
x0 d ∈ cube d
Proof (Lean source)
lemma x0_mem_cube (d : ℕ) : x0 d ∈ cube d := by intro i norm_num [x0]
theorem tau_eq_canonicalContrast Lemma tau_eq_canonicalContrast in the paper ↗

The canonical contrast agrees with its admissible raw version on the cube. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input x, the specified input hx, the tau eq canonical contrast conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
x :
Cov d
hx :
x ∈ cube d
tau P hP x = rawContrast (canonicalLaw P hP) x
Proof (Lean source)
lemma tau_eq_canonicalContrast {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (x : Cov d) (hx : x ∈ cube d) : tau P hP x = rawContrast (canonicalLaw P hP) x := by simp [tau, designatedTreated, designatedControl, hx, rawContrast]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tau_eq_canonicalContrast · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:38
theorem tau_lipschitz_gamma_one Lemma tau_lipschitz_gamma_one in the paper ↗

A first-order Hölder norm bounds the contrast's Lipschitz modulus on the cube. Given the specified input d, the specified input alpha, the specified input beta, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hL, the specified input x, the specified input y, the specified input hx, the specified input hy, the tau lipschitz gamma one conclusion holds.

Formal statement
d :
ℕ
alpha beta L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta 1 L eps P
hL :
0 ≤ L
x y :
Cov d
hx :
x ∈ cube d
hy :
y ∈ cube d
|tau P hP x-tau P hP y| ≤ L*dist x y
Proof (Lean source)
lemma tau_lipschitz_gamma_one {d : ℕ} {alpha beta L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta 1 L eps P) (hL : 0 ≤ L) (x y : Cov d) (hx : x ∈ cube d) (hy : y ∈ cube d) : |tau P hP x-tau P hP y| ≤ L*dist x y := by have hh := (holderNorm_le_iff (rawContrast (canonicalLaw P hP)) 1 L hL).mp (canonicalLaw_spec P hP).2.2.2.2.2.2.1 by_cases he : x = y · subst y simp · have hm := hh.2.2 (fun _ => 0) (by simp [multiOrder]) x hx y hy he simpa [coordinatePartial_zero_index, tau_eq_canonicalContrast P hP x hx, tau_eq_canonicalContrast P hP y hy] using hm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tau_lipschitz_gamma_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:45
theorem locCube_distance_center_bound Lemma locCube_distance_center_bound in the paper ↗

A localization window has radius at most its side times the square root of dimension. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the loc cube distance center bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
dist x (x0 d) ≤ sqrt (d:ℝ)*h
Proof (Lean source)
lemma locCube_distance_center_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) : dist x (x0 d) ≤ sqrt (d:ℝ)*h := by have hs : (∑ i : Fin d, dist (x i) (x0 d i)^2) ≤ (d:ℝ)*h^2 := by calc _ ≤ ∑ _i : Fin d, h^2 := by apply Finset.sum_le_sum intro i _ have hi := hx i have hb : |x i-1/2| ≤ h := by rw [abs_le] constructor <;> linarith [hi.1, hi.2] simp only [x0, WithLp.ofLp_toLp, Real.dist_eq] nlinarith [abs_nonneg (x i-1/2), sq_abs (x i-1/2)] _ = _ := by simp rw [EuclideanSpace.dist_eq] calc _ ≤ sqrt ((d:ℝ)*h^2) := Real.sqrt_le_sqrt hs _ = _ := by rw [Real.sqrt_mul (Nat.cast_nonneg d), Real.sqrt_sq hh.le]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locCube_distance_center_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:59

The only multi-index of total order zero is the zero index. Given the specified input d, the poly idx order zero iff conclusion holds.

Formal statement
d :
ℕ
κ :
multiOrder κ.1 ≤ 0 ↔ κ = ⟨fun _ => 0, by simp⟩
Proof (Lean source)
lemma polyIdx_order_zero_iff {d : ℕ} (κ : PolyIdx d) : multiOrder κ.1 ≤ 0 ↔ κ = ⟨fun _ => 0, by simp⟩ := by constructor · intro hk apply Subtype.ext funext i have hi := Finset.single_le_sum (fun j _ => zero_le (κ.1 j)) (Finset.mem_univ i) change κ.1 i = 0 unfold multiOrder at hk omega · rintro rfl simp [multiOrder]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.polyIdx_order_zero_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:80

The degree-zero Taylor polynomial is the function's value at the centre. Given the specified input d, the specified input f, the specified input x, the taylor poly zero degree conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
x :
Cov d
taylorPoly f 0 x = f (x0 d)
Proof (Lean source)
lemma taylorPoly_zero_degree {d : ℕ} (f : Cov d → ℝ) (x : Cov d) : taylorPoly f 0 x = f (x0 d) := by classical let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ have hfilter : Finset.univ.filter (fun κ : PolyIdx d => multiOrder κ.1 ≤ 0) = {z} := by ext κ simp only [mem_filter, Finset.mem_univ, true_and, Finset.mem_singleton] exact polyIdx_order_zero_iff κ rw [taylorPoly, hfilter, Finset.sum_singleton] simp [z, coordinatePartial_zero_index]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.taylorPoly_zero_degree · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:95
theorem pv_constant_coefficient Lemma pv_constant_coefficient in the paper ↗

A single constant-basis coefficient represents a constant polynomial. Given the specified input d, the specified input h, the specified input c, the specified input x, the pv constant coefficient conclusion holds.

Formal statement
d :
ℕ
h c :
ℝ
x :
Cov d
pv h (single (⟨fun _ => 0, by simp⟩ : PolyIdx d) c) x = c
Proof (Lean source)
lemma pv_constant_coefficient {d : ℕ} (h c : ℝ) (x : Cov d) : pv h (single (⟨fun _ => 0, by simp⟩ : PolyIdx d) c) x = c := by simp [pv, Pi.single_apply, coarseBasis, legendre]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.pv_constant_coefficient · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:107
theorem taylor_coefficient_bounds_gamma_one Lemma taylor_coefficient_bounds_gamma_one in the paper ↗

At smoothness one, the prescribed Taylor construction is the constant centre value. Given the specified input d, the specified input alpha, the specified input beta, the specified input L, the overlap level eps, the specified input hdom, the taylor coefficient bounds gamma one conclusion holds.

Formal statement
d :
ℕ
alpha beta L eps :
ℝ
hdom :
PublicDomain d alpha beta 1 L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta 1 L eps P
h :
0 < h
h ≤ 1/2
∃ theta : PolyIdx d → ℝ,
x ∈ locCube d h :
|tau P hP x-pv h theta x| ≤ C*h^(1:ℝ)
sqrt (∑ u, theta u^2) ≤ C
pv h theta (x0 d) = tau P hP (x0 d)
x ∈ locCube d h :
pv h theta x = taylorPoly (tau P hP) (ceil (1:ℝ)-1) x
Proof (Lean source)
lemma taylor_coefficient_bounds_gamma_one (d : ℕ) (alpha beta L eps : ℝ) (hdom : PublicDomain d alpha beta 1 L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta 1 L eps P), ∀ h, 0 < h → h ≤ 1/2 → ∃ theta : PolyIdx d → ℝ, (∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ C*h^(1:ℝ)) ∧ sqrt (∑ u, theta u^2) ≤ C ∧ pv h theta (x0 d) = tau P hP (x0 d) ∧ (∀ x ∈ locCube d h, pv h theta x = taylorPoly (tau P hP) (ceil (1:ℝ)-1) x) := by have hL : 0 < L := by have := hdom.2.2.2.2.2.2.2.1; linarith let C := L*(sqrt (d:ℝ)+1) have hLC : L ≤ C := by dsimp [C]; nlinarith [Real.sqrt_nonneg (d:ℝ)] refine ⟨C, hL.trans_le hLC, ?_⟩ intro P hP h hh hh' let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ let theta : PolyIdx d → ℝ := single z (tau P hP (x0 d)) have hp (x : Cov d) : pv h theta x = tau P hP (x0 d) := pv_constant_coefficient h _ x have htarget : |tau P hP (x0 d)| ≤ L := by have hb := (holderNorm_le_iff (rawContrast (canonicalLaw P hP)) 1 L hL.le).mp (canonicalLaw_spec P hP).2.2.2.2.2.2.1 have ht := hb.2.1 (fun _ => 0) (by simp [multiOrder]) (x0 d) (x0_mem_cube d) simpa [coordinatePartial_zero_index, tau_eq_canonicalContrast P hP (x0 d) (x0_mem_cube d)] using ht refine ⟨theta, ?_, ?_, hp _, ?_⟩ · intro x hx have hxc : x ∈ cube d := by intro i have hi := hx i constructor <;> linarith [hi.1, hi.2] rw [hp, Real.rpow_one] calc _ ≤ L*dist x (x0 d) := tau_lipschitz_gamma_one P hP hL.le x _ hxc (x0_mem_cube d) _ ≤ L*(sqrt (d:ℝ)*h) := mul_le_mul_of_nonneg_left (locCube_distance_center_bound d h hh x hx) hL.le _ ≤ C*h := by dsimp [C]; nlinarith · have hs : (∑ u, theta u^2) = (tau P hP (x0 d))^2 := by simp [theta, Pi.single_apply] rw [hs, Real.sqrt_sq_eq_abs] exact htarget.trans hLC · intro x hx rw [hp] norm_num [taylorPoly_zero_degree]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.taylor_coefficient_bounds_gamma_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:384
theorem taylor_coefficient_bounds Lemma taylor_coefficient_bounds in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the taylor coefficient bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
0 < h
h ≤ 1/2
∃ theta : PolyIdx d → ℝ,
x ∈ locCube d h :
|tau P hP x-pv h theta x| ≤ C*h^gamma
sqrt (∑ u, theta u^2) ≤ C
pv h theta (x0 d) = tau P hP (x0 d)
x ∈ locCube d h :
pv h theta x = taylorPoly (tau P hP) (ceil gamma-1) x
Proof (Lean source)
lemma taylor_coefficient_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h, 0 < h → h ≤ 1/2 → ∃ theta : PolyIdx d → ℝ, (∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ C*h^gamma) ∧ sqrt (∑ u, theta u^2) ≤ C ∧ pv h theta (x0 d) = tau P hP (x0 d) ∧ (∀ x ∈ locCube d h, pv h theta x = taylorPoly (tau P hP) (Nat.ceil gamma-1) x) := by by_cases hg : gamma = 1 · subst gamma exact taylor_coefficient_bounds_gamma_one d alpha beta L eps hdom · let m := Nat.ceil gamma - 1 let s := gamma - m have hgamma : 1 ≤ gamma := hdom.2.2.2.2.2.1 have hgamma3 : gamma ≤ 3 := hdom.2.2.2.2.2.2.1 have hL : 0 < L := by linarith [hdom.2.2.2.2.2.2.2.1] have hgamma1 : 1 < gamma := lt_of_le_of_ne hgamma (Ne.symm hg) have hceil1 : 1 < Nat.ceil gamma := by have hc : gamma ≤ (Nat.ceil gamma : ℝ) := Nat.le_ceil gamma by_contra hn have hn' : Nat.ceil gamma ≤ 1 := by omega have hnR : (Nat.ceil gamma : ℝ) ≤ 1 := by exact_mod_cast hn' linarith have hceil3 : Nat.ceil gamma ≤ 3 := Nat.ceil_le.mpr (by norm_num; exact hgamma3) have hm : m ≤ 2 := by dsimp [m]; omega have hmcast : (m : ℝ) = (Nat.ceil gamma : ℝ) - 1 := by dsimp [m] rw [Nat.cast_sub hceil1.le] norm_num have hs : 0 < s := by dsimp [s] rw [hmcast] linarith [Nat.ceil_lt_add_one (by linarith : 0 ≤ gamma)] have hs1 : s ≤ 1 := by dsimp [s] rw [hmcast] linarith [Nat.le_ceil gamma] have hms : (m : ℝ) + s = gamma := by dsimp [s]; ring obtain ⟨C0, hC0, hC0spec⟩ := euclidean_multiindex_taylor_legendre_adapter d m hm refine ⟨C0 * L, mul_pos hC0 hL, ?_⟩ intro P hP h hh hhhalf let g := rawContrast (canonicalLaw P hP) have heq : EqOn (tau P hP) g (cube d) := by intro x hx exact tau_eq_canonicalContrast P hP x hx have hgdata := (holderNorm_le_iff g gamma L hL.le).mp (canonicalLaw_spec P hP).2.2.2.2.2.2.1 have hu : ContDiffOn ℝ m (tau P hP) (cube d) := by apply (hgdata.1.congr heq).of_le rfl have hderiv : ∀ κ : GenericIndex d m, ∀ x ∈ cube d, |coordinatePartial (cube d) (tau P hP) κ.1 x| ≤ L := by intro κ x hx rw [← coordinatePartial_eq_sorted (tau P hP) hu κ.1 (by simpa only [multiOrder, multiOrder] using κ.2) x hx, coordinatePartial_congr heq κ.1 x hx] exact hgdata.2.1 κ.1 (by simpa only [multiOrder, multiOrder] using κ.2) x hx have hmod : ∀ κ : ExactIndex d m, ∀ x ∈ cube d, ∀ z ∈ cube d, |coordinatePartial (cube d) (tau P hP) κ.1 x - coordinatePartial (cube d) (tau P hP) κ.1 z| ≤ L * ‖x - z‖ ^ s := by intro κ x hx z hz rw [← coordinatePartial_eq_sorted (tau P hP) hu κ.1 (by simpa only [multiOrder, multiOrder] using κ.2.le) x hx, ← coordinatePartial_eq_sorted (tau P hP) hu κ.1 (by simpa only [multiOrder, multiOrder] using κ.2.le) z hz, coordinatePartial_congr heq κ.1 x hx, coordinatePartial_congr heq κ.1 z hz] by_cases hxz : x = z · subst z simp only [sub_self, norm_zero, abs_zero] exact mul_nonneg hL.le (Real.rpow_nonneg (by norm_num) _) · simpa [s, dist_eq_norm] using hgdata.2.2 κ.1 (by simpa only [multiOrder, multiOrder] using κ.2) x hx z hz hxz have hloc : locCube d h = centeredCube (x0 d) h := by ext x simp only [locCube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith have hsub : centeredCube (x0 d) h ⊆ centeredCube (x0 d) 1 := by rw [← hloc, ← show cube d = centeredCube (x0 d) 1 by ext x simp only [cube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith] intro x hx i have hi := hx i constructor <;> linarith [hi.1, hi.2] have hcube : cube d = centeredCube (x0 d) 1 := by ext x simp only [cube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith obtain ⟨θ, _hθ, hpoly, hrem, hnorm, hcenter⟩ := hC0spec (x0 d) (x0 d) 1 h L s (tau P hP) (by norm_num) hh hhhalf hL.le hs hs1 (by simpa [← hcube] using hu) (by simpa [← hcube] using hderiv) (by simpa [← hcube] using hmod) (center_mem_interior_cube (x0 d) 1 (by norm_num)) hsub let theta := extendCoefficients hm θ refine ⟨theta, ?_, ?_, ?_, ?_⟩ · intro x hx rw [pv_extendCoefficients hm h θ x] have hx' : x ∈ centeredCube (x0 d) h := by rw [← hloc] exact hx simpa only [theta, hms, mul_assoc] using hrem x hx' · rw [sum_sq_extendCoefficients hm θ] simpa only [theta, mul_assoc] using hnorm · rw [pv_extendCoefficients hm h θ (x0 d)] exact hcenter · intro x hx rw [pv_extendCoefficients hm h θ x, hpoly x] simpa only [hcube, m] using (taylorPoly_eq_multiindexTaylor hm (tau P hP) hu x).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.taylor_coefficient_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:428
theorem oracle_taylor_approximation Lemma oracle_taylor_approximation in the paper ↗

Taylor approximation and center reproduction on every oracle window contained in the design cube. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle taylor approximation conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
0 < h
h ≤ 1
∃ theta : PolyIdx d → ℝ,
x ∈ locCube d h :
|tau P hP x-pv h theta x| ≤ C*h^gamma
pv h theta (x0 d) = tau P hP (x0 d)
x ∈ locCube d h :
pv h theta x = taylorPoly (tau P hP) (ceil gamma-1) x
Proof (Lean source)
lemma oracle_taylor_approximation (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ h, 0 < h → h ≤ 1 → ∃ theta : PolyIdx d → ℝ, (∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ C*h^gamma) ∧ pv h theta (x0 d) = tau P hP (x0 d) ∧ (∀ x ∈ locCube d h, pv h theta x = taylorPoly (tau P hP) (Nat.ceil gamma-1) x) := by by_cases hg : gamma = 1 · subst gamma have hL : 0 < L := by linarith [hdom.2.2.2.2.2.2.2.1] refine ⟨L*(sqrt (d:ℝ)+1), by positivity, ?_⟩ intro P hP h hh hh' let theta : PolyIdx d → ℝ := single ⟨fun _ => 0, by simp⟩ (tau P hP (x0 d)) have hp (x : Cov d) : pv h theta x = tau P hP (x0 d) := pv_constant_coefficient h _ x refine ⟨theta, ?_, hp _, ?_⟩ · intro x hx have hxc : x ∈ cube d := by intro i constructor <;> linarith [(hx i).1, (hx i).2] rw [hp, Real.rpow_one] calc _ ≤ L*dist x (x0 d) := tau_lipschitz_gamma_one P hP hL.le x _ hxc (x0_mem_cube d) _ ≤ L*(sqrt (d:ℝ)*h) := mul_le_mul_of_nonneg_left (locCube_distance_center_bound d h hh x hx) hL.le _ ≤ _ := by nlinarith [Real.sqrt_nonneg (d:ℝ)] · intro x hx rw [hp] norm_num [taylorPoly_zero_degree] · let m := Nat.ceil gamma - 1 let s := gamma - m have hgamma : 1 ≤ gamma := hdom.2.2.2.2.2.1 have hgamma3 : gamma ≤ 3 := hdom.2.2.2.2.2.2.1 have hL : 0 < L := by linarith [hdom.2.2.2.2.2.2.2.1] have hgamma1 : 1 < gamma := lt_of_le_of_ne hgamma (Ne.symm hg) have hceil1 : 1 < Nat.ceil gamma := by have hc : gamma ≤ (Nat.ceil gamma : ℝ) := Nat.le_ceil gamma by_contra hn have hn' : Nat.ceil gamma ≤ 1 := by omega have hnR : (Nat.ceil gamma : ℝ) ≤ 1 := by exact_mod_cast hn' linarith have hceil3 : Nat.ceil gamma ≤ 3 := Nat.ceil_le.mpr (by norm_num; exact hgamma3) have hm : m ≤ 2 := by dsimp [m]; omega have hmcast : (m : ℝ) = (Nat.ceil gamma : ℝ) - 1 := by dsimp [m] rw [Nat.cast_sub hceil1.le] norm_num have hs : 0 < s := by dsimp [s] rw [hmcast] linarith [Nat.ceil_lt_add_one (by linarith : 0 ≤ gamma)] have hs1 : s ≤ 1 := by dsimp [s] rw [hmcast] linarith [Nat.le_ceil gamma] have hms : (m : ℝ) + s = gamma := by dsimp [s]; ring obtain ⟨C0, hC0, hC0spec⟩ := local_cube_multiindex_remainder d m refine ⟨C0 * L, mul_pos hC0 hL, ?_⟩ intro P hP h hh hhhalf let g := rawContrast (canonicalLaw P hP) have heq : EqOn (tau P hP) g (cube d) := by intro x hx exact tau_eq_canonicalContrast P hP x hx have hgdata := (holderNorm_le_iff g gamma L hL.le).mp (canonicalLaw_spec P hP).2.2.2.2.2.2.1 have hu : ContDiffOn ℝ m (tau P hP) (cube d) := by apply (hgdata.1.congr heq).of_le rfl have hmod : ∀ κ : ExactIndex d m, ∀ x ∈ cube d, ∀ z ∈ cube d, |coordinatePartial (cube d) (tau P hP) κ.1 x - coordinatePartial (cube d) (tau P hP) κ.1 z| ≤ L * ‖x - z‖ ^ s := by intro κ x hx z hz rw [← coordinatePartial_eq_sorted (tau P hP) hu κ.1 (by simpa only [multiOrder, multiOrder] using κ.2.le) x hx, ← coordinatePartial_eq_sorted (tau P hP) hu κ.1 (by simpa only [multiOrder, multiOrder] using κ.2.le) z hz, coordinatePartial_congr heq κ.1 x hx, coordinatePartial_congr heq κ.1 z hz] by_cases hxz : x = z · subst z simp only [sub_self, norm_zero, abs_zero] exact mul_nonneg hL.le (Real.rpow_nonneg (by norm_num) _) · simpa [s, dist_eq_norm] using hgdata.2.2 κ.1 (by simpa only [multiOrder, multiOrder] using κ.2) x hx z hz hxz have hloc : locCube d h = centeredCube (x0 d) h := by ext x simp only [locCube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith have hsub : centeredCube (x0 d) h ⊆ centeredCube (x0 d) 1 := by rw [← hloc, ← show cube d = centeredCube (x0 d) 1 by ext x simp only [cube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith] intro x hx i have hi := hx i constructor <;> linarith [hi.1, hi.2] have hcube : cube d = centeredCube (x0 d) 1 := by ext x simp only [cube, centeredCube, Set.mem_ofPred_eq, x0, WithLp.ofLp_toLp] constructor · intro hx i rw [abs_le] constructor <;> linarith [(hx i).1, (hx i).2] · intro hx i have hi := abs_le.mp (hx i) constructor <;> linarith let θ := taylorLegendreCoefficients (cube d) (tau P hP) m (x0 d) h have hpoly (x : Cov d) : legendrePolynomial (x0 d) h θ x = multiindexTaylor (cube d) (tau P hP) m (x0 d) x := taylorLegendreCoefficients_realize hm _ _ _ _ h hh have hrem := hC0spec (x0 d) (x0 d) 1 h L s (tau P hP) (by norm_num) hh hL.le hs hs1 (by simpa [← hcube] using hu) (by simpa [← hcube] using hmod) (center_mem_interior_cube (x0 d) 1 (by norm_num)) hsub let theta := extendCoefficients hm θ refine ⟨theta, ?_, ?_, ?_⟩ · intro x hx rw [pv_extendCoefficients hm h θ x] have hx' : x ∈ centeredCube (x0 d) h := by rw [← hloc] exact hx rw [hpoly] simpa only [hcube, theta, hms, mul_assoc] using hrem x hx' · rw [pv_extendCoefficients hm h θ (x0 d)] rw [hpoly] exact multiindexTaylor_center _ _ _ _ · intro x hx rw [pv_extendCoefficients hm h θ x, hpoly x] simpa only [hcube, m] using (taylorPoly_eq_multiindexTaylor hm (tau P hP) hu x).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_taylor_approximation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/LocalPolynomial/Taylor.lean:585
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.OracleMean 11 declarations Bounded inverse-propensity tests identify the conditional effect, and uniform design transports the oracle evaluation kernel to its local projection mean.

# Oracle response identification Bounded inverse-propensity tests identify the conditional effect, and uniform design transports the oracle evaluation kernel to its local projection mean.

theorem oracle_inverse_test_bound Lemma oracle_inverse_test_bound in the paper ↗

Overlap bounds both inverse-propensity test functions on their cube support. Given the specified input d, the specified input P, the specified input he, the specified input f, the specified input B, the specified input hB, the specified input hf, the specified input hs, the overlap level eps, the oracle inverse test bound conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
he :
Overlap eps P
f :
Cov d → ℝ
B :
ℝ
hB :
0 ≤ B
hf :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
conclusion 1
x :
‖f x / P.e x‖ ≤ eps⁻¹*B
conclusion 2
x :
‖f x / (1-P.e x)‖ ≤ eps⁻¹*B
Proof (Lean source)
lemma oracle_inverse_test_bound {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (he : Overlap eps P) (f : Cov d → ℝ) (B : ℝ) (hB : 0 ≤ B) (hf : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : (∀ x, ‖f x / P.e x‖ ≤ eps⁻¹*B) ∧ (∀ x, ‖f x / (1-P.e x)‖ ≤ eps⁻¹*B) := by have heps : 0 < eps := he.1 have hdiv (x : Cov d) (q : ℝ) (hq : eps ≤ q) : ‖f x / q‖ ≤ eps⁻¹*B := by have hq0 : 0 < q := by linarith rw [norm_div, Real.norm_eq_abs q, abs_of_pos hq0] apply (div_le_iff₀ hq0).2 have h1 : 1 ≤ eps⁻¹ * q := by rw [← div_eq_inv_mul, le_div_iff₀ heps]; linarith calc ‖f x‖ ≤ B := hf x _ = 1 * B := (one_mul B).symm _ ≤ (eps⁻¹ * q) * B := mul_le_mul_of_nonneg_right h1 hB _ = _ := by ring have hepsi : 0 ≤ eps⁻¹ * B := mul_nonneg (inv_nonneg.mpr heps.le) hB constructor <;> intro x <;> by_cases hx : x ∈ cube d · exact hdiv x _ (he.2 x hx).1 · simp [hs x hx, hepsi] · exact hdiv x _ (by linarith [(he.2 x hx).2]) · simp [hs x hx, hepsi]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_inverse_test_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:16
theorem oracle_response_test_mean Lemma oracle_response_test_mean in the paper ↗

The supplied inverse-propensity response has effect mean against every bounded cube-supported Borel test, by cancellation in the two identified arm moments. Given the specified input d, the specified input P, the specified input hdesign, the specified input hex, the specified input he, the specified input hm0, the specified input hm1, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the specified input hs, the overlap level eps, the oracle response test mean conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
he :
Overlap eps P
hm0 :
hm1 :
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
(∫ w, f w.1 * (bit w.2.1 * bit w.2.2 / P.e w.1 - (1-bit w.2.1)*bit w.2.2 / (1-P.e w.1)) ∂obsLaw P)
= ∫ x, f x * (P.mu1 x-P.mu0 x) ∂uniformLaw d
Proof (Lean source)
lemma oracle_response_test_mean {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hex : ConditionalExchangeability P) (he : Overlap eps P) (hm0 : ControlInterior P) (hm1 : TreatedInterior P) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : (∫ w, f w.1 * (bit w.2.1 * bit w.2.2 / P.e w.1 - (1-bit w.2.1)*bit w.2.2 / (1-P.e w.1)) ∂obsLaw P) = ∫ x, f x * (P.mu1 x-P.mu0 x) ∂uniformLaw d := by letI := obsLaw_probability P have hPe := P.measurable_e have hb := oracle_inverse_test_bound P he f B hB hfB hs have heps : 0 < eps := he.1 have hbits (a y : Bool) : ‖bit a * bit y‖ ≤ 1 ∧ ‖(1-bit a)*bit y‖ ≤ 1 := by cases a <;> cases y <;> norm_num [bit] have hi : Integrable (fun w : Cov d × Bool × Bool => (f w.1/P.e w.1)*bit w.2.1*bit w.2.2) (obsLaw P) := by apply population_integrable_bounded _ _ (by fun_prop) (eps⁻¹*B) intro w rw [mul_assoc, norm_mul] exact (mul_le_mul_of_nonneg_left (hbits _ _).1 (norm_nonneg _)).trans (by simpa using hb.1 w.1) have hj : Integrable (fun w : Cov d × Bool × Bool => (f w.1/(1-P.e w.1))*(1-bit w.2.1)*bit w.2.2) (obsLaw P) := by apply population_integrable_bounded _ _ (by fun_prop) (eps⁻¹*B) intro w rw [mul_assoc, norm_mul] exact (mul_le_mul_of_nonneg_left (hbits _ _).2 (norm_nonneg _)).trans (by simpa using hb.2 w.1) have ht := population_treated_outcome_moment P hdesign hex he hm1 (fun x => f x/P.e x) (by fun_prop) (eps⁻¹*B) (by positivity) hb.1 (by intro x hx; simp [hs x hx]) have hc := population_control_outcome_moment P hdesign hex he hm0 (fun x => f x/(1-P.e x)) (by fun_prop) (eps⁻¹*B) (by positivity) hb.2 (by intro x hx; simp [hs x hx]) have hut : (∫ x, (f x/P.e x)*P.e x*P.mu1 x ∂uniformLaw d) = ∫ x, f x*P.mu1 x ∂uniformLaw d := by apply integral_congr_ae filter_upwards [ae_restrict_mem (show MeasurableSet (cube d) from by unfold cube; simp only [setOf_forall]; exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop)))] with x hx rw [div_mul_cancel₀ _ (by linarith [(he.2 x hx).1, he.1] : P.e x ≠ 0)] have huc : (∫ x, (f x/(1-P.e x))*(1-P.e x)*P.mu0 x ∂uniformLaw d) = ∫ x, f x*P.mu0 x ∂uniformLaw d := by apply integral_congr_ae filter_upwards [ae_restrict_mem (show MeasurableSet (cube d) from by unfold cube; simp only [setOf_forall]; exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop)))] with x hx rw [div_mul_cancel₀ _ (by linarith [(he.2 x hx).2, he.1] : 1-P.e x ≠ 0)] have hu : IsProbabilityMeasure (uniformLaw d) := by rw [← hdesign]; exact Measure.isProbabilityMeasure_map (by fun_prop) letI := hu have hmu (g : Cov d → ℝ) (hg : Measurable g) (hgB : ∀ x ∈ cube d, g x ∈ Icc 0 1) : Integrable (fun x => f x*g x) (uniformLaw d) := by apply population_integrable_bounded _ _ (by fun_prop) B intro x by_cases hx : x ∈ cube d · rw [norm_mul, Real.norm_eq_abs (g x), abs_of_nonneg (hgB x hx).1] exact (mul_le_of_le_one_right (norm_nonneg _) (hgB x hx).2).trans (hfB x) · simp [hs x hx, hB] have hiu := hmu P.mu1 P.measurable_mu1 (by intro x hx; constructor <;> linarith [(hm1 x hx).1, (hm1 x hx).2]) have hju := hmu P.mu0 P.measurable_mu0 (by intro x hx; constructor <;> linarith [(hm0 x hx).1, (hm0 x hx).2]) have heq : (fun w : Cov d × Bool × Bool => f w.1 * (bit w.2.1 * bit w.2.2 / P.e w.1 - (1-bit w.2.1)*bit w.2.2/(1-P.e w.1))) = fun w => (f w.1/P.e w.1)*bit w.2.1*bit w.2.2 - (f w.1/(1-P.e w.1))*(1-bit w.2.1)*bit w.2.2 := by funext w; ring rw [heq, integral_sub hi hj, ht, hc, hut, huc, ← integral_sub hiu hju] apply integral_congr_ae filter_upwards [] with x ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_response_test_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:40

The oracle kernel's record expectation is the known-design local projection of the canonical effect, throughout the full admissible oracle bandwidth range. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the oracle summand mean conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
(∫ w, locWeight h w.1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h w.1 u) * (bit w.2.1 * bit w.2.2 / designatedPropensity P hP w.1 - (1-bit w.2.1)*bit w.2.2 / (1-designatedPropensity P hP w.1))) ∂obsLaw P)
= ∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h
Proof (Lean source)
lemma oracle_summand_mean {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) : (∫ w, locWeight h w.1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h w.1 u) * (bit w.2.1 * bit w.2.2 / designatedPropensity P hP w.1 - (1-bit w.2.1)*bit w.2.2 / (1-designatedPropensity P hP w.1))) ∂obsLaw P) = ∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h := by let K := fun x : Cov d => ∑ u : PolyIdx d, r0 d h u * coarseBasis h x u let F := fun x : Cov d => locWeight h x * K x have hs := canonicalLaw_spec P hP have hobs : obsLaw P = obsLaw (canonicalLaw P hP) := by unfold obsLaw; rw [hs.1] have hFB : ∀ x, ‖F x‖ ≤ h^(-(d:ℝ))* ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) := by apply locWeight_mul_norm_bound h hh K _ (by positivity) intro x hx simpa only [Real.norm_eq_abs] using oracle_evaluation_kernel_bound d h hh x hx have hFs : ∀ x, x ∉ cube d → F x = 0 := by intro x hx have hn : x ∉ locCube d h := fun hl => hx (oracle_locCube_subset_cube d h hh' hl) simp [F, locWeight, hn] have hm := oracle_response_test_mean (canonicalLaw P hP) hs.2.1 hs.2.2.1 hs.2.2.2.1 hs.2.2.2.2.2.2.2.1 hs.2.2.2.2.2.2.2.2 F (by dsimp [F, K]; fun_prop) _ (by positivity) hFB hFs calc _ = ∫ w, F w.1 * (bit w.2.1 * bit w.2.2 / (canonicalLaw P hP).e w.1 - (1-bit w.2.1)*bit w.2.2 / (1-(canonicalLaw P hP).e w.1)) ∂obsLaw (canonicalLaw P hP) := by rw [hobs] apply integral_congr_ae filter_upwards [] with w by_cases hx : w.1 ∈ locCube d h · simp only [designatedPropensity, if_pos (oracle_locCube_subset_cube d h hh' hx), F, K] ring · simp [F, locWeight, hx] _ = ∫ x, K x * ((canonicalLaw P hP).mu1 x-(canonicalLaw P hP).mu0 x) ∂locLaw d h := by rw [hm] dsimp only [F] simp only [mul_assoc] exact oracle_uniform_localization_integral d h hh hh' _ _ = _ := by apply integral_congr_ae unfold locLaw apply Measure.ae_smul_measure filter_upwards [ae_restrict_mem (isClosed_locCube d h).measurableSet] with x hx simp only [tau, designatedTreated, designatedControl, if_pos (oracle_locCube_subset_cube d h hh' hx), K]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_summand_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:110
theorem oracle_localization_probability Lemma oracle_localization_probability in the paper ↗

Full-window coarse orthonormality normalizes the oracle localization law. Given the specified input d, the specified input h, the specified input hh, the oracle localization probability conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
Proof (Lean source)
lemma oracle_localization_probability (d : ℕ) (h : ℝ) (hh : 0 < h) : IsProbabilityMeasure (locLaw d h) := by let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ have ho := oracle_coarse_orthonormal d h hh z z simp only [z, coarseBasis, legendre, ite_true, Finset.prod_const_one, one_mul] at ho apply isProbabilityMeasure_iff_real.mpr simpa only [integral_const, smul_eq_mul, mul_one] using ho
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_localization_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:163
theorem oracle_polynomial_reproduction Lemma oracle_polynomial_reproduction in the paper ↗

The oracle evaluation kernel reproduces every coarse polynomial at the target. Given the specified input d, the specified input h, the specified input hh, the specified input theta, the oracle polynomial reproduction conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
theta :
PolyIdx d → ℝ
(∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * pv h theta x ∂locLaw d h)
= pv h theta (x0 d)
Proof (Lean source)
lemma oracle_polynomial_reproduction (d : ℕ) (h : ℝ) (hh : 0 < h) (theta : PolyIdx d → ℝ) : (∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * pv h theta x ∂locLaw d h) = pv h theta (x0 d) := by have hi (u v : PolyIdx d) : Integrable (fun x => (r0 d h u * coarseBasis h x u) * (coarseBasis h x v * theta v)) (locLaw d h) := by convert ((oracle_coarseBasis_memLp d h hh u).integrable_mul (oracle_coarseBasis_memLp d h hh v)).const_mul (r0 d h u * theta v) using 1 ext x; simp only [Pi.mul_apply]; ring simp only [pv, Finset.mul_sum, Finset.sum_mul] rw [integral_finsetSum _ (fun v _ => integrable_finsetSum _ (fun u _ => hi u v))] simp_rw [integral_finsetSum _ (fun u _ => hi u _)] simp_rw [show ∀ (u v : PolyIdx d) x, (r0 d h u * coarseBasis h x u) * (coarseBasis h x v * theta v) = (r0 d h u * theta v) * (coarseBasis h x u * coarseBasis h x v) by intros; ring] simp_rw [integral_const_mul, oracle_coarse_orthonormal d h hh] simp [r0]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_polynomial_reproduction · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:172
theorem oracle_projection_bias_bound Lemma oracle_projection_bias_bound in the paper ↗

Polynomial reproduction converts a uniform approximation remainder into an oracle mean bias bound, with the explicit finite-dimensional kernel constant. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input theta, the specified input B, the specified input hB, the specified input herr, the specified input htarget, the oracle projection bias bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
theta :
PolyIdx d → ℝ
B :
ℝ
hB :
0 ≤ B
herr :
∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ B
htarget :
pv h theta (x0 d) = tau P hP (x0 d)
|(∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h)
- tau P hP (x0 d)|
≤ ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) * B
Proof (Lean source)
lemma oracle_projection_bias_bound {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (theta : PolyIdx d → ℝ) (B : ℝ) (hB : 0 ≤ B) (herr : ∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ B) (htarget : pv h theta (x0 d) = tau P hP (x0 d)) : |(∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h) - tau P hP (x0 d)| ≤ ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) * B := by letI := oracle_localization_probability d h hh let K := fun x : Cov d => ∑ u : PolyIdx d, r0 d h u * coarseBasis h x u have hae : ∀ᵐ x ∂locLaw d h, x ∈ locCube d h := by unfold locLaw; apply Measure.ae_smul_measure exact ae_restrict_mem (isClosed_locCube d h).measurableSet have hk : MemLp K 2 (locLaw d h) := memLp_finsetSum _ (fun u _ => (oracle_coarseBasis_memLp d h hh u).const_mul _) have hp : MemLp (pv h theta) 2 (locLaw d h) := by unfold pv exact memLp_finsetSum _ (fun u _ => (oracle_coarseBasis_memLp d h hh u).mul_const _) have he : MemLp (fun x => tau P hP x-pv h theta x) 2 (locLaw d h) := by apply (memLp_top_of_bound ((measurable_tau P hP).sub (by unfold pv; fun_prop)).aestronglyMeasurable B ?_).mono_exponent (by simp) filter_upwards [hae] with x hx simpa only [Real.norm_eq_abs, Pi.sub_apply] using herr x hx have ht : MemLp (tau P hP) 2 (locLaw d h) := by convert he.add hp using 1 ext x; simp rw [← htarget, ← oracle_polynomial_reproduction d h hh theta, ← integral_sub (f := fun x => K x*tau P hP x) (g := fun x => K x*pv h theta x) (hk.integrable_mul ht) (hk.integrable_mul hp)] have hr : (fun x => K x*tau P hP x-K x*pv h theta x) = fun x => K x*(tau P hP x-pv h theta x) := by funext x; ring change |∫ x, K x*tau P hP x-K x*pv h theta x ∂locLaw d h| ≤ _ rw [hr] apply (abs_integral_le_integral_abs).trans calc _ ≤ ∫ _x : Cov d, ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2)*B ∂locLaw d h := by apply integral_mono_ae (hk.integrable_mul he).abs (integrable_const _) filter_upwards [hae] with x hx simp only [Pi.mul_apply] rw [abs_mul] exact mul_le_mul (oracle_evaluation_kernel_bound d h hh x hx) (herr x hx) (abs_nonneg _) (by positivity) _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_projection_bias_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:192

Averaging all labeled oracle responses preserves their local projection mean; auxiliary records and the independent randomizer integrate out exactly. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input hh, the specified input hh', the oracle average mean conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
0 < n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m)
= ∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h
Proof (Lean source)
lemma oracle_average_mean {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 0 < n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) : (∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m) = ∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u) * tau P hP x ∂locLaw d h := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability letI := population_experiment_probability P n m let F := fun z : Cov d × Bool × Bool => locWeight h z.1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h z.1 u) * (bit z.2.1 * bit z.2.2 / designatedPropensity P hP z.1 - (1-bit z.2.1)*bit z.2.2 / (1-designatedPropensity P hP z.1))) have hF := oracle_summand_memLp_top (obsLaw P) P hP h hh id measurable_id have hi (i : Fin n) : Integrable (fun w : Sample d n m => F (w.1.1 i)) (experiment P n m) := (oracle_summand_memLp_top (experiment P n m) P hP h hh (fun w => w.1.1 i) (by fun_prop)).integrable (by simp) have hmean (i : Fin n) : (∫ w : Sample d n m, F (w.1.1 i) ∂experiment P n m) = ∫ z, F z ∂obsLaw P := by rw [experiment_integral_dataset P (fun D : Dataset d n m => F (D.1 i)), integral_fun_fst (fun D : Fin n → Cov d × Bool × Bool => F (D i))] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] exact integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (f := F) hF.aestronglyMeasurable change (∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, F (w.1.1 i) ∂experiment P n m) = _ rw [integral_const_mul, integral_finsetSum _ (fun i _ => hi i)] simp_rw [hmean] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] rw [← mul_assoc, inv_mul_cancel₀ (by exact_mod_cast hn.ne' : (n:ℝ) ≠ 0), one_mul] exact oracle_summand_mean P hP h hh hh'
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_average_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:238
theorem oracle_average_bias_bound Lemma oracle_average_bias_bound in the paper ↗

The untruncated oracle sample average inherits the polynomial approximation bias without any loss from the auxiliary channel or randomization. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input theta, the specified input B, the specified input hB, the specified input herr, the specified input htarget, the oracle average bias bound conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
0 < n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
theta :
PolyIdx d → ℝ
B :
ℝ
hB :
0 ≤ B
herr :
∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ B
htarget :
pv h theta (x0 d) = tau P hP (x0 d)
|(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m)
- tau P hP (x0 d)|
≤ ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) * B
Proof (Lean source)
lemma oracle_average_bias_bound {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 0 < n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) (theta : PolyIdx d → ℝ) (B : ℝ) (hB : 0 ≤ B) (herr : ∀ x ∈ locCube d h, |tau P hP x-pv h theta x| ≤ B) (htarget : pv h theta (x0 d) = tau P hP (x0 d)) : |(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m) - tau P hP (x0 d)| ≤ ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) * B := by rw [oracle_average_mean P hP hn h hh hh'] exact oracle_projection_bias_bound P hP h hh theta B hB herr htarget
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_average_bias_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:278
theorem oracle_uniform_average_bias Lemma oracle_uniform_average_bias in the paper ↗

Full-window Taylor reproduction bounds the bias uniformly over the primitive class. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle uniform average bias conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
0 < n
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
0 < h
h ≤ 1
|(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m)
- tau P hP (x0 d)|
≤ C*h^gamma
Proof (Lean source)
lemma oracle_uniform_average_bias (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 0 < n → ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ (h : ℝ), 0 < h → h ≤ 1 → |(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m) - tau P hP (x0 d)| ≤ C*h^gamma := by obtain ⟨Ct, hCt, ht⟩ := oracle_taylor_approximation d alpha beta gamma L eps hdom let K : ℝ := (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 have hcard : 0 < card (PolyIdx d) := by have : Nonempty (PolyIdx d) := ⟨⟨fun _ => 0, by simp⟩⟩ exact Fintype.card_pos have hK : 0 < K := mul_pos (by exact_mod_cast hcard) (by positivity) refine ⟨K*Ct, mul_pos hK hCt, ?_⟩ intro n m hn P hP h hh hh' obtain ⟨theta, herr, htarget, _⟩ := ht P hP h hh hh' have hb := oracle_average_bias_bound (m := m) P hP hn h hh hh' theta (Ct*h^gamma) (by positivity) herr htarget simpa only [K, mul_assoc] using hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_uniform_average_bias · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:296
theorem oracle_tuned_average_bias Lemma oracle_tuned_average_bias in the paper ↗

At the prescribed oracle bandwidth the uniform average bias has the oracle rate. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle tuned average bias conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
2 ≤ n
P :
hP :
PrimitiveClass alpha beta gamma L eps P
|(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight ((n:ℝ)^(-(1/(2*gamma+d)))) (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d ((n:ℝ)^(-(1/(2*gamma+d)))) u * coarseBasis ((n:ℝ)^(-(1/(2*gamma+d)))) (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m)
- tau P hP (x0 d)|
≤ C*oracleRate d gamma n
Proof (Lean source)
lemma oracle_tuned_average_bias (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 2 ≤ n → ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), |(∫ w : Sample d n m, (n:ℝ)⁻¹ * ∑ i : Fin n, locWeight ((n:ℝ)^(-(1/(2*gamma+d)))) (w.1.1 i).1 * ((∑ u : PolyIdx d, r0 d ((n:ℝ)^(-(1/(2*gamma+d)))) u * coarseBasis ((n:ℝ)^(-(1/(2*gamma+d)))) (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / designatedPropensity P hP (w.1.1 i).1 - (1-bit (w.1.1 i).2.1)*bit (w.1.1 i).2.2 / (1-designatedPropensity P hP (w.1.1 i).1))) ∂experiment P n m) - tau P hP (x0 d)| ≤ C*oracleRate d gamma n := by obtain ⟨C, hC, hbound⟩ := oracle_uniform_average_bias d alpha beta gamma L eps hdom refine ⟨C, hC, ?_⟩ intro n m hn P hP have hn0 : 0 < n := by omega obtain ⟨hh, hh'⟩ := oracle_bandwidth_bounds d n gamma hn hdom.2.2.2.2.2.1 have hb := hbound n m hn0 P hP _ hh hh' rwa [oracle_bandwidth_bias_identity d n gamma hn0] at hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_tuned_average_bias · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:321
theorem oracle_iid_centered_second_moment Lemma oracle_iid_centered_second_moment in the paper ↗

The original-record experiment preserves the iid variance reduction for any labeled statistic. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input F, the specified input hF, the oracle iid centered second moment conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
0 < n
F :
Cov d × Bool × Bool → ℝ
hF :
MemLp F 2 (obsLaw P)
(∫ w : Sample d n m, ((n:ℝ)⁻¹ * ∑ i : Fin n, F (w.1.1 i) - ∫ z, F z ∂obsLaw P)^2 ∂experiment P n m)
≤ (n:ℝ)⁻¹ * ∫ z, (F z)^2 ∂obsLaw P
Proof (Lean source)
lemma oracle_iid_centered_second_moment {d n m : ℕ} (P : PrimitiveLaw d) (hn : 0 < n) (F : Cov d × Bool × Bool → ℝ) (hF : MemLp F 2 (obsLaw P)) : (∫ w : Sample d n m, ((n:ℝ)⁻¹ * ∑ i : Fin n, F (w.1.1 i) - ∫ z, F z ∂obsLaw P)^2 ∂experiment P n m) ≤ (n:ℝ)⁻¹ * ∫ z, (F z)^2 ∂obsLaw P := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability let A := fun s : Fin n → Cov d × Bool × Bool => (n:ℝ)⁻¹ * ∑ i, F (s i) let μ := Measure.pi (fun _ : Fin n => obsLaw P) have hA : MemLp A 2 μ := (memLp_finsetSum _ (fun i _ => hF.comp_measurePreserving (measurePreserving_eval (fun _ : Fin n => obsLaw P) i))).const_mul _ have hmean : (∫ s, A s ∂μ) = ∫ z, F z ∂obsLaw P := iid_average_integral (obsLaw P) n hn F (hF.integrable (by norm_num)) have hv := iid_average_variance (obsLaw P) n F hF have hvar : variance F (obsLaw P) ≤ ∫ z, (F z)^2 ∂obsLaw P := by rw [variance_eq_sub hF] exact sub_le_self _ (sq_nonneg _) calc _ = ∫ s, (A s - ∫ z, F z ∂obsLaw P)^2 ∂μ := by rw [experiment_integral_dataset P (fun D : Dataset d n m => (A D.1 - ∫ z, F z ∂obsLaw P)^2), integral_fun_fst (fun s => (A s - ∫ z, F z ∂obsLaw P)^2)] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] rfl _ = variance A μ := by rw [variance_eq_integral hA.aemeasurable, hmean] _ = (n:ℝ)⁻¹ * variance F (obsLaw P) := hv _ ≤ _ := mul_le_mul_of_nonneg_left hvar (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_iid_centered_second_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleMean.lean:340
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.OracleRisk 12 declarations The labeled sample average has the variance reduction and clipping contraction needed to combine its full-window Taylor bias with its stochastic error.

# Oracle sampling and risk assembly The labeled sample average has the variance reduction and clipping contraction needed to combine its full-window Taylor bias with its stochastic error.

The untruncated localized inverse-propensity record statistic. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input z, oracle record is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
z :
Cov d × Bool × Bool
oracleRecord P hP h z :
ℝ
locWeight h z.1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h z.1 u) * (bit z.2.1 * bit z.2.2 / designatedPropensity P hP z.1 - (1-bit z.2.1)*bit z.2.2 / (1-designatedPropensity P hP z.1)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleRecord · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:15

The raw oracle average, with auxiliary records and randomization ignored. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input w, oracle average is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
w :
Sample d n m
oracleAverage P hP h w :
ℝ
(n:ℝ)⁻¹ * ∑ i : Fin n, oracleRecord P hP h (w.1.1 i)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleAverage · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:23

Class membership fixes the observed covariate marginal to the known design. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the oracle observed design conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
(obsLaw P).map (fun z => z.1) = uniformLaw d
Proof (Lean source)
lemma oracle_observed_design {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : (obsLaw P).map (fun z => z.1) = uniformLaw d := by rw [obsLaw, Measure.map_map (by fun_prop) population_measurable_observed] change P.law.map fst = uniformLaw d have hs := canonicalLaw_spec P hP rw [← hs.1] exact hs.2.1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_observed_design · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:28

Finite averaging preserves the bounded summands' finite moments. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the oracle average mem lp conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
MemLp (oracleAverage (n:=n) (m:=m) P hP h) 2 (experiment P n m)
Proof (Lean source)
lemma oracleAverage_memLp {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) : MemLp (oracleAverage (n:=n) (m:=m) P hP h) 2 (experiment P n m) := by letI := population_experiment_probability P n m apply MemLp.const_mul apply memLp_finsetSum intro i hi exact (oracle_summand_memLp_top (experiment P n m) P hP h hh (fun w => w.1.1 i) (by fun_prop)).mono_exponent (by norm_num)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleAverage_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:38
theorem oracle_average_centered_square_bound Lemma oracle_average_centered_square_bound in the paper ↗

The iid second-moment reduction gives an explicit oracle sampling bound. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input hh, the specified input hh', the oracle average centered square bound conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
0 < n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
(∫ w, (oracleAverage (n:=n) (m:=m) P hP h w - ∫ v, oracleAverage (n:=n) (m:=m) P hP h v ∂experiment P n m)^2 ∂experiment P n m)
≤ (n:ℝ)⁻¹ * (eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2))
Proof (Lean source)
lemma oracle_average_centered_square_bound {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 0 < n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) : (∫ w, (oracleAverage (n:=n) (m:=m) P hP h w - ∫ v, oracleAverage (n:=n) (m:=m) P hP h v ∂experiment P n m)^2 ∂experiment P n m) ≤ (n:ℝ)⁻¹ * (eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2)) := by letI := obsLaw_probability P have hF : MemLp (oracleRecord P hP h) 2 (obsLaw P) := (oracle_summand_memLp_top (obsLaw P) P hP h hh id measurable_id).mono_exponent (by norm_num) have hm : (∫ w, oracleAverage (n:=n) (m:=m) P hP h w ∂experiment P n m) = ∫ z, oracleRecord P hP h z ∂obsLaw P := by rw [show (∫ w, oracleAverage (n:=n) (m:=m) P hP h w ∂experiment P n m) = ∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u)*tau P hP x ∂locLaw d h from oracle_average_mean P hP hn h hh hh'] exact (oracle_summand_mean P hP h hh hh').symm rw [hm] exact (oracle_iid_centered_second_moment (m:=m) P hn _ hF).trans (mul_le_mul_of_nonneg_left (oracle_summand_second_moment_bound (obsLaw P) P hP h hh hh' id measurable_id (oracle_observed_design P hP)) (by positivity))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_average_centered_square_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:49
theorem oracle_average_absolute_deviation Lemma oracle_average_absolute_deviation in the paper ↗

Cauchy--Schwarz converts the sampling second moment to absolute deviation. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input hh, the specified input hh', the oracle average absolute deviation conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
0 < n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
(∫ w, |oracleAverage (n:=n) (m:=m) P hP h w - ∫ v, oracleAverage (n:=n) (m:=m) P hP h v ∂experiment P n m| ∂experiment P n m)
≤ sqrt ((n:ℝ)⁻¹ * (eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2)))
Proof (Lean source)
lemma oracle_average_absolute_deviation {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 0 < n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) : (∫ w, |oracleAverage (n:=n) (m:=m) P hP h w - ∫ v, oracleAverage (n:=n) (m:=m) P hP h v ∂experiment P n m| ∂experiment P n m) ≤ sqrt ((n:ℝ)⁻¹ * (eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2))) := by letI := population_experiment_probability P n m have hc := (oracleAverage_memLp (n:=n) (m:=m) P hP h hh).sub (memLp_const (∫ v, oracleAverage (n:=n) (m:=m) P hP h v ∂experiment P n m)) have hcs := integral_abs_le_sqrt_integral_sq (experiment P n m) _ hc simp only [Real.norm_eq_abs, sq_abs] at hcs exact hcs.trans (Real.sqrt_le_sqrt (oracle_average_centered_square_bound P hP hn h hh hh'))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_average_absolute_deviation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:71
theorem oracle_target_energy_bound Lemma oracle_target_energy_bound in the paper ↗

The target evaluation coordinates have a bound independent of bandwidth. Given the specified input d, the specified input h, the specified input hh, the oracle target energy bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
(∑ u : PolyIdx d, (r0 d h u)^2) ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2
Proof (Lean source)
lemma oracle_target_energy_bound (d : ℕ) (h : ℝ) (hh : 0 < h) : (∑ u : PolyIdx d, (r0 d h u)^2) ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 := by have hx : x0 d ∈ locCube d h := by intro i constructor <;> change _ ≤ _ <;> simp only [x0] <;> linarith calc _ ≤ ∑ _u : PolyIdx d, ((4:ℝ)^d)^2 := by apply Finset.sum_le_sum intro u hu have hb := coarseBasis_abs_bound d h hh (x0 d) hx u change |r0 d h u| ≤ (4:ℝ)^d at hb nlinarith [sq_abs (r0 d h u), abs_nonneg (r0 d h u)] _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_target_energy_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:86
theorem oracle_bandwidth_sqrt_identity Lemma oracle_bandwidth_sqrt_identity in the paper ↗

Inverse effective sample size has standard deviation equal to the oracle rate. Given the specified input d, the specified input n, the specified input gamma, the specified input hn, the specified input hg, the oracle bandwidth sqrt identity conclusion holds.

Formal statement
d n :
ℕ
gamma :
ℝ
hn :
0 < n
hg :
1 ≤ gamma
sqrt ((n:ℝ)⁻¹ * ((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ))) = oracleRate d gamma n
Proof (Lean source)
lemma oracle_bandwidth_sqrt_identity (d n : ℕ) (gamma : ℝ) (hn : 0 < n) (hg : 1 ≤ gamma) : sqrt ((n:ℝ)⁻¹ * ((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ))) = oracleRate d gamma n := by have hn0 : (0:ℝ) < n := by exact_mod_cast hn have hh : 0 < (n:ℝ)^(-(1/(2*gamma+d))) := Real.rpow_pos_of_pos hn0 _ rw [show (n:ℝ)⁻¹ * ((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ)) = ((n:ℝ)*((n:ℝ)^(-(1/(2*gamma+d))))^d)⁻¹ by rw [mul_inv_rev, Real.rpow_neg hh.le, Real.rpow_natCast]; ring] rw [Real.sqrt_eq_rpow, ← Real.rpow_neg_one, ← Real.rpow_mul (by positivity)] convert oracle_bandwidth_sampling_identity d n gamma hn hg using 1 <;> norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bandwidth_sqrt_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:102
theorem oracle_tuned_absolute_deviation Lemma oracle_tuned_absolute_deviation in the paper ↗

The tuned oracle average has a uniform absolute sampling deviation at the oracle rate. Given the specified input d, the specified input gamma, the specified input hg, the overlap level eps, the oracle tuned absolute deviation conclusion holds.

Formal statement
d :
ℕ
gamma eps :
ℝ
hg :
1 ≤ gamma
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
2 ≤ n
alpha beta L :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
(∫ w, |oracleAverage (n:=n) (m:=m) P hP ((n:ℝ)^(-(1/(2*gamma+d)))) w - ∫ v, oracleAverage (n:=n) (m:=m) P hP ((n:ℝ)^(-(1/(2*gamma+d)))) v ∂experiment P n m| ∂experiment P n m)
≤ C*oracleRate d gamma n
Proof (Lean source)
lemma oracle_tuned_absolute_deviation (d : ℕ) (gamma eps : ℝ) (hg : 1 ≤ gamma) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 2 ≤ n → ∀ (alpha beta L : ℝ) (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), (∫ w, |oracleAverage (n:=n) (m:=m) P hP ((n:ℝ)^(-(1/(2*gamma+d)))) w - ∫ v, oracleAverage (n:=n) (m:=m) P hP ((n:ℝ)^(-(1/(2*gamma+d)))) v ∂experiment P n m| ∂experiment P n m) ≤ C*oracleRate d gamma n := by let K : ℝ := (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 refine ⟨Real.sqrt (eps⁻¹^2*K)+1, by positivity, ?_⟩ intro n m hn alpha beta L P hP have hn0 : 0 < n := by omega obtain ⟨hh, hh'⟩ := oracle_bandwidth_bounds d n gamma hn hg have hb := oracle_average_absolute_deviation (m:=m) P hP hn0 _ hh hh' have hk := oracle_target_energy_bound d _ hh have hs : sqrt ((n:ℝ)⁻¹ * (eps⁻¹^2 * (((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d ((n:ℝ)^(-(1/(2*gamma+d)))) u)^2))) ≤ sqrt (eps⁻¹^2*K)*oracleRate d gamma n := by calc _ ≤ sqrt ((eps⁻¹^2*K)*((n:ℝ)⁻¹ * ((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ)))) := by apply Real.sqrt_le_sqrt dsimp [K] nlinarith [mul_le_mul_of_nonneg_left hk (by positivity : 0 ≤ (n:ℝ)⁻¹ * eps⁻¹^2 * ((n:ℝ)^(-(1/(2*gamma+d))))^(-(d:ℝ)))] _ = _ := by rw [Real.sqrt_mul (by dsimp [K]; positivity), oracle_bandwidth_sqrt_identity d n gamma hn0 hg] apply (hb.trans hs).trans exact mul_le_mul_of_nonneg_right (by linarith) (by unfold oracleRate; positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_tuned_absolute_deviation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:115

The continuous target lies in the clipping interval by the two arm-mean range conditions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the oracle target in clip conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
tau P hP (x0 d) ∈ Icc (-1) 1
Proof (Lean source)
lemma oracle_target_in_clip {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : tau P hP (x0 d) ∈ Icc (-1) 1 := by have hx : x0 d ∈ cube d := by intro i; norm_num [x0, cube] have hs := canonicalLaw_spec P hP have hc := hs.2.2.2.2.2.2.2.1 (x0 d) hx have ht := hs.2.2.2.2.2.2.2.2 (x0 d) hx simp only [tau, designatedTreated, designatedControl, if_pos hx] constructor <;> linarith [hc.1, hc.2, ht.1, ht.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_target_in_clip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:145
theorem oracleSmoother_eq_clip_average Lemma oracleSmoother_eq_clip_average in the paper ↗

The stipulated smoother clips exactly the raw oracle sample average. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input w, the oracle smoother eq clip average conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
w :
Sample d n m
= clip (oracleAverage P hP ((n:ℝ)^(-(1/(2*gamma+d)))) w)
Proof (Lean source)
lemma oracleSmoother_eq_clip_average {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (w : Sample d n m) : oracleSmoother d gamma n m w (designatedPropensity P hP) = clip (oracleAverage P hP ((n:ℝ)^(-(1/(2*gamma+d)))) w) := by unfold oracleSmoother oracleAverage oracleRecord dsimp only simp only [mul_assoc]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSmoother_eq_clip_average · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:156
theorem oracle_smoother_upper_rate Lemma oracle_smoother_upper_rate in the paper ↗

Taylor bias plus iid sampling deviation bounds the clipped oracle risk uniformly. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle smoother upper rate conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
2 ≤ n
P :
hP :
PrimitiveClass alpha beta gamma L eps P
(∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m)
≤ ofReal (C*oracleRate d gamma n)
Proof (Lean source)
lemma oracle_smoother_upper_rate (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 2 ≤ n → ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), (∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m) ≤ ofReal (C*oracleRate d gamma n) := by obtain ⟨Cb, hCb, hb⟩ := oracle_tuned_average_bias d alpha beta gamma L eps hdom obtain ⟨Cs, hCs, hs⟩ := oracle_tuned_absolute_deviation d gamma eps hdom.2.2.2.2.2.1 refine ⟨Cs+Cb, add_pos hCs hCb, ?_⟩ intro n m hn P hP letI := population_experiment_probability P n m let H := (n:ℝ)^(-(1/(2*gamma+d))) let A := oracleAverage (n:=n) (m:=m) P hP H let mu := ∫ w, A w ∂experiment P n m let target := tau P hP (x0 d) obtain ⟨hh, hh'⟩ := oracle_bandwidth_bounds d n gamma hn hdom.2.2.2.2.2.1 have hA : Integrable A (experiment P n m) := (oracleAverage_memLp P hP H hh).integrable (by norm_num) have hcenter : Integrable (fun w => |A w-mu|) (experiment P n m) := (hA.sub (integrable_const mu)).abs have herror : Integrable (fun w => |oracleSmoother d gamma n m w (designatedPropensity P hP)-target|) (experiment P n m) := by apply Integrable.mono' ((hA.sub (integrable_const target)).abs) (by dsimp [target]; fun_prop) filter_upwards [] with w simp only [Real.norm_eq_abs, abs_abs] rw [oracleSmoother_eq_clip_average] exact clipping_contraction (A w) target (oracle_target_in_clip P hP) have hb' : |mu-target| ≤ Cb*oracleRate d gamma n := hb n m hn P hP have hs' : (∫ w, |A w-mu| ∂experiment P n m) ≤ Cs*oracleRate d gamma n := hs n m hn alpha beta L P hP have hr : (∫ w, |oracleSmoother d gamma n m w (designatedPropensity P hP)-target| ∂experiment P n m) ≤ (Cs+Cb)*oracleRate d gamma n := by calc _ ≤ ∫ w, (|A w-mu|+|mu-target|) ∂experiment P n m := by apply integral_mono herror (hcenter.add (integrable_const _)) intro w dsimp only [Pi.add_apply] rw [oracleSmoother_eq_clip_average] exact (clipping_contraction (A w) target (oracle_target_in_clip P hP)).trans (abs_sub_le (A w) mu target) _ = (∫ w, |A w-mu| ∂experiment P n m)+|mu-target| := by rw [integral_add hcenter (integrable_const _)] simp _ ≤ _ := by nlinarith [hs', hb'] rw [← ofReal_integral_eq_lintegral_ofReal herror (Filter.Eventually.of_forall (fun w => abs_nonneg _))] exact ENNReal.ofReal_le_ofReal hr
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_smoother_upper_rate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleRisk.lean:165
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.OracleSmoother 21 declarations Explicit supplied-propensity smoothing, bounded record moments, full-window Legendre geometry, and bandwidth identities for the oracle upper-risk proof.

Oracle smoother primitives

Explicit supplied-propensity smoothing, bounded record moments, full-window Legendre geometry, and bandwidth identities for the oracle upper-risk proof.

Explicit clipped known-design degree-two smoother of the inverse-propensity pseudo-outcome. Given the specified input d, the specified input gamma, the specified input n, the specified input m, the specified input w, the specified input e, oracle smoother is the corresponding construction.

Definition (Lean source)
d :
ℕ
gamma :
ℝ
n m :
ℕ
w :
Sample d n m
e :
Cov d → ℝ
oracleSmoother d gamma n m w e :
ℝ
h :
(n:ℝ)^(-(1/(2*gamma+d)))
clip ((n:ℝ)⁻¹ * ∑ i : Fin n, locWeight h (w.1.1 i).1 * (∑ u : PolyIdx d, r0 d h u * coarseBasis h (w.1.1 i).1 u) * (bit (w.1.1 i).2.1 * bit (w.1.1 i).2.2 / e (w.1.1 i).1 - (1-bit (w.1.1 i).2.1) * bit (w.1.1 i).2.2 / (1-e (w.1.1 i).1)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSmoother · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:28
theorem oracle_binary_response_bound Lemma oracle_binary_response_bound in the paper ↗

The inverse-propensity response is a bounded signed binary outcome under overlap. Given the specified input a, the specified input y, the specified input e, the specified input he, the specified input he', the overlap level eps, the oracle binary response bound conclusion holds.

Formal statement
a y :
e eps :
ℝ
heps :
0 < eps
he :
eps ≤ e
he' :
e ≤ 1 - eps
|bit a * bit y / e - (1-bit a) * bit y / (1-e)| ≤ eps⁻¹
Proof (Lean source)
lemma oracle_binary_response_bound (a y : Bool) (e eps : ℝ) (heps : 0 < eps) (he : eps ≤ e) (he' : e ≤ 1 - eps) : |bit a * bit y / e - (1-bit a) * bit y / (1-e)| ≤ eps⁻¹ := by have hp : 0 < e := by linarith have hq : 0 < 1-e := by linarith have hi : 1/e ≤ eps⁻¹ := by rw [one_div]; exact inv_anti₀ heps he have hj : 1/(1-e) ≤ eps⁻¹ := by rw [one_div]; exact inv_anti₀ heps (by linarith) have hk : (0:ℝ) ≤ eps⁻¹ := inv_nonneg.mpr heps.le cases a <;> cases y <;> simp only [bit, Bool.false_eq_true, if_false, if_true, zero_mul, one_mul, sub_zero, sub_self, zero_div, zero_sub, abs_neg, abs_zero, abs_of_nonneg (by positivity : 0 ≤ 1/e), abs_of_nonneg (by positivity : 0 ≤ 1/(1-e))] <;> first | exact hi | exact hj | exact hk | norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_binary_response_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:36
theorem oracle_designated_response_bound Lemma oracle_designated_response_bound in the paper ↗

The zero extension of the supplied propensity also preserves the global response bound. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input z, the oracle designated response bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
z :
Cov d × Bool × Bool
|bit z.2.1 * bit z.2.2 / designatedPropensity P hP z.1
- (1-bit z.2.1) * bit z.2.2 / (1-designatedPropensity P hP z.1)|
≤ eps⁻¹
Proof (Lean source)
lemma oracle_designated_response_bound {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (z : Cov d × Bool × Bool) : |bit z.2.1 * bit z.2.2 / designatedPropensity P hP z.1 - (1-bit z.2.1) * bit z.2.2 / (1-designatedPropensity P hP z.1)| ≤ eps⁻¹ := by have heps := hP.eps_pos have hhalf := hP.eps_le_half by_cases hx : z.1 ∈ cube d · have he := (canonicalLaw_spec P hP).2.2.2.1.2 z.1 hx apply oracle_binary_response_bound _ _ _ eps heps · simpa only [designatedPropensity, if_pos hx] using he.1 · simpa only [designatedPropensity, if_pos hx] using he.2 · have h1 : (1:ℝ) ≤ eps⁻¹ := by rw [← one_div, le_div_iff₀ heps]; linarith simp only [designatedPropensity, if_neg hx, div_zero, sub_zero, div_one, zero_sub, abs_neg] rcases z with ⟨x, a, y⟩ cases a <;> cases y <;> norm_num [bit] <;> linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_designated_response_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:51
theorem oracle_evaluation_kernel_bound Lemma oracle_evaluation_kernel_bound in the paper ↗

The evaluation kernel has a uniform bound on the localized cube. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the oracle evaluation kernel bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
|∑ u : PolyIdx d, r0 d h u * coarseBasis h x u|
≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2
Proof (Lean source)
lemma oracle_evaluation_kernel_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) : |∑ u : PolyIdx d, r0 d h u * coarseBasis h x u| ≤ (card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 := by have hc : x0 d ∈ locCube d h := by intro i change (1/2:ℝ) ∈ Icc (1/2-h/2) (1/2+h/2) constructor <;> linarith calc _ ≤ ∑ u : PolyIdx d, |r0 d h u * coarseBasis h x u| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _u : PolyIdx d, ((4:ℝ)^d)^2 := by apply Finset.sum_le_sum intro u _ rw [abs_mul, pow_two] exact mul_le_mul (coarseBasis_abs_bound d h hh (x0 d) hc u) (coarseBasis_abs_bound d h hh x hx u) (abs_nonneg _) (by positivity) _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_evaluation_kernel_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:70
theorem oracle_summand_memLp_top Lemma oracle_summand_memLp_top in the paper ↗

Every localized oracle summand has finite moments, before averaging or clipping. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input Z, the specified input hZ, the oracle summand mem lp top conclusion holds.

Formal statement
Ω :
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
Z :
Ω → Cov d × Bool × Bool
hZ :
MemLp (fun w => locWeight h (Z w).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (Z w).1 u) * (bit (Z w).2.1 * bit (Z w).2.2 / designatedPropensity P hP (Z w).1 - (1-bit (Z w).2.1) * bit (Z w).2.2 / (1-designatedPropensity P hP (Z w).1)))) ∞ μ
Proof (Lean source)
lemma oracle_summand_memLp_top {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (Z : Ω → Cov d × Bool × Bool) (hZ : Measurable Z) : MemLp (fun w => locWeight h (Z w).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (Z w).1 u) * (bit (Z w).2.1 * bit (Z w).2.2 / designatedPropensity P hP (Z w).1 - (1-bit (Z w).2.1) * bit (Z w).2.2 / (1-designatedPropensity P hP (Z w).1)))) ∞ μ := by apply population_localized_record_memLp μ d h hh (fun w => (Z w).1) (by fun_prop) _ (by fun_prop) ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2 * eps⁻¹) (by have := hP.eps_pos; positivity) intro w hw rw [abs_mul] exact mul_le_mul (oracle_evaluation_kernel_bound d h hh (Z w).1 hw) (oracle_designated_response_bound P hP (Z w)) (abs_nonneg _) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_summand_memLp_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:90
theorem oracle_locCube_subset_cube Lemma oracle_locCube_subset_cube in the paper ↗

Oracle windows up to unit side length remain in the known-design cube. Given the specified input d, the specified input h, the specified input hh, the oracle loc cube subset cube conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
h ≤ 1
locCube d h ⊆ cube d
Proof (Lean source)
lemma oracle_locCube_subset_cube (d : ℕ) (h : ℝ) (hh : h ≤ 1) : locCube d h ⊆ cube d := by intro x hx i constructor <;> linarith [(hx i).1, (hx i).2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_locCube_subset_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:108
theorem oracle_uniform_localization_integral Lemma oracle_uniform_localization_integral in the paper ↗

Known-design weighted integration equals localization for the full oracle window. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input f, the oracle uniform localization integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
f :
Cov d → ℝ
(∫ x, locWeight h x * f x ∂uniformLaw d) = ∫ x, f x ∂locLaw d h
Proof (Lean source)
lemma oracle_uniform_localization_integral (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) (f : Cov d → ℝ) : (∫ x, locWeight h x * f x ∂uniformLaw d) = ∫ x, f x ∂locLaw d h := by have hfun : (fun x => locWeight h x * f x) = (locCube d h).indicator (fun x => h^(-(d:ℝ)) * f x) := by funext x by_cases hx : x ∈ locCube d h <;> simp [locWeight, hx] rw [hfun, integral_indicator (isClosed_locCube d h).measurableSet] unfold uniformLaw locLaw rw [Measure.restrict_restrict (isClosed_locCube d h).measurableSet, Set.inter_eq_left.mpr (oracle_locCube_subset_cube d h hh'), integral_const_mul, integral_smul_measure] rw [ENNReal.toReal_ofReal (Real.rpow_nonneg hh.le _)] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_uniform_localization_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:114
theorem oracle_coarse_orthonormal Lemma oracle_coarse_orthonormal in the paper ↗

Coarse Legendre orthonormality is a scaling identity for every positive window. Given the specified input d, the specified input h, the specified input hh, the specified input u, the specified input v, the oracle coarse orthonormal conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
u v :
(∫ x, coarseBasis h x u * coarseBasis h x v ∂locLaw d h) = if u = v then 1 else 0
Proof (Lean source)
lemma oracle_coarse_orthonormal (d : ℕ) (h : ℝ) (hh : 0 < h) (u v : PolyIdx d) : (∫ x, coarseBasis h x u * coarseBasis h x v ∂locLaw d h) = if u = v then 1 else 0 := by rw [locLaw, integral_smul_measure, ENNReal.toReal_ofReal (by positivity)] simp only [coarseBasis, ← Finset.prod_mul_distrib] rw [locCube, euclidean_box_product_integral d (1/2-h/2) (1/2+h/2) (fun i x => legendre (u.1 i) ((x-1/2)/h) * legendre (v.1 i) ((x-1/2)/h))] simp only [smul_eq_mul] have hk (w : PolyIdx d) (i : Fin d) : w.1 i ≤ 2 := (Finset.single_le_sum (fun j _ => zero_le (w.1 j)) (Finset.mem_univ i)).trans w.2 simp_rw [scaled_legendre_orthogonality h hh _ _ (hk u _) (hk v _)] rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, Fintype.card_fin] have hnorm : h ^ (-(d:ℝ)) * h^d = 1 := by rw [Real.rpow_neg hh.le, Real.rpow_natCast, inv_mul_cancel₀ (pow_ne_zero _ hh.ne')] rw [← mul_assoc, hnorm, one_mul] by_cases huv : u = v · subst v simp · rw [if_neg huv] have hne : ∃ i, u.1 i ≠ v.1 i := by by_contra hn apply huv apply Subtype.ext funext i exact not_ne_iff.mp (not_exists.mp hn i) obtain ⟨i, hi⟩ := hne exact Finset.prod_eq_zero (Finset.mem_univ i) (if_neg hi)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_coarse_orthonormal · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:130
theorem oracle_coarseBasis_memLp Lemma oracle_coarseBasis_memLp in the paper ↗

Full-window coarse coordinates are square integrable by their orthonormal norms. Given the specified input d, the specified input h, the specified input hh, the specified input u, the oracle coarse basis mem lp conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
u :
MemLp (fun x => coarseBasis h x u) 2 (locLaw d h)
Proof (Lean source)
lemma oracle_coarseBasis_memLp (d : ℕ) (h : ℝ) (hh : 0 < h) (u : PolyIdx d) : MemLp (fun x => coarseBasis h x u) 2 (locLaw d h) := by apply (memLp_two_iff_integrable_sq (by fun_prop)).2 by_contra hi have hz := integral_undef hi have ho := oracle_coarse_orthonormal d h hh u u simp only [ite_true, ← pow_two] at ho rw [hz] at ho norm_num at ho
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_coarseBasis_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:159
theorem oracle_evaluation_kernel_square_integral Lemma oracle_evaluation_kernel_square_integral in the paper ↗

The squared oracle evaluation-kernel norm is the sum of squared target coordinates. Given the specified input d, the specified input h, the specified input hh, the oracle evaluation kernel square integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
(∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u)^2 ∂locLaw d h)
= ∑ u : PolyIdx d, (r0 d h u)^2
Proof (Lean source)
lemma oracle_evaluation_kernel_square_integral (d : ℕ) (h : ℝ) (hh : 0 < h) : (∫ x, (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u)^2 ∂locLaw d h) = ∑ u : PolyIdx d, (r0 d h u)^2 := by simp_rw [mul_comm (r0 d h _) (coarseBasis h _ _)] exact finite_orthonormal_square_norm (locLaw d h) (fun u x => coarseBasis h x u) (oracle_coarseBasis_memLp d h hh) (fun i j => by have ho := oracle_coarse_orthonormal d h hh i j by_cases hij : i = j · simp only [if_pos hij] at ho ⊢; exact ho · simp only [if_neg hij] at ho ⊢; exact ho) (r0 d h)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_evaluation_kernel_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:170
theorem oracle_weighted_kernel_square_integral Lemma oracle_weighted_kernel_square_integral in the paper ↗

Uniform-design scaling gives the exact squared weighted-kernel energy. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the oracle weighted kernel square integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
(∫ x, (locWeight h x * (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u))^2 ∂uniformLaw d)
= h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2
Proof (Lean source)
lemma oracle_weighted_kernel_square_integral (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) : (∫ x, (locWeight h x * (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u))^2 ∂uniformLaw d) = h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2 := by have he (x : Cov d) : (locWeight h x * (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u))^2 = locWeight h x * (h^(-(d:ℝ)) * (∑ u : PolyIdx d, r0 d h u * coarseBasis h x u)^2) := by by_cases hx : x ∈ locCube d h · simp only [locWeight, if_pos hx]; ring · simp only [locWeight, if_neg hx, zero_mul, zero_pow (by norm_num : 2 ≠ 0)] simp_rw [he] rw [oracle_uniform_localization_integral d h hh hh', integral_const_mul, oracle_evaluation_kernel_square_integral d h hh]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_weighted_kernel_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:182
theorem oracle_summand_second_moment_bound Lemma oracle_summand_second_moment_bound in the paper ↗

Bounded pseudo-outcomes and the exact kernel energy bound the oracle record second moment. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input Z, the specified input hZ, the specified input hdesign, the oracle summand second moment bound conclusion holds.

Formal statement
Ω :
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1
Z :
Ω → Cov d × Bool × Bool
hZ :
hdesign :
μ.map (fun w => (Z w).1) = uniformLaw d
(∫ w, (locWeight h (Z w).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (Z w).1 u) * (bit (Z w).2.1 * bit (Z w).2.2 / designatedPropensity P hP (Z w).1 - (1-bit (Z w).2.1) * bit (Z w).2.2 / (1-designatedPropensity P hP (Z w).1))))^2 ∂μ)
≤ eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2)
Proof (Lean source)
lemma oracle_summand_second_moment_bound {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1) (Z : Ω → Cov d × Bool × Bool) (hZ : Measurable Z) (hdesign : μ.map (fun w => (Z w).1) = uniformLaw d) : (∫ w, (locWeight h (Z w).1 * ((∑ u : PolyIdx d, r0 d h u * coarseBasis h (Z w).1 u) * (bit (Z w).2.1 * bit (Z w).2.2 / designatedPropensity P hP (Z w).1 - (1-bit (Z w).2.1) * bit (Z w).2.2 / (1-designatedPropensity P hP (Z w).1))))^2 ∂μ) ≤ eps⁻¹^2 * (h^(-(d:ℝ)) * ∑ u : PolyIdx d, (r0 d h u)^2) := by let K := fun x : Cov d => ∑ u : PolyIdx d, r0 d h u * coarseBasis h x u let R := fun w => bit (Z w).2.1 * bit (Z w).2.2 / designatedPropensity P hP (Z w).1 - (1-bit (Z w).2.1) * bit (Z w).2.2 / (1-designatedPropensity P hP (Z w).1) have hk : MemLp (fun w => locWeight h (Z w).1 * K (Z w).1) ∞ μ := by apply population_localized_record_memLp μ d h hh (fun w => (Z w).1) (by fun_prop) _ (by dsimp [K]; fun_prop) ((card (PolyIdx d):ℝ) * ((4:ℝ)^d)^2) (by positivity) intro w hw exact oracle_evaluation_kernel_bound d h hh (Z w).1 hw have hki := (hk.mono_exponent (show (2:ℝ≥0∞) ≤ ∞ from le_top)).integrable_sq have hsi := ((oracle_summand_memLp_top μ P hP h hh Z hZ).mono_exponent (show (2:ℝ≥0∞) ≤ ∞ from le_top)).integrable_sq have hpoint (w : Ω) : (locWeight h (Z w).1 * (K (Z w).1 * R w))^2 ≤ eps⁻¹^2 * (locWeight h (Z w).1 * K (Z w).1)^2 := by have hb : |R w| ≤ eps⁻¹ := oracle_designated_response_bound P hP (Z w) have hr : (R w)^2 ≤ eps⁻¹^2 := by rw [← sq_abs]; exact pow_le_pow_left₀ (abs_nonneg _) hb 2 calc _ = (locWeight h (Z w).1 * K (Z w).1)^2 * (R w)^2 := by ring _ ≤ (locWeight h (Z w).1 * K (Z w).1)^2 * eps⁻¹^2 := mul_le_mul_of_nonneg_left hr (sq_nonneg _) _ = _ := by ring have hm := integral_map (μ := μ) (by fun_prop : AEMeasurable (fun w => (Z w).1) μ) (f := fun x => (locWeight h x * K x)^2) (by dsimp [K]; fun_prop) rw [hdesign] at hm calc _ ≤ ∫ w, eps⁻¹^2 * (locWeight h (Z w).1 * K (Z w).1)^2 ∂μ := integral_mono hsi (hki.const_mul (eps⁻¹^2)) hpoint _ = _ := by rw [integral_const_mul, ← hm] exact congrArg (fun t : ℝ => eps⁻¹^2*t) (oracle_weighted_kernel_square_integral d h hh hh')
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_summand_second_moment_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:199
theorem oracle_bandwidth_bounds Lemma oracle_bandwidth_bounds in the paper ↗

The oracle bandwidth is positive and its whole support fits in the design cube. Given the specified input d, the specified input n, the specified input gamma, the specified input hn, the specified input hg, the oracle bandwidth bounds conclusion holds.

Formal statement
d n :
ℕ
gamma :
ℝ
hn :
2 ≤ n
hg :
1 ≤ gamma
conclusion 1
0 < (n:ℝ)^(-(1/(2*gamma+d)))
conclusion 2
(n:ℝ)^(-(1/(2*gamma+d))) ≤ 1
Proof (Lean source)
lemma oracle_bandwidth_bounds (d n : ℕ) (gamma : ℝ) (hn : 2 ≤ n) (hg : 1 ≤ gamma) : 0 < (n:ℝ)^(-(1/(2*gamma+d))) ∧ (n:ℝ)^(-(1/(2*gamma+d))) ≤ 1 := by have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hd : (0:ℝ) ≤ d := Nat.cast_nonneg d have hD : 0 < 2*gamma+d := by linarith refine ⟨Real.rpow_pos_of_pos hn0 _, ?_⟩ exact Real.rpow_le_one_of_one_le_of_nonpos hn1 (neg_nonpos.mpr (by positivity))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bandwidth_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:244
theorem oracle_bandwidth_bias_identity Lemma oracle_bandwidth_bias_identity in the paper ↗

At the oracle bandwidth the Taylor remainder has exactly the oracle rate. Given the specified input d, the specified input n, the specified input gamma, the specified input hn, the oracle bandwidth bias identity conclusion holds.

Formal statement
d n :
ℕ
gamma :
ℝ
hn :
0 < n
((n:ℝ)^(-(1/(2*gamma+d))))^gamma = oracleRate d gamma n
Proof (Lean source)
lemma oracle_bandwidth_bias_identity (d n : ℕ) (gamma : ℝ) (hn : 0 < n) : ((n:ℝ)^(-(1/(2*gamma+d))))^gamma = oracleRate d gamma n := by rw [← Real.rpow_mul (Nat.cast_nonneg n)] unfold oracleRate congr 1 ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bandwidth_bias_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:255
theorem oracle_bandwidth_sampling_identity Lemma oracle_bandwidth_sampling_identity in the paper ↗

The oracle bandwidth also balances the stochastic standard-deviation term exactly. Given the specified input d, the specified input n, the specified input gamma, the specified input hn, the specified input hg, the oracle bandwidth sampling identity conclusion holds.

Formal statement
d n :
ℕ
gamma :
ℝ
hn :
0 < n
hg :
1 ≤ gamma
((n:ℝ)*((n:ℝ)^(-(1/(2*gamma+d))))^d)^(-(1/2:ℝ)) = oracleRate d gamma n
Proof (Lean source)
lemma oracle_bandwidth_sampling_identity (d n : ℕ) (gamma : ℝ) (hn : 0 < n) (hg : 1 ≤ gamma) : ((n:ℝ)*((n:ℝ)^(-(1/(2*gamma+d))))^d)^(-(1/2:ℝ)) = oracleRate d gamma n := by have hn0 : (0:ℝ) < n := by exact_mod_cast hn have hD : 0 < 2*gamma+d := by nlinarith [(Nat.cast_nonneg d : (0:ℝ) ≤ d)] rw [← Real.rpow_natCast, ← Real.rpow_mul hn0.le] conv_lhs => arg 1; arg 1; rw [← Real.rpow_one (n:ℝ)] rw [← Real.rpow_add hn0, ← Real.rpow_mul hn0.le] unfold oracleRate congr 1 field_simp <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bandwidth_sampling_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:263
theorem measurable_oracleSmoother Lemma measurable_oracleSmoother in the paper ↗

Given dimension d, smoothness γ, sample sizes n and m, and a Borel supplied propensity e, the explicit oracle smoother is Borel.

Formal statement
d :
ℕ
gamma :
ℝ
n m :
ℕ
e :
Cov d → ℝ
he :
Measurable (fun w : Sample d n m => oracleSmoother d gamma n m w e)
Proof (Lean source)
@[fun_prop] lemma measurable_oracleSmoother (d : ℕ) (gamma : ℝ) (n m : ℕ) (e : Cov d → ℝ) (he : Measurable e) : Measurable (fun w : Sample d n m => oracleSmoother d gamma n m w e) := by unfold oracleSmoother clip fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_oracleSmoother · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:278
theorem measurable_oracleSmoother_designated Lemma measurable_oracleSmoother_designated in the paper ↗

For a primitive law P in the model class at overlap level eps and sample sizes n and m, the oracle smoother using its designated propensity is Borel.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
Measurable (fun w => oracleSmoother d gamma n m w (designatedPropensity P hP))
Proof (Lean source)
@[fun_prop] lemma measurable_oracleSmoother_designated {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) : Measurable (fun w => oracleSmoother d gamma n m w (designatedPropensity P hP)) := by fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_oracleSmoother_designated · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:285

Clipping bounds the smoother on every dataset, including inputs outside the model support. Given the specified input d, the specified input gamma, the specified input n, the specified input m, the specified input w, the specified input e, the oracle smoother bounded conclusion holds.

Formal statement
d :
ℕ
gamma :
ℝ
n m :
ℕ
w :
Sample d n m
e :
Cov d → ℝ
|oracleSmoother d gamma n m w e| ≤ 1
Proof (Lean source)
lemma oracleSmoother_bounded (d : ℕ) (gamma : ℝ) (n m : ℕ) (w : Sample d n m) (e : Cov d → ℝ) : |oracleSmoother d gamma n m w e| ≤ 1 := by unfold oracleSmoother clip dsimp only apply abs_le.mpr constructor · simpa only [neg_div] using (le_max_left (-1 : ℝ) _) · exact max_le (by norm_num) (min_le_left _ _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSmoother_bounded · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:291

The oracle decision space requires a Borel section for every supplied function. The zero branch makes the explicit smoother a total admissible rule. Given the specified input d, the specified input gamma, the specified input n, the specified input m, oracle smoother decision is the corresponding construction.

Definition (Lean source)
d :
ℕ
gamma :
ℝ
n m :
ℕ
oracleSmootherDecision d gamma n m :
⟨fun w e
=> if Measurable e then oracleSmoother d gamma n m w e else 0, by intro e by_cases he : Measurable e · simp only [if_pos he] exact measurable_oracleSmoother d gamma n m e he · simp only [if_neg he] fun_prop⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSmootherDecision · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:302
theorem oracleSmootherDecision_designated Lemma oracleSmootherDecision_designated in the paper ↗

The total oracle rule agrees with the stipulated smoother on every class member. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input w, the oracle smoother decision designated conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
w :
Sample d n m
Proof (Lean source)
lemma oracleSmootherDecision_designated {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (w : Sample d n m) : (oracleSmootherDecision d gamma n m).1 w (designatedPropensity P hP) = oracleSmoother d gamma n m w (designatedPropensity P hP) := by simp only [oracleSmootherDecision, if_pos (measurable_designatedPropensity P hP)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSmootherDecision_designated · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:313
theorem oracleRisk_le_of_oracleSmoother Lemma oracleRisk_le_of_oracleSmoother in the paper ↗

A uniform risk bound for the explicit smoother transfers to oracle minimax risk by using its total Borel extension as the candidate decision. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, the specified input B, the specified input hbound, the oracle risk le of oracle smoother conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
B :
ℝ≥0∞
hbound :
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
(∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m)
≤ B
oracleRisk d alpha beta gamma L eps n m ≤ B
Proof (Lean source)
lemma oracleRisk_le_of_oracleSmoother (d : ℕ) (alpha beta gamma L eps : ℝ) (n m : ℕ) (B : ℝ≥0∞) (hbound : ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), (∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m) ≤ B) : oracleRisk d alpha beta gamma L eps n m ≤ B := by unfold oracleRisk apply (minimaxValueENNReal_le_worstCaseRisk (oracleSmootherDecision d gamma n m)).trans apply worstCaseRiskENNReal_le intro P simp only [oracleSmootherDecision_designated] exact hbound P.1 P.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleRisk_le_of_oracleSmoother · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/OracleSmoother.lean:321
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationBiasGeometry 11 declarations Finite orthonormal expansions give the bilinear projection identity and the orthogonality cancellation used in the population-bias roadmap.

# Population bias projection geometry Finite orthonormal expansions give the bilinear projection identity and the orthogonality cancellation used in the population-bias roadmap. The causal response and Gram action give the exact bias identity; projection contraction and Cauchy–Schwarz give its coordinate and Euclidean bounds.

theorem population_projection_memLp Lemma population_projection_memLp in the paper ↗

A finite orthonormal projection preserves square integrability. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the population projection mem lp conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
MemLp (projOp d h J f) 2 (locLaw d h)
Proof (Lean source)
lemma population_projection_memLp (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : MemLp (projOp d h J f) 2 (locLaw d h) := by have he : projOp d h J f = fun x => ∑ z : FineIdx d J, fineBasis h J x z * (∫ y, fineBasis h J y z*f y ∂locLaw d h) := funext (projection_finite_expansion d h J hh hh' hJ f hf) rw [he] exact memLp_finsetSum _ (fun z _ => (fineBasis_memLp d h J hh hh' hJ z).mul_const _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_projection_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:21
theorem population_projection_coefficient Lemma population_projection_coefficient in the paper ↗

Orthogonal projection preserves each fine-basis coefficient. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the specified input z, the population projection coefficient conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
z :
(∫ x, fineBasis h J x z * projOp d h J f x ∂locLaw d h)
= ∫ x, fineBasis h J x z*f x ∂locLaw d h
Proof (Lean source)
lemma population_projection_coefficient (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) (z : FineIdx d J) : (∫ x, fineBasis h J x z * projOp d h J f x ∂locLaw d h) = ∫ x, fineBasis h J x z*f x ∂locLaw d h := by classical simp_rw [projection_finite_expansion d h J hh hh' hJ f hf, Finset.mul_sum, ← mul_assoc] rw [integral_finsetSum (f := fun w x => (fineBasis h J x z*fineBasis h J x w)*(∫ y, fineBasis h J y w*f y ∂locLaw d h)) univ (fun w _ => ((fineBasis_memLp d h J hh hh' hJ z).integrable_mul (fineBasis_memLp d h J hh hh' hJ w)).mul_const _)] simp_rw [integral_mul_const, fine_orthonormal d h J hh hh' hJ] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_projection_coefficient · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:32
theorem population_projection_inner Lemma population_projection_inner in the paper ↗

Pairing a projected function with any square-integrable function is the finite coefficient inner product. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input g, the specified input hf, the specified input hg, the population projection inner conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f g :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
hg :
MemLp g 2 (locLaw d h)
(∫ x, projOp d h J f x*g x ∂locLaw d h)
= ∑ z : FineIdx d J, (∫ x, fineBasis h J x z*f x ∂locLaw d h)* (∫ x, fineBasis h J x z*g x ∂locLaw d h)
Proof (Lean source)
lemma population_projection_inner (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f g : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) (hg : MemLp g 2 (locLaw d h)) : (∫ x, projOp d h J f x*g x ∂locLaw d h) = ∑ z : FineIdx d J, (∫ x, fineBasis h J x z*f x ∂locLaw d h)* (∫ x, fineBasis h J x z*g x ∂locLaw d h) := by simp_rw [projection_finite_expansion d h J hh hh' hJ f hf, Finset.sum_mul] simp_rw [show ∀ (z : FineIdx d J) x, fineBasis h J x z*(∫ y, fineBasis h J y z*f y ∂locLaw d h)*g x = (fineBasis h J x z*g x)*(∫ y, fineBasis h J y z*f y ∂locLaw d h) by intros; ring] rw [integral_finsetSum (f := fun z x => (fineBasis h J x z*g x)*(∫ y, fineBasis h J y z*f y ∂locLaw d h)) univ (fun z _ => ((fineBasis_memLp d h J hh hh' hJ z).integrable_mul hg).mul_const _)] simp_rw [integral_mul_const] apply Finset.sum_congr rfl intro z _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_projection_inner · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:49
theorem population_residual_inner_identity Lemma population_residual_inner_identity in the paper ↗

A control-mean residual pairs only with the residual of the propensity feature. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input g, the specified input hf, the specified input hg, the population residual inner identity conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f g :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
hg :
MemLp g 2 (locLaw d h)
(∫ x, f x*(g x-projOp d h J g x) ∂locLaw d h)
= ∫ x, (f x-projOp d h J f x)*(g x-projOp d h J g x) ∂locLaw d h
Proof (Lean source)
lemma population_residual_inner_identity (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f g : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) (hg : MemLp g 2 (locLaw d h)) : (∫ x, f x*(g x-projOp d h J g x) ∂locLaw d h) = ∫ x, (f x-projOp d h J f x)*(g x-projOp d h J g x) ∂locLaw d h := by have hpf := population_projection_memLp d h J hh hh' hJ f hf have hpg := population_projection_memLp d h J hh hh' hJ g hg have hc : (∫ x, projOp d h J f x*(g x-projOp d h J g x) ∂locLaw d h) = 0 := by simp_rw [mul_sub] rw [integral_sub (show Integrable (fun x => projOp d h J f x*g x) (locLaw d h) from hpf.integrable_mul hg) (show Integrable (fun x => projOp d h J f x*projOp d h J g x) (locLaw d h) from hpf.integrable_mul hpg), population_projection_inner d h J hh hh' hJ f g hf hg, population_projection_inner d h J hh hh' hJ f _ hf hpg] simp_rw [population_projection_coefficient d h J hh hh' hJ g hg] exact sub_self _ simp_rw [sub_mul] rw [integral_sub (show Integrable (fun x => f x*(g x-projOp d h J g x)) (locLaw d h) from hf.integrable_mul (hg.sub hpg)) (show Integrable (fun x => projOp d h J f x*(g x-projOp d h J g x)) (locLaw d h) from hpf.integrable_mul (hg.sub hpg)), hc, sub_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_residual_inner_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:70

Applying the population Gram matrix to polynomial coefficients gives the localized bilinear projection formula. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input theta, the specified input u, the population gram action conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
theta :
PolyIdx d → ℝ
u :
((qPop P n m h J).mulVec theta) u
= (∫ x, coarseBasis h x u * (designatedPropensity P hP x * pv h theta x) ∂locLaw d h)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * pv h theta x) ∂locLaw d h)
Proof (Lean source)
lemma population_gram_action {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (theta : PolyIdx d → ℝ) (u : PolyIdx d) : ((qPop P n m h J).mulVec theta) u = (∫ x, coarseBasis h x u * (designatedPropensity P hP x * pv h theta x) ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * pv h theta x) ∂locLaw d h) := by classical have hfirst : (∫ x, coarseBasis h x u * (designatedPropensity P hP x * pv h theta x) ∂locLaw d h) = ∑ v, (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h) * theta v := by simp only [pv, Finset.mul_sum] simp_rw [← mul_assoc] rw [integral_finsetSum (f := fun v x => coarseBasis h x u * designatedPropensity P hP x * coarseBasis h x v * theta v) univ (fun v _ => (show Integrable (fun x => coarseBasis h x u * designatedPropensity P hP x * coarseBasis h x v) (locLaw d h) by convert (coarseBasis_memLp d h hh hh' u).integrable_mul (designatedPropensity_mul_memLp P hP h hh' _ (coarseBasis_memLp d h hh hh' v)) using 1 ext x; simp only [Pi.mul_apply]; ring).mul_const _)] simp_rw [integral_mul_const] simp only [mulVec, dotProduct] simp_rw [population_gram_entries P hP n m hn h hh hh' J hJ, sub_mul, Finset.sum_sub_distrib, Finset.sum_mul] rw [hfirst, Finset.sum_comm] simp_rw [weighted_pv_projection_coefficient P hP h hh hh' J hJ theta, Finset.mul_sum, mul_assoc]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_gram_action · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:93
theorem measurable_designatedTreated Lemma measurable_designatedTreated in the paper ↗

For a primitive law P in the model class at overlap level eps, the designated treated mean is Borel.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Proof (Lean source)
@[fun_prop] lemma measurable_designatedTreated {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : Measurable (designatedTreated P hP) := by unfold designatedTreated have hc : MeasurableSet (cube d) := by unfold cube simp only [Set.ofPred_forall] apply MeasurableSet.iInter intro i exact measurableSet_Icc.preimage (by fun_prop) exact Measurable.ite hc (canonicalLaw P hP).measurable_mu1 measurable_const
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_designatedTreated · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:123

For a primitive law P in the model class at overlap level eps, the canonical treatment contrast is Borel.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Measurable (tau P hP)
Proof (Lean source)
@[fun_prop] lemma measurable_tau {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : Measurable (tau P hP) := by unfold tau fun_prop
theorem population_causal_memLp Lemma population_causal_memLp in the paper ↗

Interior arm means give square-integrable designated means and contrast. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the population causal mem lp conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
conclusion 1
conclusion 2
conclusion 3
MemLp (tau P hP) 2 (locLaw d h)
Proof (Lean source)
lemma population_causal_memLp {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) : MemLp (designatedControl P hP) 2 (locLaw d h) ∧ MemLp (designatedTreated P hP) 2 (locLaw d h) ∧ MemLp (tau P hP) 2 (locLaw d h) := by letI := localization_probability d h hh hh' have hae : ∀ᵐ x ∂locLaw d h, x ∈ locCube d h := by unfold locLaw apply Measure.ae_smul_measure exact ae_restrict_mem (isClosed_locCube d h).measurableSet have hs := canonicalLaw_spec P hP have hmu : MemLp (designatedControl P hP) 2 (locLaw d h) := by apply (memLp_top_of_bound (by fun_prop) 1 ?_).mono_exponent (by simp) filter_upwards [hae] with x hx have hc := locCube_subset_cube d h hh' hx have hi := hs.2.2.2.2.2.2.2.1 x hc simp only [designatedControl, if_pos hc, Real.norm_eq_abs] exact (abs_le.mpr ⟨by linarith [hi.1], by linarith [hi.2]⟩) have ht : MemLp (designatedTreated P hP) 2 (locLaw d h) := by apply (memLp_top_of_bound (by fun_prop) 1 ?_).mono_exponent (by simp) filter_upwards [hae] with x hx have hc := locCube_subset_cube d h hh' hx have hi := hs.2.2.2.2.2.2.2.2 x hc simp only [designatedTreated, if_pos hc, Real.norm_eq_abs] exact (abs_le.mpr ⟨by linarith [hi.1], by linarith [hi.2]⟩) exact ⟨hmu, ht, ht.sub hmu⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_causal_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:143
theorem population_bias_coordinate_identity Lemma population_bias_coordinate_identity in the paper ↗

Subtracting the population Gram action cancels the control mean except for its orthogonal projection residual. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input theta, the specified input u, the population bias coordinate identity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
theta :
PolyIdx d → ℝ
u :
rBar P n m h J u - ((qPop P n m h J).mulVec theta) u
= (∫ x, (designatedPropensity P hP x * coarseBasis h x u - projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x) * (designatedControl P hP x - projOp d h J (designatedControl P hP) x) ∂locLaw d h)
+ (∫ x, coarseBasis h x u * (designatedPropensity P hP x * (tau P hP x - pv h theta x)) ∂locLaw d h)
- (∫ x, projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x * (designatedPropensity P hP x * (tau P hP x - pv h theta x)) ∂locLaw d h)
Proof (Lean source)
lemma population_bias_coordinate_identity {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (theta : PolyIdx d → ℝ) (u : PolyIdx d) : rBar P n m h J u - ((qPop P n m h J).mulVec theta) u = (∫ x, (designatedPropensity P hP x * coarseBasis h x u - projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x) * (designatedControl P hP x - projOp d h J (designatedControl P hP) x) ∂locLaw d h) + (∫ x, coarseBasis h x u * (designatedPropensity P hP x * (tau P hP x - pv h theta x)) ∂locLaw d h) - (∫ x, projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x * (designatedPropensity P hP x * (tau P hP x - pv h theta x)) ∂locLaw d h) := by classical let e := designatedPropensity P hP let mu := designatedControl P hP let g := fun x => tau P hP x - pv h theta x let f := fun x => e x * coarseBasis h x u have hmu := (population_causal_memLp P hP h hh hh').1 have htreated := (population_causal_memLp P hP h hh hh').2.1 have htau := (population_causal_memLp P hP h hh hh').2.2 have hp := pv_memLp d h hh hh' theta have heg := designatedPropensity_mul_memLp P hP h hh' g (htau.sub hp) have hep := designatedPropensity_mul_memLp P hP h hh' _ hp have hf := designatedPropensity_mul_memLp P hP h hh' _ (coarseBasis_memLp d h hh hh' u) have hr := coarseBasis_memLp d h hh hh' u have hfst : (∫ x, coarseBasis h x u * e x * designatedTreated P hP x ∂locLaw d h) - (∫ x, coarseBasis h x u * (e x * pv h theta x) ∂locLaw d h) = (∫ x, f x * mu x ∂locLaw d h) + (∫ x, coarseBasis h x u * (e x * g x) ∂locLaw d h) := by rw [← integral_sub (by convert hf.integrable_mul htreated using 1; ext x; simp only [f, e, Pi.mul_apply]; ring) (show Integrable (fun x => coarseBasis h x u * (e x * pv h theta x)) (locLaw d h) from hr.integrable_mul hep), ← integral_add (show Integrable (fun x => f x * mu x) (locLaw d h) from hf.integrable_mul hmu) (show Integrable (fun x => coarseBasis h x u * (e x * g x)) (locLaw d h) from hr.integrable_mul heg)] apply integral_congr_ae filter_upwards [] with x simp only [f, g, e, tau] ring have hcoef (z : FineIdx d J) : (∫ x, fineBasis h J x z * (mu x + e x * tau P hP x) ∂locLaw d h) - (∫ x, fineBasis h J x z * (e x * pv h theta x) ∂locLaw d h) = (∫ x, fineBasis h J x z * mu x ∂locLaw d h) + (∫ x, fineBasis h J x z * (e x * g x) ∂locLaw d h) := by have hb := fineBasis_memLp d h J hh hh' hJ z have het := designatedPropensity_mul_memLp P hP h hh' _ htau rw [← integral_sub (show Integrable (fun x => fineBasis h J x z * (mu x + e x * tau P hP x)) (locLaw d h) from hb.integrable_mul (hmu.add het)) (show Integrable (fun x => fineBasis h J x z * (e x * pv h theta x)) (locLaw d h) from hb.integrable_mul hep), ← integral_add (show Integrable (fun x => fineBasis h J x z * mu x) (locLaw d h) from hb.integrable_mul hmu) (show Integrable (fun x => fineBasis h J x z * (e x * g x)) (locLaw d h) from hb.integrable_mul heg)] apply integral_congr_ae filter_upwards [] with x dsimp [g] ring rw [population_response_causal_entries P hP n m hn h hh hh' J hJ u, population_gram_action P hP n m hn h hh hh' J hJ theta u] change (_ - ∑ z, _ * (∫ x, fineBasis h J x z * (mu x + e x * tau P hP x) ∂locLaw d h)) - (_ - ∑ z, _ * (∫ x, fineBasis h J x z * (e x * pv h theta x) ∂locLaw d h)) = _ rw [show ∀ (a b c D : ℝ), (a-b)-(c-D) = (a-c)-(b-D) by intros; ring, hfst, ← Finset.sum_sub_distrib] simp_rw [← mul_sub, hcoef, mul_add, Finset.sum_add_distrib] rw [← population_projection_inner d h J hh hh' hJ f mu hf hmu, ← population_projection_inner d h J hh hh' hJ f (fun x => e x * g x) hf heg] have hres := population_residual_inner_identity d h J hh hh' hJ f mu hf hmu have hpg := population_projection_memLp d h J hh hh' hJ mu hmu have hself : (∫ x, projOp d h J f x * mu x ∂locLaw d h) = ∫ x, f x * projOp d h J mu x ∂locLaw d h := by rw [population_projection_inner d h J hh hh' hJ f mu hf hmu] simp_rw [mul_comm (f _) (projOp d h J mu _)] rw [population_projection_inner d h J hh hh' hJ mu f hmu hf] apply Finset.sum_congr rfl intro z _ ring have hres' : (∫ x, f x * mu x ∂locLaw d h) - (∫ x, projOp d h J f x * mu x ∂locLaw d h) = ∫ x, (f x - projOp d h J f x) * (mu x - projOp d h J mu x) ∂locLaw d h := by rw [hself, ← integral_sub (show Integrable (fun x => f x * mu x) (locLaw d h) from hf.integrable_mul hmu) (show Integrable (fun x => f x * projOp d h J mu x) (locLaw d h) from hf.integrable_mul hpg)] simp_rw [← mul_sub] exact hres dsimp only [f, g, e, mu] at hres' ⊢ linarith [hres']
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_bias_coordinate_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:172
theorem population_bias_coordinate_bound Lemma population_bias_coordinate_bound in the paper ↗

Projection contraction and overlap control the two Taylor-error pairings; Cauchy–Schwarz controls the product of the two nuisance residuals. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input theta, the specified input C, the specified input hC, the specified input herr, the specified input he, the specified input hmu, the specified input u, the population bias coordinate bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
theta :
PolyIdx d → ℝ
C :
ℝ
hC :
0 < C
herr :
∀ x ∈ locCube d h, |tau P hP x - pv h theta x| ≤ C*h^gamma
he :
∀ u : PolyIdx d,
sqrt (∫ x, (designatedPropensity P hP x * coarseBasis h x u - projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x)^2 ∂locLaw d h)
≤ C*(h/J)^alpha
hmu :
sqrt (∫ x, (designatedControl P hP x - projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h)
≤ C*(h/J)^beta
u :
|rBar P n m h J u - ((qPop P n m h J).mulVec theta) u|
≤ (C^2+2*C)*(h^gamma+(h/J)^(alpha+beta))
Proof (Lean source)
lemma population_bias_coordinate_bound {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (theta : PolyIdx d → ℝ) (C : ℝ) (hC : 0 < C) (herr : ∀ x ∈ locCube d h, |tau P hP x - pv h theta x| ≤ C*h^gamma) (he : ∀ u : PolyIdx d, Real.sqrt (∫ x, (designatedPropensity P hP x * coarseBasis h x u - projOp d h J (fun y => designatedPropensity P hP y * coarseBasis h y u) x)^2 ∂locLaw d h) ≤ C*(h/J)^alpha) (hmu : Real.sqrt (∫ x, (designatedControl P hP x - projOp d h J (designatedControl P hP) x)^2 ∂locLaw d h) ≤ C*(h/J)^beta) (u : PolyIdx d) : |rBar P n m h J u - ((qPop P n m h J).mulVec theta) u| ≤ (C^2+2*C)*(h^gamma+(h/J)^(alpha+beta)) := by letI := localization_probability d h hh hh' let e := designatedPropensity P hP let mu := designatedControl P hP let g := fun x => tau P hP x - pv h theta x let f := fun x => e x * coarseBasis h x u have hr := coarseBasis_memLp d h hh hh' u have hf := designatedPropensity_mul_memLp P hP h hh' _ hr have hm := (population_causal_memLp P hP h hh hh').1 have hg := (population_causal_memLp P hP h hh hh').2.2.sub (pv_memLp d h hh hh' theta) have heg := designatedPropensity_mul_memLp P hP h hh' _ hg have hpf := population_projection_memLp d h J hh hh' hJ f hf have hpm := population_projection_memLp d h J hh hh' hJ mu hm have hae : ∀ᵐ x ∂locLaw d h, x ∈ locCube d h := by unfold locLaw apply Measure.ae_smul_measure exact ae_restrict_mem (isClosed_locCube d h).measurableSet have hover := designatedPropensity_overlap_locLaw P hP h hh' have hepsP := hP.eps_pos have hrootr : Real.sqrt (∫ x, (coarseBasis h x u)^2 ∂locLaw d h) = 1 := by have ho := coarse_orthonormal d h hh hh' u u simpa only [← pow_two, ite_true, ho, Real.sqrt_one] using congrArg Real.sqrt ho have hfsq : (∫ x, (f x)^2 ∂locLaw d h) ≤ 1 := by have ho : (∫ x, (coarseBasis h x u)^2 ∂locLaw d h) = 1 := by simpa only [← pow_two, ite_true] using coarse_orthonormal d h hh hh' u u rw [← ho] apply integral_mono_ae hf.integrable_sq hr.integrable_sq filter_upwards [hover] with x hx change (designatedPropensity P hP x * coarseBasis h x u)^2 ≤ (coarseBasis h x u)^2 have heabs : |designatedPropensity P hP x| ≤ 1 := abs_le.mpr ⟨by linarith [hx.1], by linarith [hx.2]⟩ have hle : |designatedPropensity P hP x * coarseBasis h x u| ≤ |coarseBasis h x u| := by rw [abs_mul] exact mul_le_of_le_one_left (abs_nonneg _) heabs nlinarith [sq_abs (designatedPropensity P hP x * coarseBasis h x u), sq_abs (coarseBasis h x u), abs_nonneg (coarseBasis h x u), abs_nonneg (designatedPropensity P hP x * coarseBasis h x u)] have hpfroot : Real.sqrt (∫ x, (projOp d h J f x)^2 ∂locLaw d h) ≤ 1 := by have hpy := projection_pythagoras d h J hh hh' hJ f hf have hres : 0 ≤ ∫ x, (f x - projOp d h J f x)^2 ∂locLaw d h := integral_nonneg (fun _ => sq_nonneg _) apply (Real.sqrt_le_iff).2 constructor · norm_num · nlinarith have hnonneg : 0 ≤ C*h^gamma := mul_nonneg hC.le (Real.rpow_nonneg hh.le _) have hegsq : (∫ x, (e x * g x)^2 ∂locLaw d h) ≤ (C*h^gamma)^2 := by calc _ ≤ ∫ _x : Cov d, (C*h^gamma)^2 ∂locLaw d h := by apply integral_mono_ae heg.integrable_sq (integrable_const _) filter_upwards [hae, hover] with x hx hov have heabs : |e x| ≤ 1 := abs_le.mpr ⟨by dsimp [e]; linarith [hov.1], by dsimp [e]; linarith [hov.2]⟩ have hle : |e x * g x| ≤ C*h^gamma := by rw [abs_mul] exact (mul_le_of_le_one_left (abs_nonneg _) heabs).trans (herr x hx) change (e x * g x)^2 ≤ (C*h^gamma)^2 nlinarith [sq_abs (e x * g x), abs_nonneg (e x * g x)] _ = (C*h^gamma)^2 := by simp have hegroot : Real.sqrt (∫ x, (e x * g x)^2 ∂locLaw d h) ≤ C*h^gamma := (Real.sqrt_le_iff).2 ⟨hnonneg, hegsq⟩ have hbias : |∫ x, (f x-projOp d h J f x)*(mu x-projOp d h J mu x) ∂locLaw d h| ≤ C^2*(h/J)^(alpha+beta) := by calc _ ≤ Real.sqrt (∫ x, (f x-projOp d h J f x)^2 ∂locLaw d h) * Real.sqrt (∫ x, (mu x-projOp d h J mu x)^2 ∂locLaw d h) := abs_integral_mul_le_sqrt _ _ (hf.sub hpf) (hm.sub hpm) _ ≤ (C*(h/J)^alpha)*(C*(h/J)^beta) := mul_le_mul (he u) hmu (Real.sqrt_nonneg _) (by positivity) _ = C^2*(h/J)^(alpha+beta) := by rw [Real.rpow_add (div_pos hh (by exact_mod_cast hJ))] ring have hterm1 : |∫ x, coarseBasis h x u*(e x*g x) ∂locLaw d h| ≤ C*h^gamma := by have hc := abs_integral_mul_le_sqrt _ _ hr heg rw [hrootr, one_mul] at hc exact hc.trans hegroot have hterm2 : |∫ x, projOp d h J f x*(e x*g x) ∂locLaw d h| ≤ C*h^gamma := by calc _ ≤ Real.sqrt (∫ x, (projOp d h J f x)^2 ∂locLaw d h) * Real.sqrt (∫ x, (e x*g x)^2 ∂locLaw d h) := abs_integral_mul_le_sqrt _ _ hpf heg _ ≤ 1*(C*h^gamma) := mul_le_mul hpfroot hegroot (Real.sqrt_nonneg _) zero_le_one _ = _ := one_mul _ rw [population_bias_coordinate_identity P hP n m hn h hh hh' J hJ theta u] calc _ ≤ |∫ x, (f x-projOp d h J f x)*(mu x-projOp d h J mu x) ∂locLaw d h| + |∫ x, coarseBasis h x u*(e x*g x) ∂locLaw d h| + |∫ x, projOp d h J f x*(e x*g x) ∂locLaw d h| := (abs_sub _ _).trans (add_le_add (abs_add_le _ _) le_rfl) _ ≤ C^2*(h/J)^(alpha+beta) + C*h^gamma + C*h^gamma := add_le_add (add_le_add hbias hterm1) hterm2 _ ≤ (C^2+2*C)*(h^gamma+(h/J)^(alpha+beta)) := by have ha : 0 ≤ h^gamma := Real.rpow_nonneg hh.le _ have hb : 0 ≤ (h/(J:ℝ))^(alpha+beta) := Real.rpow_nonneg (by positivity) _ nlinarith [sq_nonneg C, mul_nonneg (sq_nonneg C) ha, mul_nonneg hC.le hb]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_bias_coordinate_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:255
theorem population_finite_norm_bound Lemma population_finite_norm_bound in the paper ↗

Coordinatewise absolute bounds imply the Euclidean bound in fixed dimension. Given the specified input v, the specified input B, the specified input hB, the specified input hv, the population finite norm bound conclusion holds.

Formal statement
ι :
Type*
v :
ι → ℝ
B :
ℝ
hB :
0 ≤ B
hv :
∀ i, |v i| ≤ B
sqrt (∑ i, (v i)^2) ≤ sqrt (card ι)*B
Proof (Lean source)
lemma population_finite_norm_bound {ι : Type*} [Fintype ι] (v : ι → ℝ) (B : ℝ) (hB : 0 ≤ B) (hv : ∀ i, |v i| ≤ B) : sqrt (∑ i, (v i)^2) ≤ sqrt (Fintype.card ι)*B := by have hs : (∑ i, (v i)^2) ≤ (Fintype.card ι : ℝ)*B^2 := by calc _ ≤ ∑ _i : ι, B^2 := Finset.sum_le_sum (fun i _ => by nlinarith [hv i, sq_abs (v i), abs_nonneg (v i)]) _ = _ := by simp calc _ ≤ sqrt ((Fintype.card ι : ℝ)*B^2) := Real.sqrt_le_sqrt hs _ = _ := by rw [Real.sqrt_mul (Nat.cast_nonneg _), Real.sqrt_sq hB]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_finite_norm_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationBiasGeometry.lean:360
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationCausalEntries 2 declarations The observed outcome moments are transported to the designated admissible versions and substituted into the population rectangular response formula.

# Localized causal response entries The observed outcome moments are transported to the designated admissible versions and substituted into the population rectangular response formula.

theorem population_localized_causal_moments Lemma population_localized_causal_moments in the paper ↗

Localization transports both observed response moments to designated causal versions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the population localized causal moments conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x ∈ locCube d h, ‖f x‖ ≤ B
conclusion 1
(∫ w, locWeight h w.1 * (f w.1 * bit w.2.1 * bit w.2.2) ∂obsLaw P)
= ∫ x, f x * designatedPropensity P hP x * designatedTreated P hP x ∂locLaw d h
conclusion 2
(∫ w, locWeight h w.1 * (f w.1 * bit w.2.2) ∂obsLaw P)
= ∫ x, f x * (designatedControl P hP x + designatedPropensity P hP x * tau P hP x) ∂locLaw d h
Proof (Lean source)
lemma population_localized_causal_moments {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x ∈ locCube d h, ‖f x‖ ≤ B) : ((∫ w, locWeight h w.1 * (f w.1 * bit w.2.1 * bit w.2.2) ∂obsLaw P) = ∫ x, f x * designatedPropensity P hP x * designatedTreated P hP x ∂locLaw d h) ∧ ((∫ w, locWeight h w.1 * (f w.1 * bit w.2.2) ∂obsLaw P) = ∫ x, f x * (designatedControl P hP x + designatedPropensity P hP x * tau P hP x) ∂locLaw d h) := by have hs := canonicalLaw_spec P hP have hobs : obsLaw P = obsLaw (canonicalLaw P hP) := by unfold obsLaw; rw [hs.1] let F := fun x => locWeight h x * f x have hF : Measurable F := by fun_prop have hFB := locWeight_mul_norm_bound h hh f B hB hfB have hFs : ∀ x, x ∉ cube d → F x = 0 := by intro x hx have hl : x ∉ locCube d h := fun hl => hx (locCube_subset_cube d h hh' hl) simp [F, locWeight, hl] have hB' : 0 ≤ h^(-(d:ℝ))*B := by positivity have ht := population_treated_outcome_moment (canonicalLaw P hP) hs.2.1 hs.2.2.1 hs.2.2.2.1 hs.2.2.2.2.2.2.2.2 F hF _ hB' hFB hFs have hy := population_outcome_moment (canonicalLaw P hP) hs.2.1 hs.2.2.1 hs.2.2.2.1 hs.2.2.2.2.2.2.2.1 hs.2.2.2.2.2.2.2.2 F hF _ hB' hFB hFs dsimp [F] at ht hy simp only [mul_assoc] at ht hy rw [uniformLaw_localization_integral d h hh hh'] at ht hy constructor · simp only [mul_assoc] rw [hobs, ht] unfold locLaw apply integral_congr_ae apply Measure.ae_smul_measure filter_upwards [ae_restrict_mem (isClosed_locCube d h).measurableSet] with x hx simp [designatedPropensity, designatedTreated, locCube_subset_cube d h hh' hx, mul_assoc] · rw [hobs, hy] unfold locLaw apply integral_congr_ae apply Measure.ae_smul_measure filter_upwards [ae_restrict_mem (isClosed_locCube d h).measurableSet] with x hx simp [designatedPropensity, designatedControl, designatedTreated, tau, locCube_subset_cube d h hh' hx]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_localized_causal_moments · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationCausalEntries.lean:17
theorem population_response_causal_entries Lemma population_response_causal_entries in the paper ↗

The population response vector uses the causal response mean in its projection correction. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input u, the population response causal entries conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
u :
rBar P n m h J u
= (∫ x, coarseBasis h x u * designatedPropensity P hP x * designatedTreated P hP x ∂locLaw d h)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedControl P hP x + designatedPropensity P hP x * tau P hP x) ∂locLaw d h)
Proof (Lean source)
lemma population_response_causal_entries {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (u : PolyIdx d) : rBar P n m h J u = (∫ x, coarseBasis h x u * designatedPropensity P hP x * designatedTreated P hP x ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedControl P hP x + designatedPropensity P hP x * tau P hP x) ∂locLaw d h) := by rw [population_response_observed_entries P hP n m hn h hh hh' J hJ u, (population_localized_causal_moments P hP h hh hh' (fun x => coarseBasis h x u) (by fun_prop) ((4:ℝ)^d) (by positivity) (by intro x hx; simpa only [Real.norm_eq_abs] using coarseBasis_abs_bound d h hh x hx u)).1] congr 1 apply Finset.sum_congr rfl intro z _ rw [(population_localized_causal_moments P hP h hh hh' (fun x => fineBasis h J x z) (by fun_prop) (sqrt ((J:ℝ)^d)*(4:ℝ)^d) (by positivity) (by intro x hx; simpa only [Real.norm_eq_abs] using fineBasis_abs_bound d h J hh hJ x z)).2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_response_causal_entries · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationCausalEntries.lean:63
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationEntries 6 declarations Finite kernel expansion and independence of the two roles compute the population Gram entries directly from the original-record experiment.

Population Gram entries

Finite kernel expansion and independence of the two roles compute the population Gram entries directly from the original-record experiment.

theorem population_outcome_role_integrable Lemma population_outcome_role_integrable in the paper ↗

Bounded treatment features remain integrable after averaging over the outcome role. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input f, the specified input hf, the specified input B, the specified input hfB, the population outcome role integrable conclusion holds.

Formal statement
d n m :
ℕ
P :
f :
Cov d × Bool → ℝ
hf :
B :
ℝ
hfB :
∀ z, ‖f z‖ ≤ B
Integrable (fun w : Sample d n m => (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m)
Proof (Lean source)
lemma population_outcome_role_integrable {d n m : ℕ} (P : PrimitiveLaw d) (f : Cov d × Bool → ℝ) (hf : Measurable f) (B : ℝ) (hfB : ∀ z, ‖f z‖ ≤ B) : Integrable (fun w : Sample d n m => (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m) := by classical letI := population_experiment_probability P n m apply Integrable.const_mul apply integrable_finsetSum intro j _ exact population_integrable_bounded _ _ (hf.comp (by fun_prop)) B (fun w => hfB _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_outcome_role_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:18
theorem population_rectangular_role_integrable Lemma population_rectangular_role_integrable in the paper ↗

Products of bounded features are integrable over the rectangular role average. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input B, the specified input C, the specified input hfB, the specified input hgC, the population rectangular role integrable conclusion holds.

Formal statement
d n m :
ℕ
P :
f g :
Cov d × Bool → ℝ
hf :
hg :
B C :
ℝ
hfB :
∀ z, ‖f z‖ ≤ B
hgC :
∀ z, ‖g z‖ ≤ C
Integrable (fun w : Sample d n m => ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m)
Proof (Lean source)
lemma population_rectangular_role_integrable {d n m : ℕ} (P : PrimitiveLaw d) (f g : Cov d × Bool → ℝ) (hf : Measurable f) (hg : Measurable g) (B C : ℝ) (hfB : ∀ z, ‖f z‖ ≤ B) (hgC : ∀ z, ‖g z‖ ≤ C) : Integrable (fun w : Sample d n m => ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m) := by classical letI := population_experiment_probability P n m apply Integrable.const_mul apply integrable_finsetSum intro i _ apply integrable_finsetSum intro j _ apply population_integrable_bounded _ _ (by fun_prop) (B*C) intro w rw [norm_mul] exact mul_le_mul (hfB _) (hgC _) (norm_nonneg _) ((norm_nonneg (f (treatmentRecords w.1 i))).trans (hfB _))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_rectangular_role_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:30
theorem population_basis_product_bounds Lemma population_basis_product_bounds in the paper ↗

Coarse products and coarse-fine products have finite bounds on the localization box. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input u, the specified input v, the specified input z, the population basis product bounds conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
u v :
z :
conclusion 1
x ∈ locCube d h :
‖coarseBasis h x u * coarseBasis h x v‖ ≤ (4:ℝ)^d * (4:ℝ)^d
conclusion 2
x ∈ locCube d h :
‖coarseBasis h x u * fineBasis h J x z‖ ≤ (4:ℝ)^d * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)
Proof (Lean source)
lemma population_basis_product_bounds (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (u v : PolyIdx d) (z : FineIdx d J) : (∀ x ∈ locCube d h, ‖coarseBasis h x u * coarseBasis h x v‖ ≤ (4:ℝ)^d * (4:ℝ)^d) ∧ (∀ x ∈ locCube d h, ‖coarseBasis h x u * fineBasis h J x z‖ ≤ (4:ℝ)^d * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)) := by constructor · intro x hx rw [norm_mul, Real.norm_eq_abs, Real.norm_eq_abs] exact mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (coarseBasis_abs_bound d h hh x hx v) (abs_nonneg _) (by positivity) · intro x hx rw [norm_mul, Real.norm_eq_abs, Real.norm_eq_abs] exact mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (fineBasis_abs_bound d h J hh hJ x z) (abs_nonneg _) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_basis_product_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:50
theorem qRaw_finite_role_expansion Lemma qRaw_finite_role_expansion in the paper ↗

Expanding the fine kernel decomposes the raw Gram entry into finite role averages. Given the specified input d, the specified input n, the specified input m, the specified input D, the specified input h, the specified input J, the specified input u, the specified input v, the q raw finite role expansion conclusion holds.

Formal statement
d n m :
ℕ
D :
Dataset d n m
h :
ℝ
J :
ℕ
u v :
qRaw D h J u v
= (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, weightedTreatmentFeature h (fun x => coarseBasis h x u * coarseBasis h x v) ((D.1 j).1, (D.1 j).2.1)
- ∑ z : FineIdx d J, ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, weightedTreatmentFeature h (fun x => coarseBasis h x u * fineBasis h J x z) (treatmentRecords D i) * weightedTreatmentFeature h (fun x => coarseBasis h x v * fineBasis h J x z) ((D.1 j).1, (D.1 j).2.1)
Proof (Lean source)
lemma qRaw_finite_role_expansion {d n m : ℕ} (D : Dataset d n m) (h : ℝ) (J : ℕ) (u v : PolyIdx d) : qRaw D h J u v = (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, weightedTreatmentFeature h (fun x => coarseBasis h x u * coarseBasis h x v) ((D.1 j).1, (D.1 j).2.1) - ∑ z : FineIdx d J, ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, weightedTreatmentFeature h (fun x => coarseBasis h x u * fineBasis h J x z) (treatmentRecords D i) * weightedTreatmentFeature h (fun x => coarseBasis h x v * fineBasis h J x z) ((D.1 j).1, (D.1 j).2.1) := by classical unfold qRaw weightedTreatmentFeature fineKernel congr 1 · congr 1 apply Finset.sum_congr rfl intro j _ ring · simp only [Finset.mul_sum] conv_rhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ apply Finset.sum_congr rfl intro z _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qRaw_finite_role_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:66
theorem population_raw_gram_entries Lemma population_raw_gram_entries in the paper ↗

Raw Gram entries are integrable and have the expected localized coordinate formula. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input u, the specified input v, the population raw gram entries conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
u v :
conclusion 1
Integrable (fun w : Sample d n m => qRaw w.1 h J u v) (experiment P n m)
conclusion 2
(∫ w : Sample d n m, qRaw w.1 h J u v ∂experiment P n m)
= (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h)
Proof (Lean source)
lemma population_raw_gram_entries {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (u v : PolyIdx d) : Integrable (fun w : Sample d n m => qRaw w.1 h J u v) (experiment P n m) ∧ (∫ w : Sample d n m, qRaw w.1 h J u v ∂experiment P n m) = (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h) := by classical let f := weightedTreatmentFeature h (fun x => coarseBasis h x u * coarseBasis h x v) let g := fun (a : PolyIdx d) (z : FineIdx d J) => weightedTreatmentFeature h (fun x => coarseBasis h x a * fineBasis h J x z) let B : ℝ := h^(-(d:ℝ)) * ((4:ℝ)^d * (4:ℝ)^d) let C : ℝ := h^(-(d:ℝ)) * ((4:ℝ)^d * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)) have hf : Measurable f := by dsimp [f]; fun_prop have hg (a z) : Measurable (g a z) := by dsimp [g]; fun_prop have hfB (w) : ‖f w‖ ≤ B := weightedTreatmentFeature_norm_bound h hh _ _ (by positivity) (fun x hx => by rw [norm_mul, Real.norm_eq_abs, Real.norm_eq_abs] exact mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (coarseBasis_abs_bound d h hh x hx v) (abs_nonneg _) (by positivity)) w have hgC (a z w) : ‖g a z w‖ ≤ C := weightedTreatmentFeature_norm_bound h hh _ _ (by positivity) (population_basis_product_bounds d h J hh hJ a a z).2 w have hi := population_outcome_role_integrable (n := n) (m := m) P f hf B hfB have hj (z) := population_rectangular_role_integrable (n := n) (m := m) P (g u z) (g v z) (hg u z) (hg v z) C C (hgC u z) (hgC v z) have heq := qRaw_finite_role_expansion (d := d) (n := n) (m := m) constructor · simp_rw [heq] exact hi.sub (integrable_finsetSum _ (fun z _ => hj z)) · simp_rw [heq] rw [integral_sub hi (integrable_finsetSum _ (fun z _ => hj z)), integral_finsetSum _ (fun z _ => hj z), population_outcome_role_mean P hn f hf B hfB] simp_rw [population_rectangular_role_mean P hn (g u _) (g v _) (hg u _) (hg v _) C C (hgC u _) (hgC v _)] have hfm := designated_local_treatment_moment P hP h hh hh' (fun x => coarseBasis h x u * coarseBasis h x v) (by fun_prop) ((4:ℝ)^d * (4:ℝ)^d) (by positivity) (fun x hx => by rw [norm_mul, Real.norm_eq_abs, Real.norm_eq_abs] exact mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (coarseBasis_abs_bound d h hh x hx v) (abs_nonneg _) (by positivity)) have hgm (a z) := designated_local_treatment_moment P hP h hh hh' (fun x => coarseBasis h x a * fineBasis h J x z) (by fun_prop) ((4:ℝ)^d * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)) (by positivity) (population_basis_product_bounds d h J hh hJ a a z).2 change (∫ w, locWeight h w.1 * (coarseBasis h w.1 u * coarseBasis h w.1 v) * bit w.2 ∂xaLaw P) - ∑ z, (∫ w, locWeight h w.1 * (coarseBasis h w.1 u * fineBasis h J w.1 z) * bit w.2 ∂xaLaw P) * (∫ w, locWeight h w.1 * (coarseBasis h w.1 v * fineBasis h J w.1 z) * bit w.2 ∂xaLaw P) = _ rw [hfm] simp_rw [hgm] congr 1 · apply integral_congr_ae filter_upwards [] with x ring · apply Finset.sum_congr rfl intro z _ congr 1 <;> apply integral_congr_ae <;> filter_upwards [] with x <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_raw_gram_entries · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:97
theorem population_gram_entries Lemma population_gram_entries in the paper ↗

Symmetrization preserves the symmetric localized population Gram formula. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input u, the specified input v, the population gram entries conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
u v :
qPop P n m h J u v
= (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h)
Proof (Lean source)
lemma population_gram_entries {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (u v : PolyIdx d) : qPop P n m h J u v = (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h) := by have huv := population_raw_gram_entries P hP n m hn h hh hh' J hJ u v have hvu := population_raw_gram_entries P hP n m hn h hh hh' J hJ v u unfold qPop qHat simp_rw [div_eq_mul_inv] rw [integral_mul_const, integral_add huv.1 hvu.1, huv.2, hvu.2] have hs : (∫ x, coarseBasis h x v * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) = ∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h := by apply integral_congr_ae filter_upwards [] with x ring rw [hs] simp_rw [mul_comm (∫ x, fineBasis h J x _ * (designatedPropensity P hP x * coarseBasis h x v) ∂locLaw d h)] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_gram_entries · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationEntries.lean:159
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationGram 20 declarations Two-channel point-CATE annotation frontier: Helpers/PopulationGram constructions and obligations.

Helpers/PopulationGram

Two-channel point-CATE annotation frontier: Helpers/PopulationGram constructions and obligations.

theorem finite_orthonormal_square_norm Lemma finite_orthonormal_square_norm in the paper ↗

The squared norm of a finite orthonormal expansion is the squared coefficient norm. Given the specified input b, the specified input hb, the specified input hortho, the specified input v, the finite orthonormal square norm conclusion holds.

Formal statement
Ω ι :
μ :
b :
ι → Ω → ℝ
hb :
∀ i, MemLp (b i) 2 μ
hortho :
∀ i j, (∫ x, b i x * b j x ∂μ) = if i = j then 1 else 0
v :
ι → ℝ
(∫ x, (∑ i, b i x * v i)^2 ∂μ) = ∑ i, (v i)^2
Proof (Lean source)
lemma finite_orthonormal_square_norm {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] (μ : Measure Ω) (b : ι → Ω → ℝ) (hb : ∀ i, MemLp (b i) 2 μ) (hortho : ∀ i j, (∫ x, b i x * b j x ∂μ) = if i = j then 1 else 0) (v : ι → ℝ) : (∫ x, (∑ i, b i x * v i)^2 ∂μ) = ∑ i, (v i)^2 := by classical have hexpand (x : Ω) : (∑ i, b i x * v i)^2 = ∑ i, ∑ j, (b i x * b j x) * (v i * v j) := by simp only [pow_two, Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring simp_rw [hexpand] rw [integral_finsetSum (f := fun i x => ∑ j, (b i x * b j x) * (v i * v j)) univ (fun i _ => integrable_finsetSum _ (fun j _ => ((hb i).integrable_mul (hb j)).mul_const (v i * v j)))] congr 1 funext i rw [integral_finsetSum (f := fun j x => (b i x * b j x) * (v i * v j)) univ (fun j _ => ((hb i).integrable_mul (hb j)).mul_const (v i * v j))] simp_rw [integral_mul_const, hortho] simp [pow_two]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_orthonormal_square_norm · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:23

Coarse orthonormality supplies square integrability of each polynomial basis entry. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input u, the coarse basis mem lp conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
u :
MemLp (fun x => coarseBasis h x u) 2 (locLaw d h)
Proof (Lean source)
lemma coarseBasis_memLp (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (u : PolyIdx d) : MemLp (fun x => coarseBasis h x u) 2 (locLaw d h) := by apply (memLp_two_iff_integrable_sq (by fun_prop)).2 by_contra hi have hz := integral_undef hi have ho := coarse_orthonormal d h hh hh' u u simp only [ite_true, ← pow_two] at ho rw [hz] at ho norm_num at ho
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coarseBasis_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:49

Polynomial coefficient vectors define square-integrable localization polynomials. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input v, the pv mem lp conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
v :
PolyIdx d → ℝ
MemLp (pv h v) 2 (locLaw d h)
Proof (Lean source)
lemma pv_memLp (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (v : PolyIdx d → ℝ) : MemLp (pv h v) 2 (locLaw d h) := by exact memLp_finsetSum _ (fun u _ => (coarseBasis_memLp d h hh hh' u).mul_const (v u))

Coarse orthonormality identifies polynomial and coefficient squared norms. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input v, the pv square norm conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
v :
PolyIdx d → ℝ
(∫ x, (pv h v x)^2 ∂locLaw d h) = ∑ u, (v u)^2
Proof (Lean source)
lemma pv_square_norm (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (v : PolyIdx d → ℝ) : (∫ x, (pv h v x)^2 ∂locLaw d h) = ∑ u, (v u)^2 := by exact finite_orthonormal_square_norm (locLaw d h) (fun u x => coarseBasis h x u) (coarseBasis_memLp d h hh hh') (fun i j => by have ho := coarse_orthonormal d h hh hh' i j by_cases hij : i = j · simp only [if_pos hij] at ho ⊢; exact ho · simp only [if_neg hij] at ho ⊢; exact ho) v
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.pv_square_norm · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:65
theorem overlap_weighted_square_lower Lemma overlap_weighted_square_lower in the paper ↗

Overlap at level eps bounds the weighted squared integral below by eps·(1 − eps) times its norm. Given the specified input μ, the specified input e, the specified input f, the overlap level eps, its nonnegativity, the specified input he, the specified input hf, the specified input hoverlap, the overlap weighted square lower conclusion holds.

Formal statement
Ω :
μ :
e f :
Ω → ℝ
eps :
ℝ
heps :
0 ≤ eps
he :
hf :
MemLp f 2 μ
hoverlap :
∀ᵐ x ∂μ, eps ≤ e x ∧ e x ≤ 1 - eps
eps * (1 - eps) * (∫ x, (f x)^2 ∂μ) ≤ ∫ x, e x * (1-e x) * (f x)^2 ∂μ
Proof (Lean source)
lemma overlap_weighted_square_lower {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (e f : Ω → ℝ) (eps : ℝ) (heps : 0 ≤ eps) (he : AEMeasurable e μ) (hf : MemLp f 2 μ) (hoverlap : ∀ᵐ x ∂μ, eps ≤ e x ∧ e x ≤ 1 - eps) : eps * (1 - eps) * (∫ x, (f x)^2 ∂μ) ≤ ∫ x, e x * (1-e x) * (f x)^2 ∂μ := by have hweight : ∀ᵐ x ∂μ, eps * (1 - eps) ≤ e x * (1-e x) ∧ e x * (1-e x) ≤ 1 ∧ 0 ≤ e x * (1-e x) := by filter_upwards [hoverlap] with x hx have hprod := mul_nonneg (sub_nonneg.mpr hx.1) (sub_nonneg.mpr hx.2) have h0 : 0 ≤ e x := le_trans heps hx.1 have h1 : 0 ≤ 1 - e x := by linarith [hx.2] refine ⟨by nlinarith, by nlinarith [sq_nonneg (e x - 1/2)], mul_nonneg h0 h1⟩ have hi : Integrable (fun x => e x * (1-e x) * (f x)^2) μ := by apply hf.integrable_sq.mono' · exact (he.aestronglyMeasurable.mul (aestronglyMeasurable_const.sub he.aestronglyMeasurable)).mul (hf.aestronglyMeasurable.pow 2) · filter_upwards [hweight] with x hx rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hx.2.2 (sq_nonneg _))] exact mul_le_of_le_one_left (sq_nonneg _) hx.2.1 have hm := integral_mono_ae (hf.integrable_sq.const_mul (eps * (1 - eps))) hi (by filter_upwards [hweight] with x hx exact mul_le_mul_of_nonneg_right hx.1 (sq_nonneg _)) rwa [integral_const_mul] at hm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.overlap_weighted_square_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:75
theorem projection_overlap_lower Lemma projection_overlap_lower in the paper ↗

The overlap contribution and the projection residual give the deterministic positivity bound. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input e, the specified input f, the specified input he, the specified input hf, the specified input hef, the specified input hoverlap, the overlap level eps, the projection overlap lower conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
e f :
Cov d → ℝ
eps :
ℝ
heps :
0 ≤ eps
he :
hf :
MemLp f 2 (locLaw d h)
hef :
MemLp (fun x => e x * f x) 2 (locLaw d h)
hoverlap :
∀ᵐ x ∂locLaw d h, eps ≤ e x ∧ e x ≤ 1 - eps
conclusion 1
(∫ x, (e x * f x)^2 ∂locLaw d h)
= (∫ x, (projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h)
+ (∫ x, (e x * f x - projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h)
conclusion 2
eps * (1 - eps) * (∫ x, (f x)^2 ∂locLaw d h)
≤ (∫ x, e x * (1-e x) * (f x)^2 ∂locLaw d h)
+ (∫ x, (e x * f x - projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h)
Proof (Lean source)
lemma projection_overlap_lower (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (e f : Cov d → ℝ) (eps : ℝ) (heps : 0 ≤ eps) (he : AEMeasurable e (locLaw d h)) (hf : MemLp f 2 (locLaw d h)) (hef : MemLp (fun x => e x * f x) 2 (locLaw d h)) (hoverlap : ∀ᵐ x ∂locLaw d h, eps ≤ e x ∧ e x ≤ 1 - eps) : (∫ x, (e x * f x)^2 ∂locLaw d h) = (∫ x, (projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h) + (∫ x, (e x * f x - projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h) ∧ eps * (1 - eps) * (∫ x, (f x)^2 ∂locLaw d h) ≤ (∫ x, e x * (1-e x) * (f x)^2 ∂locLaw d h) + (∫ x, (e x * f x - projOp d h J (fun y => e y * f y) x)^2 ∂locLaw d h) := by refine ⟨projection_pythagoras d h J hh hh' hJ _ hef, ?_⟩ exact (overlap_weighted_square_lower (locLaw d h) e f eps heps he hf hoverlap).trans (le_add_of_nonneg_right (integral_nonneg (fun x => sq_nonneg _)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projection_overlap_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:103

Every admissible localization box lies inside the design cube. Given the specified input d, the specified input h, the specified input hh', the loc cube subset cube conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh' :
h ≤ 1/2
locCube d h ⊆ cube d
Proof (Lean source)
lemma locCube_subset_cube (d : ℕ) (h : ℝ) (hh' : h ≤ 1/2) : locCube d h ⊆ cube d := by intro x hx i have hxi := hx i constructor <;> linarith [hxi.1, hxi.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locCube_subset_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:120
theorem measurable_designatedPropensity Lemma measurable_designatedPropensity in the paper ↗

For a primitive law P in the model class at overlap level eps, the designated propensity is Borel on the whole covariate space.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Proof (Lean source)
@[fun_prop] lemma measurable_designatedPropensity {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : Measurable (designatedPropensity P hP) := by unfold designatedPropensity have hc : MeasurableSet (cube d) := by unfold cube simp only [Set.ofPred_forall] apply MeasurableSet.iInter intro i exact measurableSet_Icc.preimage (by fun_prop) exact Measurable.ite hc (canonicalLaw P hP).measurable_e measurable_const
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_designatedPropensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:127
theorem designatedPropensity_overlap_locLaw Lemma designatedPropensity_overlap_locLaw in the paper ↗

Localization inherits the overlap interval from primitive-class membership. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh', the designated propensity overlap loc law conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh' :
h ≤ 1/2
∀ᵐ x ∂locLaw d h, eps
≤ designatedPropensity P hP x ∧ designatedPropensity P hP x ≤ 1 - eps
Proof (Lean source)
lemma designatedPropensity_overlap_locLaw {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh' : h ≤ 1/2) : ∀ᵐ x ∂locLaw d h, eps ≤ designatedPropensity P hP x ∧ designatedPropensity P hP x ≤ 1 - eps := by unfold locLaw apply Measure.ae_smul_measure filter_upwards [ae_restrict_mem (isClosed_locCube d h).measurableSet] with x hx have hc := locCube_subset_cube d h hh' hx simpa only [designatedPropensity, if_pos hc] using (canonicalLaw_spec P hP).2.2.2.1.2 x hc
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedPropensity_overlap_locLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:140
theorem population_expression_positivity Lemma population_expression_positivity in the paper ↗

The deterministic population expression has the claimed coefficient lower bound. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input v, the population expression positivity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
v :
PolyIdx d → ℝ
eps * (1 - eps) * (∑ u, (v u)^2)
≤ (∫ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (pv h v x)^2 ∂locLaw d h)
+ (∫ x, (designatedPropensity P hP x * pv h v x - projOp d h J (fun y => designatedPropensity P hP y * pv h v y) x)^2 ∂locLaw d h)
Proof (Lean source)
lemma population_expression_positivity {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (v : PolyIdx d → ℝ) : eps * (1 - eps) * (∑ u, (v u)^2) ≤ (∫ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (pv h v x)^2 ∂locLaw d h) + (∫ x, (designatedPropensity P hP x * pv h v x - projOp d h J (fun y => designatedPropensity P hP y * pv h v y) x)^2 ∂locLaw d h) := by rw [← pv_square_norm d h hh hh' v] exact (overlap_weighted_square_lower (locLaw d h) _ _ eps hP.eps_pos.le (measurable_designatedPropensity P hP).aemeasurable (pv_memLp d h hh hh' v) (designatedPropensity_overlap_locLaw P hP h hh')).trans (le_add_of_nonneg_right (integral_nonneg (fun x => sq_nonneg _)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_expression_positivity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:153
theorem designatedPropensity_mul_memLp Lemma designatedPropensity_mul_memLp in the paper ↗

A bounded propensity preserves square integrability under localization. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh', the specified input f, the specified input hf, the designated propensity mul mem lp conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh' :
h ≤ 1/2
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
MemLp (fun x => designatedPropensity P hP x * f x) 2 (locLaw d h)
Proof (Lean source)
lemma designatedPropensity_mul_memLp {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh' : h ≤ 1/2) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : MemLp (fun x => designatedPropensity P hP x * f x) 2 (locLaw d h) := by apply hf.of_le_mul ((measurable_designatedPropensity P hP).aestronglyMeasurable.mul hf.aestronglyMeasurable) (c := 1) filter_upwards [designatedPropensity_overlap_locLaw P hP h hh'] with x hx change ‖designatedPropensity P hP x * f x‖ ≤ 1 * ‖f x‖ rw [norm_mul, Real.norm_eq_abs (designatedPropensity P hP x), abs_of_nonneg (by linarith [hx.1, hP.eps_pos]), one_mul] exact mul_le_of_le_one_left (norm_nonneg _) (by linarith [hx.2, hP.eps_pos])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedPropensity_mul_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:168
theorem designatedPropensity_square_integrable Lemma designatedPropensity_square_integrable in the paper ↗

The first population energy is integrable because overlap bounds its multiplier. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh', the specified input f, the specified input hf, the designated propensity square integrable conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh' :
h ≤ 1/2
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
Integrable (fun x => designatedPropensity P hP x * (f x)^2) (locLaw d h)
Proof (Lean source)
lemma designatedPropensity_square_integrable {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh' : h ≤ 1/2) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : Integrable (fun x => designatedPropensity P hP x * (f x)^2) (locLaw d h) := by apply hf.integrable_sq.mono' · exact (measurable_designatedPropensity P hP).aestronglyMeasurable.mul (hf.aestronglyMeasurable.pow 2) · filter_upwards [designatedPropensity_overlap_locLaw P hP h hh'] with x hx rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (by linarith [hx.1, hP.eps_pos]) (sq_nonneg _))] exact mul_le_of_le_one_left (sq_nonneg _) (by linarith [hx.2, hP.eps_pos])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedPropensity_square_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:182
theorem population_projection_energy_identity Lemma population_projection_energy_identity in the paper ↗

Pythagoras turns the population first energy minus the projected energy into an overlap energy plus the nonnegative projection residual. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input f, the specified input hf, the population projection energy identity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
(∫ x, designatedPropensity P hP x * (f x)^2 ∂locLaw d h)
- (∫ x, (projOp d h J (fun y => designatedPropensity P hP y * f y) x)^2 ∂locLaw d h)
= (∫ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (f x)^2 ∂locLaw d h)
+ (∫ x, (designatedPropensity P hP x * f x - projOp d h J (fun y => designatedPropensity P hP y * f y) x)^2 ∂locLaw d h)
Proof (Lean source)
lemma population_projection_energy_identity {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : (∫ x, designatedPropensity P hP x * (f x)^2 ∂locLaw d h) - (∫ x, (projOp d h J (fun y => designatedPropensity P hP y * f y) x)^2 ∂locLaw d h) = (∫ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (f x)^2 ∂locLaw d h) + (∫ x, (designatedPropensity P hP x * f x - projOp d h J (fun y => designatedPropensity P hP y * f y) x)^2 ∂locLaw d h) := by have hef := designatedPropensity_mul_memLp P hP h hh' f hf have hi := designatedPropensity_square_integrable P hP h hh' f hf have hpyth := projection_pythagoras d h J hh hh' hJ _ hef have hsplit : (∫ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (f x)^2 ∂locLaw d h) = (∫ x, designatedPropensity P hP x * (f x)^2 ∂locLaw d h) - (∫ x, (designatedPropensity P hP x * f x)^2 ∂locLaw d h) := by simp_rw [show ∀ x, designatedPropensity P hP x * (1-designatedPropensity P hP x) * (f x)^2 = designatedPropensity P hP x * (f x)^2 - (designatedPropensity P hP x * f x)^2 by intro x; ring] exact integral_sub hi hef.integrable_sq rw [hsplit, hpyth] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_projection_energy_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:195
theorem finite_bilinear_integral_quadratic Lemma finite_bilinear_integral_quadratic in the paper ↗

A finite bilinear integral matrix acts on coefficients by integrating the product of their two finite expansions. Given the specified input a, the specified input b, the specified input hab, the specified input v, the finite bilinear integral quadratic conclusion holds.

Formal statement
Ω ι :
μ :
a b :
ι → Ω → ℝ
hab :
∀ i j, Integrable (fun x => a i x * b j x) μ
v :
ι → ℝ
(∑ i, v i * (∑ j, (∫ x, a i x * b j x ∂μ) * v j))
= ∫ x, (∑ i, a i x * v i) * (∑ j, b j x * v j) ∂μ
Proof (Lean source)
lemma finite_bilinear_integral_quadratic {Ω ι : Type*} [MeasurableSpace Ω] [Fintype ι] (μ : Measure Ω) (a b : ι → Ω → ℝ) (hab : ∀ i j, Integrable (fun x => a i x * b j x) μ) (v : ι → ℝ) : (∑ i, v i * (∑ j, (∫ x, a i x * b j x ∂μ) * v j)) = ∫ x, (∑ i, a i x * v i) * (∑ j, b j x * v j) ∂μ := by classical have hexpand (x : Ω) : (∑ i, a i x * v i) * (∑ j, b j x * v j) = ∑ i, ∑ j, (a i x * b j x) * (v i * v j) := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro i _ rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ ring simp_rw [hexpand] rw [integral_finsetSum (f := fun i x => ∑ j, (a i x * b j x) * (v i * v j)) univ (fun i _ => integrable_finsetSum _ (fun j _ => (hab i j).mul_const (v i * v j)))] simp_rw [integral_finsetSum univ (fun j _ => (hab _ j).mul_const (v _ * v j)), integral_mul_const, Finset.mul_sum] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_bilinear_integral_quadratic · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:221
theorem finite_coefficient_gram_quadratic Lemma finite_coefficient_gram_quadratic in the paper ↗

The quadratic form of a finite coefficient Gram matrix is the sum of the squared coefficient expansions. Given the specified input c, the specified input v, the finite coefficient gram quadratic conclusion holds.

Formal statement
ι ζ :
Type*
c :
ζ → ι → ℝ
v :
ι → ℝ
(∑ i, v i * (∑ j, (∑ z, c z i * c z j) * v j)) = ∑ z, (∑ i, c z i * v i)^2
Proof (Lean source)
lemma finite_coefficient_gram_quadratic {ι ζ : Type*} [Fintype ι] [Fintype ζ] (c : ζ → ι → ℝ) (v : ι → ℝ) : (∑ i, v i * (∑ j, (∑ z, c z i * c z j) * v j)) = ∑ z, (∑ i, c z i * v i)^2 := by classical simp only [Finset.mul_sum, Finset.sum_mul, pow_two] rw [Finset.sum_comm] conv_lhs => arg 2; ext j; rw [Finset.sum_comm] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro z _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_coefficient_gram_quadratic · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:250
theorem projection_finite_expansion Lemma projection_finite_expansion in the paper ↗

Finite kernel integration expands the projection in its orthonormal basis. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the specified input x, the projection finite expansion conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
x :
Cov d
projOp d h J f x
= ∑ z : FineIdx d J, fineBasis h J x z * (∫ y, fineBasis h J y z * f y ∂locLaw d h)
Proof (Lean source)
lemma projection_finite_expansion (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) (x : Cov d) : projOp d h J f x = ∑ z : FineIdx d J, fineBasis h J x z * (∫ y, fineBasis h J y z * f y ∂locLaw d h) := by unfold projOp fineKernel simp_rw [Finset.sum_mul, mul_assoc] rw [integral_finsetSum (f := fun z y => fineBasis h J x z * (fineBasis h J y z * f y)) univ (fun z _ => ((fineBasis_memLp d h J hh hh' hJ z).integrable_mul hf).const_mul (fineBasis h J x z))] simp_rw [integral_const_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projection_finite_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:270
theorem projection_square_coefficients Lemma projection_square_coefficients in the paper ↗

Projection energy is exactly the sum of squared orthonormal coefficients. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the projection square coefficients conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
(∫ x, (projOp d h J f x)^2 ∂locLaw d h)
= ∑ z : FineIdx d J, (∫ y, fineBasis h J y z * f y ∂locLaw d h)^2
Proof (Lean source)
lemma projection_square_coefficients (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : (∫ x, (projOp d h J f x)^2 ∂locLaw d h) = ∑ z : FineIdx d J, (∫ y, fineBasis h J y z * f y ∂locLaw d h)^2 := by simp_rw [projection_finite_expansion d h J hh hh' hJ f hf] exact finite_orthonormal_square_norm (locLaw d h) (fun z x => fineBasis h J x z) (fineBasis_memLp d h J hh hh' hJ) (fun i j => by have ho := fine_orthonormal d h J hh hh' hJ i j by_cases hij : i = j · simp only [if_pos hij] at ho ⊢; exact ho · simp only [if_neg hij] at ho ⊢; exact ho) _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projection_square_coefficients · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:283
theorem weighted_pv_projection_coefficient Lemma weighted_pv_projection_coefficient in the paper ↗

The weighted polynomial's fine coefficients are linear combinations of the weighted coarse-basis coefficients. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input v, the specified input z, the weighted pv projection coefficient conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
v :
PolyIdx d → ℝ
z :
(∫ x, fineBasis h J x z * (designatedPropensity P hP x * pv h v x) ∂locLaw d h)
= ∑ u, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * v u
Proof (Lean source)
lemma weighted_pv_projection_coefficient {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (v : PolyIdx d → ℝ) (z : FineIdx d J) : (∫ x, fineBasis h J x z * (designatedPropensity P hP x * pv h v x) ∂locLaw d h) = ∑ u, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * v u := by have hexpand (x : Cov d) : fineBasis h J x z * (designatedPropensity P hP x * pv h v x) = ∑ u, (fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u)) * v u := by simp only [pv, Finset.mul_sum] apply Finset.sum_congr rfl intro u _ ring simp_rw [hexpand] rw [integral_finsetSum (f := fun u x => (fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u)) * v u) univ (fun u _ => ((fineBasis_memLp d h J hh hh' hJ z).integrable_mul (designatedPropensity_mul_memLp P hP h hh' _ (coarseBasis_memLp d h hh hh' u))).mul_const (v u))] simp_rw [integral_mul_const]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.weighted_pv_projection_coefficient · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:297
theorem population_gram_quadratic_of_entries Lemma population_gram_quadratic_of_entries in the paper ↗

The population coordinate formula implies the full quadratic projection identity by finite expansion, without an empirical invertibility assumption. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input Q, the specified input hQ, the specified input v, the population gram quadratic of entries conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
hQ :
∀ u w,
Q u w
= (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h)
v :
PolyIdx d → ℝ
(∑ u, v u * (Q.mulVec v) u)
= (∫ x, designatedPropensity P hP x * (pv h v x)^2 ∂locLaw d h)
- (∫ x, (projOp d h J (fun y => designatedPropensity P hP y * pv h v y) x)^2 ∂locLaw d h)
Proof (Lean source)
lemma population_gram_quadratic_of_entries {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (hQ : ∀ u w, Q u w = (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h)) (v : PolyIdx d → ℝ) : (∑ u, v u * (Q.mulVec v) u) = (∫ x, designatedPropensity P hP x * (pv h v x)^2 ∂locLaw d h) - (∫ x, (projOp d h J (fun y => designatedPropensity P hP y * pv h v y) x)^2 ∂locLaw d h) := by classical simp only [mulVec, dotProduct, hQ, sub_mul, Finset.sum_sub_distrib, mul_sub] rw [finite_bilinear_integral_quadratic] · rw [finite_coefficient_gram_quadratic, projection_square_coefficients d h J hh hh' hJ _ (designatedPropensity_mul_memLp P hP h hh' _ (pv_memLp d h hh hh' v))] simp_rw [weighted_pv_projection_coefficient P hP h hh hh' J hJ v] congr 1 apply integral_congr_ae filter_upwards [] with x simp only [pv, mul_assoc, ← Finset.mul_sum, pow_two] ring · intro u w exact (coarseBasis_memLp d h hh hh' u).integrable_mul (designatedPropensity_mul_memLp P hP h hh' _ (coarseBasis_memLp d h hh hh' w))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_gram_quadratic_of_entries · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:319
theorem population_positivity

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input v, the population positivity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
v :
PolyIdx d → ℝ
conclusion 1
(∑ u, v u*((qPop P n m h J).mulVec v) u)
= (∫ x, (designatedPropensity P hP) x*(1-(designatedPropensity P hP) x)*(pv h v x)^2 ∂locLaw d h)
+ (∫ x, ((designatedPropensity P hP) x*pv h v x-projOp d h J (fun y => (designatedPropensity P hP) y*pv h v y) x)^2 ∂locLaw d h)
conclusion 2
eps*(1-eps)*(∑ u, v u^2) ≤ ∑ u, v u*((qPop P n m h J).mulVec v) u
Proof (Lean source)
lemma population_positivity (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (v : PolyIdx d → ℝ) : (∑ u, v u*((qPop P n m h J).mulVec v) u) = (∫ x, (designatedPropensity P hP) x*(1-(designatedPropensity P hP) x)*(pv h v x)^2 ∂locLaw d h) + (∫ x, ((designatedPropensity P hP) x*pv h v x-projOp d h J (fun y => (designatedPropensity P hP) y*pv h v y) x)^2 ∂locLaw d h) ∧ eps*(1-eps)*(∑ u, v u^2) ≤ ∑ u, v u*((qPop P n m h J).mulVec v) u := by have hentries : ∀ u w, qPop P n m h J u w = (∫ x, coarseBasis h x u * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x w) ∂locLaw d h) := by exact population_gram_entries P hP n m hn h hh hh' J hJ have hmoment := population_gram_quadratic_of_entries P hP h hh hh' J hJ _ hentries v have hidentity := hmoment.trans (population_projection_energy_identity P hP h hh hh' J hJ (pv h v) (pv_memLp d h hh hh' v)) refine ⟨hidentity, ?_⟩ rw [hidentity] exact population_expression_positivity P hP h hh hh' J v
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_positivity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationGram.lean:351
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationMoments 16 declarations Conditional Bernoulli integration and localization identities used to compute the population rectangular Gram matrix from the original-record experiment.

Treatment moments under the uniform design

Conditional Bernoulli integration and localization identities used to compute the population rectangular Gram matrix from the original-record experiment.

theorem population_measurable_observed Lemma population_measurable_observed in the paper ↗

For covariate dimension d, the observation map is Borel, including its treatment-dependent outcome selection.

Formal statement
d :
ℕ
Measurable (observed (d := d))
Proof (Lean source)
@[fun_prop] lemma population_measurable_observed {d : ℕ} : Measurable (observed (d := d)) := by unfold observed apply prodMk (by fun_prop) apply prodMk (by fun_prop) exact Measurable.ite (measurableSet_eq_fun (by fun_prop) measurable_const) (by fun_prop) (by fun_prop)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_measurable_observed · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:21
theorem primitive_propensity_kernel_sfinite Lemma primitive_propensity_kernel_sfinite in the paper ↗

A primitive treatment-margin identity guarantees that its Bernoulli kernel is s-finite. Given the specified input d, the specified input P, the primitive propensity kernel sfinite conclusion holds.

Formal statement
d :
ℕ
P :
IsSFiniteKernel (bernKernel P.e P.measurable_e)
Proof (Lean source)
lemma primitive_propensity_kernel_sfinite {d : ℕ} (P : PrimitiveLaw d) : IsSFiniteKernel (bernKernel P.e P.measurable_e) := by by_contra hn have hz := P.margin_e rw [Measure.compProd_of_not_isSFiniteKernel _ _ hn] at hz have hm := congrArg (fun μ => μ univ) hz have hmap : IsProbabilityMeasure (P.law.map (fun w => (w.1, w.2.1))) := Measure.isProbabilityMeasure_map (by fun_prop) letI := hmap simpa using hm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.primitive_propensity_kernel_sfinite · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:29

The treatment-record law is a probability measure. Given the specified input d, the specified input P, the xa law probability conclusion holds.

Formal statement
d :
ℕ
P :
Proof (Lean source)
lemma xaLaw_probability {d : ℕ} (P : PrimitiveLaw d) : IsProbabilityMeasure (xaLaw P) := by unfold xaLaw exact Measure.isProbabilityMeasure_map (by fun_prop)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.xaLaw_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:41

Discarding outcomes in an observed record gives exactly the treatment-record marginal. Given the specified input d, the specified input P, the obs law map treatment conclusion holds.

Formal statement
d :
ℕ
P :
(obsLaw P).map (fun w => (w.1, w.2.1)) = xaLaw P
Proof (Lean source)
lemma obsLaw_map_treatment {d : ℕ} (P : PrimitiveLaw d) : (obsLaw P).map (fun w => (w.1, w.2.1)) = xaLaw P := by unfold obsLaw xaLaw rw [Measure.map_map (by fun_prop) population_measurable_observed] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.obsLaw_map_treatment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:46

The observed-record law is a probability measure. Given the specified input d, the specified input P, the obs law probability conclusion holds.

Formal statement
d :
ℕ
P :
Proof (Lean source)
lemma obsLaw_probability {d : ℕ} (P : PrimitiveLaw d) : IsProbabilityMeasure (obsLaw P) := by unfold obsLaw exact Measure.isProbabilityMeasure_map population_measurable_observed.aemeasurable
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.obsLaw_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:53

Integrating a treatment bit against its Bernoulli law returns its probability. Given the specified input p, the specified input c, the specified input hp, the bern bit integral conclusion holds.

Formal statement
p c :
ℝ
hp :
0 ≤ p
(∫ a, c * bit a ∂bern p) = c * p
Proof (Lean source)
lemma bern_bit_integral (p c : ℝ) (hp : 0 ≤ p) : (∫ a, c * bit a ∂bern p) = c * p := by have hi (q : ℝ) : Integrable (fun a => c * bit a) (ofReal q • Measure.dirac false) := (integrable_dirac (by finiteness)).smul_measure ENNReal.ofReal_ne_top have hj (q : ℝ) : Integrable (fun a => c * bit a) (ofReal q • Measure.dirac true) := (integrable_dirac (by finiteness)).smul_measure ENNReal.ofReal_ne_top rw [bern, integral_add_measure (hi _) (hj _)] simp [integral_smul_measure, bit, ENNReal.toReal_ofReal hp] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_bit_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:58

Uniform-design integration of a bounded covariate function times treatment uses the primitive law's conditional treatment margin. Given the specified input d, the specified input P, the specified input hdesign, the specified input hoverlap, the specified input f, the specified input hf, the specified input B, the specified input hB, the overlap level eps, the xa law treatment moment conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
hoverlap :
Overlap eps P
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
∀ x, ‖f x‖ ≤ B
(∫ w, f w.1 * bit w.2 ∂xaLaw P) = ∫ x, f x * P.e x ∂uniformLaw d
Proof (Lean source)
lemma xaLaw_treatment_moment {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hoverlap : Overlap eps P) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ x, ‖f x‖ ≤ B) : (∫ w, f w.1 * bit w.2 ∂xaLaw P) = ∫ x, f x * P.e x ∂uniformLaw d := by letI : SFinite (uniformLaw d) := by unfold uniformLaw; infer_instance letI := primitive_propensity_kernel_sfinite P letI := xaLaw_probability P have hi : Integrable (fun w : Cov d × Bool => f w.1 * bit w.2) (xaLaw P) := by apply (integrable_const B).mono' ((hf.comp measurable_fst).mul (show Measurable (fun w : Cov d × Bool => bit w.2) from (measurable_of_finite bit).comp measurable_snd)).aestronglyMeasurable filter_upwards [] with w rcases w with ⟨x, a⟩ cases a · simpa [bit] using (norm_nonneg (f x)).trans (hB x) · simpa [bit] using hB x have hmargin : xaLaw P = uniformLaw d ⊗ₘ bernKernel P.e P.measurable_e := by exact P.margin_e.trans (congrArg (fun μ => μ ⊗ₘ bernKernel P.e P.measurable_e) hdesign) rw [hmargin] at hi ⊢ rw [Measure.integral_compProd hi] apply integral_congr_ae filter_upwards [ae_restrict_mem (show MeasurableSet (cube d) from by unfold cube; simp only [setOf_forall]; exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop)))] with x hx exact bern_bit_integral (P.e x) (f x) (by linarith [(hoverlap.unit x hx).1])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.xaLaw_treatment_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:69
theorem uniformLaw_localization_integral Lemma uniformLaw_localization_integral in the paper ↗

Weighted integration under the uniform design is exactly localization integration. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input f, the uniform law localization integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
f :
Cov d → ℝ
(∫ x, locWeight h x * f x ∂uniformLaw d) = ∫ x, f x ∂locLaw d h
Proof (Lean source)
lemma uniformLaw_localization_integral (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (f : Cov d → ℝ) : (∫ x, locWeight h x * f x ∂uniformLaw d) = ∫ x, f x ∂locLaw d h := by have hsub : locCube d h ⊆ cube d := by intro x hx i constructor <;> linarith [(hx i).1, (hx i).2] have hfun : (fun x => locWeight h x * f x) = (locCube d h).indicator (fun x => h^(-(d:ℝ)) * f x) := by funext x by_cases hx : x ∈ locCube d h <;> simp [locWeight, hx] rw [hfun, integral_indicator (isClosed_locCube d h).measurableSet] unfold uniformLaw locLaw rw [Measure.restrict_restrict (isClosed_locCube d h).measurableSet, Set.inter_eq_left.mpr hsub, integral_const_mul, integral_smul_measure] rw [ENNReal.toReal_ofReal (Real.rpow_nonneg hh.le _)] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniformLaw_localization_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:95
theorem locWeight_mul_norm_bound Lemma locWeight_mul_norm_bound in the paper ↗

A bounded function on the localization box has a globally bounded weighted extension. Given the specified input d, the specified input h, the specified input hh, the specified input f, the specified input B, the specified input hB, the specified input hf, the specified input x, the loc weight mul norm bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
f :
Cov d → ℝ
B :
ℝ
hB :
0 ≤ B
hf :
∀ x ∈ locCube d h, ‖f x‖ ≤ B
x :
Cov d
‖locWeight h x * f x‖ ≤ h^(-(d:ℝ)) * B
Proof (Lean source)
lemma locWeight_mul_norm_bound {d : ℕ} (h : ℝ) (hh : 0 < h) (f : Cov d → ℝ) (B : ℝ) (hB : 0 ≤ B) (hf : ∀ x ∈ locCube d h, ‖f x‖ ≤ B) (x : Cov d) : ‖locWeight h x * f x‖ ≤ h^(-(d:ℝ)) * B := by by_cases hx : x ∈ locCube d h · rw [locWeight, if_pos hx, norm_mul, Real.norm_eq_abs, abs_of_pos (Real.rpow_pos_of_pos hh _)] exact mul_le_mul_of_nonneg_left (hf x hx) (Real.rpow_pos_of_pos hh _).le · simp only [locWeight, if_neg hx, zero_mul, norm_zero] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locWeight_mul_norm_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:113
theorem designated_local_treatment_moment Lemma designated_local_treatment_moment in the paper ↗

A localized treatment moment uses the designated admissible version, even when the raw primitive carrier stores different conditional versions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input hh, the specified input hh', the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the designated local treatment moment conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x ∈ locCube d h, ‖f x‖ ≤ B
(∫ w, locWeight h w.1 * f w.1 * bit w.2 ∂xaLaw P)
= ∫ x, f x * designatedPropensity P hP x ∂locLaw d h
Proof (Lean source)
lemma designated_local_treatment_moment {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x ∈ locCube d h, ‖f x‖ ≤ B) : (∫ w, locWeight h w.1 * f w.1 * bit w.2 ∂xaLaw P) = ∫ x, f x * designatedPropensity P hP x ∂locLaw d h := by have hs := canonicalLaw_spec P hP have hxa : xaLaw P = xaLaw (canonicalLaw P hP) := by unfold xaLaw rw [hs.1] rw [hxa, xaLaw_treatment_moment _ hs.2.1 hs.2.2.2.1 _ (by fun_prop) _ (locWeight_mul_norm_bound h hh f B hB hfB)] simp_rw [mul_assoc] rw [uniformLaw_localization_integral d h hh hh'] unfold locLaw apply integral_congr_ae apply Measure.ae_smul_measure filter_upwards [ae_restrict_mem (isClosed_locCube d h).measurableSet] with x hx have hcube : x ∈ cube d := by intro i constructor <;> linarith [(hx i).1, (hx i).2] simp only [designatedPropensity, if_pos hcube]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designated_local_treatment_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:125
theorem population_randomizer_probability Lemma population_randomizer_probability in the paper ↗

The independent randomizer has unit mass. the population randomizer probability conclusion holds.

Formal statement
IsProbabilityMeasure (volume.restrict (Icc (0:ℝ) 1))
Proof (Lean source)
lemma population_randomizer_probability : IsProbabilityMeasure (volume.restrict (Icc (0:ℝ) 1)) := by constructor simp [Real.volume_Icc]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_randomizer_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:151
theorem population_experiment_probability Lemma population_experiment_probability in the paper ↗

The original-record experiment is a probability measure. Given the specified input d, the specified input P, the specified input n, the specified input m, the population experiment probability conclusion holds.

Formal statement
d :
ℕ
P :
n m :
ℕ
Proof (Lean source)
lemma population_experiment_probability {d : ℕ} (P : PrimitiveLaw d) (n m : ℕ) : IsProbabilityMeasure (experiment P n m) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability unfold experiment infer_instance
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_experiment_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:157
theorem experiment_integral_dataset Lemma experiment_integral_dataset in the paper ↗

Dataset-only statistics integrate out the independent public randomizer. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input F, the experiment integral dataset conclusion holds.

Formal statement
d n m :
ℕ
P :
F :
Dataset d n m → ℝ
(∫ w : Sample d n m, F w.1 ∂experiment P n m)
= ∫ D, F D ∂(Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))
Proof (Lean source)
lemma experiment_integral_dataset {d n m : ℕ} (P : PrimitiveLaw d) (F : Dataset d n m → ℝ) : (∫ w : Sample d n m, F w.1 ∂experiment P n m) = ∫ D, F D ∂(Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P)) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability exact (integral_fun_fst F).trans (by simp)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_integral_dataset · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:166
theorem experiment_labeled_treatment_integral Lemma experiment_labeled_treatment_integral in the paper ↗

An outcome-discarded labeled record has the treatment-record marginal. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input f, the specified input hf, the specified input j, the experiment labeled treatment integral conclusion holds.

Formal statement
d n m :
ℕ
P :
f :
Cov d × Bool → ℝ
hf :
j :
Fin n
(∫ w : Sample d n m, f ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = ∫ z, f z ∂xaLaw P
Proof (Lean source)
lemma experiment_labeled_treatment_integral {d n m : ℕ} (P : PrimitiveLaw d) (f : Cov d × Bool → ℝ) (hf : Measurable f) (j : Fin n) : (∫ w : Sample d n m, f ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = ∫ z, f z ∂xaLaw P := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability rw [experiment_integral_dataset P (fun D : Dataset d n m => f ((D.1 j).1, (D.1 j).2.1))] rw [integral_fun_fst (fun D : Fin n → Cov d × Bool × Bool => f ((D j).1, (D j).2.1))] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] rw [integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (i := j) (f := fun z : Cov d × Bool × Bool => f (z.1,z.2.1)) ((hf.comp (by fun_prop)).aestronglyMeasurable)] rw [← obsLaw_map_treatment P, integral_map (by fun_prop) hf.aestronglyMeasurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_labeled_treatment_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:177
theorem experiment_distinct_labeled_treatment_integral Lemma experiment_distinct_labeled_treatment_integral in the paper ↗

Different labeled records give a product of treatment-record expectations. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input i, the specified input j, the specified input hij, the experiment distinct labeled treatment integral conclusion holds.

Formal statement
d n m :
ℕ
P :
f g :
Cov d × Bool → ℝ
hf :
hg :
i j :
Fin n
hij :
i ≠ j
(∫ w : Sample d n m, f ((w.1.1 i).1, (w.1.1 i).2.1) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m)
= (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P)
Proof (Lean source)
lemma experiment_distinct_labeled_treatment_integral {d n m : ℕ} (P : PrimitiveLaw d) (f g : Cov d × Bool → ℝ) (hf : Measurable f) (hg : Measurable g) (i j : Fin n) (hij : i ≠ j) : (∫ w : Sample d n m, f ((w.1.1 i).1, (w.1.1 i).2.1) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability rw [experiment_integral_dataset P (fun D : Dataset d n m => f ((D.1 i).1, (D.1 i).2.1) * g ((D.1 j).1, (D.1 j).2.1))] rw [integral_fun_fst (fun D : Fin n → Cov d × Bool × Bool => f ((D i).1, (D i).2.1) * g ((D j).1, (D j).2.1))] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] have hi := (iIndepFun_pi (μ := fun _ : Fin n => obsLaw P) (X := fun _ => id) (fun _ => aemeasurable_id)).indepFun hij have hfg := hi.comp (φ := fun z : Cov d × Bool × Bool => f (z.1,z.2.1)) (ψ := fun z : Cov d × Bool × Bool => g (z.1,z.2.1)) (by fun_prop) (by fun_prop) have hprod : (∫ D : Fin n → Cov d × Bool × Bool, f ((D i).1, (D i).2.1) * g ((D j).1, (D j).2.1) ∂Measure.pi (fun _ => obsLaw P)) = (∫ D, f ((D i).1, (D i).2.1) ∂Measure.pi (fun _ : Fin n => obsLaw P)) * (∫ D, g ((D j).1, (D j).2.1) ∂Measure.pi (fun _ : Fin n => obsLaw P)) := by simpa only [Function.comp_def, id_eq, Pi.mul_apply] using hfg.integral_mul_eq_mul_integral ((hf.comp (by fun_prop)).aestronglyMeasurable) ((hg.comp (by fun_prop)).aestronglyMeasurable) rw [hprod] rw [integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (i := i) (f := fun z : Cov d × Bool × Bool => f (z.1,z.2.1)) ((hf.comp (by fun_prop)).aestronglyMeasurable), integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (i := j) (f := fun z : Cov d × Bool × Bool => g (z.1,z.2.1)) ((hg.comp (by fun_prop)).aestronglyMeasurable)] rw [← obsLaw_map_treatment P] rw [integral_map (by fun_prop) hf.aestronglyMeasurable, integral_map (by fun_prop) hg.aestronglyMeasurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_distinct_labeled_treatment_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:192
theorem experiment_role_product_integral Lemma experiment_role_product_integral in the paper ↗

A treatment-role record and an outcome-role record have independent expectations, including treatment records from the auxiliary block. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input i, the specified input j, the specified input hi, the specified input hj, the experiment role product integral conclusion holds.

Formal statement
d n m :
ℕ
P :
f g :
Cov d × Bool → ℝ
hf :
hg :
i :
Fin (n+m)
j :
Fin n
hi :
i ∈ (roleSplit n m).2
hj :
j ∈ (roleSplit n m).1
(∫ w : Sample d n m, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m)
= (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P)
Proof (Lean source)
lemma experiment_role_product_integral {d n m : ℕ} (P : PrimitiveLaw d) (f g : Cov d × Bool → ℝ) (hf : Measurable f) (hg : Measurable g) (i : Fin (n+m)) (j : Fin n) (hi : i ∈ (roleSplit n m).2) (hj : j ∈ (roleSplit n m).1) : (∫ w : Sample d n m, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability revert hi refine Fin.addCases (fun i hi => ?_) (fun i hi => ?_) i · simp only [treatmentRecords, Fin.addCases_left] change (∫ w : Sample d n m, f ((w.1.1 i).1, (w.1.1 i).2.1) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = _ apply experiment_distinct_labeled_treatment_integral P f g hf hg i j have hit : n/2 ≤ i.val := (Finset.mem_filter.mp hi).2 have hjt : j.val < n/2 := (Finset.mem_filter.mp hj).2 intro heq have := congrArg val heq omega · simp only [treatmentRecords, Fin.addCases_right] change (∫ w : Sample d n m, f (w.1.2 i) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = _ rw [experiment_integral_dataset P (fun D : Dataset d n m => f (D.2 i) * g ((D.1 j).1, (D.1 j).2.1))] simp_rw [mul_comm (f _)] rw [integral_prod_mul (fun D : Fin n → Cov d × Bool × Bool => g ((D j).1, (D j).2.1)) (fun D : Fin m → Cov d × Bool => f (D i)), integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (i := j) (f := fun z : Cov d × Bool × Bool => g (z.1,z.2.1)) ((hg.comp (by fun_prop)).aestronglyMeasurable), integral_comp_eval (μ := fun _ : Fin m => xaLaw P) (i := i) (f := f) hf.aestronglyMeasurable] rw [← obsLaw_map_treatment P, integral_map (by fun_prop) hg.aestronglyMeasurable] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_role_product_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationMoments.lean:225
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationOutcomeEntries 4 declarations Finite expansion of the response correction and independence of the two roles identify the population vector using observed outcome moments.

# Population outcome entries Finite expansion of the response correction and independence of the two roles identify the population vector using observed outcome moments. The terminal response is the observed outcome, without an additional treatment mark.

theorem population_localized_record_memLp Lemma population_localized_record_memLp in the paper ↗

Localization makes any locally bounded Borel record statistic essentially bounded. Given the specified input d, the specified input h, the specified input hh, the specified input X, the specified input hX, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the population localized record mem lp conclusion holds.

Formal statement
Ω :
d :
ℕ
h :
ℝ
hh :
0 < h
X :
Ω → Cov d
hX :
f :
Ω → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ B
MemLp (fun w => locWeight h (X w) * f w) ∞ μ
Proof (Lean source)
lemma population_localized_record_memLp {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (d : ℕ) (h : ℝ) (hh : 0 < h) (X : Ω → Cov d) (hX : Measurable X) (f : Ω → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ w, X w ∈ locCube d h → |f w| ≤ B) : MemLp (fun w => locWeight h (X w) * f w) ∞ μ := by apply memLp_top_of_bound (by fun_prop) (h^(-(d:ℝ))*B) filter_upwards [] with w change |locWeight h (X w) * f w| ≤ _ by_cases hx : X w ∈ locCube d h · rw [locWeight, if_pos hx, abs_mul, abs_of_pos (Real.rpow_pos_of_pos hh _)] exact mul_le_mul_of_nonneg_left (hfB w hx) (by positivity) · simp only [locWeight, if_neg hx, zero_mul, abs_zero] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_localized_record_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeEntries.lean:18
theorem population_rectangular_observed_product_mean Lemma population_rectangular_observed_product_mean in the paper ↗

Independent role averages of separated bounded features factor into their means. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hf2, the specified input hg2, the population rectangular observed product mean conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool → ℝ
g :
Cov d × Bool × Bool → ℝ
hf :
hg :
hf2 :
MemLp f ∞ (xaLaw P)
hg2 :
MemLp g ∞ (obsLaw P)
conclusion 1
Integrable (rectangularAverage (n := n) (m := m) (fun p => f p.1*g p.2)) (experiment P n m)
conclusion 2
(∫ w, rectangularAverage (n := n) (m := m) (fun p => f p.1*g p.2) w ∂experiment P n m)
= (∫ z, f z ∂xaLaw P)*(∫ z, g z ∂obsLaw P)
Proof (Lean source)
lemma population_rectangular_observed_product_mean {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool → ℝ) (g : Cov d × Bool × Bool → ℝ) (hf : Measurable f) (hg : Measurable g) (hf2 : MemLp f ∞ (xaLaw P)) (hg2 : MemLp g ∞ (obsLaw P)) : Integrable (rectangularAverage (n := n) (m := m) (fun p => f p.1*g p.2)) (experiment P n m) ∧ (∫ w, rectangularAverage (n := n) (m := m) (fun p => f p.1*g p.2) w ∂experiment P n m) = (∫ z, f z ∂xaLaw P)*(∫ z, g z ∂obsLaw P) := by letI := xaLaw_probability P letI := obsLaw_probability P letI := population_experiment_probability P n m have hp2 : MemLp (fun p : (Cov d × Bool) × (Cov d × Bool × Bool) => f p.1*g p.2) 2 ((xaLaw P).prod (obsLaw P)) := by convert ((hf2.comp_measurePreserving measurePreserving_fst).mul (r := ∞) (hg2.comp_measurePreserving measurePreserving_snd)).mono_exponent (show (2:ℝ≥0∞) ≤ ∞ from le_top) using 1 ext p simp only [Function.comp_def, Pi.mul_apply] ring refine ⟨(rectangular_original_average_memLp P _ hp2).integrable (by norm_num), ?_⟩ rw [rectangular_original_average_mean P hn _ (by fun_prop) hp2] exact integral_prod_mul f g
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_rectangular_observed_product_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeEntries.lean:33
theorem rHat_finite_role_expansion Lemma rHat_finite_role_expansion in the paper ↗

The response correction is a sum of products of treatment and observed-outcome features. Given the specified input d, the specified input n, the specified input m, the specified input D, the specified input h, the specified input J, the specified input u, the r hat finite role expansion conclusion holds.

Formal statement
d n m :
ℕ
D :
Dataset d n m
h :
ℝ
J :
ℕ
u :
rHat D h J u
= rectangularOutcomeAverage (fun z => locWeight h z.1 * (coarseBasis h z.1 u * bit z.2.1 * bit z.2.2)) (D,0)
- ∑ z : FineIdx d J, rectangularAverage (fun p => weightedTreatmentFeature h (fun x => coarseBasis h x u * fineBasis h J x z) p.1 * (locWeight h p.2.1 * (fineBasis h J p.2.1 z * bit p.2.2.2))) (D,0)
Proof (Lean source)
lemma rHat_finite_role_expansion {d n m : ℕ} (D : Dataset d n m) (h : ℝ) (J : ℕ) (u : PolyIdx d) : rHat D h J u = rectangularOutcomeAverage (fun z => locWeight h z.1 * (coarseBasis h z.1 u * bit z.2.1 * bit z.2.2)) (D,0) - ∑ z : FineIdx d J, rectangularAverage (fun p => weightedTreatmentFeature h (fun x => coarseBasis h x u * fineBasis h J x z) p.1 * (locWeight h p.2.1 * (fineBasis h J p.2.1 z * bit p.2.2.2))) (D,0) := by classical rw [rHat_rectangular] unfold rectangularOutcomeAverage rectangularAverage weightedTreatmentFeature fineKernel congr 1 · congr 1 apply Finset.sum_congr rfl intro j _ ring · simp only [Finset.mul_sum] conv_rhs => rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j _ simp only [Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro z _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rHat_finite_role_expansion · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeEntries.lean:59
theorem population_response_observed_entries Lemma population_response_observed_entries in the paper ↗

The population response vector has the finite projection-coefficient formula under the original-record experiment. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input u, the population response observed entries conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
u :
rBar P n m h J u
= (∫ w, locWeight h w.1 * (coarseBasis h w.1 u * bit w.2.1 * bit w.2.2) ∂obsLaw P)
- ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ w, locWeight h w.1 * (fineBasis h J w.1 z * bit w.2.2) ∂obsLaw P)
Proof (Lean source)
lemma population_response_observed_entries {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (u : PolyIdx d) : rBar P n m h J u = (∫ w, locWeight h w.1 * (coarseBasis h w.1 u * bit w.2.1 * bit w.2.2) ∂obsLaw P) - ∑ z : FineIdx d J, (∫ x, fineBasis h J x z * (designatedPropensity P hP x * coarseBasis h x u) ∂locLaw d h) * (∫ w, locWeight h w.1 * (fineBasis h J w.1 z * bit w.2.2) ∂obsLaw P) := by classical letI := xaLaw_probability P letI := obsLaw_probability P letI := population_experiment_probability P n m let F := fun w : Cov d × Bool × Bool => locWeight h w.1 * (coarseBasis h w.1 u * bit w.2.1 * bit w.2.2) let f := fun z : FineIdx d J => weightedTreatmentFeature h (fun x => coarseBasis h x u * fineBasis h J x z) let g := fun z : FineIdx d J => fun w : Cov d × Bool × Bool => locWeight h w.1 * (fineBasis h J w.1 z * bit w.2.2) have hF : MemLp F ∞ (obsLaw P) := by apply population_localized_record_memLp (obsLaw P) d h hh fst (by fun_prop) _ (by fun_prop) ((4:ℝ)^d) (by positivity) intro w hw rcases w with ⟨x,a,y⟩ cases a <;> cases y <;> simp only [bit, if_true, Bool.false_eq_true, if_false, mul_one, mul_zero, abs_zero] <;> first | positivity | exact coarseBasis_abs_bound d h hh x hw u have hf (z) : MemLp (f z) ∞ (xaLaw P) := by unfold f weightedTreatmentFeature simp only [mul_assoc] apply population_localized_record_memLp (xaLaw P) d h hh fst (by fun_prop) _ (by fun_prop) ((4:ℝ)^d * (sqrt ((J:ℝ)^d)*(4:ℝ)^d)) (by positivity) intro w hw rcases w with ⟨x,a⟩ cases a · simp [bit] · simpa only [bit, if_true, mul_one, Real.norm_eq_abs, mul_assoc] using (population_basis_product_bounds d h J hh hJ u u z).2 x hw have hg (z) : MemLp (g z) ∞ (obsLaw P) := by apply population_localized_record_memLp (obsLaw P) d h hh fst (by fun_prop) _ (by fun_prop) (sqrt ((J:ℝ)^d)*(4:ℝ)^d) (by positivity) intro w hw rcases w with ⟨x,a,y⟩ cases y · simp [bit] · simpa only [bit, if_true, mul_one] using fineBasis_abs_bound d h J hh hJ x z have hm := rectangular_outcome_average_moments (n := n) (m := m) P hn F (by fun_prop) (hF.mono_exponent (by simp)) have hp (z) := population_rectangular_observed_product_mean (n := n) (m := m) P hn (f z) (g z) (by unfold f; fun_prop) (by unfold g; fun_prop) (hf z) (hg z) unfold rBar simp_rw [rHat_finite_role_expansion] change (∫ w, rectangularOutcomeAverage F w - ∑ z, rectangularAverage (fun p => f z p.1*g z p.2) w ∂experiment P n m) = _ rw [integral_sub (hm.1.integrable (by norm_num)) (integrable_finsetSum _ (fun z _ => (hp z).1)), integral_finsetSum _ (fun z _ => (hp z).1), hm.2] simp_rw [(hp _).2] congr 1 apply Finset.sum_congr rfl intro z _ congr 1 have ht := designated_local_treatment_moment P hP h hh hh' (fun x => coarseBasis h x u * fineBasis h J x z) (by fun_prop) ((4:ℝ)^d * (sqrt ((J:ℝ)^d)*(4:ℝ)^d)) (by positivity) (population_basis_product_bounds d h J hh hJ u u z).2 change (∫ w, locWeight h w.1 * (coarseBasis h w.1 u * fineBasis h J w.1 z) * bit w.2 ∂xaLaw P) = _ rw [ht] apply integral_congr_ae filter_upwards [] with x ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_response_observed_entries · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeEntries.lean:88
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationOutcomeMoments 7 declarations Exchangeability removes the treatment bit under bounded test functions, and conditional Bernoulli margins identify the selected potential-outcome moment.

# Causal outcome moments Exchangeability removes the treatment bit under bounded test functions, and conditional Bernoulli margins identify the selected potential-outcome moment.

theorem population_bern_probability Lemma population_bern_probability in the paper ↗

A Bernoulli law with an admissible probability has unit mass. Given the specified input p, the specified input hp, the population bern probability conclusion holds.

Formal statement
p :
ℝ
hp :
p ∈ Icc 0 1
Proof (Lean source)
lemma population_bern_probability (p : ℝ) (hp : p ∈ Icc 0 1) : IsProbabilityMeasure (bern p) := by constructor simp only [bern, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (by linarith [hp.2]) hp.1] norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_bern_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:15
theorem population_exchangeability_bit_moment Lemma population_exchangeability_bit_moment in the paper ↗

Exchangeability factors the treatment bit from a bounded potential-outcome test. Given the specified input d, the specified input P, the specified input hdesign, the specified input hex, the specified input he, the specified input H, the specified input hH, the specified input B, the specified input hB, the specified input hbound, the specified input hsupp, the overlap level eps, the population exchangeability bit moment conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
he :
Overlap eps P
H :
Cov d × (Bool × Bool) → ℝ
hH :
B :
ℝ
hB :
0 ≤ B
hbound :
∀ z, ‖H z‖ ≤ B
hsupp :
∀ z
if
z.1 ∉ cube d
then
H z = 0
(∫ w, H (w.1, w.2.2) * bit w.2.1 ∂P.law) = ∫ w, H (w.1, w.2.2) * P.e w.1 ∂P.law
Proof (Lean source)
lemma population_exchangeability_bit_moment {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hex : ConditionalExchangeability P) (he : Overlap eps P) (H : Cov d × (Bool × Bool) → ℝ) (hH : Measurable H) (B : ℝ) (hB : 0 ≤ B) (hbound : ∀ z, ‖H z‖ ≤ B) (hsupp : ∀ z, z.1 ∉ cube d → H z = 0) : (∫ w, H (w.1, w.2.2) * bit w.2.1 ∂P.law) = ∫ w, H (w.1, w.2.2) * P.e w.1 ∂P.law := by have hPe := P.measurable_e obtain ⟨Γ, hΓ, hΓlaw⟩ := hex letI := hΓ let Q := (P.law.map fst) ⊗ₘ Γ let κ := bernKernel (fun z : Cov d × (Bool × Bool) => P.e z.1) (P.measurable_e.comp measurable_fst) let T := fun w : FullRecord d => ((w.1, w.2.2), w.2.1) have hT : Measurable T := by fun_prop have hlaw : P.law.map T = Q ⊗ₘ κ := hΓlaw letI : IsSFiniteKernel κ := by by_contra hn have hz := hlaw rw [Measure.compProd_of_not_isSFiniteKernel _ _ hn] at hz have hm := congrArg (fun μ => μ univ) hz letI := Measure.isProbabilityMeasure_map hT.aemeasurable (μ := P.law) simpa using hm letI : IsProbabilityMeasure Q := by dsimp [Q] rw [hdesign] have hu : IsProbabilityMeasure (uniformLaw d) := by rw [← hdesign] exact Measure.isProbabilityMeasure_map (by fun_prop) infer_instance have hHe : ∀ z, ‖H z * P.e z.1‖ ≤ B := by intro z by_cases hx : z.1 ∈ cube d · rw [norm_mul, Real.norm_eq_abs (P.e z.1), abs_of_nonneg (by linarith [(he.unit _ hx).1])] exact (mul_le_mul_of_nonneg_left (by linarith [(he.unit _ hx).2] : P.e z.1 ≤ 1) (norm_nonneg _)).trans (by simpa using hbound z) · simp [hsupp z hx, hB] have hF : Integrable (fun z : (Cov d × (Bool × Bool)) × Bool => H z.1 * bit z.2) (Q ⊗ₘ κ) := by rw [← hlaw] letI := Measure.isProbabilityMeasure_map hT.aemeasurable (μ := P.law) apply population_integrable_bounded _ _ (by fun_prop) B intro z cases z.2 · simpa [bit] using hB · simpa [bit] using hbound z.1 have hG : Integrable (fun z : (Cov d × (Bool × Bool)) × Bool => H z.1 * P.e z.1.1) (Q ⊗ₘ κ) := by rw [← hlaw] letI := Measure.isProbabilityMeasure_map hT.aemeasurable (μ := P.law) exact population_integrable_bounded _ _ (by fun_prop) B (fun z => hHe z.1) have hcube : ∀ᵐ z ∂Q, z.1 ∈ cube d := by dsimp [Q] apply Measure.ae_compProd_of_ae_fst Γ · unfold cube simp only [setOf_forall] exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop)) · rw [hdesign] exact ae_restrict_mem (by unfold cube simp only [setOf_forall] exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop))) calc _ = ∫ z, H z.1 * bit z.2 ∂(Q ⊗ₘ κ) := by rw [← hlaw, integral_map hT.aemeasurable (by fun_prop : Measurable _).aestronglyMeasurable] _ = ∫ z, (∫ a, H z * bit a ∂κ z) ∂Q := Measure.integral_compProd hF _ = ∫ z, H z * P.e z.1 ∂Q := by apply integral_congr_ae filter_upwards [hcube] with z hz exact bern_bit_integral _ _ (by linarith [(he.unit _ hz).1]) _ = ∫ z, (∫ a, H z * P.e z.1 ∂κ z) ∂Q := by apply integral_congr_ae filter_upwards [hcube] with z hz letI := population_bern_probability (P.e z.1) ⟨by linarith [(he.unit _ hz).1], by linarith [(he.unit _ hz).2]⟩ change H z * P.e z.1 = ∫ _a, H z * P.e z.1 ∂bern (P.e z.1) simp only [integral_const, Measure.real, measure_univ, ENNReal.toReal_one, one_smul] _ = ∫ z, H z.1 * P.e z.1.1 ∂(Q ⊗ₘ κ) := (Measure.integral_compProd hG).symm _ = _ := by rw [← hlaw, integral_map hT.aemeasurable (by fun_prop : Measurable _).aestronglyMeasurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_exchangeability_bit_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:24
theorem population_arm_margin_moment Lemma population_arm_margin_moment in the paper ↗

A conditional Bernoulli margin identifies bounded potential-outcome test moments. Given the specified input d, the specified input P, the specified input hdesign, the specified input j, the specified input hj, the specified input mu, the specified input hmu, the specified input hmu0, the specified input hmargin, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the population arm margin moment conclusion holds.

Formal statement
d :
ℕ
P :
hdesign :
j :
hj :
mu :
Cov d → ℝ
hmu :
hmu0 :
∀ x ∈ cube d, 0 ≤ mu x
hmargin :
P.law.map (fun w => (w.1, j w)) = (P.law.map fst) ⊗ₘ bernKernel mu hmu
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x, ‖f x‖ ≤ B
(∫ w, f w.1 * bit (j w) ∂P.law) = ∫ x, f x * mu x ∂uniformLaw d
Proof (Lean source)
lemma population_arm_margin_moment {d : ℕ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (j : FullRecord d → Bool) (hj : Measurable j) (mu : Cov d → ℝ) (hmu : Measurable mu) (hmu0 : ∀ x ∈ cube d, 0 ≤ mu x) (hmargin : P.law.map (fun w => (w.1, j w)) = (P.law.map fst) ⊗ₘ bernKernel mu hmu) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x, ‖f x‖ ≤ B) : (∫ w, f w.1 * bit (j w) ∂P.law) = ∫ x, f x * mu x ∂uniformLaw d := by letI : SFinite (uniformLaw d) := by unfold uniformLaw; infer_instance letI := bernKernel_sfinite_of_margin P j hj mu hmu hmargin have hm : IsProbabilityMeasure (P.law.map (fun w => (w.1, j w))) := Measure.isProbabilityMeasure_map (by fun_prop) letI := hm have hi : Integrable (fun z : Cov d × Bool => f z.1 * bit z.2) (P.law.map (fun w => (w.1, j w))) := by apply population_integrable_bounded _ _ (by fun_prop) B intro z cases z.2 · simpa [bit] using hB · simpa [bit] using hfB z.1 rw [hmargin, hdesign] at hi rw [← integral_map (by fun_prop : Measurable (fun w : FullRecord d => (w.1, j w))).aemeasurable (by fun_prop : Measurable (fun z : Cov d × Bool => f z.1 * bit z.2)).aestronglyMeasurable, hmargin, hdesign, Measure.integral_compProd hi] apply integral_congr_ae filter_upwards [ae_restrict_mem (show MeasurableSet (cube d) from by unfold cube; simp only [setOf_forall] exact MeasurableSet.iInter (fun i => measurableSet_Icc.preimage (by fun_prop)))] with x hx exact bern_bit_integral _ _ (hmu0 x hx)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_arm_margin_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:104
theorem population_test_mul_propensity_bound Lemma population_test_mul_propensity_bound in the paper ↗

A bounded cube-supported test remains bounded after multiplication by overlap. Given the specified input d, the specified input P, the specified input he, the specified input f, the specified input B, the specified input hB, the specified input hf, the specified input hs, the overlap level eps, the population test mul propensity bound conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
he :
Overlap eps P
f :
Cov d → ℝ
B :
ℝ
hB :
0 ≤ B
hf :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
x :
‖f x * P.e x‖ ≤ B
Proof (Lean source)
lemma population_test_mul_propensity_bound {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (he : Overlap eps P) (f : Cov d → ℝ) (B : ℝ) (hB : 0 ≤ B) (hf : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : ∀ x, ‖f x * P.e x‖ ≤ B := by intro x by_cases hx : x ∈ cube d · rw [norm_mul, Real.norm_eq_abs (P.e x), abs_of_nonneg (by linarith [(he.unit _ hx).1])] exact (mul_le_mul_of_nonneg_left (by linarith [(he.unit _ hx).2] : P.e x ≤ 1) (norm_nonneg _)).trans (by simpa using hf x) · simp [hs x hx, hB]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_test_mul_propensity_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:135
theorem population_treated_outcome_moment Lemma population_treated_outcome_moment in the paper ↗

The treated observed outcome moment is the propensity times the treated arm mean. Given the specified input d, the specified input P, the specified input hdesign, the specified input hex, the specified input he, the specified input hmu, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the specified input hs, the overlap level eps, the population treated outcome moment conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
he :
Overlap eps P
hmu :
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
(∫ w, f w.1 * bit w.2.1 * bit w.2.2 ∂obsLaw P) = ∫ x, f x * P.e x * P.mu1 x ∂uniformLaw d
Proof (Lean source)
lemma population_treated_outcome_moment {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hex : ConditionalExchangeability P) (he : Overlap eps P) (hmu : TreatedInterior P) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : (∫ w, f w.1 * bit w.2.1 * bit w.2.2 ∂obsLaw P) = ∫ x, f x * P.e x * P.mu1 x ∂uniformLaw d := by have hPe := P.measurable_e rw [obsLaw, integral_map population_measurable_observed.aemeasurable (by fun_prop : Measurable (fun w : Cov d × Bool × Bool => f w.1 * bit w.2.1 * bit w.2.2)).aestronglyMeasurable] have hcons : (fun w : FullRecord d => f (observed w).1 * bit (observed w).2.1 * bit (observed w).2.2) = fun w => (f w.1 * bit w.2.2.2) * bit w.2.1 := by funext w cases ha : w.2.1 <;> simp [observed, ha, bit, mul_comm] rw [hcons, population_exchangeability_bit_moment P hdesign hex he (fun z => f z.1 * bit z.2.2) (by fun_prop) B hB (by intro z; cases z.2.2 · simpa [bit] using hB · simpa [bit] using hfB z.1) (by intro z hz; simp [hs z.1 hz])] have hcomm : (fun w : FullRecord d => (f w.1 * bit w.2.2.2) * P.e w.1) = fun w => (f w.1 * P.e w.1) * bit w.2.2.2 := by funext w; ring rw [hcomm] exact population_arm_margin_moment P hdesign (fun w => w.2.2.2) (by fun_prop) P.mu1 P.measurable_mu1 (by intro x hx; linarith [(hmu x hx).1]) P.margin_mu1 _ (by fun_prop) B hB (population_test_mul_propensity_bound P he f B hB hfB hs)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_treated_outcome_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:146
theorem population_control_outcome_moment Lemma population_control_outcome_moment in the paper ↗

The untreated observed outcome moment uses the complementary propensity. Given the specified input d, the specified input P, the specified input hdesign, the specified input hex, the specified input he, the specified input hmu, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the specified input hs, the overlap level eps, the population control outcome moment conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
he :
Overlap eps P
hmu :
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
(∫ w, f w.1 * (1-bit w.2.1) * bit w.2.2 ∂obsLaw P)
= ∫ x, f x * (1-P.e x) * P.mu0 x ∂uniformLaw d
Proof (Lean source)
lemma population_control_outcome_moment {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hex : ConditionalExchangeability P) (he : Overlap eps P) (hmu : ControlInterior P) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : (∫ w, f w.1 * (1-bit w.2.1) * bit w.2.2 ∂obsLaw P) = ∫ x, f x * (1-P.e x) * P.mu0 x ∂uniformLaw d := by have hPe := P.measurable_e have hPm := P.measurable_mu0 rw [obsLaw, integral_map population_measurable_observed.aemeasurable (by fun_prop : Measurable (fun w : Cov d × Bool × Bool => f w.1 * (1-bit w.2.1) * bit w.2.2)).aestronglyMeasurable] have hcons : (fun w : FullRecord d => f (observed w).1 * (1-bit (observed w).2.1) * bit (observed w).2.2) = fun w => f w.1 * bit w.2.2.1 - (f w.1 * bit w.2.2.1) * bit w.2.1 := by funext w cases ha : w.2.1 <;> simp [observed, ha, bit] have hi : Integrable (fun w : FullRecord d => f w.1 * bit w.2.2.1) P.law := by apply population_integrable_bounded _ _ (by fun_prop) B intro w cases w.2.2.1 · simpa [bit] using hB · simpa [bit] using hfB w.1 have hj : Integrable (fun w : FullRecord d => (f w.1 * bit w.2.2.1)*bit w.2.1) P.law := by apply population_integrable_bounded _ _ (by fun_prop) B intro w cases w.2.1 <;> cases w.2.2.1 all_goals simp only [bit, Bool.false_eq_true, ite_false, ite_true, mul_zero, mul_one, norm_zero] all_goals first | exact hB | exact hfB w.1 have hex0 := population_exchangeability_bit_moment P hdesign hex he (fun z => f z.1 * bit z.2.1) (by fun_prop) B hB (by intro z; cases z.2.1 · simpa [bit] using hB · simpa [bit] using hfB z.1) (by intro z hz; simp [hs z.1 hz]) have hcomm : (fun w : FullRecord d => (f w.1 * bit w.2.2.1) * P.e w.1) = fun w => (f w.1 * P.e w.1) * bit w.2.2.1 := by funext w; ring rw [hcomm] at hex0 rw [population_arm_margin_moment P hdesign (fun w => w.2.2.1) (by fun_prop) P.mu0 P.measurable_mu0 (by intro x hx; linarith [(hmu x hx).1]) P.margin_mu0 _ (by fun_prop) B hB (population_test_mul_propensity_bound P he f B hB hfB hs)] at hex0 rw [hcons, integral_sub hi hj, hex0, population_arm_margin_moment P hdesign (fun w => w.2.2.1) (by fun_prop) P.mu0 P.measurable_mu0 (by intro x hx; linarith [(hmu x hx).1]) P.margin_mu0 f hf B hB hfB] have hu : IsProbabilityMeasure (uniformLaw d) := by rw [← hdesign]; exact Measure.isProbabilityMeasure_map (by fun_prop) letI := hu have hfm : ∀ x, ‖f x * P.mu0 x‖ ≤ B := by intro x by_cases hx : x ∈ cube d · rw [norm_mul, Real.norm_eq_abs (P.mu0 x), abs_of_nonneg (by linarith [(hmu x hx).1])] exact (mul_le_mul_of_nonneg_left (by linarith [(hmu x hx).2] : P.mu0 x ≤ 1) (norm_nonneg _)).trans (by simpa using hfB x) · simp [hs x hx, hB] have hfe : ∀ x, ‖f x * P.e x * P.mu0 x‖ ≤ B := by have hb := population_test_mul_propensity_bound P he f B hB hfB hs intro x by_cases hx : x ∈ cube d · rw [norm_mul, Real.norm_eq_abs (P.mu0 x), abs_of_nonneg (by linarith [(hmu x hx).1])] exact (mul_le_mul_of_nonneg_left (by linarith [(hmu x hx).2] : P.mu0 x ≤ 1) (norm_nonneg _)).trans (by simpa using hb x) · simp [hs x hx, hB] rw [← integral_sub (population_integrable_bounded _ _ (by fun_prop) B hfm) (population_integrable_bounded _ _ (by fun_prop) B hfe)] apply integral_congr_ae filter_upwards [] with x ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_control_outcome_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:175
theorem population_outcome_moment Lemma population_outcome_moment in the paper ↗

The observed response moment combines the two identified arm moments. Given the specified input d, the specified input P, the specified input hdesign, the specified input hex, the specified input he, the specified input hm0, the specified input hm1, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the specified input hs, the overlap level eps, the population outcome moment conclusion holds.

Formal statement
d :
ℕ
eps :
ℝ
P :
hdesign :
he :
Overlap eps P
hm0 :
hm1 :
f :
Cov d → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x, ‖f x‖ ≤ B
hs :
∀ x
if
x ∉ cube d
then
f x = 0
(∫ w, f w.1 * bit w.2.2 ∂obsLaw P)
= ∫ x, f x * (P.mu0 x + P.e x * (P.mu1 x-P.mu0 x)) ∂uniformLaw d
Proof (Lean source)
lemma population_outcome_moment {d : ℕ} {eps : ℝ} (P : PrimitiveLaw d) (hdesign : UniformDesign P) (hex : ConditionalExchangeability P) (he : Overlap eps P) (hm0 : ControlInterior P) (hm1 : TreatedInterior P) (f : Cov d → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x, ‖f x‖ ≤ B) (hs : ∀ x, x ∉ cube d → f x = 0) : (∫ w, f w.1 * bit w.2.2 ∂obsLaw P) = ∫ x, f x * (P.mu0 x + P.e x * (P.mu1 x-P.mu0 x)) ∂uniformLaw d := by letI := obsLaw_probability P letI : IsProbabilityMeasure (uniformLaw d) := by rw [← hdesign]; exact Measure.isProbabilityMeasure_map (by fun_prop) have hPe := P.measurable_e have hP0 := P.measurable_mu0 have hP1 := P.measurable_mu1 have hbits (a y : Bool) : ‖(1-bit a)*bit y‖ ≤ 1 ∧ ‖bit a*bit y‖ ≤ 1 := by cases a <;> cases y <;> norm_num [bit] have hi : Integrable (fun w : Cov d × Bool × Bool => f w.1*(1-bit w.2.1)*bit w.2.2) (obsLaw P) := by apply population_integrable_bounded _ _ (by fun_prop) B intro w rw [mul_assoc, norm_mul] exact (mul_le_mul_of_nonneg_left (hbits _ _).1 (norm_nonneg _)).trans (by simpa using hfB w.1) have hj : Integrable (fun w : Cov d × Bool × Bool => f w.1*bit w.2.1*bit w.2.2) (obsLaw P) := by apply population_integrable_bounded _ _ (by fun_prop) B intro w rw [mul_assoc, norm_mul] exact (mul_le_mul_of_nonneg_left (hbits _ _).2 (norm_nonneg _)).trans (by simpa using hfB w.1) have hsum : (fun w : Cov d × Bool × Bool => f w.1*bit w.2.2) = fun w => f w.1*(1-bit w.2.1)*bit w.2.2+f w.1*bit w.2.1*bit w.2.2 := by funext w; ring rw [hsum, integral_add hi hj, population_control_outcome_moment P hdesign hex he hm0 f hf B hB hfB hs, population_treated_outcome_moment P hdesign hex he hm1 f hf B hB hfB hs] have hbound (mu : Cov d → ℝ) (hmu : ∀ x ∈ cube d, mu x ∈ Icc 0 1) (e : Cov d → ℝ) (he : ∀ x ∈ cube d, e x ∈ Icc 0 1) : ∀ x, ‖f x * e x * mu x‖ ≤ B := by intro x by_cases hx : x ∈ cube d · rw [norm_mul, norm_mul, Real.norm_eq_abs (e x), Real.norm_eq_abs (mu x), abs_of_nonneg (he x hx).1, abs_of_nonneg (hmu x hx).1] calc _ ≤ ‖f x‖ * e x := by simpa only [mul_one] using mul_le_mul_of_nonneg_left (hmu x hx).2 (mul_nonneg (norm_nonneg (f x)) (he x hx).1) _ ≤ ‖f x‖ := by simpa only [mul_one] using mul_le_mul_of_nonneg_left (he x hx).2 (norm_nonneg (f x)) _ ≤ B := hfB x · simp [hs x hx, hB] have hb0 := hbound P.mu0 (by intro x hx; constructor <;> linarith [(hm0 x hx).1, (hm0 x hx).2]) (fun x => 1-P.e x) (by intro x hx; constructor <;> linarith [(he.unit x hx).1, (he.unit x hx).2]) have hb1 := hbound P.mu1 (by intro x hx; constructor <;> linarith [(hm1 x hx).1, (hm1 x hx).2]) P.e (by intro x hx; constructor <;> linarith [(he.unit x hx).1, (he.unit x hx).2]) rw [← integral_add (population_integrable_bounded _ _ (by fun_prop) B hb0) (population_integrable_bounded _ _ (by fun_prop) B hb1)] apply integral_congr_ae filter_upwards [] with x ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_outcome_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationOutcomeMoments.lean:245
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.PopulationRoles 9 declarations Finite role counts, integrability of localized treatment features, and exact expectations of the independent rectangular role products.

Population averages over the two roles

Finite role counts, integrability of localized treatment features, and exact expectations of the independent rectangular role products.

Localization weights a covariate feature and its treatment bit. Given the specified input d, the specified input h, the specified input f, the specified input z, weighted treatment feature is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
f :
Cov d → ℝ
z :
Cov d × Bool
weightedTreatmentFeature h f z :
ℝ
locWeight h z.1 * f z.1 * bit z.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.weightedTreatmentFeature · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:17
theorem measurable_weightedTreatmentFeature Lemma measurable_weightedTreatmentFeature in the paper ↗

Given bandwidth h and a Borel covariate feature f, the localized treatment feature is Borel.

Formal statement
d :
ℕ
h :
ℝ
f :
Cov d → ℝ
hf :
Proof (Lean source)
@[fun_prop] lemma measurable_weightedTreatmentFeature {d : ℕ} (h : ℝ) (f : Cov d → ℝ) (hf : Measurable f) : Measurable (weightedTreatmentFeature h f) := by unfold weightedTreatmentFeature have hb : Measurable bit := measurable_of_finite bit fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_weightedTreatmentFeature · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:21
theorem weightedTreatmentFeature_norm_bound Lemma weightedTreatmentFeature_norm_bound in the paper ↗

A localized feature inherits a global bound from its bound on the localization box. Given the specified input d, the specified input h, the specified input hh, the specified input f, the specified input B, the specified input hB, the specified input hfB, the specified input z, the weighted treatment feature norm bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
f :
Cov d → ℝ
B :
ℝ
hB :
0 ≤ B
hfB :
∀ x ∈ locCube d h, ‖f x‖ ≤ B
z :
Cov d × Bool
‖weightedTreatmentFeature h f z‖ ≤ h^(-(d:ℝ)) * B
Proof (Lean source)
lemma weightedTreatmentFeature_norm_bound {d : ℕ} (h : ℝ) (hh : 0 < h) (f : Cov d → ℝ) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ x ∈ locCube d h, ‖f x‖ ≤ B) (z : Cov d × Bool) : ‖weightedTreatmentFeature h f z‖ ≤ h^(-(d:ℝ)) * B := by rcases z with ⟨x, a⟩ cases a · simp only [weightedTreatmentFeature, bit, Bool.false_eq_true, if_false, mul_zero, norm_zero] positivity · simpa only [weightedTreatmentFeature, bit, if_true, mul_one] using locWeight_mul_norm_bound h hh f B hB hfB x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.weightedTreatmentFeature_norm_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:28
theorem measurable_treatmentRecord_eval Lemma measurable_treatmentRecord_eval in the paper ↗

For record position i, evaluating the concatenated treatment record at i is Borel.

Formal statement
d n m :
ℕ
i :
Fin (n+m)
Measurable (fun D : Dataset d n m => treatmentRecords D i)
Proof (Lean source)
@[fun_prop] lemma measurable_treatmentRecord_eval {d n m : ℕ} (i : Fin (n+m)) : Measurable (fun D : Dataset d n m => treatmentRecords D i) := by refine Fin.addCases (fun j => ?_) (fun j => ?_) i · simp only [treatmentRecords, Fin.addCases_left] fun_prop · simp only [treatmentRecords, Fin.addCases_right] fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_treatmentRecord_eval · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:40
theorem population_integrable_bounded Lemma population_integrable_bounded in the paper ↗

Bounded Borel statistics are integrable under a probability measure. Given the specified input f, the specified input hf, the specified input B, the specified input hB, the population integrable bounded conclusion holds.

Formal statement
Ω :
f :
Ω → ℝ
hf :
B :
ℝ
hB :
∀ x, ‖f x‖ ≤ B
Proof (Lean source)
lemma population_integrable_bounded {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (f : Ω → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ x, ‖f x‖ ≤ B) : Integrable f μ := by exact (integrable_const B).mono' hf.aestronglyMeasurable (Filter.Eventually.of_forall hB)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_integrable_bounded · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:49
theorem population_role_cardinalities Lemma population_role_cardinalities in the paper ↗

The outcome and treatment roles have their prescribed cardinalities. Given the specified input n, the specified input m, the population role cardinalities conclusion holds.

Formal statement
n m :
ℕ
conclusion 1
(roleSplit n m).1.card = outcomeCount n
conclusion 2
(roleSplit n m).2.card = treatmentCount n m
Proof (Lean source)
lemma population_role_cardinalities (n m : ℕ) : (roleSplit n m).1.card = outcomeCount n ∧ (roleSplit n m).2.card = treatmentCount n m := by classical have hl : n/2 ≤ n := Nat.div_le_self n 2 have ht : n/2 ≤ n+m := by omega constructor · simpa only [roleSplit, outcomeCount, Fin.card_filter_val_lt, min_eq_right hl] · have heq : (roleSplit n m).2 = univ \ (Finset.univ.filter (fun i : Fin (n+m) => i.val < n/2)) := by ext i simp [roleSplit] rw [heq, Finset.card_sdiff_of_subset (filter_subset _ _), Finset.card_univ, Fintype.card_fin, Fin.card_filter_val_lt, min_eq_right ht] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_role_cardinalities · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:55
theorem population_role_counts_pos Lemma population_role_counts_pos in the paper ↗

Both role counts are strictly positive whenever there are at least two labeled records. Given the specified input n, the specified input m, the specified input hn, the population role counts pos conclusion holds.

Formal statement
n m :
ℕ
hn :
2 ≤ n
conclusion 1
conclusion 2
Proof (Lean source)
lemma population_role_counts_pos (n m : ℕ) (hn : 2 ≤ n) : 0 < outcomeCount n ∧ 0 < treatmentCount n m := by unfold outcomeCount treatmentCount omega
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_role_counts_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:72
theorem population_outcome_role_mean Lemma population_outcome_role_mean in the paper ↗

Averaging the labeled outcome-role treatment features preserves their population mean. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input hf, the specified input B, the specified input hfB, the population outcome role mean conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool → ℝ
hf :
B :
ℝ
hfB :
∀ z, ‖f z‖ ≤ B
(∫ w : Sample d n m, (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m)
= ∫ z, f z ∂xaLaw P
Proof (Lean source)
lemma population_outcome_role_mean {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool → ℝ) (hf : Measurable f) (B : ℝ) (hfB : ∀ z, ‖f z‖ ≤ B) : (∫ w : Sample d n m, (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = ∫ z, f z ∂xaLaw P := by classical letI := population_experiment_probability P n m have hi (j : Fin n) : Integrable (fun w : Sample d n m => f ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m) := population_integrable_bounded _ _ (hf.comp (by fun_prop)) B (fun w => hfB _) rw [integral_const_mul, integral_finsetSum _ (fun j _ => hi j)] simp_rw [experiment_labeled_treatment_integral P f hf] simp only [Finset.sum_const, nsmul_eq_mul, (population_role_cardinalities n m).1] have hn0 : (outcomeCount n : ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).1.ne' field_simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_outcome_role_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:78
theorem population_rectangular_role_mean Lemma population_rectangular_role_mean in the paper ↗

Independent rectangular averaging gives the product of the two marginal means. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input B, the specified input C, the specified input hfB, the specified input hgC, the population rectangular role mean conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f g :
Cov d × Bool → ℝ
hf :
hg :
B C :
ℝ
hfB :
∀ z, ‖f z‖ ≤ B
hgC :
∀ z, ‖g z‖ ≤ C
(∫ w : Sample d n m, ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m)
= (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P)
Proof (Lean source)
lemma population_rectangular_role_mean {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f g : Cov d × Bool → ℝ) (hf : Measurable f) (hg : Measurable g) (B C : ℝ) (hfB : ∀ z, ‖f z‖ ≤ B) (hgC : ∀ z, ‖g z‖ ≤ C) : (∫ w : Sample d n m, ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1) ∂experiment P n m) = (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P) := by classical letI := population_experiment_probability P n m have hi (i : Fin (n+m)) (j : Fin n) : Integrable (fun w : Sample d n m => f (treatmentRecords w.1 i) * g ((w.1.1 j).1, (w.1.1 j).2.1)) (experiment P n m) := by apply population_integrable_bounded _ _ (by fun_prop) (B*C) intro w rw [norm_mul] exact mul_le_mul (hfB _) (hgC _) (norm_nonneg _) ((norm_nonneg (f (treatmentRecords w.1 i))).trans (hfB _)) rw [integral_const_mul, integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hi i j))] have hcount : ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ * (∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P)) = (∫ z, f z ∂xaLaw P) * (∫ z, g z ∂xaLaw P) := by simp only [Finset.sum_const, nsmul_eq_mul, (population_role_cardinalities n m).1, (population_role_cardinalities n m).2] have hn0 : (outcomeCount n : ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).1.ne' have ht0 : (treatmentCount n m : ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).2.ne' field_simp apply Eq.trans ?_ hcount congr 1 apply Finset.sum_congr rfl intro i hi' rw [integral_finsetSum _ (fun j _ => hi i j)] apply Finset.sum_congr rfl intro j hj' exact experiment_role_product_integral P f g hf hg i j hi' hj'
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_rectangular_role_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/PopulationRoles.lean:96
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RateAlgebra 6 declarations Two-channel point-CATE annotation frontier: Helpers/RateAlgebra constructions and obligations.

Helpers/RateAlgebra

Two-channel point-CATE annotation frontier: Helpers/RateAlgebra constructions and obligations.

theorem rate_exponent_identities Lemma rate_exponent_identities in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rate exponent identities conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
conclusion 1
qStar d alpha beta gamma = sCrit d gamma/(alpha+beta)
conclusion 2
bigDelta d alpha beta gamma = (2*gamma+d)*(1+qStar d alpha beta gamma)
Proof (Lean source)
lemma rate_exponent_identities (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : qStar d alpha beta gamma = sCrit d gamma/(alpha+beta) ∧ bigDelta d alpha beta gamma = (2*gamma+d)*(1+qStar d alpha beta gamma) := by have hS : 0 < alpha + beta := add_pos hdom.2.1 hdom.2.2.2.1 have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hD : 0 < 2 * gamma + (d : ℝ) := by positivity constructor · dsimp [qStar, sCrit] field_simp · dsimp [bigDelta, qStar] field_simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rate_exponent_identities · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:23

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input m, the specified input hn, the rate branches conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n m :
ℕ
hn :
2 ≤ n
conclusion 1
sCrit d gamma ≤ alpha+beta
sharpRate d alpha beta gamma n m = oracleRate d gamma n
conclusion 2
alpha+beta < sCrit d gamma
(n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma
sharpRate d alpha beta gamma n m
= ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))
conclusion 3
alpha+beta < sCrit d gamma
(n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m
sharpRate d alpha beta gamma n m = oracleRate d gamma n
conclusion 4
(n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma
((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = oracleRate d gamma n
Proof (Lean source)
lemma rate_branches (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n m : ℕ) (hn : 2 ≤ n) : (sCrit d gamma ≤ alpha+beta → sharpRate d alpha beta gamma n m = oracleRate d gamma n) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma → sharpRate d alpha beta gamma n m = ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m → sharpRate d alpha beta gamma n m = oracleRate d gamma n) ∧ ((n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma → ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = oracleRate d gamma n) := by have hS : 0 < alpha + beta := add_pos hdom.2.1 hdom.2.2.2.1 have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hD : 0 < 2 * gamma + (d : ℝ) := by positivity have hDelta : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta] positivity have hnpos : 0 < (n : ℝ) := by exact_mod_cast (show 0 < n by omega) have hn1 : 1 ≤ (n : ℝ) := by exact_mod_cast (show 1 ≤ n by omega) have hN : (n : ℝ) ≤ (n : ℝ) + m := le_add_of_nonneg_right (Nat.cast_nonneg m) have hexp : -(gamma / bigDelta d alpha beta gamma) ≤ 0 := by exact neg_nonpos.mpr (le_of_lt (div_pos hg hDelta)) have hid := (rate_exponent_identities d alpha beta gamma L eps hdom).2 have hboundary : ((n : ℝ) * (n : ℝ) ^ qStar d alpha beta gamma) ^ (-(gamma / bigDelta d alpha beta gamma)) = oracleRate d gamma n := by rw [show (n : ℝ) * (n : ℝ) ^ qStar d alpha beta gamma = (n : ℝ) ^ (1 + qStar d alpha beta gamma) by rw [Real.rpow_add hnpos, Real.rpow_one]] rw [← Real.rpow_mul hnpos.le] dsimp [oracleRate] congr 1 rw [hid] have hq : 0 ≤ qStar d alpha beta gamma := by dsimp [qStar] positivity field_simp have hlarge : ∀ N : ℝ, (n : ℝ) ^ qStar d alpha beta gamma ≤ N → ((n : ℝ) * N) ^ (-(gamma / bigDelta d alpha beta gamma)) ≤ oracleRate d gamma n := by intro N h rw [← hboundary] exact Real.rpow_le_rpow_of_nonpos (mul_pos hnpos (Real.rpow_pos_of_pos hnpos _)) (mul_le_mul_of_nonneg_left h hnpos.le) hexp have hsmall : ∀ N : ℝ, 0 < N → N ≤ (n : ℝ) ^ qStar d alpha beta gamma → oracleRate d gamma n ≤ ((n : ℝ) * N) ^ (-(gamma / bigDelta d alpha beta gamma)) := by intro N hNpos h rw [← hboundary] exact Real.rpow_le_rpow_of_nonpos (mul_pos hnpos hNpos) (mul_le_mul_of_nonneg_left h hnpos.le) hexp change (sCrit d gamma ≤ alpha + beta → max (oracleRate d gamma n) _ = oracleRate d gamma n) ∧ _ refine ⟨?_, ?_, ?_, ?_⟩ · intro hs apply max_eq_left apply hlarge have hq : qStar d alpha beta gamma ≤ 1 := by rw [(rate_exponent_identities d alpha beta gamma L eps hdom).1] exact (div_le_one hS).mpr hs calc (n : ℝ) ^ qStar d alpha beta gamma ≤ (n : ℝ) ^ (1 : ℝ) := Real.rpow_le_rpow_of_exponent_le hn1 hq _ = (n : ℝ) := Real.rpow_one _ _ ≤ (n : ℝ) + m := hN · intro hs h exact max_eq_right (hsmall _ (lt_of_lt_of_le hnpos hN) h) · intro hs h exact max_eq_left (hlarge _ h) · intro h rw [h] exact hboundary
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rate_branches · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:36

Below the smoothness cutoff, the total-count boundary exponent exceeds one. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hs, the q star gt one conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hs :
alpha + beta < sCrit d gamma
1 < qStar d alpha beta gamma
Proof (Lean source)
lemma qStar_gt_one (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hs : alpha + beta < sCrit d gamma) : 1 < qStar d alpha beta gamma := by rw [(rate_exponent_identities d alpha beta gamma L eps hdom).1] exact (one_lt_div (add_pos hdom.2.1 hdom.2.2.2.1)).mpr hs
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qStar_gt_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:107
theorem supervised_rate_branches Lemma supervised_rate_branches in the paper ↗

With no auxiliary records, the pair branch is the stated supervised power. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input hn, the supervised rate branches conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n :
ℕ
hn :
2 ≤ n
conclusion 1
alpha + beta < sCrit d gamma
sharpRate d alpha beta gamma n 0 = (n:ℝ)^(-(2*gamma/bigDelta d alpha beta gamma))
conclusion 2
sCrit d gamma ≤ alpha + beta
sharpRate d alpha beta gamma n 0 = oracleRate d gamma n
Proof (Lean source)
lemma supervised_rate_branches (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n : ℕ) (hn : 2 ≤ n) : (alpha + beta < sCrit d gamma → sharpRate d alpha beta gamma n 0 = (n:ℝ)^(-(2*gamma/bigDelta d alpha beta gamma))) ∧ (sCrit d gamma ≤ alpha + beta → sharpRate d alpha beta gamma n 0 = oracleRate d gamma n) := by have hnpos : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have hn1 : 1 ≤ (n:ℝ) := by exact_mod_cast (show 1 ≤ n by omega) have hb := rate_branches d alpha beta gamma L eps hdom n 0 hn refine ⟨?_, hb.1⟩ intro hs have hN : (n:ℝ) + (0:ℕ) ≤ (n:ℝ)^qStar d alpha beta gamma := by simpa only [Nat.cast_zero, add_zero, Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le hn1 (qStar_gt_one d alpha beta gamma L eps hdom hs).le rw [hb.2.1 hs hN] simp only [Nat.cast_zero, add_zero] rw [← pow_two, ← Real.rpow_natCast, ← Real.rpow_mul hnpos.le] congr 1 norm_num ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.supervised_rate_branches · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:114
theorem decreasing_power_threshold Lemma decreasing_power_threshold in the paper ↗

Inverting a decreasing positive power gives its exact sample threshold. Given the specified input x, the specified input epsilon, the specified input D, the specified input g, the specified input hx, the specified input he, the specified input hD, the specified input hg, the decreasing power threshold conclusion holds.

Formal statement
x epsilon D g :
ℝ
hx :
0 < x
he :
0 < epsilon
hD :
0 < D
hg :
0 < g
x^(-(g/D)) ≤ epsilon ↔ epsilon^(-(D/g)) ≤ x
Proof (Lean source)
lemma decreasing_power_threshold (x epsilon D g : ℝ) (hx : 0 < x) (he : 0 < epsilon) (hD : 0 < D) (hg : 0 < g) : x^(-(g/D)) ≤ epsilon ↔ epsilon^(-(D/g)) ≤ x := by have hz : -(D/g) < 0 := neg_neg_of_pos (div_pos hD hg) have hi : (-(D/g))⁻¹ = -(g/D) := by field_simp simpa only [hi] using (Real.rpow_inv_le_iff_of_neg hx he hz)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.decreasing_power_threshold · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:135
theorem sharpRate_acquisition_iff Lemma sharpRate_acquisition_iff in the paper ↗

The maximum of the two frontier branches gives both exact acquisition requirements. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input m, the specified input hn, the specified input epsilon, the specified input he, the sharp rate acquisition iff conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n m :
ℕ
hn :
2 ≤ n
epsilon :
ℝ
he :
0 < epsilon
sharpRate d alpha beta gamma n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧
epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
Proof (Lean source)
lemma sharpRate_acquisition_iff (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n m : ℕ) (hn : 2 ≤ n) (epsilon : ℝ) (he : 0 < epsilon) : sharpRate d alpha beta gamma n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧ epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m) := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity have hnpos : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have hNpos : 0 < (n:ℝ)+(m:ℝ) := by positivity change max ((n:ℝ)^(-(gamma/(2*gamma+(d:ℝ))))) (((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) ≤ epsilon ↔ _ rw [max_le_iff, decreasing_power_threshold _ _ _ _ hnpos he hA hg, decreasing_power_threshold _ _ _ _ (mul_pos hnpos hNpos) he hD hg] have h0 : (2*gamma+(d:ℝ))/gamma = 2+(d:ℝ)/gamma := by field_simp have h1 : bigDelta d alpha beta gamma/gamma = 2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta) := by dsimp [bigDelta]; field_simp rw [h0, h1]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpRate_acquisition_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RateAlgebra.lean:143
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularBlockLaw 8 declarations An iid full-observation representation projects the auxiliary records to treatment records.

# Joint law of the original-record roles An iid full-observation representation projects the auxiliary records to treatment records. Selecting disjoint index blocks then gives exactly the independent role product law needed by the rectangular variance calculation.

theorem rectangular_iid_block_law Lemma rectangular_iid_block_law in the paper ↗

Disjoint injective selections from an iid sequence have the independent block law. Given the specified input N, the specified input t, the specified input ell, the specified input i, the specified input j, the specified input hi, the specified input hj, the specified input hij, the rectangular iid block law conclusion holds.

Formal statement
Ω :
N t ell :
ℕ
i :
Fin t → Fin N
j :
Fin ell → Fin N
hi :
hj :
hij :
∀ a b, i a ≠ j b
MeasurePreserving (fun D : Fin N → Ω => ((fun a => D (i a)), (fun b => D (j b)))) (Measure.pi (fun _ : Fin N => μ)) ((Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => μ)))
Proof (Lean source)
lemma rectangular_iid_block_law {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (N t ell : ℕ) (i : Fin t → Fin N) (j : Fin ell → Fin N) (hi : Injective i) (hj : Injective j) (hij : ∀ a b, i a ≠ j b) : MeasurePreserving (fun D : Fin N → Ω => ((fun a => D (i a)), (fun b => D (j b)))) (Measure.pi (fun _ : Fin N => μ)) ((Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => μ))) := by classical let s : Fin t ⊕ Fin ell → Fin N := Sum.elim i j have hs : Injective s := by intro a b hab cases a with | inl a => cases b with | inl b => exact congrArg inl (hi hab) | inr b => exact False.elim (hij a b hab) | inr a => cases b with | inl b => exact False.elim (hij b a hab.symm) | inr b => exact congrArg inr (hj hab) have hind := (iIndepFun_pi (μ := fun _ : Fin N => μ) (X := fun _ => id) (fun _ => aemeasurable_id)).precomp hs have hm := (iIndepFun_iff_map_fun_eq_pi_map (fun a : Fin t ⊕ Fin ell => (measurable_pi_apply (s a)).aemeasurable)).mp hind simp only [(measurePreserving_eval (fun _ : Fin N => μ) _).map_eq] at hm have hsel : MeasurePreserving (fun D : Fin N → Ω => fun a => D (s a)) (Measure.pi (fun _ : Fin N => μ)) (Measure.pi (fun _ : Fin t ⊕ Fin ell => μ)) := ⟨by fun_prop, hm⟩ exact (measurePreserving_sumPiEquivProdPi (fun _ : Fin t ⊕ Fin ell => μ)).comp hsel
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_iid_block_law · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:18
theorem rectangular_iid_dataset_law Lemma rectangular_iid_dataset_law in the paper ↗

Projecting outcome-free records from a longer iid observation sequence realizes the dataset law. Given the specified input d, the specified input n, the specified input m, the specified input P, the rectangular iid dataset law conclusion holds.

Formal statement
d n m :
ℕ
P :
MeasurePreserving (fun D : Fin (n+m) → Cov d × Bool × Bool => ((fun i : Fin n => D (castAdd m i)), (fun j : Fin m => ((D (natAdd n j)).1, (D (natAdd n j)).2.1)))) (Measure.pi (fun _ : Fin (n+m) => obsLaw P)) ((Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P)))
Proof (Lean source)
lemma rectangular_iid_dataset_law {d n m : ℕ} (P : PrimitiveLaw d) : MeasurePreserving (fun D : Fin (n+m) → Cov d × Bool × Bool => ((fun i : Fin n => D (castAdd m i)), (fun j : Fin m => ((D (natAdd n j)).1, (D (natAdd n j)).2.1)))) (Measure.pi (fun _ : Fin (n+m) => obsLaw P)) ((Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))) := by letI := obsLaw_probability P letI := xaLaw_probability P have hsplit := rectangular_iid_block_law (obsLaw P) (n+m) n m (castAdd m) (natAdd n) (Fin.castAdd_injective n m) (Fin.natAdd_injective m n) (fun i j he => by have := congrArg val he; simp only [Fin.val_castAdd, Fin.val_natAdd] at this; omega) have hproj : MeasurePreserving (fun z : Cov d × Bool × Bool => (z.1,z.2.1)) (obsLaw P) (xaLaw P) := ⟨by fun_prop, obsLaw_map_treatment P⟩ exact (MeasurePreserving.prod (MeasurePreserving.id _) (measurePreserving_pi _ _ (fun _ : Fin m => hproj))).comp hsplit
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_iid_dataset_law · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:48
theorem rectangular_dataset_block_law Lemma rectangular_dataset_block_law in the paper ↗

Enumerating both prescribed roles preserves their independent treatment/outcome product law. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input i, the specified input j, the specified input hi, the specified input hj, the specified input hit, the specified input hjl, the rectangular dataset block law conclusion holds.

Formal statement
d n m :
ℕ
P :
i :
Fin (treatmentCount n m) → Fin (n+m)
j :
Fin (outcomeCount n) → Fin n
hi :
hj :
hit :
∀ a, i a ∈ (roleSplit n m).2
hjl :
∀ b, j b ∈ (roleSplit n m).1
MeasurePreserving (fun D : Dataset d n m => ((fun a => treatmentRecords D (i a)), (fun b => D.1 (j b)))) ((Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))) ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P)))
Proof (Lean source)
lemma rectangular_dataset_block_law {d n m : ℕ} (P : PrimitiveLaw d) (i : Fin (treatmentCount n m) → Fin (n+m)) (j : Fin (outcomeCount n) → Fin n) (hi : Injective i) (hj : Injective j) (hit : ∀ a, i a ∈ (roleSplit n m).2) (hjl : ∀ b, j b ∈ (roleSplit n m).1) : MeasurePreserving (fun D : Dataset d n m => ((fun a => treatmentRecords D (i a)), (fun b => D.1 (j b)))) ((Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))) ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) := by letI := obsLaw_probability P letI := xaLaw_probability P have hsplit := rectangular_iid_block_law (obsLaw P) (n+m) (treatmentCount n m) (outcomeCount n) i (fun b => castAdd m (j b)) hi ((Fin.castAdd_injective n m).comp hj) (fun a b he => by have ht := (Finset.mem_filter.mp (hit a)).2 have hl := (Finset.mem_filter.mp (hjl b)).2 have := congrArg val he simp only [Fin.val_castAdd] at this omega) have hproj : MeasurePreserving (fun z : Cov d × Bool × Bool => (z.1,z.2.1)) (obsLaw P) (xaLaw P) := ⟨by fun_prop, obsLaw_map_treatment P⟩ have hroles := (MeasurePreserving.prod (measurePreserving_pi _ _ (fun _ : Fin (treatmentCount n m) => hproj)) (MeasurePreserving.id _)).comp hsplit have hd := rectangular_iid_dataset_law (n := n) (m := m) P have he (D : Fin (n+m) → Cov d × Bool × Bool) (a : Fin (n+m)) : treatmentRecords ((fun k => D (castAdd m k)), (fun k => ((D (natAdd n k)).1, (D (natAdd n k)).2.1))) a = ((D a).1, (D a).2.1) := by refine Fin.addCases (fun k => ?_) (fun k => ?_) a <;> simp only [treatmentRecords, Fin.addCases_left, Fin.addCases_right] refine ⟨by fun_prop, ?_⟩ rw [← hd.map_eq, Measure.map_map (by fun_prop) hd.measurable] convert hroles.map_eq using 1 congr 1 funext D apply Prod.ext · funext a exact he D (i a) · rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_dataset_block_law · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:66

An enumeration of the treatment role by its prescribed count. Given the specified input n, the specified input m, rectangular treatment enumeration is the corresponding construction.

Definition (Lean source)
n m :
ℕ
rectangularTreatmentEnumeration n m :
Fin (treatmentCount n m) ≃ (roleSplit n m).2
(Fintype.equivFinOfCardEq (by simpa using (population_role_cardinalities n m).2)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularTreatmentEnumeration · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:109

An enumeration of the outcome role by its prescribed count. Given the specified input n, the specified input m, rectangular outcome enumeration is the corresponding construction.

Definition (Lean source)
n m :
ℕ
rectangularOutcomeEnumeration n m :
Fin (outcomeCount n) ≃ (roleSplit n m).1
(Fintype.equivFinOfCardEq (by simpa using (population_role_cardinalities n m).1)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularOutcomeEnumeration · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:113

The selected records in the two roles, including their deterministic enumeration. Given the specified input d, the specified input n, the specified input m, the specified input w, rectangular role data is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
w :
Sample d n m
rectangularRoleData w :
(Fin (treatmentCount n m) → Cov d × Bool) × (Fin (outcomeCount n) → Cov d × Bool × Bool)
((fun a => treatmentRecords w.1 (rectangularTreatmentEnumeration n m a)), (fun b => w.1.1 (rectangularOutcomeEnumeration n m b)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularRoleData · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:117
theorem rectangular_role_data_law Lemma rectangular_role_data_law in the paper ↗

The original-record role vector has precisely the independent role product law. Given the specified input d, the specified input n, the specified input m, the specified input P, the rectangular role data law conclusion holds.

Formal statement
d n m :
ℕ
P :
MeasurePreserving (rectangularRoleData (d := d) (n := n) (m := m)) (experiment P n m) ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P)))
Proof (Lean source)
lemma rectangular_role_data_law {d n m : ℕ} (P : PrimitiveLaw d) : MeasurePreserving (rectangularRoleData (d := d) (n := n) (m := m)) (experiment P n m) ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) := by letI := population_randomizer_probability have h := rectangular_dataset_block_law P (fun a => (rectangularTreatmentEnumeration n m a).val) (fun b => (rectangularOutcomeEnumeration n m b).val) (Subtype.val_injective.comp (rectangularTreatmentEnumeration n m).injective) (Subtype.val_injective.comp (rectangularOutcomeEnumeration n m).injective) (fun a => (rectangularTreatmentEnumeration n m a).property) (fun b => (rectangularOutcomeEnumeration n m b).property) exact h.comp measurePreserving_fst
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_data_law · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:123
theorem rectangular_role_sum_enumeration Lemma rectangular_role_sum_enumeration in the paper ↗

The rectangular role sum equals the ordinary finite sum over the enumerated role vector. Given the specified input d, the specified input n, the specified input m, the specified input w, the specified input H, the rectangular role sum enumeration conclusion holds.

Formal statement
d n m :
ℕ
w :
Sample d n m
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
(∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, H (treatmentRecords w.1 i, w.1.1 j))
= ∑ a : Fin (treatmentCount n m), ∑ b : Fin (outcomeCount n), H ((rectangularRoleData w).1 a, (rectangularRoleData w).2 b)
Proof (Lean source)
lemma rectangular_role_sum_enumeration {d n m : ℕ} (w : Sample d n m) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) : (∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, H (treatmentRecords w.1 i, w.1.1 j)) = ∑ a : Fin (treatmentCount n m), ∑ b : Fin (outcomeCount n), H ((rectangularRoleData w).1 a, (rectangularRoleData w).2 b) := by classical rw [← Finset.sum_coe_sort (roleSplit n m).2] simp_rw [← Finset.sum_coe_sort (roleSplit n m).1] rw [← (rectangularTreatmentEnumeration n m).sum_comp] simp_rw [← (rectangularOutcomeEnumeration n m).sum_comp] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_sum_enumeration · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularBlockLaw.lean:138
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularCoordinates 5 declarations Both types of coordinate are instances of the original-record marked moment bound.

# Coordinate bounds for the rectangular vector and raw Gram matrix Both types of coordinate are instances of the original-record marked moment bound. Their constants depend only on dimension, and hence are uniform in the law, sample counts, and localization grid.

A common finite variance constant for vector and raw-matrix coordinates. Given the specified input d, rectangular coordinate constant is the corresponding construction.

Definition (Lean source)
d :
ℕ
rectangularCoordinateConstant d :
ℝ
M :
((4:ℝ)^d)^2
6*M^2 + 12*(M*M)^2*(((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularCoordinateConstant · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularCoordinates.lean:18
theorem rectangular_coarse_mark_bound Lemma rectangular_coarse_mark_bound in the paper ↗

Coarse basis coordinates times a binary mark share a dimension-only local bound. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the specified input u, the specified input a, the rectangular coarse mark bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
u :
a :
|coarseBasis h x u * bit a| ≤ ((4:ℝ)^d)^2
Proof (Lean source)
lemma rectangular_coarse_mark_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) (u : PolyIdx d) (a : Bool) : |coarseBasis h x u * bit a| ≤ ((4:ℝ)^d)^2 := by rw [abs_mul] have hb : 1 ≤ (4:ℝ)^d := one_le_pow₀ (by norm_num) calc _ ≤ (4:ℝ)^d * 1 := mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (rectangular_bit_abs_le_one a) (abs_nonneg _) (by positivity) _ ≤ _ := by nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_coarse_mark_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularCoordinates.lean:23
theorem rectangular_coarse_pair_mark_bound Lemma rectangular_coarse_pair_mark_bound in the paper ↗

A product of two coarse coordinates and a binary mark has the same common bound. Given the specified input d, the specified input h, the specified input hh, the specified input x, the specified input hx, the specified input u, the specified input v, the specified input a, the rectangular coarse pair mark bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∈ locCube d h
u v :
a :
|coarseBasis h x u * coarseBasis h x v * bit a| ≤ ((4:ℝ)^d)^2
Proof (Lean source)
lemma rectangular_coarse_pair_mark_bound (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∈ locCube d h) (u v : PolyIdx d) (a : Bool) : |coarseBasis h x u * coarseBasis h x v * bit a| ≤ ((4:ℝ)^d)^2 := by rw [abs_mul, abs_mul] calc _ ≤ ((4:ℝ)^d * (4:ℝ)^d) * 1 := mul_le_mul (mul_le_mul (coarseBasis_abs_bound d h hh x hx u) (coarseBasis_abs_bound d h hh x hx v) (abs_nonneg _) (by positivity)) (rectangular_bit_abs_le_one a) (abs_nonneg _) (by positivity) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_coarse_pair_mark_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularCoordinates.lean:34
theorem rectangular_r_coordinate_bound Lemma rectangular_r_coordinate_bound in the paper ↗

The vector coordinate's centered energy has the claimed rectangular sampling order. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the rectangular r coordinate bound conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
2 ≤ n
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u :
conclusion 1
MemLp (fun w : Sample d n m => rHat w.1 h J u) 2 (experiment P n m)
conclusion 2
(∫ w, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m)
≤ rectangularCoordinateConstant d * (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_r_coordinate_bound {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 2 ≤ n) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u : PolyIdx d) : MemLp (fun w : Sample d n m => rHat w.1 h J u) 2 (experiment P n m) ∧ (∫ w, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m) ≤ rectangularCoordinateConstant d * (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by let f0 := fun z : Cov d × Bool × Bool => coarseBasis h z.1 u * bit z.2.1 * bit z.2.2 let f := fun z : Cov d × Bool => coarseBasis h z.1 u * bit z.2 let g := fun z : Cov d × Bool × Bool => bit z.2.2 let H := fun p : (Cov d × Bool) × (Cov d × Bool × Bool) => locWeight h p.1.1 * locWeight h p.2.1 * fineKernel d h J p.1.1 p.2.1 * f p.1 * g p.2 have hf0 : Measurable f0 := by dsimp [f0]; fun_prop have hf : Measurable f := by dsimp [f]; fun_prop have hg : Measurable g := by dsimp [g]; fun_prop have h0 (z : Cov d × Bool × Bool) (hz : z.1 ∈ locCube d h) : |f0 z| ≤ ((4:ℝ)^d)^2 := by dsimp [f0] rw [abs_mul] calc _ ≤ ((4:ℝ)^d)^2 * 1 := mul_le_mul (rectangular_coarse_mark_bound d h hh z.1 hz u z.2.1) (rectangular_bit_abs_le_one _) (abs_nonneg _) (by positivity) _ = _ := mul_one _ have hfB (z : Cov d × Bool) (hz : z.1 ∈ locCube d h) : |f z| ≤ ((4:ℝ)^d)^2 := rectangular_coarse_mark_bound d h hh z.1 hz u z.2 have hgB (z : Cov d × Bool × Bool) (_ : z.1 ∈ locCube d h) : |g z| ≤ ((4:ℝ)^d)^2 := by have hb : 1 ≤ (4:ℝ)^d := one_le_pow₀ (by norm_num) exact (rectangular_bit_abs_le_one _).trans (by nlinarith) have hb := rectangular_marked_moment_bound (m := m) P hP hn h J hh hh' hJ f0 f g hf0 hf hg (((4:ℝ)^d)^2) (by positivity) h0 hfB hgB have he : (fun w : Sample d n m => rHat w.1 h J u) = (fun w => rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w - rectangularAverage H w) := by funext w rw [rHat_rectangular] dsimp [rectangularOutcomeAverage, rectangularAverage, H, f0, f, g] congr 1 · congr 1 apply Finset.sum_congr rfl intro j _ ring · congr 1 apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring change MemLp (fun w => rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w-rectangularAverage H w) 2 _ ∧ _ at hb rw [← he] at hb exact hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_r_coordinate_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularCoordinates.lean:46
theorem rectangular_q_coordinate_bound Lemma rectangular_q_coordinate_bound in the paper ↗

Every raw Gram coordinate has the same dimension-only centered-energy bound. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the specified input v, the rectangular q coordinate bound conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
2 ≤ n
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u v :
conclusion 1
MemLp (fun w : Sample d n m => qRaw w.1 h J u v) 2 (experiment P n m)
conclusion 2
(∫ w, (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2 ∂experiment P n m)
≤ rectangularCoordinateConstant d * (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_q_coordinate_bound {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 2 ≤ n) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u v : PolyIdx d) : MemLp (fun w : Sample d n m => qRaw w.1 h J u v) 2 (experiment P n m) ∧ (∫ w, (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2 ∂experiment P n m) ≤ rectangularCoordinateConstant d * (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by let f0 := fun z : Cov d × Bool × Bool => coarseBasis h z.1 u * coarseBasis h z.1 v * bit z.2.1 let f := fun z : Cov d × Bool => coarseBasis h z.1 u * bit z.2 let g := fun z : Cov d × Bool × Bool => coarseBasis h z.1 v * bit z.2.1 let H := fun p : (Cov d × Bool) × (Cov d × Bool × Bool) => locWeight h p.1.1 * locWeight h p.2.1 * fineKernel d h J p.1.1 p.2.1 * f p.1 * g p.2 have hf0 : Measurable f0 := by dsimp [f0]; fun_prop have hf : Measurable f := by dsimp [f]; fun_prop have hg : Measurable g := by dsimp [g]; fun_prop have h0 (z : Cov d × Bool × Bool) (hz : z.1 ∈ locCube d h) : |f0 z| ≤ ((4:ℝ)^d)^2 := rectangular_coarse_pair_mark_bound d h hh z.1 hz u v z.2.1 have hfB (z : Cov d × Bool) (hz : z.1 ∈ locCube d h) : |f z| ≤ ((4:ℝ)^d)^2 := rectangular_coarse_mark_bound d h hh z.1 hz u z.2 have hgB (z : Cov d × Bool × Bool) (hz : z.1 ∈ locCube d h) : |g z| ≤ ((4:ℝ)^d)^2 := rectangular_coarse_mark_bound d h hh z.1 hz v z.2.1 have hb := rectangular_marked_moment_bound (m := m) P hP hn h J hh hh' hJ f0 f g hf0 hf hg (((4:ℝ)^d)^2) (by positivity) h0 hfB hgB have he : (fun w : Sample d n m => qRaw w.1 h J u v) = (fun w => rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w - rectangularAverage H w) := by funext w dsimp [qRaw, rectangularOutcomeAverage, rectangularAverage, H, f0, f, g] congr 1 · congr 1 apply Finset.sum_congr rfl intro j _ ring · congr 1 apply Finset.sum_congr rfl intro i _ apply Finset.sum_congr rfl intro j _ ring change MemLp (fun w => rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w-rectangularAverage H w) 2 _ ∧ _ at hb rw [← he] at hb exact hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_q_coordinate_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularCoordinates.lean:97
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularKernelEnergy 20 declarations Uniform design converts the squared, doubly localized projection kernel into its rank times the inverse squared localization volume.

# Rectangular kernel second moments Uniform design converts the squared, doubly localized projection kernel into its rank times the inverse squared localization volume. Bounded record marks and coarse features preserve this order. These are the kernel-energy steps of the rectangular sampling roadmap.

theorem rectangular_fineKernel_abs_bound Lemma rectangular_fineKernel_abs_bound in the paper ↗

The fine projection kernel is globally bounded at every fixed resolution. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input x, the specified input y, the rectangular fine kernel abs bound conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
x y :
Cov d
|fineKernel d h J x y|
≤ (card (FineIdx d J):ℝ) * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2
Proof (Lean source)
lemma rectangular_fineKernel_abs_bound (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (x y : Cov d) : |fineKernel d h J x y| ≤ (card (FineIdx d J):ℝ) * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2 := by unfold fineKernel calc _ ≤ ∑ z : FineIdx d J, |fineBasis h J x z * fineBasis h J y z| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ _z : FineIdx d J, (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2 := by apply Finset.sum_le_sum intro z _ rw [abs_mul, pow_two] exact mul_le_mul (fineBasis_abs_bound d h J hh hJ x z) (fineBasis_abs_bound d h J hh hJ y z) (abs_nonneg _) (by positivity) _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_fineKernel_abs_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:19
theorem rectangular_locWeight_bounds Lemma rectangular_locWeight_bounds in the paper ↗

The localization weight is nonnegative and at most its fixed height. Given the specified input d, the specified input h, the specified input hh, the specified input x, the rectangular loc weight bounds conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
x :
Cov d
conclusion 1
0 ≤ locWeight h x
conclusion 2
locWeight h x ≤ h^(-(d:ℝ))
Proof (Lean source)
lemma rectangular_locWeight_bounds (d : ℕ) (h : ℝ) (hh : 0 < h) (x : Cov d) : 0 ≤ locWeight h x ∧ locWeight h x ≤ h^(-(d:ℝ)) := by unfold locWeight split_ifs <;> constructor <;> first | exact le_refl _ | positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_locWeight_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:36
theorem rectangular_weighted_kernel_memLp Lemma rectangular_weighted_kernel_memLp in the paper ↗

A bounded fine kernel remains square integrable with either one or two localization weights. Given the specified input W, the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the specified input a, the specified input b, the rectangular weighted kernel mem lp conclusion holds.

Formal statement
μ :
ν :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
a b :
ℕ
MemLp (fun p : W × Z => (locWeight h (X p.1))^a * (locWeight h (Y p.2))^b * fineKernel d h J (X p.1) (Y p.2)) 2 (μ.prod ν)
Proof (Lean source)
lemma rectangular_weighted_kernel_memLp {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (a b : ℕ) : MemLp (fun p : W × Z => (locWeight h (X p.1))^a * (locWeight h (Y p.2))^b * fineKernel d h J (X p.1) (Y p.2)) 2 (μ.prod ν) := by apply (memLp_top_of_bound (by fun_prop) ((h^(-(d:ℝ)))^a * (h^(-(d:ℝ)))^b * (card (FineIdx d J):ℝ) * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2) ?_).mono_exponent (by simp) filter_upwards [] with p simp only [Real.norm_eq_abs, abs_mul, abs_pow, abs_of_nonneg (rectangular_locWeight_bounds d h hh _).1] calc _ ≤ (h^(-(d:ℝ)))^a * (h^(-(d:ℝ)))^b * ((card (FineIdx d J):ℝ) * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2) := by obtain ⟨hx0, hx⟩ := rectangular_locWeight_bounds d h hh (X p.1) obtain ⟨hy0, hy⟩ := rectangular_locWeight_bounds d h hh (Y p.2) gcongr <;> first | positivity | assumption | exact rectangular_fineKernel_abs_bound d h J hh hJ _ _ _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_weighted_kernel_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:42
theorem rectangular_product_localization_integral Lemma rectangular_product_localization_integral in the paper ↗

Product localization is obtained by applying the one-variable identity twice. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input F, the specified input hfull, the specified input hloc, the rectangular product localization integral conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
F :
Cov d × Cov d → ℝ
hfull :
Integrable (fun p => locWeight h p.1 * locWeight h p.2 * F p) ((uniformLaw d).prod (uniformLaw d))
hloc :
Integrable F ((locLaw d h).prod (locLaw d h))
(∫ p, locWeight h p.1 * locWeight h p.2 * F p ∂(uniformLaw d).prod (uniformLaw d))
= ∫ p, F p ∂(locLaw d h).prod (locLaw d h)
Proof (Lean source)
lemma rectangular_product_localization_integral (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (F : Cov d × Cov d → ℝ) (hfull : Integrable (fun p => locWeight h p.1 * locWeight h p.2 * F p) ((uniformLaw d).prod (uniformLaw d))) (hloc : Integrable F ((locLaw d h).prod (locLaw d h))) : (∫ p, locWeight h p.1 * locWeight h p.2 * F p ∂(uniformLaw d).prod (uniformLaw d)) = ∫ p, F p ∂(locLaw d h).prod (locLaw d h) := by letI : SFinite (uniformLaw d) := by unfold uniformLaw; infer_instance letI : SFinite (locLaw d h) := by unfold locLaw; infer_instance rw [integral_prod _ hfull] simp_rw [mul_assoc, integral_const_mul, uniformLaw_localization_integral d h hh hh'] rw [integral_prod _ hloc]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_product_localization_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:65
theorem rectangular_uniform_kernel_square_integral Lemma rectangular_uniform_kernel_square_integral in the paper ↗

Under uniform design, the squared weighted kernel has exactly rank divided by squared volume. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the rectangular uniform kernel square integral conclusion holds.

Formal statement
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
(∫ p, (locWeight h p.1 * locWeight h p.2 * fineKernel d h J p.1 p.2)^2 ∂(uniformLaw d).prod (uniformLaw d))
= (card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)
Proof (Lean source)
lemma rectangular_uniform_kernel_square_integral (d : ℕ) [IsProbabilityMeasure (uniformLaw d)] (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) : (∫ p, (locWeight h p.1 * locWeight h p.2 * fineKernel d h J p.1 p.2)^2 ∂(uniformLaw d).prod (uniformLaw d)) = (card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d) := by letI := localization_probability d h hh hh' have hsq (x : Cov d) : (locWeight h x)^2 = h^(-(d:ℝ))*locWeight h x := by unfold locWeight split_ifs <;> ring have heq (p : Cov d × Cov d) : (locWeight h p.1 * locWeight h p.2 * fineKernel d h J p.1 p.2)^2 = (h^(-(d:ℝ)))^2 * (locWeight h p.1 * locWeight h p.2 * (fineKernel d h J p.1 p.2)^2) := by rw [mul_pow, mul_pow, hsq, hsq] ring have hfull := (rectangular_weighted_kernel_memLp (uniformLaw d) (uniformLaw d) d h J hh hJ id id measurable_id measurable_id 1 1).integrable_sq have hi : Integrable (fun p : Cov d × Cov d => locWeight h p.1 * locWeight h p.2 * (fineKernel d h J p.1 p.2)^2) ((uniformLaw d).prod (uniformLaw d)) := by have hrewrite : (fun p : Cov d × Cov d => locWeight h p.1 * locWeight h p.2 * (fineKernel d h J p.1 p.2)^2) = (fun p => ((h^(-(d:ℝ)))^2)⁻¹ * (locWeight h p.1 * locWeight h p.2 * fineKernel d h J p.1 p.2)^2) := by funext p rw [heq] field_simp rw [hrewrite] simpa only [pow_one, id_eq] using hfull.const_mul (((h^(-(d:ℝ)))^2)⁻¹) have hlocal := (rectangular_weighted_kernel_memLp (locLaw d h) (locLaw d h) d h J hh hJ id id measurable_id measurable_id 0 0).integrable_sq simp only [pow_one, pow_zero, one_mul, id_eq] at hfull hlocal simp_rw [heq] rw [integral_const_mul, rectangular_product_localization_integral d h hh hh' _ hi hlocal, fineKernel_square_integral d h J hh hh' hJ] rw [Real.rpow_neg hh.le, Real.rpow_natCast, ← inv_pow, ← pow_mul] rw [Nat.mul_comm d 2] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_uniform_kernel_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:81
theorem rectangular_record_kernel_square_integral Lemma rectangular_record_kernel_square_integral in the paper ↗

Independent uniform covariates retain the exact weighted-kernel energy under record maps. Given the specified input W, the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the uniform pushforward identities, the rectangular record kernel square integral conclusion holds.

Formal statement
μ :
ν :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
hμ :
μ.map X = uniformLaw d
hν :
ν.map Y = uniformLaw d
(∫ p, (locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2))^2 ∂μ.prod ν)
= (card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)
Proof (Lean source)
lemma rectangular_record_kernel_square_integral {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (hμ : μ.map X = uniformLaw d) (hν : ν.map Y = uniformLaw d) : (∫ p, (locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2))^2 ∂μ.prod ν) = (card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d) := by letI : IsProbabilityMeasure (uniformLaw d) := hμ ▸ Measure.isProbabilityMeasure_map hX.aemeasurable have hmap : (μ.prod ν).map (fun p : W × Z => (X p.1, Y p.2)) = (uniformLaw d).prod (uniformLaw d) := by change (μ.prod ν).map (map X Y) = _ rw [← Measure.map_prod_map μ ν hX hY, hμ, hν] have hi := integral_map (show AEMeasurable (fun p : W × Z => (X p.1, Y p.2)) (μ.prod ν) from (by fun_prop)) (f := fun p : Cov d × Cov d => (locWeight h p.1 * locWeight h p.2 * fineKernel d h J p.1 p.2)^2) (by fun_prop) rw [hmap] at hi rw [← hi] exact rectangular_uniform_kernel_square_integral d h J hh hh' hJ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_record_kernel_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:121
theorem rectangular_marked_kernel_energy_le Lemma rectangular_marked_kernel_energy_le in the paper ↗

Locally bounded record features multiply kernel energy by their squared bounds. Given the specified input W, the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the uniform pushforward identities, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input hfA, the specified input hgB, the rectangular marked kernel energy le conclusion holds.

Formal statement
μ :
ν :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
hμ :
μ.map X = uniformLaw d
hν :
ν.map Y = uniformLaw d
f :
W → ℝ
g :
Z → ℝ
hf :
hg :
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hfA :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ A
hgB :
∀ z
if
Y z ∈ locCube d h
then
|g z| ≤ B
conclusion 1
MemLp (fun p : W × Z => locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2) 2 (μ.prod ν)
conclusion 2
(∫ p, (locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2)^2 ∂μ.prod ν)
≤ A^2 * B^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d))
Proof (Lean source)
lemma rectangular_marked_kernel_energy_le {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (hμ : μ.map X = uniformLaw d) (hν : ν.map Y = uniformLaw d) (f : W → ℝ) (g : Z → ℝ) (hf : Measurable f) (hg : Measurable g) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hfA : ∀ w, X w ∈ locCube d h → |f w| ≤ A) (hgB : ∀ z, Y z ∈ locCube d h → |g z| ≤ B) : MemLp (fun p : W × Z => locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2) 2 (μ.prod ν) ∧ (∫ p, (locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2)^2 ∂μ.prod ν) ≤ A^2 * B^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)) := by let K := fun p : W × Z => locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) let H := fun p : W × Z => K p * f p.1 * g p.2 have hK : MemLp K 2 (μ.prod ν) := by simpa only [K, pow_one] using rectangular_weighted_kernel_memLp μ ν d h J hh hJ X Y hX hY 1 1 have hbound (p : W × Z) : ‖H p‖ ≤ (A*B)*‖K p‖ := by by_cases hx : X p.1 ∈ locCube d h · by_cases hy : Y p.2 ∈ locCube d h · simp only [H, Real.norm_eq_abs, abs_mul] calc _ ≤ |K p| * A * B := mul_le_mul (mul_le_mul_of_nonneg_left (hfA p.1 hx) (abs_nonneg _)) (hgB p.2 hy) (abs_nonneg _) (mul_nonneg (abs_nonneg _) hA) _ = _ := by ring · simp [H, K, locWeight, hy] · simp [H, K, locWeight, hx] have hH : MemLp H 2 (μ.prod ν) := hK.of_le_mul (by dsimp [H, K]; fun_prop) (Filter.Eventually.of_forall hbound) refine ⟨hH, ?_⟩ have he := rectangular_record_kernel_square_integral μ ν d h J hh hh' hJ X Y hX hY hμ hν change (∫ p, (H p)^2 ∂μ.prod ν) ≤ _ calc _ ≤ ∫ p, (A*B)^2 * (K p)^2 ∂μ.prod ν := by apply integral_mono hH.integrable_sq (hK.integrable_sq.const_mul _) intro p have hb := hbound p simp only [Real.norm_eq_abs] at hb have hs := mul_self_le_mul_self (abs_nonneg (H p)) hb simpa only [← pow_two, mul_pow, sq_abs] using hs _ = _ := by rw [integral_const_mul, he]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_marked_kernel_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:145
theorem rectangular_primitive_uniform_design Lemma rectangular_primitive_uniform_design in the paper ↗

Primitive-class membership fixes the actual covariate marginal, regardless of raw versions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the rectangular primitive uniform design conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Proof (Lean source)
lemma rectangular_primitive_uniform_design {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : UniformDesign P := by have hs := canonicalLaw_spec P hP change P.law.map fst = uniformLaw d rw [← hs.1] exact hs.2.1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_primitive_uniform_design · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:193
theorem rectangular_xaLaw_covariates Lemma rectangular_xaLaw_covariates in the paper ↗

A treatment-role record has uniform covariates. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the rectangular xa law covariates conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Proof (Lean source)
lemma rectangular_xaLaw_covariates {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : (xaLaw P).map fst = uniformLaw d := by unfold xaLaw rw [Measure.map_map (by fun_prop) (by fun_prop)] exact rectangular_primitive_uniform_design P hP
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_xaLaw_covariates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:201
theorem rectangular_obsLaw_covariates Lemma rectangular_obsLaw_covariates in the paper ↗

An outcome-role record has uniform covariates. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the rectangular obs law covariates conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
(obsLaw P).map fst = uniformLaw d
Proof (Lean source)
lemma rectangular_obsLaw_covariates {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) : (obsLaw P).map fst = uniformLaw d := by unfold obsLaw rw [Measure.map_map (by fun_prop) population_measurable_observed] exact rectangular_primitive_uniform_design P hP
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_obsLaw_covariates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:209
theorem rectangular_bit_abs_le_one Lemma rectangular_bit_abs_le_one in the paper ↗

Binary record marks have absolute value at most one. Given the specified input a, the rectangular bit abs le one conclusion holds.

Formal statement
a :
|bit a| ≤ 1
Proof (Lean source)
lemma rectangular_bit_abs_le_one (a : Bool) : |bit a| ≤ 1 := by cases a <;> norm_num [bit]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_bit_abs_le_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:217
theorem rectangular_r_kernel_energy Lemma rectangular_r_kernel_energy in the paper ↗

The vector correction kernel has second moment at most a dimension constant times rank over squared volume. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the rectangular r kernel energy conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u :
(∫ p : (Cov d × Bool) × (Cov d × Bool × Bool), (locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * bit p.1.2 * fineKernel d h J p.1.1 p.2.1 * bit p.2.2.2)^2 ∂(xaLaw P).prod (obsLaw P))
≤ ((4:ℝ)^d)^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d))
Proof (Lean source)
lemma rectangular_r_kernel_energy {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u : PolyIdx d) : (∫ p : (Cov d × Bool) × (Cov d × Bool × Bool), (locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * bit p.1.2 * fineKernel d h J p.1.1 p.2.1 * bit p.2.2.2)^2 ∂(xaLaw P).prod (obsLaw P)) ≤ ((4:ℝ)^d)^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)) := by letI := xaLaw_probability P letI := obsLaw_probability P have he := rectangular_marked_kernel_energy_le (xaLaw P) (obsLaw P) d h J hh hh' hJ fst fst measurable_fst measurable_fst (rectangular_xaLaw_covariates P hP) (rectangular_obsLaw_covariates P hP) (fun w => coarseBasis h w.1 u * bit w.2) (fun z => bit z.2.2) (by fun_prop) (by fun_prop) ((4:ℝ)^d) 1 (by positivity) zero_le_one (fun w hw => by rw [abs_mul] simpa using mul_le_mul (coarseBasis_abs_bound d h hh w.1 hw u) (rectangular_bit_abs_le_one w.2) (abs_nonneg _) (by positivity)) (fun z _ => rectangular_bit_abs_le_one z.2.2) convert he.2 using 1 · congr 1 funext p congr 1 ring · ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_r_kernel_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:221
theorem rectangular_q_kernel_energy Lemma rectangular_q_kernel_energy in the paper ↗

The raw Gram correction kernel has the same rank-over-squared-volume order. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the specified input v, the rectangular q kernel energy conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u v :
(∫ p : (Cov d × Bool) × (Cov d × Bool × Bool), (locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * coarseBasis h p.2.1 v * bit p.1.2 * bit p.2.2.1 * fineKernel d h J p.1.1 p.2.1)^2 ∂(xaLaw P).prod (obsLaw P))
≤ ((4:ℝ)^d)^4 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d))
Proof (Lean source)
lemma rectangular_q_kernel_energy {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u v : PolyIdx d) : (∫ p : (Cov d × Bool) × (Cov d × Bool × Bool), (locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * coarseBasis h p.2.1 v * bit p.1.2 * bit p.2.2.1 * fineKernel d h J p.1.1 p.2.1)^2 ∂(xaLaw P).prod (obsLaw P)) ≤ ((4:ℝ)^d)^4 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)) := by letI := xaLaw_probability P letI := obsLaw_probability P have hb (a : PolyIdx d) (x : Cov d) (hx : x ∈ locCube d h) (b : Bool) : |coarseBasis h x a * bit b| ≤ (4:ℝ)^d := by rw [abs_mul] simpa using mul_le_mul (coarseBasis_abs_bound d h hh x hx a) (rectangular_bit_abs_le_one b) (abs_nonneg _) (by positivity) have he := rectangular_marked_kernel_energy_le (xaLaw P) (obsLaw P) d h J hh hh' hJ fst fst measurable_fst measurable_fst (rectangular_xaLaw_covariates P hP) (rectangular_obsLaw_covariates P hP) (fun w => coarseBasis h w.1 u * bit w.2) (fun z => coarseBasis h z.1 v * bit z.2.1) (by fun_prop) (by fun_prop) ((4:ℝ)^d) ((4:ℝ)^d) (by positivity) (by positivity) (fun w hw => hb u w.1 hw w.2) (fun z hz => hb v z.1 hz z.2.1) convert he.2 using 1 · congr 1 funext p congr 1 ring · ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_q_kernel_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:249
theorem rectangular_localized_mark_memLp_top Lemma rectangular_localized_mark_memLp_top in the paper ↗

A locally bounded record feature has a globally bounded weighted extension. Given the specified input W, the specified input d, the specified input h, the specified input hh, the specified input X, the specified input hX, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the rectangular localized mark mem lp top conclusion holds.

Formal statement
W :
d :
ℕ
h :
ℝ
hh :
0 < h
X :
W → Cov d
hX :
f :
W → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ B
MemLp (fun w => locWeight h (X w) * f w) ∞ μ
Proof (Lean source)
lemma rectangular_localized_mark_memLp_top {W : Type*} [MeasurableSpace W] (μ : Measure W) [IsFiniteMeasure μ] (d : ℕ) (h : ℝ) (hh : 0 < h) (X : W → Cov d) (hX : Measurable X) (f : W → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ w, X w ∈ locCube d h → |f w| ≤ B) : MemLp (fun w => locWeight h (X w) * f w) ∞ μ := by apply memLp_top_of_bound (by fun_prop) (h^(-(d:ℝ))*B) filter_upwards [] with w change |locWeight h (X w) * f w| ≤ _ rw [abs_mul, abs_of_nonneg (rectangular_locWeight_bounds d h hh _).1] by_cases hx : X w ∈ locCube d h · exact mul_le_mul (rectangular_locWeight_bounds d h hh _).2 (hfB w hx) (abs_nonneg _) (Real.rpow_nonneg hh.le _) · simp only [locWeight, if_neg hx, zero_mul] positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_localized_mark_memLp_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:278
theorem rectangular_kernel_slice_abs_le Lemma rectangular_kernel_slice_abs_le in the paper ↗

Bounded record marks and uniform design give a resolution-independent conditional kernel bound. Given the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input Y, the specified input hY, its uniform pushforward identity, the specified input g, the specified input hg, the specified input B, the specified input hB, the specified input hgB, the specified input x, the rectangular kernel slice abs le conclusion holds.

Formal statement
Z :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
Y :
Z → Cov d
hY :
hν :
ν.map Y = uniformLaw d
g :
Z → ℝ
hg :
B :
ℝ
hB :
0 ≤ B
hgB :
∀ z
if
Y z ∈ locCube d h
then
|g z| ≤ B
x :
Cov d
|∫ z, locWeight h (Y z) * fineKernel d h J x (Y z) * g z ∂ν|
≤ B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)
Proof (Lean source)
lemma rectangular_kernel_slice_abs_le {Z : Type*} [MeasurableSpace Z] (ν : Measure Z) [IsProbabilityMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (Y : Z → Cov d) (hY : Measurable Y) (hν : ν.map Y = uniformLaw d) (g : Z → ℝ) (hg : Measurable g) (B : ℝ) (hB : 0 ≤ B) (hgB : ∀ z, Y z ∈ locCube d h → |g z| ≤ B) (x : Cov d) : |∫ z, locWeight h (Y z) * fineKernel d h J x (Y z) * g z ∂ν| ≤ B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2) := by let M := (card (FineIdx d J):ℝ) * (sqrt ((J:ℝ)^d) * (4:ℝ)^d)^2 have hM : 0 ≤ M := by dsimp [M]; positivity have hkernel : ∀ y, |fineKernel d h J x y| ≤ M := rectangular_fineKernel_abs_bound d h J hh hJ x have hi : Integrable (fun z => locWeight h (Y z) * fineKernel d h J x (Y z) * g z) ν := by have hm := rectangular_localized_mark_memLp_top ν d h hh Y hY (fun z => fineKernel d h J x (Y z) * g z) (by fun_prop) (M*B) (mul_nonneg hM hB) (fun z hz => by rw [abs_mul] exact mul_le_mul (hkernel _) (hgB z hz) (abs_nonneg _) hM) simpa only [mul_assoc] using hm.integrable (by simp) have hj : Integrable (fun z => B * (locWeight h (Y z) * |fineKernel d h J x (Y z)|)) ν := by exact (rectangular_localized_mark_memLp_top ν d h hh Y hY (fun z => |fineKernel d h J x (Y z)|) (by fun_prop) M hM (fun z _ => by simpa only [abs_abs] using hkernel (Y z))).integrable (by simp) |>.const_mul B have hpoint (z : Z) : |locWeight h (Y z) * fineKernel d h J x (Y z) * g z| ≤ B * (locWeight h (Y z) * |fineKernel d h J x (Y z)|) := by by_cases hz : Y z ∈ locCube d h · rw [abs_mul, abs_mul, abs_of_nonneg (rectangular_locWeight_bounds d h hh _).1] calc _ ≤ (locWeight h (Y z) * |fineKernel d h J x (Y z)|) * B := mul_le_mul_of_nonneg_left (hgB z hz) (by exact mul_nonneg (rectangular_locWeight_bounds d h hh _).1 (abs_nonneg _)) _ = _ := by ring · simp [locWeight, hz] have he : (∫ z, locWeight h (Y z) * |fineKernel d h J x (Y z)| ∂ν) = ∫ y, |fineKernel d h J x y| ∂locLaw d h := by have hm := integral_map (μ := ν) hY.aemeasurable (f := fun y => locWeight h y * |fineKernel d h J x y|) (by fun_prop) rw [hν, uniformLaw_localization_integral d h hh hh'] at hm exact hm.symm calc _ ≤ ∫ z, |locWeight h (Y z) * fineKernel d h J x (Y z) * g z| ∂ν := abs_integral_le_integral_abs _ ≤ ∫ z, B * (locWeight h (Y z) * |fineKernel d h J x (Y z)|) ∂ν := integral_mono hi.abs hj hpoint _ = B * (∫ y, |fineKernel d h J x y| ∂locLaw d h) := by rw [integral_const_mul, he] _ ≤ _ := mul_le_mul_of_nonneg_left (fineKernel_abs_row_bound d h J hh hh' hJ x) hB
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_kernel_slice_abs_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:294
theorem rectangular_record_locWeight_square_integral Lemma rectangular_record_locWeight_square_integral in the paper ↗

The squared localization weight integrates to inverse localization volume under uniform design. Given the specified input W, the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input X, the specified input hX, its uniform pushforward identity, the rectangular record loc weight square integral conclusion holds.

Formal statement
W :
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
X :
W → Cov d
hX :
hμ :
μ.map X = uniformLaw d
(∫ w, (locWeight h (X w))^2 ∂μ) = 1/h^d
Proof (Lean source)
lemma rectangular_record_locWeight_square_integral {W : Type*} [MeasurableSpace W] (μ : Measure W) [IsProbabilityMeasure μ] (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (X : W → Cov d) (hX : Measurable X) (hμ : μ.map X = uniformLaw d) : (∫ w, (locWeight h (X w))^2 ∂μ) = 1/h^d := by letI := localization_probability d h hh hh' have he (x : Cov d) : (locWeight h x)^2 = h^(-(d:ℝ))*locWeight h x := by unfold locWeight split_ifs <;> ring have hm := integral_map (μ := μ) hX.aemeasurable (f := fun x : Cov d => (locWeight h x)^2) (by fun_prop) rw [hμ] at hm rw [← hm] simp_rw [he] rw [integral_const_mul] have hw := uniformLaw_localization_integral d h hh hh' (fun _ => (1:ℝ)) simp only [mul_one] at hw simp at hw rw [hw, mul_one, Real.rpow_neg hh.le, Real.rpow_natCast, one_div]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_record_locWeight_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:343
theorem rectangular_marked_kernel_row_energy Lemma rectangular_marked_kernel_row_energy in the paper ↗

First conditional integration has second moment of inverse-volume order, with no rank factor. Given the specified input W, the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the uniform pushforward identities, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input hfA, the specified input hgB, the rectangular marked kernel row energy conclusion holds.

Formal statement
μ :
ν :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
hμ :
μ.map X = uniformLaw d
hν :
ν.map Y = uniformLaw d
f :
W → ℝ
g :
Z → ℝ
hf :
hg :
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hfA :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ A
hgB :
∀ z
if
Y z ∈ locCube d h
then
|g z| ≤ B
(∫ w, (∫ z, locWeight h (X w) * locWeight h (Y z) * fineKernel d h J (X w) (Y z) * f w * g z ∂ν)^2 ∂μ)
≤ (A * B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2))^2 / h^d
Proof (Lean source)
lemma rectangular_marked_kernel_row_energy {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (hμ : μ.map X = uniformLaw d) (hν : ν.map Y = uniformLaw d) (f : W → ℝ) (g : Z → ℝ) (hf : Measurable f) (hg : Measurable g) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hfA : ∀ w, X w ∈ locCube d h → |f w| ≤ A) (hgB : ∀ z, Y z ∈ locCube d h → |g z| ≤ B) : (∫ w, (∫ z, locWeight h (X w) * locWeight h (Y z) * fineKernel d h J (X w) (Y z) * f w * g z ∂ν)^2 ∂μ) ≤ (A * B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2))^2 / h^d := by let D := (card (PolyIdx d):ℝ)*((4:ℝ)^d)^2 let F := fun w => ∫ z, locWeight h (X w) * locWeight h (Y z) * fineKernel d h J (X w) (Y z) * f w * g z ∂ν have hD : 0 ≤ D := by dsimp [D]; positivity have hF : MemLp F 2 μ := rectangular_memLp_mean μ ν _ (rectangular_marked_kernel_energy_le μ ν d h J hh hh' hJ X Y hX hY hμ hν f g hf hg A B hA hB hfA hgB).1 have hw : MemLp (fun w => locWeight h (X w)) ∞ μ := by simpa only [mul_one] using rectangular_localized_mark_memLp_top μ d h hh X hX (fun _ => 1) measurable_const 1 zero_le_one (fun _ _ => by norm_num) have hbound (w : W) : |F w| ≤ (A*B*D)*locWeight h (X w) := by have he : F w = (locWeight h (X w)*f w) * (∫ z, locWeight h (Y z) * fineKernel d h J (X w) (Y z) * g z ∂ν) := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with z ring rw [he, abs_mul, abs_mul, abs_of_nonneg (rectangular_locWeight_bounds d h hh _).1] by_cases hx : X w ∈ locCube d h · calc _ ≤ (locWeight h (X w)*A)*(B*D) := mul_le_mul (mul_le_mul_of_nonneg_left (hfA w hx) (rectangular_locWeight_bounds d h hh _).1) (rectangular_kernel_slice_abs_le ν d h J hh hh' hJ Y hY hν g hg B hB hgB (X w)) (abs_nonneg _) (mul_nonneg (rectangular_locWeight_bounds d h hh _).1 hA) _ = _ := by ring · simp [locWeight, hx] calc _ ≤ ∫ w, (A*B*D)^2*(locWeight h (X w))^2 ∂μ := by apply integral_mono hF.integrable_sq ((hw.mono_exponent (by simp : (2:ℝ≥0∞) ≤ ∞)).integrable_sq.const_mul _) intro w have hb := mul_self_le_mul_self (abs_nonneg (F w)) (hbound w) simpa only [← pow_two, mul_pow, sq_abs] using hb _ = _ := by rw [integral_const_mul, rectangular_record_locWeight_square_integral μ d h hh hh' X hX hμ] dsimp [D] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_marked_kernel_row_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:363
theorem rectangular_fineKernel_symmetric Lemma rectangular_fineKernel_symmetric in the paper ↗

The finite projection kernel is symmetric in its covariate arguments. Given the specified input d, the specified input h, the specified input J, the specified input x, the specified input y, the rectangular fine kernel symmetric conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
x y :
Cov d
fineKernel d h J x y = fineKernel d h J y x
Proof (Lean source)
lemma rectangular_fineKernel_symmetric (d : ℕ) (h : ℝ) (J : ℕ) (x y : Cov d) : fineKernel d h J x y = fineKernel d h J y x := by unfold fineKernel apply Finset.sum_congr rfl intro z _ exact mul_comm _ _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_fineKernel_symmetric · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:415
theorem rectangular_marked_kernel_column_energy Lemma rectangular_marked_kernel_column_energy in the paper ↗

Reversing the independent roles gives the same inverse-volume bound for the second conditional integration. Given the specified input W, the specified input Z, the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the uniform pushforward identities, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input hfA, the specified input hgB, the rectangular marked kernel column energy conclusion holds.

Formal statement
μ :
ν :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
hμ :
μ.map X = uniformLaw d
hν :
ν.map Y = uniformLaw d
f :
W → ℝ
g :
Z → ℝ
hf :
hg :
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hfA :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ A
hgB :
∀ z
if
Y z ∈ locCube d h
then
|g z| ≤ B
(∫ z, (∫ w, locWeight h (X w) * locWeight h (Y z) * fineKernel d h J (X w) (Y z) * f w * g z ∂μ)^2 ∂ν)
≤ (A * B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2))^2 / h^d
Proof (Lean source)
lemma rectangular_marked_kernel_column_energy {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (hμ : μ.map X = uniformLaw d) (hν : ν.map Y = uniformLaw d) (f : W → ℝ) (g : Z → ℝ) (hf : Measurable f) (hg : Measurable g) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hfA : ∀ w, X w ∈ locCube d h → |f w| ≤ A) (hgB : ∀ z, Y z ∈ locCube d h → |g z| ≤ B) : (∫ z, (∫ w, locWeight h (X w) * locWeight h (Y z) * fineKernel d h J (X w) (Y z) * f w * g z ∂μ)^2 ∂ν) ≤ (A * B * ((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2))^2 / h^d := by have he := rectangular_marked_kernel_row_energy ν μ d h J hh hh' hJ Y X hY hX hν hμ g f hg hf B A hB hA hgB hfA convert he using 1 · congr 1 funext z congr 1 apply integral_congr_ae filter_upwards [] with w rw [rectangular_fineKernel_symmetric d h J (X w) (Y z)] ring · ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_marked_kernel_column_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:423
theorem rectangular_marked_kernel_variance_bound Lemma rectangular_marked_kernel_variance_bound in the paper ↗

The roadmap's two conditional energies and kernel rank give the full variance order for each rectangular correction. Given the specified input W, the specified input Z, the specified input d, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input X, the specified input Y, the specified input hX, the specified input hY, the uniform pushforward identities, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input hfA, the specified input hgB, the rectangular marked kernel variance bound conclusion holds.

Formal statement
μ :
ν :
d n m :
ℕ
hn :
2 ≤ n
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
X :
W → Cov d
Y :
Z → Cov d
hX :
hY :
hμ :
μ.map X = uniformLaw d
hν :
ν.map Y = uniformLaw d
f :
W → ℝ
g :
Z → ℝ
hf :
hg :
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
hfA :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ A
hgB :
∀ z
if
Y z ∈ locCube d h
then
|g z| ≤ B
H :
fun p : W × Z
=> locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2
C :
(A*B)^2 * (((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1)
(∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν)))
≤ 6*C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_marked_kernel_variance_bound {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (d n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (X : W → Cov d) (Y : Z → Cov d) (hX : Measurable X) (hY : Measurable Y) (hμ : μ.map X = uniformLaw d) (hν : ν.map Y = uniformLaw d) (f : W → ℝ) (g : Z → ℝ) (hf : Measurable f) (hg : Measurable g) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (hfA : ∀ w, X w ∈ locCube d h → |f w| ≤ A) (hgB : ∀ z, Y z ∈ locCube d h → |g z| ≤ B) : let H := fun p : W × Z => locWeight h (X p.1) * locWeight h (Y p.2) * fineKernel d h J (X p.1) (Y p.2) * f p.1 * g p.2 let C := (A*B)^2 * (((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1) (∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν))) ≤ 6*C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by dsimp only let D := (card (PolyIdx d):ℝ)*((4:ℝ)^d)^2 let C := (A*B)^2*(D^2+1) have hC : 0 ≤ C := by dsimp [C]; positivity have hsmall : (A*B*D)^2 ≤ C := by dsimp [C]; nlinarith [sq_nonneg (A*B)] have hbase : A^2*B^2 ≤ C := by dsimp [C]; nlinarith [sq_nonneg (A*B*D)] have hk : 0 ≤ (card (PolyIdx d):ℝ)*(J:ℝ)^d := by positivity have hr := rectangular_marked_kernel_row_energy μ ν d h J hh hh' hJ X Y hX hY hμ hν f g hf hg A B hA hB hfA hgB have hc := rectangular_marked_kernel_column_energy μ ν d h J hh hh' hJ X Y hX hY hμ hν f g hf hg A B hA hB hfA hgB obtain ⟨hH, he⟩ := rectangular_marked_kernel_energy_le μ ν d h J hh hh' hJ X Y hX hY hμ hν f g hf hg A B hA hB hfA hgB apply rectangular_sampling_from_kernel_energies μ ν n m d hn h C _ hh hC hk _ hH · exact hr.trans (div_le_div_of_nonneg_right hsmall (by positivity)) · exact hc.trans (div_le_div_of_nonneg_right hsmall (by positivity)) · calc _ ≤ _ := he _ = (A^2*B^2) * ((card (PolyIdx d):ℝ)*(J:ℝ)^d) / h^(2*d) := by ring _ ≤ _ := div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hbase hk) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_marked_kernel_variance_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularKernelEnergy.lean:449
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularMomentBounds 11 declarations The joint role law transfers the independent rectangular variance calculation to the actual data.

# Original-record rectangular moment bounds The joint role law transfers the independent rectangular variance calculation to the actual data. Centered first-order averages and corrections are combined by the squared-difference inequality, without an independence assertion.

A rectangular average of a record kernel on the original dataset. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input w, rectangular average is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
w :
Sample d n m
rectangularAverage H w :
ℝ
((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i ∈ (roleSplit n m).2, ∑ j ∈ (roleSplit n m).1, H (treatmentRecords w.1 i, w.1.1 j)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularAverage · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:19
theorem rectangular_average_enumeration Lemma rectangular_average_enumeration in the paper ↗

The rectangular average is exactly its finite enumerated counterpart. Given the specified input d, the specified input n, the specified input m, the specified input H, the rectangular average enumeration conclusion holds.

Formal statement
d n m :
ℕ
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
rectangularAverage (n := n) (m := m) H
= fun w => ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a : Fin (treatmentCount n m), ∑ b : Fin (outcomeCount n), H ((rectangularRoleData w).1 a,(rectangularRoleData w).2 b)
Proof (Lean source)
lemma rectangular_average_enumeration {d n m : ℕ} (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) : rectangularAverage (n := n) (m := m) H = fun w => ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a : Fin (treatmentCount n m), ∑ b : Fin (outcomeCount n), H ((rectangularRoleData w).1 a,(rectangularRoleData w).2 b) := by funext w exact congrArg (fun x : ℝ => ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹*x) (rectangular_role_sum_enumeration w H)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_average_enumeration · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:26
theorem rectangular_original_average_memLp Lemma rectangular_original_average_memLp in the paper ↗

A square-integrable kernel gives a square-integrable original-record rectangular average. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input H, the specified input hH, the rectangular original average mem lp conclusion holds.

Formal statement
d n m :
ℕ
P :
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hH :
MemLp H 2 ((xaLaw P).prod (obsLaw P))
MemLp (rectangularAverage (n := n) (m := m) H) 2 (experiment P n m)
Proof (Lean source)
lemma rectangular_original_average_memLp {d n m : ℕ} (P : PrimitiveLaw d) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hH : MemLp H 2 ((xaLaw P).prod (obsLaw P))) : MemLp (rectangularAverage (n := n) (m := m) H) 2 (experiment P n m) := by letI := obsLaw_probability P letI := xaLaw_probability P have hm : MemLp (fun D : (Fin (treatmentCount n m) → Cov d × Bool) × (Fin (outcomeCount n) → Cov d × Bool × Bool) => ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a, ∑ b, H (D.1 a,D.2 b)) 2 ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) := by apply MemLp.const_mul apply memLp_finsetSum intro a _ apply memLp_finsetSum intro b _ exact hH.comp_measurePreserving ((measurePreserving_eval _ a).prod (measurePreserving_eval _ b)) rw [rectangular_average_enumeration] exact hm.comp_measurePreserving (rectangular_role_data_law P)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_original_average_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:37
theorem rectangular_original_average_mean Lemma rectangular_original_average_mean in the paper ↗

The original-record rectangular average has the independent pair expectation. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input H, the specified input hHm, the specified input hH, the rectangular original average mean conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hHm :
hH :
MemLp H 2 ((xaLaw P).prod (obsLaw P))
(∫ w, rectangularAverage (n := n) (m := m) H w ∂experiment P n m)
= ∫ p, H p ∂(xaLaw P).prod (obsLaw P)
Proof (Lean source)
lemma rectangular_original_average_mean {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hHm : Measurable H) (hH : MemLp H 2 ((xaLaw P).prod (obsLaw P))) : (∫ w, rectangularAverage (n := n) (m := m) H w ∂experiment P n m) = ∫ p, H p ∂(xaLaw P).prod (obsLaw P) := by letI := obsLaw_probability P letI := xaLaw_probability P have hmp := rectangular_role_data_law (n := n) (m := m) P rw [rectangular_average_enumeration] let G := fun D : (Fin (treatmentCount n m) → Cov d × Bool) × (Fin (outcomeCount n) → Cov d × Bool × Bool) => ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a, ∑ b, H (D.1 a,D.2 b) have hG : Measurable G := by apply Measurable.const_mul apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro b _ exact hHm.comp (by fun_prop) have hmap := integral_map (μ := experiment P n m) hmp.measurable.aemeasurable hG.aestronglyMeasurable rw [hmp.map_eq] at hmap rw [← hmap] have hi (a : Fin (treatmentCount n m)) (b : Fin (outcomeCount n)) : Integrable (fun D => H (D.1 a,D.2 b)) ((Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) := (hH.comp_measurePreserving ((measurePreserving_eval _ a).prod (measurePreserving_eval _ b))).integrable (by norm_num) rw [integral_const_mul, integral_finsetSum _ (fun a _ => integrable_finsetSum _ (fun b _ => hi a b))] simp_rw [integral_finsetSum _ (fun b _ => hi _ b)] have he (a : Fin (treatmentCount n m)) (b : Fin (outcomeCount n)) : (∫ D, H (D.1 a,D.2 b) ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) = ∫ p, H p ∂(xaLaw P).prod (obsLaw P) := by have hp := (measurePreserving_eval (fun _ : Fin (treatmentCount n m) => xaLaw P) a).prod (measurePreserving_eval (fun _ : Fin (outcomeCount n) => obsLaw P) b) rw [← hp.map_eq, integral_map hp.measurable.aemeasurable hHm.aestronglyMeasurable] rfl simp_rw [he] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] have hl : (outcomeCount n:ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).1.ne' have ht : (treatmentCount n m:ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).2.ne' field_simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_original_average_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:59
theorem rectangular_original_average_variance_le Lemma rectangular_original_average_variance_le in the paper ↗

Any independent-block centered variance bound transfers to the original rectangular average. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input H, the specified input hHm, the specified input B, the specified input hb, the rectangular original average variance le conclusion holds.

Formal statement
d n m :
ℕ
P :
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hHm :
B :
ℝ
hb :
(∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a, ∑ b, H (D.1 a,D.2 b) - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P)))
≤ B
(∫ w, (rectangularAverage (n := n) (m := m) H w - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂experiment P n m)
≤ B
Proof (Lean source)
lemma rectangular_original_average_variance_le {d n m : ℕ} (P : PrimitiveLaw d) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hHm : Measurable H) (B : ℝ) (hb : (∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a, ∑ b, H (D.1 a,D.2 b) - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => xaLaw P)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P))) ≤ B) : (∫ w, (rectangularAverage (n := n) (m := m) H w - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂experiment P n m) ≤ B := by have hp := rectangular_role_data_law (n := n) (m := m) P rw [rectangular_average_enumeration] let G := fun D : (Fin (treatmentCount n m) → Cov d × Bool) × (Fin (outcomeCount n) → Cov d × Bool × Bool) => (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ a, ∑ b, H (D.1 a,D.2 b) - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 have hG : Measurable G := by apply Measurable.pow_const apply Measurable.sub _ measurable_const apply Measurable.const_mul apply Finset.measurable_sum intro a _ apply Finset.measurable_sum intro b _ exact hHm.comp (by fun_prop) have hmap := integral_map (μ := experiment P n m) hp.measurable.aemeasurable hG.aestronglyMeasurable rw [hp.map_eq] at hmap change (∫ w, G (rectangularRoleData w) ∂experiment P n m) ≤ B rw [← hmap] exact hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_original_average_variance_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:104

A first-order average over the labeled outcome role. Given the specified input d, the specified input n, the specified input m, the specified input f, the specified input w, rectangular outcome average is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
f :
Cov d × Bool × Bool → ℝ
w :
Sample d n m
rectangularOutcomeAverage f w :
ℝ
(outcomeCount n:ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (w.1.1 j)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangularOutcomeAverage · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:135
theorem rectangular_outcome_average_enumeration Lemma rectangular_outcome_average_enumeration in the paper ↗

The outcome average is the ordinary iid average of the enumerated outcome records. Given the specified input d, the specified input n, the specified input m, the specified input f, the specified input w, the rectangular outcome average enumeration conclusion holds.

Formal statement
d n m :
ℕ
f :
Cov d × Bool × Bool → ℝ
w :
Sample d n m
= (outcomeCount n:ℝ)⁻¹ * ∑ b : Fin (outcomeCount n), f ((rectangularRoleData w).2 b)
Proof (Lean source)
lemma rectangular_outcome_average_enumeration {d n m : ℕ} (f : Cov d × Bool × Bool → ℝ) (w : Sample d n m) : rectangularOutcomeAverage f w = (outcomeCount n:ℝ)⁻¹ * ∑ b : Fin (outcomeCount n), f ((rectangularRoleData w).2 b) := by classical unfold rectangularOutcomeAverage rw [← Finset.sum_coe_sort (roleSplit n m).1, ← (rectangularOutcomeEnumeration n m).sum_comp] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_outcome_average_enumeration · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:139
theorem rectangular_outcome_average_moments Lemma rectangular_outcome_average_moments in the paper ↗

The first-order outcome average is square-integrable and has the observation-law mean. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input hfm, the specified input hf, the rectangular outcome average moments conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool × Bool → ℝ
hfm :
hf :
MemLp f 2 (obsLaw P)
conclusion 1
MemLp (rectangularOutcomeAverage (n := n) (m := m) f) 2 (experiment P n m)
conclusion 2
(∫ w, rectangularOutcomeAverage (n := n) (m := m) f w ∂experiment P n m)
= ∫ z, f z ∂obsLaw P
Proof (Lean source)
lemma rectangular_outcome_average_moments {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool × Bool → ℝ) (hfm : Measurable f) (hf : MemLp f 2 (obsLaw P)) : MemLp (rectangularOutcomeAverage (n := n) (m := m) f) 2 (experiment P n m) ∧ (∫ w, rectangularOutcomeAverage (n := n) (m := m) f w ∂experiment P n m) = ∫ z, f z ∂obsLaw P := by letI := obsLaw_probability P letI := xaLaw_probability P have hp := measurePreserving_snd.comp (rectangular_role_data_law (n := n) (m := m) P) have hm : MemLp (fun D : Fin (outcomeCount n) → Cov d × Bool × Bool => (outcomeCount n:ℝ)⁻¹ * ∑ b, f (D b)) 2 (Measure.pi (fun _ : Fin (outcomeCount n) => obsLaw P)) := (memLp_finsetSum _ (fun b _ => hf.comp_measurePreserving (measurePreserving_eval _ b))).const_mul _ constructor · change MemLp (fun w => rectangularOutcomeAverage f w) 2 _ simpa only [Function.comp_def, rectangular_outcome_average_enumeration] using hm.comp_measurePreserving hp · simp only [rectangular_outcome_average_enumeration] have hmap := integral_map (μ := experiment P n m) hp.measurable.aemeasurable ((by fun_prop : Measurable (fun D : Fin (outcomeCount n) → Cov d × Bool × Bool => (outcomeCount n:ℝ)⁻¹ * ∑ b, f (D b))).aestronglyMeasurable) rw [hp.map_eq] at hmap change (∫ w, ((outcomeCount n:ℝ)⁻¹ * ∑ b, f ((snd ∘ rectangularRoleData) w b)) ∂experiment P n m) = _ rw [← hmap] exact iid_average_integral (obsLaw P) (outcomeCount n) (population_role_counts_pos n m hn).1 f (hf.integrable (by norm_num))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_outcome_average_moments · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:149
theorem rectangular_original_moment_variance_le Lemma rectangular_original_moment_variance_le in the paper ↗

The centered difference of the two actual moments obeys the sum of their variance bounds. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input hfm, the specified input hf, the specified input H, the specified input hHm, the specified input hH, the specified input B, the rectangular-average variance bound, the rectangular original moment variance le conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool × Bool → ℝ
hfm :
hf :
MemLp f 2 (obsLaw P)
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hHm :
hH :
MemLp H 2 ((xaLaw P).prod (obsLaw P))
B :
ℝ
hb :
(∫ w, (rectangularAverage (n := n) (m := m) H w - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂experiment P n m)
≤ B
conclusion 1
MemLp (fun w => rectangularOutcomeAverage (n := n) (m := m) f w - rectangularAverage H w) 2 (experiment P n m)
conclusion 2
(∫ w, (rectangularOutcomeAverage (n := n) (m := m) f w - rectangularAverage H w - ∫ z, (rectangularOutcomeAverage f z - rectangularAverage H z) ∂experiment P n m)^2 ∂experiment P n m)
≤ (6/(n:ℝ))*(∫ z, (f z)^2 ∂obsLaw P) + 2*B
Proof (Lean source)
lemma rectangular_original_moment_variance_le {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool × Bool → ℝ) (hfm : Measurable f) (hf : MemLp f 2 (obsLaw P)) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hHm : Measurable H) (hH : MemLp H 2 ((xaLaw P).prod (obsLaw P))) (B : ℝ) (hb : (∫ w, (rectangularAverage (n := n) (m := m) H w - ∫ p, H p ∂(xaLaw P).prod (obsLaw P))^2 ∂experiment P n m) ≤ B) : MemLp (fun w => rectangularOutcomeAverage (n := n) (m := m) f w - rectangularAverage H w) 2 (experiment P n m) ∧ (∫ w, (rectangularOutcomeAverage (n := n) (m := m) f w - rectangularAverage H w - ∫ z, (rectangularOutcomeAverage f z - rectangularAverage H z) ∂experiment P n m)^2 ∂experiment P n m) ≤ (6/(n:ℝ))*(∫ z, (f z)^2 ∂obsLaw P) + 2*B := by letI := population_experiment_probability P n m obtain ⟨hA, hmA⟩ := rectangular_outcome_average_moments P hn f hfm hf have hR := rectangular_original_average_memLp (n := n) (m := m) P H hH have hmR := rectangular_original_average_mean (n := n) (m := m) P hn H hHm hH refine ⟨hA.sub hR, ?_⟩ rw [integral_sub (hA.integrable (by norm_num)) (hR.integrable (by norm_num)), hmA, hmR] have he (w : Sample d n m) : rectangularOutcomeAverage f w - rectangularAverage H w - ((∫ z, f z ∂obsLaw P) - ∫ p, H p ∂(xaLaw P).prod (obsLaw P)) = (rectangularOutcomeAverage f w - ∫ z, f z ∂obsLaw P) - (rectangularAverage H w - ∫ p, H p ∂(xaLaw P).prod (obsLaw P)) := by ring simp_rw [he] have hv := rectangular_difference_energy_le (experiment P n m) (fun w => rectangularOutcomeAverage f w-∫ z, f z ∂obsLaw P) (fun w => rectangularAverage H w-∫ p, H p ∂(xaLaw P).prod (obsLaw P)) (hA.sub (memLp_const _)) (hR.sub (memLp_const _)) have ha := rectangular_outcome_role_energy_le (n := n) (m := m) P hn f hf change (∫ w, (rectangularOutcomeAverage f w-∫ z, f z ∂obsLaw P)^2 ∂experiment P n m) ≤ _ at ha calc _ ≤ _ := hv _ ≤ 2*((3/(n:ℝ))*(∫ z, (f z)^2 ∂obsLaw P)) + 2*B := by gcongr _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_original_moment_variance_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:173
theorem rectangular_localized_mark_energy Lemma rectangular_localized_mark_energy in the paper ↗

A bounded localized observation feature has inverse-volume second moment. Given the specified input W, the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input X, the specified input hX, its uniform pushforward identity, the specified input f, the specified input hf, the specified input B, the specified input hB, the specified input hfB, the rectangular localized mark energy conclusion holds.

Formal statement
W :
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
X :
W → Cov d
hX :
hμ :
μ.map X = uniformLaw d
f :
W → ℝ
hf :
B :
ℝ
hB :
0 ≤ B
hfB :
∀ w
if
X w ∈ locCube d h
then
|f w| ≤ B
conclusion 1
MemLp (fun w => locWeight h (X w)*f w) 2 μ
conclusion 2
(∫ w, (locWeight h (X w)*f w)^2 ∂μ) ≤ B^2/h^d
Proof (Lean source)
lemma rectangular_localized_mark_energy {W : Type*} [MeasurableSpace W] (μ : Measure W) [IsProbabilityMeasure μ] (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (X : W → Cov d) (hX : Measurable X) (hμ : μ.map X = uniformLaw d) (f : W → ℝ) (hf : Measurable f) (B : ℝ) (hB : 0 ≤ B) (hfB : ∀ w, X w ∈ locCube d h → |f w| ≤ B) : MemLp (fun w => locWeight h (X w)*f w) 2 μ ∧ (∫ w, (locWeight h (X w)*f w)^2 ∂μ) ≤ B^2/h^d := by have hm := (rectangular_localized_mark_memLp_top μ d h hh X hX f hf B hB hfB).mono_exponent (by simp : (2:ℝ≥0∞) ≤ ∞) have hw := (rectangular_localized_mark_memLp_top μ d h hh X hX (fun _ => 1) measurable_const 1 zero_le_one (fun _ _ => by norm_num)).mono_exponent (by simp : (2:ℝ≥0∞) ≤ ∞) simp only [mul_one] at hw refine ⟨hm, ?_⟩ calc _ ≤ ∫ w, B^2*(locWeight h (X w))^2 ∂μ := by apply integral_mono hm.integrable_sq (hw.integrable_sq.const_mul _) intro w by_cases hx : X w ∈ locCube d h · have he := mul_self_le_mul_self (abs_nonneg (f w)) (hfB w hx) have hs : (f w)^2 ≤ B^2 := by simpa only [← pow_two, sq_abs] using he nlinarith [mul_le_mul_of_nonneg_left hs (sq_nonneg (locWeight h (X w)))] · simp [locWeight, hx] _ = _ := by rw [integral_const_mul, rectangular_record_locWeight_square_integral μ d h hh hh' X hX hμ]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_localized_mark_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:207
theorem rectangular_marked_moment_bound Lemma rectangular_marked_moment_bound in the paper ↗

Localized bounded marks give the sampling envelope for an actual moment coordinate. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f0, the specified input f, the specified input g, the specified input hf0, the specified input hf, the specified input hg, the specified input M, the specified input hM, the specified input hf0M, the specified input hfM, the specified input hgM, the rectangular marked moment bound conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
2 ≤ n
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f0 :
Cov d × Bool × Bool → ℝ
f :
Cov d × Bool → ℝ
g :
Cov d × Bool × Bool → ℝ
hf0 :
hf :
hg :
M :
ℝ
hM :
0 ≤ M
hf0M :
∀ z
if
z.1 ∈ locCube d h
then
|f0 z| ≤ M
hfM :
∀ z
if
z.1 ∈ locCube d h
then
|f z| ≤ M
hgM :
∀ z
if
z.1 ∈ locCube d h
then
|g z| ≤ M
H :
fun p : (Cov d × Bool) × (Cov d × Bool × Bool)
=> locWeight h p.1.1 * locWeight h p.2.1 * fineKernel d h J p.1.1 p.2.1 * f p.1 * g p.2
F :
fun w : Sample d n m
=> rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w - rectangularAverage H w
K :
6*M^2 + 12*(M*M)^2*(((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1)
MemLp F 2 (experiment P n m)
(∫ w, (F w-∫ z, F z ∂experiment P n m)^2 ∂experiment P n m)
≤ K*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_marked_moment_bound {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 2 ≤ n) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f0 : Cov d × Bool × Bool → ℝ) (f : Cov d × Bool → ℝ) (g : Cov d × Bool × Bool → ℝ) (hf0 : Measurable f0) (hf : Measurable f) (hg : Measurable g) (M : ℝ) (hM : 0 ≤ M) (hf0M : ∀ z, z.1 ∈ locCube d h → |f0 z| ≤ M) (hfM : ∀ z, z.1 ∈ locCube d h → |f z| ≤ M) (hgM : ∀ z, z.1 ∈ locCube d h → |g z| ≤ M) : let H := fun p : (Cov d × Bool) × (Cov d × Bool × Bool) => locWeight h p.1.1 * locWeight h p.2.1 * fineKernel d h J p.1.1 p.2.1 * f p.1 * g p.2 let F := fun w : Sample d n m => rectangularOutcomeAverage (fun z => locWeight h z.1*f0 z) w - rectangularAverage H w let K := 6*M^2 + 12*(M*M)^2*(((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1) MemLp F 2 (experiment P n m) ∧ (∫ w, (F w-∫ z, F z ∂experiment P n m)^2 ∂experiment P n m) ≤ K*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by dsimp only letI := obsLaw_probability P letI := xaLaw_probability P have hμ := rectangular_xaLaw_covariates P hP have hν := rectangular_obsLaw_covariates P hP obtain ⟨h0, he0⟩ := rectangular_localized_mark_energy (obsLaw P) d h hh hh' fst measurable_fst hν f0 hf0 M hM hf0M obtain ⟨hH, _⟩ := rectangular_marked_kernel_energy_le (xaLaw P) (obsLaw P) d h J hh hh' hJ fst fst measurable_fst measurable_fst hμ hν f g hf hg M M hM hM hfM hgM have hv := rectangular_marked_kernel_variance_bound (xaLaw P) (obsLaw P) d n m hn h J hh hh' hJ fst fst measurable_fst measurable_fst hμ hν f g hf hg M M hM hM hfM hgM dsimp only at hv let H := fun p : (Cov d × Bool) × (Cov d × Bool × Bool) => locWeight h p.1.1 * locWeight h p.2.1 * fineKernel d h J p.1.1 p.2.1 * f p.1 * g p.2 have hHm : Measurable H := by dsimp [H]; fun_prop have h0m : Measurable (fun z : Cov d × Bool × Bool => locWeight h z.1*f0 z) := by fun_prop have hv' := rectangular_original_average_variance_le (n := n) (m := m) P H hHm _ hv obtain ⟨hm, he⟩ := rectangular_original_moment_variance_le P hn (fun z => locWeight h z.1*f0 z) h0m h0 H hHm hH _ hv' refine ⟨hm, he.trans ?_⟩ have ha : 0 ≤ 1/((n:ℝ)*h^d) := by positivity have hb : 0 ≤ (card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)) := by positivity have hcoef : 0 ≤ 6*M^2 := by positivity have he0' := mul_le_mul_of_nonneg_left he0 (by positivity : 0 ≤ 6/(n:ℝ)) calc _ ≤ (6/(n:ℝ))*(M^2/h^d) + 2*(6*((M*M)^2* (((card (PolyIdx d):ℝ)*((4:ℝ)^d)^2)^2+1)))* (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by linarith only [he0'] _ ≤ _ := by have heq : (6/(n:ℝ))*(M^2/h^d) = 6*M^2*(1/((n:ℝ)*h^d)) := by simp only [div_eq_mul_inv, mul_inv_rev]; ring rw [heq] nlinarith only [mul_nonneg hcoef hb]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_marked_moment_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularMomentBounds.lean:231
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularRoleTransport 7 declarations The treatment and outcome records in a rectangular pair have the product of their respective marginal laws, including pairs using auxiliary records.

# Transport of rectangular kernels to original records The treatment and outcome records in a rectangular pair have the product of their respective marginal laws, including pairs using auxiliary records. Consequently their kernel energies are those calculated under the product law.

theorem rectangular_distinct_labeled_pair_integral Lemma rectangular_distinct_labeled_pair_integral in the paper ↗

Distinct labeled records have their full observation product law. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input H, the specified input hH, the specified input i, the specified input j, the specified input hij, the rectangular distinct labeled pair integral conclusion holds.

Formal statement
d n m :
ℕ
P :
H :
(Cov d × Bool × Bool) × (Cov d × Bool × Bool) → ℝ
hH :
i j :
Fin n
hij :
i ≠ j
(∫ w : Sample d n m, H (w.1.1 i, w.1.1 j) ∂experiment P n m)
= ∫ p, H p ∂(obsLaw P).prod (obsLaw P)
Proof (Lean source)
lemma rectangular_distinct_labeled_pair_integral {d n m : ℕ} (P : PrimitiveLaw d) (H : (Cov d × Bool × Bool) × (Cov d × Bool × Bool) → ℝ) (hH : Measurable H) (i j : Fin n) (hij : i ≠ j) : (∫ w : Sample d n m, H (w.1.1 i, w.1.1 j) ∂experiment P n m) = ∫ p, H p ∂(obsLaw P).prod (obsLaw P) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability rw [experiment_integral_dataset P (fun D : Dataset d n m => H (D.1 i, D.1 j))] rw [integral_fun_fst (fun D : Fin n → Cov d × Bool × Bool => H (D i, D j))] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] have hind := (iIndepFun_pi (μ := fun _ : Fin n => obsLaw P) (X := fun _ => id) (fun _ => aemeasurable_id)).indepFun hij have hmap := hind.map_prod_eq_prod_map_map (measurable_pi_apply i).aemeasurable (measurable_pi_apply j).aemeasurable rw [(measurePreserving_eval (fun _ : Fin n => obsLaw P) i).map_eq, (measurePreserving_eval (fun _ : Fin n => obsLaw P) j).map_eq] at hmap rw [← hmap, integral_map (by fun_prop) hH.aestronglyMeasurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_distinct_labeled_pair_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:17
theorem rectangular_role_pair_integral Lemma rectangular_role_pair_integral in the paper ↗

Any Borel rectangular kernel has the product-law expectation on a pair of disjoint roles. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input H, the specified input hH, the specified input i, the specified input j, the specified input hi, the specified input hj, the rectangular role pair integral conclusion holds.

Formal statement
d n m :
ℕ
P :
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hH :
i :
Fin (n+m)
j :
Fin n
hi :
i ∈ (roleSplit n m).2
hj :
j ∈ (roleSplit n m).1
(∫ w : Sample d n m, H (treatmentRecords w.1 i, w.1.1 j) ∂experiment P n m)
= ∫ p, H p ∂(xaLaw P).prod (obsLaw P)
Proof (Lean source)
lemma rectangular_role_pair_integral {d n m : ℕ} (P : PrimitiveLaw d) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hH : Measurable H) (i : Fin (n+m)) (j : Fin n) (hi : i ∈ (roleSplit n m).2) (hj : j ∈ (roleSplit n m).1) : (∫ w : Sample d n m, H (treatmentRecords w.1 i, w.1.1 j) ∂experiment P n m) = ∫ p, H p ∂(xaLaw P).prod (obsLaw P) := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability revert hi refine Fin.addCases (fun i hi => ?_) (fun i hi => ?_) i · simp only [treatmentRecords, Fin.addCases_left] have hij : i ≠ j := by have hit : n/2 ≤ i.val := (Finset.mem_filter.mp hi).2 have hjt : j.val < n/2 := (Finset.mem_filter.mp hj).2 intro heq have := congrArg val heq omega rw [rectangular_distinct_labeled_pair_integral P (fun p => H ((p.1.1,p.1.2.1),p.2)) (by fun_prop) i j hij] have he := Measure.map_prod_map (obsLaw P) (obsLaw P) (f := fun z : Cov d × Bool × Bool => (z.1,z.2.1)) (g := id) (by fun_prop) measurable_id rw [obsLaw_map_treatment P, Measure.map_id] at he rw [he, integral_map (by fun_prop) hH.aestronglyMeasurable] rfl · simp only [treatmentRecords, Fin.addCases_right] rw [experiment_integral_dataset P (fun D : Dataset d n m => H (D.2 i, D.1 j))] have hmap : ((Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))).map (fun D => (D.2 i, D.1 j)) = (xaLaw P).prod (obsLaw P) := by have he := Measure.map_prod_map (Measure.pi (fun _ : Fin n => obsLaw P)) (Measure.pi (fun _ : Fin m => xaLaw P)) (measurable_pi_apply j) (measurable_pi_apply i) rw [(measurePreserving_eval (fun _ : Fin n => obsLaw P) j).map_eq, (measurePreserving_eval (fun _ : Fin m => xaLaw P) i).map_eq] at he have hs := Measure.map_map measurable_swap ((measurable_pi_apply j).prodMap (measurable_pi_apply i)) (μ := (Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))) rw [← he, Measure.prod_swap] at hs exact hs.symm rw [← hmap, integral_map (by fun_prop) hH.aestronglyMeasurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_pair_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:37
theorem rectangular_role_pair_square_integral Lemma rectangular_role_pair_square_integral in the paper ↗

Squared kernel energy on an original-record pair equals its independent product-law energy. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input H, the specified input hH, the specified input i, the specified input j, the specified input hi, the specified input hj, the rectangular role pair square integral conclusion holds.

Formal statement
d n m :
ℕ
P :
H :
(Cov d × Bool) × (Cov d × Bool × Bool) → ℝ
hH :
i :
Fin (n+m)
j :
Fin n
hi :
i ∈ (roleSplit n m).2
hj :
j ∈ (roleSplit n m).1
(∫ w : Sample d n m, (H (treatmentRecords w.1 i, w.1.1 j))^2 ∂experiment P n m)
= ∫ p, (H p)^2 ∂(xaLaw P).prod (obsLaw P)
Proof (Lean source)
lemma rectangular_role_pair_square_integral {d n m : ℕ} (P : PrimitiveLaw d) (H : (Cov d × Bool) × (Cov d × Bool × Bool) → ℝ) (hH : Measurable H) (i : Fin (n+m)) (j : Fin n) (hi : i ∈ (roleSplit n m).2) (hj : j ∈ (roleSplit n m).1) : (∫ w : Sample d n m, (H (treatmentRecords w.1 i, w.1.1 j))^2 ∂experiment P n m) = ∫ p, (H p)^2 ∂(xaLaw P).prod (obsLaw P) := by exact rectangular_role_pair_integral P (fun p => (H p)^2) (by fun_prop) i j hi hj
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_pair_square_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:84
theorem rectangular_outcome_role_centered_energy Lemma rectangular_outcome_role_centered_energy in the paper ↗

Averaging a full observation statistic over the outcome role has the usual iid variance. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input hf, the rectangular outcome role centered energy conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool × Bool → ℝ
hf :
MemLp f 2 (obsLaw P)
(∫ w : Sample d n m, ((outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (w.1.1 j) - ∫ z, f z ∂obsLaw P)^2 ∂experiment P n m)
= (outcomeCount n : ℝ)⁻¹ * Var[f; obsLaw P]
Proof (Lean source)
lemma rectangular_outcome_role_centered_energy {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool × Bool → ℝ) (hf : MemLp f 2 (obsLaw P)) : (∫ w : Sample d n m, ((outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (w.1.1 j) - ∫ z, f z ∂obsLaw P)^2 ∂experiment P n m) = (outcomeCount n : ℝ)⁻¹ * Var[f; obsLaw P] := by classical letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability let μ := Measure.pi (fun _ : Fin n => obsLaw P) let X := fun j : Fin n => fun D : Fin n → Cov d × Bool × Bool => f (D j) let F := fun D : Fin n → Cov d × Bool × Bool => (outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (D j) have hX (j : Fin n) : MemLp (X j) 2 μ := hf.comp_measurePreserving (measurePreserving_eval _ j) have hF : MemLp F 2 μ := (memLp_finsetSum _ (fun j _ => hX j)).const_mul _ have hc : (outcomeCount n : ℝ) ≠ 0 := by exact_mod_cast (population_role_counts_pos n m hn).1.ne' have hmean : (∫ D, F D ∂μ) = ∫ z, f z ∂obsLaw P := by dsimp only [F] rw [integral_const_mul, integral_finsetSum _ (fun j _ => (hX j).integrable (by norm_num))] dsimp only [X, μ] simp_rw [integral_comp_eval (μ := fun _ : Fin n => obsLaw P) (f := f) hf.aestronglyMeasurable] simp only [Finset.sum_const, nsmul_eq_mul, (population_role_cardinalities n m).1] field_simp have hv : Var[F; μ] = (outcomeCount n : ℝ)⁻¹ * Var[f; obsLaw P] := by have heF : F = fun D => (outcomeCount n : ℝ)⁻¹ * (∑ j ∈ (roleSplit n m).1, X j) D := by funext D simp only [F, X, Finset.sum_apply] rw [heF] rw [variance_const_mul, IndepFun.variance_sum (fun j _ => hX j)] · have he (j : Fin n) : Var[X j; μ] = Var[f; obsLaw P] := (measurePreserving_eval (fun _ : Fin n => obsLaw P) j).variance_fun_comp hf.aemeasurable simp_rw [he] simp only [Finset.sum_const, nsmul_eq_mul, (population_role_cardinalities n m).1] field_simp · intro i _ j _ hij exact (iIndepFun_pi (μ := fun _ : Fin n => obsLaw P) (X := fun _ => f) (fun _ => hf.aemeasurable)).indepFun hij rw [experiment_integral_dataset P (fun D : Dataset d n m => ((outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (D.1 j) - ∫ z, f z ∂obsLaw P)^2)] rw [integral_fun_fst (fun D : Fin n → Cov d × Bool × Bool => (F D - ∫ z, f z ∂obsLaw P)^2)] simp only [measureReal_def, measure_univ, ENNReal.toReal_one, one_smul] rw [← hmean, ← variance_eq_integral hF.aemeasurable] exact hv
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_outcome_role_centered_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:93
theorem rectangular_outcome_role_energy_le Lemma rectangular_outcome_role_energy_le in the paper ↗

The outcome-role first-order centered energy has labeled-sample inverse-volume order. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input hn, the specified input f, the specified input hf, the rectangular outcome role energy le conclusion holds.

Formal statement
d n m :
ℕ
P :
hn :
2 ≤ n
f :
Cov d × Bool × Bool → ℝ
hf :
MemLp f 2 (obsLaw P)
(∫ w : Sample d n m, ((outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (w.1.1 j) - ∫ z, f z ∂obsLaw P)^2 ∂experiment P n m)
≤ (3/(n:ℝ)) * (∫ z, (f z)^2 ∂obsLaw P)
Proof (Lean source)
lemma rectangular_outcome_role_energy_le {d n m : ℕ} (P : PrimitiveLaw d) (hn : 2 ≤ n) (f : Cov d × Bool × Bool → ℝ) (hf : MemLp f 2 (obsLaw P)) : (∫ w : Sample d n m, ((outcomeCount n : ℝ)⁻¹ * ∑ j ∈ (roleSplit n m).1, f (w.1.1 j) - ∫ z, f z ∂obsLaw P)^2 ∂experiment P n m) ≤ (3/(n:ℝ)) * (∫ z, (f z)^2 ∂obsLaw P) := by letI := obsLaw_probability P rw [rectangular_outcome_role_centered_energy P hn f hf] have hv : Var[f; obsLaw P] ≤ ∫ z, (f z)^2 ∂obsLaw P := by rw [variance_eq_integral hf.aemeasurable] exact rectangular_centered_energy_le (obsLaw P) f hf exact mul_le_mul (rectangular_role_inverse_bounds n m hn).1 hv (variance_nonneg f (obsLaw P)) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_outcome_role_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:145
theorem rectangular_experiment_r_kernel_energy Lemma rectangular_experiment_r_kernel_energy in the paper ↗

The vector correction's squared kernel bound holds on every actual rectangular pair. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the specified input i, the specified input j, the specified input hi, the specified input hj, the rectangular experiment r kernel energy conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u :
i :
Fin (n+m)
j :
Fin n
hi :
i ∈ (roleSplit n m).2
hj :
j ∈ (roleSplit n m).1
(∫ w : Sample d n m, (locWeight h (treatmentRecords w.1 i).1 * locWeight h (w.1.1 j).1 * coarseBasis h (treatmentRecords w.1 i).1 u * bit (treatmentRecords w.1 i).2 * fineKernel d h J (treatmentRecords w.1 i).1 (w.1.1 j).1 * bit (w.1.1 j).2.2)^2 ∂experiment P n m)
≤ ((4:ℝ)^d)^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d))
Proof (Lean source)
lemma rectangular_experiment_r_kernel_energy {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u : PolyIdx d) (i : Fin (n+m)) (j : Fin n) (hi : i ∈ (roleSplit n m).2) (hj : j ∈ (roleSplit n m).1) : (∫ w : Sample d n m, (locWeight h (treatmentRecords w.1 i).1 * locWeight h (w.1.1 j).1 * coarseBasis h (treatmentRecords w.1 i).1 u * bit (treatmentRecords w.1 i).2 * fineKernel d h J (treatmentRecords w.1 i).1 (w.1.1 j).1 * bit (w.1.1 j).2.2)^2 ∂experiment P n m) ≤ ((4:ℝ)^d)^2 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)) := by rw [rectangular_role_pair_square_integral P (fun p => locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * bit p.1.2 * fineKernel d h J p.1.1 p.2.1 * bit p.2.2.2) (by fun_prop) i j hi hj] exact rectangular_r_kernel_energy P hP h J hh hh' hJ u
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_experiment_r_kernel_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:159
theorem rectangular_experiment_q_kernel_energy Lemma rectangular_experiment_q_kernel_energy in the paper ↗

The raw Gram correction's squared kernel bound holds on every actual rectangular pair. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the specified input v, the specified input i, the specified input j, the specified input hi, the specified input hj, the rectangular experiment q kernel energy conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u v :
i :
Fin (n+m)
j :
Fin n
hi :
i ∈ (roleSplit n m).2
hj :
j ∈ (roleSplit n m).1
(∫ w : Sample d n m, (locWeight h (treatmentRecords w.1 i).1 * locWeight h (w.1.1 j).1 * coarseBasis h (treatmentRecords w.1 i).1 u * coarseBasis h (w.1.1 j).1 v * bit (treatmentRecords w.1 i).2 * bit (w.1.1 j).2.1 * fineKernel d h J (treatmentRecords w.1 i).1 (w.1.1 j).1)^2 ∂experiment P n m)
≤ ((4:ℝ)^d)^4 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d))
Proof (Lean source)
lemma rectangular_experiment_q_kernel_energy {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u v : PolyIdx d) (i : Fin (n+m)) (j : Fin n) (hi : i ∈ (roleSplit n m).2) (hj : j ∈ (roleSplit n m).1) : (∫ w : Sample d n m, (locWeight h (treatmentRecords w.1 i).1 * locWeight h (w.1.1 j).1 * coarseBasis h (treatmentRecords w.1 i).1 u * coarseBasis h (w.1.1 j).1 v * bit (treatmentRecords w.1 i).2 * bit (w.1.1 j).2.1 * fineKernel d h J (treatmentRecords w.1 i).1 (w.1.1 j).1)^2 ∂experiment P n m) ≤ ((4:ℝ)^d)^4 * ((card (PolyIdx d):ℝ)*(J:ℝ)^d / h^(2*d)) := by rw [rectangular_role_pair_square_integral P (fun p => locWeight h p.1.1 * locWeight h p.2.1 * coarseBasis h p.1.1 u * coarseBasis h p.2.1 v * bit p.1.2 * bit p.2.2.1 * fineKernel d h J p.1.1 p.2.1) (by fun_prop) i j hi hj] exact rectangular_q_kernel_energy P hP h J hh hh' hJ u v
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_experiment_q_kernel_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularRoleTransport.lean:176
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularSampling 1 declarations Two-channel point-CATE annotation frontier: Helpers/RectangularSampling constructions and obligations.

Helpers/RectangularSampling

Two-channel point-CATE annotation frontier: Helpers/RectangularSampling constructions and obligations.

theorem rectangular_sampling_bound

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular sampling bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
(∫ w, ∑ u : PolyIdx d, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m)
+ (∫ w, ∑ u : PolyIdx d, ∑ v : PolyIdx d, (qHat w.1 h J u v-qPop P n m h J u v)^2 ∂experiment P n m)
≤ C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_sampling_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d), PrimitiveClass alpha beta gamma L eps P → ∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → (∫ w, ∑ u : PolyIdx d, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m) + (∫ w, ∑ u : PolyIdx d, ∑ v : PolyIdx d, (qHat w.1 h J u v-qPop P n m h J u v)^2 ∂experiment P n m) ≤ C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by classical let q : ℝ := card (PolyIdx d) let K := rectangularCoordinateConstant d have hK : 0 < K := by dsimp [K, rectangularCoordinateConstant]; positivity refine ⟨(q+q*q+1)*K, by dsimp [q]; positivity, ?_⟩ intro P hP n m h J hn hh hh' hJ letI := population_experiment_probability P n m let V := 1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)) have hV : 0 ≤ V := by dsimp [V]; positivity have hr (u : PolyIdx d) := rectangular_r_coordinate_bound (m := m) P hP hn h J hh hh' hJ u have hq (u v : PolyIdx d) := rectangular_q_coordinate_bound (m := m) P hP hn h J hh hh' hJ u v have hiR (u : PolyIdx d) : Integrable (fun w : Sample d n m => (rHat w.1 h J u-rBar P n m h J u)^2) (experiment P n m) := ((hr u).1.sub (memLp_const _)).integrable_sq have hiRaw (u v : PolyIdx d) : Integrable (fun w : Sample d n m => (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2) (experiment P n m) := ((hq u v).1.sub (memLp_const _)).integrable_sq have hmean (u v : PolyIdx d) : qPop P n m h J u v = ((∫ w, qRaw w.1 h J u v ∂experiment P n m)+ (∫ w, qRaw w.1 h J v u ∂experiment P n m))/2 := by unfold qPop qHat simp_rw [div_eq_mul_inv] rw [integral_mul_const, integral_add ((hq u v).1.integrable (by norm_num)) ((hq v u).1.integrable (by norm_num))] have hiQ (u v : PolyIdx d) : Integrable (fun w : Sample d n m => (qHat w.1 h J u v-qPop P n m h J u v)^2) (experiment P n m) := by have hm : MemLp (fun w : Sample d n m => qHat w.1 h J u v) 2 (experiment P n m) := by simpa only [qHat, div_eq_mul_inv, Pi.add_apply] using ((hq u v).1.add (hq v u).1).mul_const (2:ℝ)⁻¹ exact (hm.sub (memLp_const _)).integrable_sq have hsym (w : Sample d n m) : (∑ u : PolyIdx d, ∑ v : PolyIdx d, (qHat w.1 h J u v-qPop P n m h J u v)^2) ≤ ∑ u : PolyIdx d, ∑ v : PolyIdx d, (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2 := by have hb := rectangular_symmetrization_energy_le (fun u v : PolyIdx d => qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m) convert hb using 1 apply Finset.sum_congr rfl intro u _ apply Finset.sum_congr rfl intro v _ rw [hmean] unfold qHat congr 1 ring have hR : (∫ w, ∑ u : PolyIdx d, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m) ≤ q*K*V := by rw [integral_finsetSum _ (fun u _ => hiR u)] calc _ ≤ ∑ u : PolyIdx d, K*V := Finset.sum_le_sum (fun u _ => (hr u).2) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; dsimp [q]; ring have hQ : (∫ w, ∑ u : PolyIdx d, ∑ v : PolyIdx d, (qHat w.1 h J u v-qPop P n m h J u v)^2 ∂experiment P n m) ≤ q*q*K*V := by calc _ ≤ ∫ w, ∑ u : PolyIdx d, ∑ v : PolyIdx d, (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2 ∂experiment P n m := integral_mono (integrable_finsetSum _ (fun u _ => integrable_finsetSum _ (fun v _ => hiQ u v))) (integrable_finsetSum _ (fun u _ => integrable_finsetSum _ (fun v _ => hiRaw u v))) hsym _ = ∑ u : PolyIdx d, ∑ v : PolyIdx d, ∫ w, (qRaw w.1 h J u v-∫ z, qRaw z.1 h J u v ∂experiment P n m)^2 ∂experiment P n m := by rw [integral_finsetSum _ (fun u _ => integrable_finsetSum _ (fun v _ => hiRaw u v))] apply Finset.sum_congr rfl intro u _ exact integral_finsetSum _ (fun v _ => hiRaw u v) _ ≤ ∑ u : PolyIdx d, ∑ v : PolyIdx d, K*V := Finset.sum_le_sum (fun u _ => Finset.sum_le_sum (fun v _ => (hq u v).2)) _ = _ := by simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul]; dsimp [q]; ring change _ ≤ ((q+q*q+1)*K)*V calc _ ≤ q*K*V + q*q*K*V := add_le_add hR hQ _ ≤ _ := by nlinarith only [mul_nonneg hK.le hV]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_sampling_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularSampling.lean:28
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularUStat 12 declarations Exact second moments and the Hoeffding variance identity for two independent finite iid blocks.

Helpers/RectangularUStat

Exact second moments and the Hoeffding variance identity for two independent finite iid blocks. Slice means preserve square integrability; the centered kernel splits into orthogonal row, column, and degenerate energies.

theorem rectangular_memLp_slices Lemma rectangular_memLp_slices in the paper ↗

Square-integrability on a product gives square-integrable slices almost everywhere. Given the specified input W, the specified input Z, the specified input H, the specified input hH, the rectangular mem lp slices conclusion holds.

Formal statement
μ :
ν :
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
∀ᵐ w ∂μ, MemLp (fun z => H (w,z)) 2 ν
Proof (Lean source)
lemma rectangular_memLp_slices {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : ∀ᵐ w ∂μ, MemLp (fun z => H (w,z)) 2 ν := by filter_upwards [hH.aestronglyMeasurable.prodMk_left, hH.integrable_sq.prod_right_ae] with w hm hi exact (memLp_two_iff_integrable_sq hm).2 hi
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_memLp_slices · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:28
theorem rectangular_sq_integral_le Lemma rectangular_sq_integral_le in the paper ↗

The squared expectation is no greater than the second moment. Given the specified input W, the specified input F, the specified input hF, the rectangular sq integral le conclusion holds.

Formal statement
W :
F :
W → ℝ
hF :
MemLp F 2 μ
(∫ w, F w ∂μ)^2 ≤ ∫ w, (F w)^2 ∂μ
Proof (Lean source)
lemma rectangular_sq_integral_le {W : Type*} [MeasurableSpace W] (μ : Measure W) [IsProbabilityMeasure μ] (F : W → ℝ) (hF : MemLp F 2 μ) : (∫ w, F w ∂μ)^2 ≤ ∫ w, (F w)^2 ∂μ := by have hv := variance_nonneg F μ rw [variance_eq_sub hF] at hv exact sub_nonneg.mp hv
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_sq_integral_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:37

Integrating one coordinate of a square-integrable product function preserves L². Given the specified input W, the specified input Z, the specified input H, the specified input hH, the rectangular mem lp mean conclusion holds.

Formal statement
μ :
ν :
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
MemLp (fun w => ∫ z, H (w,z) ∂ν) 2 μ
Proof (Lean source)
lemma rectangular_memLp_mean {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : MemLp (fun w => ∫ z, H (w,z) ∂ν) 2 μ := by have hm := hH.aestronglyMeasurable.integral_prod_right' apply (memLp_two_iff_integrable_sq hm).2 apply hH.integrable_sq.integral_prod_left.mono' · exact hm.pow 2 · filter_upwards [rectangular_memLp_slices μ ν H hH] with w hw rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact rectangular_sq_integral_le ν _ hw
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_memLp_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:45
theorem rectangular_iid_second_moment Lemma rectangular_iid_second_moment in the paper ↗

An iid average has second moment equal to its squared mean plus scaled variance. Given the specified input W, the specified input t, the specified input ht, the specified input F, the specified input hF, the rectangular iid second moment conclusion holds.

Formal statement
W :
t :
ℕ
ht :
0 < t
F :
W → ℝ
hF :
MemLp F 2 μ
(∫ s, ((t:ℝ)⁻¹ * ∑ i : Fin t, F (s i))^2 ∂Measure.pi (fun _ : Fin t => μ))
= (t:ℝ)⁻¹ * (∫ w, (F w)^2 ∂μ) + (1-(t:ℝ)⁻¹) * (∫ w, F w ∂μ)^2
Proof (Lean source)
lemma rectangular_iid_second_moment {W : Type*} [MeasurableSpace W] (μ : Measure W) [IsProbabilityMeasure μ] (t : ℕ) (ht : 0 < t) (F : W → ℝ) (hF : MemLp F 2 μ) : (∫ s, ((t:ℝ)⁻¹ * ∑ i : Fin t, F (s i))^2 ∂Measure.pi (fun _ : Fin t => μ)) = (t:ℝ)⁻¹ * (∫ w, (F w)^2 ∂μ) + (1-(t:ℝ)⁻¹) * (∫ w, F w ∂μ)^2 := by have hs : MemLp (fun s => (t:ℝ)⁻¹ * ∑ i : Fin t, F (s i)) 2 (Measure.pi (fun _ : Fin t => μ)) := (memLp_finsetSum _ (fun i _ => hF.comp_measurePreserving (measurePreserving_eval (fun _ : Fin t => μ) i))).const_mul _ have hv := iid_average_variance μ t F hF rw [variance_eq_sub hs, iid_average_integral μ t ht F (hF.integrable (by norm_num)), variance_eq_sub hF] at hv simp only [Pi.pow_apply] at hv linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_iid_second_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:58
theorem rectangular_average_memLp Lemma rectangular_average_memLp in the paper ↗

Averaging the first coordinate preserves square integrability on the remaining product. Given the specified input W, the specified input Z, the specified input t, the specified input H, the specified input hH, the rectangular average mem lp conclusion holds.

Formal statement
μ :
ν :
t :
ℕ
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
MemLp (fun p : (Fin t → W) × Z => (t:ℝ)⁻¹ * ∑ i : Fin t, H (p.1 i,p.2)) 2 ((Measure.pi (fun _ : Fin t => μ)).prod ν)
Proof (Lean source)
lemma rectangular_average_memLp {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t : ℕ) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : MemLp (fun p : (Fin t → W) × Z => (t:ℝ)⁻¹ * ∑ i : Fin t, H (p.1 i,p.2)) 2 ((Measure.pi (fun _ : Fin t => μ)).prod ν) := by apply MemLp.const_mul apply memLp_finsetSum intro i _ exact hH.comp_measurePreserving ((measurePreserving_eval (fun _ : Fin t => μ) i).prod (MeasurePreserving.id ν))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_average_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:75
theorem rectangular_average_square Lemma rectangular_average_square in the paper ↗

The second moment after averaging one coordinate follows from iid variance and Fubini. Given the specified input W, the specified input Z, the specified input t, the specified input ht, the specified input H, the specified input hH, the rectangular average square conclusion holds.

Formal statement
μ :
ν :
t :
ℕ
ht :
0 < t
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
(∫ p : (Fin t → W) × Z, ((t:ℝ)⁻¹ * ∑ i : Fin t, H (p.1 i,p.2))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod ν)
= (t:ℝ)⁻¹ * (∫ p, (H p)^2 ∂μ.prod ν) + (1-(t:ℝ)⁻¹) * (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν)
Proof (Lean source)
lemma rectangular_average_square {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t : ℕ) (ht : 0 < t) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : (∫ p : (Fin t → W) × Z, ((t:ℝ)⁻¹ * ∑ i : Fin t, H (p.1 i,p.2))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod ν) = (t:ℝ)⁻¹ * (∫ p, (H p)^2 ∂μ.prod ν) + (1-(t:ℝ)⁻¹) * (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) := by rw [integral_prod_symm _ (rectangular_average_memLp μ ν t H hH).integrable_sq] have hs : ∀ᵐ z ∂ν, MemLp (fun w => H (w,z)) 2 μ := rectangular_memLp_slices ν μ (fun p => H (p.2,p.1)) (hH.comp_measurePreserving Measure.measurePreserving_swap) rw [integral_congr_ae (by filter_upwards [hs] with z hz exact rectangular_iid_second_moment μ t ht _ hz)] have hm := rectangular_memLp_mean ν μ (fun p => H (p.2,p.1)) (hH.comp_measurePreserving Measure.measurePreserving_swap) rw [integral_add (hH.integrable_sq.integral_prod_right.const_mul _) (hm.integrable_sq.const_mul _), integral_const_mul, integral_const_mul, ← integral_prod_symm _ hH.integrable_sq]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_average_square · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:87
theorem rectangular_average_mean Lemma rectangular_average_mean in the paper ↗

Almost every slice mean of a first-coordinate average is the corresponding original mean. Given the specified input W, the specified input Z, the specified input t, the specified input ht, the specified input H, the specified input hH, the rectangular average mean conclusion holds.

Formal statement
μ :
ν :
t :
ℕ
ht :
0 < t
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
∀ᵐ z ∂ν, (∫ s : Fin t → W, (t:ℝ)⁻¹ * ∑ i : Fin t, H (s i,z) ∂Measure.pi (fun _ : Fin t => μ))
= ∫ w, H (w,z) ∂μ
Proof (Lean source)
lemma rectangular_average_mean {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t : ℕ) (ht : 0 < t) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : ∀ᵐ z ∂ν, (∫ s : Fin t → W, (t:ℝ)⁻¹ * ∑ i : Fin t, H (s i,z) ∂Measure.pi (fun _ : Fin t => μ)) = ∫ w, H (w,z) ∂μ := by filter_upwards [hH.integrable (by norm_num) |>.prod_left_ae] with z hz exact iid_average_integral μ t ht _ hz
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_average_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:108
theorem rectangular_average_other_mean Lemma rectangular_average_other_mean in the paper ↗

Slice integration commutes with a finite first-coordinate average. Given the specified input W, the specified input Z, the specified input t, the specified input H, the specified input hH, the rectangular average other mean conclusion holds.

Formal statement
μ :
ν :
t :
ℕ
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
∀ᵐ s ∂Measure.pi (fun _ : Fin t => μ), (∫ z, (t:ℝ)⁻¹ * ∑ i : Fin t, H (s i,z) ∂ν)
= (t:ℝ)⁻¹ * ∑ i : Fin t, ∫ z, H (s i,z) ∂ν
Proof (Lean source)
lemma rectangular_average_other_mean {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t : ℕ) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : ∀ᵐ s ∂Measure.pi (fun _ : Fin t => μ), (∫ z, (t:ℝ)⁻¹ * ∑ i : Fin t, H (s i,z) ∂ν) = (t:ℝ)⁻¹ * ∑ i : Fin t, ∫ z, H (s i,z) ∂ν := by have hs : ∀ i : Fin t, ∀ᵐ s ∂Measure.pi (fun _ : Fin t => μ), Integrable (fun z => H (s i,z)) ν := fun i => (measurePreserving_eval (fun _ : Fin t => μ) i).quasiMeasurePreserving.ae (hH.integrable (by norm_num) |>.prod_right_ae) filter_upwards [ae_all_iff.mpr hs] with s hs rw [integral_const_mul, integral_finsetSum _ (fun i _ => hs i)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_average_other_mean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:117
theorem rectangular_second_moment Lemma rectangular_second_moment in the paper ↗

Iterated iid averaging gives the exact uncentered rectangular second moment. Given the specified input W, the specified input Z, the specified input t, the specified input ell, the specified input ht, the specified input hl, the specified input H, the specified input hH, the rectangular second moment conclusion holds.

Formal statement
μ :
ν :
t ell :
ℕ
ht :
0 < t
hl :
0 < ell
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
(∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν)))
= (t:ℝ)⁻¹*(ell:ℝ)⁻¹ * (∫ p, (H p)^2 ∂μ.prod ν)
+ (t:ℝ)⁻¹*(1-(ell:ℝ)⁻¹) * (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ)
+ (1-(t:ℝ)⁻¹)*(ell:ℝ)⁻¹ * (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν)
+ (1-(t:ℝ)⁻¹)*(1-(ell:ℝ)⁻¹) * (∫ p, H p ∂μ.prod ν)^2
Proof (Lean source)
lemma rectangular_second_moment {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t ell : ℕ) (ht : 0 < t) (hl : 0 < ell) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : (∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν))) = (t:ℝ)⁻¹*(ell:ℝ)⁻¹ * (∫ p, (H p)^2 ∂μ.prod ν) + (t:ℝ)⁻¹*(1-(ell:ℝ)⁻¹) * (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ) + (1-(t:ℝ)⁻¹)*(ell:ℝ)⁻¹ * (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) + (1-(t:ℝ)⁻¹)*(1-(ell:ℝ)⁻¹) * (∫ p, H p ∂μ.prod ν)^2 := by let μt := Measure.pi (fun _ : Fin t => μ) let νl := Measure.pi (fun _ : Fin ell => ν) let A : (Fin t → W) × Z → ℝ := fun p => (t:ℝ)⁻¹ * ∑ i : Fin t, H (p.1 i,p.2) have hA : MemLp A 2 (μt.prod ν) := rectangular_average_memLp μ ν t H hH have hsecond := rectangular_average_square ν μt ell hl (fun p => A (p.2,p.1)) (hA.comp_measurePreserving Measure.measurePreserving_swap) dsimp only at hsecond change (∫ p : (Fin ell → Z) × (Fin t → W), ((ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.2,p.1 j))^2 ∂νl.prod μt) = _ at hsecond have hswap : (∫ p : (Fin ell → Z) × (Fin t → W), ((ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.2,p.1 j))^2 ∂νl.prod μt) = (∫ p : (Fin t → W) × (Fin ell → Z), ((ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.1,p.2 j))^2 ∂μt.prod νl) := by simpa only [swap] using integral_prod_swap (μ := μt) (ν := νl) (fun p => ((ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.1,p.2 j))^2) rw [hswap] at hsecond have havg : (fun p : (Fin t → W) × (Fin ell → Z) => (ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.1,p.2 j)) = (fun p => ((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (p.1 i,p.2 j)) := by funext p simp only [A, ← Finset.mul_sum, mul_inv_rev] rw [Finset.sum_comm] ring change (∫ p, ((ell:ℝ)⁻¹ * ∑ j : Fin ell, A (p.1,p.2 j))^2 ∂μt.prod νl) = _ at hsecond simp_rw [congrFun havg] at hsecond have hswapA : (∫ p : Z × (Fin t → W), (A (p.2,p.1))^2 ∂ν.prod μt) = ∫ p, (A p)^2 ∂μt.prod ν := by simpa only [swap] using integral_prod_swap (μ := μt) (ν := ν) (fun p => (A p)^2) rw [hswapA] at hsecond change _ = (ell:ℝ)⁻¹ * (∫ p, (A p)^2 ∂μt.prod ν) + (1-(ell:ℝ)⁻¹) * (∫ s, (∫ z, A (s,z) ∂ν)^2 ∂μt) at hsecond have hmeansq : (∫ s, (∫ z, A (s,z) ∂ν)^2 ∂μt) = (∫ s, ((t:ℝ)⁻¹ * ∑ i : Fin t, ∫ z, H (s i,z) ∂ν)^2 ∂μt) := by apply integral_congr_ae filter_upwards [rectangular_average_other_mean μ ν t H hH] with s hs exact congrArg (fun x : ℝ => x^2) hs rw [hmeansq] at hsecond rw [rectangular_average_square μ ν t ht H hH, rectangular_iid_second_moment μ t ht _ (rectangular_memLp_mean μ ν H hH), ← integral_prod _ (hH.integrable (by norm_num))] at hsecond rw [hsecond] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_second_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:131

A product function has the same inner product with a first-coordinate function as its slice mean. Given the specified input W, the specified input Z, the specified input H, the specified input g, the specified input hH, the specified input hg, the rectangular mean inner conclusion holds.

Formal statement
μ :
ν :
H :
W × Z → ℝ
g :
W → ℝ
hH :
MemLp H 2 (μ.prod ν)
hg :
MemLp g 2 μ
(∫ p, H p * g p.1 ∂μ.prod ν) = ∫ w, (∫ z, H (w,z) ∂ν) * g w ∂μ
Proof (Lean source)
lemma rectangular_mean_inner {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (H : W × Z → ℝ) (g : W → ℝ) (hH : MemLp H 2 (μ.prod ν)) (hg : MemLp g 2 μ) : (∫ p, H p * g p.1 ∂μ.prod ν) = ∫ w, (∫ z, H (w,z) ∂ν) * g w ∂μ := by have hi : Integrable (fun p : W × Z => H p*g p.1) (μ.prod ν) := by simpa only [Pi.mul_def] using hH.integrable_mul (hg.comp_fst ν) rw [integral_prod (fun p => H p*g p.1) hi] simp_rw [integral_mul_const]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_mean_inner · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:185
theorem rectangular_anova_energy Lemma rectangular_anova_energy in the paper ↗

The centered rectangular kernel splits into orthogonal row, column, and degenerate energies. Given the specified input W, the specified input Z, the specified input H, the specified input hH, the specified input hzero, the rectangular anova energy conclusion holds.

Formal statement
μ :
ν :
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
hzero :
∫ p, H p ∂μ.prod ν = 0
R :
fun w => ∫ z, H (w,z) ∂ν
C :
fun z => ∫ w, H (w,z) ∂μ
(∫ p, (H p-R p.1-C p.2)^2 ∂μ.prod ν)
= (∫ p, (H p)^2 ∂μ.prod ν) - (∫ w, (R w)^2 ∂μ) - (∫ z, (C z)^2 ∂ν)
Proof (Lean source)
lemma rectangular_anova_energy {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) (hzero : ∫ p, H p ∂μ.prod ν = 0) : let R := fun w => ∫ z, H (w,z) ∂ν let C := fun z => ∫ w, H (w,z) ∂μ (∫ p, (H p-R p.1-C p.2)^2 ∂μ.prod ν) = (∫ p, (H p)^2 ∂μ.prod ν) - (∫ w, (R w)^2 ∂μ) - (∫ z, (C z)^2 ∂ν) := by dsimp only let R := fun w => ∫ z, H (w,z) ∂ν let C := fun z => ∫ w, H (w,z) ∂μ have hR : MemLp R 2 μ := rectangular_memLp_mean μ ν H hH have hC : MemLp C 2 ν := rectangular_memLp_mean ν μ (fun p => H (p.2,p.1)) (hH.comp_measurePreserving Measure.measurePreserving_swap) have hRf := hR.comp_fst ν have hCs := hC.comp_snd μ have hHR := rectangular_mean_inner μ ν H R hH hR have hHC : (∫ p, H p * C p.2 ∂μ.prod ν) = ∫ z, (C z)^2 ∂ν := by have h := rectangular_mean_inner ν μ (fun p => H (p.2,p.1)) C (hH.comp_measurePreserving Measure.measurePreserving_swap) hC have hs : (∫ p : Z × W, H (p.2,p.1)*C p.1 ∂ν.prod μ) = ∫ p, H p*C p.2 ∂μ.prod ν := by simpa only [swap] using integral_prod_swap (μ := μ) (ν := ν) (fun p => H p*C p.2) rw [hs] at h simpa only [C, pow_two] using h have hRC : (∫ p : W × Z, R p.1*C p.2 ∂μ.prod ν) = 0 := by rw [integral_prod_mul] have hr : ∫ w, R w ∂μ = 0 := by rw [← integral_prod _ (hH.integrable (by norm_num))] exact hzero rw [hr, zero_mul] have hRsq : (∫ p : W × Z, (R p.1)^2 ∂μ.prod ν) = ∫ w, (R w)^2 ∂μ := by simpa using integral_fun_fst (μ := μ) (ν := ν) (fun w => (R w)^2) have hCsq : (∫ p : W × Z, (C p.2)^2 ∂μ.prod ν) = ∫ z, (C z)^2 ∂ν := by simpa using integral_fun_snd (μ := μ) (ν := ν) (fun z => (C z)^2) have hiH := hH.integrable_sq have hiR := hRf.integrable_sq have hiC := hCs.integrable_sq have hiHR : Integrable (fun p : W × Z => H p*R p.1) (μ.prod ν) := by simpa only [Pi.mul_def] using hH.integrable_mul hRf have hiHC : Integrable (fun p : W × Z => H p*C p.2) (μ.prod ν) := by simpa only [Pi.mul_def] using hH.integrable_mul hCs have hiRC : Integrable (fun p : W × Z => R p.1*C p.2) (μ.prod ν) := by simpa only [Pi.mul_def] using hRf.integrable_mul hCs have hiHR2 := hiHR.const_mul (2:ℝ) have hiHC2 := hiHC.const_mul (2:ℝ) have hiRC2 := hiRC.const_mul (2:ℝ) have hiSum := ((hiH.add hiR).add hiC).sub hiHR2 |>.sub hiHC2 have hexpand : (fun p : W × Z => (H p-R p.1-C p.2)^2) = (fun p => (H p)^2 + (R p.1)^2 + (C p.2)^2 - 2*(H p*R p.1) - 2*(H p*C p.2) + 2*(R p.1*C p.2)) := by funext p ring change (∫ p, (H p-R p.1-C p.2)^2 ∂μ.prod ν) = _ rw [hexpand] integral_linearity simp only [hRsq, hCsq, hHC, hRC] have hHR' : (∫ p, H p*R p.1 ∂μ.prod ν) = ∫ w, (R w)^2 ∂μ := by simpa only [R, pow_two] using hHR rw [hHR'] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_anova_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:196
theorem rectangular_ustat_variance Lemma rectangular_ustat_variance in the paper ↗

Two independent finite iid blocks give the rectangular Hoeffding variance identity. Given the specified input W, the specified input Z, the specified input t, the specified input ell, the specified input ht, the specified input hl, the specified input H, the specified input hH, the rectangular ustat variance conclusion holds.

Formal statement
μ :
ν :
t ell :
ℕ
ht :
0 < t
hl :
0 < ell
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
mean :
∫ wz, H wz ∂μ.prod ν
H1 :
fun w => (∫ z, H (w,z) ∂ν)-mean
H2 :
fun z => (∫ w, H (w,z) ∂μ)-mean
H12 :
fun wz => H wz-mean-H1 wz.1-H2 wz.2
(∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-mean)^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν)))
= (∫ w, (H1 w)^2 ∂μ)/(t:ℝ)
+ (∫ z, (H2 z)^2 ∂ν)/(ell:ℝ)
+ (∫ wz, (H12 wz)^2 ∂μ.prod ν)/((t:ℝ)*(ell:ℝ))
Proof (Lean source)
lemma rectangular_ustat_variance {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t ell : ℕ) (ht : 0 < t) (hl : 0 < ell) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : let mean := ∫ wz, H wz ∂μ.prod ν let H1 := fun w => (∫ z, H (w,z) ∂ν)-mean let H2 := fun z => (∫ w, H (w,z) ∂μ)-mean let H12 := fun wz => H wz-mean-H1 wz.1-H2 wz.2 (∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-mean)^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν))) = (∫ w, (H1 w)^2 ∂μ)/(t:ℝ) + (∫ z, (H2 z)^2 ∂ν)/(ell:ℝ) + (∫ wz, (H12 wz)^2 ∂μ.prod ν)/((t:ℝ)*(ell:ℝ)) := by dsimp only let mean := ∫ p, H p ∂μ.prod ν let H0 := fun p => H p-mean let H1 := fun w => (∫ z, H (w,z) ∂ν)-mean let H2 := fun z => (∫ w, H (w,z) ∂μ)-mean let R := fun w => ∫ z, H0 (w,z) ∂ν let C := fun z => ∫ w, H0 (w,z) ∂μ have hH0 : MemLp H0 2 (μ.prod ν) := hH.sub (memLp_const mean) have hzero : (∫ p, H0 p ∂μ.prod ν) = 0 := by rw [integral_sub (hH.integrable (by norm_num)) (integrable_const mean)] simp [mean] have hrow : R =ᵐ[μ] H1 := by filter_upwards [hH.integrable (by norm_num) |>.prod_right_ae] with w hw dsimp only [R, H0, H1] rw [integral_sub hw (integrable_const mean)] simp have hcol : C =ᵐ[ν] H2 := by filter_upwards [hH.integrable (by norm_num) |>.prod_left_ae] with z hz dsimp only [C, H0, H2] rw [integral_sub hz (integrable_const mean)] simp have hrowSq : (∫ w, (R w)^2 ∂μ) = ∫ w, (H1 w)^2 ∂μ := integral_congr_ae (hrow.fun_comp (fun x : ℝ => x^2)) have hcolSq : (∫ z, (C z)^2 ∂ν) = ∫ z, (H2 z)^2 ∂ν := integral_congr_ae (hcol.fun_comp (fun x : ℝ => x^2)) have hresSq : (∫ p, (H0 p-R p.1-C p.2)^2 ∂μ.prod ν) = ∫ p, (H p-mean-H1 p.1-H2 p.2)^2 ∂μ.prod ν := by apply integral_congr_ae have hr := (Measure.quasiMeasurePreserving_fst (μ := μ) (ν := ν)).ae hrow have hc := (Measure.quasiMeasurePreserving_snd (μ := μ) (ν := ν)).ae hcol filter_upwards [hr, hc] with p hp hq rw [hp, hq] have henergy := rectangular_anova_energy μ ν H0 hH0 hzero change (∫ p, (H0 p-R p.1-C p.2)^2 ∂μ.prod ν) = (∫ p, (H0 p)^2 ∂μ.prod ν) - (∫ w, (R w)^2 ∂μ) - (∫ z, (C z)^2 ∂ν) at henergy rw [hresSq, hrowSq, hcolSq] at henergy have hsecond := rectangular_second_moment μ ν t ell ht hl H0 hH0 change _ = (t:ℝ)⁻¹*(ell:ℝ)⁻¹ * (∫ p, (H0 p)^2 ∂μ.prod ν) + (t:ℝ)⁻¹*(1-(ell:ℝ)⁻¹) * (∫ w, (R w)^2 ∂μ) + (1-(t:ℝ)⁻¹)*(ell:ℝ)⁻¹ * (∫ z, (C z)^2 ∂ν) + (1-(t:ℝ)⁻¹)*(1-(ell:ℝ)⁻¹) * (∫ p, H0 p ∂μ.prod ν)^2 at hsecond rw [hrowSq, hcolSq, hzero] at hsecond have htR : (t:ℝ) ≠ 0 := by exact_mod_cast ht.ne' have hlR : (ell:ℝ) ≠ 0 := by exact_mod_cast hl.ne' have havg (D : (Fin t → W) × (Fin ell → Z)) : ((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H0 (D.1 i,D.2 j) = ((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-mean := by simp only [H0, Finset.sum_sub_distrib, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp simp_rw [havg] at hsecond change (∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-mean)^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν))) = (∫ w, (H1 w)^2 ∂μ)/(t:ℝ) + (∫ z, (H2 z)^2 ∂ν)/(ell:ℝ) + (∫ p, (H p-mean-H1 p.1-H2 p.2)^2 ∂μ.prod ν)/((t:ℝ)*(ell:ℝ)) rw [hsecond] have hE : (∫ p, (H0 p)^2 ∂μ.prod ν) = (∫ p, (H p-mean-H1 p.1-H2 p.2)^2 ∂μ.prod ν) + (∫ w, (H1 w)^2 ∂μ) + (∫ z, (H2 z)^2 ∂ν) := by linarith [henergy] rw [hE] simp only [div_eq_mul_inv, mul_inv_rev] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_ustat_variance · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularUStat.lean:259
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.RectangularVarianceBounds 10 declarations The Hoeffding identity bounds a rectangular average using uncentered slice and kernel second moments.

# Rectangular variance bounds The Hoeffding identity bounds a rectangular average using uncentered slice and kernel second moments. The prescribed role counts then yield the paper's two sample-size denominators. No independence between a first-order moment and its rectangular correction is required.

theorem rectangular_centered_energy_le Lemma rectangular_centered_energy_le in the paper ↗

Centering a square-integrable real statistic cannot increase its second moment. Given the specified input f, the specified input hf, the rectangular centered energy le conclusion holds.

Formal statement
Ω :
f :
Ω → ℝ
hf :
MemLp f 2 μ
(∫ x, (f x - ∫ y, f y ∂μ)^2 ∂μ) ≤ ∫ x, (f x)^2 ∂μ
Proof (Lean source)
lemma rectangular_centered_energy_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (f : Ω → ℝ) (hf : MemLp f 2 μ) : (∫ x, (f x - ∫ y, f y ∂μ)^2 ∂μ) ≤ ∫ x, (f x)^2 ∂μ := by have hv := variance_eq_sub hf rw [variance_eq_integral hf.aestronglyMeasurable.aemeasurable] at hv simp only [Pi.pow_apply] at hv linarith [sq_nonneg (∫ y, f y ∂μ)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_centered_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:20
theorem rectangular_degenerate_energy_le Lemma rectangular_degenerate_energy_le in the paper ↗

The orthogonal degenerate remainder has no more energy than the original kernel. Given the specified input W, the specified input Z, the specified input H, the specified input hH, the rectangular degenerate energy le conclusion holds.

Formal statement
μ :
ν :
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
mean :
∫ p, H p ∂μ.prod ν
(∫ p, (H p - mean - ((∫ z, H (p.1,z) ∂ν)-mean) - ((∫ w, H (w,p.2) ∂μ)-mean))^2 ∂μ.prod ν)
≤ ∫ p, (H p)^2 ∂μ.prod ν
Proof (Lean source)
lemma rectangular_degenerate_energy_le {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : let mean := ∫ p, H p ∂μ.prod ν (∫ p, (H p - mean - ((∫ z, H (p.1,z) ∂ν)-mean) - ((∫ w, H (w,p.2) ∂μ)-mean))^2 ∂μ.prod ν) ≤ ∫ p, (H p)^2 ∂μ.prod ν := by dsimp only let mean := ∫ p, H p ∂μ.prod ν let H0 := fun p => H p - mean have hH0 : MemLp H0 2 (μ.prod ν) := hH.sub (memLp_const mean) have hzero : ∫ p, H0 p ∂μ.prod ν = 0 := by rw [integral_sub (hH.integrable (by norm_num)) (integrable_const mean)] simp [mean] have hr : (fun w => ∫ z, H0 (w,z) ∂ν) =ᵐ[μ] (fun w => (∫ z, H (w,z) ∂ν)-mean) := by filter_upwards [hH.integrable (by norm_num) |>.prod_right_ae] with w hw dsimp only [H0] rw [integral_sub hw (integrable_const mean)] simp have hc : (fun z => ∫ w, H0 (w,z) ∂μ) =ᵐ[ν] (fun z => (∫ w, H (w,z) ∂μ)-mean) := by filter_upwards [hH.integrable (by norm_num) |>.prod_left_ae] with z hz dsimp only [H0] rw [integral_sub hz (integrable_const mean)] simp have he := rectangular_anova_energy μ ν H0 hH0 hzero dsimp only at he have hres : (∫ p, (H0 p - (∫ z, H0 (p.1,z) ∂ν) - (∫ w, H0 (w,p.2) ∂μ))^2 ∂μ.prod ν) = (∫ p, (H p-mean-((∫ z, H (p.1,z) ∂ν)-mean)- ((∫ w, H (w,p.2) ∂μ)-mean))^2 ∂μ.prod ν) := by apply integral_congr_ae filter_upwards [(Measure.quasiMeasurePreserving_fst (μ := μ) (ν := ν)).ae hr, (Measure.quasiMeasurePreserving_snd (μ := μ) (ν := ν)).ae hc] with p hp hq rw [hp, hq] rw [hres] at he have hbound := rectangular_centered_energy_le (μ.prod ν) H hH have hrow : 0 ≤ ∫ w, (∫ z, H0 (w,z) ∂ν)^2 ∂μ := integral_nonneg (fun _ => sq_nonneg _) have hcol : 0 ≤ ∫ z, (∫ w, H0 (w,z) ∂μ)^2 ∂ν := integral_nonneg (fun _ => sq_nonneg _) change (∫ p, (H p-mean-((∫ z, H (p.1,z) ∂ν)-mean)- ((∫ w, H (w,p.2) ∂μ)-mean))^2 ∂μ.prod ν) ≤ _ change (∫ p, (H0 p)^2 ∂μ.prod ν) ≤ _ at hbound linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_degenerate_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:29
theorem rectangular_variance_le_slice_energies Lemma rectangular_variance_le_slice_energies in the paper ↗

The rectangular variance is bounded by the uncentered row, column, and kernel energies. Given the specified input W, the specified input Z, the specified input t, the specified input ell, the specified input ht, the specified input hl, the specified input H, the specified input hH, the rectangular variance le slice energies conclusion holds.

Formal statement
μ :
ν :
t ell :
ℕ
ht :
0 < t
hl :
0 < ell
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
(∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν)))
≤ (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ)/(t:ℝ)
+ (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν)/(ell:ℝ)
+ (∫ p, (H p)^2 ∂μ.prod ν)/((t:ℝ)*(ell:ℝ))
Proof (Lean source)
lemma rectangular_variance_le_slice_energies {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (t ell : ℕ) (ht : 0 < t) (hl : 0 < ell) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) : (∫ D, (((t:ℝ)*(ell:ℝ))⁻¹ * ∑ i : Fin t, ∑ j : Fin ell, H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin t => μ)).prod (Measure.pi (fun _ : Fin ell => ν))) ≤ (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ)/(t:ℝ) + (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν)/(ell:ℝ) + (∫ p, (H p)^2 ∂μ.prod ν)/((t:ℝ)*(ell:ℝ)) := by rw [rectangular_ustat_variance μ ν t ell ht hl H hH] have hr := rectangular_centered_energy_le μ _ (rectangular_memLp_mean μ ν H hH) have hc := rectangular_centered_energy_le ν _ (rectangular_memLp_mean ν μ (fun p => H (p.2,p.1)) (hH.comp_measurePreserving Measure.measurePreserving_swap)) rw [← integral_prod _ (hH.integrable (by norm_num))] at hr rw [← integral_prod_symm _ (hH.integrable (by norm_num))] at hc exact add_le_add (add_le_add (div_le_div_of_nonneg_right hr (Nat.cast_nonneg _)) (div_le_div_of_nonneg_right hc (Nat.cast_nonneg _))) (div_le_div_of_nonneg_right (rectangular_degenerate_energy_le μ ν H hH) (by positivity))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_variance_le_slice_energies · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:78
theorem rectangular_role_count_bounds Lemma rectangular_role_count_bounds in the paper ↗

The floor split reserves at least one third of the labeled records and half of all treatment records. Given the specified input n, the specified input m, the specified input hn, the rectangular role count bounds conclusion holds.

Formal statement
n m :
ℕ
hn :
2 ≤ n
conclusion 1
(n:ℝ)/3 ≤ outcomeCount n
conclusion 2
((n:ℝ)+m)/2 ≤ treatmentCount n m
Proof (Lean source)
lemma rectangular_role_count_bounds (n m : ℕ) (hn : 2 ≤ n) : (n:ℝ)/3 ≤ outcomeCount n ∧ ((n:ℝ)+m)/2 ≤ treatmentCount n m := by have hfloor : n ≤ 3*(n/2) := by omega have hhalf : 2*(n/2) ≤ n := by omega constructor · unfold outcomeCount have h := (show (n:ℝ) ≤ 3*(n/2:ℕ) by exact_mod_cast hfloor) linarith · unfold treatmentCount rw [Nat.cast_sub (by omega : n/2 ≤ n+m), Nat.cast_add] have h := (show (2:ℝ)*(n/2:ℕ) ≤ (n:ℝ) by exact_mod_cast hhalf) linarith [show (0:ℝ) ≤ m by positivity]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_count_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:102
theorem rectangular_role_inverse_bounds Lemma rectangular_role_inverse_bounds in the paper ↗

Role reciprocals have the labeled and total-record orders required by the variance bound. Given the specified input n, the specified input m, the specified input hn, the rectangular role inverse bounds conclusion holds.

Formal statement
n m :
ℕ
hn :
2 ≤ n
conclusion 1
(outcomeCount n : ℝ)⁻¹ ≤ 3/(n:ℝ)
conclusion 2
(treatmentCount n m : ℝ)⁻¹ ≤ 2/((n:ℝ)+m)
conclusion 3
((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ ≤ 6/((n:ℝ)*((n:ℝ)+m))
Proof (Lean source)
lemma rectangular_role_inverse_bounds (n m : ℕ) (hn : 2 ≤ n) : (outcomeCount n : ℝ)⁻¹ ≤ 3/(n:ℝ) ∧ (treatmentCount n m : ℝ)⁻¹ ≤ 2/((n:ℝ)+m) ∧ ((treatmentCount n m : ℝ)*(outcomeCount n : ℝ))⁻¹ ≤ 6/((n:ℝ)*((n:ℝ)+m)) := by have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hN : (0:ℝ) < (n:ℝ)+m := by positivity obtain ⟨hl, ht⟩ := rectangular_role_count_bounds n m hn have hl0 : (0:ℝ) < outcomeCount n := (div_pos hn0 (by norm_num)).trans_le hl have ht0 : (0:ℝ) < treatmentCount n m := (div_pos hN (by norm_num)).trans_le ht have hil : (outcomeCount n : ℝ)⁻¹ ≤ 3/(n:ℝ) := by apply (le_div_iff₀ hn0).mpr apply (inv_mul_le_iff₀ hl0).mpr linarith have hit : (treatmentCount n m : ℝ)⁻¹ ≤ 2/((n:ℝ)+m) := by apply (le_div_iff₀ hN).mpr apply (inv_mul_le_iff₀ ht0).mpr linarith refine ⟨hil, hit, ?_⟩ rw [mul_inv_rev] calc _ ≤ (3/(n:ℝ))*(2/((n:ℝ)+m)) := mul_le_mul hil hit (inv_nonneg.mpr ht0.le) (by positivity) _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_inverse_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:116
theorem rectangular_role_variance_bound Lemma rectangular_role_variance_bound in the paper ↗

Uniform slice and kernel energies give the rectangular sampling order after the floor split. Given the specified input W, the specified input Z, the specified input n, the specified input m, the specified input hn, the specified input H, the specified input hH, the specified input B, the specified input E, the specified input hB, the specified input hE, the specified input hrow, the specified input hcol, the specified input hkernel, the rectangular role variance bound conclusion holds.

Formal statement
μ :
ν :
n m :
ℕ
hn :
2 ≤ n
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
B E :
ℝ
hB :
0 ≤ B
hE :
0 ≤ E
hrow :
(∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ) ≤ B
hcol :
(∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) ≤ B
hkernel :
(∫ p, (H p)^2 ∂μ.prod ν) ≤ E
(∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν)))
≤ 5*B/(n:ℝ) + 6*E/((n:ℝ)*((n:ℝ)+m))
Proof (Lean source)
lemma rectangular_role_variance_bound {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (n m : ℕ) (hn : 2 ≤ n) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) (B E : ℝ) (hB : 0 ≤ B) (hE : 0 ≤ E) (hrow : (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ) ≤ B) (hcol : (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) ≤ B) (hkernel : (∫ p, (H p)^2 ∂μ.prod ν) ≤ E) : (∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν))) ≤ 5*B/(n:ℝ) + 6*E/((n:ℝ)*((n:ℝ)+m)) := by have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hN : (0:ℝ) < (n:ℝ)+m := by positivity have hcounts : 0 < treatmentCount n m ∧ 0 < outcomeCount n := by unfold treatmentCount outcomeCount omega have hv := rectangular_variance_le_slice_energies μ ν (treatmentCount n m) (outcomeCount n) hcounts.1 hcounts.2 H hH obtain ⟨hil, hit, hip⟩ := rectangular_role_inverse_bounds n m hn have htotal : (2:ℝ)/((n:ℝ)+m) ≤ 2/(n:ℝ) := div_le_div_of_nonneg_left (by norm_num) hn0 (le_add_of_nonneg_right (Nat.cast_nonneg m)) have hr : (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ)/(treatmentCount n m:ℝ) ≤ B*(2/(n:ℝ)) := by rw [div_eq_mul_inv] exact mul_le_mul hrow (hit.trans htotal) (by positivity) hB have hc : (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν)/(outcomeCount n:ℝ) ≤ B*(3/(n:ℝ)) := by rw [div_eq_mul_inv] exact mul_le_mul hcol hil (by positivity) hB have hp : (∫ p, (H p)^2 ∂μ.prod ν)/ ((treatmentCount n m:ℝ)*(outcomeCount n:ℝ)) ≤ E*(6/((n:ℝ)*((n:ℝ)+m))) := by rw [div_eq_mul_inv] exact mul_le_mul hkernel hip (by positivity) hE calc _ ≤ _ := hv _ ≤ B*(2/(n:ℝ)) + B*(3/(n:ℝ)) + E*(6/((n:ℝ)*((n:ℝ)+m))) := add_le_add (add_le_add hr hc) hp _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_role_variance_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:142
theorem rectangular_difference_energy_le Lemma rectangular_difference_energy_le in the paper ↗

A first-order moment and its rectangular correction need no independence for this energy bound. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the rectangular difference energy le conclusion holds.

Formal statement
Ω :
μ :
f g :
Ω → ℝ
hf :
MemLp f 2 μ
hg :
MemLp g 2 μ
(∫ x, (f x-g x)^2 ∂μ) ≤ 2*(∫ x, (f x)^2 ∂μ) + 2*(∫ x, (g x)^2 ∂μ)
Proof (Lean source)
lemma rectangular_difference_energy_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (f g : Ω → ℝ) (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : (∫ x, (f x-g x)^2 ∂μ) ≤ 2*(∫ x, (f x)^2 ∂μ) + 2*(∫ x, (g x)^2 ∂μ) := by calc _ ≤ ∫ x, 2*(f x)^2 + 2*(g x)^2 ∂μ := by apply integral_mono (hf.sub hg).integrable_sq ((hf.integrable_sq.const_mul 2).add (hg.integrable_sq.const_mul 2)) intro x change (f x-g x)^2 ≤ 2*(f x)^2 + 2*(g x)^2 nlinarith [sq_nonneg (f x+g x)] _ = _ := by rw [integral_add (hf.integrable_sq.const_mul 2) (hg.integrable_sq.const_mul 2), integral_const_mul, integral_const_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_difference_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:183
theorem rectangular_symmetrization_energy_le Lemma rectangular_symmetrization_energy_le in the paper ↗

Symmetrization is a contraction for the squared Frobenius norm. Given the specified input B, the rectangular symmetrization energy le conclusion holds.

Formal statement
ι :
Type*
B :
Matrix ι ι ℝ
(∑ u, ∑ v, ((B u v+B v u)/2)^2) ≤ ∑ u, ∑ v, (B u v)^2
Proof (Lean source)
lemma rectangular_symmetrization_energy_le {ι : Type*} [Fintype ι] (B : Matrix ι ι ℝ) : (∑ u, ∑ v, ((B u v+B v u)/2)^2) ≤ ∑ u, ∑ v, (B u v)^2 := by change ι → ι → ℝ at B have hp : (∑ u, ∑ v, ((B u v+B v u)/2)^2) ≤ ∑ u, ∑ v, ((B u v)^2+(B v u)^2)/2 := by apply Finset.sum_le_sum intro u _ apply Finset.sum_le_sum intro v _ nlinarith [sq_nonneg (B u v-B v u)] calc _ ≤ _ := hp _ = _ := by simp only [← Finset.sum_div, Finset.sum_add_distrib] rw [Finset.sum_comm (f := fun u v => (B v u)^2)] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_symmetrization_energy_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:199
theorem rectangular_symmetrized_deviation_le Lemma rectangular_symmetrized_deviation_le in the paper ↗

Symmetrization about a symmetric population matrix contracts the squared deviation. Given the specified input B, the specified input Q, the specified input hQ, the rectangular symmetrized deviation le conclusion holds.

Formal statement
ι :
Type*
B Q :
Matrix ι ι ℝ
hQ :
∀ u v, Q u v = Q v u
(∑ u, ∑ v, ((B u v+B v u)/2-Q u v)^2) ≤ ∑ u, ∑ v, (B u v-Q u v)^2
Proof (Lean source)
lemma rectangular_symmetrized_deviation_le {ι : Type*} [Fintype ι] (B Q : Matrix ι ι ℝ) (hQ : ∀ u v, Q u v = Q v u) : (∑ u, ∑ v, ((B u v+B v u)/2-Q u v)^2) ≤ ∑ u, ∑ v, (B u v-Q u v)^2 := by have h := rectangular_symmetrization_energy_le (B-Q) simp only [Matrix.sub_apply] at h convert h using 1 apply Finset.sum_congr rfl intro u _ apply Finset.sum_congr rfl intro v _ rw [← hQ u v] congr 1 ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_symmetrized_deviation_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:218
theorem rectangular_sampling_from_kernel_energies Lemma rectangular_sampling_from_kernel_energies in the paper ↗

The roadmap's kernel and conditional-mean bounds give precisely the two-term sampling envelope. Given the specified input W, the specified input Z, the specified input n, the specified input m, the specified input d, the specified input hn, the specified input h, the specified input C, the specified input k, the specified input hh, the specified input hC, the specified input hk, the specified input H, the specified input hH, the specified input hrow, the specified input hcol, the specified input hkernel, the rectangular sampling from kernel energies conclusion holds.

Formal statement
μ :
ν :
n m d :
ℕ
hn :
2 ≤ n
h C k :
ℝ
hh :
0 < h
hC :
0 ≤ C
hk :
0 ≤ k
H :
W × Z → ℝ
hH :
MemLp H 2 (μ.prod ν)
hrow :
(∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ) ≤ C/h^d
hcol :
(∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) ≤ C/h^d
hkernel :
(∫ p, (H p)^2 ∂μ.prod ν) ≤ C*k/h^(2*d)
(∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν)))
≤ 6*C*(1/((n:ℝ)*h^d)+k/((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
Proof (Lean source)
lemma rectangular_sampling_from_kernel_energies {W Z : Type*} [MeasurableSpace W] [MeasurableSpace Z] (μ : Measure W) (ν : Measure Z) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (n m d : ℕ) (hn : 2 ≤ n) (h C k : ℝ) (hh : 0 < h) (hC : 0 ≤ C) (hk : 0 ≤ k) (H : W × Z → ℝ) (hH : MemLp H 2 (μ.prod ν)) (hrow : (∫ w, (∫ z, H (w,z) ∂ν)^2 ∂μ) ≤ C/h^d) (hcol : (∫ z, (∫ w, H (w,z) ∂μ)^2 ∂ν) ≤ C/h^d) (hkernel : (∫ p, (H p)^2 ∂μ.prod ν) ≤ C*k/h^(2*d)) : (∫ D, (((treatmentCount n m:ℝ)*(outcomeCount n:ℝ))⁻¹ * ∑ i : Fin (treatmentCount n m), ∑ j : Fin (outcomeCount n), H (D.1 i,D.2 j)-(∫ p, H p ∂μ.prod ν))^2 ∂(Measure.pi (fun _ : Fin (treatmentCount n m) => μ)).prod (Measure.pi (fun _ : Fin (outcomeCount n) => ν))) ≤ 6*C*(1/((n:ℝ)*h^d)+k/((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by have hv := rectangular_role_variance_bound μ ν n m hn H hH (C/h^d) (C*k/h^(2*d)) (by positivity) (by positivity) hrow hcol hkernel have heq : 5*(C/h^d)/(n:ℝ) + 6*(C*k/h^(2*d))/((n:ℝ)*((n:ℝ)+m)) = 5*C*(1/((n:ℝ)*h^d)) + 6*C*(k/((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by simp only [div_eq_mul_inv, mul_inv_rev] ring rw [heq] at hv have ha : 0 ≤ C*(1/((n:ℝ)*h^d)) := by positivity calc _ ≤ _ := hv _ ≤ _ := by nlinarith only [ha]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_sampling_from_kernel_energies · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/RectangularVarianceBounds.lean:234
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.ScaledHolder 6 declarations Global derivative bounds and a bounded/Lipschitz interpolation argument give uniform bounds in the paper's exact coordinate-partial Hölder norm.

Hölder bounds for dilated smooth compact profiles

Global derivative bounds and a bounded/Lipschitz interpolation argument give uniform bounds in the paper's exact coordinate-partial Hölder norm.

theorem coordinateDirections_norm_le Lemma coordinateDirections_norm_le in the paper ↗

The direction list has a dimension-only bound, sufficient for multilinear estimates. Given the specified input d, the specified input k, the coordinate directions norm le conclusion holds.

Formal statement
d :
ℕ
κ :
Fin d → ℕ
k :
Fin (multiOrder κ)
‖coordinateDirections κ k‖ ≤ (d : ℝ)
Proof (Lean source)
lemma coordinateDirections_norm_le {d : ℕ} (κ : Fin d → ℕ) (k : Fin (multiOrder κ)) : ‖coordinateDirections κ k‖ ≤ (d : ℝ) := by unfold coordinateDirections calc _ ≤ ∑ i : Fin d, ‖if (∑ j ∈ Finset.univ.filter (fun j => j < i), κ j) ≤ k.val ∧ k.val < (∑ j ∈ Finset.univ.filter (fun j => j < i), κ j) + κ i then single i (1 : ℝ) else 0‖ := norm_sum_le _ _ _ ≤ ∑ _ : Fin d, (1 : ℝ) := by apply Finset.sum_le_sum intro i _ split_ifs <;> simp _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinateDirections_norm_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:19
theorem compact_profile_derivative_bound Lemma compact_profile_derivative_bound in the paper ↗

A smooth compact profile has globally bounded derivatives at each fixed order. Given the specified input d, the specified input f, the specified input hf, the specified input hs, the specified input j, the compact profile derivative bound conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
hf :
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f
j :
ℕ
∃ C : ℝ,
0 ≤ C
conclusion 1
x :
‖iteratedFDeriv ℝ j f x‖ ≤ C
Proof (Lean source)
lemma compact_profile_derivative_bound {d : ℕ} (f : Cov d → ℝ) (hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f) (hs : HasCompactSupport f) (j : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ x, ‖iteratedFDeriv ℝ j f x‖ ≤ C := by have hc : Continuous (iteratedFDeriv ℝ j f) := hf.continuous_iteratedFDeriv (WithTop.coe_le_coe.mpr le_top) obtain ⟨C, hC⟩ := hc.bounded_above_of_compact_support (hs.iteratedFDeriv j) exact ⟨max C 0, le_max_right _ _, fun x => (hC x).trans (le_max_left _ _)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.compact_profile_derivative_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:33
theorem compact_profile_derivative_modulus Lemma compact_profile_derivative_modulus in the paper ↗

Bounded smooth derivatives interpolate to a global fractional Hölder modulus. Given the specified input d, the specified input f, the specified input hf, the specified input hs, the specified input j, the specified input a, the specified input ha, the specified input ha1, the compact profile derivative modulus conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
hf :
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f
j :
ℕ
a :
ℝ
ha :
0 < a
ha1 :
a ≤ 1
∃ C : ℝ,
0 ≤ C
conclusion 1
x y :
‖iteratedFDeriv ℝ j f x - iteratedFDeriv ℝ j f y‖ ≤ C * ‖x-y‖^a
Proof (Lean source)
lemma compact_profile_derivative_modulus {d : ℕ} (f : Cov d → ℝ) (hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f) (hs : HasCompactSupport f) (j : ℕ) (a : ℝ) (ha : 0 < a) (ha1 : a ≤ 1) : ∃ C : ℝ, 0 ≤ C ∧ ∀ x y, ‖iteratedFDeriv ℝ j f x - iteratedFDeriv ℝ j f y‖ ≤ C * ‖x-y‖^a := by obtain ⟨B, hB0, hB⟩ := compact_profile_derivative_bound f hf hs j obtain ⟨L, hL0, hL⟩ := compact_profile_derivative_bound f hf hs (j+1) let A := max B L have hA : 0 ≤ A := hB0.trans (le_max_left _ _) refine ⟨2*A, by positivity, ?_⟩ intro x y have hlip : ‖iteratedFDeriv ℝ j f x - iteratedFDeriv ℝ j f y‖ ≤ A * ‖x-y‖ := by apply Convex.norm_image_sub_le_of_norm_fderiv_le (s := univ) (x := y) (y := x) (𝕜 := ℝ) (f := iteratedFDeriv ℝ j f) · intro z _ exact hf.contDiffAt.differentiableAt_iteratedFDeriv (by exact_mod_cast (show (j : ℕ∞) < ⊤ by simp)) · intro z _ rw [norm_fderiv_iteratedFDeriv] exact (hL z).trans (le_max_right _ _) · exact convex_univ · trivial · trivial by_cases hr : ‖x-y‖ ≤ 1 · have hp := Real.self_le_rpow_of_le_one (norm_nonneg (x-y)) hr ha1 calc _ ≤ A * ‖x-y‖ := hlip _ ≤ A * ‖x-y‖^a := mul_le_mul_of_nonneg_left hp hA _ ≤ _ := by nlinarith [Real.rpow_nonneg (norm_nonneg (x-y)) a] · have hp := Real.one_le_rpow (le_of_lt (lt_of_not_ge hr)) ha.le calc _ ≤ ‖iteratedFDeriv ℝ j f x‖ + ‖iteratedFDeriv ℝ j f y‖ := norm_sub_le _ _ _ ≤ 2*A := by dsimp [A]; linarith [hB x, hB y, le_max_left B L] _ ≤ _ := by nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.compact_profile_derivative_modulus · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:42
theorem dilated_profile_derivative Lemma dilated_profile_derivative in the paper ↗

Translation and dilation give the exact derivative scaling of a profile. Given the specified input d, the specified input f, the specified input hf, the specified input h, the specified input j, the specified input x, the dilated profile derivative conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
hf :
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f
h :
ℝ
j :
ℕ
x :
Cov d
iteratedFDeriv ℝ j (fun z => f (h⁻¹ • (z-x0 d))) x
= (h⁻¹)^j • iteratedFDeriv ℝ j f (h⁻¹ • (x-x0 d))
Proof (Lean source)
lemma dilated_profile_derivative {d : ℕ} (f : Cov d → ℝ) (hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f) (h : ℝ) (j : ℕ) (x : Cov d) : iteratedFDeriv ℝ j (fun z => f (h⁻¹ • (z-x0 d))) x = (h⁻¹)^j • iteratedFDeriv ℝ j f (h⁻¹ • (x-x0 d)) := by rw [iteratedFDeriv_comp_sub (𝕜 := ℝ) (f := fun z => f (h⁻¹ • z)) j (x0 d) x] exact congrFun (iteratedFDeriv_comp_const_smul h⁻¹ (hf.of_le (WithTop.coe_le_coe.mpr le_top))) _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.dilated_profile_derivative · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:77
theorem coordinatePartial_le_operator Lemma coordinatePartial_le_operator in the paper ↗

The exact coordinate partial is controlled by the ambient derivative operator norm. Given the specified input d, the specified input f, the specified input hf, the specified input x, the specified input hx, the coordinate partial le operator conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
hf :
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f
κ :
Fin d → ℕ
x :
Cov d
hx :
x ∈ cube d
|coordinatePartial f κ x| ≤ ‖iteratedFDeriv ℝ (multiOrder κ) f x‖ * (d : ℝ)^(multiOrder κ)
Proof (Lean source)
lemma coordinatePartial_le_operator {d : ℕ} (f : Cov d → ℝ) (hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f) (κ : Fin d → ℕ) (x : Cov d) (hx : x ∈ cube d) : |coordinatePartial f κ x| ≤ ‖iteratedFDeriv ℝ (multiOrder κ) f x‖ * (d : ℝ)^(multiOrder κ) := by unfold coordinatePartial rw [iteratedFDerivWithin_eq_iteratedFDeriv (uniqueDiffOn_cube d) (hf.of_le (WithTop.coe_le_coe.mpr le_top)).contDiffAt hx] change ‖(iteratedFDeriv ℝ (multiOrder κ) f x) (coordinateDirections κ)‖ ≤ _ calc _ ≤ ‖iteratedFDeriv ℝ (multiOrder κ) f x‖ * ∏ i, ‖coordinateDirections κ i‖ := (iteratedFDeriv ℝ (multiOrder κ) f x).le_opNorm _ _ ≤ _ := by have hd := Finset.prod_le_prod (s := univ) (fun i _ => norm_nonneg (coordinateDirections κ i)) (fun i _ => coordinateDirections_norm_le κ i) simpa only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] using mul_le_mul_of_nonneg_left hd (norm_nonneg (iteratedFDeriv ℝ (multiOrder κ) f x))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial_le_operator · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:86
theorem compact_profile_scaled_holder Lemma compact_profile_scaled_holder in the paper ↗

Smooth compact profiles obey the exact Hölder norm bound after dilation. Given the specified input d, the specified input f, the specified input hf, the specified input hsupp, the specified input s, the specified input hs, the compact profile scaled holder conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
hf :
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f
hsupp :
s :
ℝ
hs :
0 < s
∃ C : ℝ,
0 < C
conclusion 1
h :
0 < h
h ≤ 1
holderNorm (fun x => f (h⁻¹ • (x-x0 d))) s ≤ ofReal (C*h^(-s))
Proof (Lean source)
lemma compact_profile_scaled_holder {d : ℕ} (f : Cov d → ℝ) (hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f) (hsupp : HasCompactSupport f) (s : ℝ) (hs : 0 < s) : ∃ C : ℝ, 0 < C ∧ ∀ h, 0 < h → h ≤ 1 → holderNorm (fun x => f (h⁻¹ • (x-x0 d))) s ≤ ofReal (C*h^(-s)) := by let m := Nat.ceil s - 1 let a := s - (m : ℝ) have hm : (m : ℝ) < s := Nat.lt_ceil.mp (by have := Nat.ceil_pos.mpr hs dsimp [m] omega) have ha : 0 < a := by dsimp [a]; linarith have ha1 : a ≤ 1 := by have hc := Nat.le_ceil s have he : m+1 = Nat.ceil s := by dsimp [m] have := Nat.ceil_pos.mpr hs omega have heR : (m : ℝ)+1 = (Nat.ceil s : ℝ) := by exact_mod_cast he dsimp [a] linarith let D : ℕ → ℝ := fun j => (compact_profile_derivative_bound f hf hsupp j).choose have hD0 (j) : 0 ≤ D j := (compact_profile_derivative_bound f hf hsupp j).choose_spec.1 have hD (j x) : ‖iteratedFDeriv ℝ j f x‖ ≤ D j := (compact_profile_derivative_bound f hf hsupp j).choose_spec.2 x obtain ⟨M, hM0, hM⟩ := compact_profile_derivative_modulus f hf hsupp m a ha ha1 let B := ∑ j ∈ range (m+1), D j * (d : ℝ)^j let C := B + M*(d : ℝ)^m + 1 have hB : 0 ≤ B := Finset.sum_nonneg (fun j _ => by exact mul_nonneg (hD0 j) (pow_nonneg (Nat.cast_nonneg _) _)) have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro h hh hh1 let g : Cov d → ℝ := fun x => f (h⁻¹ • (x-x0 d)) have hg : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) g := hf.comp (by fun_prop) have hCB : B ≤ C := by dsimp [C]; linarith [mul_nonneg hM0 (pow_nonneg (Nat.cast_nonneg d) m)] have hCM : M*(d : ℝ)^m ≤ C := by dsimp [C]; linarith apply (holderNorm_le_iff g s (C*h^(-s)) (by positivity)).mpr refine ⟨(hg.of_le (WithTop.coe_le_coe.mpr le_top)).contDiffOn, ?_, ?_⟩ · intro κ hκ x hx let j := multiOrder κ have hj : j ≤ m := hκ have hjB : D j * (d : ℝ)^j ≤ B := by apply Finset.single_le_sum (f := fun i => D i * (d : ℝ)^i) · intro i _ exact mul_nonneg (hD0 i) (by positivity) · exact Finset.mem_range.mpr (Nat.lt_succ_of_le hj) have hscale : (h⁻¹)^j ≤ h^(-s) := by rw [inv_pow, ← Real.rpow_natCast, ← Real.rpow_neg hh.le] apply Real.rpow_le_rpow_of_exponent_ge hh hh1 have hjR : (j : ℝ) ≤ m := by exact_mod_cast hj linarith calc _ ≤ ‖iteratedFDeriv ℝ j g x‖ * (d : ℝ)^j := coordinatePartial_le_operator g hg κ x hx _ = (h⁻¹)^j * ‖iteratedFDeriv ℝ j f (h⁻¹ • (x-x0 d))‖ * (d : ℝ)^j := by rw [dilated_profile_derivative f hf, norm_smul, Real.norm_eq_abs, abs_of_nonneg (by positivity)] _ ≤ (h⁻¹)^j * (D j * (d : ℝ)^j) := by have hp := mul_le_mul_of_nonneg_left (hD j (h⁻¹ • (x-x0 d))) (show 0 ≤ (h⁻¹)^j by positivity) have hp' := mul_le_mul_of_nonneg_right hp (show 0 ≤ (d : ℝ)^j by positivity) simpa only [mul_assoc] using hp' _ ≤ h^(-s) * C := mul_le_mul hscale (hjB.trans hCB) (mul_nonneg (hD0 j) (by positivity)) (by positivity) _ = _ := by ring · intro κ hκ x hx y hy hxy have hκm : multiOrder κ = m := hκ have hMj := hM rw [← hκm] at hMj have hjet (z : Cov d) (hz : z ∈ cube d) : coordinatePartial g κ z = (iteratedFDeriv ℝ (multiOrder κ) g z) (coordinateDirections κ) := by unfold coordinatePartial rw [iteratedFDerivWithin_eq_iteratedFDeriv (uniqueDiffOn_cube d) (hg.of_le (WithTop.coe_le_coe.mpr le_top)).contDiffAt hz] rw [hjet x hx, hjet y hy] have hop : |(iteratedFDeriv ℝ (multiOrder κ) g x) (coordinateDirections κ) - (iteratedFDeriv ℝ (multiOrder κ) g y) (coordinateDirections κ)| ≤ ‖iteratedFDeriv ℝ (multiOrder κ) g x - iteratedFDeriv ℝ (multiOrder κ) g y‖ * (d : ℝ)^(multiOrder κ) := by change ‖((iteratedFDeriv ℝ (multiOrder κ) g x)-(iteratedFDeriv ℝ (multiOrder κ) g y)) (coordinateDirections κ)‖ ≤ _ calc _ ≤ _ := ((iteratedFDeriv ℝ (multiOrder κ) g x)-(iteratedFDeriv ℝ (multiOrder κ) g y)).le_opNorm _ _ ≤ _ := by have hd := Finset.prod_le_prod (s := univ) (fun i _ => norm_nonneg (coordinateDirections κ i)) (fun i _ => coordinateDirections_norm_le κ i) simpa only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] using mul_le_mul_of_nonneg_left hd (norm_nonneg ((iteratedFDeriv ℝ (multiOrder κ) g x)-(iteratedFDeriv ℝ (multiOrder κ) g y))) have hdist : ‖h⁻¹ • (x-x0 d)-h⁻¹ • (y-x0 d)‖ = ‖x-y‖/h := by rw [← smul_sub, sub_sub_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_inv, abs_of_pos hh] ring have hcancel : (h⁻¹)^(multiOrder κ) * (‖x-y‖/h)^a = h^(-s) * ‖x-y‖^a := by rw [Real.div_rpow (norm_nonneg _) hh.le, div_eq_mul_inv, inv_pow, ← Real.rpow_natCast, ← Real.rpow_neg hh.le, ← Real.rpow_neg hh.le] rw [show h^(-(multiOrder κ : ℝ)) * (‖x-y‖^a * h^(-a)) = (h^(-(multiOrder κ : ℝ)) * h^(-a)) * ‖x-y‖^a by ring, ← Real.rpow_add hh] congr 2 rw [hκm] dsimp [a] ring calc _ ≤ _ := hop _ = (h⁻¹)^(multiOrder κ) * ‖iteratedFDeriv ℝ (multiOrder κ) f (h⁻¹ • (x-x0 d)) - iteratedFDeriv ℝ (multiOrder κ) f (h⁻¹ • (y-x0 d))‖ * (d : ℝ)^(multiOrder κ) := by rw [dilated_profile_derivative f hf, dilated_profile_derivative f hf, ← smul_sub, norm_smul, Real.norm_eq_abs, abs_of_nonneg (by positivity)] _ ≤ (h⁻¹)^(multiOrder κ) * (M*(‖x-y‖/h)^a) * (d : ℝ)^(multiOrder κ) := by gcongr simpa only [hdist] using hMj (h⁻¹ • (x-x0 d)) (h⁻¹ • (y-x0 d)) _ = (M*(d : ℝ)^(multiOrder κ)) * h^(-s) * ‖x-y‖^a := by calc _ = (M*(d : ℝ)^(multiOrder κ)) * ((h⁻¹)^(multiOrder κ) * (‖x-y‖/h)^a) := by ring _ = _ := by rw [hcancel]; ring _ ≤ C*h^(-s)*‖x-y‖^a := by apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg (norm_nonneg _) _) apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg hh.le _) simpa only [hκm] using hCM _ = _ := by rw [dist_eq_norm]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.compact_profile_scaled_holder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/ScaledHolder.lean:105
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.TuningBalance 4 declarations Algebraic bounds for the two sampling terms under the prescribed public tuning.

# Public bandwidth and grid balance Algebraic bounds for the two sampling terms under the prescribed public tuning.

theorem bandwidth_monomial_balance Lemma bandwidth_monomial_balance in the paper ↗

A bandwidth above the sample power balances a sampling monomial against its bias. Given the specified input x, the specified input H, the specified input D, the specified input p, the specified input g, the specified input hx, the specified input hH, the specified input hD, the specified input heq, the specified input hb, the bandwidth monomial balance conclusion holds.

Formal statement
x H D p g :
ℝ
hx :
0 < x
hH :
0 < H
hD :
0 < D
heq :
D = 2*g+p
hb :
x^(-(1/D)) ≤ 2*H
(x*H^p)^(-(1/2:ℝ)) ≤ (2:ℝ)^(D/2)*H^g
Proof (Lean source)
lemma bandwidth_monomial_balance (x H D p g : ℝ) (hx : 0 < x) (hH : 0 < H) (hD : 0 < D) (heq : D = 2*g+p) (hb : x^(-(1/D)) ≤ 2*H) : (x*H^p)^(-(1/2:ℝ)) ≤ (2:ℝ)^(D/2)*H^g := by have hl := Real.log_le_log (Real.rpow_pos_of_pos hx _) hb rw [Real.log_rpow hx, Real.log_mul (by norm_num) hH.ne'] at hl have hm := mul_le_mul_of_nonneg_left hl hD.le have hc : D * (-(1/D) * log x) = -log x := by field_simp rw [hc] at hm apply (Real.log_le_log_iff (by positivity) (by positivity)).mp rw [Real.log_rpow (by positivity), Real.log_mul hx.ne' (by positivity), Real.log_rpow hH, Real.log_mul (by positivity) (by positivity), Real.log_rpow (by norm_num), Real.log_rpow hH] rw [heq] at hm ⊢ nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bandwidth_monomial_balance · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/TuningBalance.lean:16

Rounding the grid power changes its cell side by at most a factor two. Given the specified input H, the specified input t, the specified input hH, the specified input hH1, the specified input ht, the ceil grid side bounds conclusion holds.

Formal statement
H t :
ℝ
hH :
0 < H
hH1 :
H ≤ 1
ht :
1 ≤ t
J :
ceil (H^(-(t-1)))
1 ≤ J
0 < H/J
H^t/2 ≤ H/J
H/J ≤ H^t
Proof (Lean source)
lemma ceil_grid_side_bounds (H t : ℝ) (hH : 0 < H) (hH1 : H ≤ 1) (ht : 1 ≤ t) : let J := Nat.ceil (H^(-(t-1))) 1 ≤ J ∧ 0 < H/J ∧ H^t/2 ≤ H/J ∧ H/J ≤ H^t := by let z := H^(-(t-1)) have hz : 0 < z := Real.rpow_pos_of_pos hH _ have hz1 : 1 ≤ z := by simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_ge hH hH1 (show -(t-1) ≤ 0 by linarith) have hJ : 1 ≤ Nat.ceil z := Nat.one_le_ceil_iff.mpr hz have hJpos : (0:ℝ) < Nat.ceil z := by exact_mod_cast hJ have hlow : z ≤ (Nat.ceil z:ℝ) := Nat.le_ceil z have hupp : (Nat.ceil z:ℝ) ≤ 2*z := by have hc := Nat.ceil_lt_add_one hz.le linarith have heq : H/z = H^t := by dsimp [z] rw [div_eq_mul_inv, ← Real.rpow_neg hH.le] conv_lhs => lhs; rw [← Real.rpow_one H] rw [← Real.rpow_add hH] congr 1 ring refine ⟨hJ, div_pos hH hJpos, ?_, ?_⟩ · rw [← heq] calc H/z/2 = H/(2*z) := by ring _ ≤ H/(Nat.ceil z:ℝ) := div_le_div_of_nonneg_left hH.le hJpos hupp · rw [← heq] exact div_le_div_of_nonneg_left hH.le hz hlow
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ceil_grid_side_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/TuningBalance.lean:33

A factor-two cell-side bound gives the corresponding pair-sampling bound. Given the specified input x, the specified input H, the specified input delta, the specified input t, the specified input d, the specified input hx, the specified input hH, the specified input hd, the specified input hgrid, the grid pair sampling le conclusion holds.

Formal statement
x H delta t :
ℝ
d :
ℕ
hx :
0 < x
hH :
0 < H
hd :
0 < delta
hgrid :
H^t/2 ≤ delta
(x*H^d*delta^d)^(-(1/2:ℝ)) ≤ (2:ℝ)^((d:ℝ)/2)*(x*H^((d:ℝ)+(d:ℝ)*t))^(-(1/2:ℝ))
Proof (Lean source)
lemma grid_pair_sampling_le (x H delta t : ℝ) (d : ℕ) (hx : 0 < x) (hH : 0 < H) (hd : 0 < delta) (hgrid : H^t/2 ≤ delta) : (x*H^d*delta^d)^(-(1/2:ℝ)) ≤ (2:ℝ)^((d:ℝ)/2)*(x*H^((d:ℝ)+(d:ℝ)*t))^(-(1/2:ℝ)) := by have hl := Real.log_le_log (by positivity : 0 < H^t/2) hgrid rw [Real.log_div (by positivity) (by norm_num), Real.log_rpow hH] at hl have hm := mul_le_mul_of_nonneg_left hl (Nat.cast_nonneg d : (0:ℝ) ≤ d) apply (Real.log_le_log_iff (by positivity) (by positivity)).mp simp only [← Real.rpow_natCast] rw [Real.log_rpow (by positivity), Real.log_mul (by positivity) (by positivity), Real.log_mul hx.ne' (by positivity), Real.log_rpow hH, Real.log_rpow hd, Real.log_mul (by positivity) (by positivity), Real.log_rpow (by norm_num), Real.log_rpow (by positivity), Real.log_mul hx.ne' (by positivity), Real.log_rpow hH] nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.grid_pair_sampling_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/TuningBalance.lean:63

The prescribed tuning balances approximation and both sampling channels. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the tuning balance conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
2 ≤ n
h :
hStar d alpha beta gamma n m
J :
jStar d alpha beta gamma n m
0 < h
h ≤ 1/2
1 ≤ J
h^gamma+(h/J)^(alpha+beta)+((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))
≤ C*upperRate d alpha beta gamma n m
Proof (Lean source)
lemma tuning_balance (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 2 ≤ n → let h := hStar d alpha beta gamma n m let J := jStar d alpha beta gamma n m 0 < h ∧ h ≤ 1/2 ∧ 1 ≤ J ∧ h^gamma+(h/J)^(alpha+beta)+((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)) ≤ C*upperRate d alpha beta gamma n m := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 let A : ℝ := 2*gamma+d let D := bigDelta d alpha beta gamma have hA : 0 < A := by dsimp [A]; positivity have hD : 0 < D := by dsimp [D, bigDelta]; positivity let c1 : ℝ := (2:ℝ)^(A/2) let c2 : ℝ := (2:ℝ)^((d:ℝ)/2)*(2:ℝ)^(D/2)+(2:ℝ)^A refine ⟨2+c1+c2, by dsimp [c1, c2]; positivity, ?_⟩ intro n m hn let H := hStar d alpha beta gamma n m let J := jStar d alpha beta gamma n m have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hnpos : (0:ℝ) < n := lt_of_lt_of_le zero_lt_one hn1 have hN : (n:ℝ) ≤ (n:ℝ)+m := le_add_of_nonneg_right (Nat.cast_nonneg m) have hNpos : (0:ℝ) < (n:ℝ)+m := hnpos.trans_le hN have hx : (0:ℝ) < (n:ℝ)*((n:ℝ)+m) := mul_pos hnpos hNpos let u : ℝ := (n:ℝ)^(-(1/A)) let w : ℝ := ((n:ℝ)*((n:ℝ)+m))^(-(1/D)) have hu : 0 < u := Real.rpow_pos_of_pos hnpos _ have hw : 0 < w := Real.rpow_pos_of_pos hx _ have hu1 : u ≤ 1 := by simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_le hn1 (show -(1/A) ≤ 0 by exact neg_nonpos.mpr (one_div_nonneg.mpr hA.le)) have hx1 : (1:ℝ) ≤ (n:ℝ)*((n:ℝ)+m) := by nlinarith have hw1 : w ≤ 1 := by simpa only [Real.rpow_zero] using Real.rpow_le_rpow_of_exponent_le hx1 (show -(1/D) ≤ 0 by exact neg_nonpos.mpr (one_div_nonneg.mpr hD.le)) have hHdef : H = (1/2:ℝ)*max u w := rfl have hH : 0 < H := by rw [hHdef]; positivity have hHhalf : H ≤ 1/2 := by rw [hHdef]; nlinarith [max_le hu1 hw1] have hH1 : H ≤ 1 := by linarith have hbu : u ≤ 2*H := by rw [hHdef]; nlinarith [le_max_left u w] have hbw : w ≤ 2*H := by rw [hHdef]; nlinarith [le_max_right u w] have hrate : H^gamma ≤ upperRate d alpha beta gamma n m := by have hHm : H ≤ max u w := by rw [hHdef]; nlinarith [le_max_left u w] have hp := Real.rpow_le_rpow hH.le hHm hg.le rw [Real.rpow_max hu.le hw.le hg.le] at hp have he1 : u^gamma = oracleRate d gamma n := by dsimp [u, oracleRate, A] rw [← Real.rpow_mul hnpos.le] congr 1 ring have he2 : w^gamma = ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) := by dsimp [w, D] rw [← Real.rpow_mul hx.le] congr 1 ring simpa only [he1, he2, upperRate] using hp have hsamp : ((n:ℝ)*H^d)^(-(1/2:ℝ)) ≤ c1*H^gamma := by rw [← Real.rpow_natCast] exact bandwidth_monomial_balance _ _ A _ _ hnpos hH hA rfl hbu have hgrid : 1 ≤ J ∧ 0 < H/J ∧ (H/J)^(alpha+beta) ≤ H^gamma ∧ ((n:ℝ)*((n:ℝ)+m)*H^d*(H/J)^d)^(-(1/2:ℝ)) ≤ c2*H^gamma := by by_cases hSG : alpha+beta < gamma · have ht : 1 ≤ gamma/(alpha+beta) := (le_div_iff₀ hS).mpr (by linarith) have hJdef : J = ceil (H^(-(gamma/(alpha+beta)-1))) := by dsimp [J, jStar] rw [max_eq_right (by linarith : 0 ≤ gamma/(alpha+beta)-1)] obtain ⟨hJ, hd, hlo, hhi⟩ := ceil_grid_side_bounds H (gamma/(alpha+beta)) hH hH1 ht rw [← hJdef] at hJ hd hlo hhi have hbias := Real.rpow_le_rpow hd.le hhi hS.le rw [← Real.rpow_mul hH.le, div_mul_cancel₀ _ hS.ne'] at hbias have hp := grid_pair_sampling_le _ H (H/J) (gamma/(alpha+beta)) d hx hH hd hlo have hbal := bandwidth_monomial_balance _ H D ((d:ℝ)+(d:ℝ)*(gamma/(alpha+beta))) gamma hx hH hD (by dsimp [D, bigDelta]; ring) hbw have hc : (2:ℝ)^((d:ℝ)/2)*(2:ℝ)^(D/2) ≤ c2 := by dsimp [c2]; exact le_add_of_nonneg_right (by positivity) refine ⟨hJ, hd, hbias, ?_⟩ calc _ ≤ (2:ℝ)^((d:ℝ)/2)*((2:ℝ)^(D/2)*H^gamma) := hp.trans (mul_le_mul_of_nonneg_left hbal (by positivity)) _ ≤ c2*H^gamma := by nlinarith [Real.rpow_pos_of_pos hH gamma] · have ht : gamma/(alpha+beta) ≤ 1 := (div_le_iff₀ hS).mpr (by linarith) have hJdef : J = 1 := by dsimp [J, jStar] rw [max_eq_left (by linarith : gamma/(alpha+beta)-1 ≤ 0)] norm_num rw [hJdef] simp only [Nat.cast_one, div_one] have hbias := Real.rpow_le_rpow_of_exponent_ge hH hH1 (le_of_not_gt hSG) have hb2 : ((n:ℝ)^2)^(-(1/(2*A))) ≤ 2*H := by rw [← Real.rpow_natCast, ← Real.rpow_mul hnpos.le] norm_num only [Nat.cast_ofNat] have he : (2:ℝ)*(-(1/(2*A))) = -(1/A) := by field_simp rw [he] exact hbu have hbal := bandwidth_monomial_balance ((n:ℝ)^2) H (2*A) (2*(d:ℝ)) (2*gamma) (by positivity) hH (by positivity) (by dsimp [A]; ring) hb2 have hcompare : ((n:ℝ)*((n:ℝ)+m)*H^d*H^d)^(-(1/2:ℝ)) ≤ ((n:ℝ)^2*H^(2*(d:ℝ)))^(-(1/2:ℝ)) := by apply Real.rpow_le_rpow_of_nonpos (by positivity) ?_ (by norm_num) rw [show 2*(d:ℝ) = (d:ℝ)+(d:ℝ) by ring, Real.rpow_add hH, Real.rpow_natCast] nlinarith [sq_nonneg (H^d), mul_nonneg (by positivity : (0:ℝ) ≤ n) (Nat.cast_nonneg m : (0:ℝ) ≤ m)] have hpow : H^(2*gamma) ≤ H^gamma := Real.rpow_le_rpow_of_exponent_ge hH hH1 (by linarith) have hc : (2:ℝ)^A ≤ c2 := by dsimp [c2]; exact le_add_of_nonneg_left (by positivity) refine ⟨by omega, hH, hbias, ?_⟩ calc _ ≤ (2:ℝ)^A*H^(2*gamma) := by convert hcompare.trans hbal using 1 <;> congr 2 <;> ring _ ≤ c2*H^gamma := mul_le_mul hc hpow (by positivity) (by positivity) rcases hgrid with ⟨hJ, hd, hbias, hpair⟩ refine ⟨hH, hHhalf, hJ, ?_⟩ calc _ ≤ (2+c1+c2)*H^gamma := by change H^gamma+(H/J)^(alpha+beta)+((n:ℝ)*H^d)^(-(1/2:ℝ))+((n:ℝ)*((n:ℝ)+m)*H^d*(H/J)^d)^(-(1/2:ℝ)) ≤ _; nlinarith _ ≤ (2+c1+c2)*upperRate d alpha beta gamma n m := mul_le_mul_of_nonneg_left hrate (by dsimp [c1, c2]; positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tuning_balance · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/TuningBalance.lean:79
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.UpperAssembly 26 declarations Two-channel point-CATE annotation frontier: Helpers/UpperAssembly constructions and obligations.

Helpers/UpperAssembly

Two-channel point-CATE annotation frontier: Helpers/UpperAssembly constructions and obligations.

Population bias assembly from the causal outcome identities and projection bounds. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the population bias bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
∃ theta : PolyIdx d → ℝ,
x ∈ locCube d h :
pv h theta x = taylorPoly (tau P hP) (ceil gamma-1) x
sqrt (∑ u, (rBar P n m h J u-((qPop P n m h J).mulVec theta) u)^2)
≤ C*(h^gamma+(h/J)^(alpha+beta))
Proof (Lean source)
lemma population_bias_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∃ theta : PolyIdx d → ℝ, (∀ x ∈ locCube d h, pv h theta x = taylorPoly (tau P hP) (ceil gamma-1) x) ∧ sqrt (∑ u, (rBar P n m h J u-((qPop P n m h J).mulVec theta) u)^2) ≤ C*(h^gamma+(h/J)^(alpha+beta)) := by obtain ⟨C, hC, hlocal⟩ := local_polynomial_projection_facts d alpha beta gamma L eps hdom let D := sqrt (card (PolyIdx d)) * (C^2+2*C) have hcard : 0 < card (PolyIdx d) := by have : Nonempty (PolyIdx d) := ⟨⟨fun _ => 0, by simp⟩⟩ exact Fintype.card_pos have hD : 0 < D := mul_pos (Real.sqrt_pos.mpr (by exact_mod_cast hcard)) (by nlinarith [sq_nonneg C]) refine ⟨D, hD, ?_⟩ intro P hP n m h J hn hh hh' hJ obtain ⟨⟨theta, herr, htheta, hcenter, htaylor⟩, hcoarse, hrow, htrace, he, hmu⟩ := hlocal P hP h J hh hh' hJ refine ⟨theta, htaylor, ?_⟩ have hB : 0 ≤ (C^2+2*C)*(h^gamma+(h/J)^(alpha+beta)) := by positivity have hb := population_finite_norm_bound (fun u => rBar P n m h J u - ((qPop P n m h J).mulVec theta) u) _ hB (population_bias_coordinate_bound P hP n m hn h hh hh' J hJ theta C hC herr he hmu) calc _ ≤ sqrt (card (PolyIdx d)) * ((C^2+2*C)*(h^gamma+(h/J)^(alpha+beta))) := hb _ = D*(h^gamma+(h/J)^(alpha+beta)) := by dsimp [D]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.population_bias_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:27
theorem unit_quadratic_bddBelow Lemma unit_quadratic_bddBelow in the paper ↗

Unit quadratic forms are bounded below by the sum of absolute matrix entries. Given the specified input d, the specified input Q, the unit quadratic bdd below conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
BddBelow {c : ℝ | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u * (Q.mulVec v) u}
Proof (Lean source)
lemma unit_quadratic_bddBelow {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) : BddBelow {c : ℝ | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u * (Q.mulVec v) u} := by refine ⟨-(∑ u, ∑ w, |Q u w|), ?_⟩ rintro c ⟨v, hv, rfl⟩ have hcoord : ∀ u, |v u| ≤ 1 := by intro u have hu : v u ^ 2 ≤ ∑ w, v w ^ 2 := Finset.single_le_sum (fun w _ => sq_nonneg (v w)) (Finset.mem_univ u) rw [hv] at hu have habs := sq_abs (v u) nlinarith [abs_nonneg (v u)] have hbound : |∑ u, v u * (Q.mulVec v) u| ≤ ∑ u, ∑ w, |Q u w| := by simp only [mulVec, dotProduct, Finset.mul_sum] calc |∑ u, ∑ w, v u * (Q u w * v w)| ≤ ∑ u, |∑ w, v u * (Q u w * v w)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ u, ∑ w, |v u * (Q u w * v w)| := by apply Finset.sum_le_sum intro u _ exact Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ u, ∑ w, |Q u w| := by apply Finset.sum_le_sum intro u _ apply Finset.sum_le_sum intro w _ rw [abs_mul, abs_mul] calc |v u| * (|Q u w| * |v w|) ≤ 1 * (|Q u w| * 1) := mul_le_mul (hcoord u) (mul_le_mul_of_nonneg_left (hcoord w) (abs_nonneg _)) (mul_nonneg (abs_nonneg _) (abs_nonneg _)) zero_le_one _ = |Q u w| := by ring exact (abs_le.mp hbound).1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.unit_quadratic_bddBelow · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:56
theorem lambdaMin_le_unit_quadratic Lemma lambdaMin_le_unit_quadratic in the paper ↗

The Rayleigh infimum is at most every unit-vector quadratic form. Given the specified input d, the specified input Q, the specified input v, the specified input hv, the lambda min le unit quadratic conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
v :
PolyIdx d → ℝ
hv :
(∑ u, v u^2) = 1
lambdaMin Q ≤ ∑ u, v u * (Q.mulVec v) u
Proof (Lean source)
lemma lambdaMin_le_unit_quadratic {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (v : PolyIdx d → ℝ) (hv : (∑ u, v u^2) = 1) : lambdaMin Q ≤ ∑ u, v u * (Q.mulVec v) u := by exact csInf_le (unit_quadratic_bddBelow Q) ⟨v, hv, rfl⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.lambdaMin_le_unit_quadratic · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:92

the measurable bit conclusion holds.

Formal statement
Proof (Lean source)
@[fun_prop] lemma measurable_bit : Measurable bit := by fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_bit · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:98
theorem measurable_treatmentRecords Lemma measurable_treatmentRecords in the paper ↗

Given the specified input d, the specified input n, the specified input m, the measurable treatment records conclusion holds.

Formal statement
d n m :
ℕ
i :
Fin (n+m)
Measurable (fun D : Dataset d n m => treatmentRecords D i)
Proof (Lean source)
@[fun_prop] lemma measurable_treatmentRecords (d n m : ℕ) (i : Fin (n+m)) : Measurable (fun D : Dataset d n m => treatmentRecords D i) := by unfold treatmentRecords refine Fin.addCases ?_ ?_ i · intro j simp only [Fin.addCases_left] fun_prop · intro j simp only [Fin.addCases_right] fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_treatmentRecords · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:102

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the measurable eta hat conclusion holds.

Formal statement
d n m :
ℕ
h :
ℝ
J :
ℕ
Measurable (fun p : Dataset d n m × Cov d => etaHat p.1 h J p.2)
Proof (Lean source)
@[fun_prop] lemma measurable_etaHat (d n m : ℕ) (h : ℝ) (J : ℕ) : Measurable (fun p : Dataset d n m × Cov d => etaHat p.1 h J p.2) := by unfold etaHat apply Measurable.ite ((isClosed_locCube d h).measurableSet.preimage measurable_snd) · fun_prop · fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_etaHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:114

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the specified input u, the measurable r hat conclusion holds.

Formal statement
d n m :
ℕ
h :
ℝ
J :
ℕ
u :
Measurable (fun D : Dataset d n m => rHat D h J u)
Proof (Lean source)
@[fun_prop] lemma measurable_rHat (d n m : ℕ) (h : ℝ) (J : ℕ) (u : PolyIdx d) : Measurable (fun D : Dataset d n m => rHat D h J u) := by unfold rHat fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_rHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:122

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the specified input u, the specified input v, the measurable q hat conclusion holds.

Formal statement
d n m :
ℕ
h :
ℝ
J :
ℕ
u v :
Measurable (fun D : Dataset d n m => qHat D h J u v)
Proof (Lean source)
@[fun_prop] lemma measurable_qHat (d n m : ℕ) (h : ℝ) (J : ℕ) (u v : PolyIdx d) : Measurable (fun D : Dataset d n m => qHat D h J u v) := by unfold qHat qRaw fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_qHat · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:128

The guard is the intersection of closed inequalities over all unit vectors. Given the specified input d, the specified input a, the is closed lambda min ge conclusion holds.

Formal statement
d :
ℕ
a :
ℝ
IsClosed {Q : PolyIdx d → PolyIdx d → ℝ | a ≤ lambdaMin Q}
Proof (Lean source)
lemma isClosed_lambdaMin_ge (d : ℕ) (a : ℝ) : IsClosed {Q : PolyIdx d → PolyIdx d → ℝ | a ≤ lambdaMin Q} := by have hne (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) : Nonempty {c : ℝ | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u * (mulVec Q v) u} := by let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ let v : PolyIdx d → ℝ := single z 1 refine ⟨_, v, ?_, rfl⟩ simp [v, Pi.single_apply] have heq : {Q : PolyIdx d → PolyIdx d → ℝ | a ≤ lambdaMin Q} = ⋂ (v : PolyIdx d → ℝ) (_ : (∑ u, v u^2) = 1), {Q : PolyIdx d → PolyIdx d → ℝ | a ≤ ∑ u, v u * (mulVec Q v) u} := by ext Q simp only [mem_setOf_eq, mem_iInter] constructor · intro ha v hv exact ha.trans (lambdaMin_le_unit_quadratic Q v hv) · intro ha apply le_csInf (hne Q) rintro c ⟨v, hv, rfl⟩ exact ha v hv rw [heq] apply isClosed_iInter intro v apply isClosed_iInter intro hv apply isClosed_le continuous_const simp only [mulVec, dotProduct] fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.isClosed_lambdaMin_ge · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:134

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the overlap level eps, the measurable t hat total conclusion holds.

Formal statement
d n m :
ℕ
eps h :
ℝ
J :
ℕ
Measurable (fun D : Dataset d n m => tHat eps h J D)
Proof (Lean source)
@[fun_prop] lemma measurable_tHat_total (d n m : ℕ) (eps h : ℝ) (J : ℕ) : Measurable (fun D : Dataset d n m => tHat eps h J D) := by have hQ : Measurable (fun D : Dataset d n m => fun u v => qHat D h J u v) := by exact measurable_pi_lambda _ (fun u => measurable_pi_lambda _ (fun v => measurable_qHat d n m h J u v)) have hguard : MeasurableSet {D : Dataset d n m | gramGuard eps ≤ lambdaMin (qHat D h J)} := (isClosed_lambdaMin_ge d (gramGuard eps)).measurableSet.preimage hQ unfold tHat apply Measurable.ite hguard · unfold clip mulVec dotProduct fun_prop · fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_tHat_total · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:165

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the specified input hn, the specified input hh, the specified input hh', the specified input hJ, the overlap level eps, the t hat measurable conclusion holds.

Formal statement
d n m :
ℕ
eps h :
ℝ
J :
ℕ
hn :
2 ≤ n
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
Measurable (fun w : Sample d n m => tHat eps h J w.1)
Proof (Lean source)
@[fun_prop] lemma tHat_measurable (d n m : ℕ) (eps h : ℝ) (J : ℕ) (hn : 2 ≤ n) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) : Measurable (fun w : Sample d n m => tHat eps h J w.1) := by exact (measurable_tHat_total d n m eps h J).comp measurable_fst
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat_measurable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:178
theorem sharpDecision_measurable Lemma sharpDecision_measurable in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input m, the specified input hn, the sharp decision measurable conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n m :
ℕ
hn :
2 ≤ n
Measurable (sharpDecision d alpha beta gamma eps n m)
Proof (Lean source)
@[fun_prop] lemma sharpDecision_measurable (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n m : ℕ) (hn : 2 ≤ n) : Measurable (sharpDecision d alpha beta gamma eps n m) := by exact (measurable_tHat_total d n m eps _ _).comp measurable_fst
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpDecision_measurable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:184
theorem isUnit_of_lambdaMin_pos Lemma isUnit_of_lambdaMin_pos in the paper ↗

A positive Rayleigh infimum excludes a nonzero kernel and makes the matrix invertible. Given the specified input d, the specified input Q, the specified input hmin, the is unit of lambda min pos conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
hmin :
0 < lambdaMin Q
Proof (Lean source)
lemma isUnit_of_lambdaMin_pos {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (hmin : 0 < lambdaMin Q) : IsUnit Q := by have hkernel : ∀ v : PolyIdx d → ℝ, Q.mulVec v = 0 → v = 0 := by intro v hv by_contra hne have hs : 0 < ∑ u, v u ^ 2 := by have hex : ∃ u, v u ≠ 0 := by by_contra h apply hne ext u simpa using (not_exists.mp h u) obtain ⟨u, hu⟩ := hex exact lt_of_lt_of_le (sq_pos_of_ne_zero hu) (Finset.single_le_sum (fun w _ => sq_nonneg (v w)) (Finset.mem_univ u)) let w : PolyIdx d → ℝ := (sqrt (∑ u, v u ^ 2))⁻¹ • v have hwunit : (∑ u, w u ^ 2) = 1 := by simp only [w, Pi.smul_apply, smul_eq_mul, mul_pow, ← Finset.mul_sum, inv_pow] rw [Real.sq_sqrt hs.le] exact inv_mul_cancel₀ hs.ne' have hwzero : Q.mulVec w = 0 := by dsimp only [w] rw [Matrix.mulVec_smul, hv, smul_zero] have hle := lambdaMin_le_unit_quadratic Q w hwunit rw [hwzero] at hle simp only [Pi.zero_apply, mul_zero, Finset.sum_const_zero] at hle exact (not_le_of_gt hmin) hle apply Matrix.mulVec_injective_iff_isUnit.mp intro v w hvw have hk : Q.mulVec (v-w) = 0 := by rw [Matrix.mulVec_sub, hvw, sub_self] exact sub_eq_zero.mp (hkernel (v-w) hk)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.isUnit_of_lambdaMin_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:190

Given the specified input d, the specified input Q, the specified input hQ, the specified input hmin, the specified input R, the specified input theta, the good branch resolvent conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
hQ :
Q.transpose = Q
g :
ℝ
hg :
0 < g
hmin :
g ≤ lambdaMin Q
R theta :
PolyIdx d → ℝ
Q⁻¹.mulVec R-theta = Q⁻¹.mulVec (R-Q.mulVec theta)
Proof (Lean source)
lemma good_branch_resolvent {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (hQ : Q.transpose = Q) (g : ℝ) (hg : 0 < g) (hmin : g ≤ lambdaMin Q) (R theta : PolyIdx d → ℝ) : Q⁻¹.mulVec R-theta = Q⁻¹.mulVec (R-Q.mulVec theta) := by have hunit : IsUnit Q := isUnit_of_lambdaMin_pos Q (by linarith) have hinv : Q⁻¹.mulVec (Q.mulVec theta) = theta := by rw [Matrix.mulVec_mulVec, Matrix.nonsing_inv_mul Q ((Matrix.isUnit_iff_isUnit_det Q).mp hunit), Matrix.one_mulVec] rw [Matrix.mulVec_sub, hinv]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.good_branch_resolvent · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:223

Given the specified input x, the specified input y, the specified input hy, the clipping contraction conclusion holds.

Formal statement
x y :
ℝ
hy :
y ∈ Icc (-1) 1
|clip x-y| ≤ |x-y|
Proof (Lean source)
lemma clipping_contraction (x y : ℝ) (hy : y ∈ Icc (-1) 1) : |clip x-y| ≤ |x-y| := by rcases hy with ⟨hyl, hyu⟩ by_cases hxl : x ≤ -1 · have hxu : x ≤ 1 := by linarith rw [clip, min_eq_right hxu, max_eq_left hxl, abs_of_nonpos (by linarith : -1-y ≤ 0), abs_of_nonpos (by linarith : x-y ≤ 0)] linarith · by_cases hxu : 1 ≤ x · rw [clip, min_eq_left hxu, max_eq_right (by norm_num : (-1:ℝ) ≤ 1), abs_of_nonneg (by linarith : 1-y ≥ 0), abs_of_nonneg (by linarith : x-y ≥ 0)] linarith · rw [clip, min_eq_right (le_of_not_ge hxu), max_eq_right (le_of_not_ge hxl)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.clipping_contraction · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:233

Localization boxes are compact, including degenerate parameter values. Given the specified input d, the specified input h, the is compact loc cube conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
Proof (Lean source)
lemma isCompact_locCube (d : ℕ) (h : ℝ) : IsCompact (locCube d h) := by have heq : locCube d h = ((PiLp.homeomorph 2 (fun _ : Fin d => ℝ)) ⁻¹' pi univ (fun _ => Icc (1/2-h/2) (1/2+h/2))) := by ext x simp only [locCube, mem_setOf_eq, mem_preimage, mem_pi, mem_univ, forall_const] rfl rw [heq] exact (Homeomorph.isCompact_preimage _).2 (isCompact_univ_pi fun _ => isCompact_Icc)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.isCompact_locCube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:250
theorem compact_supported_memLp_top Lemma compact_supported_memLp_top in the paper ↗

A measurable function supported on a localization box and dominated there by a continuous function is essentially bounded after any measurable covariate map. Given the specified input d, the specified input h, the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input hbound, the specified input hsupp, the specified input X, the specified input hX, the compact supported mem lp top conclusion holds.

Formal statement
Ω :
μ :
d :
ℕ
h :
ℝ
f g :
Cov d → ℝ
hf :
hg :
hbound :
∀ x ∈ locCube d h, |f x| ≤ |g x|
hsupp :
∀ x
if
x ∉ locCube d h
then
f x = 0
X :
Ω → Cov d
hX :
MemLp (fun w => f (X w)) ∞ μ
Proof (Lean source)
lemma compact_supported_memLp_top {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (d : ℕ) (h : ℝ) (f g : Cov d → ℝ) (hf : Measurable f) (hg : Continuous g) (hbound : ∀ x ∈ locCube d h, |f x| ≤ |g x|) (hsupp : ∀ x, x ∉ locCube d h → f x = 0) (X : Ω → Cov d) (hX : Measurable X) : MemLp (fun w => f (X w)) ∞ μ := by obtain ⟨C, hC⟩ := (isCompact_locCube d h).exists_bound_of_continuousOn hg.continuousOn apply memLp_top_of_bound (hf.comp hX).aestronglyMeasurable (max C 0) filter_upwards [] with w change |f (X w)| ≤ max C 0 by_cases hx : X w ∈ locCube d h · exact (hbound _ hx).trans ((hC _ hx).trans (le_max_left _ _)) · rw [hsupp _ hx, abs_zero] exact le_max_right _ _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.compact_supported_memLp_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:260
theorem weighted_coarse_memLp_top Lemma weighted_coarse_memLp_top in the paper ↗

Localized finite products of coarse polynomial entries are essentially bounded on any sample space. Given the specified input d, the specified input h, the specified input us, the specified input X, the specified input hX, the weighted coarse mem lp top conclusion holds.

Formal statement
Ω :
μ :
d :
ℕ
h :
ℝ
us :
X :
Ω → Cov d
hX :
MemLp (fun w => locWeight h (X w) * ∏ u ∈ us, coarseBasis h (X w) u) ∞ μ
Proof (Lean source)
lemma weighted_coarse_memLp_top {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (d : ℕ) (h : ℝ) (us : Finset (PolyIdx d)) (X : Ω → Cov d) (hX : Measurable X) : MemLp (fun w => locWeight h (X w) * ∏ u ∈ us, coarseBasis h (X w) u) ∞ μ := by apply compact_supported_memLp_top μ d h (fun x => locWeight h x * ∏ u ∈ us, coarseBasis h x u) (fun x => h^(-(d:ℝ)) * ∏ u ∈ us, coarseBasis h x u) ?_ ?_ ?_ ?_ X hX · fun_prop · unfold coarseBasis fun_prop · intro x hx simp only [locWeight, if_pos hx, le_refl] · intro x hx simp [locWeight, hx]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.weighted_coarse_memLp_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:276
theorem fineBasis_memLp_top_comp Lemma fineBasis_memLp_top_comp in the paper ↗

Each cellwise basis entry is essentially bounded after a measurable covariate map. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the specified input X, the specified input hX, the fine basis mem lp top comp conclusion holds.

Formal statement
Ω :
μ :
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z :
X :
Ω → Cov d
hX :
MemLp (fun w => fineBasis h J (X w) z) ∞ μ
Proof (Lean source)
lemma fineBasis_memLp_top_comp {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z : FineIdx d J) (X : Ω → Cov d) (hX : Measurable X) : MemLp (fun w => fineBasis h J (X w) z) ∞ μ := by apply compact_supported_memLp_top μ d h (fun x => fineBasis h J x z) (fun x => sqrt ((J:ℝ)^d) * ∏ i, legendre (z.2.1 i) ((x i-(1/2-h/2+((z.1 i:ℝ)+1/2)*(h/J)))/(h/J))) ?_ ?_ ?_ ?_ X hX · fun_prop · fun_prop · intro x hx unfold fineBasis split_ifs · exact le_refl _ · simpa only [abs_zero] using (abs_nonneg (sqrt ((J:ℝ)^d) * ∏ i, legendre (z.2.1 i) ((x i-(1/2-h/2+((z.1 i:ℝ)+1/2)*(h/J)))/(h/J)))) · intro x hx exact if_neg (fun hc => hx (cell_subset_locCube h J hh hJ z.1 hc))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineBasis_memLp_top_comp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:291

Each empirical Gram entry is essentially bounded at every fixed admissible resolution. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input u, the specified input v, the q hat mem lp top conclusion holds.

Formal statement
d n m :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
μ :
Measure (Sample d n m)
u v :
MemLp (fun w => qHat w.1 h J u v) ∞ μ
Proof (Lean source)
lemma qHat_memLp_top (d n m : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (μ : Measure (Sample d n m)) (u v : PolyIdx d) : MemLp (fun w => qHat w.1 h J u v) ∞ μ := by have hw (X : Sample d n m → Cov d) (hX : Measurable X) (u : PolyIdx d) : MemLp (fun w => locWeight h (X w) * coarseBasis h (X w) u) ∞ μ := by simpa using weighted_coarse_memLp_top μ d h {u} X hX have hw2 (X : Sample d n m → Cov d) (hX : Measurable X) (u v : PolyIdx d) : MemLp (fun w => locWeight h (X w) * coarseBasis h (X w) u * coarseBasis h (X w) v) ∞ μ := by apply compact_supported_memLp_top μ d h (fun x => locWeight h x * coarseBasis h x u * coarseBasis h x v) (fun x => h^(-(d:ℝ)) * coarseBasis h x u * coarseBasis h x v) ?_ ?_ ?_ ?_ X hX · fun_prop · unfold coarseBasis; fun_prop · intro x hx; simp only [locWeight, if_pos hx, le_refl] · intro x hx; simp [locWeight, hx] have hb (A : Sample d n m → Bool) (hA : Measurable A) : MemLp (fun w => bit (A w)) ∞ μ := by apply memLp_top_of_bound (by fun_prop) 1 filter_upwards [] with w cases A w <;> norm_num [bit] have hk (X Y : Sample d n m → Cov d) (hX : Measurable X) (hY : Measurable Y) : MemLp (fun w => fineKernel d h J (X w) (Y w)) ∞ μ := by exact memLp_finsetSum _ (fun z _ => (fineBasis_memLp_top_comp μ d h J hh hJ z Y hY).mul' (fineBasis_memLp_top_comp μ d h J hh hJ z X hX)) have hraw (u v : PolyIdx d) : MemLp (fun w => qRaw w.1 h J u v) ∞ μ := by unfold qRaw apply MemLp.sub · apply MemLp.const_mul apply memLp_finsetSum intro j hj exact (hb (fun w => (w.1.1 j).2.1) (by fun_prop)).mul' (hw2 (fun w => (w.1.1 j).1) (by fun_prop) u v) · apply MemLp.const_mul apply memLp_finsetSum intro i hi apply memLp_finsetSum intro j hj have hiX : Measurable (fun w : Sample d n m => (treatmentRecords w.1 i).1) := by fun_prop have hiA : Measurable (fun w : Sample d n m => (treatmentRecords w.1 i).2) := by fun_prop convert (((hw _ hiX u).mul (r := ∞) (hw (fun w => (w.1.1 j).1) (by fun_prop) v)).mul (r := ∞) (hb _ hiA)).mul (r := ∞) (hb (fun w => (w.1.1 j).2.1) (by fun_prop)) |>.mul (r := ∞) (hk _ _ hiX (show Measurable (fun w : Sample d n m => (w.1.1 j).1) by fun_prop)) using 1 ext w simp only [Pi.mul_apply] ring simpa only [qHat, div_eq_mul_inv, Pi.add_apply] using ((hraw u v).add (hraw v u)).mul_const (2:ℝ)⁻¹
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qHat_memLp_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:310

The original-record experiment, including its independent randomizer, is a probability law. Given the specified input d, the specified input n, the specified input m, the specified input P, the experiment probability conclusion holds.

Formal statement
d n m :
ℕ
P :
Proof (Lean source)
lemma experiment_probability (d n m : ℕ) (P : PrimitiveLaw d) : IsProbabilityMeasure (experiment P n m) := by have ho : Measurable (observed (d:=d)) := by unfold observed apply prodMk (by fun_prop) apply prodMk (by fun_prop) exact Measurable.ite ((measurableSet_singleton true).preimage (by fun_prop)) (by fun_prop) (by fun_prop) letI : IsProbabilityMeasure (obsLaw P) := by unfold obsLaw exact Measure.isProbabilityMeasure_map ho.aemeasurable letI : IsProbabilityMeasure (xaLaw P) := by unfold xaLaw exact Measure.isProbabilityMeasure_map (show Measurable (fun w : FullRecord d => (w.1,w.2.1)) by fun_prop).aemeasurable letI : IsProbabilityMeasure (volume.restrict (Icc (0:ℝ) 1)) := ⟨by simp⟩ unfold experiment infer_instance
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:359
theorem qHat_square_deviation_integrable Lemma qHat_square_deviation_integrable in the paper ↗

The squared Frobenius deviation of the empirical Gram matrix is integrable, as a finite sum of bounded measurable terms. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input h, the specified input J, the specified input hh, the specified input hJ, the q hat square deviation integrable conclusion holds.

Formal statement
d n m :
ℕ
P :
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
Integrable (fun w : Sample d n m => ∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2) (experiment P n m)
Proof (Lean source)
lemma qHat_square_deviation_integrable (d n m : ℕ) (P : PrimitiveLaw d) (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) : Integrable (fun w : Sample d n m => ∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2) (experiment P n m) := by letI := experiment_probability d n m P apply integrable_finsetSum intro u hu apply integrable_finsetSum intro v hv have hq := qHat_memLp_top d n m h J hh hJ (experiment P n m) u v exact ((hq.sub (memLp_const _)).mono_exponent (show (2:ℝ≥0∞) ≤ ∞ from le_top)).integrable_sq
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.qHat_square_deviation_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:378
theorem unit_quadratic_nonempty Lemma unit_quadratic_nonempty in the paper ↗

A constant-polynomial coordinate supplies a unit vector for the Rayleigh infimum. Given the specified input d, the specified input Q, the unit quadratic nonempty conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
Nonempty {c : ℝ | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u*(Q.mulVec v) u}
Proof (Lean source)
lemma unit_quadratic_nonempty {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) : Nonempty {c : ℝ | ∃ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 ∧ c = ∑ u, v u*(Q.mulVec v) u} := by let z : PolyIdx d := ⟨fun _ => 0, by simp⟩ let v : PolyIdx d → ℝ := single z 1 refine ⟨_, v, ?_, rfl⟩ simp [v, Pi.single_apply]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.unit_quadratic_nonempty · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:391
theorem quadratic_sq_le_frobenius_sq Lemma quadratic_sq_le_frobenius_sq in the paper ↗

Finite Cauchy–Schwarz bounds the squared quadratic form of a unit vector by the squared Frobenius norm. Given the specified input E, the specified input v, the specified input hv, the quadratic sq le frobenius sq conclusion holds.

Formal statement
ι :
Type*
E :
Matrix ι ι ℝ
v :
ι → ℝ
hv :
(∑ u, v u^2) = 1
(∑ u, v u*(E.mulVec v) u)^2 ≤ ∑ u, ∑ w, (E u w)^2
Proof (Lean source)
lemma quadratic_sq_le_frobenius_sq {ι : Type*} [Fintype ι] (E : Matrix ι ι ℝ) (v : ι → ℝ) (hv : (∑ u, v u^2) = 1) : (∑ u, v u*(E.mulVec v) u)^2 ≤ ∑ u, ∑ w, (E u w)^2 := by have hc := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (ι × ι)) (fun uw => E uw.1 uw.2) (fun uw => v uw.1 * v uw.2) have hn : (∑ uw : ι × ι, (v uw.1 * v uw.2)^2) = 1 := by simp only [Fintype.sum_prod_type, mul_pow, ← Finset.mul_sum, ← Finset.sum_mul, hv, mul_one] rw [hn, mul_one] at hc convert hc using 1 · rfl · congr 1 simp only [Fintype.sum_prod_type, mulVec, dotProduct, Finset.mul_sum] apply Finset.sum_congr rfl intro u hu apply Finset.sum_congr rfl intro w hw ring · simp only [Fintype.sum_prod_type]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.quadratic_sq_le_frobenius_sq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:400
theorem gram_cutoff_sq_deviation Lemma gram_cutoff_sq_deviation in the paper ↗

Failure of the empirical Rayleigh guard forces a squared Frobenius deviation of at least the squared guard threshold. Given the specified input d, the specified input Q, the specified input B, the specified input hB, the specified input hcut, the gram cutoff sq deviation conclusion holds.

Formal statement
d :
ℕ
Q B :
Matrix (PolyIdx d) (PolyIdx d) ℝ
g :
ℝ
hg :
0 < g
hB :
∀ v : PolyIdx d → ℝ
if
(∑ u, v u^2) = 1
then
2*g ≤ ∑ u, v u*(B.mulVec v) u
hcut :
lambdaMin Q < g
g^2 ≤ ∑ u, ∑ v, (Q u v-B u v)^2
Proof (Lean source)
lemma gram_cutoff_sq_deviation {d : ℕ} (Q B : Matrix (PolyIdx d) (PolyIdx d) ℝ) (g : ℝ) (hg : 0 < g) (hB : ∀ v : PolyIdx d → ℝ, (∑ u, v u^2) = 1 → 2*g ≤ ∑ u, v u*(B.mulVec v) u) (hcut : lambdaMin Q < g) : g^2 ≤ ∑ u, ∑ v, (Q u v-B u v)^2 := by by_contra hnot have hs : (∑ u, ∑ v, (Q u v-B u v)^2) < g^2 := lt_of_not_ge hnot have hmin : g ≤ lambdaMin Q := by apply le_csInf (unit_quadratic_nonempty Q) rintro c ⟨v, hv, rfl⟩ have hpop := hB v hv have hc := (quadratic_sq_le_frobenius_sq (Q-B) v hv).trans_lt hs have he : (∑ u, v u*((Q-B).mulVec v) u) = (∑ u, v u*(Q.mulVec v) u) - (∑ u, v u*(B.mulVec v) u) := by simp only [Matrix.sub_mulVec, Pi.sub_apply, mul_sub, Finset.sum_sub_distrib] rw [he] at hc nlinarith exact (not_lt_of_ge hmin) hcut
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gram_cutoff_sq_deviation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:420
theorem gram_cutoff_probability Lemma gram_cutoff_probability in the paper ↗

Population positivity and the rectangular second-moment bound control the probability that the empirical Gram guard fails. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the gram cutoff probability conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
experiment P n m {w | lambdaMin (qHat w.1 h J) < gramGuard eps}
≤ ofReal (C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))))
Proof (Lean source)
lemma gram_cutoff_probability (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), ∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → experiment P n m {w | lambdaMin (qHat w.1 h J) < gramGuard eps} ≤ ofReal (C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))) := by obtain ⟨C, hC, hsampling⟩ := rectangular_sampling_bound d alpha beta gamma L eps hdom have hg : 0 < gramGuard eps := hdom.gramGuard_pos refine ⟨C / (gramGuard eps)^2, by positivity, ?_⟩ intro P hP n m h J hn hh hh' hJ letI := experiment_probability d n m P let f : Sample d n m → ℝ := fun w => ∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2 have hf : Integrable f (experiment P n m) := qHat_square_deviation_integrable d n m P h J hh hJ have hf0 : ∀ w, 0 ≤ f w := fun w => Finset.sum_nonneg fun u _ => Finset.sum_nonneg fun v _ => sq_nonneg _ have hsub : {w : Sample d n m | lambdaMin (qHat w.1 h J) < gramGuard eps} ⊆ {w | (gramGuard eps)^2 ≤ f w} := by intro w hw apply gram_cutoff_sq_deviation _ _ _ hg _ hw intro v hv have hb := (population_positivity d alpha beta gamma L eps hdom P hP n m hn h hh hh' J hJ v).2 have h2 : 2*gramGuard eps = eps*(1-eps) := by unfold gramGuard; ring rw [h2] simpa only [hv, mul_one] using hb have hmarkov := mul_meas_ge_le_integral_of_nonneg (Filter.Eventually.of_forall hf0) hf ((gramGuard eps)^2) have hreal : (experiment P n m).real {w | lambdaMin (qHat w.1 h J) < gramGuard eps} ≤ (∫ w, f w ∂experiment P n m) / (gramGuard eps)^2 := by apply (le_div_iff₀ (by positivity : (0:ℝ) < (gramGuard eps)^2)).mpr calc _ ≤ (experiment P n m).real {w | (gramGuard eps)^2 ≤ f w} * (gramGuard eps)^2 := mul_le_mul_of_nonneg_right (measureReal_mono hsub) (by positivity) _ ≤ _ := by nlinarith [hmarkov] have hs := hsampling P hP n m h J hn hh hh' hJ have hvariance : (∫ w, f w ∂experiment P n m) ≤ C*(1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) := by have hr : 0 ≤ (∫ w : Sample d n m, ∑ u, (rHat w.1 h J u-rBar P n m h J u)^2 ∂experiment P n m) := integral_nonneg (fun w => Finset.sum_nonneg fun u _ => sq_nonneg _) dsimp only [f] linarith rw [← ENNReal.ofReal_toReal (measure_ne_top (experiment P n m) _)] apply ENNReal.ofReal_le_ofReal change (experiment P n m).real _ ≤ _ calc _ ≤ _ := hreal _ ≤ _ := div_le_div_of_nonneg_right hvariance (by positivity) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gram_cutoff_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperAssembly.lean:442
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.UpperRiskGeometry 8 declarations Rayleigh coercivity, inverse stability, and pointwise clipped-error bounds used in the fixed-tuning risk assembly.

# Geometry of the guarded rectangular estimator Rayleigh coercivity, inverse stability, and pointwise clipped-error bounds used in the fixed-tuning risk assembly.

The unit-vector Rayleigh lower bound extends homogeneously to every vector. Given the specified input d, the specified input Q, the specified input a, the specified input ha, the specified input v, the rayleigh coercivity conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
a :
ℝ
ha :
a ≤ lambdaMin Q
v :
PolyIdx d → ℝ
a * (∑ u, v u^2) ≤ ∑ u, v u * (Q.mulVec v) u
Proof (Lean source)
lemma rayleigh_coercivity {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (a : ℝ) (ha : a ≤ lambdaMin Q) (v : PolyIdx d → ℝ) : a * (∑ u, v u^2) ≤ ∑ u, v u * (Q.mulVec v) u := by classical have hs0 : 0 ≤ ∑ u, v u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ by_cases hs : (∑ u, v u^2) = 0 · have hv : v = 0 := by ext u have hu := Finset.single_le_sum (fun w _ => sq_nonneg (v w)) (Finset.mem_univ u) rw [hs] at hu simpa using (sq_eq_zero_iff.mp (le_antisymm hu (sq_nonneg _))) simp [hv] · have hspos : 0 < ∑ u, v u^2 := lt_of_le_of_ne hs0 (Ne.symm hs) let s := sqrt (∑ u, v u^2) have hsp : 0 < s := Real.sqrt_pos.mpr hspos have hss : s^2 = ∑ u, v u^2 := Real.sq_sqrt hs0 let w : PolyIdx d → ℝ := s⁻¹ • v have hw : (∑ u, w u^2) = 1 := by simp only [w, Pi.smul_apply, smul_eq_mul, mul_pow, ← Finset.mul_sum, inv_pow] rw [hss] exact inv_mul_cancel₀ hs have hl := ha.trans (lambdaMin_le_unit_quadratic Q w hw) have he : (∑ u, w u*(Q.mulVec w) u) = s⁻¹^2 * (∑ u, v u*(Q.mulVec v) u) := by simp only [w, Matrix.mulVec_smul, Pi.smul_apply, smul_eq_mul] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro u _ ring rw [he] at hl have hm := mul_le_mul_of_nonneg_left hl (sq_nonneg s) have hc : s^2 * (s⁻¹^2 * (∑ u, v u*(Q.mulVec v) u)) = ∑ u, v u*(Q.mulVec v) u := by field_simp rw [hc, hss] at hm simpa only [mul_comm] using hm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rayleigh_coercivity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:18
theorem good_branch_inverse_sq_bound Lemma good_branch_inverse_sq_bound in the paper ↗

The guard bounds the squared Euclidean norm of the inverse image by the reciprocal squared threshold. Given the specified input d, the specified input Q, a guard threshold g, its positivity, the specified input hmin, the specified input R, the good branch inverse sq bound conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
g :
ℝ
hg :
0 < g
hmin :
g ≤ lambdaMin Q
R :
PolyIdx d → ℝ
(∑ u, (Q⁻¹.mulVec R u)^2) ≤ (g⁻¹)^2 * (∑ u, R u^2)
Proof (Lean source)
lemma good_branch_inverse_sq_bound {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (g : ℝ) (hg : 0 < g) (hmin : g ≤ lambdaMin Q) (R : PolyIdx d → ℝ) : (∑ u, (Q⁻¹.mulVec R u)^2) ≤ (g⁻¹)^2 * (∑ u, R u^2) := by classical let v := Q⁻¹.mulVec R have hunit : IsUnit Q := isUnit_of_lambdaMin_pos Q (by linarith) have hQR : Q.mulVec v = R := by dsimp [v] rw [Matrix.mulVec_mulVec, Matrix.mul_nonsing_inv Q ((Matrix.isUnit_iff_isUnit_det Q).mp hunit), Matrix.one_mulVec] have hl := rayleigh_coercivity Q g hmin v rw [hQR] at hl have hs : 0 ≤ ∑ u, v u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hr : 0 ≤ ∑ u, R u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hc := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset (PolyIdx d)) v R have hdot : 0 ≤ ∑ u, v u*R u := le_trans (by positivity) hl have hh : (g*(∑ u, v u^2))^2 ≤ (∑ u, v u*R u)^2 := pow_le_pow_left₀ (by positivity) hl 2 by_cases hz : (∑ u, v u^2) = 0 · change (∑ u, v u^2) ≤ _ rw [hz] positivity · have hp : 0 < ∑ u, v u^2 := lt_of_le_of_ne hs (Ne.symm hz) have hcancel : g^2*(∑ u, v u^2) ≤ ∑ u, R u^2 := by apply (mul_le_mul_iff_right₀ hp).mp nlinarith change (∑ u, v u^2) ≤ _ rw [inv_pow, ← div_eq_inv_mul, le_div_iff₀ (by positivity)] linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.good_branch_inverse_sq_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:54

Finite Cauchy–Schwarz in Euclidean square-root notation. Given the specified input v, the specified input w, the finite dot abs le conclusion holds.

Formal statement
ι :
Type*
v w :
ι → ℝ
|∑ u, v u*w u| ≤ sqrt (∑ u, v u^2) * sqrt (∑ u, w u^2)
Proof (Lean source)
lemma finite_dot_abs_le {ι : Type*} [Fintype ι] (v w : ι → ℝ) : |∑ u, v u*w u| ≤ sqrt (∑ u, v u^2) * sqrt (∑ u, w u^2) := by classical have hv : 0 ≤ ∑ u, v u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hw : 0 ≤ ∑ u, w u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hc := Finset.sum_mul_sq_le_sq_mul_sq (Finset.univ : Finset ι) v w have hvs := Real.sq_sqrt hv have hws := Real.sq_sqrt hw have ha := sq_abs (∑ u, v u*w u) nlinarith [Real.sqrt_nonneg (∑ u, v u^2), Real.sqrt_nonneg (∑ u, w u^2), mul_nonneg (Real.sqrt_nonneg (∑ u, v u^2)) (Real.sqrt_nonneg (∑ u, w u^2))]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_dot_abs_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:85
theorem good_branch_projected_error Lemma good_branch_projected_error in the paper ↗

On the good branch the projected inverse amplifies a residual by at most the reciprocal guard threshold. Given the specified input d, the specified input Q, the specified input hQ, the specified input hmin, the specified input R, the specified input theta, the specified input r, the good branch projected error conclusion holds.

Formal statement
d :
ℕ
Q :
Matrix (PolyIdx d) (PolyIdx d) ℝ
hQ :
Q.transpose = Q
g :
ℝ
hg :
0 < g
hmin :
g ≤ lambdaMin Q
R theta r :
PolyIdx d → ℝ
|∑ u, r u * (Q⁻¹.mulVec R u-theta u)|
≤ g⁻¹ * sqrt (∑ u, r u^2) * sqrt (∑ u, (R u-Q.mulVec theta u)^2)
Proof (Lean source)
lemma good_branch_projected_error {d : ℕ} (Q : Matrix (PolyIdx d) (PolyIdx d) ℝ) (hQ : Q.transpose = Q) (g : ℝ) (hg : 0 < g) (hmin : g ≤ lambdaMin Q) (R theta r : PolyIdx d → ℝ) : |∑ u, r u * (Q⁻¹.mulVec R u-theta u)| ≤ g⁻¹ * sqrt (∑ u, r u^2) * sqrt (∑ u, (R u-Q.mulVec theta u)^2) := by have he := good_branch_resolvent Q hQ g hg hmin R theta have hi := good_branch_inverse_sq_bound Q g hg hmin (R-Q.mulVec theta) have hs : sqrt (∑ u, (Q⁻¹.mulVec (R-Q.mulVec theta) u)^2) ≤ g⁻¹*sqrt (∑ u, (R u-Q.mulVec theta u)^2) := by apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ rw [mul_pow, Real.sq_sqrt (Finset.sum_nonneg fun _ _ => sq_nonneg _)] exact hi calc _ = |∑ u, r u * (Q⁻¹.mulVec (R-Q.mulVec theta)) u| := by congr 1 apply Finset.sum_congr rfl intro u _ rw [← he] rfl _ ≤ sqrt (∑ u, r u^2) * sqrt (∑ u, (Q⁻¹.mulVec (R-Q.mulVec theta) u)^2) := finite_dot_abs_le r _ _ ≤ _ := by have hm := mul_le_mul_of_nonneg_left hs (Real.sqrt_nonneg (∑ u, r u^2)) have hgi : 0 ≤ g⁻¹ := inv_nonneg.mpr hg.le nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.good_branch_projected_error · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:98

The Euclidean square-root norm satisfies the triangle inequality. Given the specified input v, the specified input w, the finite sqrt triangle conclusion holds.

Formal statement
ι :
Type*
v w :
ι → ℝ
sqrt (∑ u, (v u+w u)^2) ≤ sqrt (∑ u, v u^2) + sqrt (∑ u, w u^2)
Proof (Lean source)
lemma finite_sqrt_triangle {ι : Type*} [Fintype ι] (v w : ι → ℝ) : sqrt (∑ u, (v u+w u)^2) ≤ sqrt (∑ u, v u^2) + sqrt (∑ u, w u^2) := by classical have hv : 0 ≤ ∑ u, v u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hw : 0 ≤ ∑ u, w u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hc := (le_abs_self (∑ u, v u*w u)).trans (finite_dot_abs_le v w) have he : (∑ u, (v u+w u)^2) = (∑ u, v u^2) + 2*(∑ u, v u*w u) + (∑ u, w u^2) := by simp only [add_sq, Finset.sum_add_distrib, mul_assoc, ← Finset.mul_sum] apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ rw [he] nlinarith [Real.sq_sqrt hv, Real.sq_sqrt hw]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_sqrt_triangle · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:127
theorem finite_matrix_mulVec_sqrt_le Lemma finite_matrix_mulVec_sqrt_le in the paper ↗

The Frobenius norm bounds matrix action in the Euclidean norm. Given the specified input E, the specified input v, the finite matrix mul vec sqrt le conclusion holds.

Formal statement
ι :
Type*
E :
Matrix ι ι ℝ
v :
ι → ℝ
sqrt (∑ u, (E.mulVec v u)^2)
≤ sqrt (∑ u, ∑ w, (E u w)^2) * sqrt (∑ u, v u^2)
Proof (Lean source)
lemma finite_matrix_mulVec_sqrt_le {ι : Type*} [Fintype ι] (E : Matrix ι ι ℝ) (v : ι → ℝ) : sqrt (∑ u, (E.mulVec v u)^2) ≤ sqrt (∑ u, ∑ w, (E u w)^2) * sqrt (∑ u, v u^2) := by classical have he : 0 ≤ ∑ u, ∑ w, (E u w)^2 := Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => sq_nonneg _ have hv : 0 ≤ ∑ u, v u^2 := Finset.sum_nonneg fun _ _ => sq_nonneg _ have hc : (∑ u, (E.mulVec v u)^2) ≤ (∑ u, ∑ w, (E u w)^2)*(∑ u, v u^2) := by rw [Finset.sum_mul] apply Finset.sum_le_sum intro u _ exact Finset.sum_mul_sq_le_sq_mul_sq univ (E u) v apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ rw [mul_pow, Real.sq_sqrt he, Real.sq_sqrt hv] exact hc
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_matrix_mulVec_sqrt_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:143
theorem rectangular_residual_sqrt_le Lemma rectangular_residual_sqrt_le in the paper ↗

A sample residual decomposes into vector noise, population bias, and Gram noise. Given the specified input R, the specified input Rbar, the specified input theta, the specified input Q, the specified input Qbar, the rectangular residual sqrt le conclusion holds.

Formal statement
ι :
Type*
R Rbar theta :
ι → ℝ
Q Qbar :
Matrix ι ι ℝ
sqrt (∑ u, (R u-Q.mulVec theta u)^2)
≤ sqrt (∑ u, (R u-Rbar u)^2)
+ sqrt (∑ u, (Rbar u-Qbar.mulVec theta u)^2)
+ sqrt (∑ u, ∑ v, (Q u v-Qbar u v)^2) * sqrt (∑ u, theta u^2)
Proof (Lean source)
lemma rectangular_residual_sqrt_le {ι : Type*} [Fintype ι] (R Rbar theta : ι → ℝ) (Q Qbar : Matrix ι ι ℝ) : sqrt (∑ u, (R u-Q.mulVec theta u)^2) ≤ sqrt (∑ u, (R u-Rbar u)^2) + sqrt (∑ u, (Rbar u-Qbar.mulVec theta u)^2) + sqrt (∑ u, ∑ v, (Q u v-Qbar u v)^2) * sqrt (∑ u, theta u^2) := by have he : R-Q.mulVec theta = ((R-Rbar)+(Rbar-Qbar.mulVec theta)) + (Qbar-Q).mulVec theta := by ext u simp only [Matrix.sub_mulVec, Pi.add_apply, Pi.sub_apply] ring have h1 := finite_sqrt_triangle ((R-Rbar)+(Rbar-Qbar.mulVec theta)) ((Qbar-Q).mulVec theta) have h2 := finite_sqrt_triangle (R-Rbar) (Rbar-Qbar.mulVec theta) have h3 := finite_matrix_mulVec_sqrt_le (Qbar-Q) theta have hs : (∑ u, ∑ v, ((Qbar-Q) u v)^2) = (∑ u, ∑ v, (Q u v-Qbar u v)^2) := by apply Finset.sum_congr rfl intro u _ apply Finset.sum_congr rfl intro v _ simp only [Matrix.sub_apply] ring rw [hs] at h3 change sqrt (∑ u, ((R-Q.mulVec theta) u)^2) ≤ _ rw [he] exact h1.trans (add_le_add h2 h3)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_residual_sqrt_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:162

The good-branch clipped error is controlled by sampling deviations and population bias. Given the specified input d, the specified input n, the specified input m, the specified input D, the specified input h, the specified input J, the specified input theta, the specified input Rbar, the specified input Qbar, the specified input y, the specified input hy, the specified input hcenter, the specified input hgood, the overlap level eps, the t hat good branch error conclusion holds.

Formal statement
d n m :
ℕ
eps :
ℝ
heps :
0 < gramGuard eps
D :
Dataset d n m
h :
ℝ
J :
ℕ
theta Rbar :
PolyIdx d → ℝ
Qbar :
Matrix (PolyIdx d) (PolyIdx d) ℝ
y :
ℝ
hy :
y ∈ Icc (-1) 1
hcenter :
pv h theta (x0 d) = y
hgood :
gramGuard eps ≤ lambdaMin (qHat D h J)
|tHat eps h J D-y|
≤ (gramGuard eps)⁻¹*sqrt (∑ u, (r0 d h u)^2) * (sqrt (∑ u, (rHat D h J u-Rbar u)^2) + sqrt (∑ u, (Rbar u-Qbar.mulVec theta u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-Qbar u v)^2) * sqrt (∑ u, theta u^2))
Proof (Lean source)
lemma tHat_good_branch_error {d n m : ℕ} {eps : ℝ} (heps : 0 < gramGuard eps) (D : Dataset d n m) (h : ℝ) (J : ℕ) (theta Rbar : PolyIdx d → ℝ) (Qbar : Matrix (PolyIdx d) (PolyIdx d) ℝ) (y : ℝ) (hy : y ∈ Icc (-1) 1) (hcenter : pv h theta (x0 d) = y) (hgood : gramGuard eps ≤ lambdaMin (qHat D h J)) : |tHat eps h J D-y| ≤ (gramGuard eps)⁻¹*sqrt (∑ u, (r0 d h u)^2) * (sqrt (∑ u, (rHat D h J u-Rbar u)^2) + sqrt (∑ u, (Rbar u-Qbar.mulVec theta u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-Qbar u v)^2) * sqrt (∑ u, theta u^2)) := by have hsym : (qHat D h J).transpose = qHat D h J := by ext u v simp only [Matrix.transpose_apply, qHat] ring have hp := good_branch_projected_error (qHat D h J) hsym _ heps hgood (rHat D h J) theta (r0 d h) have hres := rectangular_residual_sqrt_le (rHat D h J) Rbar theta (qHat D h J) Qbar have he : (∑ u, r0 d h u * (qHat D h J)⁻¹.mulVec (rHat D h J) u)-y = ∑ u, r0 d h u * ((qHat D h J)⁻¹.mulVec (rHat D h J) u-theta u) := by simp only [mul_sub, Finset.sum_sub_distrib] change _-y = _-pv h theta (x0 d) rw [hcenter] rw [tHat, if_pos hgood] calc _ ≤ |(∑ u, r0 d h u * (qHat D h J)⁻¹.mulVec (rHat D h J) u)-y| := clipping_contraction _ y hy _ ≤ (gramGuard eps)⁻¹*sqrt (∑ u, (r0 d h u)^2) * sqrt (∑ u, (rHat D h J u-(qHat D h J).mulVec theta u)^2) := by rw [he] exact hp _ ≤ _ := mul_le_mul_of_nonneg_left hres (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat_good_branch_error · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskGeometry.lean:189
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.UpperRiskMoments 8 declarations Integrability and Cauchy–Schwarz bounds converting the rectangular second moments into the mean error of the guarded estimator.

# Expected rectangular sampling deviations Integrability and Cauchy–Schwarz bounds converting the rectangular second moments into the mean error of the guarded estimator.

The square root of a nonnegative integrable function is integrable on a finite measure. Given the specified input f, the specified input hf, the specified input hf0, the upper integrable sqrt conclusion holds.

Formal statement
Ω :
f :
Ω → ℝ
hf :
hf0 :
∀ w, 0 ≤ f w
Integrable (fun w => sqrt (f w)) μ
Proof (Lean source)
lemma upper_integrable_sqrt {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {f : Ω → ℝ} (hf : Integrable f μ) (hf0 : ∀ w, 0 ≤ f w) : Integrable (fun w => sqrt (f w)) μ := by apply (hf.add (integrable_const 1)).mono' (Real.continuous_sqrt.comp_aestronglyMeasurable hf.aestronglyMeasurable) filter_upwards [] with w rw [Real.norm_eq_abs, abs_of_nonneg (Real.sqrt_nonneg _)] change sqrt (f w) ≤ f w+1 have hs := Real.sq_sqrt (hf0 w) nlinarith [Real.sqrt_nonneg (f w), sq_nonneg (sqrt (f w)-1)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.upper_integrable_sqrt · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:21

Cauchy–Schwarz in expectation bounds a mean square root by the square root of its mean. Given the specified input f, the specified input hf, the specified input hf0, the upper integral sqrt le conclusion holds.

Formal statement
Ω :
f :
Ω → ℝ
hf :
hf0 :
∀ w, 0 ≤ f w
(∫ w, sqrt (f w) ∂μ) ≤ sqrt (∫ w, f w ∂μ)
Proof (Lean source)
lemma upper_integral_sqrt_le {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {f : Ω → ℝ} (hf : Integrable f μ) (hf0 : ∀ w, 0 ≤ f w) : (∫ w, sqrt (f w) ∂μ) ≤ sqrt (∫ w, f w ∂μ) := by have hs := upper_integrable_sqrt hf hf0 have hj := Real.strictConcaveOn_sqrt.concaveOn.le_map_integral Real.continuous_sqrt.continuousOn isClosed_Ici (Filter.Eventually.of_forall hf0) hf hs simpa only [Function.comp_def] using hj
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.upper_integral_sqrt_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:32
theorem rHat_square_deviation_integrable Lemma rHat_square_deviation_integrable in the paper ↗

The outcome moment's squared Euclidean deviation is integrable. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hn, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the r hat square deviation integrable conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hn :
2 ≤ n
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
Integrable (fun w : Sample d n m => ∑ u, (rHat w.1 h J u-rBar P n m h J u)^2) (experiment P n m)
Proof (Lean source)
lemma rHat_square_deviation_integrable (d n m : ℕ) (alpha beta gamma L eps : ℝ) (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hn : 2 ≤ n) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) : Integrable (fun w : Sample d n m => ∑ u, (rHat w.1 h J u-rBar P n m h J u)^2) (experiment P n m) := by letI := experiment_probability d n m P apply integrable_finsetSum intro u hu exact (((rectangular_r_coordinate_bound (m := m) P hP hn h J hh hh' hJ u).1.sub (memLp_const _))).integrable_sq
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rHat_square_deviation_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:42
theorem gram_cutoff_indicator_le_sqrt Lemma gram_cutoff_indicator_le_sqrt in the paper ↗

A failed guard is dominated by the Frobenius deviation itself. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input P, the specified input hP, the specified input n, the specified input m, the specified input hn, the specified input h, the specified input hh, the specified input hh', the specified input J, the specified input hJ, the specified input D, the gram cutoff indicator le sqrt conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
hn :
2 ≤ n
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
J :
ℕ
hJ :
1 ≤ J
D :
Dataset d n m
(if lambdaMin (qHat D h J) < gramGuard eps then (1:ℝ) else 0)
≤ (gramGuard eps)⁻¹*sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)
Proof (Lean source)
lemma gram_cutoff_indicator_le_sqrt (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (hn : 2 ≤ n) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (J : ℕ) (hJ : 1 ≤ J) (D : Dataset d n m) : (if lambdaMin (qHat D h J) < gramGuard eps then (1:ℝ) else 0) ≤ (gramGuard eps)⁻¹*sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2) := by have hg : 0 < gramGuard eps := hdom.gramGuard_pos split_ifs with hbad · have hs := gram_cutoff_sq_deviation (qHat D h J) (qPop P n m h J) _ hg (fun v hv => by have hp := (population_positivity d alpha beta gamma L eps hdom P hP n m hn h hh hh' J hJ v).2 have h2 : 2*gramGuard eps = eps*(1-eps) := by unfold gramGuard; ring rw [h2] simpa only [hv, mul_one] using hp) hbad have hnonneg : 0 ≤ ∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2 := Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => sq_nonneg _ have hr := Real.sq_sqrt hnonneg have hr0 := Real.sqrt_nonneg (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2) have hsq : gramGuard eps ≤ sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2) := Real.le_sqrt_of_sq_le hs rw [← div_eq_inv_mul, le_div_iff₀ hg, one_mul] exact hsq · positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gram_cutoff_indicator_le_sqrt · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:54
theorem rectangular_risk_sqrt_variance Lemma rectangular_risk_sqrt_variance in the paper ↗

Fixed-tuning risk is controlled by population approximation and the square root of the rectangular variance scale. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular risk sqrt variance conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨fun w
=> tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*(h^gamma+(h/J)^(alpha+beta)+ sqrt (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))))
Proof (Lean source)
lemma rectangular_risk_sqrt_variance (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*(h^gamma+(h/J)^(alpha+beta)+ sqrt (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))))) := by obtain ⟨A, hA, hpoint⟩ := rectangular_pointwise_error_bound d alpha beta gamma L eps hdom obtain ⟨B, hB, hsampling⟩ := rectangular_sampling_bound d alpha beta gamma L eps hdom have hg : 0 < gramGuard eps := hdom.gramGuard_pos let K := A+(gramGuard eps)⁻¹ refine ⟨K*(1+2*sqrt B), by dsimp [K]; positivity, ?_⟩ intro n m h J hn hh hh' hJ let hMeas := tHat_measurable d n m eps h J hn hh hh' hJ refine ⟨hMeas, ?_⟩ intro P hP letI := experiment_probability d n m P let μ := experiment P n m let R : Sample d n m → ℝ := fun w => ∑ u, (rHat w.1 h J u-rBar P n m h J u)^2 let Q : Sample d n m → ℝ := fun w => ∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2 let V := 1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)) let b := h^gamma+(h/J)^(alpha+beta) have hb : 0 ≤ b := by dsimp [b]; positivity have hV : 0 ≤ V := by dsimp [V]; positivity have hR0 : ∀ w, 0 ≤ R w := fun w => Finset.sum_nonneg fun _ _ => sq_nonneg _ have hQ0 : ∀ w, 0 ≤ Q w := fun w => Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => sq_nonneg _ have hiR : Integrable R μ := rHat_square_deviation_integrable d n m alpha beta gamma L eps P hP hn h J hh hh' hJ have hiQ : Integrable Q μ := qHat_square_deviation_integrable d n m P h J hh hJ have hsR := upper_integrable_sqrt hiR hR0 have hsQ := upper_integrable_sqrt hiQ hQ0 have hsamp : (∫ w, R w ∂μ)+(∫ w, Q w ∂μ) ≤ B*V := hsampling P hP n m h J hn hh hh' hJ have hmeanR : (∫ w, sqrt (R w) ∂μ) ≤ sqrt B*sqrt V := by calc _ ≤ sqrt (∫ w, R w ∂μ) := upper_integral_sqrt_le hiR hR0 _ ≤ sqrt (B*V) := Real.sqrt_le_sqrt (by linarith [integral_nonneg (f := Q) (fun w => hQ0 w) (μ := μ)]) _ = _ := Real.sqrt_mul hB.le V have hmeanQ : (∫ w, sqrt (Q w) ∂μ) ≤ sqrt B*sqrt V := by calc _ ≤ sqrt (∫ w, Q w ∂μ) := upper_integral_sqrt_le hiQ hQ0 _ ≤ sqrt (B*V) := Real.sqrt_le_sqrt (by linarith [integral_nonneg (f := R) (fun w => hR0 w) (μ := μ)]) _ = _ := Real.sqrt_mul hB.le V let f : Sample d n m → ℝ := fun w => |tHat eps h J w.1-tau P hP (x0 d)| have hif : Integrable f μ := by apply (integrable_const (2:ℝ)).mono' (by dsimp [f] exact (hMeas.sub measurable_const).abs.aestronglyMeasurable) filter_upwards [] with w simpa only [f, Real.norm_eq_abs, abs_abs] using tHat_absolute_error_le P hP w.1 h J have henv : Integrable (fun w => K*(b+sqrt (R w)+sqrt (Q w))) μ := (((integrable_const b).add hsR).add hsQ).const_mul K have hpoint' : ∀ w, f w ≤ K*(b+sqrt (R w)+sqrt (Q w)) := by intro w have hp := hpoint P hP n m h J hn hh hh' hJ w.1 have hg' := gram_cutoff_indicator_le_sqrt d alpha beta gamma L eps hdom P hP n m hn h hh hh' J hJ w.1 change f w ≤ A*(b+sqrt (R w)+sqrt (Q w))+_ at hp change _ ≤ (gramGuard eps)⁻¹*sqrt (Q w) at hg' dsimp only [K] have hgi : 0 ≤ (gramGuard eps)⁻¹ := inv_nonneg.mpr hg.le nlinarith [Real.sqrt_nonneg (R w), Real.sqrt_nonneg (Q w), mul_nonneg hgi (Real.sqrt_nonneg (R w)), mul_nonneg hgi hb] have hrisk : (∫ w, f w ∂μ) ≤ K*(1+2*sqrt B)*(b+sqrt V) := by calc _ ≤ ∫ w, K*(b+sqrt (R w)+sqrt (Q w)) ∂μ := integral_mono hif henv hpoint' _ = K*(b+(∫ w, sqrt (R w) ∂μ)+(∫ w, sqrt (Q w) ∂μ)) := by rw [integral_const_mul, integral_add (f := fun w => b+sqrt (R w)) (g := fun w => sqrt (Q w)) ((integrable_const b).add hsR) hsQ, integral_add (f := fun _ => b) (g := fun w => sqrt (R w)) (integrable_const b) hsR] simp [μ] _ ≤ K*(b+2*(sqrt B*sqrt V)) := mul_le_mul_of_nonneg_left (by linarith) (by dsimp [K]; positivity) _ ≤ _ := by have hnonneg : 0 ≤ K*(2*sqrt B)*b := by dsimp [K]; positivity have hnV : 0 ≤ K*sqrt V := by dsimp [K]; positivity nlinarith change (∫⁻ w, ofReal (f w) ∂μ) ≤ _ rw [← ofReal_integral_eq_lintegral_ofReal hif (Filter.Eventually.of_forall (fun w => abs_nonneg _))] exact ENNReal.ofReal_le_ofReal hrisk
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_risk_sqrt_variance · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:80

The squared inverse square-root rate is the reciprocal scale. Given the specified input x, the specified input hx, the upper inverse half sq conclusion holds.

Formal statement
x :
ℝ
hx :
0 < x
(x^(-(1/2:ℝ)))^2 = 1/x
Proof (Lean source)
lemma upper_inverse_half_sq (x : ℝ) (hx : 0 < x) : (x^(-(1/2:ℝ)))^2 = 1/x := by rw [← Real.rpow_natCast, ← Real.rpow_mul hx.le] norm_num exact Real.rpow_neg_one x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.upper_inverse_half_sq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:164
theorem rectangular_variance_sqrt_le_rates Lemma rectangular_variance_sqrt_le_rates in the paper ↗

Rank and cell-side bookkeeping converts rectangular variance to the stated sampling rates. Given the specified input d, the specified input n, the specified input m, the specified input J, the specified input h, the specified input hn, the specified input hh, the specified input hJ, the rectangular variance sqrt le rates conclusion holds.

Formal statement
d n m J :
ℕ
h :
ℝ
hn :
2 ≤ n
hh :
0 < h
hJ :
1 ≤ J
sqrt (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)))
≤ (1+sqrt (card (PolyIdx d)))* (((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)))
Proof (Lean source)
lemma rectangular_variance_sqrt_le_rates (d n m J : ℕ) (h : ℝ) (hn : 2 ≤ n) (hh : 0 < h) (hJ : 1 ≤ J) : sqrt (1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d))) ≤ (1+sqrt (card (PolyIdx d)))* (((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))) := by have hnpos : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hJpos : (0:ℝ) < J := by exact_mod_cast (show 0 < J by omega) let a := ((n:ℝ)*h^d)^(-(1/2:ℝ)) let b := ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)) let q : ℝ := card (PolyIdx d) have ha : 0 ≤ a := by dsimp [a]; positivity have hb : 0 ≤ b := by dsimp [b]; positivity have hq : 0 ≤ q := by dsimp [q]; positivity have ha2 : a^2 = 1/((n:ℝ)*h^d) := upper_inverse_half_sq _ (by positivity) have hb2 : b^2 = 1/((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d) := upper_inverse_half_sq _ (by positivity) have hid : 1/((n:ℝ)*h^d)+q*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)) = a^2+q*b^2 := by rw [ha2, hb2, div_pow, pow_mul] field_simp rw [← pow_mul, Nat.mul_comm 2 d, pow_mul] ring change sqrt _ ≤ (1+sqrt q)*(a+b) rw [hid] apply Real.sqrt_le_iff.mpr refine ⟨by positivity, ?_⟩ have hs := Real.sq_sqrt hq have hsq : a^2+q*b^2 ≤ (a+sqrt q*b)^2 := by nlinarith [mul_nonneg ha (mul_nonneg (Real.sqrt_nonneg q) hb)] have hsum : a+sqrt q*b ≤ (1+sqrt q)*(a+b) := by nlinarith [mul_nonneg (Real.sqrt_nonneg q) ha] exact hsq.trans (pow_le_pow_left₀ (by positivity) hsum 2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_variance_sqrt_le_rates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:171
theorem rectangular_fixed_tuning_risk Lemma rectangular_fixed_tuning_risk in the paper ↗

The clipped rectangular estimator attains the fixed-tuning risk envelope uniformly over the primitive class. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular fixed tuning risk conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨fun w
=> tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*min 1 (h^gamma+(h/J)^(alpha+beta)+ ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))))
Proof (Lean source)
lemma rectangular_fixed_tuning_risk (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*min 1 (h^gamma+(h/J)^(alpha+beta)+ ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)))) := by obtain ⟨A, hA, hmean⟩ := rectangular_risk_sqrt_variance d alpha beta gamma L eps hdom let K := 1+sqrt (card (PolyIdx d)) let C := A*K+2 have hK : 1 ≤ K := by dsimp [K]; linarith [Real.sqrt_nonneg (card (PolyIdx d))] have hC : 0 < C := by dsimp [C, K]; positivity refine ⟨C, hC, ?_⟩ intro n m h J hn hh hh' hJ obtain ⟨hMeas, hbound⟩ := hmean n m h J hn hh hh' hJ refine ⟨hMeas, ?_⟩ intro P hP let b := h^gamma+(h/J)^(alpha+beta) let a := ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)) let V := 1/((n:ℝ)*h^d)+(card (PolyIdx d):ℝ)*(J:ℝ)^d / ((n:ℝ)*((n:ℝ)+m)*h^(2*d)) have hb : 0 ≤ b := by dsimp [b]; positivity have ha : 0 ≤ a := by dsimp [a]; positivity have hvar : sqrt V ≤ K*a := rectangular_variance_sqrt_le_rates d n m J h hn hh hJ have hfull : risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*(b+a)) := by calc _ ≤ ofReal (A*(b+sqrt V)) := hbound P hP _ ≤ _ := by apply ENNReal.ofReal_le_ofReal have hbase : b ≤ K*b := by nlinarith have hm := mul_le_mul_of_nonneg_left (add_le_add hbase hvar) hA.le dsimp [C] nlinarith rw [show h^gamma+(h/J)^(alpha+beta)+((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ)) = b+a by dsimp [b, a]; ring] by_cases hsmall : b+a ≤ 1 · rw [min_eq_right hsmall] exact hfull · rw [min_eq_left (le_of_not_ge hsmall)] exact (tHat_risk_le_diameter P hP h J hMeas).trans (ENNReal.ofReal_le_ofReal (by dsimp [C, K]; nlinarith [Real.sqrt_nonneg (card (PolyIdx d))]))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_fixed_tuning_risk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskMoments.lean:206
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Helpers.UpperRiskPointwise 7 declarations Uniform deterministic error envelopes for the rectangular estimator, separating the two sampling deviations, the population bias, and the failed guard.

# Pointwise upper-risk assembly Uniform deterministic error envelopes for the rectangular estimator, separating the two sampling deviations, the population bias, and the failed guard.

theorem tau_mem_clipping_interval Lemma tau_mem_clipping_interval in the paper ↗

The two arm-mean range conditions place the designated contrast in the clipping interval. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input x, the specified input hx, the tau mem clipping interval conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
x :
Cov d
hx :
x ∈ cube d
tau P hP x ∈ Icc (-1) 1
Proof (Lean source)
lemma tau_mem_clipping_interval {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (x : Cov d) (hx : x ∈ cube d) : tau P hP x ∈ Icc (-1) 1 := by have hspec := canonicalLaw_spec P hP have h0 := hspec.2.2.2.2.2.2.2.1 x hx have h1 := hspec.2.2.2.2.2.2.2.2 x hx simp only [tau, designatedTreated, designatedControl, if_pos hx, mem_Icc] constructor <;> linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tau_mem_clipping_interval · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:19
theorem tHat_mem_clipping_interval Lemma tHat_mem_clipping_interval in the paper ↗

Clipping, including the zero fallback, always produces an output in the prescribed interval. Given the specified input d, the specified input n, the specified input m, the specified input D, the specified input h, the specified input J, the overlap level eps, the t hat mem clipping interval conclusion holds.

Formal statement
d n m :
ℕ
eps :
ℝ
D :
Dataset d n m
h :
ℝ
J :
ℕ
tHat eps h J D ∈ Icc (-1) 1
Proof (Lean source)
lemma tHat_mem_clipping_interval {d n m : ℕ} (eps : ℝ) (D : Dataset d n m) (h : ℝ) (J : ℕ) : tHat eps h J D ∈ Icc (-1) 1 := by classical unfold tHat split_ifs · constructor · exact le_max_left _ _ · exact max_le (by norm_num) (min_le_left _ _) · constructor <;> norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat_mem_clipping_interval · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:29

The absolute error is uniformly bounded by the diameter of the clipping interval. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input D, the specified input h, the specified input J, the t hat absolute error le conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
D :
Dataset d n m
h :
ℝ
J :
ℕ
|tHat eps h J D-tau P hP (x0 d)| ≤ 2
Proof (Lean source)
lemma tHat_absolute_error_le {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (D : Dataset d n m) (h : ℝ) (J : ℕ) : |tHat eps h J D-tau P hP (x0 d)| ≤ 2 := by have ht := tHat_mem_clipping_interval eps D h J have hy := tau_mem_clipping_interval P hP (x0 d) (x0_mem_cube d) exact abs_le.mpr ⟨by linarith [ht.1, hy.2], by linarith [ht.2, hy.1]⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat_absolute_error_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:40

The localization center is in every positive-bandwidth box. Given the specified input d, the specified input h, the specified input hh, the x0 mem loc cube conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 ≤ h
x0 d ∈ locCube d h
Proof (Lean source)
lemma x0_mem_locCube (d : ℕ) (h : ℝ) (hh : 0 ≤ h) : x0 d ∈ locCube d h := by intro i change (1/2:ℝ) ∈ Icc (1/2-h/2) (1/2+h/2) constructor <;> linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.x0_mem_locCube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:49
theorem rectangular_pointwise_error_bound Lemma rectangular_pointwise_error_bound in the paper ↗

Uniform pointwise assembly follows from the local polynomial approximation and the causal population-bias bridge. The failed-guard term is kept explicit for the probability bound. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular pointwise error bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
D :
Dataset d n m
|tHat eps h J D-tau P hP (x0 d)|
≤ C*(h^gamma+(h/J)^(alpha+beta) + sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2))
+ (if lambdaMin (qHat D h J) < gramGuard eps then (1:ℝ) else 0)
Proof (Lean source)
lemma rectangular_pointwise_error_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∀ D : Dataset d n m, |tHat eps h J D-tau P hP (x0 d)| ≤ C*(h^gamma+(h/J)^(alpha+beta) + sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)) + (if lambdaMin (qHat D h J) < gramGuard eps then (1:ℝ) else 0) := by classical obtain ⟨A, hA, hlocal⟩ := local_polynomial_projection_facts d alpha beta gamma L eps hdom let B := sqrt (card (PolyIdx d)) * (A^2+2*A) have hB : 0 ≤ B := by dsimp [B]; positivity have hg : 0 < gramGuard eps := hdom.gramGuard_pos let C := (gramGuard eps)⁻¹*A*(1+B+A) have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro P hP n m h J hn hh hh' hJ D obtain ⟨⟨theta, herr, htheta, hcenter, htaylor⟩, hcoarse, hrow, htrace, he, hmu⟩ := hlocal P hP h J hh hh' hJ have hbias : sqrt (∑ u, (rBar P n m h J u-(qPop P n m h J).mulVec theta u)^2) ≤ B*(h^gamma+(h/J)^(alpha+beta)) := by have hc := population_finite_norm_bound (fun u => rBar P n m h J u-(qPop P n m h J).mulVec theta u) ((A^2+2*A)*(h^gamma+(h/J)^(alpha+beta))) (by positivity) (population_bias_coordinate_bound P hP n m hn h hh hh' J hJ theta A hA herr he hmu) calc _ ≤ sqrt (card (PolyIdx d))*((A^2+2*A)*(h^gamma+(h/J)^(alpha+beta))) := hc _ = _ := by dsimp [B]; ring have hr0 : sqrt (∑ u, (r0 d h u)^2) ≤ A := hcoarse (x0 d) (x0_mem_locCube d h hh.le) have hbase : 0 ≤ h^gamma+(h/J)^(alpha+beta) := by positivity have hnoiseR : 0 ≤ sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) := Real.sqrt_nonneg _ have hnoiseQ : 0 ≤ sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2) := Real.sqrt_nonneg _ by_cases hgood : gramGuard eps ≤ lambdaMin (qHat D h J) · have hp := tHat_good_branch_error hg D h J theta (rBar P n m h J) (qPop P n m h J) (tau P hP (x0 d)) (tau_mem_clipping_interval P hP (x0 d) (x0_mem_cube d)) hcenter hgood rw [if_neg (not_lt_of_ge hgood), add_zero] calc _ ≤ (gramGuard eps)⁻¹*sqrt (∑ u, (r0 d h u)^2) * (sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + sqrt (∑ u, (rBar P n m h J u-(qPop P n m h J).mulVec theta u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)*sqrt (∑ u, theta u^2)) := hp _ ≤ (gramGuard eps)⁻¹*A * (sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + B*(h^gamma+(h/J)^(alpha+beta)) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)*A) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_left hr0 (inv_nonneg.mpr hg.le) · exact add_le_add (add_le_add (le_refl _) hbias) (mul_le_mul_of_nonneg_left htheta hnoiseQ) · positivity · positivity _ ≤ _ := by have hk : 0 ≤ (gramGuard eps)⁻¹*A := by positivity have hbr : 1 ≤ 1+B+A := by linarith have hbb : B ≤ 1+B+A := by linarith have hbq : A ≤ 1+B+A := by linarith have hsum : sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + B*(h^gamma+(h/J)^(alpha+beta)) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)*A ≤ (1+B+A)*((h^gamma+(h/J)^(alpha+beta)) + sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)) := by nlinarith [mul_le_mul_of_nonneg_right hbr hnoiseR, mul_le_mul_of_nonneg_right hbb hbase, mul_le_mul_of_nonneg_right hbq hnoiseQ] have hm := mul_le_mul_of_nonneg_left hsum hk dsimp [C] nlinarith · have hbad : lambdaMin (qHat D h J) < gramGuard eps := lt_of_not_ge hgood rw [if_pos hbad, tHat, if_neg hgood, zero_sub, abs_neg] have hy := tau_mem_clipping_interval P hP (x0 d) (x0_mem_cube d) have habs : |tau P hP (x0 d)| ≤ 1 := abs_le.mpr ⟨by linarith [hy.1], hy.2⟩ have hnonneg : 0 ≤ C*(h^gamma+(h/J)^(alpha+beta) + sqrt (∑ u, (rHat D h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat D h J u v-qPop P n m h J u v)^2)) := by positivity linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_pointwise_error_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:55

The clipped estimator has finite absolute-loss risk on every primitive-class law. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input h, the specified input J, the specified input hMeas, the t hat risk le diameter conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
h :
ℝ
J :
ℕ
hMeas :
Measurable (fun w : Sample d n m => tHat eps h J w.1)
risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (2:ℝ)
Proof (Lean source)
lemma tHat_risk_le_diameter {d n m : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (h : ℝ) (J : ℕ) (hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1)) : risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (2:ℝ) := by let := experiment_probability d n m P unfold risk calc _ ≤ ∫⁻ _ : Sample d n m, ofReal (2:ℝ) ∂experiment P n m := by apply lintegral_mono intro w exact ENNReal.ofReal_le_ofReal (tHat_absolute_error_le P hP w.1 h J) _ = _ := by simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tHat_risk_le_diameter · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:134
theorem rectangular_risk_envelope_reduction Lemma rectangular_risk_envelope_reduction in the paper ↗

The pointwise assembly reduces fixed-tuning risk to the two mean Euclidean deviations and the failed-guard indicator, while retaining a finite uniform cap. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular risk envelope reduction conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
P :
hP :
PrimitiveClass alpha beta gamma L eps P
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1),
risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (2:ℝ) ∧
risk ⟨fun w
=> tHat eps h J w.1, hMeas⟩ P hP ≤ ∫⁻ w, ofReal (C*(h^gamma+(h/J)^(alpha+beta) + sqrt (∑ u, (rHat w.1 h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2)) + (if lambdaMin (qHat w.1 h J) < gramGuard eps then (1:ℝ) else 0)) ∂experiment P n m
Proof (Lean source)
lemma rectangular_risk_envelope_reduction (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1), risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (2:ℝ) ∧ risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ∫⁻ w, ofReal (C*(h^gamma+(h/J)^(alpha+beta) + sqrt (∑ u, (rHat w.1 h J u-rBar P n m h J u)^2) + sqrt (∑ u, ∑ v, (qHat w.1 h J u v-qPop P n m h J u v)^2)) + (if lambdaMin (qHat w.1 h J) < gramGuard eps then (1:ℝ) else 0)) ∂experiment P n m := by obtain ⟨C, hC, hpoint⟩ := rectangular_pointwise_error_bound d alpha beta gamma L eps hdom refine ⟨C, hC, ?_⟩ intro P hP n m h J hn hh hh' hJ let hMeas := tHat_measurable d n m eps h J hn hh hh' hJ refine ⟨hMeas, tHat_risk_le_diameter P hP h J hMeas, ?_⟩ apply lintegral_mono intro w exact ENNReal.ofReal_le_ofReal (hpoint P hP n m h J hn hh hh' hJ w.1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_risk_envelope_reduction · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Helpers/UpperRiskPointwise.lean:148
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.ComponentHellinger 5 declarations Positive record likelihoods give the component density floor (MC23).

Component Hellinger estimate

Positive record likelihoods give the component density floor (MC23). The square-root identity converts the two-amplitude density difference into the squared Hellinger estimate (MC30–MC31).

theorem sqrt_difference_sq_le_of_floor Lemma sqrt_difference_sq_le_of_floor in the paper ↗

A common positive density floor controls squared square-root differences. Given the specified input f, the specified input g, the specified input t, the specified input ht, the specified input hf, the specified input hg, the sqrt difference sq le of floor conclusion holds.

Formal statement
f g t :
ℝ
ht :
0 < t
hf :
t ≤ f
hg :
t ≤ g
(sqrt f - sqrt g)^2 ≤ (f-g)^2 / (4*t)
Proof (Lean source)
lemma sqrt_difference_sq_le_of_floor (f g t : ℝ) (ht : 0 < t) (hf : t ≤ f) (hg : t ≤ g) : (sqrt f - sqrt g)^2 ≤ (f-g)^2 / (4*t) := by have hf0 : 0 ≤ f := ht.le.trans hf have hg0 : 0 ≤ g := ht.le.trans hg have hs := Real.sqrt_le_sqrt hf have hr := Real.sqrt_le_sqrt hg have hden : 4*t ≤ (sqrt f + sqrt g)^2 := by nlinarith [Real.sq_sqrt ht.le, Real.sqrt_nonneg t, Real.sqrt_nonneg f, Real.sqrt_nonneg g] have hid : (f-g)^2 = (sqrt f-sqrt g)^2 * (sqrt f+sqrt g)^2 := by nlinarith [Real.sq_sqrt hf0, Real.sq_sqrt hg0] apply (le_div_iff₀ (by positivity : 0 < 4*t)).2 nlinarith [mul_le_mul_of_nonneg_left hden (sq_nonneg (sqrt f-sqrt g))]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sqrt_difference_sq_le_of_floor · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentHellinger.lean:19
theorem marked_recordLikelihood_lower Lemma marked_recordLikelihood_lower in the paper ↗

Small marked amplitudes give every record likelihood a uniform positive floor. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input ha, the specified input hb, the specified input he, the specified input hm, the specified input x, the specified input s, the specified input i, the marked record likelihood lower conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
ha :
0 ≤ a
hb :
0 ≤ b
he :
a*(2:ℝ)^d ≤ 1/16
hm :
b*(2:ℝ)^d+a*b ≤ 1/16
x :
Fin (n+m) → Cov d
s :
i :
Fin (n+m)
(1/2:ℝ) ≤ recordLikelihood (markedLaw h delta a b theta sigma) x s i
Proof (Lean source)
lemma marked_recordLikelihood_lower {d n m : ℕ} (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hb : 0 ≤ b) (he : a*(2:ℝ)^d ≤ 1/16) (hm : b*(2:ℝ)^d+a*b ≤ 1/16) (x : Fin (n+m) → Cov d) (s : RecordSpins n m) (i : Fin (n+m)) : (1/2:ℝ) ≤ recordLikelihood (markedLaw h delta a b theta sigma) x s i := by have hsign (v : Bool) : |thetaSign v| = 1 := by cases v <;> norm_num [thetaSign] have hpert (v : Bool) (amp : ℝ) (hamp : 0 ≤ amp) (control : Bool) (y : Cov d) : |2*thetaSign v*amp*signField h delta sigma control y| ≤ 2*amp*(2:ℝ)^d := by rw [abs_mul, abs_mul, abs_mul, hsign, abs_of_nonneg hamp] norm_num only [abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2), mul_one] exact mul_le_mul_of_nonneg_left (abs_signField_le h delta sigma control y) (by positivity) induction i using Fin.addCases with | left j => let y := x (castAdd m j) have hp := markedPropensity_overlap h delta a sigma ha (by linarith) y have hmean := fun arm => markedMean_interior h delta a b theta arm sigma ha hb (by linarith : b*(2:ℝ)^d+a*b ≤ 3/8) y have hlik := marked_labelLikelihood_spin d h delta a b theta sigma y ⟨by linarith [hp.1], by linarith [hp.2]⟩ (fun arm => ⟨by linarith [(hmean arm).1], by linarith [(hmean arm).2]⟩) (s.1 j) have ht : |thetaSign (s.1 j).1*thetaSign (s.1 j).2*markedContrast h a b theta y| ≤ 2*a*b := by simpa only [abs_mul, hsign, one_mul] using abs_markedContrast_le h a b theta y ha hb have h1 := (abs_le.mp (hpert (s.1 j).1 a ha false y)).1 have h2 := (abs_le.mp (hpert (s.1 j).2 b hb true y)).1 have h3 := (abs_le.mp ht).1 have hfirst : 7/8 ≤ 1+2*thetaSign (s.1 j).1*a*signField h delta sigma false y := by linarith have hsecond : 7/8 ≤ 1+2*thetaSign (s.1 j).2*b*signField h delta sigma true y+ thetaSign (s.1 j).1*thetaSign (s.1 j).2*markedContrast h a b theta y := by linarith simp only [recordLikelihood, Fin.addCases_left] change 1/2 ≤ labelLikelihood _ y _ rw [hlik] have hmul := mul_le_mul hfirst hsecond (by norm_num : (0:ℝ) ≤ 7/8) (by linarith : 0 ≤ 1+2*thetaSign (s.1 j).1*a*signField h delta sigma false y) linarith | right j => let y := x (natAdd n j) have hp := markedPropensity_overlap h delta a sigma ha (by linarith) y simp only [recordLikelihood, Fin.addCases_right, auxiliaryLikelihood] rw [markedLaw_propensity_eq h delta a b theta sigma ha (by linarith) y, bern_singleton_toReal_spin _ ⟨by linarith [hp.1], by linarith [hp.2]⟩] have h1 := (abs_le.mp (hpert (s.2 j) a ha false y)).1 dsimp [y, markedPropensity] at * linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_recordLikelihood_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentHellinger.lean:37
theorem marked_componentDensity_lower Lemma marked_componentDensity_lower in the paper ↗

Averaging positive record products preserves the component density floor. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input ha, the specified input hb, the specified input he, the specified input hm, the specified input x, the specified input V, the specified input s, the marked component density lower conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
ha :
0 ≤ a
hb :
0 ≤ b
he :
a*(2:ℝ)^d ≤ 1/16
hm :
b*(2:ℝ)^d+a*b ≤ 1/16
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
s :
(1/2:ℝ)^V.card ≤ componentDensity (markedHandle d h delta a b) theta x V s
Proof (Lean source)
lemma marked_componentDensity_lower {d n m : ℕ} (h delta a b : ℝ) (theta : Bool) (ha : 0 ≤ a) (hb : 0 ≤ b) (he : a*(2:ℝ)^d ≤ 1/16) (hm : b*(2:ℝ)^d+a*b ≤ 1/16) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (s : RecordSpins n m) : (1/2:ℝ)^V.card ≤ componentDensity (markedHandle d h delta a b) theta x V s := by have hp (sigma : SignArray d h delta) : (1/2:ℝ)^V.card ≤ ∏ i ∈ V, recordLikelihood (markedLaw h delta a b theta sigma) x s i := by rw [← Finset.prod_const] exact Finset.prod_le_prod (fun _ _ => by norm_num) (fun i _ => marked_recordLikelihood_lower h delta a b theta sigma ha hb he hm x s i) calc _ = ∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (1/2:ℝ)^V.card := by rw [← Finset.sum_mul, (marked_prior_mass d h delta theta).2, one_mul] _ ≤ _ := Finset.sum_le_sum (fun sigma _ => mul_le_mul_of_nonneg_left (hp sigma) ((marked_prior_mass d h delta theta).1 sigma))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_componentDensity_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentHellinger.lean:83
theorem density_hellinger_le_of_floor Lemma density_hellinger_le_of_floor in the paper ↗

A bounded density difference and a positive floor imply the integrated Hellinger bound. Given the specified input f, the specified input g, the specified input hf, the specified input hg, the specified input t, the specified input D, the specified input ht, the specified input hD, the specified input hfloor, the specified input hdiff, the density hellinger le of floor conclusion holds.

Formal statement
Ω :
f g :
Ω → ℝ
hf :
hg :
t D :
ℝ
ht :
0 < t
hD :
0 ≤ D
hfloor :
∀ x, t ≤ f x ∧ t ≤ g x
hdiff :
∀ x, |f x-g x| ≤ D
hellingerSqDensity μ f g ≤ D^2/(4*t)
Proof (Lean source)
lemma density_hellinger_le_of_floor {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (f g : Ω → ℝ) (hf : Measurable f) (hg : Measurable g) (t D : ℝ) (ht : 0 < t) (hD : 0 ≤ D) (hfloor : ∀ x, t ≤ f x ∧ t ≤ g x) (hdiff : ∀ x, |f x-g x| ≤ D) : hellingerSqDensity μ f g ≤ D^2/(4*t) := by have hbound (x : Ω) : (sqrt (f x)-sqrt (g x))^2 ≤ D^2/(4*t) := by apply (sqrt_difference_sq_le_of_floor _ _ _ ht (hfloor x).1 (hfloor x).2).trans apply div_le_div_of_nonneg_right _ (by positivity) nlinarith [sq_abs (f x-g x), sq_nonneg (D-|f x-g x|), hdiff x, abs_nonneg (f x-g x)] have hi : Integrable (fun x => (sqrt (f x)-sqrt (g x))^2) μ := by apply (integrable_const (D^2/(4*t))).mono' (by fun_prop) exact Filter.Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg (sqrt (f x)-sqrt (g x)))] using hbound x) unfold hellingerSqDensity simpa using integral_mono hi (integrable_const (D^2/(4*t))) hbound
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.density_hellinger_le_of_floor · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentHellinger.lean:100
theorem marked_component_hellinger_bound Lemma marked_component_hellinger_bound in the paper ↗

The component squared Hellinger estimate retains both nuisance amplitudes, uniformly in the two channel sizes and in the common probability reference. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked component hellinger bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c K : ℝ,
0 < c
c ≤ 1
0 < K
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
n m (x : Fin (n+m) → Cov d) :
(∀ i, x i ∈ cube d)
V :
Finset (Fin (n+m))
μ :
≤ K*(9/2:ℝ)^V.card*(V.card:ℝ)^4*a^2*b^2
Proof (Lean source)
lemma marked_component_hellinger_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c K : ℝ, 0 < c ∧ c ≤ 1 ∧ 0 < K ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ n m (x : Fin (n+m) → Cov d), (∀ i, x i ∈ cube d) → ∀ V : Finset (Fin (n+m)), ∀ μ : Measure (RecordSpins n m), IsProbabilityMeasure μ → hellingerSqDensity μ (componentDensity (markedHandle d h delta a b) true x V) (componentDensity (markedHandle d h delta a b) false x V) ≤ K*(9/2:ℝ)^V.card*(V.card:ℝ)^4*a^2*b^2 := by obtain ⟨cI, C, hcI, hcI1, hC, hdiff⟩ := component_information_bound d alpha beta gamma L eps hdom let B : ℝ := (2:ℝ)^d let c := min cI (1/(64*B)) have hB : 1 ≤ B := one_le_pow₀ (by norm_num) have hBp : 0 < B := by positivity have hc : 0 < c := lt_min hcI (by positivity) have hcI' : c ≤ cI := min_le_left _ _ have hcB : c*B ≤ 1/64 := by have hm := mul_le_mul_of_nonneg_right (min_le_right cI (1/(64*B))) hBp.le have hid : (1/(64*B))*B = 1/64 := by field_simp simpa only [c, hid] using hm have hcsmall : c ≤ 1/64 := by nlinarith refine ⟨c, C^2, hc, hcI'.trans hcI1, sq_pos_of_pos hC, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab n m x hx V μ hμ letI := hμ have hd1 : delta ≤ 1 := by linarith have haC : a ≤ c := hac.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hdom.2.1.le) hc.le) have hbC : b ≤ c := hbc.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hdom.2.2.2.1.le) hc.le) have he : a*(2:ℝ)^d ≤ 1/16 := by change a*B ≤ _; nlinarith have hm : b*(2:ℝ)^d+a*b ≤ 1/16 := by have hab' := mul_le_mul haC hbC hb.le hc.le change b*B+a*b ≤ _ nlinarith have hscale (s : ℝ) (hs : 0 < s) (e : ℝ) : c*s^e ≤ cI*s^e := mul_le_mul_of_nonneg_right hcI' (Real.rpow_pos_of_pos hs e).le have hh0 : 0 < h := hd.trans_le hdh have hdif := hdiff h delta a b hd hdh hh ha (hac.trans (hscale delta hd alpha)) hb (hbc.trans (hscale delta hd beta)) (hab.trans (hscale h hh0 gamma)) n m x hx V have hbnd := density_hellinger_le_of_floor μ (componentDensity (markedHandle d h delta a b) true x V) (componentDensity (markedHandle d h delta a b) false x V) (measurable_of_countable _) (measurable_of_countable _) ((1/2:ℝ)^V.card) (C*(3/2:ℝ)^V.card*(V.card:ℝ)^2*a*b) (by positivity) (by positivity) (fun s => ⟨marked_componentDensity_lower h delta a b true ha.le hb.le he hm x V s, marked_componentDensity_lower h delta a b false ha.le hb.le he hm x V s⟩) hdif refine hbnd.trans ?_ have hid : (C*(3/2:ℝ)^V.card*(V.card:ℝ)^2*a*b)^2 / (4*(1/2:ℝ)^V.card) = C^2/4*(9/2:ℝ)^V.card*(V.card:ℝ)^4*a^2*b^2 := by rw [show (9/2:ℝ)^V.card = ((3/2:ℝ)^V.card)^2 / (1/2:ℝ)^V.card by rw [← pow_mul, mul_comm V.card 2, pow_mul, ← div_pow]; norm_num] field_simp <;> ring rw [hid] gcongr nlinarith [sq_nonneg C]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_component_hellinger_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentHellinger.lean:117
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.ComponentInformation 3 declarations Contrast deletion and cancellation of the common one-channel sign marginals retain both nuisance amplitudes in the component density difference (MC24–MC29).

Component likelihood information bound

Contrast deletion and cancellation of the common one-channel sign marginals retain both nuisance amplitudes in the component density difference (MC24–MC29).

theorem marked_channel_marginal_expectation Lemma marked_channel_marginal_expectation in the paper ↗

Both sign-array marginals agree between hypotheses, for arbitrary functions of one array. Given the specified input d, the specified input h, the specified input delta, the specified input control, the specified input F, the marked channel marginal expectation conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
control :
F :
({z // z ∈ frameIdx d h delta} → Bool) → ℝ
(∑ sigma : SignArray d h delta, markedWeight h delta true sigma * F (fun z => if control then (sigma z).2 else (sigma z).1))
= ∑ sigma : SignArray d h delta, markedWeight h delta false sigma * F (fun z => if control then (sigma z).2 else (sigma z).1)
Proof (Lean source)
lemma marked_channel_marginal_expectation (d : ℕ) (h delta : ℝ) (control : Bool) (F : ({z // z ∈ frameIdx d h delta} → Bool) → ℝ) : (∑ sigma : SignArray d h delta, markedWeight h delta true sigma * F (fun z => if control then (sigma z).2 else (sigma z).1)) = ∑ sigma : SignArray d h delta, markedWeight h delta false sigma * F (fun z => if control then (sigma z).2 else (sigma z).1) := by let e : SignArray d h delta ≃ SignArray d h delta := { toFun := fun sigma z => if control then (!(sigma z).1, (sigma z).2) else ((sigma z).1, !(sigma z).2) invFun := fun sigma z => if control then (!(sigma z).1, (sigma z).2) else ((sigma z).1, !(sigma z).2) left_inv := by intro sigma; funext z; cases control <;> simp right_inv := by intro sigma; funext z; cases control <;> simp } apply Fintype.sum_equiv e intro sigma have hw : markedWeight h delta true sigma = markedWeight h delta false (e sigma) := by unfold markedWeight apply Finset.prod_congr rfl intro z _ rcases hs : sigma z with ⟨l,v⟩ cases control <;> cases l <;> cases v <;> norm_num [e, thetaSign, hs] rw [hw] congr 2 funext z cases control <;> rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_channel_marginal_expectation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentInformation.lean:18
theorem component_channel_power_bound Lemma component_channel_power_bound in the paper ↗

Squared channel-product growth is bounded by the full-record growth factor. Given the specified input p, the component channel power bound conclusion holds.

Formal statement
p :
ℕ
(9/8:ℝ)^p * (9/8:ℝ)^p ≤ (3/2:ℝ)^p
Proof (Lean source)
lemma component_channel_power_bound (p : ℕ) : (9/8:ℝ)^p * (9/8:ℝ)^p ≤ (3/2:ℝ)^p := by rw [← mul_pow] exact pow_le_pow_left₀ (by norm_num) (by norm_num) p
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.component_channel_power_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentInformation.lean:45
theorem component_information_bound Lemma component_information_bound in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the component information bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c C : ℝ,
0 < c
c ≤ 1
0 < C
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
n m (x : Fin (n+m) → Cov d) :
(∀ i, x i ∈ cube d)
V :
Finset (Fin (n+m))
s :
|componentDensity (markedHandle d h delta a b) true x V s
- componentDensity (markedHandle d h delta a b) false x V s|
≤ C*(3/2:ℝ)^V.card*(V.card:ℝ)^2*a*b
Proof (Lean source)
lemma component_information_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c C : ℝ, 0 < c ∧ c ≤ 1 ∧ 0 < C ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ n m (x : Fin (n+m) → Cov d), (∀ i, x i ∈ cube d) → ∀ V : Finset (Fin (n+m)), ∀ s : RecordSpins n m, |componentDensity (markedHandle d h delta a b) true x V s - componentDensity (markedHandle d h delta a b) false x V s| ≤ C*(3/2:ℝ)^V.card*(V.card:ℝ)^2*a*b := by classical let B : ℝ := (2:ℝ)^d let c : ℝ := 1/(64*B) have hB : 1 ≤ B := one_le_pow₀ (by norm_num) have hBp : 0 < B := by positivity have hc : 0 < c := by dsimp [c]; positivity have hcB : c*B = 1/64 := by dsimp [c]; field_simp have hc1 : c ≤ 1/64 := by nlinarith refine ⟨c, 8*B^2+6, hc, by linarith, by positivity, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab n m x hx V s have hδ1 : delta ≤ 1 := by linarith have haC : a ≤ c := hac.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hδ1 hdom.2.1.le) hc.le) have hbC : b ≤ c := hbc.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hδ1 hdom.2.2.2.1.le) hc.le) have haB : a*B ≤ 1/64 := by nlinarith have hbB : b*B ≤ 1/64 := by nlinarith have habsmall : a*b ≤ 1/4096 := by nlinarith [mul_le_mul haC hbC hb.le hc.le] let f : SignArray d h delta → Fin (n+m) → ℝ := fun sigma => Fin.addCases (fun i => 1+2*thetaSign (s.1 i).1*a*signField h delta sigma false (x (castAdd m i))) (fun j => 1+2*thetaSign (s.2 j)*a*signField h delta sigma false (x (natAdd n j))) let g : SignArray d h delta → Fin (n+m) → ℝ := fun sigma => Fin.addCases (fun i => 1+2*thetaSign (s.1 i).2*b*signField h delta sigma true (x (castAdd m i))) (fun _ => 1) have hsign (v : Bool) : |thetaSign v| = 1 := by cases v <;> norm_num [thetaSign] have hpert (v : Bool) (amp : ℝ) (hamp : 0 ≤ amp) (sigma : SignArray d h delta) (control : Bool) (y : Cov d) : |2*thetaSign v*amp*signField h delta sigma control y| ≤ 2*amp*B := by rw [abs_mul, abs_mul, abs_mul, hsign, abs_of_nonneg hamp] norm_num only [abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2), mul_one] exact mul_le_mul_of_nonneg_left (abs_signField_le h delta sigma control y) (by positivity) have hfd : ∀ sigma i, |f sigma i-1| ≤ 2*a*B := by intro sigma i refine Fin.addCases (fun j => ?_) (fun j => ?_) i <;> simpa [f] using hpert _ a ha.le sigma false _ have hgd : ∀ sigma i, |g sigma i-1| ≤ 2*b*B := by intro sigma i refine Fin.addCases (fun j => ?_) (fun j => ?_) i · simpa [g] using hpert _ b hb.le sigma true _ · simp [g]; positivity have hfactor {v D : ℝ} (hv : |v-1| ≤ D) (hD : D ≤ 1/8) : |v| ≤ 9/8 ∧ 7/8 ≤ v := by have ht := abs_le.mp hv have hn := (abs_add_le (v-1) 1) rw [sub_add_cancel, abs_one] at hn constructor <;> linarith have hf : ∀ sigma i, |f sigma i| ≤ 9/8 := fun sigma i => (hfactor (hfd sigma i) (by linarith)).1 have hg : ∀ sigma i, |g sigma i| ≤ 9/8 := fun sigma i => (hfactor (hgd sigma i) (by linarith)).1 have he : a*B ≤ 1/4 := by linarith have hm : b*B+a*b ≤ 3/8 := by linarith have hrec (theta : Bool) (sigma : SignArray d h delta) (i : Fin (n+m)) : |recordLikelihood (markedLaw h delta a b theta sigma) x s i| ≤ 3/2 ∧ |recordLikelihood (markedLaw h delta a b theta sigma) x s i - f sigma i*g sigma i| ≤ 3*a*b := by refine Fin.addCases (fun j => ?_) (fun j => ?_) i · have hp := markedPropensity_overlap h delta a sigma ha.le he (x (castAdd m j)) have hmean := fun arm => markedMean_interior h delta a b theta arm sigma ha.le hb.le hm (x (castAdd m j)) have hlik := marked_labelLikelihood_spin d h delta a b theta sigma _ ⟨by linarith [hp.1], by linarith [hp.2]⟩ (fun arm => ⟨by linarith [(hmean arm).1], by linarith [(hmean arm).2]⟩) (s.1 j) have ht : |thetaSign (s.1 j).1*thetaSign (s.1 j).2 * markedContrast h a b theta (x (castAdd m j))| ≤ 2*a*b := by simpa only [abs_mul, hsign, one_mul] using abs_markedContrast_le h a b theta _ ha.le hb.le simp only [recordLikelihood, Fin.addCases_left] change |labelLikelihood _ _ _| ≤ _ ∧ |labelLikelihood _ _ _ - _| ≤ _ rw [hlik] have hfj : f sigma (castAdd m j) = 1+2*thetaSign (s.1 j).1*a*signField h delta sigma false (x (castAdd m j)) := by simp only [f, Fin.addCases_left] have hgj : g sigma (castAdd m j) = 1+2*thetaSign (s.1 j).2*b*signField h delta sigma true (x (castAdd m j)) := by simp only [g, Fin.addCases_left] rw [← hfj, ← hgj] change |f sigma (castAdd m j) * (g sigma (castAdd m j) + _)| ≤ _ ∧ |f sigma (castAdd m j) * (g sigma (castAdd m j) + _) - f sigma (castAdd m j)*g sigma (castAdd m j)| ≤ _ constructor · rw [abs_mul] have hu := abs_add_le (g sigma (castAdd m j)) (thetaSign (s.1 j).1*thetaSign (s.1 j).2*markedContrast h a b theta (x (castAdd m j))) have hm := mul_le_mul (hf sigma (castAdd m j)) (hu.trans (add_le_add (hg sigma _) ht)) (abs_nonneg _) (by norm_num : (0:ℝ) ≤ 9/8) nlinarith only [hm, habsmall] · rw [mul_add, add_sub_cancel_left, abs_mul] have hm := mul_le_mul (hf sigma (castAdd m j)) ht (abs_nonneg _) (by norm_num : (0:ℝ) ≤ 9/8) nlinarith only [hm, ha, hb] · have hp := markedPropensity_overlap h delta a sigma ha.le he (x (natAdd n j)) have hlik : auxiliaryLikelihood (markedLaw h delta a b theta sigma) (x (natAdd n j)) (s.2 j) = f sigma (natAdd n j) := by unfold auxiliaryLikelihood rw [markedLaw_propensity_eq h delta a b theta sigma ha.le he] rw [bern_singleton_toReal_spin _ ⟨by linarith [hp.1], by linarith [hp.2]⟩] simp [f, markedPropensity]; ring simpa [recordLikelihood, hlik, g] using intro ((hf sigma (natAdd n j)).trans (by norm_num : (9/8:ℝ) ≤ 3/2)) (by positivity : (0:ℝ) ≤ 3*a*b) let A := fun sigma => ∏ i ∈ V, f sigma i let G := fun sigma => ∏ i ∈ V, g sigma i have hcommon (control : Bool) (F : SignArray d h delta → ℝ) (hF : ∀ sigma sigma', (∀ z, (if control then (sigma z).2 else (sigma z).1) = (if control then (sigma' z).2 else (sigma' z).1)) → F sigma = F sigma') : (∑ sigma, markedWeight h delta true sigma*F sigma) = ∑ sigma, markedWeight h delta false sigma*F sigma := by let lift : ({z // z ∈ frameIdx d h delta} → Bool) → SignArray d h delta := fun l z => if control then (false,l z) else (l z,false) have ht (sigma) : F sigma = F (lift (fun z => if control then (sigma z).2 else (sigma z).1)) := by apply hF; intro z; cases control <;> rfl calc _ = ∑ sigma, markedWeight h delta true sigma * F (lift (fun z => if control then (sigma z).2 else (sigma z).1)) := Finset.sum_congr rfl (fun sigma _ => congrArg (fun v => markedWeight h delta true sigma*v) (ht sigma)) _ = ∑ sigma, markedWeight h delta false sigma * F (lift (fun z => if control then (sigma z).2 else (sigma z).1)) := marked_channel_marginal_expectation d h delta control (fun l => F (lift l)) _ = _ := Finset.sum_congr rfl (fun sigma _ => congrArg (fun v => markedWeight h delta false sigma*v) (ht sigma).symm) have hA := hcommon false A (by intro sigma sigma' hs simp only [Bool.false_eq_true, if_false, if_true] at hs apply Finset.prod_congr rfl; intro i _ refine Fin.addCases (fun j => ?_) (fun j => ?_) i <;> simp only [f, Fin.addCases_left, Fin.addCases_right, signField, Bool.false_eq_true, if_false, hs]) have hG := hcommon true G (by intro sigma sigma' hs simp only [Bool.false_eq_true, if_false, if_true] at hs apply Finset.prod_congr rfl; intro i _ refine Fin.addCases (fun j => ?_) (fun j => ?_) i <;> simp only [g, Fin.addCases_left, Fin.addCases_right, signField, if_true, hs]) let U := (V.card:ℝ)* (2*a*B) * (9/8:ℝ)^V.card let W := (V.card:ℝ)* (2*b*B) * (9/8:ℝ)^V.card let D := (V.card:ℝ)* (3*a*b) * (3/2:ℝ)^V.card have hdel (theta : Bool) (sigma : SignArray d h delta) : |(∏ i ∈ V, recordLikelihood (markedLaw h delta a b theta sigma) x s i) - A sigma*G sigma| ≤ D := by rw [← Finset.prod_mul_distrib] have hp := finite_product_perturbation_bound V (recordLikelihood (markedLaw h delta a b theta sigma) x s) (fun i => f sigma i*g sigma i) (3/2) (by norm_num) (fun i _ => (hrec theta sigma i).1) (fun i _ => by rw [abs_mul]; nlinarith [mul_le_mul (hf sigma i) (hg sigma i) (abs_nonneg _) (by norm_num : (0:ℝ) ≤ 9/8)]) calc _ ≤ (3/2:ℝ)^V.card * ∑ i ∈ V, |recordLikelihood _ x s i-f sigma i*g sigma i| := hp _ ≤ (3/2:ℝ)^V.card * ∑ _i ∈ V, 3*a*b := by gcongr; exact (hrec theta sigma _).2 _ = D := by simp [D, Finset.sum_const]; ring have hbound := finite_prior_contrast_deletion_bound (markedWeight h delta true) (markedWeight h delta false) A G _ _ (marked_prior_mass d h delta true).1 (marked_prior_mass d h delta false).1 (marked_prior_mass d h delta true).2 (marked_prior_mass d h delta false).2 hA hG U W D D (by dsimp [U]; positivity) (by dsimp [W]; positivity) (fun sigma => finite_product_deviation_bound V (f sigma) (9/8) (2*a*B) (by norm_num) (fun i _ => hf sigma i) (fun i _ => hfd sigma i)) (fun sigma => finite_product_deviation_bound V (g sigma) (9/8) (2*b*B) (by norm_num) (fun i _ => hg sigma i) (fun i _ => hgd sigma i)) (hdel true) (hdel false) change |(∑ sigma, markedWeight h delta true sigma * ∏ i ∈ V, recordLikelihood _ x s i) - (∑ sigma, markedWeight h delta false sigma * ∏ i ∈ V, recordLikelihood _ x s i)| ≤ _ refine hbound.trans ?_ have hp := component_channel_power_bound V.card have hcard : (V.card:ℝ) ≤ (V.card:ℝ)^2 := by have hn : V.card = 0 ∨ 1 ≤ V.card := by omega rcases hn with hn | hn · simp [hn] · have hn' : (1:ℝ) ≤ V.card := by exact_mod_cast hn nlinarith have hab0 : 0 ≤ a*b := by positivity dsimp [D, U, W] clear hbound hrec hA hG hcommon hdel hf hg hfd hgd hfactor hpert nlinarith [mul_le_mul_of_nonneg_left hp (show 0 ≤ 8*B^2*(V.card:ℝ)^2*a*b by positivity), mul_le_mul_of_nonneg_right hcard (show 0 ≤ 6*a*b*(3/2:ℝ)^V.card by positivity)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.component_information_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentInformation.lean:52
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.ComponentNormalization 7 declarations Each record likelihood integrates to one against fair observed spins.

Normalization of conditional component densities

Each record likelihood integrates to one against fair observed spins. Independent fair spins therefore normalize every selected record product and its finite prior mixture, as required by the MC32 product-distance argument.

theorem labelLikelihood_integral_one Lemma labelLikelihood_integral_one in the paper ↗

A labeled likelihood has total mass one under the two fair reference spins. Given the specified input d, the specified input P, the specified input x, the specified input he, the specified input hm, the label likelihood integral one conclusion holds.

Formal statement
d :
ℕ
P :
x :
Cov d
he :
P.e x ∈ Icc (0:ℝ) 1
hm :
∀ arm : Bool, (if arm then P.mu1 x else P.mu0 x) ∈ Icc (0:ℝ) 1
∫ s, labelLikelihood P x s ∂fairObserved = 1
Proof (Lean source)
lemma labelLikelihood_integral_one {d : ℕ} (P : PrimitiveLaw d) (x : Cov d) (he : P.e x ∈ Icc (0:ℝ) 1) (hm : ∀ arm : Bool, (if arm then P.mu1 x else P.mu0 x) ∈ Icc (0:ℝ) 1) : ∫ s, labelLikelihood P x s ∂fairObserved = 1 := by letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance rw [integral_fintype (Integrable.of_finite)] simp only [Fintype.sum_prod_type, Fintype.sum_bool, labelLikelihood] rw [bern_singleton_toReal_spin _ he, bern_singleton_toReal_spin _ he] simp only [Bool.false_eq_true, if_false, if_true] have hm0 : P.mu0 x ∈ Icc (0:ℝ) 1 := hm false have hm1 : P.mu1 x ∈ Icc (0:ℝ) 1 := hm true rw [bern_singleton_toReal_spin _ hm0, bern_singleton_toReal_spin _ hm0, bern_singleton_toReal_spin _ hm1, bern_singleton_toReal_spin _ hm1] norm_num [fairObserved, bern, Measure.real, Measure.prod_apply, thetaSign] <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.labelLikelihood_integral_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:19
theorem auxiliaryLikelihood_integral_one Lemma auxiliaryLikelihood_integral_one in the paper ↗

An auxiliary likelihood has total mass one under a fair treatment spin. Given the specified input d, the specified input P, the specified input x, the specified input he, the auxiliary likelihood integral one conclusion holds.

Formal statement
d :
ℕ
P :
x :
Cov d
he :
P.e x ∈ Icc (0:ℝ) 1
∫ s, auxiliaryLikelihood P x s ∂bern (1/2) = 1
Proof (Lean source)
lemma auxiliaryLikelihood_integral_one {d : ℕ} (P : PrimitiveLaw d) (x : Cov d) (he : P.e x ∈ Icc (0:ℝ) 1) : ∫ s, auxiliaryLikelihood P x s ∂bern (1/2) = 1 := by letI := bern_probability (1/2) (by norm_num) rw [integral_fintype (Integrable.of_finite)] simp only [Fintype.sum_bool, auxiliaryLikelihood] rw [bern_singleton_toReal_spin _ he, bern_singleton_toReal_spin _ he] norm_num [bern, Measure.real, thetaSign] <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliaryLikelihood_integral_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:37
theorem recordLikelihood_product_integral_one Lemma recordLikelihood_product_integral_one in the paper ↗

A selected product of record likelihoods is normalized by independent fair spins, including when no records are selected. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input x, the specified input V, the specified input he, the specified input hm, the record likelihood product integral one conclusion holds.

Formal statement
d n m :
ℕ
P :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
he :
∀ i, P.e (x i) ∈ Icc (0:ℝ) 1
hm :
∀ i (arm : Bool), (if arm then P.mu1 (x i) else P.mu0 (x i)) ∈ Icc (0:ℝ) 1
∫ s : RecordSpins n m, (∏ i ∈ V, recordLikelihood P x s i) ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))
= 1
Proof (Lean source)
lemma recordLikelihood_product_integral_one {d n m : ℕ} (P : PrimitiveLaw d) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (he : ∀ i, P.e (x i) ∈ Icc (0:ℝ) 1) (hm : ∀ i (arm : Bool), (if arm then P.mu1 (x i) else P.mu0 (x i)) ∈ Icc (0:ℝ) 1) : ∫ s : RecordSpins n m, (∏ i ∈ V, recordLikelihood P x s i) ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) = 1 := by classical letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance have hsplit (s : RecordSpins n m) : (∏ i ∈ V, recordLikelihood P x s i) = (∏ i : Fin n, if castAdd m i ∈ V then labelLikelihood P (x (castAdd m i)) (s.1 i) else 1) * (∏ j : Fin m, if natAdd n j ∈ V then auxiliaryLikelihood P (x (natAdd n j)) (s.2 j) else 1) := by have hv : (∏ i, if i ∈ V then recordLikelihood P x s i else 1) = ∏ i ∈ V, recordLikelihood P x s i := by rw [← Finset.prod_filter] congr 1 ext i simp rw [← hv, Fin.prod_univ_add] simp [recordLikelihood] simp_rw [hsplit] rw [integral_prod_mul (fun sl : Fin n → Bool × Bool => ∏ i, if castAdd m i ∈ V then labelLikelihood P (x (castAdd m i)) (sl i) else 1) (fun st : Fin m → Bool => ∏ j, if natAdd n j ∈ V then auxiliaryLikelihood P (x (natAdd n j)) (st j) else 1), integral_fintype_prod_eq_prod (fun (i : Fin n) s => if castAdd m i ∈ V then labelLikelihood P (x (castAdd m i)) s else 1), integral_fintype_prod_eq_prod (fun (j : Fin m) s => if natAdd n j ∈ V then auxiliaryLikelihood P (x (natAdd n j)) s else 1)] have hl (i : Fin n) : (∫ s, (if castAdd m i ∈ V then labelLikelihood P (x (castAdd m i)) s else 1) ∂fairObserved) = 1 := by split_ifs · exact labelLikelihood_integral_one P _ (he _) (hm _) · simp have ht (j : Fin m) : (∫ s, (if natAdd n j ∈ V then auxiliaryLikelihood P (x (natAdd n j)) s else 1) ∂bern (1/2)) = 1 := by split_ifs · exact auxiliaryLikelihood_integral_one P _ (he _) · rw [integral_const, probReal_univ, one_smul] simp only [hl, ht, Finset.prod_const_one, one_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordLikelihood_product_integral_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:48
theorem componentDensity_integral_one Lemma componentDensity_integral_one in the paper ↗

Averaging normalized selected record products over a probability prior gives normalized component densities, even for the empty selected set. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the specified input x, the specified input V, the specified input hw, the specified input he, the specified input hm, the component density integral one conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
hw :
∑ sigma, H.weight theta sigma = 1
he :
∀ sigma i, (H.law theta sigma).e (x i) ∈ Icc (0:ℝ) 1
hm :
∀ sigma i (arm : Bool),
(if arm then (H.law theta sigma).mu1 (x i) else (H.law theta sigma).mu0 (x i)) ∈ Icc (0:ℝ) 1
∫ s : RecordSpins n m, componentDensity H theta x V s ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))
= 1
Proof (Lean source)
lemma componentDensity_integral_one {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (hw : ∑ sigma, H.weight theta sigma = 1) (he : ∀ sigma i, (H.law theta sigma).e (x i) ∈ Icc (0:ℝ) 1) (hm : ∀ sigma i (arm : Bool), (if arm then (H.law theta sigma).mu1 (x i) else (H.law theta sigma).mu0 (x i)) ∈ Icc (0:ℝ) 1) : ∫ s : RecordSpins n m, componentDensity H theta x V s ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) = 1 := by letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance unfold componentDensity rw [integral_finset_sum _ (fun _ _ => Integrable.of_finite)] simp_rw [integral_const_mul, recordLikelihood_product_integral_one _ x V (he _) (hm _), mul_one] exact hw
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.componentDensity_integral_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:99
theorem marked_componentDensity_integral_one Lemma marked_componentDensity_integral_one in the paper ↗

The prescribed marked construction normalizes every component for every covariate vector; probability clipping supplies valid margins without extra premises. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input x, the specified input V, the marked component density integral one conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
∫ s : RecordSpins n m, componentDensity (markedHandle d h delta a b) theta x V s ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))
= 1
Proof (Lean source)
lemma marked_componentDensity_integral_one {d n m : ℕ} (h delta a b : ℝ) (theta : Bool) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) : ∫ s : RecordSpins n m, componentDensity (markedHandle d h delta a b) theta x V s ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) = 1 := by apply componentDensity_integral_one · exact (marked_prior_mass d h delta theta).2 · intro sigma i exact probabilityClip_mem _ · intro sigma i arm cases arm <;> exact probabilityClip_mem _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_componentDensity_integral_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:119
theorem componentDensity_nonneg Lemma componentDensity_nonneg in the paper ↗

Prior averages of nonnegative record likelihoods are nonnegative densities. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the specified input hw, the specified input x, the specified input V, the specified input s, the component density nonneg conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
hw :
∀ sigma, 0 ≤ H.weight theta sigma
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
s :
0 ≤ componentDensity H theta x V s
Proof (Lean source)
lemma componentDensity_nonneg {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) (hw : ∀ sigma, 0 ≤ H.weight theta sigma) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (s : RecordSpins n m) : 0 ≤ componentDensity H theta x V s := by unfold componentDensity apply Finset.sum_nonneg intro sigma _ apply mul_nonneg (hw sigma) apply Finset.prod_nonneg intro i _ induction i using Fin.addCases with | left j => simp only [recordLikelihood, Fin.addCases_left, labelLikelihood]; positivity | right j => simp only [recordLikelihood, Fin.addCases_right, auxiliaryLikelihood]; positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.componentDensity_nonneg · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:133
theorem marked_componentDensity_probability Lemma marked_componentDensity_probability in the paper ↗

Each marked component density defines a probability law on the common fair spin reference, supplying the normalization required by Hellinger subadditivity. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input x, the specified input V, the marked component density probability conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
IsProbabilityMeasure (((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))).withDensity (fun s => ofReal (componentDensity (markedHandle d h delta a b) theta x V s)))
Proof (Lean source)
lemma marked_componentDensity_probability {d n m : ℕ} (h delta a b : ℝ) (theta : Bool) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) : IsProbabilityMeasure (((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))).withDensity (fun s => ofReal (componentDensity (markedHandle d h delta a b) theta x V s))) := by letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance constructor rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ, ← ofReal_integral_eq_lintegral_ofReal (Integrable.of_finite) (Filter.Eventually.of_forall (fun s => componentDensity_nonneg _ theta (marked_prior_mass d h delta theta).1 x V s)), marked_componentDensity_integral_one] exact ENNReal.ofReal_one
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_componentDensity_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentNormalization.lean:148
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.ComponentProduct 9 declarations Finite spin coordinates may have different types in the labeled and auxiliary channels.

Hellinger assembly over independent finite coordinate blocks

Finite spin coordinates may have different types in the labeled and auxiliary channels. Regrouping their product weights proves affinity tensorization over components, the finite-product step of MC32.

theorem finite_dependent_fiber_weighted_sum Lemma finite_dependent_fiber_weighted_sum in the paper ↗

Regroup a dependent finite product distribution by the owner of each coordinate. Given the specified input S, the specified input owner, the specified input w, the specified input G, the finite dependent fiber weighted sum conclusion holds.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (S i)
owner :
ι → κ
w :
∀ i
if
S i
then
ℝ
G :
∀ c
if
(∀ z : {z // owner z = c}, S z.1)
then
ℝ
(∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * ∏ c, G c (fun z => sigma z.1))
= ∏ c, ∑ s : (∀ z : {z // owner z = c}, S z.1), (∏ z, w z.1 (s z)) * G c s
Proof (Lean source)
lemma finite_dependent_fiber_weighted_sum {ι κ : Type*} [Fintype ι] [Fintype κ] {S : ι → Type*} [∀ i, Fintype (S i)] (owner : ι → κ) (w : ∀ i, S i → ℝ) (G : ∀ c, (∀ z : {z // owner z = c}, S z.1) → ℝ) : (∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * ∏ c, G c (fun z => sigma z.1)) = ∏ c, ∑ s : (∀ z : {z // owner z = c}, S z.1), (∏ z, w z.1 (s z)) * G c s := by classical let e : (∀ i, S i) ≃ (∀ c, ∀ z : {z // owner z = c}, S z.1) := Equiv.piCongrFiberwise (fun _ => Equiv.refl _) calc _ = ∑ s : (∀ c, ∀ z : {z // owner z = c}, S z.1), ∏ c, (∏ z : {z // owner z = c}, w z.1 (s c z)) * G c (s c) := by apply Fintype.sum_equiv e intro sigma simp only [e, Equiv.piCongrFiberwise_apply, Equiv.refl_apply, Finset.prod_mul_distrib] rw [Fintype.prod_fiberwise owner (fun z => w z (sigma z))] _ = _ := (Fintype.prod_sum (fun c (s : ∀ z : {z // owner z = c}, S z.1) => (∏ z, w z.1 (s z)) * G c s)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_dependent_fiber_weighted_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:21
theorem finite_dependent_fiber_expectation_factorization Lemma finite_dependent_fiber_expectation_factorization in the paper ↗

Expectations multiply for functions of disjoint coordinate blocks, including empty blocks. Given the specified input S, the specified input owner, the specified input w, the specified input hw, the specified input F, the specified input hF, the finite dependent fiber expectation factorization conclusion holds.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (S i)
∀ i, Nonempty (S i)
owner :
ι → κ
w :
∀ i
if
S i
then
ℝ
hw :
∀ z, ∑ s, w z s = 1
F :
κ → (∀ i, S i) → ℝ
hF :
∀ c sigma sigma'
if
(∀ z, owner z = c → sigma z = sigma' z)
then
F c sigma = F c sigma'
(∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * ∏ c, F c sigma)
= ∏ c, ∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * F c sigma
Proof (Lean source)
lemma finite_dependent_fiber_expectation_factorization {ι κ : Type*} [Fintype ι] [Fintype κ] {S : ι → Type*} [∀ i, Fintype (S i)] [∀ i, Nonempty (S i)] (owner : ι → κ) (w : ∀ i, S i → ℝ) (hw : ∀ z, ∑ s, w z s = 1) (F : κ → (∀ i, S i) → ℝ) (hF : ∀ c sigma sigma', (∀ z, owner z = c → sigma z = sigma' z) → F c sigma = F c sigma') : (∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * ∏ c, F c sigma) = ∏ c, ∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * F c sigma := by classical let lift (c : κ) (s : ∀ z : {z // owner z = c}, S z.1) (z : ι) : S z := if hz : owner z = c then s ⟨z, hz⟩ else choice (inferInstance : Nonempty (S z)) let G (c : κ) (s : ∀ z : {z // owner z = c}, S z.1) : ℝ := F c (lift c s) have hG (c : κ) (sigma : ∀ i, S i) : F c sigma = G c (fun z => sigma z.1) := by apply hF intro z hz simp [lift, hz] have hmass (c : κ) : (∑ s : (∀ z : {z // owner z = c}, S z.1), ∏ z, w z.1 (s z)) = 1 := by rw [← Fintype.prod_sum] simp [hw] have hmarg (c : κ) : (∑ sigma : ∀ i, S i, (∏ z, w z (sigma z)) * F c sigma) = ∑ s : (∀ z : {z // owner z = c}, S z.1), (∏ z, w z.1 (s z)) * G c s := by have ht := finite_dependent_fiber_weighted_sum owner w (fun j s => if hj : j = c then G c (hj ▸ s) else 1) have hprod (sigma : ∀ i, S i) : (∏ j, if hj : j = c then G c (hj ▸ (fun z => sigma z.1)) else 1) = F c sigma := by simp [← hG] simp_rw [hprod] at ht rw [ht] have hsum (j : κ) : (∑ s : (∀ z : {z // owner z = j}, S z.1), (∏ z, w z.1 (s z)) * (if hj : j = c then G c (hj ▸ s) else 1)) = if hj : j = c then (∑ s : (∀ z : {z // owner z = c}, S z.1), (∏ z, w z.1 (s z)) * G c s) else 1 := by by_cases hj : j = c · subst j; simp · simp [hj, hmass] simp_rw [hsum] simp simp_rw [hG] at ⊢ rw [finite_dependent_fiber_weighted_sum] apply Finset.prod_congr rfl intro c _ exact (hmarg c).symm.trans (by simp_rw [hG])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_dependent_fiber_expectation_factorization · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:44
theorem integral_finite_block_product Lemma integral_finite_block_product in the paper ↗

A finite product reference with coordinate measures μ integrates block-dependent functions multiplicatively. Given the specified input S, the specified input owner, the specified input F, the specified input hF, the integral finite block product conclusion holds.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (S i)
∀ i, Nonempty (S i)
∀ i, MeasurableSpace (S i)
μ :
∀ i, Measure (S i)
∀ i, IsProbabilityMeasure (μ i)
owner :
ι → κ
F :
κ → (∀ i, S i) → ℝ
hF :
∀ c sigma sigma'
if
(∀ z, owner z = c → sigma z = sigma' z)
then
F c sigma = F c sigma'
(∫ sigma, ∏ c, F c sigma ∂Measure.pi μ) = ∏ c, ∫ sigma, F c sigma ∂Measure.pi μ
Proof (Lean source)
lemma integral_finite_block_product {ι κ : Type*} [Fintype ι] [Fintype κ] {S : ι → Type*} [∀ i, Fintype (S i)] [∀ i, Nonempty (S i)] [∀ i, MeasurableSpace (S i)] [∀ i, MeasurableSingletonClass (S i)] (μ : ∀ i, Measure (S i)) [∀ i, IsProbabilityMeasure (μ i)] (owner : ι → κ) (F : κ → (∀ i, S i) → ℝ) (hF : ∀ c sigma sigma', (∀ z, owner z = c → sigma z = sigma' z) → F c sigma = F c sigma') : (∫ sigma, ∏ c, F c sigma ∂Measure.pi μ) = ∏ c, ∫ sigma, F c sigma ∂Measure.pi μ := by have hw (i : ι) : ∑ s, (μ i).real {s} = 1 := by simpa using (integral_fintype (μ := μ i) (f := fun _ => (1:ℝ)) Integrable.of_finite).symm simp_rw [integral_fintype (μ := Measure.pi μ) Integrable.of_finite, measureReal_def, Measure.pi_singleton, ENNReal.toReal_prod, smul_eq_mul] exact finite_dependent_fiber_expectation_factorization owner (fun i s => (μ i).real {s}) hw F hF
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.integral_finite_block_product · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:91
theorem densityAffinity_finite_blocks Lemma densityAffinity_finite_blocks in the paper ↗

Affinity tensorizes across disjoint blocks of a finite product reference with coordinate measures μ. Given the specified input S, the specified input owner, the specified input f, the specified input g, the specified input hf0, the specified input hg0, the specified input hf, the specified input hg, the density affinity finite blocks conclusion holds.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (S i)
∀ i, Nonempty (S i)
∀ i, MeasurableSpace (S i)
μ :
∀ i, Measure (S i)
∀ i, IsProbabilityMeasure (μ i)
owner :
ι → κ
f g :
κ → (∀ i, S i) → ℝ
hf0 :
∀ c s, 0 ≤ f c s
hg0 :
∀ c s, 0 ≤ g c s
hf :
∀ c s t
if
(∀ z, owner z = c → s z = t z)
then
f c s = f c t
hg :
∀ c s t
if
(∀ z, owner z = c → s z = t z)
then
g c s = g c t
densityAffinity (Measure.pi μ) (fun s => ∏ c, f c s) (fun s => ∏ c, g c s)
= ∏ c, densityAffinity (Measure.pi μ) (f c) (g c)
Proof (Lean source)
lemma densityAffinity_finite_blocks {ι κ : Type*} [Fintype ι] [Fintype κ] {S : ι → Type*} [∀ i, Fintype (S i)] [∀ i, Nonempty (S i)] [∀ i, MeasurableSpace (S i)] [∀ i, MeasurableSingletonClass (S i)] (μ : ∀ i, Measure (S i)) [∀ i, IsProbabilityMeasure (μ i)] (owner : ι → κ) (f g : κ → (∀ i, S i) → ℝ) (hf0 : ∀ c s, 0 ≤ f c s) (hg0 : ∀ c s, 0 ≤ g c s) (hf : ∀ c s t, (∀ z, owner z = c → s z = t z) → f c s = f c t) (hg : ∀ c s t, (∀ z, owner z = c → s z = t z) → g c s = g c t) : densityAffinity (Measure.pi μ) (fun s => ∏ c, f c s) (fun s => ∏ c, g c s) = ∏ c, densityAffinity (Measure.pi μ) (f c) (g c) := by unfold densityAffinity simp_rw [← Finset.prod_mul_distrib, Real.sqrt_prod _ (fun c _ => mul_nonneg (hf0 c _) (hg0 c _))] apply integral_finite_block_product μ owner intro c s t hst rw [hf c s t hst, hg c s t hst]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.densityAffinity_finite_blocks · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:108
theorem density_hellinger_finite_blocks_le_sum Lemma density_hellinger_finite_blocks_le_sum in the paper ↗

Normalized component densities combine by Hellinger subadditivity on their actual shared spin space with coordinate measures μ, provided they use disjoint coordinate blocks. Given the specified input S, the specified input owner, the specified input f, the specified input g, the specified input hf0, the specified input hg0, the specified input hf1, the specified input hg1, the specified input hf, the specified input hg, the density hellinger finite blocks le sum conclusion holds.

Formal statement
ι κ :
Type*
ι → Type*
∀ i, Fintype (S i)
∀ i, Nonempty (S i)
∀ i, MeasurableSpace (S i)
μ :
∀ i, Measure (S i)
∀ i, IsProbabilityMeasure (μ i)
owner :
ι → κ
f g :
κ → (∀ i, S i) → ℝ
hf0 :
∀ c s, 0 ≤ f c s
hg0 :
∀ c s, 0 ≤ g c s
hf1 :
∀ c, ∫ s, f c s ∂Measure.pi μ = 1
hg1 :
∀ c, ∫ s, g c s ∂Measure.pi μ = 1
hf :
∀ c s t
if
(∀ z, owner z = c → s z = t z)
then
f c s = f c t
hg :
∀ c s t
if
(∀ z, owner z = c → s z = t z)
then
g c s = g c t
hellingerSqDensity (Measure.pi μ) (fun s => ∏ c, f c s) (fun s => ∏ c, g c s)
≤ ∑ c, hellingerSqDensity (Measure.pi μ) (f c) (g c)
Proof (Lean source)
lemma density_hellinger_finite_blocks_le_sum {ι κ : Type*} [Fintype ι] [Fintype κ] {S : ι → Type*} [∀ i, Fintype (S i)] [∀ i, Nonempty (S i)] [∀ i, MeasurableSpace (S i)] [∀ i, MeasurableSingletonClass (S i)] (μ : ∀ i, Measure (S i)) [∀ i, IsProbabilityMeasure (μ i)] (owner : ι → κ) (f g : κ → (∀ i, S i) → ℝ) (hf0 : ∀ c s, 0 ≤ f c s) (hg0 : ∀ c s, 0 ≤ g c s) (hf1 : ∀ c, ∫ s, f c s ∂Measure.pi μ = 1) (hg1 : ∀ c, ∫ s, g c s ∂Measure.pi μ = 1) (hf : ∀ c s t, (∀ z, owner z = c → s z = t z) → f c s = f c t) (hg : ∀ c s t, (∀ z, owner z = c → s z = t z) → g c s = g c t) : hellingerSqDensity (Measure.pi μ) (fun s => ∏ c, f c s) (fun s => ∏ c, g c s) ≤ ∑ c, hellingerSqDensity (Measure.pi μ) (f c) (g c) := by have hpf : (∫ s, ∏ c, f c s ∂Measure.pi μ) = 1 := by rw [integral_finite_block_product μ owner f hf] simp [hf1] have hpg : (∫ s, ∏ c, g c s ∂Measure.pi μ) = 1 := by rw [integral_finite_block_product μ owner g hg] simp [hg1] rw [hellingerSqDensity_eq_two_mul_one_sub_affinity _ _ _ Integrable.of_finite Integrable.of_finite (fun s => Finset.prod_nonneg (fun c _ => hf0 c s)) (fun s => Finset.prod_nonneg (fun c _ => hg0 c s)) hpf hpg, densityAffinity_finite_blocks μ owner f g hf0 hg0 hf hg] simp_rw [hellingerSqDensity_eq_two_mul_one_sub_affinity _ _ _ Integrable.of_finite Integrable.of_finite (hf0 _) (hg0 _) (hf1 _) (hg1 _)] rw [← Finset.mul_sum] apply mul_le_mul_of_nonneg_left _ (by norm_num : (0:ℝ) ≤ 2) exact one_sub_prod_le_sum _ (fun c => (densityAffinity_mem_unit _ _ _ Integrable.of_finite Integrable.of_finite (hf0 c) (hg0 c) (hf1 c) (hg1 c)).1) (fun c => (densityAffinity_mem_unit _ _ _ Integrable.of_finite Integrable.of_finite (hf0 c) (hg0 c) (hf1 c) (hg1 c)).2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.density_hellinger_finite_blocks_le_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:127
theorem componentDensity_spin_congr Lemma componentDensity_spin_congr in the paper ↗

A selected component density depends only on its selected record spins. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the specified input x, the specified input V, the specified input s, the specified input t, the specified input hl, the specified input ha, the component density spin congr conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
s t :
hl :
∀ i : Fin n
if
castAdd m i ∈ V
then
s.1 i = t.1 i
ha :
∀ j : Fin m
if
natAdd n j ∈ V
then
s.2 j = t.2 j
componentDensity H theta x V s = componentDensity H theta x V t
Proof (Lean source)
lemma componentDensity_spin_congr {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (s t : RecordSpins n m) (hl : ∀ i : Fin n, castAdd m i ∈ V → s.1 i = t.1 i) (ha : ∀ j : Fin m, natAdd n j ∈ V → s.2 j = t.2 j) : componentDensity H theta x V s = componentDensity H theta x V t := by unfold componentDensity apply Finset.sum_congr rfl intro sigma _ congr 1 apply Finset.prod_congr rfl intro i hi induction i using Fin.addCases with | left j => simp only [recordLikelihood, Fin.addCases_left, hl j hi] | right j => simp only [recordLikelihood, Fin.addCases_right, ha j hi]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.componentDensity_spin_congr · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:163
theorem marked_conditional_hellinger_le_component_sum Lemma marked_conditional_hellinger_le_component_sum in the paper ↗

The marked conditional Hellinger discrepancy is at most the sum of the component discrepancies (the tensorization part of MC32). No extra independence assumption is needed: the fair reference spins are independent by construction. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hd, the specified input hdh, the specified input hh, the specified input x, the specified input hx, the marked conditional hellinger le component sum conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
hd :
0 < delta
hdh :
delta ≤ h
hh :
h ≤ 1/2
x :
Fin (n+m) → Cov d
hx :
∀ i, x i ∈ cube d
hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x)
≤ ∑ c : (recordGraph h delta x).ConnectedComponent, hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (componentDensity (markedHandle d h delta a b) true x (componentVertices h delta x c)) (componentDensity (markedHandle d h delta a b) false x (componentVertices h delta x c))
Proof (Lean source)
lemma marked_conditional_hellinger_le_component_sum {d n m : ℕ} (h delta a b : ℝ) (hd : 0 < delta) (hdh : delta ≤ h) (hh : h ≤ 1/2) (x : Fin (n+m) → Cov d) (hx : ∀ i, x i ∈ cube d) : hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x) ≤ ∑ c : (recordGraph h delta x).ConnectedComponent, hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (componentDensity (markedHandle d h delta a b) true x (componentVertices h delta x c)) (componentDensity (markedHandle d h delta a b) false x (componentVertices h delta x c)) := by classical letI hBern := bern_probability (1/2) (by norm_num) letI hFair : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance let S : Fin n ⊕ Fin m → Type := elim (fun _ => Bool × Bool) (fun _ => Bool) letI : ∀ i, Fintype (S i) := fun i => by cases i <;> dsimp [S] <;> infer_instance letI : ∀ i, Nonempty (S i) := fun i => by cases i <;> dsimp [S] <;> infer_instance letI mS : ∀ i, MeasurableSpace (S i) := fun i => by cases i <;> dsimp [S] <;> infer_instance letI : ∀ i, MeasurableSingletonClass (S i) := fun i => by cases i <;> dsimp [S] <;> infer_instance let μ : ∀ i, Measure (S i) := Sum.rec (fun _ => fairObserved) (fun _ => bern (1/2)) letI hProb : ∀ i, IsProbabilityMeasure (μ i) := fun i => by cases i with | inl j => exact hFair | inr j => exact hBern letI hSigma : ∀ i, SigmaFinite (μ i) := fun i => by cases i with | inl j => exact (inferInstance : SigmaFinite fairObserved) | inr j => exact (inferInstance : SigmaFinite (bern (1/2))) have hi (F : RecordSpins n m → ℝ) : (∫ s, F (fun i => s (.inl i), fun j => s (.inr j)) ∂Measure.pi μ) = ∫ s, F s ∂(Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) := (@measurePreserving_sumPiEquivProdPi (Fin n) (Fin m) _ _ S mS μ hSigma).integral_comp' F let H := markedHandle d h delta a b let comp := (recordGraph h delta x).connectedComponentMk let owner : Fin n ⊕ Fin m → (recordGraph h delta x).ConnectedComponent := fun i => comp (i.elim (castAdd m) (natAdd n)) let f : (recordGraph h delta x).ConnectedComponent → (∀ i, S i) → ℝ := fun c s => componentDensity H true x (componentVertices h delta x c) (fun i => s (.inl i), fun j => s (.inr j)) let g : (recordGraph h delta x).ConnectedComponent → (∀ i, S i) → ℝ := fun c s => componentDensity H false x (componentVertices h delta x c) (fun i => s (.inl i), fun j => s (.inr j)) have hdep (theta : Bool) (c : (recordGraph h delta x).ConnectedComponent) (s t : ∀ i, S i) (hst : ∀ z, owner z = c → s z = t z) : componentDensity H theta x (componentVertices h delta x c) (fun i => s (.inl i), fun j => s (.inr j)) = componentDensity H theta x (componentVertices h delta x c) (fun i => t (.inl i), fun j => t (.inr j)) := by apply componentDensity_spin_congr · intro i hi exact hst (.inl i) (Finset.mem_filter.mp hi).2 · intro j hj exact hst (.inr j) (Finset.mem_filter.mp hj).2 have hb := @density_hellinger_finite_blocks_le_sum (Fin n ⊕ Fin m) (recordGraph h delta x).ConnectedComponent _ _ S _ _ mS _ μ hProb owner f g (fun c s => componentDensity_nonneg H true (marked_prior_mass d h delta true).1 _ _ _) (fun c s => componentDensity_nonneg H false (marked_prior_mass d h delta false).1 _ _ _) (fun c => (hi _).trans (marked_componentDensity_integral_one h delta a b true x _)) (fun c => (hi _).trans (marked_componentDensity_integral_one h delta a b false x _)) (hdep true) (hdep false) have hfactor := marked_conditional_factorization d h delta a b hd hdh hh n m x hx have hlhs : hellingerSqDensity (Measure.pi μ) (fun s => ∏ c, f c s) (fun s => ∏ c, g c s) = hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity H true x) (mixedDensity H false x) := by unfold hellingerSqDensity have hfprod (s : ∀ i, S i) : (∏ c, f c s) = mixedDensity H true x (fun i => s (.inl i), fun j => s (.inr j)) := (hfactor true _).symm have hgprod (s : ∀ i, S i) : (∏ c, g c s) = mixedDensity H false x (fun i => s (.inl i), fun j => s (.inr j)) := (hfactor false _).symm calc _ = ∫ s, (sqrt (mixedDensity H true x (fun i => s (.inl i), fun j => s (.inr j))) - sqrt (mixedDensity H false x (fun i => s (.inl i), fun j => s (.inr j))))^2 ∂Measure.pi μ := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun s => congrArg₂ (fun u v : ℝ => (sqrt u - sqrt v)^2) (hfprod s) (hgprod s)) _ = _ := hi (fun s => (sqrt (mixedDensity H true x s) - sqrt (mixedDensity H false x s))^2) have hrhs (c : (recordGraph h delta x).ConnectedComponent) : hellingerSqDensity (Measure.pi μ) (f c) (g c) = hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (componentDensity H true x (componentVertices h delta x c)) (componentDensity H false x (componentVertices h delta x c)) := by unfold hellingerSqDensity exact hi (fun s => (sqrt (componentDensity H true x (componentVertices h delta x c) s) - sqrt (componentDensity H false x (componentVertices h delta x c) s))^2) rwa [hlhs, show (∑ c, hellingerSqDensity (Measure.pi μ) (f c) (g c)) = _ from Finset.sum_congr rfl (fun c _ => hrhs c)] at hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_conditional_hellinger_le_component_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:180
theorem finite_size_weighted_count Lemma finite_size_weighted_count in the paper ↗

A component sum regrouped by size counts exactly the informative components. Given the specified input size, the specified input info, the specified input N, the specified input hsize, the specified input W, the finite size weighted count conclusion holds.

Formal statement
ι :
Type*
size :
ι → ℕ
info :
ι → Prop
N :
ℕ
hsize :
∀ i, size i ≤ N
W :
ℕ → ℝ
(∑ i, if 2 ≤ size i ∧ info i then W (size i) else 0)
= ∑ p ∈ Icc 2 N, W p * ((Finset.univ.filter (fun i => size i = p ∧ info i)).card : ℝ)
Proof (Lean source)
lemma finite_size_weighted_count {ι : Type*} [Fintype ι] (size : ι → ℕ) (info : ι → Prop) [DecidablePred info] (N : ℕ) (hsize : ∀ i, size i ≤ N) (W : ℕ → ℝ) : (∑ i, if 2 ≤ size i ∧ info i then W (size i) else 0) = ∑ p ∈ Icc 2 N, W p * ((Finset.univ.filter (fun i => size i = p ∧ info i)).card : ℝ) := by classical have hexpand (p : ℕ) : W p * ((Finset.univ.filter (fun i => size i = p ∧ info i)).card : ℝ) = ∑ i, if size i = p ∧ info i then W p else 0 := by rw [← Finset.sum_filter] simp [Finset.sum_const, mul_comm] simp_rw [hexpand] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro i _ by_cases hi : info i · by_cases hs : 2 ≤ size i · rw [if_pos ⟨hs, hi⟩] symm rw [Finset.sum_eq_single (size i)] · simp [hi] · intro p hp hne simp [Ne.symm hne] · intro hnot exact False.elim (hnot (Finset.mem_Icc.mpr ⟨hs, hsize i⟩)) · rw [if_neg (fun h => hs h.1)] symm apply Finset.sum_eq_zero intro p hp have hne : size i ≠ p := by intro heq exact hs (heq.symm ▸ (Finset.mem_Icc.mp hp).1) simp [hne] · simp [hi]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_size_weighted_count · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:278
theorem marked_conditional_hellinger_count_bound Lemma marked_conditional_hellinger_count_bound in the paper ↗

MC32 before integration over covariates: only components of size at least two containing a label contribute, and they are grouped by their exact size. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked conditional hellinger count bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c K : ℝ,
0 < c
c ≤ 1
0 < K
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
n m (x : Fin (n+m) → Cov d) :
(∀ i, x i ∈ cube d)
hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x)
≤ K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ)
Proof (Lean source)
lemma marked_conditional_hellinger_count_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c K : ℝ, 0 < c ∧ c ≤ 1 ∧ 0 < K ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ n m (x : Fin (n+m) → Cov d), (∀ i, x i ∈ cube d) → hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x) ≤ K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) := by classical obtain ⟨cH, K, hcH, hcH1, hK, hbound⟩ := marked_component_hellinger_bound d alpha beta gamma L eps hdom obtain ⟨cU, hcU, hcU1, huninf⟩ := uninformative_component_equality d alpha beta gamma L eps hdom let c := min cH cU have hc : 0 < c := lt_min hcH hcU refine ⟨c, K, hc, (min_le_left _ _).trans hcH1, hK, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab n m x hx letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance let μ := (Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) let H := markedHandle d h delta a b have hamp (c' : ℝ) (hcc : c ≤ c') : a ≤ c'*delta^alpha ∧ b ≤ c'*delta^beta ∧ a*b ≤ c'*h^gamma := ⟨hac.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos hd _).le), hbc.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos hd _).le), hab.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos (hd.trans_le hdh) _).le)⟩ have hH := hamp cH (min_le_left _ _) have hU := hamp cU (min_le_right _ _) have hzero := huninf h delta a b hd hdh hh ha hU.1 hb hU.2.1 hU.2.2 n m x hx let size := fun c => (componentVertices h delta x c).card let info := fun c => ∃ i ∈ componentVertices h delta x c, i.val < n have hsize (c : (recordGraph h delta x).ConnectedComponent) : size c ≤ n+m := by exact (Finset.card_le_card (Finset.subset_univ _)).trans_eq (by simp) have hcomp (c : (recordGraph h delta x).ConnectedComponent) : hellingerSqDensity μ (componentDensity H true x (componentVertices h delta x c)) (componentDensity H false x (componentVertices h delta x c)) ≤ if 2 ≤ size c ∧ info c then K*a^2*b^2*(9/2:ℝ)^(size c)*(size c:ℝ)^4 else 0 := by split_ifs with hinf · have hbnd := hbound h delta a b hd hdh hh ha hH.1 hb hH.2.1 hH.2.2 n m x hx (componentVertices h delta x c) μ inferInstance convert hbnd using 1 <;> ring · have heq : ∀ s, componentDensity H true x (componentVertices h delta x c) s = componentDensity H false x (componentVertices h delta x c) s := by by_cases hi : info c · have hs : ¬ 2 ≤ size c := fun hs => hinf ⟨hs, hi⟩ have hn : (componentVertices h delta x c).Nonempty := by obtain ⟨i, hiV, _⟩ := hi exact ⟨i, hiV⟩ have hs1 : size c = 1 := by have := Finset.card_pos.mpr hn; dsimp [size] at *; omega exact hzero c (inr ⟨hs1, hi⟩) · apply hzero c left intro i hiV by_contra hni exact hi ⟨i, hiV, by omega⟩ unfold hellingerSqDensity simp only [heq, sub_self, zero_pow (by decide : 2 ≠ 0), integral_zero, le_refl] calc _ ≤ ∑ c, hellingerSqDensity μ (componentDensity H true x (componentVertices h delta x c)) (componentDensity H false x (componentVertices h delta x c)) := marked_conditional_hellinger_le_component_sum h delta a b hd hdh hh x hx _ ≤ ∑ c, if 2 ≤ size c ∧ info c then K*a^2*b^2*(9/2:ℝ)^(size c)*(size c:ℝ)^4 else 0 := Finset.sum_le_sum (fun c _ => hcomp c) _ = K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * ((Finset.univ.filter (fun c => size c = p ∧ info c)).card : ℝ) := by calc _ = ∑ p ∈ Icc 2 (n+m), (K*a^2*b^2*(9/2:ℝ)^p*(p:ℝ)^4) * ((Finset.univ.filter (fun c => size c = p ∧ info c)).card : ℝ) := by with_reducible exact (@finite_size_weighted_count (recordGraph h delta x).ConnectedComponent (inferInstance : Fintype (recordGraph h delta x).ConnectedComponent) size info (inferInstance : DecidablePred info) (n+m) hsize (fun p => K*a^2*b^2*(9/2:ℝ)^p*(p:ℝ)^4)) _ = _ := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro p _ ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_conditional_hellinger_count_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/ComponentProduct.lean:315
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.Components 27 declarations Two-channel point-CATE annotation frontier: Lower/Components constructions and obligations.

Lower/Components

Two-channel point-CATE annotation frontier: Lower/Components constructions and obligations.

def maxDist

Given the specified input x, the specified input xp, max dist is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
x xp :
Cov d
maxDist x xp :
ℝ
Finset.univ.sup' (Finset.univ_nonempty : (Finset.univ : Finset (Fin (d+1))).Nonempty) (fun i : Fin (d+1) => if hi : i.val < d then |x ⟨i.val,hi⟩-xp ⟨i.val,hi⟩| else 0)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.maxDist · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:26

Given the specified input h, the specified input delta, the specified input x, the specified input i, the specified input j, record adj is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
h delta :
ℝ
x :
Fin (n+m) → Cov d
i j :
Fin (n+m)
recordAdj h delta x i j :
Prop
clause 1
i ≠ j
clause 2
x i ∈ locCube d h
clause 3
x j ∈ locCube d h
clause 4
maxDist (x i) (x j) ≤ 2*delta
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordAdj · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:29

Given the specified input x, the specified input xp, the max dist comm conclusion holds.

Formal statement
d :
ℕ
shared
x xp :
Cov d
maxDist x xp = maxDist xp x
Proof (Lean source)
lemma maxDist_comm (x xp : Cov d) : maxDist x xp = maxDist xp x := by unfold maxDist congr 1 funext i split_ifs <;> simp only [abs_sub_comm]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.maxDist_comm · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:32

Given the specified input h, the specified input delta, the specified input x, the record adj symmetric conclusion holds.

Formal statement
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
h delta :
ℝ
x :
Fin (n+m) → Cov d
Symm (recordAdj h delta x)
Proof (Lean source)
lemma recordAdj_symmetric (h delta : ℝ) (x : Fin (n+m) → Cov d) : Symm (recordAdj h delta x) := by constructor intro i j hij rcases hij with ⟨hne, hi, hj, hdist⟩ exact ⟨hne.symm, hj, hi, by simpa only [maxDist_comm (x j) (x i)] using hdist⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordAdj_symmetric · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:39

Given the specified input h, the specified input delta, the specified input x, the record adj irreflexive conclusion holds.

Formal statement
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
h delta :
ℝ
x :
Fin (n+m) → Cov d
Irrefl (recordAdj h delta x)
Proof (Lean source)
lemma recordAdj_irreflexive (h delta : ℝ) (x : Fin (n+m) → Cov d) : Irrefl (recordAdj h delta x) := by constructor intro i hii exact hii.1 rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordAdj_irreflexive · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:45
def recordGraph

Given the specified input h, the specified input delta, the specified input x, record graph is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
h delta :
ℝ
x :
Fin (n+m) → Cov d
recordGraph h delta x :
clause 1
Adj := recordAdj h delta x
clause 2
symm := recordAdj_symmetric h delta x
clause 3
loopless := recordAdj_irreflexive h delta x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordGraph · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:50
instance instFintypeConnectedComponentFinHAddNatRecordGraph

For bandwidth h, proximity radius δ, and the covariate record x, the connected components of the record graph form a finite type.

Definition (Lean source)
instance (h delta : ℝ) (x : Fin (n+m) → Cov d) : Fintype (recordGraph h delta x).ConnectedComponent := ofFinite _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.instFintypeConnectedComponentFinHAddNatRecordGraph · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:55
def componentVertices

Given the specified input h, the specified input delta, the specified input x, the specified input c, component vertices is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
h delta :
ℝ
x :
Fin (n+m) → Cov d
componentVertices h delta x c :
Finset (Fin (n+m))
Finset.univ.filter (fun i => (recordGraph h delta x).connectedComponentMk i = c)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.componentVertices · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:57
def componentDensity

Given the specified input H, the specified input theta, the specified input x, the specified input V, the specified input s, component density is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
H :
theta :
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
s :
componentDensity H theta x V s :
ℝ
∑ sigma, H.weight theta sigma * ∏ i ∈ V, recordLikelihood (H.law theta sigma) x s i
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.componentDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:61

Explicit conditional factorization over the covariate proximity graph. Given the specified input H, the specified input h, the specified input delta, the specified input n, the specified input m, conditional factorization is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
h delta :
ℝ
n m :
ℕ
x :
Fin (n+m) → Cov d
(∀ i, x i ∈ cube d)
theta (s : RecordSpins n m) :
ConditionalFactorization H h delta n m :
Prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ConditionalFactorization · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:65

The uninformative components have identical full conditional laws, expressed in their fair-spin densities. Given the specified input H, the specified input h, the specified input delta, the specified input n, the specified input m, uninformative components agree is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
h delta :
ℝ
n m :
ℕ
x :
Fin (n+m) → Cov d
(∀ i, x i ∈ cube d)
UninformativeComponentsAgree H h delta n m :
Prop
V :
componentVertices h delta x c
((∀ i ∈ V, n ≤ i.val) ∨ (V.card = 1 ∧ ∃ i ∈ V, i.val < n))
s :
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.UninformativeComponentsAgree · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:71
theorem finite_product_perturbation_bound Lemma finite_product_perturbation_bound in the paper ↗

Telescoping a product of bounded factors controls its perturbation by the sum of the factor perturbations, including the empty product. Given the specified input V, the specified input f, the specified input g, the specified input M, the specified input hM, the specified input hf, the specified input hg, the finite product perturbation bound conclusion holds.

Formal statement
ι :
Type*
V :
f g :
ι → ℝ
M :
ℝ
hM :
1 ≤ M
hf :
∀ i ∈ V, |f i| ≤ M
hg :
∀ i ∈ V, |g i| ≤ M
|(∏ i ∈ V, f i) - ∏ i ∈ V, g i| ≤ M^V.card * ∑ i ∈ V, |f i - g i|
Proof (Lean source)
lemma finite_product_perturbation_bound {ι : Type*} (V : Finset ι) (f g : ι → ℝ) (M : ℝ) (hM : 1 ≤ M) (hf : ∀ i ∈ V, |f i| ≤ M) (hg : ∀ i ∈ V, |g i| ≤ M) : |(∏ i ∈ V, f i) - ∏ i ∈ V, g i| ≤ M^V.card * ∑ i ∈ V, |f i - g i| := by classical induction V using Finset.induction_on with | empty => simp | @insert i V hi ih => have hfV := fun j hj => hf j (Finset.mem_insert_of_mem hj) have hgV := fun j hj => hg j (Finset.mem_insert_of_mem hj) have hprod : |∏ j ∈ V, g j| ≤ M^V.card := by rw [Finset.abs_prod] calc (∏ j ∈ V, |g j|) ≤ ∏ _j ∈ V, M := Finset.prod_le_prod (fun _ _ => abs_nonneg _) hgV _ = M^V.card := by rw [Finset.prod_const] have hsum : 0 ≤ ∑ j ∈ V, |f j - g j| := Finset.sum_nonneg (fun _ _ => abs_nonneg _) rw [Finset.prod_insert hi, Finset.prod_insert hi, Finset.card_insert_of_notMem hi, Finset.sum_insert hi, pow_succ] calc |f i * (∏ j ∈ V, f j) - g i * ∏ j ∈ V, g j| = |f i * ((∏ j ∈ V, f j) - ∏ j ∈ V, g j) + (f i - g i) * ∏ j ∈ V, g j| := by congr 1; ring _ ≤ |f i| * |(∏ j ∈ V, f j) - ∏ j ∈ V, g j| + |f i - g i| * |∏ j ∈ V, g j| := by simpa only [abs_mul] using abs_add_le (f i * ((∏ j ∈ V, f j) - ∏ j ∈ V, g j)) ((f i - g i) * ∏ j ∈ V, g j) _ ≤ M * (M^V.card * ∑ j ∈ V, |f j - g j|) + |f i - g i| * M^V.card := by gcongr · exact hf i (Finset.mem_insert_self i V) · exact ih hfV hgV _ ≤ M * (M^V.card * ∑ j ∈ V, |f j - g j|) + |f i - g i| * (M^V.card * M) := by gcongr exact le_mul_of_one_le_right (pow_nonneg (by linarith) _) hM _ = M^V.card * M * (|f i - g i| + ∑ j ∈ V, |f j - g j|) := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_product_perturbation_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:78
theorem finite_product_deviation_bound Lemma finite_product_deviation_bound in the paper ↗

A product of small perturbations of one keeps the amplitude as a factor. Given the specified input V, the specified input f, the specified input M, the specified input D, the specified input hM, the specified input hf, the specified input hD, the finite product deviation bound conclusion holds.

Formal statement
ι :
Type*
V :
f :
ι → ℝ
M D :
ℝ
hM :
1 ≤ M
hf :
∀ i ∈ V, |f i| ≤ M
hD :
∀ i ∈ V, |f i - 1| ≤ D
|(∏ i ∈ V, f i) - 1| ≤ (V.card : ℝ) * D * M^V.card
Proof (Lean source)
lemma finite_product_deviation_bound {ι : Type*} (V : Finset ι) (f : ι → ℝ) (M D : ℝ) (hM : 1 ≤ M) (hf : ∀ i ∈ V, |f i| ≤ M) (hD : ∀ i ∈ V, |f i - 1| ≤ D) : |(∏ i ∈ V, f i) - 1| ≤ (V.card : ℝ) * D * M^V.card := by have hp := finite_product_perturbation_bound V f (fun _ => 1) M hM hf (fun _ _ => by simpa only [abs_one] using hM) simp only [Finset.prod_const_one] at hp calc _ ≤ M^V.card * ∑ i ∈ V, |f i - 1| := hp _ ≤ M^V.card * ∑ _i ∈ V, D := by exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum hD) (pow_nonneg (by linarith) _) _ = _ := by simp only [Finset.sum_const, nsmul_eq_mul]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_product_deviation_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:121
theorem finite_prior_absolute_bound Lemma finite_prior_absolute_bound in the paper ↗

Averaging over a finite probability prior preserves a uniform absolute bound. Given the specified input S, the specified input w, the specified input F, the specified input hw, the specified input hmass, the specified input D, the specified input hF, the finite prior absolute bound conclusion holds.

Formal statement
S :
Type*
w F :
S → ℝ
hw :
∀ s, 0 ≤ w s
hmass :
∑ s, w s = 1
D :
ℝ
hF :
∀ s, |F s| ≤ D
|∑ s, w s * F s| ≤ D
Proof (Lean source)
lemma finite_prior_absolute_bound {S : Type*} [Fintype S] (w F : S → ℝ) (hw : ∀ s, 0 ≤ w s) (hmass : ∑ s, w s = 1) (D : ℝ) (hF : ∀ s, |F s| ≤ D) : |∑ s, w s * F s| ≤ D := by calc _ ≤ ∑ s, |w s * F s| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ s, w s * |F s| := by apply Finset.sum_congr rfl intro s _ rw [abs_mul, abs_of_nonneg (hw s)] _ ≤ ∑ s, w s * D := Finset.sum_le_sum (fun s _ => mul_le_mul_of_nonneg_left (hF s) (hw s)) _ = D := by rw [← Finset.sum_mul, hmass, one_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_absolute_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:135
theorem finite_prior_common_marginals_cancel Lemma finite_prior_common_marginals_cancel in the paper ↗

Equal one-channel marginals cancel, leaving only the product of the two centered channel factors in the difference between mixture expectations (MC27). Given the specified input S, the specified input wplus, the specified input wminus, the specified input A, the specified input B, the specified input hp, the specified input hm, the specified input hA, the specified input hB, the finite prior common marginals cancel conclusion holds.

Formal statement
S :
Type*
wplus wminus A B :
S → ℝ
hp :
∑ s, wplus s = 1
hm :
∑ s, wminus s = 1
hA :
∑ s, wplus s * A s = ∑ s, wminus s * A s
hB :
∑ s, wplus s * B s = ∑ s, wminus s * B s
(∑ s, wplus s * (A s * B s)) - (∑ s, wminus s * (A s * B s))
= (∑ s, wplus s * ((A s - 1) * (B s - 1))) - (∑ s, wminus s * ((A s - 1) * (B s - 1)))
Proof (Lean source)
lemma finite_prior_common_marginals_cancel {S : Type*} [Fintype S] (wplus wminus A B : S → ℝ) (hp : ∑ s, wplus s = 1) (hm : ∑ s, wminus s = 1) (hA : ∑ s, wplus s * A s = ∑ s, wminus s * A s) (hB : ∑ s, wplus s * B s = ∑ s, wminus s * B s) : (∑ s, wplus s * (A s * B s)) - (∑ s, wminus s * (A s * B s)) = (∑ s, wplus s * ((A s - 1) * (B s - 1))) - (∑ s, wminus s * ((A s - 1) * (B s - 1))) := by have hexpand (w : S → ℝ) : (∑ s, w s * ((A s - 1) * (B s - 1))) = (∑ s, w s * (A s * B s)) - (∑ s, w s * A s) - (∑ s, w s * B s) + ∑ s, w s := by simp_rw [show ∀ s, w s * ((A s - 1) * (B s - 1)) = w s * (A s * B s) - w s * A s - w s * B s + w s by intro s; ring] rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, Finset.sum_sub_distrib] rw [hexpand, hexpand, hp, hm, hA, hB] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_common_marginals_cancel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:149
theorem finite_prior_two_channel_bound Lemma finite_prior_two_channel_bound in the paper ↗

The difference of two finite mixture expectations retains both channel amplitudes when their separate marginals agree (MC27--MC28). Given the specified input S, the specified input wplus, the specified input wminus, the specified input A, the specified input B, the specified input hwp, the specified input hwm, the specified input hp, the specified input hm, the specified input hA, the specified input hB, the specified input UA, the specified input UB, the specified input hUA, the specified input hUB, the specified input hAb, the specified input hBb, the finite prior two channel bound conclusion holds.

Formal statement
S :
Type*
wplus wminus A B :
S → ℝ
hwp :
∀ s, 0 ≤ wplus s
hwm :
∀ s, 0 ≤ wminus s
hp :
∑ s, wplus s = 1
hm :
∑ s, wminus s = 1
hA :
∑ s, wplus s * A s = ∑ s, wminus s * A s
hB :
∑ s, wplus s * B s = ∑ s, wminus s * B s
UA UB :
ℝ
hUA :
0 ≤ UA
hUB :
0 ≤ UB
hAb :
∀ s, |A s - 1| ≤ UA
hBb :
∀ s, |B s - 1| ≤ UB
|(∑ s, wplus s * (A s * B s)) - (∑ s, wminus s * (A s * B s))| ≤ 2 * UA * UB
Proof (Lean source)
lemma finite_prior_two_channel_bound {S : Type*} [Fintype S] (wplus wminus A B : S → ℝ) (hwp : ∀ s, 0 ≤ wplus s) (hwm : ∀ s, 0 ≤ wminus s) (hp : ∑ s, wplus s = 1) (hm : ∑ s, wminus s = 1) (hA : ∑ s, wplus s * A s = ∑ s, wminus s * A s) (hB : ∑ s, wplus s * B s = ∑ s, wminus s * B s) (UA UB : ℝ) (hUA : 0 ≤ UA) (hUB : 0 ≤ UB) (hAb : ∀ s, |A s - 1| ≤ UA) (hBb : ∀ s, |B s - 1| ≤ UB) : |(∑ s, wplus s * (A s * B s)) - (∑ s, wminus s * (A s * B s))| ≤ 2 * UA * UB := by rw [finite_prior_common_marginals_cancel wplus wminus A B hp hm hA hB] have hcenter (s : S) : |(A s - 1) * (B s - 1)| ≤ UA * UB := by rw [abs_mul] exact mul_le_mul (hAb s) (hBb s) (abs_nonneg _) hUA have hplus := finite_prior_absolute_bound wplus _ hwp hp (UA * UB) hcenter have hminus := finite_prior_absolute_bound wminus _ hwm hm (UA * UB) hcenter exact (abs_sub _ _).trans (by linarith)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_two_channel_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:169
theorem finite_prior_product_channel_bound Lemma finite_prior_product_channel_bound in the paper ↗

Two product channels with common marginal expectations retain the product of their factor amplitudes, rather than either amplitude alone. Given the specified input S, the specified input V, the specified input W, the specified input f, the specified input g, the specified input wplus, the specified input wminus, the specified input hwp, the specified input hwm, the specified input hp, the specified input hm, the specified input hA, the specified input hB, the specified input M, the specified input DA, the specified input DB, the specified input hM, the specified input hDA, the specified input hDB, the specified input hf, the specified input hg, the specified input hfd, the specified input hgd, the finite prior product channel bound conclusion holds.

Formal statement
S ι κ :
Type*
V :
W :
f :
S → ι → ℝ
g :
S → κ → ℝ
wplus wminus :
S → ℝ
hwp :
∀ s, 0 ≤ wplus s
hwm :
∀ s, 0 ≤ wminus s
hp :
∑ s, wplus s = 1
hm :
∑ s, wminus s = 1
hA :
∑ s, wplus s * (∏ i ∈ V, f s i) = ∑ s, wminus s * (∏ i ∈ V, f s i)
hB :
∑ s, wplus s * (∏ i ∈ W, g s i) = ∑ s, wminus s * (∏ i ∈ W, g s i)
M DA DB :
ℝ
hM :
1 ≤ M
hDA :
0 ≤ DA
hDB :
0 ≤ DB
hf :
∀ s i
if
i ∈ V
then
|f s i| ≤ M
hg :
∀ s i
if
i ∈ W
then
|g s i| ≤ M
hfd :
∀ s i
if
i ∈ V
then
|f s i - 1| ≤ DA
hgd :
∀ s i
if
i ∈ W
then
|g s i - 1| ≤ DB
|(∑ s, wplus s * ((∏ i ∈ V, f s i) * ∏ i ∈ W, g s i))
- (∑ s, wminus s * ((∏ i ∈ V, f s i) * ∏ i ∈ W, g s i))|
≤ 2 * ((V.card : ℝ) * DA * M^V.card) * ((W.card : ℝ) * DB * M^W.card)
Proof (Lean source)
lemma finite_prior_product_channel_bound {S ι κ : Type*} [Fintype S] (V : Finset ι) (W : Finset κ) (f : S → ι → ℝ) (g : S → κ → ℝ) (wplus wminus : S → ℝ) (hwp : ∀ s, 0 ≤ wplus s) (hwm : ∀ s, 0 ≤ wminus s) (hp : ∑ s, wplus s = 1) (hm : ∑ s, wminus s = 1) (hA : ∑ s, wplus s * (∏ i ∈ V, f s i) = ∑ s, wminus s * (∏ i ∈ V, f s i)) (hB : ∑ s, wplus s * (∏ i ∈ W, g s i) = ∑ s, wminus s * (∏ i ∈ W, g s i)) (M DA DB : ℝ) (hM : 1 ≤ M) (hDA : 0 ≤ DA) (hDB : 0 ≤ DB) (hf : ∀ s i, i ∈ V → |f s i| ≤ M) (hg : ∀ s i, i ∈ W → |g s i| ≤ M) (hfd : ∀ s i, i ∈ V → |f s i - 1| ≤ DA) (hgd : ∀ s i, i ∈ W → |g s i - 1| ≤ DB) : |(∑ s, wplus s * ((∏ i ∈ V, f s i) * ∏ i ∈ W, g s i)) - (∑ s, wminus s * ((∏ i ∈ V, f s i) * ∏ i ∈ W, g s i))| ≤ 2 * ((V.card : ℝ) * DA * M^V.card) * ((W.card : ℝ) * DB * M^W.card) := by apply finite_prior_two_channel_bound wplus wminus _ _ hwp hwm hp hm hA hB · positivity · positivity · intro s exact finite_product_deviation_bound V (f s) M DA hM (hf s) (hfd s) · intro s exact finite_product_deviation_bound W (g s) M DB hM (hg s) (hgd s)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_product_channel_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:189
theorem finite_prior_contrast_deletion_bound Lemma finite_prior_contrast_deletion_bound in the paper ↗

Adding the two contrast-deletion errors to the centered channel bound assembles the finite-mixture information estimate of MC26--MC29. Given the specified input S, the specified input wplus, the specified input wminus, the specified input A, the specified input B, the specified input Fplus, the specified input Fminus, the specified input hwp, the specified input hwm, the specified input hp, the specified input hm, the specified input hA, the specified input hB, the specified input UA, the specified input UB, the specified input Dplus, the specified input Dminus, the specified input hUA, the specified input hUB, the specified input hAb, the specified input hBb, the specified input hdelp, the specified input hdelm, the finite prior contrast deletion bound conclusion holds.

Formal statement
S :
Type*
wplus wminus A B Fplus Fminus :
S → ℝ
hwp :
∀ s, 0 ≤ wplus s
hwm :
∀ s, 0 ≤ wminus s
hp :
∑ s, wplus s = 1
hm :
∑ s, wminus s = 1
hA :
∑ s, wplus s * A s = ∑ s, wminus s * A s
hB :
∑ s, wplus s * B s = ∑ s, wminus s * B s
UA UB Dplus Dminus :
ℝ
hUA :
0 ≤ UA
hUB :
0 ≤ UB
hAb :
∀ s, |A s - 1| ≤ UA
hBb :
∀ s, |B s - 1| ≤ UB
hdelp :
∀ s, |Fplus s - A s * B s| ≤ Dplus
hdelm :
∀ s, |Fminus s - A s * B s| ≤ Dminus
|(∑ s, wplus s * Fplus s) - (∑ s, wminus s * Fminus s)| ≤ Dplus + 2 * UA * UB + Dminus
Proof (Lean source)
lemma finite_prior_contrast_deletion_bound {S : Type*} [Fintype S] (wplus wminus A B Fplus Fminus : S → ℝ) (hwp : ∀ s, 0 ≤ wplus s) (hwm : ∀ s, 0 ≤ wminus s) (hp : ∑ s, wplus s = 1) (hm : ∑ s, wminus s = 1) (hA : ∑ s, wplus s * A s = ∑ s, wminus s * A s) (hB : ∑ s, wplus s * B s = ∑ s, wminus s * B s) (UA UB Dplus Dminus : ℝ) (hUA : 0 ≤ UA) (hUB : 0 ≤ UB) (hAb : ∀ s, |A s - 1| ≤ UA) (hBb : ∀ s, |B s - 1| ≤ UB) (hdelp : ∀ s, |Fplus s - A s * B s| ≤ Dplus) (hdelm : ∀ s, |Fminus s - A s * B s| ≤ Dminus) : |(∑ s, wplus s * Fplus s) - (∑ s, wminus s * Fminus s)| ≤ Dplus + 2 * UA * UB + Dminus := by have hdel (w F : S → ℝ) (hw : ∀ s, 0 ≤ w s) (hmass : ∑ s, w s = 1) (D : ℝ) (hF : ∀ s, |F s - A s * B s| ≤ D) : |(∑ s, w s * F s) - (∑ s, w s * (A s * B s))| ≤ D := by rw [← Finset.sum_sub_distrib] simp_rw [← mul_sub] exact finite_prior_absolute_bound w _ hw hmass D hF have hdplus := hdel wplus Fplus hwp hp Dplus hdelp have hdminus := hdel wminus Fminus hwm hm Dminus hdelm have hchannel := finite_prior_two_channel_bound wplus wminus A B hwp hwm hp hm hA hB UA UB hUA hUB hAb hBb have htriangle := abs_sub_le (∑ s, wplus s * Fplus s) (∑ s, wplus s * (A s * B s)) (∑ s, wminus s * Fminus s) have htriangle' := abs_sub_le (∑ s, wplus s * (A s * B s)) (∑ s, wminus s * (A s * B s)) (∑ s, wminus s * Fminus s) rw [abs_sub_comm (∑ s, wminus s * (A s * B s))] at htriangle' linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_contrast_deletion_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:213
theorem finite_fiber_weighted_sum Lemma finite_fiber_weighted_sum in the paper ↗

Regrouping independent sign coordinates by their owner factors a finite weighted sum. Given the specified input S, the specified input owner, the specified input w, the specified input G, the finite fiber weighted sum conclusion holds.

Formal statement
ι κ S :
owner :
ι → κ
w :
ι → S → ℝ
G :
∀ c
if
({z // owner z = c} → S)
then
ℝ
(∑ sigma : ι → S, (∏ z, w z (sigma z)) * ∏ c, G c (fun z => sigma z.1))
= ∏ c, ∑ s : {z // owner z = c} → S, (∏ z, w z.1 (s z)) * G c s
Proof (Lean source)
lemma finite_fiber_weighted_sum {ι κ S : Type*} [Fintype ι] [Fintype κ] [Fintype S] (owner : ι → κ) (w : ι → S → ℝ) (G : ∀ c, ({z // owner z = c} → S) → ℝ) : (∑ sigma : ι → S, (∏ z, w z (sigma z)) * ∏ c, G c (fun z => sigma z.1)) = ∏ c, ∑ s : {z // owner z = c} → S, (∏ z, w z.1 (s z)) * G c s := by let e : (ι → S) ≃ (∀ c, {z // owner z = c} → S) := Equiv.piCongrFiberwise (fun _ => Equiv.refl _) calc _ = ∑ s : ∀ c, {z // owner z = c} → S, ∏ c, (∏ z : {z // owner z = c}, w z.1 (s c z)) * G c (s c) := by apply Fintype.sum_equiv e intro sigma simp only [e, Equiv.piCongrFiberwise_apply, Equiv.refl_apply, Finset.prod_mul_distrib] rw [Fintype.prod_fiberwise owner (fun z => w z (sigma z))] _ = _ := (Fintype.prod_sum (fun c (s : {z // owner z = c} → S) => (∏ z, w z.1 (s z)) * G c s)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_fiber_weighted_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:244
theorem finite_fiber_expectation_factorization Lemma finite_fiber_expectation_factorization in the paper ↗

Expectations of functions depending on separate coordinate blocks multiply under a normalized product prior. Given the specified input S, the specified input owner, the specified input w, the specified input hw, the specified input F, the specified input hF, the finite fiber expectation factorization conclusion holds.

Formal statement
ι κ S :
Type*
Nonempty S
owner :
ι → κ
w :
ι → S → ℝ
hw :
∀ z, ∑ s, w z s = 1
F :
κ → (ι → S) → ℝ
hF :
∀ c sigma sigma'
if
(∀ z, owner z = c → sigma z = sigma' z)
then
F c sigma = F c sigma'
(∑ sigma : ι → S, (∏ z, w z (sigma z)) * ∏ c, F c sigma)
= ∏ c, ∑ sigma : ι → S, (∏ z, w z (sigma z)) * F c sigma
Proof (Lean source)
lemma finite_fiber_expectation_factorization {ι κ S : Type*} [Fintype ι] [Fintype κ] [Fintype S] [Nonempty S] (owner : ι → κ) (w : ι → S → ℝ) (hw : ∀ z, ∑ s, w z s = 1) (F : κ → (ι → S) → ℝ) (hF : ∀ c sigma sigma', (∀ z, owner z = c → sigma z = sigma' z) → F c sigma = F c sigma') : (∑ sigma : ι → S, (∏ z, w z (sigma z)) * ∏ c, F c sigma) = ∏ c, ∑ sigma : ι → S, (∏ z, w z (sigma z)) * F c sigma := by let lift (c : κ) (s : {z // owner z = c} → S) (z : ι) : S := if hz : owner z = c then s ⟨z, hz⟩ else choice ‹Nonempty S› let G (c : κ) (s : {z // owner z = c} → S) : ℝ := F c (lift c s) have hG (c : κ) (sigma : ι → S) : F c sigma = G c (fun z => sigma z.1) := by apply hF intro z hz simp [lift, hz] have hmass (c : κ) : (∑ s : {z // owner z = c} → S, ∏ z, w z.1 (s z)) = 1 := by rw [← Fintype.prod_sum] simp [hw] have hmarg (c : κ) : (∑ sigma : ι → S, (∏ z, w z (sigma z)) * F c sigma) = ∑ s : {z // owner z = c} → S, (∏ z, w z.1 (s z)) * G c s := by have ht := finite_fiber_weighted_sum owner w (fun j s => if hj : j = c then G c (hj ▸ s) else 1) have hprod (sigma : ι → S) : (∏ j, if hj : j = c then G c (hj ▸ (fun z => sigma z.1)) else 1) = F c sigma := by simp [← hG] simp_rw [hprod] at ht rw [ht] have hsum (j : κ) : (∑ s : {z // owner z = j} → S, (∏ z, w z.1 (s z)) * (if hj : j = c then G c (hj ▸ s) else 1)) = if hj : j = c then (∑ s : {z // owner z = c} → S, (∏ z, w z.1 (s z)) * G c s) else 1 := by by_cases hj : j = c · subst j; simp · simp [hj, hmass] simp_rw [hsum] simp simp_rw [hG] at ⊢ rw [finite_fiber_weighted_sum] apply Finset.prod_congr rfl intro c _ exact (hmarg c).symm.trans (by simp_rw [hG])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_fiber_expectation_factorization · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:264

A nonzero frame is supported inside the localization cube and one grid radius. Given the specified input d, the specified input h, the specified input delta, the specified input hh, the specified input z, the specified input x, the specified input hx, the frame nonzero support conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
hh :
0 < h
z :
Fin d → ℤ
x :
Cov d
hx :
frame h delta z x ≠ 0
conclusion 1
x ∈ locCube d h
conclusion 2
j :
|(x j-1/2)/delta - (z j:ℝ)| < 1
Proof (Lean source)
lemma frame_nonzero_support {d : ℕ} (h delta : ℝ) (hh : 0 < h) (z : Fin d → ℤ) (x : Cov d) (hx : frame h delta z x ≠ 0) : x ∈ locCube d h ∧ ∀ j, |(x j-1/2)/delta - (z j:ℝ)| < 1 := by constructor · by_contra hout exact hx (by simp [frame, macroBump_zero_outside h hh x hout]) · intro j have hj : frame1d (z j) ((x j-1/2)/delta) ≠ 0 := by intro hz apply hx unfold frame rw [Finset.prod_eq_zero (Finset.mem_univ j) hz, mul_zero] rw [abs_lt] constructor · by_contra hn exact hj (frame1d_zero_left _ _ (by linarith)) · by_contra hn exact hj (frame1d_zero_right _ _ (by linarith))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame_nonzero_support · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:310

Two records sharing an active frame belong to the same graph component. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input hh, the specified input hd, the specified input x, the specified input z, the specified input i, the specified input j, the specified input hi, the specified input hj, the shared frame component conclusion holds.

Formal statement
d n m :
ℕ
h delta :
ℝ
hh :
0 < h
hd :
0 < delta
x :
Fin (n+m) → Cov d
z :
Fin d → ℤ
i j :
Fin (n+m)
hi :
frame h delta z (x i) ≠ 0
hj :
frame h delta z (x j) ≠ 0
Proof (Lean source)
lemma shared_frame_component {d n m : ℕ} (h delta : ℝ) (hh : 0 < h) (hd : 0 < delta) (x : Fin (n+m) → Cov d) (z : Fin d → ℤ) (i j : Fin (n+m)) (hi : frame h delta z (x i) ≠ 0) (hj : frame h delta z (x j) ≠ 0) : (recordGraph h delta x).connectedComponentMk i = (recordGraph h delta x).connectedComponentMk j := by by_cases hij : i = j · subst j; rfl apply SimpleGraph.ConnectedComponent.connectedComponentMk_eq_of_adj refine ⟨hij, (frame_nonzero_support h delta hh z (x i) hi).1, (frame_nonzero_support h delta hh z (x j) hj).1, ?_⟩ unfold maxDist apply Finset.sup'_le intro k hk split_ifs with hk' · have hu := (frame_nonzero_support h delta hh z (x i) hi).2 ⟨k.val,hk'⟩ have hv := (frame_nonzero_support h delta hh z (x j) hj).2 ⟨k.val,hk'⟩ rw [abs_lt] at hu hv rw [abs_le] have h1 := (lt_div_iff₀ hd).mp (show (z ⟨k.val,hk'⟩:ℝ)-1 < (x i ⟨k.val,hk'⟩-1/2)/delta by linarith) have h2 := (div_lt_iff₀ hd).mp (show (x i ⟨k.val,hk'⟩-1/2)/delta < (z ⟨k.val,hk'⟩:ℝ)+1 by linarith) have h3 := (lt_div_iff₀ hd).mp (show (z ⟨k.val,hk'⟩:ℝ)-1 < (x j ⟨k.val,hk'⟩-1/2)/delta by linarith) have h4 := (div_lt_iff₀ hd).mp (show (x j ⟨k.val,hk'⟩-1/2)/delta < (z ⟨k.val,hk'⟩:ℝ)+1 by linarith) constructor <;> linarith · linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.shared_frame_component · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:330
theorem recordLikelihood_active_signs Lemma recordLikelihood_active_signs in the paper ↗

At a record, only the sign pairs of its nonzero frames affect the likelihood. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input x, the specified input s, the specified input i, the specified input sigma, the specified input sigma', the specified input hs, the record likelihood active signs conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
x :
Fin (n+m) → Cov d
s :
i :
Fin (n+m)
sigma sigma' :
SignArray d h delta
hs :
∀ z
if
frame h delta z.1 (x i) ≠ 0
then
sigma z = sigma' z
recordLikelihood (markedLaw h delta a b theta sigma) x s i
= recordLikelihood (markedLaw h delta a b theta sigma') x s i
Proof (Lean source)
lemma recordLikelihood_active_signs {d n m : ℕ} (h delta a b : ℝ) (theta : Bool) (x : Fin (n+m) → Cov d) (s : RecordSpins n m) (i : Fin (n+m)) (sigma sigma' : SignArray d h delta) (hs : ∀ z, frame h delta z.1 (x i) ≠ 0 → sigma z = sigma' z) : recordLikelihood (markedLaw h delta a b theta sigma) x s i = recordLikelihood (markedLaw h delta a b theta sigma') x s i := by have hf (control : Bool) : signField h delta sigma control (x i) = signField h delta sigma' control (x i) := by apply Finset.sum_congr rfl intro z hz by_cases hn : frame h delta z.1 (x i) = 0 · simp only [hn, mul_zero] · rw [hs z hn] have he : (markedLaw h delta a b theta sigma).e (x i) = (markedLaw h delta a b theta sigma').e (x i) := by change probabilityClip (1/2+a*signField h delta sigma false (x i)) = _ rw [hf false] rfl have hm (arm : Bool) : (if arm then (markedLaw h delta a b theta sigma).mu1 (x i) else (markedLaw h delta a b theta sigma).mu0 (x i)) = (if arm then (markedLaw h delta a b theta sigma').mu1 (x i) else (markedLaw h delta a b theta sigma').mu0 (x i)) := by cases arm <;> change probabilityClip (1/2+b*signField h delta sigma true (x i)+_) = _ <;> rw [hf true] <;> rfl induction i using Fin.addCases with | left i => simp only [recordLikelihood, Fin.addCases_left, labelLikelihood, he, hm] | right i => simp only [recordLikelihood, Fin.addCases_right, auxiliaryLikelihood, he]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordLikelihood_active_signs · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:361
theorem marked_conditional_factorization Lemma marked_conditional_factorization in the paper ↗

Disjoint active frame blocks factor the conditional likelihood across graph components. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hd, the specified input hdh, the specified input hh, the specified input n, the specified input m, the marked conditional factorization conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
hd :
0 < delta
hdh :
delta ≤ h
hh :
h ≤ 1/2
n m :
ℕ
ConditionalFactorization (markedHandle d h delta a b) h delta n m
Proof (Lean source)
lemma marked_conditional_factorization (d : ℕ) (h delta a b : ℝ) (hd : 0 < delta) (hdh : delta ≤ h) (hh : h ≤ 1/2) (n m : ℕ) : ConditionalFactorization (markedHandle d h delta a b) h delta n m := by intro x hx theta s let comp := (recordGraph h delta x).connectedComponentMk let owner (z : {z // z ∈ frameIdx d h delta}) : Option (recordGraph h delta x).ConnectedComponent := if hz : ∃ i, frame h delta z.1 (x i) ≠ 0 then some (comp hz.choose) else none let F : Option (recordGraph h delta x).ConnectedComponent → SignArray d h delta → ℝ := fun c sigma => match c with | none => 1 | some c => ∏ i ∈ componentVertices h delta x c, recordLikelihood (markedLaw h delta a b theta sigma) x s i have howner (z : {z // z ∈ frameIdx d h delta}) (i : Fin (n+m)) (hi : frame h delta z.1 (x i) ≠ 0) : owner z = some (comp i) := by have hz : ∃ j, frame h delta z.1 (x j) ≠ 0 := ⟨i,hi⟩ simp only [owner, dif_pos hz] congr 1 exact shared_frame_component h delta (hd.trans_le hdh) hd x z.1 _ i hz.choose_spec hi have hF : ∀ c sigma sigma', (∀ z, owner z = c → sigma z = sigma' z) → F c sigma = F c sigma' := by intro c sigma sigma' hs cases c with | none => rfl | some c => apply Finset.prod_congr rfl intro i hi apply recordLikelihood_active_signs intro z hz apply hs z have hc : comp i = c := (Finset.mem_filter.mp hi).2 rw [howner z i hz, hc] have hw (z : {z // z ∈ frameIdx d h delta}) : (∑ v : Bool × Bool, (1+thetaSign theta*thetaSign v.1*thetaSign v.2/2)/4) = 1 := by cases theta <;> norm_num [Fintype.sum_prod_type, thetaSign] have hfactor := finite_fiber_expectation_factorization owner (fun _ v => (1+thetaSign theta*thetaSign v.1*thetaSign v.2/2)/4) hw F hF have hprod (sigma : SignArray d h delta) : (∏ c, F c sigma) = ∏ i, recordLikelihood (markedLaw h delta a b theta sigma) x s i := by simp only [F, Fintype.prod_option, one_mul] have ht := Fintype.prod_fiberwise comp (fun i => recordLikelihood (markedLaw h delta a b theta sigma) x s i) convert ht using 1 apply Finset.prod_congr rfl intro c hc exact Finset.prod_subtype (p := fun i => comp i = c) (componentVertices h delta x c) (by intro i; simp [componentVertices, comp]) (fun i => recordLikelihood (markedLaw h delta a b theta sigma) x s i) simp_rw [hprod] at hfactor change mixedDensity (markedHandle d h delta a b) theta x s = _ change (∑ sigma, markedWeight h delta theta sigma * ∏ i, recordLikelihood (markedLaw h delta a b theta sigma) x s i) = _ trans ∏ c, ∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * F c sigma · dsimp only [markedWeight] with_reducible convert hfactor using 2 · ext; simp · apply Finset.sum_congr (by ext; simp) intro sigma _ rfl · rw [Fintype.prod_option] change (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * 1) * (∏ c, ∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * ∏ i ∈ componentVertices h delta x c, recordLikelihood (markedLaw h delta a b theta sigma) x s i) = _ simp only [mul_one, (marked_prior_mass d h delta theta).2, one_mul] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_conditional_factorization · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:391
theorem auxiliary_recordLikelihood_flip Lemma auxiliary_recordLikelihood_flip in the paper ↗

An auxiliary likelihood ignores the flipped outcome signs and hypothesis index. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input sigma, the specified input x, the specified input s, the specified input i, the specified input hi, the auxiliary record likelihood flip conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
sigma :
SignArray d h delta
x :
Fin (n+m) → Cov d
s :
i :
Fin (n+m)
hi :
n ≤ i.val
recordLikelihood (markedLaw h delta a b true sigma) x s i
= recordLikelihood (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)) x s i
Proof (Lean source)
lemma auxiliary_recordLikelihood_flip {d n m : ℕ} (h delta a b : ℝ) (sigma : SignArray d h delta) (x : Fin (n+m) → Cov d) (s : RecordSpins n m) (i : Fin (n+m)) (hi : n ≤ i.val) : recordLikelihood (markedLaw h delta a b true sigma) x s i = recordLikelihood (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)) x s i := by induction i using Fin.addCases with | left i => simp only [Fin.val_castAdd] at hi; omega | right i => simp only [recordLikelihood, Fin.addCases_right, auxiliaryLikelihood, markedPropensity_flipOutcomeSigns]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliary_recordLikelihood_flip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:460
theorem auxiliary_componentDensity_equality Lemma auxiliary_componentDensity_equality in the paper ↗

A component containing only auxiliary records has the same density under both sign priors. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input x, the specified input V, the specified input hV, the specified input s, the auxiliary component density equality conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
x :
Fin (n+m) → Cov d
V :
Finset (Fin (n+m))
hV :
∀ i ∈ V, n ≤ i.val
s :
componentDensity (markedHandle d h delta a b) true x V s
= componentDensity (markedHandle d h delta a b) false x V s
Proof (Lean source)
lemma auxiliary_componentDensity_equality {d n m : ℕ} (h delta a b : ℝ) (x : Fin (n+m) → Cov d) (V : Finset (Fin (n+m))) (hV : ∀ i ∈ V, n ≤ i.val) (s : RecordSpins n m) : componentDensity (markedHandle d h delta a b) true x V s = componentDensity (markedHandle d h delta a b) false x V s := by unfold componentDensity apply Fintype.sum_equiv (flipOutcomeSigns d h delta) intro sigma change markedWeight h delta true sigma * _ = markedWeight h delta false (flipOutcomeSigns d h delta sigma) * _ rw [markedWeight_flipOutcomeSigns] congr 1 apply Finset.prod_congr rfl intro i hi exact auxiliary_recordLikelihood_flip h delta a b sigma x s i (hV i hi)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliary_componentDensity_equality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:472
theorem uninformative_component_equality Lemma uninformative_component_equality in the paper ↗

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the uninformative component equality conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
c ≤ 1
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
n m :
UninformativeComponentsAgree (markedHandle d h delta a b) h delta n m
Proof (Lean source)
lemma uninformative_component_equality (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ -- @realizes c(positive claim-local constant) c ≤ 1 ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ n m, UninformativeComponentsAgree (markedHandle d h delta a b) h delta n m := by obtain ⟨c, hc, hc1, hsingle⟩ := singleton_cancellation d alpha beta gamma L eps hdom refine ⟨c, hc, hc1, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab n m unfold UninformativeComponentsAgree intro x hx comp dsimp only intro hV s rcases hV with haux | ⟨hcard, i, hi, hilab⟩ · exact auxiliary_componentDensity_equality h delta a b x _ haux s · have hset : componentVertices h delta x comp = {i} := by obtain ⟨j, hj⟩ := Finset.card_eq_one.mp hcard have hij : i = j := by simpa only [hj, Finset.mem_singleton] using hi simpa only [hij] using hj simp only [componentDensity, hset, Finset.prod_singleton] have hcancel := hsingle h delta a b hd hdh hh ha hac hb hbc hab induction i using Fin.addCases with | left i => simp only [recordLikelihood, Fin.addCases_left] have ht := singletonMixture_density (markedHandle d h delta a b) true (marked_prior_mass d h delta true).1 (x (castAdd m i)) (s.1 i) have hf := singletonMixture_density (markedHandle d h delta a b) false (marked_prior_mass d h delta false).1 (x (castAdd m i)) (s.1 i) rw [hcancel true] at ht rw [hcancel false] at hf exact ht.symm.trans hf | right i => simp only [Fin.val_natAdd] at hilab; omega
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uninformative_component_equality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Components.lean:489
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.FrameRegularity 9 declarations Uniform low-order Hölder bounds for the signed, locally supported tensor frames.

Uniform low-order Hölder bounds for the signed, locally supported tensor frames.

The piecewise frame equals a globally smooth product of two transition factors. Given the specified input z, the specified input t, the frame1d product conclusion holds.

Formal statement
z :
ℤ
t :
ℝ
frame1d z t = sin (frameAngle (t-z+1)) * cos (frameAngle (t-z))
Proof (Lean source)
lemma frame1d_product (z : ℤ) (t : ℝ) : frame1d z t = sin (frameAngle (t-z+1)) * cos (frameAngle (t-z)) := by unfold frame1d simp only [frameAngle] split_ifs with hl hr · rw [Real.smoothTransition.zero_of_nonpos (x := t-z) (by linarith [hl.2]), mul_zero, Real.cos_zero, mul_one] · rw [Real.smoothTransition.one_of_one_le (x := t-z+1) (by linarith [hr.1]), mul_one, Real.sin_pi_div_two, one_mul] · by_cases ht : t < (z:ℝ)-1 · rw [Real.smoothTransition.zero_of_nonpos (x := t-z+1) (by linarith), mul_zero, Real.sin_zero, zero_mul] · have ht' : (z:ℝ)+1 < t := by by_contra hn apply hr refine ⟨?_, le_of_not_gt hn⟩ by_contra h apply hl exact ⟨le_of_not_gt ht, le_of_lt (lt_of_not_ge h)⟩ rw [Real.smoothTransition.one_of_one_le (x := t-z) (by linarith), mul_one, Real.cos_pi_div_two, mul_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_product · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:13
theorem frame1d_uniform_lipschitz Lemma frame1d_uniform_lipschitz in the paper ↗

Translations of the fixed smooth frame share a single Lipschitz constant. the frame1d uniform lipschitz conclusion holds.

Formal statement
∃ K : ℝ,
0 ≤ K
conclusion 1
z :
ℤ
t u :
ℝ
|frame1d z t-frame1d z u| ≤ K*|t-u|
Proof (Lean source)
lemma frame1d_uniform_lipschitz : ∃ K : ℝ, 0 ≤ K ∧ ∀ z : ℤ, ∀ t u : ℝ, |frame1d z t-frame1d z u| ≤ K*|t-u| := by have hf : ContDiff ℝ 1 (frame1d 0) := by change ContDiff ℝ 1 (fun t => frame1d 0 t) simp_rw [frame1d_product] unfold frameAngle fun_prop have hc : HasCompactSupport (frame1d 0) := by apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Icc (-1:ℝ) 1)) intro t ht rcases (not_and_or.mp ht) with ht | ht · exact frame1d_zero_left 0 t (by simpa using (le_of_lt (lt_of_not_ge ht))) · exact frame1d_zero_right 0 t (by simpa using (le_of_lt (lt_of_not_ge ht))) obtain ⟨K, hK⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hc hf (by norm_num) refine ⟨K, K.coe_nonneg, ?_⟩ intro z t u have he (v : ℝ) : frame1d z v = frame1d 0 (v-z) := by simp_rw [frame1d_product] simp rw [he, he] simpa [Real.dist_eq, sub_sub_sub_cancel_right] using hK.dist_le_mul (t-z) (u-z)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_uniform_lipschitz · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:36
theorem unit_product_difference_le Lemma unit_product_difference_le in the paper ↗

Products of unit-bounded factors have a telescoping difference bound. Given the specified input s, the specified input f, the specified input g, the specified input hf, the specified input hg, the unit product difference le conclusion holds.

Formal statement
ι :
Type*
s :
f g :
ι → ℝ
hf :
∀ i ∈ s, |f i| ≤ 1
hg :
∀ i ∈ s, |g i| ≤ 1
|(∏ i ∈ s, f i)-(∏ i ∈ s, g i)| ≤ ∑ i ∈ s, |f i-g i|
Proof (Lean source)
lemma unit_product_difference_le {ι : Type*} (s : Finset ι) (f g : ι → ℝ) (hf : ∀ i ∈ s, |f i| ≤ 1) (hg : ∀ i ∈ s, |g i| ≤ 1) : |(∏ i ∈ s, f i)-(∏ i ∈ s, g i)| ≤ ∑ i ∈ s, |f i-g i| := by classical induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => rw [Finset.prod_insert hi, Finset.prod_insert hi, Finset.sum_insert hi] have hfp : |∏ j ∈ s, f j| ≤ 1 := by rw [Finset.abs_prod] exact Finset.prod_le_one (fun _ _ => abs_nonneg _) (fun j hj => hf j (Finset.mem_insert_of_mem hj)) have hgp : |g i| ≤ 1 := hg i (Finset.mem_insert_self _ _) have hid := ih (fun j hj => hf j (Finset.mem_insert_of_mem hj)) (fun j hj => hg j (Finset.mem_insert_of_mem hj)) calc _ = |(f i-g i)*(∏ j ∈ s, f j)+g i*((∏ j ∈ s, f j)-(∏ j ∈ s, g j))| := by congr 1; ring _ ≤ |(f i-g i)*(∏ j ∈ s, f j)|+|g i*((∏ j ∈ s, f j)-(∏ j ∈ s, g j))| := abs_add_le _ _ _ ≤ |f i-g i| + ∑ j ∈ s, |f j-g j| := by rw [abs_mul, abs_mul] exact add_le_add (by nlinarith [abs_nonneg (f i-g i)]) ((mul_le_mul_of_nonneg_right hgp (abs_nonneg _)).trans (by simpa using hid))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.unit_product_difference_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:60
theorem macroBump_uniform_lipschitz Lemma macroBump_uniform_lipschitz in the paper ↗

The dilated macro bump has a dimension-only Lipschitz bound at scale h. Given the specified input d, the macro bump uniform lipschitz conclusion holds.

Formal statement
d :
ℕ
∃ K : ℝ,
0 ≤ K
conclusion 1
h :
0 < h
x y :
Cov d
|macroBump h x-macroBump h y| ≤ K/h*dist x y
Proof (Lean source)
lemma macroBump_uniform_lipschitz (d : ℕ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ h, 0 < h → ∀ x y : Cov d, |macroBump h x-macroBump h y| ≤ K/h*dist x y := by obtain ⟨K, hK⟩ := ContDiff.lipschitzWith_of_hasCompactSupport (macroBump_compactSupport d) (macroBump_contDiff 1) (by simp) refine ⟨K, K.coe_nonneg, ?_⟩ intro h hh x y rw [← macroBump_dilation h x, ← macroBump_dilation h y] have hdist : dist (h⁻¹ • (x-x0 d)+x0 d) (h⁻¹ • (y-x0 d)+x0 d) = h⁻¹*dist x y := by rw [dist_add_right, dist_eq_norm, ← smul_sub, sub_sub_sub_cancel_right, norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hh), ← dist_eq_norm] have hb := hK.dist_le_mul (h⁻¹ • (x-x0 d)+x0 d) (h⁻¹ • (y-x0 d)+x0 d) rw [Real.dist_eq, hdist] at hb simpa only [div_eq_mul_inv, mul_assoc] using hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_uniform_lipschitz · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:83
theorem frame_uniform_lipschitz Lemma frame_uniform_lipschitz in the paper ↗

Each tensor frame has a Lipschitz bound uniform over its integer translate. Given the specified input d, the frame uniform lipschitz conclusion holds.

Formal statement
d :
ℕ
∃ K : ℝ,
0 ≤ K
conclusion 1
h delta :
0 < delta
delta ≤ h
z :
Fin d → ℤ
x y :
Cov d
|frame h delta z x-frame h delta z y| ≤ K/delta*dist x y
Proof (Lean source)
lemma frame_uniform_lipschitz (d : ℕ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ h delta, 0 < delta → delta ≤ h → ∀ z : Fin d → ℤ, ∀ x y : Cov d, |frame h delta z x-frame h delta z y| ≤ K/delta*dist x y := by obtain ⟨B, hB, hb⟩ := macroBump_uniform_lipschitz d obtain ⟨A, hA, ha⟩ := frame1d_uniform_lipschitz refine ⟨B+d*A, by positivity, ?_⟩ intro h delta hd hdh z x y let f := fun i : Fin d => frame1d (z i) ((x i-1/2)/delta) let g := fun i : Fin d => frame1d (z i) ((y i-1/2)/delta) have hdiff : |(∏ i, f i)-(∏ i, g i)| ≤ (d:ℝ)*(A/delta*dist x y) := by calc _ ≤ ∑ i, |f i-g i| := unit_product_difference_le univ f g (fun i _ => abs_frame1d_le_one _ _) (fun i _ => abs_frame1d_le_one _ _) _ ≤ ∑ _ : Fin d, A/delta*dist x y := by apply Finset.sum_le_sum intro i _ have hi := ha (z i) ((x i-1/2)/delta) ((y i-1/2)/delta) have he : |(x i-1/2)/delta-(y i-1/2)/delta| = |x i-y i|/delta := by rw [← sub_div, sub_sub_sub_cancel_right, abs_div, abs_of_pos hd] rw [he] at hi have hc : |x i-y i| ≤ dist x y := by simpa only [Real.dist_eq] using PiLp.dist_apply_le x y i exact hi.trans (by calc A*(|x i-y i|/delta) = A/delta*|x i-y i| := by ring _ ≤ _ := mul_le_mul_of_nonneg_left hc (by positivity)) _ = _ := by simp have hfp : |∏ i, f i| ≤ 1 := by rw [Finset.abs_prod] exact Finset.prod_le_one (fun _ _ => abs_nonneg _) (fun _ _ => abs_frame1d_le_one _ _) have hmy : |macroBump h y| ≤ 1 := by rw [abs_of_nonneg (macroBump_mem h y).1] exact (macroBump_mem h y).2 have hmacro := hb h (hd.trans_le hdh) x y have hden : B/h ≤ B/delta := div_le_div_of_nonneg_left hB hd hdh calc _ = |(macroBump h x-macroBump h y)*(∏ i, f i)+ macroBump h y*((∏ i, f i)-(∏ i, g i))| := by dsimp [frame, f, g]; congr 1; ring _ ≤ |macroBump h x-macroBump h y| *|∏ i, f i|+ |macroBump h y| *|(∏ i, f i)-(∏ i, g i)| := by simpa only [abs_mul] using abs_add_le ((macroBump h x-macroBump h y)*(∏ i, f i)) (macroBump h y*((∏ i, f i)-(∏ i, g i))) _ ≤ B/delta*dist x y+(d:ℝ)*(A/delta*dist x y) := add_le_add ((mul_le_mul_of_nonneg_left hfp (abs_nonneg _)).trans (by simpa using hmacro.trans (mul_le_mul_of_nonneg_right hden (dist_nonneg)))) ((mul_le_mul_of_nonneg_right hmy (abs_nonneg _)).trans (by simpa using hdiff)) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame_uniform_lipschitz · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:101
theorem signField_uniform_lipschitz Lemma signField_uniform_lipschitz in the paper ↗

Bounded overlap at the two endpoints controls signed-frame differences independently of grid size. Given the specified input d, the sign field uniform lipschitz conclusion holds.

Formal statement
d :
ℕ
∃ K : ℝ,
0 ≤ K
conclusion 1
h delta :
0 < delta
delta ≤ h
sigma :
SignArray d h delta
control :
x y :
Cov d
|signField h delta sigma control x-signField h delta sigma control y| ≤ K/delta*dist x y
Proof (Lean source)
lemma signField_uniform_lipschitz (d : ℕ) : ∃ K : ℝ, 0 ≤ K ∧ ∀ h delta, 0 < delta → delta ≤ h → ∀ sigma : SignArray d h delta, ∀ control, ∀ x y : Cov d, |signField h delta sigma control x-signField h delta sigma control y| ≤ K/delta*dist x y := by classical obtain ⟨B, hB, hb⟩ := frame_uniform_lipschitz d refine ⟨2*(2:ℝ)^d*B, by positivity, ?_⟩ intro h delta hd hdh sigma control x y let A := fun x : Cov d => Finset.univ.image (fun v : Fin d → Bool => fun i => ⌊(x i-1/2)/delta⌋ + if v i then 1 else 0) have hcard (x : Cov d) : (A x).card ≤ 2^d := by exact (Finset.card_image_le).trans (by simp) have hzero (x : Cov d) (z : Fin d → ℤ) (hz : z ∉ A x) : frame h delta z x = 0 := by apply frame_zero_of_not_coordinate_adjacent intro hadj apply hz apply Finset.mem_image.mpr refine ⟨fun i => decide (z i = ⌊(x i-1/2)/delta⌋+1), Finset.mem_univ _, ?_⟩ funext i rcases hadj i with hi | hi <;> simp [hi] let S := (frameIdx d h delta).filter (fun z => z ∈ A x ∪ A y) have hScard : (S.card:ℝ) ≤ 2*(2:ℝ)^d := by have hc : S.card ≤ 2*2^d := (Finset.card_le_card (show S ⊆ A x ∪ A y from fun z hz => (Finset.mem_filter.mp hz).2)).trans ((Finset.card_union_le _ _).trans (by have hx := hcard x; have hy := hcard y; omega)) exact_mod_cast hc have he : (∑ z ∈ frameIdx d h delta, |frame h delta z x-frame h delta z y|) = ∑ z ∈ S, |frame h delta z x-frame h delta z y| := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro z _ split_ifs with hz · rfl · have hn := not_or.mp (show ¬ (z ∈ A x ∨ z ∈ A y) by simpa using hz) simp [hzero x z hn.1, hzero y z hn.2] calc _ ≤ ∑ z : {z // z ∈ frameIdx d h delta}, |frame h delta z.1 x-frame h delta z.1 y| := by unfold signField rw [← Finset.sum_sub_distrib] calc _ ≤ ∑ z : {z // z ∈ frameIdx d h delta}, |thetaSign (if control then (sigma z).2 else (sigma z).1) * frame h delta z.1 x-thetaSign (if control then (sigma z).2 else (sigma z).1)*frame h delta z.1 y| := Finset.abs_sum_le_sum_abs _ _ _ = _ := by apply Finset.sum_congr rfl intro z _ rw [← mul_sub, abs_mul] have ht : |thetaSign (if control then (sigma z).2 else (sigma z).1)| = 1 := by unfold thetaSign split_ifs <;> norm_num rw [ht, one_mul] _ = ∑ z ∈ S, |frame h delta z x-frame h delta z y| := by exact (Finset.sum_coe_sort (frameIdx d h delta) (fun z => |frame h delta z x-frame h delta z y|)).trans he _ ≤ ∑ _ ∈ S, B/delta*dist x y := Finset.sum_le_sum (fun z _ => hb h delta hd hdh z x y) _ = (S.card:ℝ)*(B/delta*dist x y) := by simp _ ≤ (2*(2:ℝ)^d)*(B/delta*dist x y) := mul_le_mul_of_nonneg_right hScard (by positivity) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signField_uniform_lipschitz · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:154
theorem coordinatePartial_order_zero Lemma coordinatePartial_order_zero in the paper ↗

A coordinate partial of total order zero is the original function. Given the specified input d, the specified input f, the specified input hk, the specified input x, the coordinate partial order zero conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
κ :
Fin d → ℕ
hk :
multiOrder κ = 0
x :
Cov d
coordinatePartial f κ x = f x
Proof (Lean source)
lemma coordinatePartial_order_zero {d : ℕ} (f : Cov d → ℝ) (κ : Fin d → ℕ) (hk : multiOrder κ = 0) (x : Cov d) : coordinatePartial f κ x = f x := by have he (k : ℕ) (h : k = 0) (v : Fin k → Cov d) : (iteratedFDerivWithin ℝ k f (cube d) x) v = f x := by subst k simp exact he _ hk _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coordinatePartial_order_zero · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:219
theorem bounded_lipschitz_scaled_holder Lemma bounded_lipschitz_scaled_holder in the paper ↗

A bounded field with a scale-dependent Lipschitz bound has the corresponding fractional Hölder norm. Given the specified input d, the specified input f, the specified input s, the specified input delta, the specified input B, the specified input K, the specified input hs, the specified input hs1, the specified input hd, the specified input hd1, the specified input hB, the specified input hK, the specified input hb, the specified input hlip, the bounded lipschitz scaled holder conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
s delta B K :
ℝ
hs :
0 < s
hs1 :
s ≤ 1
hd :
0 < delta
hd1 :
delta ≤ 1
hB :
0 ≤ B
hK :
0 ≤ K
hb :
∀ x, |f x| ≤ B
hlip :
∀ x y, |f x-f y| ≤ K/delta*dist x y
holderNorm f s ≤ ofReal ((2*B+K+1)*delta^(-s))
Proof (Lean source)
lemma bounded_lipschitz_scaled_holder {d : ℕ} (f : Cov d → ℝ) (s delta B K : ℝ) (hs : 0 < s) (hs1 : s ≤ 1) (hd : 0 < delta) (hd1 : delta ≤ 1) (hB : 0 ≤ B) (hK : 0 ≤ K) (hb : ∀ x, |f x| ≤ B) (hlip : ∀ x y, |f x-f y| ≤ K/delta*dist x y) : holderNorm f s ≤ ofReal ((2*B+K+1)*delta^(-s)) := by let C := 2*B+K+1 have hC : 0 ≤ C := by dsimp [C]; positivity have hceil : ceil s - 1 = 0 := by have hle : ceil s ≤ 1 := Nat.ceil_le.mpr (by simpa using hs1) omega have hscale : 1 ≤ delta^(-s) := Real.one_le_rpow_of_pos_of_le_one_of_nonpos hd hd1 (by linarith) have hcont : Continuous f := by have hl : LipschitzWith ⟨K/delta, by positivity⟩ f := LipschitzWith.of_dist_le_mul (by intro x y; exact hlip x y) exact hl.continuous apply (holderNorm_le_iff f s (C*delta^(-s)) (by positivity)).mpr refine ⟨?_, ?_, ?_⟩ · rw [hceil] exact (contDiff_zero.mpr hcont).contDiffOn · intro κ hκ x hx have hk : multiOrder κ = 0 := by omega rw [coordinatePartial_order_zero f κ hk] calc _ ≤ B := hb x _ ≤ C := by dsimp [C]; linarith _ ≤ C*delta^(-s) := by nlinarith · intro κ hκ x hx y hy hxy have hk : multiOrder κ = 0 := by omega rw [coordinatePartial_order_zero f κ hk, coordinatePartial_order_zero f κ hk, hceil] simp only [Nat.cast_zero, sub_zero] let r := dist x y have hr : 0 ≤ r := dist_nonneg have he : (r/delta)^s = delta^(-s)*r^s := by rw [Real.div_rpow hr hd.le, Real.rpow_neg hd.le] ring by_cases hrd : r ≤ delta · have hp : r/delta ≤ (r/delta)^s := Real.self_le_rpow_of_le_one (by positivity) ((div_le_one hd).mpr hrd) hs1 calc _ ≤ K/delta*r := hlip x y _ = K*(r/delta) := by ring _ ≤ K*(r/delta)^s := mul_le_mul_of_nonneg_left hp hK _ = K*(delta^(-s)*r^s) := by rw [he] _ ≤ C*(delta^(-s)*r^s) := mul_le_mul_of_nonneg_right (by dsimp [C]; linarith) (by positivity) _ = _ := by ring · have hp : 1 ≤ (r/delta)^s := Real.one_le_rpow ((one_le_div hd).mpr (le_of_lt (lt_of_not_ge hrd))) hs.le calc _ ≤ |f x|+|f y| := abs_sub _ _ _ ≤ 2*B := by linarith [hb x, hb y] _ ≤ C := by dsimp [C]; linarith _ ≤ C*(r/delta)^s := by nlinarith _ = _ := by rw [he]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bounded_lipschitz_scaled_holder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:228

Signed frames obey the prescribed exact Hölder norm uniformly in the sign array and grid size. Given the specified input d, the specified input s, the specified input hs, the specified input hs', the sign field holder conclusion holds.

Formal statement
d :
ℕ
s :
ℝ
hs :
0 < s
hs' :
s ≤ 1
∃ C : ℝ,
0 < C
conclusion 1
h delta :
0 < delta
delta ≤ h
h ≤ 1/2
sigma :
SignArray d h delta
control :
holderNorm (signField h delta sigma control) s ≤ ofReal (C*delta^(-s))
Proof (Lean source)
lemma signField_holder (d : ℕ) (s : ℝ) (hs : 0 < s) (hs' : s ≤ 1) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ h delta, 0 < delta → delta ≤ h → h ≤ 1/2 → ∀ sigma : SignArray d h delta, ∀ control, holderNorm (signField h delta sigma control) s ≤ ofReal (C*delta^(-s)) := by obtain ⟨K, hK, hlip⟩ := signField_uniform_lipschitz d refine ⟨2*(2:ℝ)^d+K+1, by positivity, ?_⟩ intro h delta hd hdh hh sigma control exact bounded_lipschitz_scaled_holder (signField h delta sigma control) s delta ((2:ℝ)^d) K hs hs' hd (by linarith) (by positivity) hK (abs_signField_le h delta sigma control) (hlip h delta hd hdh sigma control)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signField_holder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FrameRegularity.lean:286
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.Frames 40 declarations Two-channel point-CATE annotation frontier: Lower/Frames constructions and obligations.

Lower/Frames

Two-channel point-CATE annotation frontier: Lower/Frames constructions and obligations.

Given the specified input theta, theta sign is the corresponding construction.

Definition (Lean source)
theta :
thetaSign theta :
ℝ
if theta then 1 else -1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.thetaSign · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:29
def flatExp

Given the specified input t, flat exp is the corresponding construction.

Definition (Lean source)
t :
ℝ
flatExp t :
ℝ
if 0 < t then exp (-1/t) else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flatExp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:31
def frameAngle

Given the specified input t, frame angle is the corresponding construction.

Definition (Lean source)
t :
ℝ
frameAngle t :
ℝ
(pi/2) * Real.smoothTransition t
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frameAngle · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:33
def frame1d

Given the specified input z, the specified input t, frame1d is the corresponding construction.

Definition (Lean source)
z :
ℤ
t :
ℝ
frame1d z t :
ℝ
if (z:ℝ)-1 ≤ t ∧
t ≤ z then sin (frameAngle (t-z+1)) else if (z:ℝ) ≤ t ∧
t ≤ (z:ℝ)+1 then cos (frameAngle (t-z)) else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:35
def macroBump

Given the specified input h, the specified input x, macro bump is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
x :
Cov d
macroBump h x :
ℝ
∏ i, flatExp (1-4*((x i-1/2)/h)^2)/flatExp 1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:39
def gridRadius

Given the specified input h, the specified input delta, grid radius is the corresponding construction.

Definition (Lean source)
h delta :
ℝ
gridRadius h delta :
ℕ
ceil (|h/delta|/2)+2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.gridRadius · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:42
def frameIdx

Given the specified input d, the specified input h, the specified input delta, frame idx is the corresponding construction.

Definition (Lean source)
d :
ℕ
h delta :
ℝ
frameIdx d h delta :
Finset (Fin d → ℤ)
(Finset.univ.image (fun z : Fin d → Fin (2*gridRadius h delta+1) => fun i => (z i : ℤ) - (gridRadius h delta : ℤ))).filter (fun z => ∃ x ∈ locCube d h, ∀ i, |(x i-1/2)/delta - (z i:ℝ)| ≤ 1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frameIdx · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:44
def frame

Given the specified input h, the specified input delta, the specified input z, the specified input x, frame is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta :
ℝ
z :
Fin d → ℤ
x :
Cov d
frame h delta z x :
ℝ
macroBump h x * ∏ i, frame1d (z i) ((x i-1/2)/delta)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:49
def SignArray

Given the specified input d, the specified input h, the specified input delta, sign array is the corresponding construction.

Definition (Lean source)
d :
ℕ
h delta :
ℝ
SignArray d h delta :
Type
{z // z ∈ frameIdx d h delta} → Bool × Bool
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.SignArray · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:52
def signField

Given the specified input h, the specified input delta, the specified input sigma, the specified input control, the specified input x, sign field is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta :
ℝ
sigma :
SignArray d h delta
control :
x :
Cov d
signField h delta sigma control x :
ℝ
∑ z : {z // z ∈ frameIdx d h delta}, thetaSign (if control then (sigma z).2 else (sigma z).1) * frame h delta z.1 x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signField · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:54

the measurable flat exp conclusion holds.

Formal statement
Proof (Lean source)
@[fun_prop] lemma measurable_flatExp : Measurable flatExp := by unfold flatExp apply Measurable.ite measurableSet_Ioi <;> fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_flatExp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:57

the measurable frame angle conclusion holds.

Formal statement
Proof (Lean source)
@[fun_prop] lemma measurable_frameAngle : Measurable frameAngle := by unfold frameAngle fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_frameAngle · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:62

Given the specified input z, the measurable frame1d conclusion holds.

Formal statement
z :
ℤ
Proof (Lean source)
@[fun_prop] lemma measurable_frame1d (z : ℤ) : Measurable (frame1d z) := by unfold frame1d apply Measurable.ite measurableSet_Icc · fun_prop · apply Measurable.ite measurableSet_Icc <;> fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_frame1d · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:67

Given the specified input h, the measurable macro bump conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_macroBump (h : ℝ) : Measurable (macroBump (d:=d) h) := by unfold macroBump fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_macroBump · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:74

Given the specified input h, the specified input delta, the specified input z, the measurable frame conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
z :
Fin d → ℤ
Measurable (frame h delta z)
Proof (Lean source)
@[fun_prop] lemma measurable_frame (h delta : ℝ) (z : Fin d → ℤ) : Measurable (frame h delta z) := by unfold frame fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_frame · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:79

Given the specified input h, the specified input delta, the specified input sigma, the specified input control, the measurable sign field conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
sigma :
SignArray d h delta
control :
Measurable (signField h delta sigma control)
Proof (Lean source)
@[fun_prop] lemma measurable_signField (h delta : ℝ) (sigma : SignArray d h delta) (control : Bool) : Measurable (signField h delta sigma control) := by unfold signField fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_signField · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:85

The flat exponential is nonnegative, including on its zero branch. Given the specified input t, the flat exp nonneg conclusion holds.

Formal statement
t :
ℝ
0 ≤ flatExp t
Proof (Lean source)
lemma flatExp_nonneg (t : ℝ) : 0 ≤ flatExp t := by unfold flatExp split_ifs · exact (Real.exp_pos _).le · exact le_rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flatExp_nonneg · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:90

The normalizing value of the macro bump is strictly positive. the flat exp one pos conclusion holds.

Formal statement
0 < flatExp 1
Proof (Lean source)
lemma flatExp_one_pos : 0 < flatExp 1 := by simpa [flatExp] using Real.exp_pos (-1 : ℝ)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flatExp_one_pos · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:97

Below one, the flat exponential is bounded by its normalizing value. Given the specified input t, the specified input ht, the flat exp le one value conclusion holds.

Formal statement
t :
ℝ
ht :
t ≤ 1
Proof (Lean source)
lemma flatExp_le_one_value (t : ℝ) (ht : t ≤ 1) : flatExp t ≤ flatExp 1 := by by_cases hp : 0 < t · have hexp : -1 / t ≤ (-1 : ℝ) := (div_le_iff₀ hp).mpr (by linarith) simpa [flatExp, hp] using Real.exp_le_exp.mpr hexp · simpa [flatExp, hp] using flatExp_one_pos.le
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flatExp_le_one_value · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:101

Every normalized coordinate factor lies in the unit interval. Given the specified input t, the macro bump factor mem conclusion holds.

Formal statement
t :
ℝ
flatExp (1-4*t^2) / flatExp 1 ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma macroBump_factor_mem (t : ℝ) : flatExp (1-4*t^2) / flatExp 1 ∈ Icc (0 : ℝ) 1 := by refine ⟨div_nonneg (flatExp_nonneg _) flatExp_one_pos.le, ?_⟩ apply (div_le_one flatExp_one_pos).mpr exact flatExp_le_one_value _ (by nlinarith [sq_nonneg t])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_factor_mem · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:108

The tensor macro bump has values between zero and one in every dimension. Given the specified input h, the specified input x, the macro bump mem conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
x :
Cov d
macroBump h x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma macroBump_mem (h : ℝ) (x : Cov d) : macroBump h x ∈ Icc (0 : ℝ) 1 := by unfold macroBump exact ⟨Finset.prod_nonneg (fun i _ => (macroBump_factor_mem _).1), Finset.prod_le_one (fun i _ => (macroBump_factor_mem _).1) (fun i _ => (macroBump_factor_mem _).2)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_mem · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:115

The macro bump is normalized to one at the interior target point. Given the specified input h, the macro bump at x0 conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
macroBump (d:=d) h (x0 d) = 1
Proof (Lean source)
lemma macroBump_at_x0 (h : ℝ) : macroBump (d:=d) h (x0 d) = 1 := by simp [macroBump, x0, ne_of_gt flatExp_one_pos]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_at_x0 · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:122

A frame vanishes at and beyond the left end of its support. Given the specified input z, the specified input t, the specified input ht, the frame1d zero left conclusion holds.

Formal statement
z :
ℤ
t :
ℝ
ht :
t ≤ (z:ℝ)-1
frame1d z t = 0
Proof (Lean source)
lemma frame1d_zero_left (z : ℤ) (t : ℝ) (ht : t ≤ (z:ℝ)-1) : frame1d z t = 0 := by unfold frame1d split_ifs with h1 h2 · rw [frameAngle, Real.smoothTransition.zero_of_nonpos (by linarith), mul_zero, Real.sin_zero] · exfalso; linarith [h2.1] · rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_zero_left · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:126

A frame vanishes at and beyond the right end of its support. Given the specified input z, the specified input t, the specified input ht, the frame1d zero right conclusion holds.

Formal statement
z :
ℤ
t :
ℝ
ht :
(z:ℝ)+1 ≤ t
frame1d z t = 0
Proof (Lean source)
lemma frame1d_zero_right (z : ℤ) (t : ℝ) (ht : (z:ℝ)+1 ≤ t) : frame1d z t = 0 := by unfold frame1d split_ifs with h1 h2 · exfalso; linarith [h1.2] · rw [frameAngle, Real.smoothTransition.one_of_one_le (by linarith), mul_one, Real.cos_pi_div_two] · rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_zero_right · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:136
theorem frame1d_adjacent_square Lemma frame1d_adjacent_square in the paper ↗

On one grid interval the two adjacent frames are the cosine and sine pair. Given the specified input j, the specified input t, the specified input hl, the specified input hu, the frame1d adjacent square conclusion holds.

Formal statement
j :
ℤ
t :
ℝ
hl :
(j:ℝ) ≤ t
hu :
t ≤ (j:ℝ)+1
(frame1d j t)^2 + (frame1d (j+1) t)^2 = 1
Proof (Lean source)
lemma frame1d_adjacent_square (j : ℤ) (t : ℝ) (hl : (j:ℝ) ≤ t) (hu : t ≤ (j:ℝ)+1) : (frame1d j t)^2 + (frame1d (j+1) t)^2 = 1 := by have hj : frame1d j t = cos (frameAngle (t-j)) := by unfold frame1d split_ifs with h1 h2 · have he : t = (j:ℝ) := by linarith [h1.2] rw [he] norm_num [frameAngle, Real.smoothTransition.zero, Real.smoothTransition.one] · rfl · exact False.elim (h2 ⟨hl, hu⟩) have hj1 : frame1d (j+1) t = sin (frameAngle (t-j)) := by unfold frame1d rw [if_pos (by push_cast; constructor <;> linarith)] congr 2 push_cast ring rw [hj, hj1] exact Real.cos_sq_add_sin_sq _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_adjacent_square · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:146
theorem frame1d_zero_of_not_adjacent Lemma frame1d_zero_of_not_adjacent in the paper ↗

Only the two frames adjacent to the integer floor can contribute. Given the specified input t, the specified input z, the specified input hz, the frame1d zero of not adjacent conclusion holds.

Formal statement
t :
ℝ
z :
ℤ
hz :
z ≠ ⌊t⌋ ∧ z ≠ ⌊t⌋+1
frame1d z t = 0
Proof (Lean source)
lemma frame1d_zero_of_not_adjacent (t : ℝ) (z : ℤ) (hz : z ≠ ⌊t⌋ ∧ z ≠ ⌊t⌋+1) : frame1d z t = 0 := by have hl := Int.floor_le t have hu := Int.lt_floor_add_one t by_cases h : z < ⌊t⌋ · apply frame1d_zero_right have hi : z+1 ≤ ⌊t⌋ := by omega have hir : (z:ℝ)+1 ≤ (⌊t⌋:ℝ) := by exact_mod_cast hi linarith · apply frame1d_zero_left have hi : ⌊t⌋+2 ≤ z := by omega have hir : (⌊t⌋:ℝ)+2 ≤ z := by exact_mod_cast hi linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_zero_of_not_adjacent · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:167

Each one-dimensional frame is bounded in absolute value by one. Given the specified input z, the specified input t, the abs frame1d le one conclusion holds.

Formal statement
z :
ℤ
t :
ℝ
|frame1d z t| ≤ 1
Proof (Lean source)
lemma abs_frame1d_le_one (z : ℤ) (t : ℝ) : |frame1d z t| ≤ 1 := by unfold frame1d split_ifs · exact Real.abs_sin_le_one _ · exact Real.abs_cos_le_one _ · norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.abs_frame1d_le_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:182

Tensor frames inherit the macro bump's unit bound. Given the specified input h, the specified input delta, the specified input z, the specified input x, the abs frame le one conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
z :
Fin d → ℤ
x :
Cov d
|frame h delta z x| ≤ 1
Proof (Lean source)
lemma abs_frame_le_one (h delta : ℝ) (z : Fin d → ℤ) (x : Cov d) : |frame h delta z x| ≤ 1 := by rw [frame, abs_mul, Finset.abs_prod] have ht : (∏ i, |frame1d (z i) ((x i-1/2)/delta)|) ≤ 1 := Finset.prod_le_one (fun i _ => abs_nonneg _) (fun i _ => abs_frame1d_le_one _ _) rw [abs_of_nonneg (macroBump_mem h x).1] exact (mul_le_mul_of_nonneg_left ht (macroBump_mem h x).1).trans (by simpa using (macroBump_mem h x).2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.abs_frame_le_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:190
theorem frame_zero_of_not_coordinate_adjacent Lemma frame_zero_of_not_coordinate_adjacent in the paper ↗

Only the two adjacent indices in each coordinate can support a tensor frame. Given the specified input h, the specified input delta, the specified input z, the specified input x, the specified input hz, the frame zero of not coordinate adjacent conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
z :
Fin d → ℤ
x :
Cov d
hz :
¬ ∀ i, z i = ⌊(x i-1/2)/delta⌋ ∨ z i = ⌊(x i-1/2)/delta⌋+1
frame h delta z x = 0
Proof (Lean source)
lemma frame_zero_of_not_coordinate_adjacent (h delta : ℝ) (z : Fin d → ℤ) (x : Cov d) (hz : ¬ ∀ i, z i = ⌊(x i-1/2)/delta⌋ ∨ z i = ⌊(x i-1/2)/delta⌋+1) : frame h delta z x = 0 := by obtain ⟨i, hi⟩ := not_forall.mp hz rw [frame, Finset.prod_eq_zero (Finset.mem_univ i) (frame1d_zero_of_not_adjacent _ _ (not_or.mp hi)), mul_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame_zero_of_not_coordinate_adjacent · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:200

The signed tensor field is uniformly bounded by the number of adjacent tensor indices. Given the specified input h, the specified input delta, the specified input sigma, the specified input control, the specified input x, the abs sign field le conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
sigma :
SignArray d h delta
control :
x :
Cov d
|signField h delta sigma control x| ≤ (2:ℝ)^d
Proof (Lean source)
lemma abs_signField_le (h delta : ℝ) (sigma : SignArray d h delta) (control : Bool) (x : Cov d) : |signField h delta sigma control x| ≤ (2:ℝ)^d := by classical let A : Finset (Fin d → ℤ) := Finset.univ.image (fun v : Fin d → Bool => fun i => ⌊(x i-1/2)/delta⌋ + if v i then 1 else 0) have hzero (z : Fin d → ℤ) (hz : z ∉ A) : frame h delta z x = 0 := by apply frame_zero_of_not_coordinate_adjacent intro hadj apply hz apply Finset.mem_image.mpr refine ⟨fun i => decide (z i = ⌊(x i-1/2)/delta⌋+1), Finset.mem_univ _, ?_⟩ funext i rcases hadj i with hi | hi <;> simp [hi] have hsum : (∑ z ∈ frameIdx d h delta, |frame h delta z x|) ≤ (A.card:ℝ) := by calc _ = ∑ z ∈ (frameIdx d h delta).filter (fun z => z ∈ A), |frame h delta z x| := by rw [Finset.sum_filter] apply Finset.sum_congr rfl intro z _ split_ifs with hz · rfl · simp [hzero z hz] _ ≤ ∑ z ∈ A, |frame h delta z x| := Finset.sum_le_sum_of_subset_of_nonneg (fun z hz => (Finset.mem_filter.mp hz).2) (fun z _ _ => abs_nonneg _) _ ≤ ∑ z ∈ A, (1:ℝ) := Finset.sum_le_sum (fun z _ => abs_frame_le_one _ _ _ _) _ = _ := by simp have hcard : A.card ≤ 2^d := by exact (Finset.card_image_le).trans (by simp) calc |signField h delta sigma control x| ≤ ∑ z : {z // z ∈ frameIdx d h delta}, |thetaSign (if control then (sigma z).2 else (sigma z).1) * frame h delta z.1 x| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ z ∈ frameIdx d h delta, |frame h delta z x| := by simp only [abs_mul, show ∀ theta, |thetaSign theta| = 1 from fun theta => by cases theta <;> norm_num [thetaSign], one_mul] exact Finset.sum_coe_sort (frameIdx d h delta) (fun z => |frame h delta z x|) _ ≤ (A.card:ℝ) := hsum _ ≤ (2:ℝ)^d := by exact_mod_cast hcard
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.abs_signField_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:208

Any finite index set containing the adjacent pair has squared-frame sum one. Given the specified input s, the specified input t, the specified input h0, the specified input h1, the frame1d square sum conclusion holds.

Formal statement
s :
Finset ℤ
t :
ℝ
h0 :
⌊t⌋ ∈ s
h1 :
⌊t⌋+1 ∈ s
(∑ z ∈ s, (frame1d z t)^2) = 1
Proof (Lean source)
lemma frame1d_square_sum (s : Finset ℤ) (t : ℝ) (h0 : ⌊t⌋ ∈ s) (h1 : ⌊t⌋+1 ∈ s) : (∑ z ∈ s, (frame1d z t)^2) = 1 := by classical have hsub : {⌊t⌋, ⌊t⌋+1} ⊆ s := by intro z hz simp only [Finset.mem_insert, Finset.mem_singleton] at hz rcases hz with rfl | rfl · exact h0 · exact h1 have he := Finset.sum_subset hsub (f := fun z => (frame1d z t)^2) (by intro z _ hz have hn : z ≠ ⌊t⌋ ∧ z ≠ ⌊t⌋+1 := by simpa using hz rw [frame1d_zero_of_not_adjacent t z hn, zero_pow (by decide : 2 ≠ 0)]) rw [← he] rw [Finset.sum_pair (by omega : ⌊t⌋ ≠ ⌊t⌋+1)] exact frame1d_adjacent_square _ _ (Int.floor_le t) (Int.lt_floor_add_one t).le
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_square_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:250
theorem frame1d_grid_square_sum Lemma frame1d_grid_square_sum in the paper ↗

The finite grid contains both adjacent frames whenever the argument is in its interior. Given the specified input R, the specified input t, the specified input hl, the specified input hu, the frame1d grid square sum conclusion holds.

Formal statement
R :
ℕ
t :
ℝ
hl :
-(R:ℝ)+1 ≤ t
hu :
t ≤ (R:ℝ)-1
(∑ z : Fin (2*R+1), (frame1d ((z:ℤ)-(R:ℤ)) t)^2) = 1
Proof (Lean source)
lemma frame1d_grid_square_sum (R : ℕ) (t : ℝ) (hl : -(R:ℝ)+1 ≤ t) (hu : t ≤ (R:ℝ)-1) : (∑ z : Fin (2*R+1), (frame1d ((z:ℤ)-(R:ℤ)) t)^2) = 1 := by let s : Finset ℤ := Finset.univ.image (fun z : Fin (2*R+1) => (z:ℤ)-(R:ℤ)) have hmem (j : ℤ) (hjl : -(R:ℤ) ≤ j) (hju : j ≤ (R:ℤ)) : j ∈ s := by have hj0 : 0 ≤ j+(R:ℤ) := by omega have hjM : j+(R:ℤ) < (2*R+1:ℕ) := by omega let z : Fin (2*R+1) := ⟨(j+(R:ℤ)).toNat, by omega⟩ apply Finset.mem_image.mpr refine ⟨z, Finset.mem_univ _, ?_⟩ dsimp [z] rw [Int.toNat_of_nonneg hj0] omega have hfloor : -(R:ℤ) ≤ ⌊t⌋ ∧ ⌊t⌋+1 ≤ (R:ℤ) := by have hf := Int.floor_le t have hf' := Int.lt_floor_add_one t constructor · have hr : -(R:ℝ) < (⌊t⌋:ℝ)+1 := by linarith have hi : -(R:ℤ) < ⌊t⌋+1 := by exact_mod_cast hr omega · have hr : (⌊t⌋:ℝ)+1 ≤ (R:ℝ) := by linarith exact_mod_cast hr have he := frame1d_square_sum s t (hmem _ hfloor.1 (by omega)) (hmem _ (by omega) hfloor.2) rw [Finset.sum_image] at he · exact he · intro z _ w _ hzw apply Fin.ext have hv : (z:ℤ) = (w:ℤ) := by change (z:ℤ)-(R:ℤ) = (w:ℤ)-(R:ℤ) at hzw omega exact_mod_cast hv
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame1d_grid_square_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:269

Outside its localization cube the macro bump is identically zero. Given the specified input h, the specified input hh, the specified input x, the specified input hx, the macro bump zero outside conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
hh :
0 < h
x :
Cov d
hx :
x ∉ locCube d h
macroBump h x = 0
Proof (Lean source)
lemma macroBump_zero_outside (h : ℝ) (hh : 0 < h) (x : Cov d) (hx : x ∉ locCube d h) : macroBump h x = 0 := by have hex : ∃ i, ¬ (1/2-h/2 ≤ x i ∧ x i ≤ 1/2+h/2) := by simpa only [locCube, mem_ofPred_eq, mem_Icc, not_forall] using hx obtain ⟨i, hi⟩ := hex have ht : 1-4*((x i-1/2)/h)^2 ≤ 0 := by have hcases : x i < 1/2-h/2 ∨ 1/2+h/2 < x i := by by_cases hl : 1/2-h/2 ≤ x i · exact inr (lt_of_not_ge (fun hu => hi ⟨hl, hu⟩)) · exact inl (lt_of_not_ge hl) rcases hcases with hi | hi · have hb : (x i-1/2)/h < -1/2 := (div_lt_iff₀ hh).mpr (by linarith) nlinarith [sq_nonneg ((x i-1/2)/h+1/2)] · have hb : 1/2 < (x i-1/2)/h := (lt_div_iff₀ hh).mpr (by linarith) nlinarith [sq_nonneg ((x i-1/2)/h-1/2)] unfold macroBump apply Finset.prod_eq_zero (Finset.mem_univ i) simp only [flatExp, if_neg (not_lt.mpr ht), zero_div]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_zero_outside · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:303
theorem frame_tensor_zero_of_filter Lemma frame_tensor_zero_of_filter in the paper ↗

An index failing the geometric support filter has a zero tensor frame at a cube point. Given the specified input h, the specified input delta, the specified input x, the specified input hx, the specified input z, the specified input hz, the frame tensor zero of filter conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
x :
Cov d
hx :
x ∈ locCube d h
z :
Fin d → ℤ
hz :
¬ ∃ y ∈ locCube d h, ∀ i, |(y i-1/2)/delta-(z i:ℝ)| ≤ 1
(∏ i, frame1d (z i) ((x i-1/2)/delta)) = 0
Proof (Lean source)
lemma frame_tensor_zero_of_filter (h delta : ℝ) (x : Cov d) (hx : x ∈ locCube d h) (z : Fin d → ℤ) (hz : ¬ ∃ y ∈ locCube d h, ∀ i, |(y i-1/2)/delta-(z i:ℝ)| ≤ 1) : (∏ i, frame1d (z i) ((x i-1/2)/delta)) = 0 := by have hex : ∃ i, ¬ |(x i-1/2)/delta-(z i:ℝ)| ≤ 1 := by by_contra hn apply hz refine ⟨x, hx, ?_⟩ simpa using hn obtain ⟨i, hi⟩ := hex apply Finset.prod_eq_zero (Finset.mem_univ i) have hc : (x i-1/2)/delta-(z i:ℝ) < -1 ∨ 1 < (x i-1/2)/delta-(z i:ℝ) := by simpa only [abs_le, not_and_or, not_le] using hi rcases hc with hc | hc · exact frame1d_zero_left _ _ (by linarith) · exact frame1d_zero_right _ _ (by linarith)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame_tensor_zero_of_filter · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:323

Given the specified input h, the specified input delta, the specified input hh, the specified input hh', the specified input hd, the specified input hdh, the specified input x, the frame square partition conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
hd :
0 < delta
hdh :
delta ≤ h
x :
Cov d
(∑ z : {z // z ∈ frameIdx d h delta}, (frame h delta z.1 x)^2) = (macroBump h x)^2
Proof (Lean source)
lemma frame_square_partition (h delta : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (hd : 0 < delta) (hdh : delta ≤ h) (x : Cov d) : (∑ z : {z // z ∈ frameIdx d h delta}, (frame h delta z.1 x)^2) = (macroBump h x)^2 := by classical by_cases hx : x ∈ locCube d h · let R := gridRadius h delta let G : Finset (Fin d → ℤ) := Finset.univ.image (fun z : Fin d → Fin (2*R+1) => fun i => (z i:ℤ)-(R:ℤ)) let f : (Fin d → ℤ) → ℝ := fun z => (∏ i, frame1d (z i) ((x i-1/2)/delta))^2 have harg (i : Fin d) : -(R:ℝ)+1 ≤ (x i-1/2)/delta ∧ (x i-1/2)/delta ≤ (R:ℝ)-1 := by have hc := hx i have habs : |h/delta| = h/delta := abs_of_pos (div_pos hh hd) have hr : h/delta/2 ≤ (ceil (|h/delta|/2):ℝ) := by simpa only [habs] using Nat.le_ceil (|h/delta|/2) have hR : h/delta/2+2 ≤ (R:ℝ) := by dsimp [R, gridRadius] push_cast linarith constructor · apply (le_div_iff₀ hd).mpr have hb : -h/2 ≤ x i-1/2 := by linarith [hc.1] have hr' := (div_le_iff₀ hd).mp (show h/2/delta ≤ (R:ℝ)-1 by convert (show h/delta/2 ≤ (R:ℝ)-1 by linarith) using 1; ring) nlinarith · apply (div_le_iff₀ hd).mpr have hb : x i-1/2 ≤ h/2 := by linarith [hc.2] have hr' := (div_le_iff₀ hd).mp (show h/2/delta ≤ (R:ℝ)-1 by convert (show h/delta/2 ≤ (R:ℝ)-1 by linarith) using 1; ring) linarith have hfull : (∑ z ∈ G, f z) = 1 := by rw [Finset.sum_image] · dsimp only [f] simp_rw [← Finset.prod_pow] rw [← Fintype.prod_sum (fun (i : Fin d) (j : Fin (2*R+1)) => (frame1d ((j:ℤ)-(R:ℤ)) ((x i-1/2)/delta))^2)] simp only [frame1d_grid_square_sum R _ (harg _).1 (harg _).2, Finset.prod_const_one] · intro z _ w _ he funext i have hi := congrFun he i change (z i:ℤ)-(R:ℤ) = (w i:ℤ)-(R:ℤ) at hi apply Fin.ext have hv : (z i:ℤ) = (w i:ℤ) := by omega exact_mod_cast hv have hfiltered : (∑ z ∈ frameIdx d h delta, f z) = 1 := by change (∑ z ∈ G.filter (fun z => ∃ y ∈ locCube d h, ∀ i, |(y i-1/2)/delta-(z i:ℝ)| ≤ 1), f z) = 1 rw [Finset.sum_filter] convert hfull using 1 apply Finset.sum_congr rfl intro z hz split_ifs with hsupport · rfl · dsimp only [f] rw [frame_tensor_zero_of_filter h delta x hx z hsupport, zero_pow (by decide : 2 ≠ 0)] rw [show (∑ z : {z // z ∈ frameIdx d h delta}, (frame h delta z.1 x)^2) = (macroBump h x)^2 * (∑ z ∈ frameIdx d h delta, f z) by simp only [frame, mul_pow] rw [← Finset.mul_sum] congr 1 exact Finset.sum_coe_sort (frameIdx d h delta) f] rw [hfiltered, mul_one] · simp only [frame, macroBump_zero_outside h hh x hx, zero_mul, zero_pow (by decide : 2 ≠ 0), Finset.sum_const_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.frame_square_partition · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:342

The prescribed flat exponential is Mathlib's smooth glue function. the flat exp eq glue conclusion holds.

Formal statement
Proof (Lean source)
lemma flatExp_eq_glue : flatExp = expNegInvGlue := by funext t unfold flatExp expNegInvGlue by_cases ht : 0 < t · simp [ht, not_le.mpr ht, div_eq_mul_inv] · simp [ht, le_of_not_gt ht]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flatExp_eq_glue · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:409

For bandwidth h, the fixed macro bump is globally smooth, including its support boundary.

Formal statement
d :
ℕ
shared
h :
ℝ
ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) (macroBump (d:=d) h)
Proof (Lean source)
@[fun_prop] lemma macroBump_contDiff (h : ℝ) : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) (macroBump (d:=d) h) := by unfold macroBump apply contDiff_prod intro i _ rw [flatExp_eq_glue] have hcoord : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) (fun x : Cov d => x i) := (PiLp.proj (p := 2) (𝕜 := ℝ) (β := fun _ : Fin d => ℝ) i).contDiff exact (expNegInvGlue.contDiff.comp (by fun_prop)).div_const _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_contDiff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:417
theorem macroBump_compactSupport Lemma macroBump_compactSupport in the paper ↗

The fixed macro bump has compact support. Given the specified input d, the macro bump compact support conclusion holds.

Formal statement
d :
ℕ
Proof (Lean source)
lemma macroBump_compactSupport (d : ℕ) : HasCompactSupport (macroBump (d:=d) 1) := by have hcompact : IsCompact (locCube d 1) := by have heq : locCube d 1 = ((PiLp.homeomorph 2 (fun _ : Fin d => ℝ)) ⁻¹' pi univ (fun _ => Icc (1/2-1/2 : ℝ) (1/2+1/2))) := by ext x simp only [locCube, mem_setOf_eq, mem_preimage, mem_pi, mem_univ, forall_const] rfl rw [heq] exact (Homeomorph.isCompact_preimage _).2 (isCompact_univ_pi fun _ => isCompact_Icc) exact HasCompactSupport.intro hcompact (fun x hx => macroBump_zero_outside 1 (by norm_num) x hx)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_compactSupport · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:428

Dilation of the fixed centered macro profile is exactly the prescribed bump. Given the specified input h, the specified input x, the macro bump dilation conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
x :
Cov d
macroBump 1 (h⁻¹ • (x-x0 d) + x0 d) = macroBump h x
Proof (Lean source)
lemma macroBump_dilation (h : ℝ) (x : Cov d) : macroBump 1 (h⁻¹ • (x-x0 d) + x0 d) = macroBump h x := by unfold macroBump apply Finset.prod_congr rfl intro i _ congr 3 simp [x0, div_eq_mul_inv, mul_comm]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_dilation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:440

Given the specified input d, the specified input s, the specified input hs, the specified input hs', the macro square holder conclusion holds.

Formal statement
d :
ℕ
s :
ℝ
hs :
0 < s
hs' :
s ≤ 3
∃ C : ℝ,
0 < C
conclusion 1
h :
0 < h
h ≤ 1/2
holderNorm (fun x : Cov d => (macroBump h x)^2) s ≤ ofReal (C*h^(-s))
Proof (Lean source)
lemma macro_square_holder (d : ℕ) (s : ℝ) (hs : 0 < s) (hs' : s ≤ 3) : -- @realizes s(Holder-order public domain) ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) ∀ h, 0 < h → h ≤ 1/2 → holderNorm (fun x : Cov d => (macroBump h x)^2) s ≤ ofReal (C*h^(-s)) := by let f : Cov d → ℝ := fun z => (macroBump 1 (z+x0 d))^2 have hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f := by dsimp [f] fun_prop have hsupp : HasCompactSupport f := by have hc := (macroBump_compactSupport d).comp_homeomorph (Homeomorph.addRight (x0 d)) change HasCompactSupport (fun z => macroBump 1 (z+x0 d)) at hc change HasCompactSupport (fun z => (macroBump 1 (z+x0 d))^2) apply HasCompactSupport.intro hc intro z hz rw [image_eq_zero_of_notMem_tsupport hz, zero_pow (by decide : 2 ≠ 0)] obtain ⟨C, hC, hbound⟩ := compact_profile_scaled_holder f hf hsupp s hs refine ⟨C, hC, ?_⟩ intro h hh hh' have hb := hbound h hh (by linarith) simpa only [f, macroBump_dilation] using hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macro_square_holder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Frames.lean:449
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.FuzzyBlockTesting 22 declarations Transport the cited product-experiment testing inequality to a single observation consisting of the entire original-record dataset, with its randomizer included.

Fuzzy testing on one full data block

Transport the cited product-experiment testing inequality to a single observation consisting of the entire original-record dataset, with its randomizer included. The finite-prior identities preserve the marked information bound under this randomization and express the two mixtures using a common product prior.

theorem hellingerSq_map_embedding Lemma hellingerSq_map_embedding in the paper ↗

Squared Hellinger distance is invariant under a measurable embedding. Given the specified input B, the specified input C, the specified input f, the specified input hf, the hellinger sq map embedding conclusion holds.

Formal statement
hellingerSq (B.map f) (C.map f) = hellingerSq B C
Proof (Lean source)
lemma hellingerSq_map_embedding {Ω Ξ : Type*} [MeasurableSpace Ω] [MeasurableSpace Ξ] (B C : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure C] (f : Ω → Ξ) (hf : MeasurableEmbedding f) : hellingerSq (B.map f) (C.map f) = hellingerSq B C := by have hb := hf.rnDeriv_map B (B+C) have hc := hf.rnDeriv_map C (B+C) unfold hellingerSq hellingerSqDensity rw [← Measure.map_add _ _ hf.measurable, hf.integral_map] apply integral_congr_ae filter_upwards [hb, hc] with x hxB hxC rw [hxB, hxC]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_map_embedding · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:25
theorem measurableEmbedding_singleton_coordinate Lemma measurableEmbedding_singleton_coordinate in the paper ↗

Replicating a value in a singleton coordinate is a measurable embedding. the measurable embedding singleton coordinate conclusion holds.

Formal statement
Ω :
MeasurableEmbedding (fun x : Ω => fun _ : Fin 1 => x)
Proof (Lean source)
lemma measurableEmbedding_singleton_coordinate {Ω : Type*} [MeasurableSpace Ω] : MeasurableEmbedding (fun x : Ω => fun _ : Fin 1 => x) := by have he : (fun x : Ω => fun _ : Fin 1 => x) = (MeasurableEquiv.piUnique (fun _ : Fin 1 => Ω)).symm := by funext x i simp rw [he] exact (MeasurableEquiv.piUnique (fun _ : Fin 1 => Ω)).symm.measurableEmbedding
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurableEmbedding_singleton_coordinate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:38

A singleton product is the image of its only coordinate law. Given the specified input P, the pi one eq map constant conclusion holds.

Formal statement
Ω :
P :
Measure.pi (fun _ : Fin 1 => P) = P.map (fun x => fun _ : Fin 1 => x)
Proof (Lean source)
lemma pi_one_eq_map_constant {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) : Measure.pi (fun _ : Fin 1 => P) = P.map (fun x => fun _ : Fin 1 => x) := by exact (MeasurePreserving.symm (MeasurableEquiv.piUnique (fun _ : Fin 1 => Ω)) (measurePreserving_piUnique (fun _ : Fin 1 => P))).map_eq.symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.pi_one_eq_map_constant · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:48

One-coordinate product experiments have the original Hellinger distance. Given the specified input B, the specified input C, the hellinger sq pi one conclusion holds.

Formal statement
hellingerSq (Measure.pi (fun _ : Fin 1 => B)) (Measure.pi (fun _ : Fin 1 => C))
Proof (Lean source)
lemma hellingerSq_pi_one {Ω : Type*} [MeasurableSpace Ω] (B C : Measure Ω) [IsFiniteMeasure B] [IsFiniteMeasure C] : hellingerSq (Measure.pi (fun _ : Fin 1 => B)) (Measure.pi (fun _ : Fin 1 => C)) = hellingerSq B C := by rw [pi_one_eq_map_constant, pi_one_eq_map_constant] exact hellingerSq_map_embedding B C _ measurableEmbedding_singleton_coordinate
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.hellingerSq_pi_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:54

Mixing singleton experiments commutes with their constant-coordinate encoding. Given the specified input Z, the specified input K, the bind pi one eq map conclusion holds.

Formal statement
ω :
K :
Kernel Z Ω
ω.bind (fun z => Measure.pi (fun _ : Fin 1 => K z))
= (ω.bind (fun z => K z)).map (fun x => fun _ : Fin 1 => x)
Proof (Lean source)
lemma bind_pi_one_eq_map {Ω Z : Type*} [MeasurableSpace Ω] [MeasurableSpace Z] (ω : Measure Z) (K : Kernel Z Ω) : ω.bind (fun z => Measure.pi (fun _ : Fin 1 => K z)) = (ω.bind (fun z => K z)).map (fun x => fun _ : Fin 1 => x) := by rw [Measure.map_comp ω K (by fun_prop)] congr 1 funext z rw [Kernel.map_apply _ (by fun_prop), pi_one_eq_map_constant]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bind_pi_one_eq_map · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:63
theorem published_fuzzy_testing_block Lemma published_fuzzy_testing_block in the paper ↗

The cited fuzzy-testing result applies to one entire data block and every measurable decision on that block, without an additional independence assumption. Given the specified input Z, the specified input B, the specified input C, the specified input Model, the specified input hB, the specified input hC, the specified input s, the specified input u, the specified input hs, the specified input hu, the specified input hu2, the specified input hsep, the specified input hhell, the specified input T, the specified input hT, the published fuzzy testing block conclusion holds.

Formal statement
Model :
hB :
∀ z, B z ∈ Model
hC :
∀ z, C z ∈ Model
Ψ :
Measure Ω → ℝ
s u :
ℝ
hs :
0 < s
hu :
0 ≤ u
hu2 :
u < 2
hsep :
∀ z z', s ≤ Ψ (B z) - Ψ (C z')
hhell :
hellingerSq (ω.bind (fun z => B z)) (ω.bind (fun z => C z)) ≤ u
T :
Ω → ℝ
hT :
ofReal ((s/4)*(1-sqrt (u*(1-u/4))))
≤ ⨆ (P : Measure Ω) (_ : P ∈ Model), ∫⁻ w, ofReal |T w - Ψ P| ∂P
Proof (Lean source)
lemma published_fuzzy_testing_block {Ω Z : Type} [MeasurableSpace Ω] [MeasurableSpace Z] (ω : Measure Z) [IsProbabilityMeasure ω] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C] (Model : Set (Measure Ω)) (hB : ∀ z, B z ∈ Model) (hC : ∀ z, C z ∈ Model) (Ψ : Measure Ω → ℝ) (s u : ℝ) (hs : 0 < s) (hu : 0 ≤ u) (hu2 : u < 2) (hsep : ∀ z z', s ≤ Ψ (B z) - Ψ (C z')) (hhell : hellingerSq (ω.bind (fun z => B z)) (ω.bind (fun z => C z)) ≤ u) (T : Ω → ℝ) (hT : Measurable T) : ofReal ((s/4)*(1-sqrt (u*(1-u/4)))) ≤ ⨆ (P : Measure Ω) (_ : P ∈ Model), ∫⁻ w, ofReal |T w - Ψ P| ∂P := by have hpi : hellingerSq (ω.bind (fun z => Measure.pi (fun _ : Fin 1 => B z))) (ω.bind (fun z => Measure.pi (fun _ : Fin 1 => C z))) ≤ u := by rw [bind_pi_one_eq_map, bind_pi_one_eq_map, hellingerSq_map_embedding _ _ _ measurableEmbedding_singleton_coordinate] exact hhell have htest := PublishedFuzzyTesting Ω Z ω B C 1 (by norm_num) Model hB hC Ψ s u hs hu hu2 hsep hpi (fun w => T (w 0)) (by fun_prop) convert htest using 1 congr 1 funext P congr 1 funext hP rw [pi_one_eq_map_constant, measurableEmbedding_singleton_coordinate.lintegral_map]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.published_fuzzy_testing_block · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:73
theorem published_fuzzy_testing_minimax Lemma published_fuzzy_testing_minimax in the paper ↗

A testing bound on the image of an indexed model class bounds its original minimax risk when the target is well defined on the experiment laws. Given the specified input Z, the specified input B, the specified input C, the specified input E, the specified input target, the specified input hTarget, the specified input hB, the specified input hC, the specified input s, the specified input u, the specified input hs, the specified input hu, the specified input hu2, the specified input hsep, the specified input hhell, the published fuzzy testing minimax conclusion holds.

Formal statement
Ω Z Θ :
E :
Θ → Measure Ω
target :
Θ → ℝ
Ψ :
Measure Ω → ℝ
hTarget :
∀ θ, Ψ (E θ) = target θ
hB :
∀ z, ∃ θ, B z = E θ
hC :
∀ z, ∃ θ, C z = E θ
s u :
ℝ
hs :
0 < s
hu :
0 ≤ u
hu2 :
u < 2
hsep :
∀ z z', s ≤ Ψ (B z) - Ψ (C z')
hhell :
hellingerSq (ω.bind (fun z => B z)) (ω.bind (fun z => C z)) ≤ u
ofReal ((s/4)*(1-sqrt (u*(1-u/4))))
≤ minimaxValueENNReal (fun (T : {f : Ω → ℝ // Measurable f}) θ => ∫⁻ w, ofReal |T.1 w - target θ| ∂E θ)
Proof (Lean source)
lemma published_fuzzy_testing_minimax {Ω Z Θ : Type} [MeasurableSpace Ω] [MeasurableSpace Z] (ω : Measure Z) [IsProbabilityMeasure ω] (B C : Kernel Z Ω) [IsMarkovKernel B] [IsMarkovKernel C] (E : Θ → Measure Ω) (target : Θ → ℝ) (Ψ : Measure Ω → ℝ) (hTarget : ∀ θ, Ψ (E θ) = target θ) (hB : ∀ z, ∃ θ, B z = E θ) (hC : ∀ z, ∃ θ, C z = E θ) (s u : ℝ) (hs : 0 < s) (hu : 0 ≤ u) (hu2 : u < 2) (hsep : ∀ z z', s ≤ Ψ (B z) - Ψ (C z')) (hhell : hellingerSq (ω.bind (fun z => B z)) (ω.bind (fun z => C z)) ≤ u) : ofReal ((s/4)*(1-sqrt (u*(1-u/4)))) ≤ minimaxValueENNReal (fun (T : {f : Ω → ℝ // Measurable f}) θ => ∫⁻ w, ofReal |T.1 w - target θ| ∂E θ) := by apply le_minimaxValueENNReal intro T have htest := published_fuzzy_testing_block ω B C (range E) (fun z => by obtain ⟨θ, hθ⟩ := hB z; exact ⟨θ, hθ.symm⟩) (fun z => by obtain ⟨θ, hθ⟩ := hC z; exact ⟨θ, hθ.symm⟩) Ψ s u hs hu hu2 hsep hhell T.1 T.2 apply htest.trans apply iSup_le intro P apply iSup_le rintro ⟨θ, rfl⟩ rw [hTarget] exact le_worstCaseRiskENNReal T θ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.published_fuzzy_testing_minimax · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:100
theorem fuzzy_testing_overlap_sixteenth Lemma fuzzy_testing_overlap_sixteenth in the paper ↗

At the certificate's Hellinger budget, the testing overlap is at least three quarters. the fuzzy testing overlap sixteenth conclusion holds.

Formal statement
(3:ℝ)/4 ≤ 1-sqrt ((1/16:ℝ)*(1-(1/16:ℝ)/4))
Proof (Lean source)
lemma fuzzy_testing_overlap_sixteenth : (3:ℝ)/4 ≤ 1-sqrt ((1/16:ℝ)*(1-(1/16:ℝ)/4)) := by have hroot : sqrt ((1/16:ℝ)*(1-(1/16:ℝ)/4)) ≤ 1/4 := by apply (Real.sqrt_le_iff).mpr norm_num linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fuzzy_testing_overlap_sixteenth · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:130
theorem markedMixture_probability Lemma markedMixture_probability in the paper ↗

The prescribed finite marked mixture has unit mass. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the marked mixture probability conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
IsProbabilityMeasure (markedMixture (markedHandle d h delta a b) theta n m)
Proof (Lean source)
lemma markedMixture_probability (d n m : ℕ) (h delta a b : ℝ) (theta : Bool) : IsProbabilityMeasure (markedMixture (markedHandle d h delta a b) theta n m) := by obtain ⟨hw, hsum⟩ := marked_prior_mass d h delta theta constructor have hobs (sigma : SignArray d h delta) := obsLaw_probability (markedLaw h delta a b theta sigma) have hxa (sigma : SignArray d h delta) := xaLaw_probability (markedLaw h delta a b theta sigma) simp only [markedMixture, markedHandle, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, measure_univ, mul_one] change (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta theta sigma)) = 1 rw [← ENNReal.ofReal_sum_of_nonneg (fun sigma _ => hw sigma), hsum] norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:140
theorem markedMixture_prod_randomizer Lemma markedMixture_prod_randomizer in the paper ↗

Appending the same randomizer commutes with the marked finite prior. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the marked mixture prod randomizer conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
(markedMixture H theta n m).prod (volume.restrict (Icc (0:ℝ) 1))
= ∑ sigma : PriorSign H, ofReal (H.weight theta sigma) • experiment (H.law theta sigma) n m
Proof (Lean source)
lemma markedMixture_prod_randomizer {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) : (markedMixture H theta n m).prod (volume.restrict (Icc (0:ℝ) 1)) = ∑ sigma : PriorSign H, ofReal (H.weight theta sigma) • experiment (H.law theta sigma) n m := by unfold markedMixture experiment rw [← Measure.sum_fintype, Measure.prod_sum_left, Measure.sum_fintype] apply Finset.sum_congr rfl intro sigma _ rw [Measure.prod_smul_left]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_prod_randomizer · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:153
theorem markedMixture_randomized_hellinger Lemma markedMixture_randomized_hellinger in the paper ↗

The marked information bound holds unchanged on randomized original records. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the marked mixture randomized hellinger conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
hellingerSq (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta true sigma) • experiment ((markedHandle d h delta a b).law true sigma) n m) (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta false sigma) • experiment ((markedHandle d h delta a b).law false sigma) n m)
= hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m)
Proof (Lean source)
lemma markedMixture_randomized_hellinger (d n m : ℕ) (h delta a b : ℝ) : hellingerSq (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta true sigma) • experiment ((markedHandle d h delta a b).law true sigma) n m) (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta false sigma) • experiment ((markedHandle d h delta a b).law false sigma) n m) = hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m) := by let := population_randomizer_probability let := markedMixture_probability d n m h delta a b true let := markedMixture_probability d n m h delta a b false exact (congrArg₂ hellingerSq (markedMixture_prod_randomizer (n:=n) (m:=m) (markedHandle d h delta a b) true).symm (markedMixture_prod_randomizer (n:=n) (m:=m) (markedHandle d h delta a b) false).symm).trans (hellingerSq_prod_probability _ _ _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_randomized_hellinger · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:164

The first family under the product prior has exactly its own prior mixture. Given the specified input Z, the specified input W, the specified input K, the bind product prior fst conclusion holds.

Formal statement
(ω.prod ν).bind (fun z => K z.1) = ω.bind (fun z => K z)
Proof (Lean source)
lemma bind_product_prior_fst {Z W Ω : Type*} [MeasurableSpace Z] [MeasurableSpace W] [MeasurableSpace Ω] (ω : Measure Z) (ν : Measure W) [IsProbabilityMeasure ω] [IsProbabilityMeasure ν] (K : Kernel Z Ω) : (ω.prod ν).bind (fun z => K z.1) = ω.bind (fun z => K z) := by ext s hs rw [Measure.bind_apply hs (show AEMeasurable (fun z : Z × W => K z.1) (ω.prod ν) from by fun_prop), Measure.bind_apply hs K.aemeasurable, lintegral_prod (fun z : Z × W => K z.1 s) (show AEMeasurable (fun z : Z × W => K z.1 s) (ω.prod ν) from ((K.measurable_coe hs).comp measurable_fst).aemeasurable)] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bind_product_prior_fst · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:181

The second family under the product prior has exactly its own prior mixture. Given the specified input Z, the specified input W, the specified input K, the bind product prior snd conclusion holds.

Formal statement
(ω.prod ν).bind (fun z => K z.2) = ν.bind (fun z => K z)
Proof (Lean source)
lemma bind_product_prior_snd {Z W Ω : Type*} [MeasurableSpace Z] [MeasurableSpace W] [MeasurableSpace Ω] (ω : Measure Z) (ν : Measure W) [IsProbabilityMeasure ω] [IsProbabilityMeasure ν] (K : Kernel W Ω) : (ω.prod ν).bind (fun z => K z.2) = ν.bind (fun z => K z) := by ext s hs rw [Measure.bind_apply hs (show AEMeasurable (fun z : Z × W => K z.2) (ω.prod ν) from by fun_prop), Measure.bind_apply hs K.aemeasurable, lintegral_prod (fun z : Z × W => K z.2 s) (show AEMeasurable (fun z : Z × W => K z.2 s) (ω.prod ν) from ((K.measurable_coe hs).comp measurable_snd).aemeasurable)] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bind_product_prior_snd · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:195
theorem signPrior_marked_probability Lemma signPrior_marked_probability in the paper ↗

Each prescribed finite sign prior is a probability measure. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the sign prior marked probability conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
theta :
Proof (Lean source)
lemma signPrior_marked_probability (d : ℕ) (h delta a b : ℝ) (theta : Bool) : IsProbabilityMeasure (signPrior (markedHandle d h delta a b) theta) := by obtain ⟨hw, hsum⟩ := marked_prior_mass d h delta theta constructor change (∑ sigma : SignArray d h delta, ofReal (markedWeight h delta theta sigma) • Measure.dirac sigma) univ = 1 simp only [Measure.finsetSum_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_sum_of_nonneg (fun sigma _ => hw sigma), hsum] norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signPrior_marked_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:209

A finite atomic prior mixed through a kernel is its weighted sum of laws. Given the specified input d, the specified input H, the specified input theta, the specified input K, the sign prior bind kernel conclusion holds.

Formal statement
d :
ℕ
H :
theta :
Ω :
K :
(signPrior H theta).bind (fun sigma => K sigma)
= ∑ sigma : PriorSign H, ofReal (H.weight theta sigma) • K sigma
Proof (Lean source)
lemma signPrior_bind_kernel {d : ℕ} (H : MarkedPriors d) (theta : Bool) {Ω : Type*} [MeasurableSpace Ω] (K : Kernel (PriorSign H) Ω) : (signPrior H theta).bind (fun sigma => K sigma) = ∑ sigma : PriorSign H, ofReal (H.weight theta sigma) • K sigma := by unfold signPrior rw [← Measure.sum_fintype, Measure.bind_sum _ _ K.measurable.aemeasurable, Measure.sum_fintype] apply Finset.sum_congr rfl intro sigma _ rw [Measure.bind_smul, Measure.dirac_bind K.measurable]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signPrior_bind_kernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:221

The finite family of full original-record experiments is a measurable kernel. Given the specified input d, the specified input H, the specified input theta, the specified input n, the specified input m, marked experiment kernel is the corresponding construction.

Definition (Lean source)
d :
ℕ
H :
theta :
n m :
ℕ
markedExperimentKernel H theta n m :
Kernel (PriorSign H) (Sample d n m)
⟨fun sigma => experiment (H.law theta sigma) n m, by exact measurable_of_finite _⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedExperimentKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:233
theorem markedExperimentKernel_markov Lemma markedExperimentKernel_markov in the paper ↗

Every member of the full randomized experiment kernel is a probability law. Given the specified input d, the specified input H, the specified input theta, the specified input n, the specified input m, the marked experiment kernel markov conclusion holds.

Formal statement
d :
ℕ
H :
theta :
n m :
ℕ
Proof (Lean source)
lemma markedExperimentKernel_markov {d : ℕ} (H : MarkedPriors d) (theta : Bool) (n m : ℕ) : IsMarkovKernel (markedExperimentKernel H theta n m) := by constructor intro sigma exact population_experiment_probability (H.law theta sigma) n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedExperimentKernel_markov · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:239
theorem signPrior_bind_markedExperiment Lemma signPrior_bind_markedExperiment in the paper ↗

Mixing the full experiment kernel appends exactly the common randomizer to its original-record marked mixture. Given the specified input d, the specified input H, the specified input theta, the specified input n, the specified input m, the sign prior bind marked experiment conclusion holds.

Formal statement
d :
ℕ
H :
theta :
n m :
ℕ
(signPrior H theta).bind (fun sigma => markedExperimentKernel H theta n m sigma)
= (markedMixture H theta n m).prod (volume.restrict (Icc (0:ℝ) 1))
Proof (Lean source)
lemma signPrior_bind_markedExperiment {d : ℕ} (H : MarkedPriors d) (theta : Bool) (n m : ℕ) : (signPrior H theta).bind (fun sigma => markedExperimentKernel H theta n m sigma) = (markedMixture H theta n m).prod (volume.restrict (Icc (0:ℝ) 1)) := by rw [signPrior_bind_kernel, markedMixture_prod_randomizer] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signPrior_bind_markedExperiment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:246
theorem marked_common_prior_probability Lemma marked_common_prior_probability in the paper ↗

The product of the two prescribed sign priors is one common probability prior for the two full-block families in the cited testing theorem. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the marked common prior probability conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
Proof (Lean source)
lemma marked_common_prior_probability (d : ℕ) (h delta a b : ℝ) : IsProbabilityMeasure ((signPrior (markedHandle d h delta a b) false).prod (signPrior (markedHandle d h delta a b) true)) := by letI := signPrior_marked_probability d h delta a b false letI := signPrior_marked_probability d h delta a b true infer_instance
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_common_prior_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:255
theorem marked_common_prior_mixtures Lemma marked_common_prior_mixtures in the paper ↗

Both families under the common product prior have precisely the randomized marked mixtures prescribed by the lower-bound construction. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the marked common prior mixtures conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
H :
markedHandle d h delta a b
omega :
omega.bind (fun z => markedExperimentKernel H false n m z.1)
= (markedMixture H false n m).prod (volume.restrict (Icc (0:ℝ) 1))
omega.bind (fun z => markedExperimentKernel H true n m z.2)
= (markedMixture H true n m).prod (volume.restrict (Icc (0:ℝ) 1))
Proof (Lean source)
lemma marked_common_prior_mixtures (d n m : ℕ) (h delta a b : ℝ) : let H := markedHandle d h delta a b let omega := (signPrior H false).prod (signPrior H true) omega.bind (fun z => markedExperimentKernel H false n m z.1) = (markedMixture H false n m).prod (volume.restrict (Icc (0:ℝ) 1)) ∧ omega.bind (fun z => markedExperimentKernel H true n m z.2) = (markedMixture H true n m).prod (volume.restrict (Icc (0:ℝ) 1)) := by letI := signPrior_marked_probability d h delta a b false letI := signPrior_marked_probability d h delta a b true dsimp only constructor · rw [bind_product_prior_fst, signPrior_bind_markedExperiment] · rw [bind_product_prior_snd, signPrior_bind_markedExperiment]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_common_prior_mixtures · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:265
theorem marked_common_prior_hellinger Lemma marked_common_prior_hellinger in the paper ↗

The common product prior preserves the exact marked Hellinger distance, including the independent randomizer. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the marked common prior hellinger conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
H :
markedHandle d h delta a b
omega :
hellingerSq (omega.bind (fun z => markedExperimentKernel H true n m z.2)) (omega.bind (fun z => markedExperimentKernel H false n m z.1))
Proof (Lean source)
lemma marked_common_prior_hellinger (d n m : ℕ) (h delta a b : ℝ) : let H := markedHandle d h delta a b let omega := (signPrior H false).prod (signPrior H true) hellingerSq (omega.bind (fun z => markedExperimentKernel H true n m z.2)) (omega.bind (fun z => markedExperimentKernel H false n m z.1)) = hellingerSq (markedMixture H true n m) (markedMixture H false n m) := by have hid := marked_common_prior_mixtures d n m h delta a b dsimp only at hid ⊢ rw [hid.1, hid.2] letI := markedMixture_probability d n m h delta a b true letI := markedMixture_probability d n m h delta a b false letI := population_randomizer_probability exact hellingerSq_prod_probability _ _ _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_common_prior_hellinger · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:281
theorem marked_fuzzy_testing_minimax Lemma marked_fuzzy_testing_minimax in the paper ↗

Once the causal target is represented on the full experiment laws, the cited fuzzy test gives a minimax bound for the unchanged primitive class. Only values on the two marked families are needed from that representation. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input ha, the specified input hb, the specified input hMembers, the specified input hTargets, the target representation Ψ, its agreement on the marked families, the specified input hhell, the marked fuzzy testing minimax conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h delta a b :
ℝ
ha :
0 < a
hb :
0 < b
hMembers :
PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)
hTargets :
∀ sigma,
tau ((markedHandle d h delta a b).law false sigma) (hMembers false sigma) (x0 d) = 2*a*b ∧
tau ((markedHandle d h delta a b).law true sigma) (hMembers true sigma) (x0 d) = -2*a*b
Ψ :
Measure (Sample d n m) → ℝ
hΨ :
Ψ (experiment ((markedHandle d h delta a b).law theta sigma) n m)
= tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d)
hhell :
hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m)
≤ 1/16
ofReal ((3/4:ℝ)*a*b) ≤ minimaxRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma marked_fuzzy_testing_minimax (d n m : ℕ) (alpha beta gamma L eps h delta a b : ℝ) (ha : 0 < a) (hb : 0 < b) (hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)) (hTargets : ∀ sigma, tau ((markedHandle d h delta a b).law false sigma) (hMembers false sigma) (x0 d) = 2*a*b ∧ tau ((markedHandle d h delta a b).law true sigma) (hMembers true sigma) (x0 d) = -2*a*b) (Ψ : Measure (Sample d n m) → ℝ) (hΨ : ∀ theta sigma, Ψ (experiment ((markedHandle d h delta a b).law theta sigma) n m) = tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d)) (hhell : hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m) ≤ 1/16) : ofReal ((3/4:ℝ)*a*b) ≤ minimaxRisk d alpha beta gamma L eps n m := by let H := markedHandle d h delta a b let omega := (signPrior H false).prod (signPrior H true) let B : Kernel (PriorSign H × PriorSign H) (Sample d n m) := (markedExperimentKernel H false n m).comap Prod.fst measurable_fst let C : Kernel (PriorSign H × PriorSign H) (Sample d n m) := (markedExperimentKernel H true n m).comap snd measurable_snd letI := marked_common_prior_probability d h delta a b letI := markedExperimentKernel_markov H false n m letI := markedExperimentKernel_markov H true n m have hs : 0 < 4*a*b := by positivity have hsep : ∀ z z', 4*a*b ≤ Ψ (B z) - Ψ (C z') := by intro z z' change 4*a*b ≤ Ψ (experiment (H.law false z.1) n m) - Ψ (experiment (H.law true z'.2) n m) rw [hΨ, hΨ, (hTargets z.1).1, (hTargets z'.2).2] linarith have hh : hellingerSq (omega.bind (fun z => B z)) (omega.bind (fun z => C z)) ≤ 1/16 := by have hid := marked_common_prior_hellinger d n m h delta a b have hsym : hellingerSq (omega.bind (fun z => B z)) (omega.bind (fun z => C z)) = hellingerSq (omega.bind (fun z => C z)) (omega.bind (fun z => B z)) := by unfold hellingerSq hellingerSqDensity simp only [add_comm] apply integral_congr_ae filter_upwards [] with w ring rw [hsym] exact hid.le.trans hhell unfold minimaxRisk apply Causalean.Stat.le_minimaxValueENNReal intro T let Model : Set (Measure (Sample d n m)) := {P | ∃ theta sigma, P = experiment (H.law theta sigma) n m} have htest := published_fuzzy_testing_block omega B C Model (fun z => ⟨false, z.1, rfl⟩) (fun z => ⟨true, z.2, rfl⟩) Ψ (4*a*b) (1/16) hs (by norm_num) (by norm_num) hsep hh T.1 T.2 have hconstant : (3/4:ℝ)*a*b ≤ (4*a*b/4)*(1-sqrt ((1/16:ℝ)*(1-(1/16:ℝ)/4))) := by have ho := mul_le_mul_of_nonneg_left fuzzy_testing_overlap_sixteenth (mul_pos ha hb).le nlinarith apply (ENNReal.ofReal_le_ofReal hconstant).trans (htest.trans ?_) apply iSup_le intro P apply iSup_le rintro ⟨theta, sigma, rfl⟩ rw [hΨ] exact le_worstCaseRiskENNReal (risk := classRisk d alpha beta gamma L eps n m) T ⟨H.law theta sigma, hMembers theta sigma⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_fuzzy_testing_minimax · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/FuzzyBlockTesting.lean:298
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.Likelihood 35 declarations Two-channel point-CATE annotation frontier: Lower/Likelihood constructions and obligations.

Lower/Likelihood

Two-channel point-CATE annotation frontier: Lower/Likelihood constructions and obligations.

def conditionalObserved

Given the specified input P, the specified input x, conditional observed is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
x :
Cov d
conditionalObserved P x :
(bern (P.e x)).bind (fun A => (Measure.dirac A).prod (bern (if A then P.mu1 x else P.mu0 x)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObserved · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:24

Given the specified input H, the specified input theta, the specified input x, singleton mixture is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
theta :
x :
Cov d
singletonMixture H theta x :
∑ sigma, ofReal (H.weight theta sigma) • conditionalObserved (H.law theta sigma) x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.singletonMixture · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:27

Given the specified input H, the specified input theta, the specified input k, auxiliary mixture is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
theta :
k :
ℕ
auxiliaryMixture H theta k :
Measure (Fin k → Cov d × Bool)
∑ sigma, ofReal (H.weight theta sigma) • Measure.pi (fun _ : Fin k => xaLaw (H.law theta sigma))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliaryMixture · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:30

Given the specified input H, the specified input theta, the specified input k, the specified input x, conditional auxiliary mixture is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
theta :
k :
ℕ
x :
Fin k → Cov d
conditionalAuxiliaryMixture H theta k x :
Measure (Fin k → Bool)
∑ sigma, ofReal (H.weight theta sigma) • Measure.pi (fun i : Fin k => bern ((H.law theta sigma).e (x i)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalAuxiliaryMixture · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:34

fair observed is the corresponding construction.

Definition (Lean source)
fairObserved :
(bern (1/2)).prod (bern (1/2))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fairObserved · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:39
def labelLikelihood

Given the specified input P, the specified input x, the specified input s, label likelihood is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
x :
Cov d
s :
labelLikelihood P x s :
ℝ
4 * ((bern (P.e x)) {s.1}).toReal * ((bern (if s.1 then P.mu1 x else P.mu0 x)) {s.2}).toReal
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.labelLikelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:41
def auxiliaryLikelihood

Given the specified input P, the specified input x, the specified input s, auxiliary likelihood is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
P :
x :
Cov d
s :
auxiliaryLikelihood P x s :
ℝ
2 * ((bern (P.e x)) {s}).toReal
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliaryLikelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:45
def RecordSpins

Given the specified input n, the specified input m, record spins is the corresponding construction.

Definition (Lean source)
n m :
ℕ
RecordSpins n m :
Type
(Fin n → Bool × Bool) × (Fin m → Bool)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.RecordSpins · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:48
def recordCovariates

Given the specified input x, the specified input xt, record covariates is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
x :
Fin n → Cov d
xt :
Fin m → Cov d
recordCovariates x xt :
Fin (n+m) → Cov d
Fin.addCases x xt
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordCovariates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:50
def recordLikelihood

Given the specified input P, the specified input x, the specified input s, record likelihood is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
P :
x :
Fin (n+m) → Cov d
s :
recordLikelihood P x s :
Fin (n+m) → ℝ
Fin.addCases (fun i => labelLikelihood P (x (castAdd m i)) (s.1 i)) (fun j => auxiliaryLikelihood P (x (natAdd n j)) (s.2 j))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.recordLikelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:52
def mixedDensity

Given the specified input H, the specified input theta, the specified input x, the specified input s, mixed density is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
n :
ℕ
shared
m :
ℕ
shared
H :
theta :
x :
Fin (n+m) → Cov d
s :
mixedDensity H theta x s :
ℝ
∑ sigma, H.weight theta sigma * ∏ i, recordLikelihood (H.law theta sigma) x s i
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.mixedDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:56

Given the specified input d, the specified input h, the specified input delta, the specified input theta, the marked prior mass conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
theta :
conclusion 1
sigma :
SignArray d h delta
0 ≤ markedWeight h delta theta sigma
conclusion 2
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma) = 1
Proof (Lean source)
lemma marked_prior_mass (d : ℕ) (h delta : ℝ) (theta : Bool) : (∀ sigma : SignArray d h delta, 0 ≤ markedWeight h delta theta sigma) ∧ (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma) = 1 := by constructor · intro sigma apply Finset.prod_nonneg intro z _ rcases hs : sigma z with ⟨l, v⟩ cases theta <;> cases l <;> cases v <;> norm_num [thetaSign, hs] · unfold markedWeight rw [← Fintype.prod_sum (fun (_ : {z // z ∈ frameIdx d h delta}) (s : Bool × Bool) => (1 + thetaSign theta * thetaSign s.1 * thetaSign s.2 / 2) / 4)] have hpair : ∑ s : Bool × Bool, (1 + thetaSign theta * thetaSign s.1 * thetaSign s.2 / 2) / 4 = 1 := by cases theta <;> norm_num [Fintype.sum_prod_type, thetaSign] simp only [hpair, Finset.prod_const_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_prior_mass · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:59

Flip every outcome sign while retaining every propensity sign. Given the specified input d, the specified input h, the specified input delta, flip outcome signs is the corresponding construction.

Definition (Lean source)
d :
ℕ
h delta :
ℝ
flipOutcomeSigns d h delta :
SignArray d h delta ≃ SignArray d h delta
clause 1
toFun sigma z := ((sigma z).1, !(sigma z).2)
clause 2
invFun sigma z := ((sigma z).1, !(sigma z).2)
clause 3
left_inv sigma := by funext z; simp
clause 4
right_inv sigma := by funext z; simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.flipOutcomeSigns · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:77
theorem markedWeight_flipOutcomeSigns Lemma markedWeight_flipOutcomeSigns in the paper ↗

The sign flip transports the positive prior weights to the negative weights. Given the specified input d, the specified input h, the specified input delta, the specified input sigma, the marked weight flip outcome signs conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
sigma :
SignArray d h delta
markedWeight h delta true sigma
= markedWeight h delta false (flipOutcomeSigns d h delta sigma)
Proof (Lean source)
lemma markedWeight_flipOutcomeSigns (d : ℕ) (h delta : ℝ) (sigma : SignArray d h delta) : markedWeight h delta true sigma = markedWeight h delta false (flipOutcomeSigns d h delta sigma) := by unfold markedWeight apply Finset.prod_congr rfl intro z _ rcases hs : sigma z with ⟨l, v⟩ cases l <;> cases v <;> norm_num [flipOutcomeSigns, thetaSign, hs]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedWeight_flipOutcomeSigns · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:84
theorem markedPropensity_flipOutcomeSigns Lemma markedPropensity_flipOutcomeSigns in the paper ↗

The designated propensity ignores outcome signs and the hypothesis index. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input sigma, the marked propensity flip outcome signs conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
sigma :
SignArray d h delta
(markedLaw h delta a b true sigma).e
= (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)).e
Proof (Lean source)
lemma markedPropensity_flipOutcomeSigns (d : ℕ) (h delta a b : ℝ) (sigma : SignArray d h delta) : (markedLaw h delta a b true sigma).e = (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)).e := by rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedPropensity_flipOutcomeSigns · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:95
theorem marked_xaLaw_flipOutcomeSigns Lemma marked_xaLaw_flipOutcomeSigns in the paper ↗

The treatment-record law depends only on the propensity, with the same uniform design. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input sigma, the marked xa law flip outcome signs conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
sigma :
SignArray d h delta
xaLaw (markedLaw h delta a b true sigma)
= xaLaw (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma))
Proof (Lean source)
lemma marked_xaLaw_flipOutcomeSigns (d : ℕ) (h delta a b : ℝ) (sigma : SignArray d h delta) : xaLaw (markedLaw h delta a b true sigma) = xaLaw (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)) := by have hm (theta : Bool) (sigma : SignArray d h delta) : xaLaw (markedLaw h delta a b theta sigma) = (uniformLaw d) ⊗ₘ bernKernel (markedLaw h delta a b theta sigma).e (markedLaw h delta a b theta sigma).measurable_e := by rw [xaLaw, (markedLaw h delta a b theta sigma).margin_e] rw [show (markedLaw h delta a b theta sigma).law.map fst = uniformLaw d from independentFullLaw_covariates d _ _ _ (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma)] rw [hm, hm] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_xaLaw_flipOutcomeSigns · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:102
theorem auxiliary_only_equality Lemma auxiliary_only_equality in the paper ↗

Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input k, the auxiliary only equality conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
k :
ℕ
H :
markedHandle d h delta a b
Proof (Lean source)
lemma auxiliary_only_equality (d : ℕ) (h delta a b : ℝ) (k : ℕ) : let H := markedHandle d h delta a b auxiliaryMixture H true k = auxiliaryMixture H false k ∧ ∀ x : Fin k → Cov d, conditionalAuxiliaryMixture H true k x = conditionalAuxiliaryMixture H false k x := by dsimp only constructor · unfold auxiliaryMixture apply Fintype.sum_equiv (flipOutcomeSigns d h delta) intro sigma change ofReal (markedWeight h delta true sigma) • Measure.pi (fun _ : Fin k => xaLaw (markedLaw h delta a b true sigma)) = ofReal (markedWeight h delta false (flipOutcomeSigns d h delta sigma)) • Measure.pi (fun _ : Fin k => xaLaw (markedLaw h delta a b false (flipOutcomeSigns d h delta sigma))) rw [markedWeight_flipOutcomeSigns, marked_xaLaw_flipOutcomeSigns] · intro x unfold conditionalAuxiliaryMixture apply Fintype.sum_equiv (flipOutcomeSigns d h delta) intro sigma change ofReal (markedWeight h delta true sigma) • Measure.pi (fun i : Fin k => bern ((markedLaw h delta a b true sigma).e (x i))) = ofReal (markedWeight h delta false (flipOutcomeSigns d h delta sigma)) • Measure.pi (fun i : Fin k => bern ((markedLaw h delta a b false (flipOutcomeSigns d h delta sigma)).e (x i))) rw [markedWeight_flipOutcomeSigns, markedPropensity_flipOutcomeSigns]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliary_only_equality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:119
theorem finite_product_weighted_sum Lemma finite_product_weighted_sum in the paper ↗

Finite product weights turn expectations of coordinate products into products of scalar sums. Given the specified input S, the specified input w, the specified input f, the finite product weighted sum conclusion holds.

Formal statement
ι S :
w f :
ι → S → ℝ
(∑ sigma : ι → S, (∏ i, w i (sigma i)) * ∏ i, f i (sigma i)) = ∏ i, ∑ s, w i s * f i s
Proof (Lean source)
lemma finite_product_weighted_sum {ι S : Type*} [Fintype ι] [DecidableEq ι] [Fintype S] (w f : ι → S → ℝ) : (∑ sigma : ι → S, (∏ i, w i (sigma i)) * ∏ i, f i (sigma i)) = ∏ i, ∑ s, w i s * f i s := by simp_rw [← Finset.prod_mul_distrib] exact (Fintype.prod_sum (fun i s => w i s * f i s)).symm
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_product_weighted_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:145
theorem finite_product_coordinate_sum Lemma finite_product_coordinate_sum in the paper ↗

A normalized finite product prior has the prescribed scalar marginal at a coordinate. Given the specified input S, the specified input w, the specified input hw, the specified input z, the specified input f, the finite product coordinate sum conclusion holds.

Formal statement
ι S :
w :
ι → S → ℝ
hw :
∀ i, ∑ s, w i s = 1
z :
ι
f :
S → ℝ
(∑ sigma : ι → S, (∏ i, w i (sigma i)) * f (sigma z)) = ∑ s, w z s * f s
Proof (Lean source)
lemma finite_product_coordinate_sum {ι S : Type*} [Fintype ι] [DecidableEq ι] [Fintype S] (w : ι → S → ℝ) (hw : ∀ i, ∑ s, w i s = 1) (z : ι) (f : S → ℝ) : (∑ sigma : ι → S, (∏ i, w i (sigma i)) * f (sigma z)) = ∑ s, w z s * f s := by classical have h := finite_product_weighted_sum w (fun i s => if i = z then f s else 1) simpa [hw] using h
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_product_coordinate_sum · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:152

Each propensity or outcome sign has mean zero under the prescribed sign-pair prior. Given the specified input d, the specified input h, the specified input delta, the specified input theta, the specified input control, the specified input z, the marked sign mean zero conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
theta control :
z :
{z // z ∈ frameIdx d h delta}
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * thetaSign (if control then (sigma z).2 else (sigma z).1))
= 0
Proof (Lean source)
lemma marked_sign_mean_zero (d : ℕ) (h delta : ℝ) (theta control : Bool) (z : {z // z ∈ frameIdx d h delta}) : (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * thetaSign (if control then (sigma z).2 else (sigma z).1)) = 0 := by have hw (i : {z // z ∈ frameIdx d h delta}) : (∑ s : Bool × Bool, (1 + thetaSign theta * thetaSign s.1 * thetaSign s.2 / 2) / 4) = 1 := by cases theta <;> norm_num [Fintype.sum_prod_type, thetaSign] unfold markedWeight rw [finite_product_coordinate_sum _ hw z (fun s : Bool × Bool => thetaSign (if control then s.2 else s.1))] cases theta <;> cases control <;> norm_num [Fintype.sum_prod_type, thetaSign]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_sign_mean_zero · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:159
theorem marked_sign_cross_moment Lemma marked_sign_cross_moment in the paper ↗

Sign-pair correlation is one half the hypothesis sign at matching indices and zero otherwise. Given the specified input d, the specified input h, the specified input delta, the specified input theta, the specified input z, the specified input w, the marked sign cross moment conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
theta :
z w :
{z // z ∈ frameIdx d h delta}
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (thetaSign (sigma z).1 * thetaSign (sigma w).2))
= if z = w then thetaSign theta / 2 else 0
Proof (Lean source)
lemma marked_sign_cross_moment (d : ℕ) (h delta : ℝ) (theta : Bool) (z w : {z // z ∈ frameIdx d h delta}) : (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (thetaSign (sigma z).1 * thetaSign (sigma w).2)) = if z = w then thetaSign theta / 2 else 0 := by classical let p := fun s : Bool × Bool => (1 + thetaSign theta * thetaSign s.1 * thetaSign s.2 / 2) / 4 have hfactor := finite_product_weighted_sum (fun _ : {z // z ∈ frameIdx d h delta} => p) (fun i s => (if i = z then thetaSign s.1 else 1) * (if i = w then thetaSign s.2 else 1)) simp only [Finset.prod_mul_distrib] at hfactor simp only [Finset.prod_ite_eq', Finset.mem_univ, if_true] at hfactor change (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (thetaSign (sigma z).1 * thetaSign (sigma w).2)) = _ at hfactor rw [hfactor] have hs (i : {z // z ∈ frameIdx d h delta}) : (∑ s : Bool × Bool, p s * ((if i = z then thetaSign s.1 else 1) * (if i = w then thetaSign s.2 else 1))) = if i = z then (if z = w then thetaSign theta / 2 else 0) else if i = w then 0 else 1 := by by_cases hz : i = z · subst i by_cases hw : z = w <;> cases theta <;> norm_num [p, hw, Fintype.sum_prod_type, thetaSign] · by_cases hw : i = w · subst i cases theta <;> norm_num [p, hz, Fintype.sum_prod_type, thetaSign] · cases theta <;> norm_num [p, hz, hw, Fintype.sum_prod_type, thetaSign] simp_rw [hs] by_cases hzw : z = w · subst w simp only [ite_true] have heq (i : {z // z ∈ frameIdx d h delta}) : (if i = z then thetaSign theta / 2 else if i = z then 0 else 1) = (if i = z then thetaSign theta / 2 else 1) := by split_ifs <;> rfl simp_rw [heq] simp only [Finset.prod_ite_eq', Finset.mem_univ, if_true] · rw [if_neg hzw] exact Finset.prod_eq_zero (Finset.mem_univ z) (by simp only [ite_true, if_neg hzw])
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_sign_cross_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:170

Both signed frame fields have zero prior mean. Given the specified input d, the specified input h, the specified input delta, the specified input theta, the specified input control, the specified input x, the marked field mean zero conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
theta control :
x :
Cov d
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * signField h delta sigma control x)
= 0
Proof (Lean source)
lemma marked_field_mean_zero (d : ℕ) (h delta : ℝ) (theta control : Bool) (x : Cov d) : (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * signField h delta sigma control x) = 0 := by unfold signField simp_rw [Finset.mul_sum, ← mul_assoc] rw [Finset.sum_comm] simp_rw [← Finset.sum_mul, marked_sign_mean_zero] simp only [zero_mul, Finset.sum_const_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_field_mean_zero · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:211
theorem marked_field_cross_moment Lemma marked_field_cross_moment in the paper ↗

The frame partition identifies the prior cross moment of the two signed fields. Given the specified input d, the specified input h, the specified input delta, the specified input hd, the specified input hdh, the specified input hh, the specified input theta, the specified input x, the marked field cross moment conclusion holds.

Formal statement
d :
ℕ
h delta :
ℝ
hd :
0 < delta
hdh :
delta ≤ h
hh :
h ≤ 1/2
theta :
x :
Cov d
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (signField h delta sigma false x * signField h delta sigma true x))
= thetaSign theta / 2 * (macroBump h x)^2
Proof (Lean source)
lemma marked_field_cross_moment (d : ℕ) (h delta : ℝ) (hd : 0 < delta) (hdh : delta ≤ h) (hh : h ≤ 1/2) (theta : Bool) (x : Cov d) : (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (signField h delta sigma false x * signField h delta sigma true x)) = thetaSign theta / 2 * (macroBump h x)^2 := by classical simp only [signField, Bool.false_eq_true, if_false, if_true, Finset.sum_mul, Finset.mul_sum] have rearrange (sigma : SignArray d h delta) (z w : {z // z ∈ frameIdx d h delta}) : markedWeight h delta theta sigma * (thetaSign (sigma z).1 * frame h delta z.1 x * (thetaSign (sigma w).2 * frame h delta w.1 x)) = (markedWeight h delta theta sigma * (thetaSign (sigma z).1 * thetaSign (sigma w).2)) * (frame h delta z.1 x * frame h delta w.1 x) := by ring simp_rw [rearrange] rw [Finset.sum_comm] simp_rw [Finset.sum_comm (f := fun sigma z => (markedWeight h delta theta sigma * (thetaSign (sigma z).1 * thetaSign (sigma _).2)) * (frame h delta z.1 x * frame h delta _ x))] simp_rw [← Finset.sum_mul, marked_sign_cross_moment] simp only [ite_mul, zero_mul, Finset.sum_ite_eq', Finset.mem_univ, if_true, ← pow_two] rw [← Finset.mul_sum, frame_square_partition h delta (lt_of_lt_of_le hd hdh) hh hd hdh]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_field_cross_moment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:220
theorem marked_raw_singleton_cancellation Lemma marked_raw_singleton_cancellation in the paper ↗

Compensation cancels the cross moment in the raw singleton likelihood, including its cubic term. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hd, the specified input hdh, the specified input hh, the specified input theta, the specified input u, the specified input v, the specified input x, the marked raw singleton cancellation conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
hd :
0 < delta
hdh :
delta ≤ h
hh :
h ≤ 1/2
theta :
u v :
ℝ
x :
Cov d
(∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * ((1 + 2*u*a*signField h delta sigma false x) * (1 + 2*v*b*signField h delta sigma true x + u*v*markedContrast h a b theta x)))
= 1
Proof (Lean source)
lemma marked_raw_singleton_cancellation (d : ℕ) (h delta a b : ℝ) (hd : 0 < delta) (hdh : delta ≤ h) (hh : h ≤ 1/2) (theta : Bool) (u v : ℝ) (x : Cov d) : (∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * ((1 + 2*u*a*signField h delta sigma false x) * (1 + 2*v*b*signField h delta sigma true x + u*v*markedContrast h a b theta x))) = 1 := by have hp (sigma : SignArray d h delta) : markedWeight h delta theta sigma * ((1 + 2*u*a*signField h delta sigma false x) * (1 + 2*v*b*signField h delta sigma true x + u*v*markedContrast h a b theta x)) = markedWeight h delta theta sigma * (1 + u*v*markedContrast h a b theta x) + (2*u*a + 2*u^2*v*a*markedContrast h a b theta x) * (markedWeight h delta theta sigma * signField h delta sigma false x) + (2*v*b) * (markedWeight h delta theta sigma * signField h delta sigma true x) + (4*u*v*a*b) * (markedWeight h delta theta sigma * (signField h delta sigma false x * signField h delta sigma true x)) := by ring simp_rw [hp, Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum] rw [(marked_prior_mass d h delta theta).2, marked_field_mean_zero, marked_field_mean_zero, marked_field_cross_moment d h delta hd hdh hh] unfold markedContrast ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_raw_singleton_cancellation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:242

The zero-order partial in the Hölder norm bounds the function on the design cube. Given the specified input d, the specified input f, the specified input s, the specified input K, the specified input hK, the specified input hf, the specified input x, the specified input hx, the holder norm sup bound conclusion holds.

Formal statement
d :
ℕ
f :
Cov d → ℝ
s K :
ℝ
hK :
0 ≤ K
hf :
holderNorm f s ≤ ofReal K
x :
Cov d
hx :
x ∈ cube d
|f x| ≤ K
Proof (Lean source)
lemma holderNorm_sup_bound {d : ℕ} (f : Cov d → ℝ) (s K : ℝ) (hK : 0 ≤ K) (hf : holderNorm f s ≤ ofReal K) (x : Cov d) (hx : x ∈ cube d) : |f x| ≤ K := by have hb := ((holderNorm_le_iff f s K hK).mp hf).2.1 (fun _ => 0) (by simp [multiOrder]) x hx have hz : multiOrder (fun _ : Fin d => 0) = 0 := by simp [multiOrder] have hc : coordinatePartial f (fun _ => 0) x = f x := by unfold coordinatePartial generalize coordinateDirections (fun _ : Fin d => 0) = v revert v rw [hz] intro v exact iteratedFDerivWithin_zero_apply v rwa [hc] at hb
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holderNorm_sup_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:263
theorem holder_scaled_amplitude_bound Lemma holder_scaled_amplitude_bound in the paper ↗

A scale-controlled amplitude cancels the inverse scale in a Hölder supremum bound. Given the specified input r, the specified input s, the specified input c, the specified input K, the specified input a, the specified input f, the specified input hr, the specified input hc, the specified input hK, the specified input ha0, the specified input ha, the specified input hf, the holder scaled amplitude bound conclusion holds.

Formal statement
r s c K a f :
ℝ
hr :
0 < r
hc :
0 ≤ c
hK :
0 ≤ K
ha0 :
0 ≤ a
ha :
a ≤ c*r^s
hf :
|f| ≤ K*r^(-s)
|a*f| ≤ c*K
Proof (Lean source)
lemma holder_scaled_amplitude_bound (r s c K a f : ℝ) (hr : 0 < r) (hc : 0 ≤ c) (hK : 0 ≤ K) (ha0 : 0 ≤ a) (ha : a ≤ c*r^s) (hf : |f| ≤ K*r^(-s)) : |a*f| ≤ c*K := by rw [abs_mul, abs_of_nonneg ha0] calc a * |f| ≤ (c*r^s)*(K*r^(-s)) := mul_le_mul ha hf (abs_nonneg _) (by positivity) _ = c*K := by have hrpow : r^s*r^(-s) = 1 := by rw [← Real.rpow_add hr]; simp calc _ = c*K*(r^s*r^(-s)) := by ring _ = c*K := by rw [hrpow, mul_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.holder_scaled_amplitude_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:277
theorem signField_zero_outside_cube Lemma signField_zero_outside_cube in the paper ↗

The frame field vanishes outside the design cube for an admissible localization window. Given the specified input h, the specified input delta, the specified input hh0, the specified input hh, the specified input sigma, the specified input control, the specified input x, the specified input hx, the sign field zero outside cube conclusion holds.

Formal statement
d :
ℕ
shared
h delta :
ℝ
hh0 :
0 < h
hh :
h ≤ 1/2
sigma :
SignArray d h delta
control :
x :
Cov d
hx :
x ∉ cube d
signField h delta sigma control x = 0
Proof (Lean source)
lemma signField_zero_outside_cube (h delta : ℝ) (hh0 : 0 < h) (hh : h ≤ 1/2) (sigma : SignArray d h delta) (control : Bool) (x : Cov d) (hx : x ∉ cube d) : signField h delta sigma control x = 0 := by have hl : x ∉ locCube d h := by intro hl apply hx intro i have hi := hl i constructor <;> linarith [hi.1, hi.2] simp only [signField, frame, macroBump_zero_outside h hh0 x hl, zero_mul, mul_zero, Finset.sum_const_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signField_zero_outside_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:288
theorem macroBump_zero_outside_cube Lemma macroBump_zero_outside_cube in the paper ↗

The macro bump vanishes outside the design cube for an admissible localization window. Given the specified input h, the specified input hh0, the specified input hh, the specified input x, the specified input hx, the macro bump zero outside cube conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
hh0 :
0 < h
hh :
h ≤ 1/2
x :
Cov d
hx :
x ∉ cube d
macroBump h x = 0
Proof (Lean source)
lemma macroBump_zero_outside_cube (h : ℝ) (hh0 : 0 < h) (hh : h ≤ 1/2) (x : Cov d) (hx : x ∉ cube d) : macroBump h x = 0 := by apply macroBump_zero_outside h hh0 intro hl apply hx intro i have hi := hl i constructor <;> linarith [hi.1, hi.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.macroBump_zero_outside_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:299
theorem marked_raw_probability_bounds Lemma marked_raw_probability_bounds in the paper ↗

A public positive amplitude constant keeps the raw propensity and arm means in the unit interval. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked raw probability bounds conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
c ≤ 1
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
theta (sigma : SignArray d h delta) (x : Cov d) :
markedPropensity h delta a sigma x ∈ Icc (0:ℝ) 1
arm :
markedMean h delta a b theta arm sigma x ∈ Icc (0:ℝ) 1
Proof (Lean source)
lemma marked_raw_probability_bounds (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ c ≤ 1 ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ theta (sigma : SignArray d h delta) (x : Cov d), markedPropensity h delta a sigma x ∈ Icc (0:ℝ) 1 ∧ ∀ arm, markedMean h delta a b theta arm sigma x ∈ Icc (0:ℝ) 1 := by let B : ℝ := (2:ℝ)^d let c : ℝ := 1/(64*B) have hB : 1 ≤ B := one_le_pow₀ (by norm_num) have hBp : 0 < B := by positivity have hc : 0 < c := by dsimp [c]; positivity have hcB : c*B = 1/64 := by dsimp [c]; field_simp have hcsmall : c ≤ 1/64 := by nlinarith refine ⟨c, hc, by linarith, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab theta sigma x have hd1 : delta ≤ 1 := by linarith have haC : a ≤ c := hac.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hdom.2.1.le) hc.le) have hbC : b ≤ c := hbc.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hdom.2.2.2.1.le) hc.le) have he : a*(2:ℝ)^d ≤ 1/4 := by change a*B ≤ _; nlinarith have hm : b*(2:ℝ)^d+a*b ≤ 3/8 := by have habsmall := mul_le_mul haC hbC hb.le hc.le change b*B+a*b ≤ _ nlinarith have hp := markedPropensity_overlap h delta a sigma ha.le he x refine ⟨⟨by linarith [hp.1], by linarith [hp.2]⟩, ?_⟩ intro arm have hmean := markedMean_interior h delta a b theta arm sigma ha.le hb.le hm x exact ⟨by linarith [hmean.1], by linarith [hmean.2]⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_raw_probability_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:307
theorem bern_singleton_toReal_spin Lemma bern_singleton_toReal_spin in the paper ↗

A valid Bernoulli atom equals its affine fair-spin likelihood divided by two. Given the specified input p, the specified input hp, the specified input s, the bern singleton to real spin conclusion holds.

Formal statement
p :
ℝ
hp :
p ∈ Icc (0:ℝ) 1
s :
(bern p {s}).toReal = (1 + thetaSign s*(2*p-1))/2
Proof (Lean source)
lemma bern_singleton_toReal_spin (p : ℝ) (hp : p ∈ Icc (0:ℝ) 1) (s : Bool) : (bern p {s}).toReal = (1 + thetaSign s*(2*p-1))/2 := by cases s <;> simp [bern, thetaSign, ENNReal.toReal_ofReal hp.1, ENNReal.toReal_ofReal (sub_nonneg.mpr hp.2)] <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_singleton_toReal_spin · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:340
theorem marked_labelLikelihood_spin Lemma marked_labelLikelihood_spin in the paper ↗

For valid raw probabilities the marked label likelihood is the compensated two-spin product. Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input x, the specified input hp, the specified input hm, the specified input s, the marked label likelihood spin conclusion holds.

Formal statement
d :
ℕ
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
x :
Cov d
hp :
markedPropensity h delta a sigma x ∈ Icc (0:ℝ) 1
hm :
∀ arm, markedMean h delta a b theta arm sigma x ∈ Icc (0:ℝ) 1
s :
labelLikelihood (markedLaw h delta a b theta sigma) x s
= (1+2*thetaSign s.1*a*signField h delta sigma false x) * (1+2*thetaSign s.2*b*signField h delta sigma true x + thetaSign s.1*thetaSign s.2*markedContrast h a b theta x)
Proof (Lean source)
lemma marked_labelLikelihood_spin (d : ℕ) (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (x : Cov d) (hp : markedPropensity h delta a sigma x ∈ Icc (0:ℝ) 1) (hm : ∀ arm, markedMean h delta a b theta arm sigma x ∈ Icc (0:ℝ) 1) (s : Bool × Bool) : labelLikelihood (markedLaw h delta a b theta sigma) x s = (1+2*thetaSign s.1*a*signField h delta sigma false x) * (1+2*thetaSign s.2*b*signField h delta sigma true x + thetaSign s.1*thetaSign s.2*markedContrast h a b theta x) := by unfold labelLikelihood change 4*(bern (probabilityClip (markedPropensity h delta a sigma x)) {s.1}).toReal * (bern (if s.1 then probabilityClip (markedMean h delta a b theta true sigma x) else probabilityClip (markedMean h delta a b theta false sigma x)) {s.2}).toReal = _ rw [probabilityClip_eq_of_mem _ hp, probabilityClip_eq_of_mem _ (hm true), probabilityClip_eq_of_mem _ (hm false)] rw [bern_singleton_toReal_spin _ hp, bern_singleton_toReal_spin _ (by cases s.1 <;> simpa using hm _)] rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> simp [thetaSign, markedPropensity, markedMean] <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_labelLikelihood_spin · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:345
theorem conditionalObserved_singleton Lemma conditionalObserved_singleton in the paper ↗

The conditional observed atom factors into its treatment and selected outcome atoms. Given the specified input d, the specified input P, the specified input x, the specified input s, the conditional observed singleton conclusion holds.

Formal statement
d :
ℕ
P :
x :
Cov d
s :
= bern (P.e x) {s.1} * bern (if s.1 then P.mu1 x else P.mu0 x) {s.2}
Proof (Lean source)
lemma conditionalObserved_singleton {d : ℕ} (P : PrimitiveLaw d) (x : Cov d) (s : Bool × Bool) : conditionalObserved P x {s} = bern (P.e x) {s.1} * bern (if s.1 then P.mu1 x else P.mu0 x) {s.2} := by rw [conditionalObserved, Measure.bind_apply (measurableSet_singleton s) (measurable_of_countable _).aemeasurable] rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> simp [bern, lintegral_add_measure, lintegral_smul_measure, lintegral_dirac, ← singleton_prod_singleton, Measure.prod_prod]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObserved_singleton · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:363

Each Bernoulli atom has finite mass, including for total raw inputs. Given the specified input p, the specified input s, the bern singleton ne top conclusion holds.

Formal statement
p :
ℝ
s :
bern p {s} ≠ ⊤
Proof (Lean source)
lemma bern_singleton_ne_top (p : ℝ) (s : Bool) : bern p {s} ≠ ⊤ := by cases s <;> simp [bern]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_singleton_ne_top · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:373
theorem singletonMixture_density Lemma singletonMixture_density in the paper ↗

The fair-spin density of a singleton mixture is its prior-weighted label likelihood. Given the specified input d, the specified input H, the specified input theta, the specified input hw, the specified input x, the specified input s, the singleton mixture density conclusion holds.

Formal statement
d :
ℕ
H :
theta :
hw :
∀ sigma, 0 ≤ H.weight theta sigma
x :
Cov d
s :
4 * (singletonMixture H theta x {s}).toReal
= ∑ sigma, H.weight theta sigma * labelLikelihood (H.law theta sigma) x s
Proof (Lean source)
lemma singletonMixture_density {d : ℕ} (H : MarkedPriors d) (theta : Bool) (hw : ∀ sigma, 0 ≤ H.weight theta sigma) (x : Cov d) (s : Bool × Bool) : 4 * (singletonMixture H theta x {s}).toReal = ∑ sigma, H.weight theta sigma * labelLikelihood (H.law theta sigma) x s := by unfold singletonMixture simp only [Measure.coe_finsetSum, Finset.sum_apply, Measure.smul_apply, smul_eq_mul] have hfinite (sigma : PriorSign H) : ofReal (H.weight theta sigma) * conditionalObserved (H.law theta sigma) x {s} ≠ ⊤ := by apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top rw [conditionalObserved_singleton] exact ENNReal.mul_ne_top (bern_singleton_ne_top _ _) (bern_singleton_ne_top _ _) rw [ENNReal.toReal_sum (fun sigma _ => hfinite sigma), Finset.mul_sum] apply Finset.sum_congr rfl intro sigma _ rw [ENNReal.toReal_mul, ENNReal.toReal_ofReal (hw sigma), conditionalObserved_singleton, ENNReal.toReal_mul] unfold labelLikelihood ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.singletonMixture_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:377

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the singleton cancellation conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
c ≤ 1
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
theta x :
singletonMixture (markedHandle d h delta a b) theta x = fairObserved
Proof (Lean source)
lemma singleton_cancellation (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ -- @realizes c(positive claim-local constant) c ≤ 1 ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ theta x, singletonMixture (markedHandle d h delta a b) theta x = fairObserved := by obtain ⟨c, hc, hc1, hraw⟩ := marked_raw_probability_bounds d alpha beta gamma L eps hdom refine ⟨c, hc, hc1, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab theta x apply Measure.ext_iff_singleton.mpr intro s have hw := (marked_prior_mass d h delta theta).1 have hdensity := singletonMixture_density (markedHandle d h delta a b) theta hw x s have hl (sigma : SignArray d h delta) := marked_labelLikelihood_spin d h delta a b theta sigma x (hraw h delta a b hd hdh hh ha hac hb hbc hab theta sigma x).1 (hraw h delta a b hd hdh hh ha hac hb hbc hab theta sigma x).2 s change 4*(singletonMixture (markedHandle d h delta a b) theta x {s}).toReal = ∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * labelLikelihood (markedLaw h delta a b theta sigma) x s at hdensity simp_rw [hl] at hdensity rw [marked_raw_singleton_cancellation d h delta a b hd hdh hh] at hdensity have hfin : singletonMixture (markedHandle d h delta a b) theta x {s} ≠ ⊤ := by unfold singletonMixture simp only [Measure.coe_finsetSum, Finset.sum_apply, Measure.smul_apply, smul_eq_mul] apply ENNReal.sum_ne_top.mpr intro sigma _ apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top rw [conditionalObserved_singleton] exact ENNReal.mul_ne_top (bern_singleton_ne_top _ _) (bern_singleton_ne_top _ _) have hfair : fairObserved {s} = ofReal (1/4 : ℝ) := by rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> norm_num [fairObserved, ← singleton_prod_singleton, Measure.prod_prod, bern, ← ENNReal.ofReal_mul] rw [hfair] apply (ENNReal.toReal_eq_toReal_iff' hfin ENNReal.ofReal_ne_top).mp rw [ENNReal.toReal_ofReal (by norm_num : 0 ≤ (1/4:ℝ))] linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.singleton_cancellation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/Likelihood.lean:397
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.MarkedHandle 41 declarations Two-channel point-CATE annotation frontier: Lower/MarkedHandle constructions and obligations.

Lower/MarkedHandle

Two-channel point-CATE annotation frontier: Lower/MarkedHandle constructions and obligations.

def probabilityClip

Total Bernoulli probability parametrization; equal to its argument on [0,1]. Given the specified input x, probability clip is the corresponding construction.

Definition (Lean source)
x :
ℝ
probabilityClip x :
ℝ
max 0 (min 1 x)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.probabilityClip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:25
def independentFullLaw

Given the specified input e, the specified input mu0, the specified input mu1, independent full law is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
e mu0 mu1 :
Cov d → ℝ
independentFullLaw e mu0 mu1 :
(uniformLaw d).bind (fun x => (Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x))))))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentFullLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:27
theorem measurable_probabilityClip Lemma measurable_probabilityClip in the paper ↗

Given the specified input f, the specified input hf, the measurable probability clip conclusion holds.

Formal statement
d :
ℕ
shared
f :
Cov d → ℝ
hf :
Measurable (fun x => probabilityClip (f x))
Proof (Lean source)
@[fun_prop] lemma measurable_probabilityClip (f : Cov d → ℝ) (hf : Measurable f) : Measurable (fun x => probabilityClip (f x)) := by unfold probabilityClip fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_probabilityClip · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:32

Given the specified input x, the probability clip mem conclusion holds.

Formal statement
x :
ℝ
probabilityClip x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma probabilityClip_mem (x : ℝ) : probabilityClip x ∈ Icc (0 : ℝ) 1 := by unfold probabilityClip exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.probabilityClip_mem · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:37
theorem probabilityClip_eq_of_mem

Probability clipping fixes every valid Bernoulli parameter. Given the specified input x, the specified input hx, the probability clip eq of mem conclusion holds.

Formal statement
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma probabilityClip_eq_of_mem (x : ℝ) (hx : x ∈ Icc (0 : ℝ) 1) : probabilityClip x = x := by rw [probabilityClip, min_eq_right hx.2, max_eq_right hx.1]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.probabilityClip_eq_of_mem · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:42

Given the specified input d, the measurable cube conclusion holds.

Formal statement
d :
ℕ
MeasurableSet (cube d)
Proof (Lean source)
lemma measurable_cube (d : ℕ) : MeasurableSet (cube d) := by have heq : cube d = ⋂ i : Fin d, (fun x : Cov d => x i) ⁻¹' Icc (0 : ℝ) 1 := by ext x simp only [cube, Set.mem_setOf_eq, Set.mem_iInter, Set.mem_preimage] rw [heq] exact MeasurableSet.iInter fun i => (measurableSet_Icc : MeasurableSet (Icc (0 : ℝ) 1)).preimage (by fun_prop)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_cube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:47

Given the specified input d, the uniform law probability conclusion holds.

Formal statement
d :
ℕ
Proof (Lean source)
lemma uniformLaw_probability (d : ℕ) : IsProbabilityMeasure (uniformLaw d) := by constructor rw [uniformLaw, Measure.restrict_apply_univ] have hv := (PiLp.volume_preserving_ofLp (Fin d)).measure_preimage ((MeasurableSet.univ_pi (fun _ : Fin d => (measurableSet_Icc : MeasurableSet (Icc (0 : ℝ) 1)))).nullMeasurableSet) change volume (cube d) = 1 rw [show cube d = ofLp ⁻¹' pi univ (fun _ : Fin d => Icc (0 : ℝ) 1) by ext x; simp only [cube, Set.mem_setOf_eq, Set.mem_preimage, Set.mem_pi, Set.mem_univ, forall_const]] rw [hv] rw [volume_pi_pi] simp only [Real.volume_Icc, sub_zero, ENNReal.ofReal_one, Finset.prod_const_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniformLaw_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:56

Given the specified input p, the specified input hp, the bern probability conclusion holds.

Formal statement
p :
ℝ
hp :
p ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma bern_probability (p : ℝ) (hp : p ∈ Icc (0 : ℝ) 1) : IsProbabilityMeasure (bern p) := by constructor simp only [bern, Measure.add_apply, Measure.smul_apply, Measure.dirac_apply_of_mem (Set.mem_univ _), smul_eq_mul, mul_one] rw [← ENNReal.ofReal_add (sub_nonneg.mpr hp.2) hp.1] norm_num
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:71
theorem measurable_independentRecordKernel Lemma measurable_independentRecordKernel in the paper ↗

Given the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, the measurable independent record kernel conclusion holds.

Formal statement
d :
ℕ
shared
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
Measurable (fun x => (Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x))))))
Proof (Lean source)
@[fun_prop] lemma measurable_independentRecordKernel (e mu0 mu1 : Cov d → ℝ) (he : Measurable e) (h0 : Measurable mu0) (h1 : Measurable mu1) : Measurable (fun x => (Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x)))))) := by simp only [bern, Measure.prod_add, Measure.add_prod, Measure.prod_smul_right, Measure.prod_smul_left, Measure.dirac_prod_dirac] apply Measure.measurable_of_measurable_coe intro s hs simp only [Measure.add_apply, Measure.smul_apply, smul_eq_mul] have hd (a y0 y1 : Bool) : Measurable (fun x : Cov d => Measure.dirac (x, a, y0, y1) s) := (Measure.measurable_coe hs).comp (Measure.measurable_dirac.comp (by fun_prop)) unfold probabilityClip fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_independentRecordKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:80
theorem independentFullLaw_probability Lemma independentFullLaw_probability in the paper ↗

Given the specified input d, the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, the independent full law probability conclusion holds.

Formal statement
d :
ℕ
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
Proof (Lean source)
lemma independentFullLaw_probability (d : ℕ) (e mu0 mu1 : Cov d → ℝ) (he : Measurable e) (h0 : Measurable mu0) (h1 : Measurable mu1) : IsProbabilityMeasure (independentFullLaw e mu0 mu1) := by letI := uniformLaw_probability d unfold independentFullLaw constructor rw [Measure.bind_apply MeasurableSet.univ (measurable_independentRecordKernel e mu0 mu1 he h0 h1).aemeasurable] have hm (x : Cov d) : (Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x))))) univ = 1 := by letI := bern_probability _ (probabilityClip_mem (e x)) letI := bern_probability _ (probabilityClip_mem (mu0 x)) letI := bern_probability _ (probabilityClip_mem (mu1 x)) exact measure_univ simp_rw [hm] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentFullLaw_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:98
theorem independentFullLaw_support Lemma independentFullLaw_support in the paper ↗

Given the specified input d, the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, the independent full law support conclusion holds.

Formal statement
d :
ℕ
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
independentFullLaw e mu0 mu1 {w | w.1 ∈ cube d} = 1
Proof (Lean source)
lemma independentFullLaw_support (d : ℕ) (e mu0 mu1 : Cov d → ℝ) (he : Measurable e) (h0 : Measurable mu0) (h1 : Measurable mu1) : independentFullLaw e mu0 mu1 {w | w.1 ∈ cube d} = 1 := by letI := uniformLaw_probability d unfold independentFullLaw have hs : {w : FullRecord d | w.1 ∈ cube d} = (cube d) ×ˢ (Set.univ : Set (Bool × Bool × Bool)) := by ext w; simp rw [hs, Measure.bind_apply ((measurable_cube d).prod MeasurableSet.univ) (measurable_independentRecordKernel e mu0 mu1 he h0 h1).aemeasurable] have hm (x : Cov d) : ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x))))) Set.univ = 1 := by letI := bern_probability _ (probabilityClip_mem (e x)) letI := bern_probability _ (probabilityClip_mem (mu0 x)) letI := bern_probability _ (probabilityClip_mem (mu1 x)) exact measure_univ simp_rw [Measure.prod_prod, hm, mul_one, Measure.dirac_apply' _ (measurable_cube d)] change (∫⁻ x, (cube d).indicator (fun _ => (1 : ℝ≥0∞)) x ∂uniformLaw d) = 1 rw [lintegral_indicator_const (measurable_cube d)] have hmass : uniformLaw d (cube d) = 1 := by simpa only [uniformLaw, Measure.restrict_apply_univ, Measure.restrict_apply_self] using (measure_univ (μ := uniformLaw d)) simp [hmass]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentFullLaw_support · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:118

Given the measure μ, the kernel κ, the map f, kernel measurability, and map measurability, mapping a bind equals binding the mapped kernels.

Formal statement
μ :
κ :
α → Measure Ω
f :
Ω → Ξ
hκ :
hf :
(μ.bind κ).map f = μ.bind (fun x => (κ x).map f)
Proof (Lean source)
lemma independent_map_bind {α Ω Ξ : Type*} [MeasurableSpace α] [MeasurableSpace Ω] [MeasurableSpace Ξ] (μ : Measure α) (κ : α → Measure Ω) (f : Ω → Ξ) (hκ : Measurable κ) (hf : Measurable f) : (μ.bind κ).map f = μ.bind (fun x => (κ x).map f) := by rw [← Measure.bind_dirac_eq_map _ hf, Measure.bind_bind hκ.aemeasurable (show AEMeasurable (fun x => Measure.dirac (f x)) (μ.bind κ) from (Measure.measurable_dirac.comp hf).aemeasurable)] simp_rw [Measure.bind_dirac_eq_map _ hf]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_map_bind · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:146
theorem independentFullLaw_covariates Lemma independentFullLaw_covariates in the paper ↗

Given the specified input d, the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, the independent full law covariates conclusion holds.

Formal statement
d :
ℕ
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
Proof (Lean source)
lemma independentFullLaw_covariates (d : ℕ) (e mu0 mu1 : Cov d → ℝ) (he : Measurable e) (h0 : Measurable mu0) (h1 : Measurable mu1) : (independentFullLaw e mu0 mu1).map fst = uniformLaw d := by unfold independentFullLaw rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e mu0 mu1 he h0 h1) measurable_fst] have hm (x : Cov d) : ((Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x)))))).map fst = Measure.dirac x := by letI := bern_probability _ (probabilityClip_mem (e x)) letI := bern_probability _ (probabilityClip_mem (mu0 x)) letI := bern_probability _ (probabilityClip_mem (mu1 x)) simp simp_rw [hm] exact Measure.bind_dirac
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentFullLaw_covariates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:156

Given the specified input d, the specified input p, the specified input hp, the measurable bern record conclusion holds.

Formal statement
d :
ℕ
p :
Cov d → ℝ
hp :
Measurable (fun x => (Measure.dirac x).prod (bern (p x)))
Proof (Lean source)
@[fun_prop] lemma measurable_bernRecord (d : ℕ) (p : Cov d → ℝ) (hp : Measurable p) : Measurable (fun x => (Measure.dirac x).prod (bern (p x))) := by simp only [bern, Measure.prod_add, Measure.prod_smul_right, Measure.dirac_prod_dirac] apply Measure.measurable_of_measurable_coe intro s hs simp only [Measure.add_apply, Measure.smul_apply, smul_eq_mul] have hd (a : Bool) : Measurable (fun x : Cov d => Measure.dirac (x, a) s) := (Measure.measurable_coe hs).comp (Measure.measurable_dirac.comp (by fun_prop)) fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_bernRecord · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:173
theorem bernRecord_bind_eq_compProd Lemma bernRecord_bind_eq_compProd in the paper ↗

Given the specified input d, the specified input p, the specified input hp, the specified input hprob, the bern record bind eq comp prod conclusion holds.

Formal statement
d :
ℕ
p :
Cov d → ℝ
hp :
hprob :
∀ x, p x ∈ Icc (0 : ℝ) 1
(uniformLaw d).bind (fun x => (Measure.dirac x).prod (bern (p x)))
= (uniformLaw d) ⊗ₘ bernKernel p hp
Proof (Lean source)
lemma bernRecord_bind_eq_compProd (d : ℕ) (p : Cov d → ℝ) (hp : Measurable p) (hprob : ∀ x, p x ∈ Icc (0 : ℝ) 1) : (uniformLaw d).bind (fun x => (Measure.dirac x).prod (bern (p x))) = (uniformLaw d) ⊗ₘ bernKernel p hp := by letI := uniformLaw_probability d letI : IsMarkovKernel (bernKernel p hp) := ⟨fun x => bern_probability _ (hprob x)⟩ ext s hs rw [Measure.bind_apply hs (measurable_bernRecord d p hp).aemeasurable, Measure.compProd_apply hs] apply lintegral_congr intro x rw [Measure.dirac_prod, Measure.map_apply measurable_prodMk_left hs] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bernRecord_bind_eq_compProd · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:183
theorem independent_record_margins Lemma independent_record_margins in the paper ↗

Given the specified input x, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent record margins conclusion holds.

Formal statement
d :
ℕ
shared
x :
Cov d
e p q :
ℝ
he :
e ∈ Icc (0 : ℝ) 1
hp :
p ∈ Icc (0 : ℝ) 1
hq :
q ∈ Icc (0 : ℝ) 1
μ :
(Measure.dirac x).prod ((bern e).prod ((bern p).prod (bern q)))
μ.map (fun w => (w.1, w.2.1)) = (Measure.dirac x).prod (bern e)
μ.map (fun w => (w.1, w.2.2.1)) = (Measure.dirac x).prod (bern p)
μ.map (fun w => (w.1, w.2.2.2)) = (Measure.dirac x).prod (bern q)
Proof (Lean source)
lemma independent_record_margins (x : Cov d) (e p q : ℝ) (he : e ∈ Icc (0 : ℝ) 1) (hp : p ∈ Icc (0 : ℝ) 1) (hq : q ∈ Icc (0 : ℝ) 1) : let μ := (Measure.dirac x).prod ((bern e).prod ((bern p).prod (bern q))) μ.map (fun w => (w.1, w.2.1)) = (Measure.dirac x).prod (bern e) ∧ μ.map (fun w => (w.1, w.2.2.1)) = (Measure.dirac x).prod (bern p) ∧ μ.map (fun w => (w.1, w.2.2.2)) = (Measure.dirac x).prod (bern q) := by letI := bern_probability e he letI := bern_probability p hp letI := bern_probability q hq have hmap (g : Bool × Bool × Bool → Bool) : ((Measure.dirac x).prod ((bern e).prod ((bern p).prod (bern q)))).map (fun w => (w.1, g w.2)) = (Measure.dirac x).prod (((bern e).prod ((bern p).prod (bern q))).map g) := by simpa only [Measure.map_id, Prod.map_def, id_eq] using (Measure.map_prod_map (Measure.dirac x) ((bern e).prod ((bern p).prod (bern q))) measurable_id (measurable_of_countable g)).symm dsimp only constructor · rw [hmap] simp · constructor · rw [hmap (fun w => w.2.1)] have hc : (fun w : Bool × Bool × Bool => w.2.1) = fst ∘ snd := rfl rw [hc, ← Measure.map_map measurable_fst measurable_snd] simp only [Measure.map_snd_prod, Measure.map_fst_prod, measure_univ, one_smul] · rw [hmap (fun w => w.2.2)] have hc : (fun w : Bool × Bool × Bool => w.2.2) = snd ∘ snd := rfl rw [hc, ← Measure.map_map measurable_snd measurable_snd] simp only [Measure.map_snd_prod, Measure.map_fst_prod, measure_univ, one_smul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_record_margins · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:196
theorem independentFullLaw_margin Lemma independentFullLaw_margin in the paper ↗

Given the specified input d, the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, the independent full law margin conclusion holds.

Formal statement
d :
ℕ
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
conclusion 1
(independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.1))
= ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (e x)) (measurable_probabilityClip e he)
conclusion 2
(independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.2.1))
= ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (mu0 x)) (measurable_probabilityClip mu0 h0)
conclusion 3
(independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.2.2))
= ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (mu1 x)) (measurable_probabilityClip mu1 h1)
Proof (Lean source)
lemma independentFullLaw_margin (d : ℕ) (e mu0 mu1 : Cov d → ℝ) (he : Measurable e) (h0 : Measurable mu0) (h1 : Measurable mu1) : (independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.1)) = ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (e x)) (measurable_probabilityClip e he) ∧ (independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.2.1)) = ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (mu0 x)) (measurable_probabilityClip mu0 h0) ∧ (independentFullLaw e mu0 mu1).map (fun w => (w.1,w.2.2.2)) = ((independentFullLaw e mu0 mu1).map fst) ⊗ₘ bernKernel (fun x => probabilityClip (mu1 x)) (measurable_probabilityClip mu1 h1) := by rw [independentFullLaw_covariates d e mu0 mu1 he h0 h1] have hm (x : Cov d) := independent_record_margins x (probabilityClip (e x)) (probabilityClip (mu0 x)) (probabilityClip (mu1 x)) (probabilityClip_mem _) (probabilityClip_mem _) (probabilityClip_mem _) unfold independentFullLaw constructor · rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e mu0 mu1 he h0 h1) (by fun_prop)] simp_rw [show ∀ x, ((Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x)))))).map (fun w => (w.1, w.2.1)) = (Measure.dirac x).prod (bern (probabilityClip (e x))) from fun x => (hm x).1] exact bernRecord_bind_eq_compProd d _ (measurable_probabilityClip e he) (fun x => probabilityClip_mem _) · constructor · rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e mu0 mu1 he h0 h1) (by fun_prop)] simp_rw [show ∀ x, ((Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x)))))).map (fun w => (w.1, w.2.2.1)) = (Measure.dirac x).prod (bern (probabilityClip (mu0 x))) from fun x => (hm x).2.1] exact bernRecord_bind_eq_compProd d _ (measurable_probabilityClip mu0 h0) (fun x => probabilityClip_mem _) · rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e mu0 mu1 he h0 h1) (by fun_prop)] simp_rw [show ∀ x, ((Measure.dirac x).prod ((bern (probabilityClip (e x))).prod ((bern (probabilityClip (mu0 x))).prod (bern (probabilityClip (mu1 x)))))).map (fun w => (w.1, w.2.2.2)) = (Measure.dirac x).prod (bern (probabilityClip (mu1 x))) from fun x => (hm x).2.2] exact bernRecord_bind_eq_compProd d _ (measurable_probabilityClip mu1 h1) (fun x => probabilityClip_mem _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentFullLaw_margin · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:226
def independentPrimitive

Explicit independent potential-outcome extension, total even for inadmissible raw inputs. Given the specified input e, the specified input mu0, the specified input mu1, the specified input he, the specified input h0, the specified input h1, independent primitive is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
e mu0 mu1 :
Cov d → ℝ
he :
h0 :
h1 :
independentPrimitive e mu0 mu1 he h0 h1 :
clause 1
law := independentFullLaw e mu0 mu1
clause 2
probability := independentFullLaw_probability d e mu0 mu1 he h0 h1
clause 3
supported := independentFullLaw_support d e mu0 mu1 he h0 h1
clause 4
e := fun x => probabilityClip (e x)
clause 5
mu0 := fun x => probabilityClip (mu0 x)
clause 6
mu1 := fun x => probabilityClip (mu1 x)
clause 7
measurable_e := measurable_probabilityClip e he
clause 8
measurable_mu0 := measurable_probabilityClip mu0 h0
clause 9
measurable_mu1 := measurable_probabilityClip mu1 h1
clause 10
margin_e := (independentFullLaw_margin d e mu0 mu1 he h0 h1).1
clause 11
margin_mu0 := (independentFullLaw_margin d e mu0 mu1 he h0 h1).2.1
clause 12
margin_mu1 := (independentFullLaw_margin d e mu0 mu1 he h0 h1).2.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independentPrimitive · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:268

Concrete finite sign-pair prior data. No certificate fields are assumed.

Definition (Lean source)
d :
ℕ
idx :
Finset (Fin d → ℤ)
weight :
Bool → ({z // z ∈ idx} → Bool × Bool) → ℝ
law :
Bool → ({z // z ∈ idx} → Bool × Bool) → PrimitiveLaw d
contrast :
Bool → Cov d → ℝ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.MarkedPriors · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:283
def markedContrast

Given the specified input h, the specified input a, the specified input b, the specified input theta, the specified input x, marked contrast is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h a b :
ℝ
theta :
x :
Cov d
markedContrast h a b theta x :
ℝ
-2 * thetaSign theta * a*b*(macroBump h x)^2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedContrast · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:289
def markedPropensity

Given the specified input h, the specified input delta, the specified input a, the specified input sigma, the specified input x, marked propensity is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta a :
ℝ
sigma :
SignArray d h delta
x :
Cov d
markedPropensity h delta a sigma x :
ℝ
1/2 + a*signField h delta sigma false x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedPropensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:292

Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input arm, the specified input sigma, the specified input x, marked mean is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta a b :
ℝ
theta arm :
sigma :
SignArray d h delta
x :
Cov d
markedMean h delta a b theta arm sigma x :
ℝ
1/2 + b*signField h delta sigma true x + thetaSign arm * markedContrast h a b theta x / 2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:295

The marked arm functions differ by the prescribed contrast before probability clipping. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input x, the marked mean difference conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
x :
Cov d
markedMean h delta a b theta true sigma x - markedMean h delta a b theta false sigma x
= markedContrast h a b theta x
Proof (Lean source)
lemma markedMean_difference (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (x : Cov d) : markedMean h delta a b theta true sigma x - markedMean h delta a b theta false sigma x = markedContrast h a b theta x := by simp only [markedMean, thetaSign, Bool.true_eq_false, Bool.false_eq_true, if_true, if_false] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMean_difference · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:298

The contrast is bounded by twice the product of the nuisance amplitudes. Given the specified input h, the specified input a, the specified input b, the specified input theta, the specified input x, the specified input ha, the specified input hb, the abs marked contrast le conclusion holds.

Formal statement
d :
ℕ
shared
h a b :
ℝ
theta :
x :
Cov d
ha :
0 ≤ a
hb :
0 ≤ b
|markedContrast h a b theta x| ≤ 2*a*b
Proof (Lean source)
lemma abs_markedContrast_le (h a b : ℝ) (theta : Bool) (x : Cov d) (ha : 0 ≤ a) (hb : 0 ≤ b) : |markedContrast h a b theta x| ≤ 2*a*b := by have hs : |thetaSign theta| = 1 := by cases theta <;> norm_num [thetaSign] have hm := macroBump_mem h x have hsq : (macroBump h x)^2 ≤ 1 := by nlinarith [hm.1, hm.2] simp only [markedContrast, abs_mul, abs_neg, abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2), hs, mul_one, abs_of_nonneg ha, abs_of_nonneg hb, abs_of_nonneg (sq_nonneg (macroBump h x))] simpa only [mul_one] using mul_le_mul_of_nonneg_left hsq (show 0 ≤ 2*a*b by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.abs_markedContrast_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:306

The target value is exact, since the macro bump is one at the center. Given the specified input h, the specified input a, the specified input b, the specified input theta, the marked contrast at x0 conclusion holds.

Formal statement
d :
ℕ
shared
h a b :
ℝ
theta :
markedContrast (d:=d) h a b theta (x0 d) = -2*thetaSign theta*a*b
Proof (Lean source)
lemma markedContrast_at_x0 (h a b : ℝ) (theta : Bool) : markedContrast (d:=d) h a b theta (x0 d) = -2*thetaSign theta*a*b := by rw [markedContrast, macroBump_at_x0, one_pow, mul_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedContrast_at_x0 · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:317
theorem markedContrast_separation Lemma markedContrast_separation in the paper ↗

The two hypotheses have target separation four times the amplitude product. Given the specified input h, the specified input a, the specified input b, the specified input ha, the specified input hb, the marked contrast separation conclusion holds.

Formal statement
d :
ℕ
shared
h a b :
ℝ
ha :
0 ≤ a
hb :
0 ≤ b
|markedContrast (d:=d) h a b true (x0 d) - markedContrast h a b false (x0 d)| = 4*a*b
Proof (Lean source)
lemma markedContrast_separation (h a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : |markedContrast (d:=d) h a b true (x0 d) - markedContrast h a b false (x0 d)| = 4*a*b := by rw [markedContrast_at_x0, markedContrast_at_x0] simp only [thetaSign, if_true, Bool.false_eq_true, if_false] rw [show -2*1*a*b - -2*(-1)*a*b = -(4*a*b) by ring, abs_neg, abs_of_nonneg (by positivity)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedContrast_separation · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:322
theorem markedContrast_zero_outside Lemma markedContrast_zero_outside in the paper ↗

The contrast vanishes off the localization cube. Given the specified input h, the specified input a, the specified input b, the specified input theta, the specified input hh, the specified input x, the specified input hx, the marked contrast zero outside conclusion holds.

Formal statement
d :
ℕ
shared
h a b :
ℝ
theta :
hh :
0 < h
x :
Cov d
hx :
x ∉ locCube d h
markedContrast h a b theta x = 0
Proof (Lean source)
lemma markedContrast_zero_outside (h a b : ℝ) (theta : Bool) (hh : 0 < h) (x : Cov d) (hx : x ∉ locCube d h) : markedContrast h a b theta x = 0 := by simp only [markedContrast, macroBump_zero_outside h hh x hx, zero_pow (by decide : 2 ≠ 0), mul_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedContrast_zero_outside · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:331
theorem markedPropensity_overlap Lemma markedPropensity_overlap in the paper ↗

A uniformly small propensity amplitude guarantees overlap for every sign array. Given the specified input h, the specified input delta, the specified input a, the specified input sigma, the specified input ha, the specified input hsmall, the specified input x, the marked propensity overlap conclusion holds.

Formal statement
d :
ℕ
shared
h delta a :
ℝ
sigma :
SignArray d h delta
ha :
0 ≤ a
hsmall :
a*(2:ℝ)^d ≤ 1/4
x :
Cov d
markedPropensity h delta a sigma x ∈ Icc (1/4 : ℝ) (3/4)
Proof (Lean source)
lemma markedPropensity_overlap (h delta a : ℝ) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hsmall : a*(2:ℝ)^d ≤ 1/4) (x : Cov d) : markedPropensity h delta a sigma x ∈ Icc (1/4 : ℝ) (3/4) := by have hab : |a*signField h delta sigma false x| ≤ 1/4 := by rw [abs_mul, abs_of_nonneg ha] exact (mul_le_mul_of_nonneg_left (abs_signField_le h delta sigma false x) ha).trans hsmall have hlo := (abs_le.mp hab).1 have hhi := (abs_le.mp hab).2 constructor <;> dsimp [markedPropensity] <;> linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedPropensity_overlap · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:337

Uniform field and contrast bounds put both marked arms in the required interior band. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input arm, the specified input sigma, the specified input ha, the specified input hb, the specified input hsmall, the specified input x, the marked mean interior conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta arm :
sigma :
SignArray d h delta
ha :
0 ≤ a
hb :
0 ≤ b
hsmall :
b*(2:ℝ)^d + a*b ≤ 3/8
x :
Cov d
markedMean h delta a b theta arm sigma x ∈ Icc (1/8 : ℝ) (7/8)
Proof (Lean source)
lemma markedMean_interior (h delta a b : ℝ) (theta arm : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hb : 0 ≤ b) (hsmall : b*(2:ℝ)^d + a*b ≤ 3/8) (x : Cov d) : markedMean h delta a b theta arm sigma x ∈ Icc (1/8 : ℝ) (7/8) := by have hfield : |b*signField h delta sigma true x| ≤ b*(2:ℝ)^d := by rw [abs_mul, abs_of_nonneg hb] exact mul_le_mul_of_nonneg_left (abs_signField_le h delta sigma true x) hb have hcontrast : |thetaSign arm * markedContrast h a b theta x / 2| ≤ a*b := by have hs : |thetaSign arm| = 1 := by cases arm <;> norm_num [thetaSign] rw [abs_div, abs_mul, hs, one_mul, abs_of_nonneg (by norm_num : (0:ℝ) ≤ 2)] exact (div_le_iff₀ (by norm_num : (0:ℝ) < 2)).mpr (by nlinarith [abs_markedContrast_le h a b theta x ha hb]) have hlo1 := (abs_le.mp hfield).1 have hhi1 := (abs_le.mp hfield).2 have hlo2 := (abs_le.mp hcontrast).1 have hhi2 := (abs_le.mp hcontrast).2 constructor <;> dsimp [markedMean] <;> linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMean_interior · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:348
theorem measurable_markedPropensity Lemma measurable_markedPropensity in the paper ↗

Given the specified input h, the specified input delta, the specified input a, the specified input sigma, the measurable marked propensity conclusion holds.

Formal statement
d :
ℕ
shared
h delta a :
ℝ
sigma :
SignArray d h delta
Measurable (markedPropensity h delta a sigma)
Proof (Lean source)
@[fun_prop] lemma measurable_markedPropensity (h delta a : ℝ) (sigma : SignArray d h delta) : Measurable (markedPropensity h delta a sigma) := by unfold markedPropensity fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_markedPropensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:367

Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input arm, the specified input sigma, the measurable marked mean conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta arm :
sigma :
SignArray d h delta
Measurable (markedMean h delta a b theta arm sigma)
Proof (Lean source)
@[fun_prop] lemma measurable_markedMean (h delta a b : ℝ) (theta arm : Bool) (sigma : SignArray d h delta) : Measurable (markedMean h delta a b theta arm sigma) := by unfold markedMean markedContrast fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_markedMean · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:372
def markedLaw

Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, marked law is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
markedLaw h delta a b theta sigma :
independentPrimitive (markedPropensity h delta a sigma) (markedMean h delta a b theta false sigma) (markedMean h delta a b theta true sigma) (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:377
theorem markedLaw_propensity_eq Lemma markedLaw_propensity_eq in the paper ↗

Under the overlap amplitude condition the law's treatment margin is the prescribed field. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input ha, the specified input hsmall, the specified input x, the marked law propensity eq conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
ha :
0 ≤ a
hsmall :
a*(2:ℝ)^d ≤ 1/4
x :
Cov d
(markedLaw h delta a b theta sigma).e x = markedPropensity h delta a sigma x
Proof (Lean source)
lemma markedLaw_propensity_eq (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hsmall : a*(2:ℝ)^d ≤ 1/4) (x : Cov d) : (markedLaw h delta a b theta sigma).e x = markedPropensity h delta a sigma x := by change probabilityClip (markedPropensity h delta a sigma x) = _ apply probabilityClip_eq_of_mem have hx := markedPropensity_overlap h delta a sigma ha hsmall x exact ⟨by linarith [hx.1], by linarith [hx.2]⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedLaw_propensity_eq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:384

Under the interior amplitude condition both law margins are the prescribed arm functions. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input ha, the specified input hb, the specified input hsmall, the specified input x, the marked law means eq conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
ha :
0 ≤ a
hb :
0 ≤ b
hsmall :
b*(2:ℝ)^d + a*b ≤ 3/8
x :
Cov d
conclusion 1
(markedLaw h delta a b theta sigma).mu0 x = markedMean h delta a b theta false sigma x
conclusion 2
(markedLaw h delta a b theta sigma).mu1 x = markedMean h delta a b theta true sigma x
Proof (Lean source)
lemma markedLaw_means_eq (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hb : 0 ≤ b) (hsmall : b*(2:ℝ)^d + a*b ≤ 3/8) (x : Cov d) : (markedLaw h delta a b theta sigma).mu0 x = markedMean h delta a b theta false sigma x ∧ (markedLaw h delta a b theta sigma).mu1 x = markedMean h delta a b theta true sigma x := by have hvalid (arm : Bool) : probabilityClip (markedMean h delta a b theta arm sigma x) = markedMean h delta a b theta arm sigma x := by apply probabilityClip_eq_of_mem have hx := markedMean_interior h delta a b theta arm sigma ha hb hsmall x exact ⟨by linarith [hx.1], by linarith [hx.2]⟩ exact ⟨hvalid false, hvalid true⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedLaw_means_eq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:394
theorem markedLaw_rawContrast_eq Lemma markedLaw_rawContrast_eq in the paper ↗

The independent primitive's effect is the compensated contrast when clipping is inactive. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input ha, the specified input hb, the specified input hsmall, the marked law raw contrast eq conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
ha :
0 ≤ a
hb :
0 ≤ b
hsmall :
b*(2:ℝ)^d + a*b ≤ 3/8
rawContrast (markedLaw h delta a b theta sigma) = markedContrast h a b theta
Proof (Lean source)
lemma markedLaw_rawContrast_eq (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hb : 0 ≤ b) (hsmall : b*(2:ℝ)^d + a*b ≤ 3/8) : rawContrast (markedLaw h delta a b theta sigma) = markedContrast h a b theta := by funext x have hm := markedLaw_means_eq h delta a b theta sigma ha hb hsmall x rw [rawContrast, hm.1, hm.2] exact markedMean_difference h delta a b theta sigma x
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedLaw_rawContrast_eq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:407
theorem markedLaw_probability_bands Lemma markedLaw_probability_bands in the paper ↗

The constructed primitive satisfies the overlap condition at level eps and the two mean-range conditions at small amplitudes. Given the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input sigma, the specified input ha, the specified input hb, the specified input he, the specified input hm, the overlap level eps, its positivity, the overlap amplitude bound, the marked law probability bands conclusion holds.

Formal statement
d :
ℕ
shared
h delta a b :
ℝ
theta :
sigma :
SignArray d h delta
ha :
0 ≤ a
hb :
0 ≤ b
he :
a*(2:ℝ)^d ≤ 1/4
hm :
b*(2:ℝ)^d + a*b ≤ 3/8
eps :
ℝ
heps :
0 < eps
hov :
a*(2:ℝ)^d ≤ 1/2 - eps
conclusion 1
Overlap eps (markedLaw h delta a b theta sigma)
conclusion 2
ControlInterior (markedLaw h delta a b theta sigma)
conclusion 3
TreatedInterior (markedLaw h delta a b theta sigma)
Proof (Lean source)
lemma markedLaw_probability_bands (h delta a b : ℝ) (theta : Bool) (sigma : SignArray d h delta) (ha : 0 ≤ a) (hb : 0 ≤ b) (he : a*(2:ℝ)^d ≤ 1/4) (hm : b*(2:ℝ)^d + a*b ≤ 3/8) (eps : ℝ) (heps : 0 < eps) (hov : a*(2:ℝ)^d ≤ 1/2 - eps) : Overlap eps (markedLaw h delta a b theta sigma) ∧ ControlInterior (markedLaw h delta a b theta sigma) ∧ TreatedInterior (markedLaw h delta a b theta sigma) := by refine ⟨⟨heps, ?_⟩, ?_, ?_⟩ · intro x hx rw [markedLaw_propensity_eq h delta a b theta sigma ha he x] have hab : |a*signField h delta sigma false x| ≤ 1/2 - eps := by rw [abs_mul, abs_of_nonneg ha] exact (mul_le_mul_of_nonneg_left (abs_signField_le h delta sigma false x) ha).trans hov have hlo := (abs_le.mp hab).1 have hhi := (abs_le.mp hab).2 constructor <;> dsimp [markedPropensity] <;> linarith · intro x hx rw [(markedLaw_means_eq h delta a b theta sigma ha hb hm x).1] have hi := markedMean_interior h delta a b theta false sigma ha hb hm x exact ⟨by linarith [hi.1], by linarith [hi.2]⟩ · intro x hx rw [(markedLaw_means_eq h delta a b theta sigma ha hb hm x).2] have hi := markedMean_interior h delta a b theta true sigma ha hb hm x exact ⟨by linarith [hi.1], by linarith [hi.2]⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedLaw_probability_bands · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:417
def markedWeight

Given the specified input h, the specified input delta, the specified input theta, the specified input sigma, marked weight is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h delta :
ℝ
theta :
sigma :
SignArray d h delta
markedWeight h delta theta sigma :
ℝ
∏ z : {z // z ∈ frameIdx d h delta}, (1+thetaSign theta * thetaSign (sigma z).1 * thetaSign (sigma z).2 / 2)/4
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedWeight · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:443
def markedHandle

Given the specified input d, the specified input h, the specified input delta, the specified input a, the specified input b, marked handle is the corresponding construction.

Definition (Lean source)
d :
ℕ
h delta a b :
ℝ
markedHandle d h delta a b :
clause 1
idx := frameIdx d h delta
clause 2
weight := markedWeight h delta
clause 3
law := markedLaw h delta a b
clause 4
contrast := markedContrast h a b
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedHandle · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:448

Given the specified input H, prior sign is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
PriorSign H :
Type
{z // z ∈ H.idx} → Bool × Bool
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PriorSign · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:455

Given the specified input H, the specified input theta, sign prior is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
theta :
signPrior H theta :
∑ sigma, ofReal (H.weight theta sigma) • Measure.dirac sigma
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.signPrior · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:457

Given the specified input H, the specified input theta, the specified input n, the specified input m, marked mixture is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
H :
theta :
n m :
ℕ
markedMixture H theta n m :
∑ sigma, ofReal (H.weight theta sigma) • (Measure.pi (fun _ : Fin n => obsLaw (H.law theta sigma))).prod (Measure.pi (fun _ : Fin m => xaLaw (H.law theta sigma)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedHandle.lean:460
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.MarkedMembership 3 declarations Membership of the finite marked priors and identification of their canonical contrasts.

Membership of the finite marked priors and identification of their canonical contrasts.

theorem tau_eq_rawContrast_of_admissible Lemma tau_eq_rawContrast_of_admissible in the paper ↗

An admissible raw witness has the same contrast as the canonical continuous versions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hu, the specified input h0, the specified input ht, the specified input hi0, the specified input hi1, the tau eq raw contrast of admissible conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hu :
h0 :
ControlHolder beta L P
ht :
EffectHolder gamma L P
hi0 :
hi1 :
x ∈ cube d :
tau P hP x = rawContrast P x
Proof (Lean source)
lemma tau_eq_rawContrast_of_admissible {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hu : UniformDesign P) (h0 : ControlHolder beta L P) (ht : EffectHolder gamma L P) (hi0 : ControlInterior P) (hi1 : TreatedInterior P) : ∀ x ∈ cube d, tau P hP x = rawContrast P x := by let W := canonicalLaw P hP have hW := canonicalLaw_spec P hP have hWu : W.law.map fst = uniformLaw d := hW.2.1 letI : IsFiniteMeasure (uniformLaw d) := by rw [← hWu]; infer_instance letI := bernKernel_sfinite_of_margin W (fun w => w.2.2.1) (by fun_prop) W.mu0 W.measurable_mu0 W.margin_mu0 letI := bernKernel_sfinite_of_margin W (fun w => w.2.2.2) (by fun_prop) W.mu1 W.measurable_mu1 W.margin_mu1 letI := bernKernel_sfinite_of_margin P (fun w => w.2.2.1) (by fun_prop) P.mu0 P.measurable_mu0 P.margin_mu0 letI := bernKernel_sfinite_of_margin P (fun w => w.2.2.2) (by fun_prop) P.mu1 P.measurable_mu1 P.margin_mu1 have hW0 := holderNorm_continuousOn _ _ _ hW.2.2.2.2.2.1 have hP0 := holderNorm_continuousOn _ _ _ h0 have hW1 : ContinuousOn W.mu1 (cube d) := by have hc := (holderNorm_continuousOn _ _ _ hW.2.2.2.2.2.2.1).add hW0 change ContinuousOn (fun x => (W.mu1 x - W.mu0 x) + W.mu0 x) (cube d) at hc simpa only [sub_add_cancel] using hc have hP1 : ContinuousOn P.mu1 (cube d) := by have hc := (holderNorm_continuousOn _ _ _ ht).add hP0 change ContinuousOn (fun x => (P.mu1 x - P.mu0 x) + P.mu0 x) (cube d) at hc simpa only [sub_add_cancel] using hc have hzero : EqOn W.mu0 P.mu0 (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_mu0 P.measurable_mu0 hW0 hP0 · intro x hx; have hb := hW.2.2.2.2.2.2.2.1 x hx; constructor <;> linarith [hb.1, hb.2] · intro x hx; have hb := hi0 x hx; constructor <;> linarith [hb.1, hb.2] · rw [← hWu, ← W.margin_mu0, hW.1, P.margin_mu0, hu] have hone : EqOn W.mu1 P.mu1 (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_mu1 P.measurable_mu1 hW1 hP1 · intro x hx; have hb := hW.2.2.2.2.2.2.2.2 x hx; constructor <;> linarith [hb.1, hb.2] · intro x hx; have hb := hi1 x hx; constructor <;> linarith [hb.1, hb.2] · rw [← hWu, ← W.margin_mu1, hW.1, P.margin_mu1, hu] intro x hx simp only [tau, designatedTreated, designatedControl, if_pos hx, rawContrast] exact congrArg₂ (fun a b : ℝ => a - b) (hone hx) (hzero hx)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tau_eq_rawContrast_of_admissible · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedMembership.lean:13
theorem amplitude_inverse_scale_bound Lemma amplitude_inverse_scale_bound in the paper ↗

Amplitude restrictions cancel the inverse Hölder scale. Given the specified input x, the specified input s, the specified input a, the specified input c, the specified input hx, the specified input ha, the amplitude inverse scale bound conclusion holds.

Formal statement
x s a c :
ℝ
hx :
0 < x
ha :
a ≤ c * x ^ s
a * x ^ (-s) ≤ c
Proof (Lean source)
lemma amplitude_inverse_scale_bound (x s a c : ℝ) (hx : 0 < x) (ha : a ≤ c * x ^ s) : a * x ^ (-s) ≤ c := by calc _ ≤ (c * x ^ s) * x ^ (-s) := mul_le_mul_of_nonneg_right ha (Real.rpow_pos_of_pos hx _).le _ = c := by rw [mul_assoc, ← Real.rpow_add hx, add_neg_cancel, Real.rpow_zero, mul_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.amplitude_inverse_scale_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedMembership.lean:55

Every prescribed marked law belongs to the exact primitive class at uniformly small amplitudes. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked membership conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
c ≤ 1
conclusion 1
h delta a b :
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
theta (sigma : SignArray d h delta) :
∃ hP : PrimitiveClass alpha beta gamma L eps (markedLaw h delta a b theta sigma),
x ∈ cube d :
tau (markedLaw h delta a b theta sigma) hP x = markedContrast h a b theta x
markedContrast (d:=d) h a b theta (x0 d) = -2*thetaSign theta*a*b
Proof (Lean source)
lemma marked_membership (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ -- @realizes c(positive claim-local constant) c ≤ 1 ∧ ∀ h delta a b, 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ∀ theta (sigma : SignArray d h delta), ∃ hP : PrimitiveClass alpha beta gamma L eps (markedLaw h delta a b theta sigma), (∀ x ∈ cube d, tau (markedLaw h delta a b theta sigma) hP x = markedContrast h a b theta x) ∧ markedContrast (d:=d) h a b theta (x0 d) = -2*thetaSign theta*a*b := by rcases hdom with ⟨hdim, hα, hα1, hβ, hβ1, hγ1, hγ3, hL, heps, heps2⟩ have hγ : 0 < gamma := lt_of_lt_of_le (by norm_num) hγ1 obtain ⟨Ca, hCa, hFa⟩ := signField_holder d alpha hα hα1 obtain ⟨Cb, hCb, hFb⟩ := signField_holder d beta hβ hβ1 obtain ⟨Cg, hCg, hBg⟩ := macro_square_holder d gamma hγ hγ3 obtain ⟨Ct, hCt, hBt⟩ := macro_square_holder d beta hβ (hβ1.trans (by norm_num)) let K := (2:ℝ)^d + Ca + Cb + Cg + Ct + 1 have hK : 0 < K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] -- the amplitude room left by the radius `L` and the overlap level `eps` let ρ := min 1 (min (L - 1/2) (1/2 - eps)) have hρ : 0 < ρ := lt_min one_pos (lt_min (by linarith) (by linarith)) have hρ1 : ρ ≤ 1 := min_le_left _ _ have hρL : ρ ≤ L - 1/2 := (min_le_right _ _).trans (min_le_left _ _) have hρe : ρ ≤ 1/2 - eps := (min_le_right _ _).trans (min_le_right _ _) let c := ρ*(32*K)⁻¹ have hc : 0 < c := by dsimp [c]; positivity have hcK : c*K = ρ/32 := by dsimp [c]; field_simp have hKa : Ca ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hKb : Cb ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hKg : Cg ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hKt : Ct ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hKd : (2:ℝ)^d ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hK1 : 1 ≤ K := by dsimp [K]; nlinarith only [hCa, hCb, hCg, hCt, pow_pos (by norm_num : (0:ℝ) < 2) d] have hsmall (D : ℝ) (hD : D ≤ K) : c*D ≤ ρ/32 := by exact (mul_le_mul_of_nonneg_left hD hc.le).trans_eq hcK have hcsmall : c ≤ 1/32 := by have := hsmall 1 hK1 rw [mul_one] at this linarith have hc1 : c ≤ 1 := hcsmall.trans (by norm_num) refine ⟨c, hc, hc1, ?_⟩ intro h delta a b hd hdh hh ha hac hb hbc hab theta sigma have hh0 : 0 < h := hd.trans_le hdh have hd1 : delta ≤ 1 := hdh.trans (hh.trans (by norm_num)) have hh1 : h ≤ 1 := hh.trans (by norm_num) have ha' : a ≤ c := hac.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hα.le) hc.le) have hb' : b ≤ c := hbc.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hd.le hd1 hβ.le) hc.le) have hab' : a*b ≤ c := hab.trans (by simpa using mul_le_mul_of_nonneg_left (Real.rpow_le_one hh0.le hh1 hγ.le) hc.le) have heSmall : a*(2:ℝ)^d ≤ 1/4 := by have ht := (mul_le_mul_of_nonneg_right ha' (by positivity : 0 ≤ (2:ℝ)^d)).trans (hsmall _ hKd) linarith only [ht, hρ1] have hovSmall : a*(2:ℝ)^d ≤ 1/2 - eps := by have ht := (mul_le_mul_of_nonneg_right ha' (by positivity : 0 ≤ (2:ℝ)^d)).trans (hsmall _ hKd) linarith only [ht, hρe, hρ] have hmSmall : b*(2:ℝ)^d + a*b ≤ 3/8 := by have ht := (mul_le_mul_of_nonneg_right hb' (by positivity : 0 ≤ (2:ℝ)^d)).trans (hsmall _ hKd) linarith only [ht, hab', hcsmall, hρ1] have hsA := amplitude_inverse_scale_bound delta alpha a c hd hac have hsB := amplitude_inverse_scale_bound delta beta b c hd hbc have hsG := amplitude_inverse_scale_bound h gamma (a*b) c hh0 hab have hβγ : beta ≤ gamma := hβ1.trans hγ1 have hsT : a*b*h^(-beta) ≤ c := by have ht : a*b ≤ c*h^beta := hab.trans (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_ge hh0 hh1 hβγ) hc.le) exact amplitude_inverse_scale_bound h beta (a*b) c hh0 ht have hfieldA : holderNorm (fun x => a*signField h delta sigma false x) alpha ≤ ofReal (Ca*c) := by have ht := holderNorm_const_mul_bound _ alpha (Ca*delta^(-alpha)) a (by positivity) (hFa h delta hd hdh hh sigma false) rw [abs_of_pos ha] at ht apply ht.trans apply ENNReal.ofReal_le_ofReal nlinarith only [mul_le_mul_of_nonneg_left hsA hCa.le] have hfieldB : holderNorm (fun x => b*signField h delta sigma true x) beta ≤ ofReal (Cb*c) := by have ht := holderNorm_const_mul_bound _ beta (Cb*delta^(-beta)) b (by positivity) (hFb h delta hd hdh hh sigma true) rw [abs_of_pos hb] at ht apply ht.trans apply ENNReal.ofReal_le_ofReal nlinarith only [mul_le_mul_of_nonneg_left hsB hCb.le] have htheta : |thetaSign theta| = 1 := by cases theta <;> norm_num [thetaSign] have hcontrast : holderNorm (markedContrast (d:=d) h a b theta) gamma ≤ ofReal (2*Cg*c) := by have ht := holderNorm_const_mul_bound (fun x : Cov d => (macroBump h x)^2) gamma (Cg*h^(-gamma)) (-2*thetaSign theta*a*b) (by positivity) (hBg h hh0 hh) have hcoef : |-2*thetaSign theta*a*b| = 2*a*b := by rw [abs_mul, abs_mul, abs_mul, abs_of_pos ha, abs_of_pos hb, htheta] norm_num rw [hcoef] at ht apply ht.trans apply ENNReal.ofReal_le_ofReal nlinarith only [mul_le_mul_of_nonneg_left hsG hCg.le] have hterm : holderNorm (fun x : Cov d => thetaSign theta*a*b*(macroBump h x)^2) beta ≤ ofReal (Ct*c) := by have ht := holderNorm_const_mul_bound (fun x : Cov d => (macroBump h x)^2) beta (Ct*h^(-beta)) (thetaSign theta*a*b) (by positivity) (hBt h hh0 hh) rw [abs_mul, abs_mul, htheta, abs_of_pos ha, abs_of_pos hb, one_mul] at ht apply ht.trans apply ENNReal.ofReal_le_ofReal nlinarith only [mul_le_mul_of_nonneg_left hsT hCt.le] have hprop : holderNorm (markedPropensity h delta a sigma) alpha ≤ ofReal L := by have ht := holderNorm_add_bound (fun _ : Cov d => (1/2:ℝ)) _ alpha (1/2) (Ca*c) (by norm_num) (by positivity) (by simpa using holderNorm_const_bound (d:=d) (1/2) alpha) hfieldA exact ht.trans (ENNReal.ofReal_le_ofReal (by linarith only [hρL, hρ, hsmall Ca hKa])) have hcontrol : holderNorm (markedMean h delta a b theta false sigma) beta ≤ ofReal L := by have ht := holderNorm_add_bound (fun _ : Cov d => (1/2:ℝ)) _ beta (1/2) (Cb*c) (by norm_num) (by positivity) (by simpa using holderNorm_const_bound (d:=d) (1/2) beta) hfieldB have ht' := holderNorm_add_bound _ _ beta (1/2+Cb*c) (Ct*c) (by positivity) (by positivity) ht hterm have heq : markedMean h delta a b theta false sigma = (fun x => (1/2+b*signField h delta sigma true x) + thetaSign theta*a*b*(macroBump h x)^2) := by funext x simp only [markedMean, markedContrast, thetaSign, Bool.false_eq_true, if_false] ring rw [heq] exact ht'.trans (ENNReal.ofReal_le_ofReal (by linarith only [hρL, hρ, hsmall Cb hKb, hsmall Ct hKt])) let P := markedLaw h delta a b theta sigma have hu : UniformDesign P := independentFullLaw_covariates d _ _ _ (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma) have hex : ConditionalExchangeability P := independentPrimitive_exchangeability _ _ _ _ _ _ have hbands := markedLaw_probability_bands h delta a b theta sigma ha.le hb.le heSmall hmSmall eps heps hovSmall have he : PropensityHolder alpha L P := by change holderNorm _ alpha ≤ _ have hpEq : P.e = markedPropensity h delta a sigma := funext (markedLaw_propensity_eq h delta a b theta sigma ha.le heSmall) rw [hpEq] exact hprop have h0 : ControlHolder beta L P := by change holderNorm _ beta ≤ _ have hpEq : P.mu0 = markedMean h delta a b theta false sigma := funext (fun x => (markedLaw_means_eq h delta a b theta sigma ha.le hb.le hmSmall x).1) rw [hpEq] exact hcontrol have ht : EffectHolder gamma L P := by change holderNorm (rawContrast P) gamma ≤ _ rw [markedLaw_rawContrast_eq h delta a b theta sigma ha.le hb.le hmSmall] exact hcontrast.trans (ENNReal.ofReal_le_ofReal (by linarith only [hρL, hρ, hsmall Cg hKg])) have hP : PrimitiveClass alpha beta gamma L eps P := ⟨P, rfl, hu, hex, hbands.1, he, h0, ht, hbands.2.1, hbands.2.2⟩ refine ⟨hP, ?_, markedContrast_at_x0 h a b theta⟩ intro x hx rw [tau_eq_rawContrast_of_admissible P hP hu h0 ht hbands.2.1 hbands.2.2 x hx, markedLaw_rawContrast_eq h delta a b theta sigma ha.le hb.le hmSmall]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_membership · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MarkedMembership.lean:63
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.MixtureDensity 22 declarations The independent potential-outcome kernels yield the conditional likelihoods used in the marked-component information calculation.

# Original-record likelihood densities The independent potential-outcome kernels yield the conditional likelihoods used in the marked-component information calculation.

Given the specified input e, the specified input p, the specified input q, the specified input hp, the specified input hq, the observed bern product conclusion holds.

Formal statement
e p q :
ℝ
hp :
p ∈ Icc (0:ℝ) 1
hq :
q ∈ Icc (0:ℝ) 1
((bern e).prod ((bern p).prod (bern q))).map (fun w => (w.1, if w.1 then w.2.2 else w.2.1))
= (bern e).bind (fun A => (Measure.dirac A).prod (bern (if A then q else p)))
Proof (Lean source)
lemma observed_bern_product (e p q : ℝ) (hp : p ∈ Icc (0:ℝ) 1) (hq : q ∈ Icc (0:ℝ) 1) : ((bern e).prod ((bern p).prod (bern q))).map (fun w => (w.1, if w.1 then w.2.2 else w.2.1)) = (bern e).bind (fun A => (Measure.dirac A).prod (bern (if A then q else p))) := by letI := bern_probability p hp letI := bern_probability q hq apply Measure.ext_of_singleton rintro ⟨A,Y⟩ rw [Measure.map_apply (measurable_of_countable _) (measurableSet_singleton _), Measure.bind_apply (measurableSet_singleton _) (measurable_of_countable _).aemeasurable] cases A <;> cases Y <;> simp [bern, Measure.prod_add, Measure.add_prod, Measure.prod_smul_left, Measure.prod_smul_right, Measure.dirac_prod_dirac, lintegral_add_measure, lintegral_smul_measure, lintegral_dirac, Measure.prod_prod] all_goals have hpn : ofReal (1-p) + ofReal p = 1 := by rw [← ENNReal.ofReal_add (by linarith [hp.2]) hp.1] norm_num have hqn : ofReal (1-q) + ofReal q = 1 := by rw [← ENNReal.ofReal_add (by linarith [hq.2]) hq.1] norm_num case false.false => convert congrArg (fun t => t*(ofReal (1-p)*ofReal (1-e))) hqn using 1 <;> ring case false.true => convert congrArg (fun t => t*(ofReal p*ofReal (1-e))) hqn using 1 <;> ring case true.false => convert congrArg (fun t => t*(ofReal e*ofReal (1-q))) hpn using 1 <;> ring case true.true => convert congrArg (fun t => t*(ofReal e*ofReal q)) hpn using 1 <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.observed_bern_product · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:16

Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent obs law conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
obsLaw P = (uniformLaw d).bind (fun x => (Measure.dirac x).prod (conditionalObserved P x))
Proof (Lean source)
lemma independent_obsLaw (d : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq obsLaw P = (uniformLaw d).bind (fun x => (Measure.dirac x).prod (conditionalObserved P x)) := by dsimp only unfold obsLaw independentPrimitive independentFullLaw rw [independent_map_bind _ _ _ (measurable_independentRecordKernel e p q he hp hq) (show Measurable (observed (d := d)) by unfold observed exact measurable_fst.prodMk (measurable_fst.comp measurable_snd |>.prodMk (Measurable.ite ((measurableSet_singleton true).preimage (by fun_prop)) (by fun_prop) (by fun_prop))) )] congr 1 funext x let μ := (bern (probabilityClip (e x))).prod ((bern (probabilityClip (p x))).prod (bern (probabilityClip (q x)))) have hmap := Measure.map_prod_map (Measure.dirac x) μ measurable_id (measurable_of_countable (fun w : Bool × Bool × Bool => (w.1, if w.1 then w.2.2 else w.2.1))) change ((Measure.dirac x).prod μ).map (map id (fun w => (w.1, if w.1 then w.2.2 else w.2.1))) = _ rw [← hmap, Measure.map_id] congr 1 exact observed_bern_product _ _ _ (probabilityClip_mem _) (probabilityClip_mem _)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_obsLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:46

Given the specified input X, the specified input S, the reference measure ν, the finite measure μ, the kernel κ, its measurability, the specified input f, the specified input hf, the specified input hf0, the density representation, the finite joint density conclusion holds.

Formal statement
ν :
κ :
X → Measure S
hκ :
f :
X × S → ℝ
hf :
hf0 :
∀ z, 0 ≤ f z
hκf :
∀ x, κ x = μ.withDensity (fun s => ofReal (f (x,s)))
ν.bind (fun x => (Measure.dirac x).prod (κ x))
= (ν.prod μ).withDensity (fun z => ofReal (f z))
Proof (Lean source)
lemma finite_joint_density {X S : Type*} [MeasurableSpace X] [MeasurableSpace S] [Fintype S] [MeasurableSingletonClass S] (ν : Measure X) (μ : Measure S) [IsFiniteMeasure μ] (κ : X → Measure S) (hκ : Measurable κ) (f : X × S → ℝ) (hf : Measurable f) (hf0 : ∀ z, 0 ≤ f z) (hκf : ∀ x, κ x = μ.withDensity (fun s => ofReal (f (x,s)))) : ν.bind (fun x => (Measure.dirac x).prod (κ x)) = (ν.prod μ).withDensity (fun z => ofReal (f z)) := by classical have hk : Measurable (fun x => (Measure.dirac x).prod (κ x)) := by apply Measure.measurable_of_measurable_coe intro A hA rw [show (fun x => (Measure.dirac x).prod (κ x) A) = (fun x => ∑ s : S, if (x,s) ∈ A then κ x {s} else 0) by funext x rw [Measure.dirac_prod, Measure.map_apply measurable_prodMk_left hA] rw [← Measure.sum_smul_dirac (κ x)] simp only [Measure.sum_apply _ (hA.preimage measurable_prodMk_left), Measure.smul_apply, smul_eq_mul, Measure.dirac_apply' _ (hA.preimage measurable_prodMk_left)] simp [tsum_fintype, indicator, mul_ite]] apply Finset.measurable_fun_sum intro s _ exact Measurable.ite (hA.preimage (measurable_id.prodMk measurable_const)) ((Measure.measurable_coe (measurableSet_singleton s)).comp hκ) measurable_const ext A hA rw [Measure.bind_apply hA hk.aemeasurable, withDensity_apply _ hA, ← lintegral_indicator hA, lintegral_prod _ (hf.ennreal_ofReal.indicator hA).aemeasurable] apply lintegral_congr intro x rw [Measure.dirac_prod, Measure.map_apply measurable_prodMk_left hA, hκf, withDensity_apply _ (hA.preimage measurable_prodMk_left), ← lintegral_indicator] · rfl · exact hA.preimage measurable_prodMk_left
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_joint_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:73
theorem measurable_labelLikelihood Lemma measurable_labelLikelihood in the paper ↗

Given the specified input d, the specified input P, the measurable label likelihood conclusion holds.

Formal statement
d :
ℕ
P :
Measurable (fun z : Cov d × (Bool × Bool) => labelLikelihood P z.1 z.2)
Proof (Lean source)
@[fun_prop] lemma measurable_labelLikelihood {d : ℕ} (P : PrimitiveLaw d) : Measurable (fun z : Cov d × (Bool × Bool) => labelLikelihood P z.1 z.2) := by apply measurable_from_prod_countable_left intro s unfold labelLikelihood have he := (Measure.measurable_coe (measurableSet_singleton s.1)).comp (measurable_bern P.e P.measurable_e) have hm : Measurable (fun x => if s.1 then P.mu1 x else P.mu0 x) := by cases s.1 <;> simp only [Bool.false_eq_true, if_false, if_true] <;> first | exact P.measurable_mu0 | exact P.measurable_mu1 have hy := (Measure.measurable_coe (measurableSet_singleton s.2)).comp (measurable_bern _ hm) exact (measurable_const.mul he.ennreal_toReal).mul hy.ennreal_toReal
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_labelLikelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:106
theorem conditionalObserved_density Lemma conditionalObserved_density in the paper ↗

Given the specified input d, the specified input P, the specified input x, the conditional observed density conclusion holds.

Formal statement
d :
ℕ
P :
x :
Cov d
= fairObserved.withDensity (fun s => ofReal (labelLikelihood P x s))
Proof (Lean source)
lemma conditionalObserved_density {d : ℕ} (P : PrimitiveLaw d) (x : Cov d) : conditionalObserved P x = fairObserved.withDensity (fun s => ofReal (labelLikelihood P x s)) := by apply Measure.ext_of_singleton intro s rw [conditionalObserved_singleton, withDensity_apply _ (measurableSet_singleton s)] rw [lintegral_singleton] have hs : fairObserved {s} = ofReal (1/4:ℝ) := by rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> norm_num [fairObserved, bern, Measure.prod_apply, ← ENNReal.ofReal_mul] rw [hs] rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> norm_num [bern, labelLikelihood, ENNReal.ofReal_mul, ENNReal.ofReal_toReal, bern_singleton_ne_top, mul_assoc, mul_comm, mul_left_comm] all_goals have h4 : (4:ℝ≥0∞)*ofReal (1/4:ℝ) = 1 := by rw [show (4:ℝ≥0∞) = ofReal (4:ℝ) by norm_num] rw [← ENNReal.ofReal_mul (by norm_num)] norm_num rw [← mul_assoc, h4, one_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObserved_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:119
theorem auxiliaryLikelihood_density Lemma auxiliaryLikelihood_density in the paper ↗

Given the specified input d, the specified input P, the specified input x, the auxiliary likelihood density conclusion holds.

Formal statement
d :
ℕ
P :
x :
Cov d
bern (P.e x)
= (bern (1/2)).withDensity (fun s => ofReal (auxiliaryLikelihood P x s))
Proof (Lean source)
lemma auxiliaryLikelihood_density {d : ℕ} (P : PrimitiveLaw d) (x : Cov d) : bern (P.e x) = (bern (1/2)).withDensity (fun s => ofReal (auxiliaryLikelihood P x s)) := by apply Measure.ext_of_singleton intro s rw [withDensity_apply _ (measurableSet_singleton s), lintegral_singleton] have hs : bern (1/2) {s} = ofReal (1/2:ℝ) := by cases s <;> norm_num [bern] rw [hs] unfold auxiliaryLikelihood rw [ENNReal.ofReal_mul (by norm_num), ENNReal.ofReal_toReal (bern_singleton_ne_top _ _)] have h2 : ofReal (2:ℝ)*ofReal (1/2:ℝ) = 1 := by rw [← ENNReal.ofReal_mul (by norm_num)]; norm_num rw [mul_assoc, mul_comm (bern (P.e x) {s}), ← mul_assoc, h2, one_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.auxiliaryLikelihood_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:141
theorem measurable_auxiliaryLikelihood Lemma measurable_auxiliaryLikelihood in the paper ↗

Given the specified input d, the specified input P, the measurable auxiliary likelihood conclusion holds.

Formal statement
d :
ℕ
P :
Measurable (fun z : Cov d × Bool => auxiliaryLikelihood P z.1 z.2)
Proof (Lean source)
@[fun_prop] lemma measurable_auxiliaryLikelihood {d : ℕ} (P : PrimitiveLaw d) : Measurable (fun z : Cov d × Bool => auxiliaryLikelihood P z.1 z.2) := by apply measurable_from_prod_countable_left intro s unfold auxiliaryLikelihood exact measurable_const.mul ((Measure.measurable_coe (measurableSet_singleton s)).comp (measurable_bern P.e P.measurable_e)).ennreal_toReal
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_auxiliaryLikelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:156
theorem independent_obsLaw_density Lemma independent_obsLaw_density in the paper ↗

Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent obs law density conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
obsLaw P
= ((uniformLaw d).prod fairObserved).withDensity (fun z => ofReal (labelLikelihood P z.1 z.2))
Proof (Lean source)
lemma independent_obsLaw_density (d : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq obsLaw P = ((uniformLaw d).prod fairObserved).withDensity (fun z => ofReal (labelLikelihood P z.1 z.2)) := by letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance dsimp only rw [independent_obsLaw] let P := independentPrimitive e p q he hp hq apply finite_joint_density · apply Measure.measurable_of_measurable_coe intro A hA rw [show (fun x => conditionalObserved P x A) = (fun x => ∑ s : Bool × Bool, if s ∈ A then conditionalObserved P x {s} else 0) by funext x rw [← Measure.sum_smul_dirac (conditionalObserved P x)] simp [Measure.sum_apply, hA, tsum_fintype, Measure.dirac_apply' _ hA, indicator, mul_ite]] apply Finset.measurable_fun_sum intro s _ by_cases hs : s ∈ A · simp only [if_pos hs, conditionalObserved_singleton] have he := (Measure.measurable_coe (measurableSet_singleton s.1)).comp (measurable_bern P.e P.measurable_e) have hm : Measurable (fun x => if s.1 then P.mu1 x else P.mu0 x) := by cases s.1 <;> simp only [Bool.false_eq_true, if_false, if_true] <;> first | exact P.measurable_mu0 | exact P.measurable_mu1 exact he.mul ((Measure.measurable_coe (measurableSet_singleton s.2)).comp (measurable_bern _ hm)) · simp only [if_neg hs]; exact measurable_const · exact measurable_labelLikelihood P · intro z; unfold labelLikelihood; positivity · exact conditionalObserved_density P
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_obsLaw_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:165
theorem independent_xaLaw_density Lemma independent_xaLaw_density in the paper ↗

Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent xa law density conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
= ((uniformLaw d).prod (bern (1/2))).withDensity (fun z => ofReal (auxiliaryLikelihood P z.1 z.2))
Proof (Lean source)
lemma independent_xaLaw_density (d : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq xaLaw P = ((uniformLaw d).prod (bern (1/2))).withDensity (fun z => ofReal (auxiliaryLikelihood P z.1 z.2)) := by letI := bern_probability (1/2) (by norm_num) dsimp only let P := independentPrimitive e p q he hp hq have hxa : xaLaw P = (uniformLaw d).bind (fun x => (Measure.dirac x).prod (bern (P.e x))) := by change (independentFullLaw e p q).map _ = _ rw [independentFullLaw_margin d e p q he hp hq |>.1, independentFullLaw_covariates d e p q he hp hq] exact (bernRecord_bind_eq_compProd d _ (measurable_probabilityClip e he) (fun x => probabilityClip_mem _)).symm rw [hxa] apply finite_joint_density · exact measurable_bern P.e P.measurable_e · exact measurable_auxiliaryLikelihood P · intro z; unfold auxiliaryLikelihood; positivity · exact auxiliaryLikelihood_density P
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_xaLaw_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:198

Given the specified input p, the specified input hp, the specified input s, the bern atom le one conclusion holds.

Formal statement
p :
ℝ
hp :
p ∈ Icc (0:ℝ) 1
s :
(bern p {s}).toReal ≤ 1
Proof (Lean source)
lemma bern_atom_le_one (p : ℝ) (hp : p ∈ Icc (0:ℝ) 1) (s : Bool) : (bern p {s}).toReal ≤ 1 := by letI := bern_probability p hp have h : bern p {s} ≤ bern p univ := measure_mono (by simp) rw [measure_univ] at h simpa using ENNReal.toReal_mono (by simp : (1:ℝ≥0∞) ≠ ⊤) h
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bern_atom_le_one · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:219
theorem independent_likelihood_bounds Lemma independent_likelihood_bounds in the paper ↗

Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent likelihood bounds conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
z :
Cov d × (Bool × Bool)
0 ≤ labelLikelihood P z.1 z.2
labelLikelihood P z.1 z.2 ≤ 4
z :
Cov d × Bool
0 ≤ auxiliaryLikelihood P z.1 z.2
auxiliaryLikelihood P z.1 z.2 ≤ 2
Proof (Lean source)
lemma independent_likelihood_bounds (d : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq (∀ z : Cov d × (Bool × Bool), 0 ≤ labelLikelihood P z.1 z.2 ∧ labelLikelihood P z.1 z.2 ≤ 4) ∧ (∀ z : Cov d × Bool, 0 ≤ auxiliaryLikelihood P z.1 z.2 ∧ auxiliaryLikelihood P z.1 z.2 ≤ 2) := by let P := independentPrimitive e p q he hp hq have he1 (x : Cov d) : P.e x ∈ Icc (0:ℝ) 1 := probabilityClip_mem _ have hm1 (x : Cov d) (A : Bool) : (if A then P.mu1 x else P.mu0 x) ∈ Icc (0:ℝ) 1 := by cases A <;> exact probabilityClip_mem _ constructor · intro z have ha := bern_atom_le_one _ (he1 z.1) z.2.1 have hy := bern_atom_le_one _ (hm1 z.1 z.2.1) z.2.2 constructor · unfold labelLikelihood; positivity · unfold labelLikelihood have hb := mul_le_mul ha hy (ENNReal.toReal_nonneg) zero_le_one nlinarith · intro z have ha := bern_atom_le_one _ (he1 z.1) z.2 constructor · unfold auxiliaryLikelihood; positivity · unfold auxiliaryLikelihood; linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_likelihood_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:227
theorem independent_likelihood_integrable Lemma independent_likelihood_integrable in the paper ↗

Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent likelihood integrable conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
Integrable (fun z : Cov d × (Bool × Bool) => labelLikelihood P z.1 z.2) ((uniformLaw d).prod fairObserved)
Integrable (fun z : Cov d × Bool => auxiliaryLikelihood P z.1 z.2) ((uniformLaw d).prod (bern (1/2)))
Proof (Lean source)
lemma independent_likelihood_integrable (d : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq Integrable (fun z : Cov d × (Bool × Bool) => labelLikelihood P z.1 z.2) ((uniformLaw d).prod fairObserved) ∧ Integrable (fun z : Cov d × Bool => auxiliaryLikelihood P z.1 z.2) ((uniformLaw d).prod (bern (1/2))) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance let P := independentPrimitive e p q he hp hq obtain ⟨hl, ha⟩ := independent_likelihood_bounds d e p q he hp hq constructor · apply (integrable_const (4:ℝ)).mono' (measurable_labelLikelihood P).aestronglyMeasurable exact Filter.Eventually.of_forall (fun z => by rw [Real.norm_eq_abs, abs_of_nonneg (hl z).1]; exact (hl z).2) · apply (integrable_const (2:ℝ)).mono' (measurable_auxiliaryLikelihood P).aestronglyMeasurable exact Filter.Eventually.of_forall (fun z => by rw [Real.norm_eq_abs, abs_of_nonneg (ha z).1]; exact (ha z).2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_likelihood_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:252

Reference records have the common uniform design and independent fair spins. Given the specified input d, the specified input n, the specified input m, fair dataset is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
fairDataset d n m :
(Measure.pi (fun _ : Fin n => (uniformLaw d).prod fairObserved)).prod (Measure.pi (fun _ : Fin m => (uniformLaw d).prod (bern (1/2))))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fairDataset · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:270

Concatenate the covariates of the original labeled and auxiliary records. Given the specified input d, the specified input n, the specified input m, the specified input D, dataset covariates is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
D :
Dataset d n m
datasetCovariates D :
Fin (n+m) → Cov d
recordCovariates (fun i => (D.1 i).1) (fun j => (D.2 j).1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetCovariates · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:275

Retain the two observed bits in labeled records and the treatment bit in auxiliaries. Given the specified input d, the specified input n, the specified input m, the specified input D, dataset spins is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
D :
Dataset d n m
datasetSpins D :
(fun i => (D.1 i).2, fun j => (D.2 j).2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetSpins · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:279

The original-record mixture likelihood is the conditional mixed likelihood. Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the specified input D, dataset density is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
H :
theta :
D :
Dataset d n m
datasetDensity H theta D :
ℝ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:283

Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input D, the dataset record product conclusion holds.

Formal statement
d n m :
ℕ
P :
D :
Dataset d n m
= (∏ i : Fin n, labelLikelihood P (D.1 i).1 (D.1 i).2) * (∏ j : Fin m, auxiliaryLikelihood P (D.2 j).1 (D.2 j).2)
Proof (Lean source)
lemma dataset_record_product {d n m : ℕ} (P : PrimitiveLaw d) (D : Dataset d n m) : (∏ i, recordLikelihood P (datasetCovariates D) (datasetSpins D) i) = (∏ i : Fin n, labelLikelihood P (D.1 i).1 (D.1 i).2) * (∏ j : Fin m, auxiliaryLikelihood P (D.2 j).1 (D.2 j).2) := by rw [Fin.prod_univ_add] simp [recordLikelihood, datasetCovariates, datasetSpins, recordCovariates]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.dataset_record_product · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:287
theorem measurable_datasetDensity Lemma measurable_datasetDensity in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the measurable dataset density conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
Measurable (datasetDensity (n:=n) (m:=m) H theta)
Proof (Lean source)
@[fun_prop] lemma measurable_datasetDensity {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) : Measurable (datasetDensity (n:=n) (m:=m) H theta) := by unfold datasetDensity mixedDensity simp_rw [dataset_record_product] apply Finset.measurable_fun_sum intro sigma _ apply Measurable.const_mul exact (Finset.measurable_prod _ (fun i _ => (measurable_labelLikelihood _).comp (by fun_prop))).mul (Finset.measurable_prod _ (fun j _ => (measurable_auxiliaryLikelihood _).comp (by fun_prop)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_datasetDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:295

Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the specified input hw, the specified input D, the dataset density nonneg conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
hw :
∀ sigma, 0 ≤ H.weight theta sigma
D :
Dataset d n m
0 ≤ datasetDensity H theta D
Proof (Lean source)
lemma datasetDensity_nonneg {d n m : ℕ} (H : MarkedPriors d) (theta : Bool) (hw : ∀ sigma, 0 ≤ H.weight theta sigma) (D : Dataset d n m) : 0 ≤ datasetDensity H theta D := by unfold datasetDensity mixedDensity apply Finset.sum_nonneg intro sigma _ apply mul_nonneg (hw sigma) apply Finset.prod_nonneg intro i _ unfold recordLikelihood refine Fin.addCases ?_ ?_ i · intro j; simp only [Fin.addCases_left]; unfold labelLikelihood; positivity · intro j; simp only [Fin.addCases_right]; unfold auxiliaryLikelihood; positivity
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetDensity_nonneg · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:306
theorem independent_dataset_density Lemma independent_dataset_density in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent dataset density conclusion holds.

Formal statement
d n m :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
(Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P))
= (fairDataset d n m).withDensity (fun D => ofReal (∏ i, recordLikelihood P (datasetCovariates D) (datasetSpins D) i))
Proof (Lean source)
lemma independent_dataset_density (d n m : ℕ) (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq (Measure.pi (fun _ : Fin n => obsLaw P)).prod (Measure.pi (fun _ : Fin m => xaLaw P)) = (fairDataset d n m).withDensity (fun D => ofReal (∏ i, recordLikelihood P (datasetCovariates D) (datasetSpins D) i)) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance let P := independentPrimitive e p q he hp hq letI : IsProbabilityMeasure (obsLaw P) := by unfold obsLaw apply Measure.isProbabilityMeasure_map have ho : Measurable (observed (d := d)) := by unfold observed apply prodMk (by fun_prop) apply prodMk (by fun_prop) exact Measurable.ite ((measurableSet_singleton true).preimage (by fun_prop)) (by fun_prop) (by fun_prop) exact ho.aemeasurable letI : IsProbabilityMeasure (xaLaw P) := by unfold xaLaw exact Measure.isProbabilityMeasure_map (show Measurable (fun w : FullRecord d => (w.1,w.2.1)) by fun_prop).aemeasurable obtain ⟨hl, ha⟩ := independent_likelihood_integrable d e p q he hp hq have hL := pi_real_density (fun _ : Fin n => (uniformLaw d).prod fairObserved) (fun _ => obsLaw P) (fun _ z => labelLikelihood P z.1 z.2) (fun _ => hl) (fun _ z => by unfold labelLikelihood; positivity) (fun _ => independent_obsLaw_density d e p q he hp hq) have hA := pi_real_density (fun _ : Fin m => (uniformLaw d).prod (bern (1/2))) (fun _ => xaLaw P) (fun _ z => auxiliaryLikelihood P z.1 z.2) (fun _ => ha) (fun _ z => by unfold auxiliaryLikelihood; positivity) (fun _ => independent_xaLaw_density d e p q he hp hq) dsimp only rw [hL, hA, prod_withDensity (by fun_prop) (by fun_prop)] unfold fairDataset apply congrArg _ funext D rw [dataset_record_product, ENNReal.ofReal_mul (Finset.prod_nonneg (fun i _ => by unfold labelLikelihood; positivity))]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_dataset_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:321
theorem finite_prior_withDensity Lemma finite_prior_withDensity in the paper ↗

Given the specified input S, the specified input Q, the specified input w, the specified input f, the specified input hw, the specified input hf, the specified input hf0, the specified input hQ, the finite prior with density conclusion holds.

Formal statement
Ω S :
μ :
Q :
S → Measure Ω
w :
S → ℝ
f :
S → Ω → ℝ
hw :
∀ s, 0 ≤ w s
hf :
∀ s, Measurable (f s)
hf0 :
∀ s x, 0 ≤ f s x
hQ :
∀ s, Q s = μ.withDensity (fun x => ofReal (f s x))
(∑ s, ofReal (w s) • Q s)
= μ.withDensity (fun x => ofReal (∑ s, w s * f s x))
Proof (Lean source)
lemma finite_prior_withDensity {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] (μ : Measure Ω) (Q : S → Measure Ω) (w : S → ℝ) (f : S → Ω → ℝ) (hw : ∀ s, 0 ≤ w s) (hf : ∀ s, Measurable (f s)) (hf0 : ∀ s x, 0 ≤ f s x) (hQ : ∀ s, Q s = μ.withDensity (fun x => ofReal (f s x))) : (∑ s, ofReal (w s) • Q s) = μ.withDensity (fun x => ofReal (∑ s, w s * f s x)) := by ext A hA simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, hQ, withDensity_apply _ hA] simp_rw [ENNReal.ofReal_sum_of_nonneg (fun s _ => mul_nonneg (hw s) (hf0 s _)), ENNReal.ofReal_mul (hw _)] rw [lintegral_finsetSum (f := fun s x => ofReal (w s) * ofReal (f s x)) univ (fun s _ => (measurable_const.mul (hf s).ennreal_ofReal))] simp only [lintegral_const_mul, (hf _).ennreal_ofReal]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_prior_withDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:361

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the marked mixture density conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
markedMixture (markedHandle d h delta a b) theta n m
= (fairDataset d n m).withDensity (fun D => ofReal (datasetDensity (markedHandle d h delta a b) theta D))
Proof (Lean source)
lemma markedMixture_density (d n m : ℕ) (h delta a b : ℝ) (theta : Bool) : markedMixture (markedHandle d h delta a b) theta n m = (fairDataset d n m).withDensity (fun D => ofReal (datasetDensity (markedHandle d h delta a b) theta D)) := by unfold markedMixture apply finite_prior_withDensity · exact (marked_prior_mass d h delta theta).1 · intro sigma simp_rw [dataset_record_product] exact (Finset.measurable_prod _ (fun i _ => (measurable_labelLikelihood _).comp (by fun_prop))).mul (Finset.measurable_prod _ (fun j _ => (measurable_auxiliaryLikelihood _).comp (by fun_prop))) · intro sigma D rw [dataset_record_product] apply mul_nonneg <;> apply Finset.prod_nonneg · intro i _; unfold labelLikelihood; positivity · intro j _; unfold auxiliaryLikelihood; positivity · intro sigma exact independent_dataset_density d n m _ _ _ (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_density · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureDensity.lean:376
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.MixtureInformation 16 declarations Reorder the original records into covariates and spins, integrate the conditional component bound, and apply the labeled-root tree series.

# Unconditional marked information Reorder the original records into covariates and spins, integrate the conditional component bound, and apply the labeled-root tree series.

Regroup four blocks by exchanging the middle two. Given the specified input A, the specified input B, the specified input C, the specified input D, regroup four equiv is the corresponding construction.

Definition (Lean source)
regroupFourEquiv A B C D :
(A × B) × (C × D) ≃ᵐ (A × C) × (B × D)
clause 1
toEquiv := Equiv.prodProdProdComm A B C D
clause 2
measurable_toFun := by change Measurable (fun x : (A × B) × (C × D) => ((x.1.1,x.2.1),(x.1.2,x.2.2))) fun_prop
clause 3
measurable_invFun := by change Measurable (fun x : (A × C) × (B × D) => ((x.1.1,x.2.1),(x.1.2,x.2.2))) fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.regroupFourEquiv · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:19
theorem regroupFour_measurePreserving Lemma regroupFour_measurePreserving in the paper ↗

Given the specified input A, the specified input B, the specified input C, the specified input D, the specified input a, the specified input b, the specified input c, the specified input d, the regroup four measure preserving conclusion holds.

Formal statement
MeasurePreserving (regroupFourEquiv A B C D) ((a.prod b).prod (c.prod d)) ((a.prod c).prod (b.prod d))
Proof (Lean source)
lemma regroupFour_measurePreserving {A B C D : Type*} [MeasurableSpace A] [MeasurableSpace B] [MeasurableSpace C] [MeasurableSpace D] (a : Measure A) (b : Measure B) (c : Measure C) (d : Measure D) [IsFiniteMeasure a] [IsFiniteMeasure b] [IsFiniteMeasure c] [IsFiniteMeasure d] : MeasurePreserving (regroupFourEquiv A B C D) ((a.prod b).prod (c.prod d)) ((a.prod c).prod (b.prod d)) := by have h1 := measurePreserving_prodAssoc a b (c.prod d) have h2 := (MeasurePreserving.id a).prod ((measurePreserving_prodAssoc b c d).symm MeasurableEquiv.prodAssoc) have h3 := (MeasurePreserving.id a).prod (Measure.measurePreserving_swap (μ:=b) (ν:=c) |>.prod (MeasurePreserving.id d)) have h4 := (MeasurePreserving.id a).prod (measurePreserving_prodAssoc c b d) have h5 := (measurePreserving_prodAssoc a c (b.prod d)).symm MeasurableEquiv.prodAssoc exact h5.comp (h4.comp (h3.comp (h2.comp h1)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.regroupFour_measurePreserving · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:30

Covariate arrays split at the labeled sample size. Given the specified input d, the specified input n, the specified input m, covariate concat equiv is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
covariateConcatEquiv d n m :
((Fin n → Cov d) × (Fin m → Cov d)) ≃ᵐ (Fin (n+m) → Cov d)
clause 1
toFun x := Fin.addCases x.1 x.2
clause 2
invFun x := (fun i => x (castAdd m i), fun j => x (natAdd n j))
clause 3
left_inv x := by simp
clause 4
right_inv x := by funext i; refine Fin.addCases ?_ ?_ i <;> intro j <;> simp
clause 5
measurable_toFun := by change Measurable (fun x : (Fin n → Cov d) × (Fin m → Cov d) => fun i : Fin (n+m) => (Fin.addCases x.1 x.2 i : Cov d)) apply measurable_pi_lambda intro i refine Fin.addCases ?_ ?_ i <;> intro j <;> simp only [Fin.addCases_left, Fin.addCases_right] <;> fun_prop
clause 6
measurable_invFun := by change Measurable (fun x : Fin (n+m) → Cov d => (fun i => x (castAdd m i), fun j => x (natAdd n j))) fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.covariateConcatEquiv · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:43
theorem covariateConcat_measurePreserving Lemma covariateConcat_measurePreserving in the paper ↗

Given the specified input d, the specified input n, the specified input m, the covariate concat measure preserving conclusion holds.

Formal statement
d n m :
ℕ
MeasurePreserving (covariateConcatEquiv d n m) ((Measure.pi (fun _ : Fin n => uniformLaw d)).prod (Measure.pi (fun _ : Fin m => uniformLaw d))) (Measure.pi (fun _ : Fin (n+m) => uniformLaw d))
Proof (Lean source)
lemma covariateConcat_measurePreserving (d n m : ℕ) : MeasurePreserving (covariateConcatEquiv d n m) ((Measure.pi (fun _ : Fin n => uniformLaw d)).prod (Measure.pi (fun _ : Fin m => uniformLaw d))) (Measure.pi (fun _ : Fin (n+m) => uniformLaw d)) := by letI := uniformLaw_probability d refine ⟨(covariateConcatEquiv d n m).measurable, ?_⟩ symm apply Measure.pi_eq intro s hs rw [Measure.map_apply (covariateConcatEquiv d n m).measurable (MeasurableSet.univ_pi hs)] rw [show (covariateConcatEquiv d n m) ⁻¹' (univ.pi s) = (univ.pi (fun i : Fin n => s (castAdd m i))) ×ˢ (univ.pi (fun j : Fin m => s (natAdd n j))) by ext x simp only [Set.mem_preimage, Set.mem_pi, Set.mem_univ, forall_true_left, Set.mem_prod] change (∀ i, Fin.addCases x.1 x.2 i ∈ s i) ↔ _ constructor · intro h; exact ⟨fun i => by simpa using h (castAdd m i), fun j => by simpa using h (natAdd n j)⟩ · rintro ⟨h1,h2⟩ i; refine Fin.addCases ?_ ?_ i <;> intro j · simpa using h1 j · simpa using h2 j] rw [Measure.prod_prod, Measure.pi_pi, Measure.pi_pi, Fin.prod_univ_add]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.covariateConcat_measurePreserving · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:60

A measurable reordering separates all covariates from all observed spins. Given the specified input d, the specified input n, the specified input m, dataset split equiv is the corresponding construction.

Definition (Lean source)
d n m :
ℕ
datasetSplitEquiv d n m :
Dataset d n m ≃ᵐ ((Fin (n+m) → Cov d) × RecordSpins n m)
((MeasurableEquiv.arrowProdEquivProdArrow (Cov d) (Bool × Bool) (Fin n)).prodCongr (MeasurableEquiv.arrowProdEquivProdArrow (Cov d) Bool (Fin m))).trans ((regroupFourEquiv (Fin n → Cov d) (Fin n → Bool × Bool) (Fin m → Cov d) (Fin m → Bool)).trans ((covariateConcatEquiv d n m).prodCongr (MeasurableEquiv.refl _)))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetSplitEquiv · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:84

Given the specified input d, the specified input n, the specified input m, the specified input D, the dataset split apply conclusion holds.

Formal statement
d n m :
ℕ
D :
Dataset d n m
Proof (Lean source)
lemma datasetSplit_apply {d n m : ℕ} (D : Dataset d n m) : datasetSplitEquiv d n m D = (datasetCovariates D, datasetSpins D) := rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetSplit_apply · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:91
theorem datasetSplit_measurePreserving Lemma datasetSplit_measurePreserving in the paper ↗

Given the specified input d, the specified input n, the specified input m, the dataset split measure preserving conclusion holds.

Formal statement
d n m :
ℕ
MeasurePreserving (datasetSplitEquiv d n m) (fairDataset d n m) ((Measure.pi (fun _ : Fin (n+m) => uniformLaw d)).prod ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))))
Proof (Lean source)
lemma datasetSplit_measurePreserving (d n m : ℕ) : MeasurePreserving (datasetSplitEquiv d n m) (fairDataset d n m) ((Measure.pi (fun _ : Fin (n+m) => uniformLaw d)).prod ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))))) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance have hl := measurePreserving_arrowProdEquivProdArrow (Cov d) (Bool × Bool) (Fin n) (fun _ => uniformLaw d) (fun _ => fairObserved) have ha := measurePreserving_arrowProdEquivProdArrow (Cov d) Bool (Fin m) (fun _ => uniformLaw d) (fun _ => bern (1/2)) exact ((covariateConcat_measurePreserving d n m).prod (MeasurePreserving.id _)).comp ((regroupFour_measurePreserving _ _ _ _).comp (hl.prod ha))
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.datasetSplit_measurePreserving · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:95
theorem fairDataset_probability Lemma fairDataset_probability in the paper ↗

Given the specified input d, the specified input n, the specified input m, the fair dataset probability conclusion holds.

Formal statement
d n m :
ℕ
Proof (Lean source)
lemma fairDataset_probability (d n m : ℕ) : IsProbabilityMeasure (fairDataset d n m) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance unfold fairDataset infer_instance
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fairDataset_probability · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:111
theorem marked_mixedDensity_bounds Lemma marked_mixedDensity_bounds in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the specified input x, the specified input s, the marked mixed density bounds conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
x :
Fin (n+m) → Cov d
s :
conclusion 1
0 ≤ mixedDensity (markedHandle d h delta a b) theta x s
conclusion 2
mixedDensity (markedHandle d h delta a b) theta x s ≤ (4:ℝ)^(n+m)
Proof (Lean source)
lemma marked_mixedDensity_bounds (d n m : ℕ) (h delta a b : ℝ) (theta : Bool) (x : Fin (n+m) → Cov d) (s : RecordSpins n m) : 0 ≤ mixedDensity (markedHandle d h delta a b) theta x s ∧ mixedDensity (markedHandle d h delta a b) theta x s ≤ (4:ℝ)^(n+m) := by have hrec (sigma : SignArray d h delta) (i : Fin (n+m)) : 0 ≤ recordLikelihood (markedLaw h delta a b theta sigma) x s i ∧ recordLikelihood (markedLaw h delta a b theta sigma) x s i ≤ 4 := by obtain ⟨hl, ha⟩ := independent_likelihood_bounds d (markedPropensity h delta a sigma) (markedMean h delta a b theta false sigma) (markedMean h delta a b theta true sigma) (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma) refine Fin.addCases ?_ ?_ i · intro j simp only [recordLikelihood, Fin.addCases_left] exact hl (x (castAdd m j), s.1 j) · intro j simp only [recordLikelihood, Fin.addCases_right] exact ⟨(ha (x (natAdd n j), s.2 j)).1, (ha (x (natAdd n j), s.2 j)).2.trans (by norm_num)⟩ obtain ⟨hw, hsum⟩ := marked_prior_mass d h delta theta constructor · apply Finset.sum_nonneg intro sigma _ exact mul_nonneg (hw sigma) (Finset.prod_nonneg (fun i _ => (hrec sigma i).1)) · calc _ ≤ ∑ sigma : SignArray d h delta, markedWeight h delta theta sigma * (4:ℝ)^(n+m) := by apply Finset.sum_le_sum intro sigma _ apply mul_le_mul_of_nonneg_left _ (hw sigma) calc _ ≤ ∏ _i : Fin (n+m), (4:ℝ) := Finset.prod_le_prod (fun i _ => (hrec sigma i).1) (fun i _ => (hrec sigma i).2) _ = _ := by simp _ = _ := by rw [← Finset.sum_mul, hsum, one_mul]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_mixedDensity_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:120
theorem measurable_mixedDensity Lemma measurable_mixedDensity in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input H, the specified input theta, the measurable mixed density conclusion holds.

Formal statement
d n m :
ℕ
H :
theta :
Measurable (fun z : (Fin (n+m) → Cov d) × RecordSpins n m => mixedDensity H theta z.1 z.2)
Proof (Lean source)
@[fun_prop] lemma measurable_mixedDensity (d n m : ℕ) (H : MarkedPriors d) (theta : Bool) : Measurable (fun z : (Fin (n+m) → Cov d) × RecordSpins n m => mixedDensity H theta z.1 z.2) := by have h := (measurable_datasetDensity (n:=n) (m:=m) H theta).comp (datasetSplitEquiv d n m).symm.measurable convert h using 1 funext z have hz := datasetSplit_apply ((datasetSplitEquiv d n m).symm z) rw [(datasetSplitEquiv d n m).apply_symm_apply] at hz simpa only [datasetDensity, Function.comp_apply] using congrArg (fun z => mixedDensity H theta z.1 z.2) hz
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_mixedDensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:157
theorem marked_datasetDensity_integrable Lemma marked_datasetDensity_integrable in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the marked dataset density integrable conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
Integrable (datasetDensity (n:=n) (m:=m) (markedHandle d h delta a b) theta) (fairDataset d n m)
Proof (Lean source)
lemma marked_datasetDensity_integrable (d n m : ℕ) (h delta a b : ℝ) (theta : Bool) : Integrable (datasetDensity (n:=n) (m:=m) (markedHandle d h delta a b) theta) (fairDataset d n m) := by letI := fairDataset_probability d n m apply (integrable_const ((4:ℝ)^(n+m))).mono' (measurable_datasetDensity _ _).aestronglyMeasurable apply Filter.Eventually.of_forall intro D have hb := marked_mixedDensity_bounds d n m h delta a b theta (datasetCovariates D) (datasetSpins D) change ‖mixedDensity (markedHandle d h delta a b) theta (datasetCovariates D) (datasetSpins D)‖ ≤ _ rw [Real.norm_eq_abs, abs_of_nonneg hb.1] exact hb.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_datasetDensity_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:168

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input theta, the marked mixture finite conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
theta :
IsFiniteMeasure (markedMixture (markedHandle d h delta a b) theta n m)
Proof (Lean source)
lemma markedMixture_finite (d n m : ℕ) (h delta a b : ℝ) (theta : Bool) : IsFiniteMeasure (markedMixture (markedHandle d h delta a b) theta n m) := by rw [markedMixture_density] exact isFiniteMeasure_withDensity_ofReal (marked_datasetDensity_integrable d n m h delta a b theta).hasFiniteIntegral
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_finite · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:180
theorem marked_sqrt_difference_integrable Lemma marked_sqrt_difference_integrable in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the marked sqrt difference integrable conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
Integrable (fun z : (Fin (n+m) → Cov d) × RecordSpins n m => (sqrt (mixedDensity (markedHandle d h delta a b) true z.1 z.2) - sqrt (mixedDensity (markedHandle d h delta a b) false z.1 z.2))^2) ((Measure.pi (fun _ : Fin (n+m) => uniformLaw d)).prod ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))))
Proof (Lean source)
lemma marked_sqrt_difference_integrable (d n m : ℕ) (h delta a b : ℝ) : Integrable (fun z : (Fin (n+m) → Cov d) × RecordSpins n m => (sqrt (mixedDensity (markedHandle d h delta a b) true z.1 z.2) - sqrt (mixedDensity (markedHandle d h delta a b) false z.1 z.2))^2) ((Measure.pi (fun _ : Fin (n+m) => uniformLaw d)).prod ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))))) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance apply (integrable_const (4*(4:ℝ)^(n+m))).mono' (by fun_prop) apply Filter.Eventually.of_forall intro z obtain ⟨hf0,hf⟩ := marked_mixedDensity_bounds d n m h delta a b true z.1 z.2 obtain ⟨hg0,hg⟩ := marked_mixedDensity_bounds d n m h delta a b false z.1 z.2 rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hfs := Real.sq_sqrt hf0 have hgs := Real.sq_sqrt hg0 nlinarith [sq_nonneg (sqrt (mixedDensity (markedHandle d h delta a b) true z.1 z.2) + sqrt (mixedDensity (markedHandle d h delta a b) false z.1 z.2))]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_sqrt_difference_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:186
theorem markedMixture_hellinger_eq_integral Lemma markedMixture_hellinger_eq_integral in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input a, the specified input b, the marked mixture hellinger eq integral conclusion holds.

Formal statement
d n m :
ℕ
h delta a b :
ℝ
hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m)
= ∫ x : Fin (n+m) → Cov d, hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d)
Proof (Lean source)
lemma markedMixture_hellinger_eq_integral (d n m : ℕ) (h delta a b : ℝ) : hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m) = ∫ x : Fin (n+m) → Cov d, hellingerSqDensity ((Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2)))) (mixedDensity (markedHandle d h delta a b) true x) (mixedDensity (markedHandle d h delta a b) false x) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d) := by letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance letI := fairDataset_probability d n m letI := markedMixture_finite d n m h delta a b true letI := markedMixture_finite d n m h delta a b false rw [hellingerSq_real_density _ _ (fairDataset d n m) _ _ (measurable_datasetDensity _ _) (measurable_datasetDensity _ _) (datasetDensity_nonneg _ _ (marked_prior_mass d h delta true).1) (datasetDensity_nonneg _ _ (marked_prior_mass d h delta false).1) (markedMixture_density d n m h delta a b true) (markedMixture_density d n m h delta a b false)] unfold hellingerSqDensity have hsplit := (datasetSplit_measurePreserving d n m).integral_comp (datasetSplitEquiv d n m).measurableEmbedding (fun z => (sqrt (mixedDensity (markedHandle d h delta a b) true z.1 z.2) - sqrt (mixedDensity (markedHandle d h delta a b) false z.1 z.2))^2) change (∫ D, (sqrt (datasetDensity (markedHandle d h delta a b) true D) - sqrt (datasetDensity (markedHandle d h delta a b) false D))^2 ∂fairDataset d n m) = _ rw [show (fun D => (sqrt (datasetDensity (markedHandle d h delta a b) true D) - sqrt (datasetDensity (markedHandle d h delta a b) false D))^2) = (fun D => (sqrt (mixedDensity (markedHandle d h delta a b) true (datasetSplitEquiv d n m D).1 (datasetSplitEquiv d n m D).2) - sqrt (mixedDensity (markedHandle d h delta a b) false (datasetSplitEquiv d n m D).1 (datasetSplitEquiv d n m D).2))^2) by rfl, hsplit, integral_prod _ (marked_sqrt_difference_integrable d n m h delta a b)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.markedMixture_hellinger_eq_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:207
theorem sum_sizes_le_shifted_range Lemma sum_sizes_le_shifted_range in the paper ↗

Given the specified input N, the specified input f, the specified input hf, the sum sizes le shifted range conclusion holds.

Formal statement
N :
ℕ
f :
ℕ → ℝ
hf :
∀ p, 0 ≤ f p
(∑ p ∈ Icc 2 N, f p) ≤ ∑ j ∈ range N, f (j+2)
Proof (Lean source)
lemma sum_sizes_le_shifted_range (N : ℕ) (f : ℕ → ℝ) (hf : ∀ p, 0 ≤ f p) : (∑ p ∈ Icc 2 N, f p) ≤ ∑ j ∈ range N, f (j+2) := by classical have hi : InjOn (fun p : ℕ => p-2) (Icc 2 N) := by intro p hp q hq he have hp := Finset.mem_Icc.mp hp have hq := Finset.mem_Icc.mp hq dsimp only at he omega have heq : (∑ p ∈ Icc 2 N, f p) = ∑ j ∈ (Icc 2 N).image (fun p => p-2), f (j+2) := by rw [Finset.sum_image hi] apply Finset.sum_congr rfl intro p hp congr 1 have hp := Finset.mem_Icc.mp hp omega rw [heq] apply Finset.sum_le_sum_of_subset_of_nonneg · intro j hj obtain ⟨p,hp,rfl⟩ := Finset.mem_image.mp hj have hp := Finset.mem_Icc.mp hp rw [Finset.mem_range] omega · intro j _ _; exact hf _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sum_sizes_le_shifted_range · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:241
theorem marked_information_bound Lemma marked_information_bound in the paper ↗

Integrating MC32 and the labeled-root count series proves MC37 for the original records. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked information bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c c0 C : ℝ,
0 < c
c ≤ 1
0 < c0
0 < C
conclusion 1
n m :
ℕ
h delta a b :
ℝ
2 ≤ n
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
((n:ℝ)+m)*delta^d ≤ c0
hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m)
≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d*a^2*b^2
Proof (Lean source)
lemma marked_information_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c c0 C : ℝ, 0 < c ∧ c ≤ 1 ∧ 0 < c0 ∧ 0 < C ∧ ∀ (n m : ℕ) (h delta a b : ℝ), 2 ≤ n → 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ((n:ℝ)+m)*delta^d ≤ c0 → hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m) ≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d*a^2*b^2 := by obtain ⟨c,K,hc,hc1,hK,hcond⟩ := marked_conditional_hellinger_count_bound d alpha beta gamma L eps hdom obtain ⟨c0,C,hc0,hC,hseries⟩ := labeled_component_series_bound d (9/2) (by norm_num) refine ⟨c,c0,K*C,hc,hc1,hc0,mul_pos hK hC,?_⟩ intro n m h delta a b hn hd hdh hh ha hac hb hbc hab hocc letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance let ν := Measure.pi (fun _ : Fin (n+m) => uniformLaw d) let μ := (Measure.pi (fun _ : Fin n => fairObserved)).prod (Measure.pi (fun _ : Fin m => bern (1/2))) let H := markedHandle d h delta a b let count := fun (p : ℕ) (x : Fin (n+m) → Cov d) => ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) have hci (p : ℕ) (hp : 2 ≤ p) : Integrable (count p) ν := labeled_record_count_integrable d n m h delta p hp have hsumI : Integrable (fun x => K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * count p x) ν := by apply Integrable.const_mul apply integrable_finsetSum intro p hp exact (hci p (Finset.mem_Icc.mp hp).1).const_mul _ have hhi : Integrable (fun x => hellingerSqDensity μ (mixedDensity H true x) (mixedDensity H false x)) ν := (marked_sqrt_difference_integrable d n m h delta a b).integral_prod_left have hx : ∀ᵐ x ∂ν, ∀ i, x i ∈ cube d := by apply ae_all_iff.mpr intro i have hi := measurePreserving_eval (fun _ : Fin (n+m) => uniformLaw d) i exact hi.quasiMeasurePreserving.ae (by unfold uniformLaw exact ae_restrict_mem (measurable_cube d)) have hbound : (∫ x, hellingerSqDensity μ (mixedDensity H true x) (mixedDensity H false x) ∂ν) ≤ K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * (∫ x, count p x ∂ν) := by calc _ ≤ ∫ x, K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * count p x ∂ν := by apply integral_mono_ae hhi hsumI filter_upwards [hx] with x hx exact hcond h delta a b hd hdh hh ha hac hb hbc hab n m x hx _ = _ := by rw [integral_const_mul, integral_finsetSum (f := fun p x => (9/2:ℝ)^p*(p:ℝ)^4 * count p x) (Icc 2 (n+m)) (fun p hp => (hci p (Finset.mem_Icc.mp hp).1).const_mul _)] simp only [integral_const_mul] rw [markedMixture_hellinger_eq_integral] change (∫ x, hellingerSqDensity μ (mixedDensity H true x) (mixedDensity H false x) ∂ν) ≤ _ calc _ ≤ K*a^2*b^2 * ∑ p ∈ Icc 2 (n+m), (9/2:ℝ)^p*(p:ℝ)^4 * (∫ x, count p x ∂ν) := hbound _ ≤ K*a^2*b^2 * ∑ j ∈ range (n+m), (9/2:ℝ)^(j+2)*((j+2:ℕ):ℝ)^4 * (∫ x, count (j+2) x ∂ν) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact sum_sizes_le_shifted_range (n+m) _ (fun p => by apply mul_nonneg (by positivity) apply integral_nonneg intro x exact Nat.cast_nonneg _) _ ≤ K*a^2*b^2 * (C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact hseries n m h delta (hd.trans_le hdh) hh hd hdh hocc _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_information_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/MixtureInformation.lean:268
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.NuisanceConverse 1 declarations Two-channel point-CATE annotation frontier: Lower/NuisanceConverse constructions and obligations.

Lower/NuisanceConverse

Two-channel point-CATE annotation frontier: Lower/NuisanceConverse constructions and obligations.

theorem nuisance_frontier_converse

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hS, the nuisance frontier converse conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hS :
alpha+beta < sCrit d gamma
∃ c : ℝ,
0 < c
conclusion 1
n m :
ℕ
2 ≤ n
(n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma
ofReal (c*(((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))))
≤ minimaxRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma nuisance_frontier_converse (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hS : alpha+beta < sCrit d gamma) : ∃ c : ℝ, 0 < c ∧ -- @realizes c(positive claim-local constant) ∀ (n m : ℕ), 2 ≤ n → (n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma → ofReal (c*(((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)))) ≤ minimaxRisk d alpha beta gamma L eps n m := by obtain ⟨kappa, hkappa, hpriors⟩ := nuisance_scaled_marked_priors d alpha beta gamma L eps hdom hS refine ⟨(3/4:ℝ)*kappa, by positivity, ?_⟩ intro n m hn hboundary obtain ⟨h, delta, a, b, hd, hdh, hh, ha, hb, hab, hMembers, hTargets, hhell⟩ := hpriors n m hn hboundary obtain ⟨Ψ, hΨ⟩ := marked_experiment_target_exists (by omega : 0 < n) hMembers have htest := marked_fuzzy_testing_minimax d n m alpha beta gamma L eps h delta a b ha hb hMembers hTargets Ψ hΨ hhell have hscale : (3/4:ℝ)*a*b = ((3/4:ℝ)*kappa)*(((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) := by calc _ = (3/4:ℝ)*(a*b) := by ring _ = _ := by rw [hab]; ring rw [hscale] at htest exact htest
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_frontier_converse · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceConverse.lean:28
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.NuisanceScales 9 declarations The prescribed bandwidth, cell side and nuisance amplitudes satisfy the geometric, occupancy and information identities in the converse roadmap.

Scales for the nuisance-frontier converse

The prescribed bandwidth, cell side and nuisance amplitudes satisfy the geometric, occupancy and information identities in the converse roadmap. These identities retain both sample channels and both nuisance amplitudes.

theorem nuisance_order_lt_gamma Lemma nuisance_order_lt_gamma in the paper ↗

Below the frontier cutoff, the sum of nuisance orders is below the effect order. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hS, the nuisance order lt gamma conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hS :
alpha+beta < sCrit d gamma
alpha+beta < gamma
Proof (Lean source)
lemma nuisance_order_lt_gamma (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hS : alpha+beta < sCrit d gamma) : alpha+beta < gamma := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity apply hS.trans dsimp [sCrit] apply (div_lt_iff₀ hA).mpr nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_order_lt_gamma · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:20
theorem nuisance_scales_admissible Lemma nuisance_scales_admissible in the paper ↗

The two lower-bound scales are positive, nested and in the localization domain. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hS, the specified input n, the specified input m, the specified input hn, the specified input ch, the specified input cd, the specified input hch, the specified input hch', the specified input hcd, the specified input hcd', the nuisance scales admissible conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hS :
alpha+beta < sCrit d gamma
n m :
ℕ
hn :
2 ≤ n
ch cd :
ℝ
hch :
0 < ch
hch' :
ch ≤ 1/2
hcd :
0 < cd
hcd' :
cd ≤ ch
h :
ch*((n:ℝ)*((n:ℝ)+m))^(-(1/bigDelta d alpha beta gamma))
delta :
cd*((n:ℝ)*((n:ℝ)+m))^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma)))
0 < delta
delta ≤ h
h ≤ 1/2
Proof (Lean source)
lemma nuisance_scales_admissible (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hS : alpha+beta < sCrit d gamma) (n m : ℕ) (hn : 2 ≤ n) (ch cd : ℝ) (hch : 0 < ch) (hch' : ch ≤ 1/2) (hcd : 0 < cd) (hcd' : cd ≤ ch) : let h := ch*((n:ℝ)*((n:ℝ)+m))^(-(1/bigDelta d alpha beta gamma)) let delta := cd*((n:ℝ)*((n:ℝ)+m))^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) 0 < delta ∧ delta ≤ h ∧ h ≤ 1/2 := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS0 : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hN1 : (1:ℝ) ≤ (n:ℝ)+m := hn1.trans (le_add_of_nonneg_right (Nat.cast_nonneg m)) have hx1 : (1:ℝ) ≤ (n:ℝ)*((n:ℝ)+m) := by nlinarith have hx : 0 < (n:ℝ)*((n:ℝ)+m) := zero_lt_one.trans_le hx1 have he : -(gamma/((alpha+beta)*bigDelta d alpha beta gamma)) ≤ -(1/bigDelta d alpha beta gamma) := by apply neg_le_neg apply (div_le_div_iff₀ hD (mul_pos hS0 hD)).mpr have hs := (nuisance_order_lt_gamma d alpha beta gamma L eps hdom hS).le nlinarith refine ⟨mul_pos hcd (Real.rpow_pos_of_pos hx _), ?_, ?_⟩ · exact mul_le_mul hcd' (Real.rpow_le_rpow_of_exponent_le hx1 he) (Real.rpow_pos_of_pos hx _).le hch.le · have hp : ((n:ℝ)*((n:ℝ)+m))^(-(1/bigDelta d alpha beta gamma)) ≤ 1 := by simpa using (Real.rpow_le_rpow_of_exponent_le hx1 (show -(1/bigDelta d alpha beta gamma) ≤ 0 from neg_nonpos.mpr (by positivity))) calc _ ≤ ch*1 := mul_le_mul_of_nonneg_left hp hch.le _ ≤ 1/2 := by simpa using hch'
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_scales_admissible · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:31
theorem nuisance_occupancy_identity Lemma nuisance_occupancy_identity in the paper ↗

The cell occupancy is the public constant times a power of the count-boundary ratio. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input N, the specified input cd, the specified input hn, the specified input hN, the specified input hcd, the nuisance occupancy identity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n N cd :
ℝ
hn :
0 < n
hN :
0 < N
hcd :
0 < cd
N*(cd*(n*N)^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^d
= cd^d*(N/n^qStar d alpha beta gamma)^(1/(1+qStar d alpha beta gamma))
Proof (Lean source)
lemma nuisance_occupancy_identity (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n N cd : ℝ) (hn : 0 < n) (hN : 0 < N) (hcd : 0 < cd) : N*(cd*(n*N)^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^d = cd^d*(N/n^qStar d alpha beta gamma)^(1/(1+qStar d alpha beta gamma)) := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity have hq : 0 ≤ qStar d alpha beta gamma := by dsimp [qStar]; positivity have hq1 : 0 < 1+qStar d alpha beta gamma := by positivity have he : gamma*(d:ℝ)/((alpha+beta)*bigDelta d alpha beta gamma) = qStar d alpha beta gamma/(1+qStar d alpha beta gamma) := by rw [(rate_exponent_identities d alpha beta gamma L eps hdom).2] dsimp [qStar] field_simp apply Real.log_injOn_pos (by change (0:ℝ) < _; positivity) (by change (0:ℝ) < _; positivity) simp only [← Real.rpow_natCast] rw [Real.log_mul hN.ne' (by positivity), Real.log_rpow (by positivity), Real.log_mul hcd.ne' (by positivity), Real.log_rpow (mul_pos hn hN), Real.log_mul hn.ne' hN.ne', Real.log_mul (by positivity) (by positivity), Real.log_rpow hcd, Real.log_rpow (by positivity), Real.log_div hN.ne' (by positivity), Real.log_rpow hn] have he' : (d:ℝ)*(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) = -(qStar d alpha beta gamma/(1+qStar d alpha beta gamma)) := by rw [← he]; ring rw [mul_add, ← mul_assoc, he'] field_simp ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_occupancy_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:63
theorem nuisance_occupancy_bound Lemma nuisance_occupancy_bound in the paper ↗

In the sparse range the cell occupancy never exceeds the public cell constant. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the specified input N, the specified input cd, the specified input hn, the specified input hN, the specified input hcd, the specified input hboundary, the nuisance occupancy bound conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n N cd :
ℝ
hn :
0 < n
hN :
0 < N
hcd :
0 < cd
hboundary :
N ≤ n^qStar d alpha beta gamma
N*(cd*(n*N)^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^d ≤ cd^d
Proof (Lean source)
lemma nuisance_occupancy_bound (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n N cd : ℝ) (hn : 0 < n) (hN : 0 < N) (hcd : 0 < cd) (hboundary : N ≤ n^qStar d alpha beta gamma) : N*(cd*(n*N)^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^d ≤ cd^d := by rw [nuisance_occupancy_identity d alpha beta gamma L eps hdom n N cd hn hN hcd] have hq : 0 ≤ qStar d alpha beta gamma := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 dsimp [qStar]; positivity have hr : N/n^qStar d alpha beta gamma ≤ 1 := (div_le_one (Real.rpow_pos_of_pos hn _)).mpr hboundary have hp : (N/n^qStar d alpha beta gamma)^(1/(1+qStar d alpha beta gamma)) ≤ 1 := by simpa using Real.rpow_le_rpow (by positivity) hr (show 0 ≤ 1/(1+qStar d alpha beta gamma) by positivity) simpa using mul_le_mul_of_nonneg_left hp (by positivity : 0 ≤ cd^d)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_occupancy_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:93
theorem nuisance_amplitude_product Lemma nuisance_amplitude_product in the paper ↗

The product of the two prescribed amplitudes has exactly the converse rate. Given the specified input alpha, the specified input beta, the specified input gamma, the specified input D, the specified input x, the specified input cd, the specified input rho, the specified input hS, the specified input hD, the specified input hx, the specified input hcd, the nuisance amplitude product conclusion holds.

Formal statement
alpha beta gamma D x cd rho :
ℝ
hS :
0 < alpha+beta
hD :
0 < D
hx :
0 < x
hcd :
0 < cd
(rho*(cd*x^(-(gamma/((alpha+beta)*D))))^alpha)* (rho*(cd*x^(-(gamma/((alpha+beta)*D))))^beta)
= rho^2*cd^(alpha+beta)*x^(-(gamma/D))
Proof (Lean source)
lemma nuisance_amplitude_product (alpha beta gamma D x cd rho : ℝ) (hS : 0 < alpha+beta) (hD : 0 < D) (hx : 0 < x) (hcd : 0 < cd) : (rho*(cd*x^(-(gamma/((alpha+beta)*D))))^alpha)* (rho*(cd*x^(-(gamma/((alpha+beta)*D))))^beta) = rho^2*cd^(alpha+beta)*x^(-(gamma/D)) := by rw [mul_mul_mul_comm, ← pow_two, ← Real.rpow_add (by positivity), Real.mul_rpow hcd.le (Real.rpow_pos_of_pos hx _).le, ← Real.rpow_mul hx.le] have he : -(gamma/((alpha+beta)*D))*(alpha+beta) = -(gamma/D) := by field_simp rw [he] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_amplitude_product · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:111
theorem nuisance_information_monomial Lemma nuisance_information_monomial in the paper ↗

Both channels and both nuisance orders cancel in the information monomial. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input x, the specified input ch, the specified input cd, the specified input hx, the specified input hch, the specified input hcd, the nuisance information monomial conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
x ch cd :
ℝ
hx :
0 < x
hch :
0 < ch
hcd :
0 < cd
x*(ch*x^(-(1/bigDelta d alpha beta gamma)))^d* (cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^((d:ℝ)+2*(alpha+beta))
= ch^d*cd^((d:ℝ)+2*(alpha+beta))
Proof (Lean source)
lemma nuisance_information_monomial (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (x ch cd : ℝ) (hx : 0 < x) (hch : 0 < ch) (hcd : 0 < cd) : x*(ch*x^(-(1/bigDelta d alpha beta gamma)))^d* (cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))))^((d:ℝ)+2*(alpha+beta)) = ch^d*cd^((d:ℝ)+2*(alpha+beta)) := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity apply Real.log_injOn_pos (by change (0:ℝ) < _; positivity) (by change (0:ℝ) < _; positivity) simp only [← Real.rpow_natCast] rw [Real.log_mul (by positivity) (by positivity), Real.log_mul hx.ne' (by positivity), Real.log_rpow (by positivity), Real.log_mul hch.ne' (by positivity), Real.log_rpow hx, Real.log_rpow (by positivity), Real.log_mul hcd.ne' (by positivity), Real.log_rpow hx, Real.log_mul (by positivity) (by positivity), Real.log_rpow hch, Real.log_rpow hcd] have he : 1+(d:ℝ)*(-(1/bigDelta d alpha beta gamma))+ ((d:ℝ)+2*(alpha+beta))*(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) = 0 := by dsimp [bigDelta] field_simp ring linear_combination (log x)*he
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_information_monomial · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:124
theorem nuisance_bandwidth_bias_identity Lemma nuisance_bandwidth_bias_identity in the paper ↗

Raising the bandwidth to the effect order gives exactly its prescribed power. Given the specified input gamma, the specified input D, the specified input x, the specified input ch, the specified input hx, the specified input hch, the nuisance bandwidth bias identity conclusion holds.

Formal statement
gamma D x ch :
ℝ
hx :
0 < x
hch :
0 < ch
(ch*x^(-(1/D)))^gamma = ch^gamma*x^(-(gamma/D))
Proof (Lean source)
lemma nuisance_bandwidth_bias_identity (gamma D x ch : ℝ) (hx : 0 < x) (hch : 0 < ch) : (ch*x^(-(1/D)))^gamma = ch^gamma*x^(-(gamma/D)) := by rw [Real.mul_rpow hch.le (Real.rpow_pos_of_pos hx _).le, ← Real.rpow_mul hx.le] congr 2 ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_bandwidth_bias_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:148
theorem nuisance_scaled_information_identity Lemma nuisance_scaled_information_identity in the paper ↗

The actual rectangular information term equals the constant monomial after scaling. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input x, the specified input ch, the specified input cd, the specified input rho, the specified input hx, the specified input hch, the specified input hcd, the nuisance scaled information identity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
x ch cd rho :
ℝ
hx :
0 < x
hch :
0 < ch
hcd :
0 < cd
h :
ch*x^(-(1/bigDelta d alpha beta gamma))
delta :
cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma)))
x*h^d*delta^d*(rho*delta^alpha)^2*(rho*delta^beta)^2
= rho^4*ch^d*cd^((d:ℝ)+2*(alpha+beta))
Proof (Lean source)
lemma nuisance_scaled_information_identity (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (x ch cd rho : ℝ) (hx : 0 < x) (hch : 0 < ch) (hcd : 0 < cd) : let h := ch*x^(-(1/bigDelta d alpha beta gamma)) let delta := cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) x*h^d*delta^d*(rho*delta^alpha)^2*(rho*delta^beta)^2 = rho^4*ch^d*cd^((d:ℝ)+2*(alpha+beta)) := by dsimp only let delta := cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) have hd : 0 < delta := by dsimp [delta]; positivity have he : delta^d*(rho*delta^alpha)^2*(rho*delta^beta)^2 = rho^4*delta^((d:ℝ)+2*(alpha+beta)) := by rw [Real.rpow_add hd, Real.rpow_natCast, show 2*(alpha+beta) = (alpha+beta)*2 by ring, Real.rpow_mul hd.le, Real.rpow_two, Real.rpow_add hd] ring calc _ = rho^4*(x*(ch*x^(-(1/bigDelta d alpha beta gamma)))^d* delta^((d:ℝ)+2*(alpha+beta))) := by calc _ = x*(ch*x^(-(1/bigDelta d alpha beta gamma)))^d* (delta^d*(rho*delta^alpha)^2*(rho*delta^beta)^2) := by ring _ = _ := by rw [he]; ring _ = _ := by rw [nuisance_information_monomial d alpha beta gamma L eps hdom x ch cd hx hch hcd]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_scaled_information_identity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:156
theorem nuisance_scaled_marked_priors Lemma nuisance_scaled_marked_priors in the paper ↗

A single choice of public constants gives admissible marked priors with the converse-rate separation and small Hellinger distance throughout the sparse range. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hS, the nuisance scaled marked priors conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hS :
alpha+beta < sCrit d gamma
∃ kappa : ℝ,
0 < kappa
conclusion 1
n m :
ℕ
2 ≤ n
(n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma
∃ h delta a b : ℝ,
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
0 < b
a*b = kappa*((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))
∃ hMembers : ∀ theta sigma,
PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma), (∀ sigma, tau ((markedHandle d h delta a b).law false sigma) (hMembers false sigma) (x0 d) = 2*a*b ∧ tau ((markedHandle d h delta a b).law true sigma) (hMembers true sigma) (x0 d) = -2*a*b)
hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m)
≤ 1/16
Proof (Lean source)
lemma nuisance_scaled_marked_priors (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hS : alpha+beta < sCrit d gamma) : ∃ kappa : ℝ, 0 < kappa ∧ ∀ (n m : ℕ), 2 ≤ n → (n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma → ∃ h delta a b : ℝ, 0 < delta ∧ delta ≤ h ∧ h ≤ 1/2 ∧ 0 < a ∧ 0 < b ∧ a*b = kappa*((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) ∧ ∃ hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma), (∀ sigma, tau ((markedHandle d h delta a b).law false sigma) (hMembers false sigma) (x0 d) = 2*a*b ∧ tau ((markedHandle d h delta a b).law true sigma) (hMembers true sigma) (x0 d) = -2*a*b) ∧ hellingerSq (markedMixture (markedHandle d h delta a b) true n m) (markedMixture (markedHandle d h delta a b) false n m) ≤ 1/16 := by obtain ⟨c, c0, C, hc, hc1, hc0, hC, hcert⟩ := marked_component_certificate d alpha beta gamma L eps hdom have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS0 : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity let ch : ℝ := 1/4 let cd : ℝ := min ch c0 let rho : ℝ := min c (min 1 (min (c*ch^gamma) (1/(16*C)))) have hch : 0 < ch := by norm_num [ch] have hch1 : ch ≤ 1 := by norm_num [ch] have hchhalf : ch ≤ 1/2 := by norm_num [ch] have hcd : 0 < cd := lt_min hch hc0 have hcdch : cd ≤ ch := min_le_left _ _ have hcd1 : cd ≤ 1 := hcdch.trans hch1 have hcdc0 : cd ≤ c0 := min_le_right _ _ have hrho : 0 < rho := by dsimp [rho]; positivity have hrhoc : rho ≤ c := min_le_left _ _ have hrho1 : rho ≤ 1 := (min_le_right _ _).trans (min_le_left _ _) have hrhob : rho ≤ c*ch^gamma := ((min_le_right _ _).trans (min_le_right _ _)).trans (min_le_left _ _) have hrhoC : rho ≤ 1/(16*C) := ((min_le_right _ _).trans (min_le_right _ _)).trans (min_le_right _ _) have hrho2 : rho^2 ≤ rho := by nlinarith have hrho4 : rho^4 ≤ rho := by rw [← Real.rpow_natCast rho 4] simpa using Real.rpow_le_rpow_of_exponent_ge hrho hrho1 (by norm_num : (1:ℝ) ≤ (4:ℝ)) have hcdpow : cd^d ≤ c0 := by have hd1 : (1:ℝ) ≤ d := by exact_mod_cast hdom.1 have hp := Real.rpow_le_rpow_of_exponent_ge hcd hcd1 hd1 have hp' : cd^d ≤ cd := by simpa only [Real.rpow_natCast, Real.rpow_one] using hp exact hp'.trans hcdc0 have hcdS : cd^(alpha+beta) ≤ 1 := Real.rpow_le_one hcd.le hcd1 hS0.le have hchd : ch^d ≤ 1 := by exact_mod_cast (pow_le_one₀ hch.le hch1) have hcdinfo : cd^((d:ℝ)+2*(alpha+beta)) ≤ 1 := Real.rpow_le_one hcd.le hcd1 (by positivity) have hconstant : C*(rho^4*ch^d*cd^((d:ℝ)+2*(alpha+beta))) ≤ 1/16 := by calc _ ≤ C*rho := by gcongr calc rho^4*ch^d*cd^((d:ℝ)+2*(alpha+beta)) ≤ rho^4*1*1 := by gcongr _ ≤ rho := by simpa using hrho4 _ ≤ C*(1/(16*C)) := mul_le_mul_of_nonneg_left hrhoC hC.le _ = 1/16 := by field_simp refine ⟨rho^2*cd^(alpha+beta), by positivity, ?_⟩ intro n m hn hboundary let x : ℝ := (n:ℝ)*((n:ℝ)+m) have hnpos : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hNpos : (0:ℝ) < (n:ℝ)+m := by positivity have hx : 0 < x := mul_pos hnpos hNpos let h := ch*x^(-(1/bigDelta d alpha beta gamma)) let delta := cd*x^(-(gamma/((alpha+beta)*bigDelta d alpha beta gamma))) let a := rho*delta^alpha let b := rho*delta^beta have hs := nuisance_scales_admissible d alpha beta gamma L eps hdom hS n m hn ch cd hch hchhalf hcd hcdch have hd : 0 < delta := hs.1 have ha : 0 < a := mul_pos hrho (Real.rpow_pos_of_pos hd _) have hb : 0 < b := mul_pos hrho (Real.rpow_pos_of_pos hd _) have hprod : a*b = rho^2*cd^(alpha+beta)*x^(-(gamma/bigDelta d alpha beta gamma)) := nuisance_amplitude_product alpha beta gamma _ x cd rho hS0 hD hx hcd have hab : a*b ≤ c*h^gamma := by rw [hprod, nuisance_bandwidth_bias_identity gamma _ x ch hx hch] calc _ ≤ (rho*1)*x^(-(gamma/bigDelta d alpha beta gamma)) := by gcongr _ ≤ (c*ch^gamma)*x^(-(gamma/bigDelta d alpha beta gamma)) := mul_le_mul_of_nonneg_right (by simpa using hrhob) (Real.rpow_pos_of_pos hx _).le _ = _ := by ring have hocc : ((n:ℝ)+m)*delta^d ≤ c0 := (nuisance_occupancy_bound d alpha beta gamma L eps hdom (n:ℝ) ((n:ℝ)+m) cd hnpos hNpos hcd hboundary).trans hcdpow have hac : a ≤ c*delta^alpha := mul_le_mul_of_nonneg_right hrhoc (by positivity) have hbc : b ≤ c*delta^beta := mul_le_mul_of_nonneg_right hrhoc (by positivity) rcases hcert n m h delta a b hn hd hs.2.1 hs.2.2 ha hac hb hbc hab hocc with ⟨_, ⟨hMembers, hcontrast, _⟩, htarget, _, hhell, _⟩ refine ⟨h, delta, a, b, hd, hs.2.1, hs.2.2, ha, hb, hprod, hMembers, ?_, ?_⟩ · intro sigma constructor · rw [hcontrast false sigma _ (by intro i; norm_num [x0, cube]), htarget false] norm_num [thetaSign] · rw [hcontrast true sigma _ (by intro i; norm_num [x0, cube]), htarget true] norm_num [thetaSign] · apply hhell.trans rw [show C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d*a^2*b^2 = C*(x*h^d*delta^d*a^2*b^2) by dsimp [x]; ring] rw [nuisance_scaled_information_identity d alpha beta gamma L eps hdom x ch cd rho hx hch hcd] exact hconstant
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nuisance_scaled_marked_priors · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/NuisanceScales.lean:182
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.OracleBlockInformation 8 declarations The explicit constant-nuisance bump alternatives have a common auxiliary law.

# Oracle bandwidth and full-block information The explicit constant-nuisance bump alternatives have a common auxiliary law. Their labeled information tensorizes, and the oracle bandwidth cancels the sample size in the resulting Hellinger bound.

theorem oracle_bandwidth_identities Lemma oracle_bandwidth_identities in the paper ↗

The oracle bandwidth is positive, lies below one, and has the prescribed bias and information scaling. Given the specified input d, the specified input n, the specified input gamma, the specified input hg, the specified input hn, the oracle bandwidth identities conclusion holds.

Formal statement
d n :
ℕ
gamma :
ℝ
hg :
0 < gamma
hn :
2 ≤ n
H :
(n:ℝ)^(-(1/(2*gamma+d)))
0 < H
H ≤ 1
H^gamma = oracleRate d gamma n
(n:ℝ)*(oracleRate d gamma n)^2*H^d = 1
Proof (Lean source)
lemma oracle_bandwidth_identities (d n : ℕ) (gamma : ℝ) (hg : 0 < gamma) (hn : 2 ≤ n) : let H := (n:ℝ)^(-(1/(2*gamma+d))) 0 < H ∧ H ≤ 1 ∧ H^gamma = oracleRate d gamma n ∧ (n:ℝ)*(oracleRate d gamma n)^2*H^d = 1 := by dsimp only have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hden : 0 < 2*gamma+(d:ℝ) := by positivity refine ⟨Real.rpow_pos_of_pos hn0 _, Real.rpow_le_one_of_one_le_of_nonpos hn1 (neg_nonpos.mpr (one_div_nonneg.mpr hden.le)), ?_, ?_⟩ · unfold oracleRate rw [← Real.rpow_mul hn0.le] congr 1 ring · unfold oracleRate rw [← Real.rpow_natCast, ← Real.rpow_mul hn0.le, ← Real.rpow_natCast, ← Real.rpow_mul hn0.le] conv_lhs => lhs; lhs; rw [← Real.rpow_one (n:ℝ)] rw [← Real.rpow_add hn0, ← Real.rpow_add hn0] have hexp : (1 + -(gamma/(2*gamma+d))*2) + -(1/(2*gamma+d))*(d:ℝ) = 0 := by field_simp <;> ring norm_num only [Nat.cast_ofNat] at ⊢ rw [hexp, Real.rpow_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bandwidth_identities · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:20
theorem oracle_bump_common_auxiliary Lemma oracle_bump_common_auxiliary in the paper ↗

Both signs of the oracle bump produce exactly the same treatment records. Given the specified input d, the specified input h, the specified input b, the specified input hb, the specified input hbs, the oracle bump common auxiliary conclusion holds.

Formal statement
d :
ℕ
h b :
ℝ
hb :
0 ≤ b
hbs :
b ≤ 1/8
Proof (Lean source)
lemma oracle_bump_common_auxiliary (d : ℕ) (h b : ℝ) (hb : 0 ≤ b) (hbs : b ≤ 1/8) : xaLaw (oracleBumpPrimitive d h b false) = xaLaw (oracleBumpPrimitive d h b true) := by have he0 := (oracleBumpPrimitive_margins d h b false hb hbs).1 have he1 := (oracleBumpPrimitive_margins d h b true hb hbs).1 have hu (theta : Bool) : UniformDesign (oracleBumpPrimitive d h b theta) := independentFullLaw_covariates d _ _ _ measurable_const measurable_const (by fun_prop) unfold xaLaw rw [(oracleBumpPrimitive d h b false).margin_e, (oracleBumpPrimitive d h b true).margin_e, hu false, hu true] congr 1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_common_auxiliary · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:48
theorem oracle_experiment_hellinger_le Lemma oracle_experiment_hellinger_le in the paper ↗

A common auxiliary channel and randomizer contribute no information to a pair of primitive laws; only the labeled-record product remains. Given the specified input d, the specified input P, the specified input Q, the specified input n, the specified input m, the specified input haux, the oracle experiment hellinger le conclusion holds.

Formal statement
d :
ℕ
P Q :
n m :
ℕ
haux :
xaLaw P = xaLaw Q
≤ (n:ℝ)*hellingerSq (obsLaw P) (obsLaw Q)
Proof (Lean source)
lemma oracle_experiment_hellinger_le {d : ℕ} (P Q : PrimitiveLaw d) (n m : ℕ) (haux : xaLaw P = xaLaw Q) : hellingerSq (experiment P n m) (experiment Q n m) ≤ (n:ℝ)*hellingerSq (obsLaw P) (obsLaw Q) := by letI := obsLaw_probability P letI := obsLaw_probability Q letI := xaLaw_probability P letI := population_randomizer_probability unfold experiment rw [← haux, hellingerSq_prod_probability, hellingerSq_prod_probability] simpa using hellingerSq_pi_le_sum (fun _ : Fin n => obsLaw P) (fun _ : Fin n => obsLaw Q)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_experiment_hellinger_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:61
theorem oracle_bump_block_hellinger Lemma oracle_bump_block_hellinger in the paper ↗

The full randomized oracle bump experiment has the paper's fixed-size information bound, uniformly in the auxiliary sample size. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input b, the specified input hh, the specified input hh1, the specified input hb, the specified input hbs, the oracle bump block hellinger conclusion holds.

Formal statement
d n m :
ℕ
h b :
ℝ
hh :
0 < h
hh1 :
h ≤ 1
hb :
0 ≤ b
hbs :
b ≤ 1/8
≤ 16*(n:ℝ)*b^2*h^d
Proof (Lean source)
lemma oracle_bump_block_hellinger (d n m : ℕ) (h b : ℝ) (hh : 0 < h) (hh1 : h ≤ 1) (hb : 0 ≤ b) (hbs : b ≤ 1/8) : hellingerSq (experiment (oracleBumpPrimitive d h b false) n m) (experiment (oracleBumpPrimitive d h b true) n m) ≤ 16*(n:ℝ)*b^2*h^d := by calc _ ≤ (n:ℝ)*hellingerSq (obsLaw (oracleBumpPrimitive d h b false)) (obsLaw (oracleBumpPrimitive d h b true)) := oracle_experiment_hellinger_le _ _ n m (oracle_bump_common_auxiliary d h b hb hbs) _ ≤ (n:ℝ)*(16*b^2*h^d) := mul_le_mul_of_nonneg_left (oracle_bump_hellinger_bound d h b hh hh1 hb hbs) (Nat.cast_nonneg n) _ = _ := by ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_block_hellinger · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:76
theorem oracle_bump_information_at_rate Lemma oracle_bump_information_at_rate in the paper ↗

At the oracle bandwidth, the full-block information is bounded by sixteen times the squared public bump amplitude. Given the specified input d, the specified input n, the specified input m, the specified input gamma, the specified input eta, the specified input hg, the specified input hn, the specified input heta, the specified input hetas, the oracle bump information at rate conclusion holds.

Formal statement
d n m :
ℕ
gamma eta :
ℝ
hg :
0 < gamma
hn :
2 ≤ n
heta :
0 ≤ eta
hetas :
eta ≤ 1/8
H :
(n:ℝ)^(-(1/(2*gamma+d)))
b :
eta*oracleRate d gamma n
Proof (Lean source)
lemma oracle_bump_information_at_rate (d n m : ℕ) (gamma eta : ℝ) (hg : 0 < gamma) (hn : 2 ≤ n) (heta : 0 ≤ eta) (hetas : eta ≤ 1/8) : let H := (n:ℝ)^(-(1/(2*gamma+d))) let b := eta*oracleRate d gamma n hellingerSq (experiment (oracleBumpPrimitive d H b false) n m) (experiment (oracleBumpPrimitive d H b true) n m) ≤ 16*eta^2 := by dsimp only obtain ⟨hH, hH1, hrate, hinfo⟩ := oracle_bandwidth_identities d n gamma hg hn have hr0 : 0 ≤ oracleRate d gamma n := by unfold oracleRate; positivity have hr1 : oracleRate d gamma n ≤ 1 := by rw [← hrate] exact Real.rpow_le_one hH.le hH1 hg.le have hb0 : 0 ≤ eta*oracleRate d gamma n := mul_nonneg heta hr0 have hb1 : eta*oracleRate d gamma n ≤ 1/8 := (mul_le_mul_of_nonneg_left hr1 heta).trans (by simpa using hetas) apply (oracle_bump_block_hellinger d n m _ _ hH hH1 hb0 hb1).trans_eq calc _ = 16*eta^2*((n:ℝ)*(oracleRate d gamma n)^2* ((n:ℝ)^(-(1/(2*gamma+d))))^d) := by ring _ = 16*eta^2 := by rw [hinfo, mul_one]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_information_at_rate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:91
theorem oracle_bump_testing_family Lemma oracle_bump_testing_family in the paper ↗

A single public amplitude makes the explicit bump laws admissible for every sample size and leaves the full experiment inside the testing budget. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle bump testing family conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ eta : ℝ,
0 < eta
eta ≤ 1/16
conclusion 1
n :
ℕ
2 ≤ n
H :
(n:ℝ)^(-(1/(2*gamma+d)))
bn :
eta*oracleRate d gamma n
theta :
∃ hP : PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d H bn theta),
∀ x ∈ cube d,
designatedPropensity _ hP x = 1/2 ∧
designatedControl _ hP x = 1/2 ∧
tau _ hP x = thetaSign theta*bn*macroBump H x
Proof (Lean source)
lemma oracle_bump_testing_family (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ eta : ℝ, 0 < eta ∧ eta ≤ 1/16 ∧ ∀ (n : ℕ), 2 ≤ n → let H := (n:ℝ)^(-(1/(2*gamma+d))) let bn := eta*oracleRate d gamma n (∀ theta, ∃ hP : PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d H bn theta), ∀ x ∈ cube d, designatedPropensity _ hP x = 1/2 ∧ designatedControl _ hP x = 1/2 ∧ tau _ hP x = thetaSign theta*bn*macroBump H x) ∧ (∀ m, hellingerSq (experiment (oracleBumpPrimitive d H bn false) n m) (experiment (oracleBumpPrimitive d H bn true) n m) ≤ 1/16) := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hL : 1/2 ≤ L := hdom.2.2.2.2.2.2.2.1.le have heps : 0 < eps := hdom.2.2.2.2.2.2.2.2.1 have heps' : eps ≤ 1/2 := hdom.2.2.2.2.2.2.2.2.2.le obtain ⟨D, hD, hprofile⟩ := oracle_macro_holder d gamma hg let eta := (128*(D+1))⁻¹ have heta : 0 < eta := by dsimp [eta]; positivity have hetaD : eta*(D+1) = 1/128 := by dsimp [eta]; field_simp have hetasmall : eta ≤ 1/8 := by nlinarith have hDeta : eta*D ≤ L := by nlinarith have hetatest : eta ≤ 1/16 := by nlinarith refine ⟨eta, heta, hetatest, ?_⟩ intro n hn let H : ℝ := (n:ℝ)^(-(1/(2*gamma+d))) let bn : ℝ := eta*oracleRate d gamma n have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hden : 0 < 2*gamma+(d:ℝ) := by positivity have hH : 0 < H := Real.rpow_pos_of_pos hn0 _ have hH1 : H ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hn1 (neg_nonpos.mpr (one_div_nonneg.mpr hden.le)) have hrate : H^gamma = oracleRate d gamma n := by dsimp only [H, oracleRate] rw [← Real.rpow_mul hn0.le] congr 1 ring have hbn : 0 < bn := by dsimp [bn, oracleRate]; positivity have hbsmall : bn ≤ 1/8 := by dsimp only [bn] rw [← hrate] exact (mul_le_mul_of_nonneg_left (Real.rpow_le_one hH.le hH1 hg.le) heta.le).trans (by simpa using hetasmall) have hsmooth : holderNorm (fun x : Cov d => bn*macroBump H x) gamma ≤ ofReal L := by have hs := holderNorm_const_mul_bound (macroBump (d:=d) H) gamma (D*H^(-gamma)) bn (by positivity) (hprofile H hH hH1) rw [abs_of_pos hbn] at hs have hid : bn*(D*H^(-gamma)) = eta*D := by dsimp only [bn] rw [← hrate] calc eta*H^gamma*(D*H^(-gamma)) = eta*D*(H^gamma*H^(-gamma)) := by ring _ = eta*D := by rw [← Real.rpow_add hH, add_neg_cancel, Real.rpow_zero, mul_one] rw [hid] at hs exact hs.trans (ENNReal.ofReal_le_ofReal hDeta) constructor · intro theta exact oracleBumpPrimitive_membership d alpha beta gamma L eps H bn hL heps heps' hbn.le hbsmall hsmooth theta · intro m apply (oracle_bump_information_at_rate d n m gamma eta hg hn heta.le hetasmall).trans have hsq : eta^2 ≤ (1/16:ℝ)^2 := pow_le_pow_left₀ heta.le hetatest 2 nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_testing_family · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:114
theorem oracle_bump_target_eq_of_experiment Lemma oracle_bump_target_eq_of_experiment in the paper ↗

The target of an oracle bump is identified by its full experiment law. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input b, the specified input hn, the specified input hMembers, the specified input theta, the specified input theta', the specified input hE, the oracle bump target eq of experiment conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h b :
ℝ
hn :
0 < n
hMembers :
∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)
theta theta' :
hE :
= experiment (oracleBumpPrimitive d h b theta') n m
tau _ (hMembers theta) (x0 d) = tau _ (hMembers theta') (x0 d)
Proof (Lean source)
lemma oracle_bump_target_eq_of_experiment {d n m : ℕ} {alpha beta gamma L eps h b : ℝ} (hn : 0 < n) (hMembers : ∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)) (theta theta' : Bool) (hE : experiment (oracleBumpPrimitive d h b theta) n m = experiment (oracleBumpPrimitive d h b theta') n m) : tau _ (hMembers theta) (x0 d) = tau _ (hMembers theta') (x0 d) := by have ho := congrArg (fun μ : Measure (Sample d n m) => μ.map (fun w => w.1.1 (⟨0, hn⟩ : Fin n))) hE rw [experiment_map_labeled, experiment_map_labeled] at ho have hl := independent_fullLaw_eq_of_obsLaw _ _ _ _ _ _ measurable_const measurable_const (by fun_prop) measurable_const measurable_const (by fun_prop) (hMembers theta) ho have hu := admissible_versions_unique _ _ (hMembers theta) (hMembers theta') hl exact (hu (x0 d) (by intro i; norm_num [x0, cube])).2.2.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_target_eq_of_experiment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:180
theorem oracle_bump_experiment_target_exists Lemma oracle_bump_experiment_target_exists in the paper ↗

The two oracle targets extend to a functional of the full-block law, as required by the cited testing theorem. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input b, the specified input hn, the specified input hMembers, the oracle bump experiment target exists conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h b :
ℝ
hn :
0 < n
hMembers :
∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)
∃ Ψ : Measure (Sample d n m) → ℝ,
∀ theta,
Ψ (experiment (oracleBumpPrimitive d h b theta) n m) = tau _ (hMembers theta) (x0 d)
Proof (Lean source)
lemma oracle_bump_experiment_target_exists {d n m : ℕ} {alpha beta gamma L eps h b : ℝ} (hn : 0 < n) (hMembers : ∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)) : ∃ Ψ : Measure (Sample d n m) → ℝ, ∀ theta, Ψ (experiment (oracleBumpPrimitive d h b theta) n m) = tau _ (hMembers theta) (x0 d) := by exact exists_function_on_image (fun theta => experiment (oracleBumpPrimitive d h b theta) n m) (fun theta => tau _ (hMembers theta) (x0 d)) (fun theta theta' hE => oracle_bump_target_eq_of_experiment hn hMembers theta theta' hE)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_experiment_target_exists · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBlockInformation.lean:197
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.OracleBump 5 declarations The oracle lower-bound roadmap uses a fixed smooth compact profile, with a constant control mean and independent Bernoulli potential outcomes.

# Constant-propensity bump alternatives The oracle lower-bound roadmap uses a fixed smooth compact profile, with a constant control mean and independent Bernoulli potential outcomes.

The unsquared macro bump has the exact scaled Hölder bound on windows up to side one. Given the specified input d, the specified input s, the specified input hs, the oracle macro holder conclusion holds.

Formal statement
d :
ℕ
s :
ℝ
hs :
0 < s
∃ C : ℝ,
0 < C
conclusion 1
h :
0 < h
h ≤ 1
holderNorm (macroBump (d:=d) h) s ≤ ofReal (C*h^(-s))
Proof (Lean source)
lemma oracle_macro_holder (d : ℕ) (s : ℝ) (hs : 0 < s) : ∃ C : ℝ, 0 < C ∧ ∀ h, 0 < h → h ≤ 1 → holderNorm (macroBump (d:=d) h) s ≤ ofReal (C*h^(-s)) := by let f : Cov d → ℝ := fun z => macroBump 1 (z+x0 d) have hf : ContDiff ℝ ((⊤ : ℕ∞) : WithTop ℕ∞) f := by dsimp [f] fun_prop have hsupp : HasCompactSupport f := (macroBump_compactSupport d).comp_homeomorph (Homeomorph.addRight (x0 d)) obtain ⟨C, hC, hb⟩ := compact_profile_scaled_holder f hf hsupp s hs refine ⟨C, hC, ?_⟩ intro h hh hh1 simpa only [f, macroBump_dilation] using hb h hh hh1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_macro_holder · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBump.lean:18

The two oracle alternatives use treatment probability and control mean one half. Given the specified input d, the specified input h, the specified input b, the specified input theta, oracle bump primitive is the corresponding construction.

Definition (Lean source)
d :
ℕ
h b :
ℝ
theta :
oracleBumpPrimitive d h b theta :
independentPrimitive (fun _ => 1/2) (fun _ => 1/2) (fun x => 1/2+thetaSign theta*b*macroBump h x) measurable_const measurable_const (by fun_prop)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleBumpPrimitive · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBump.lean:33
theorem oracleBumpPrimitive_margins Lemma oracleBumpPrimitive_margins in the paper ↗

Small bump amplitudes keep all three raw margins in their prescribed probability bands. Given the specified input d, the specified input h, the specified input b, the specified input theta, the specified input hb, the specified input hbsmall, the oracle bump primitive margins conclusion holds.

Formal statement
d :
ℕ
h b :
ℝ
theta :
hb :
0 ≤ b
hbsmall :
b ≤ 1/8
conclusion 1
(oracleBumpPrimitive d h b theta).e = (fun _ => 1/2)
conclusion 2
(oracleBumpPrimitive d h b theta).mu0 = (fun _ => 1/2)
conclusion 3
(oracleBumpPrimitive d h b theta).mu1 = (fun x => 1/2+thetaSign theta*b*macroBump h x)
conclusion 4
x :
1/8 ≤ (oracleBumpPrimitive d h b theta).mu1 x
(oracleBumpPrimitive d h b theta).mu1 x ≤ 7/8
Proof (Lean source)
lemma oracleBumpPrimitive_margins (d : ℕ) (h b : ℝ) (theta : Bool) (hb : 0 ≤ b) (hbsmall : b ≤ 1/8) : (oracleBumpPrimitive d h b theta).e = (fun _ => 1/2) ∧ (oracleBumpPrimitive d h b theta).mu0 = (fun _ => 1/2) ∧ (oracleBumpPrimitive d h b theta).mu1 = (fun x => 1/2+thetaSign theta*b*macroBump h x) ∧ (∀ x, 1/8 ≤ (oracleBumpPrimitive d h b theta).mu1 x ∧ (oracleBumpPrimitive d h b theta).mu1 x ≤ 7/8) := by have hband (x : Cov d) : 1/8 ≤ 1/2+thetaSign theta*b*macroBump h x ∧ 1/2+thetaSign theta*b*macroBump h x ≤ 7/8 := by have hm := macroBump_mem h x cases theta <;> norm_num [thetaSign] <;> constructor <;> nlinarith [hm.1, hm.2] have he : (oracleBumpPrimitive d h b theta).e = (fun _ => 1/2) := by funext x exact probabilityClip_eq_of_mem _ (by norm_num) have h0 : (oracleBumpPrimitive d h b theta).mu0 = (fun _ => 1/2) := by funext x exact probabilityClip_eq_of_mem _ (by norm_num) have h1 : (oracleBumpPrimitive d h b theta).mu1 = (fun x => 1/2+thetaSign theta*b*macroBump h x) := by funext x apply probabilityClip_eq_of_mem constructor <;> linarith [(hband x).1, (hband x).2] exact ⟨he, h0, h1, fun x => h1 ▸ hband x⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleBumpPrimitive_margins · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBump.lean:39
theorem oracle_admissible_raw_versions Lemma oracle_admissible_raw_versions in the paper ↗

Canonical representatives coincide with admissible raw propensity and arm means. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hu, the specified input he, the specified input h0, the specified input ht, the specified input hov, the specified input hi0, the specified input hi1, the oracle admissible raw versions conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hu :
he :
h0 :
ControlHolder beta L P
ht :
EffectHolder gamma L P
hov :
Overlap eps P
hi0 :
hi1 :
x ∈ cube d :
conclusion 1
designatedPropensity P hP x = P.e x
conclusion 2
designatedControl P hP x = P.mu0 x
conclusion 3
tau P hP x = rawContrast P x
Proof (Lean source)
lemma oracle_admissible_raw_versions {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hu : UniformDesign P) (he : PropensityHolder alpha L P) (h0 : ControlHolder beta L P) (ht : EffectHolder gamma L P) (hov : Overlap eps P) (hi0 : ControlInterior P) (hi1 : TreatedInterior P) : ∀ x ∈ cube d, designatedPropensity P hP x = P.e x ∧ designatedControl P hP x = P.mu0 x ∧ tau P hP x = rawContrast P x := by let W := canonicalLaw P hP have hW := canonicalLaw_spec P hP have hWu : W.law.map fst = uniformLaw d := hW.2.1 letI : IsFiniteMeasure (uniformLaw d) := by rw [← hWu]; infer_instance letI := bernKernel_sfinite_of_margin W (fun w => w.2.1) (by fun_prop) W.e W.measurable_e W.margin_e letI := bernKernel_sfinite_of_margin P (fun w => w.2.1) (by fun_prop) P.e P.measurable_e P.margin_e letI := bernKernel_sfinite_of_margin W (fun w => w.2.2.1) (by fun_prop) W.mu0 W.measurable_mu0 W.margin_mu0 letI := bernKernel_sfinite_of_margin P (fun w => w.2.2.1) (by fun_prop) P.mu0 P.measurable_mu0 P.margin_mu0 have heq : EqOn W.e P.e (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_e P.measurable_e (holderNorm_continuousOn _ _ _ hW.2.2.2.2.1) (holderNorm_continuousOn _ _ _ he) · exact hW.2.2.2.1.unit · exact hov.unit · rw [← hWu, ← W.margin_e, hW.1, P.margin_e, hu] have h0eq : EqOn W.mu0 P.mu0 (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_mu0 P.measurable_mu0 (holderNorm_continuousOn _ _ _ hW.2.2.2.2.2.1) (holderNorm_continuousOn _ _ _ h0) · intro x hx; have hb := hW.2.2.2.2.2.2.2.1 x hx; constructor <;> linarith [hb.1, hb.2] · intro x hx; have hb := hi0 x hx; constructor <;> linarith [hb.1, hb.2] · rw [← hWu, ← W.margin_mu0, hW.1, P.margin_mu0, hu] intro x hx refine ⟨?_, ?_, tau_eq_rawContrast_of_admissible P hP hu h0 ht hi0 hi1 x hx⟩ · simpa only [designatedPropensity, if_pos hx] using heq hx · simpa only [designatedControl, if_pos hx] using h0eq hx
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_admissible_raw_versions · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBump.lean:65
theorem oracleBumpPrimitive_membership Lemma oracleBumpPrimitive_membership in the paper ↗

Smoothness and small amplitude make each explicit oracle alternative a member of the exact class. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input b, the specified input hL, the specified input hb, the specified input hbsmall, the specified input hsmooth, the specified input theta, the oracle bump primitive membership conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps h b :
ℝ
hL :
1/2 ≤ L
heps :
0 < eps
heps' :
eps ≤ 1/2
hb :
0 ≤ b
hbsmall :
b ≤ 1/8
hsmooth :
holderNorm (fun x : Cov d => b*macroBump h x) gamma ≤ ofReal L
theta :
∃ hP : PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta),
∀ x ∈ cube d,
designatedPropensity _ hP x = 1/2 ∧
designatedControl _ hP x = 1/2 ∧
tau _ hP x = thetaSign theta*b*macroBump h x
Proof (Lean source)
lemma oracleBumpPrimitive_membership (d : ℕ) (alpha beta gamma L eps h b : ℝ) (hL : 1/2 ≤ L) (heps : 0 < eps) (heps' : eps ≤ 1/2) (hb : 0 ≤ b) (hbsmall : b ≤ 1/8) (hsmooth : holderNorm (fun x : Cov d => b*macroBump h x) gamma ≤ ofReal L) (theta : Bool) : ∃ hP : PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta), ∀ x ∈ cube d, designatedPropensity _ hP x = 1/2 ∧ designatedControl _ hP x = 1/2 ∧ tau _ hP x = thetaSign theta*b*macroBump h x := by let P := oracleBumpPrimitive d h b theta obtain ⟨heq, h0eq, h1eq, hband⟩ := oracleBumpPrimitive_margins d h b theta hb hbsmall have hu : UniformDesign P := independentFullLaw_covariates d _ _ _ measurable_const measurable_const (by fun_prop) have hex : ConditionalExchangeability P := independentPrimitive_exchangeability _ _ _ measurable_const measurable_const (by fun_prop) have hov : Overlap eps P := by refine ⟨heps, fun x hx => ?_⟩ rw [show P.e = _ from heq] constructor <;> linarith have hi0 : ControlInterior P := by intro x hx; rw [show P.mu0 = _ from h0eq]; norm_num have hi1 : TreatedInterior P := fun x _ => ⟨by linarith [(hband x).1], by linarith [(hband x).2]⟩ have he : PropensityHolder alpha L P := by change holderNorm P.e alpha ≤ _ rw [show P.e = _ from heq] exact (holderNorm_const_bound (d:=d) (1/2) alpha).trans (ENNReal.ofReal_le_ofReal (by norm_num; linarith)) have h0 : ControlHolder beta L P := by change holderNorm P.mu0 beta ≤ _ rw [show P.mu0 = _ from h0eq] exact (holderNorm_const_bound (d:=d) (1/2) beta).trans (ENNReal.ofReal_le_ofReal (by norm_num; linarith)) have hcontrast : rawContrast P = (fun x => thetaSign theta*b*macroBump h x) := by funext x simp only [rawContrast, show P.mu1 = _ from h1eq, show P.mu0 = _ from h0eq] ring have ht : EffectHolder gamma L P := by change holderNorm (rawContrast P) gamma ≤ _ rw [hcontrast] cases theta · have ht := holderNorm_const_mul_bound (fun x : Cov d => b*macroBump h x) gamma L (-1) (by linarith) hsmooth simpa [thetaSign, mul_assoc] using ht · simpa [thetaSign] using hsmooth have hP : PrimitiveClass alpha beta gamma L eps P := ⟨P, rfl, hu, hex, hov, he, h0, ht, hi0, hi1⟩ refine ⟨hP, ?_⟩ intro x hx obtain ⟨hpe, hp0, hpt⟩ := oracle_admissible_raw_versions P hP hu he h0 ht hov hi0 hi1 x hx exact ⟨hpe.trans (congrFun heq x), hp0.trans (congrFun h0eq x), hpt.trans (congrFun hcontrast x)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleBumpPrimitive_membership · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBump.lean:104
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.OracleBumpInformation 6 declarations The treated outcome cells alone change.

# Information in the oracle bump alternatives The treated outcome cells alone change. Their densities stay bounded away from zero, and the bump's support has volume equal to its side raised to dimension.

Oracle bump likelihoods equal one in control cells and have a signed perturbation in treated cells. Given the specified input d, the specified input h, the specified input b, the specified input theta, the specified input hb, the specified input hbsmall, the specified input x, the specified input s, the oracle bump likelihood conclusion holds.

Formal statement
d :
ℕ
h b :
ℝ
theta :
hb :
0 ≤ b
hbsmall :
b ≤ 1/8
x :
Cov d
s :
= if s.1 then 1+2*thetaSign s.2*thetaSign theta*b*macroBump h x else 1
Proof (Lean source)
lemma oracle_bump_likelihood (d : ℕ) (h b : ℝ) (theta : Bool) (hb : 0 ≤ b) (hbsmall : b ≤ 1/8) (x : Cov d) (s : Bool × Bool) : labelLikelihood (oracleBumpPrimitive d h b theta) x s = if s.1 then 1+2*thetaSign s.2*thetaSign theta*b*macroBump h x else 1 := by obtain ⟨he, h0, h1, hband⟩ := oracleBumpPrimitive_margins d h b theta hb hbsmall have hm := macroBump_mem h x have hp : 0 ≤ 1/2+b*macroBump h x := by nlinarith [hm.1, hm.2] have hm' : 0 ≤ 1/2-b*macroBump h x := by nlinarith [hm.1, hm.2] rcases s with ⟨A,Y⟩ cases A <;> cases Y <;> cases theta <;> simp [labelLikelihood, he, h0, h1, bern, thetaSign] <;> norm_num only [ENNReal.toReal_ofReal, invOf_eq_inv, inv_nonneg, sub_nonneg, one_div] <;> rw [ENNReal.toReal_ofReal (by nlinarith only [hp, hm'])] <;> ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_likelihood · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:18
theorem oracle_bump_likelihood_bounds Lemma oracle_bump_likelihood_bounds in the paper ↗

Each oracle bump likelihood lies between one half and two. Given the specified input d, the specified input h, the specified input b, the specified input theta, the specified input hb, the specified input hbsmall, the specified input z, the oracle bump likelihood bounds conclusion holds.

Formal statement
d :
ℕ
h b :
ℝ
theta :
hb :
0 ≤ b
hbsmall :
b ≤ 1/8
z :
Cov d × (Bool × Bool)
conclusion 1
1/2 ≤ labelLikelihood (oracleBumpPrimitive d h b theta) z.1 z.2
conclusion 2
labelLikelihood (oracleBumpPrimitive d h b theta) z.1 z.2 ≤ 2
Proof (Lean source)
lemma oracle_bump_likelihood_bounds (d : ℕ) (h b : ℝ) (theta : Bool) (hb : 0 ≤ b) (hbsmall : b ≤ 1/8) (z : Cov d × (Bool × Bool)) : 1/2 ≤ labelLikelihood (oracleBumpPrimitive d h b theta) z.1 z.2 ∧ labelLikelihood (oracleBumpPrimitive d h b theta) z.1 z.2 ≤ 2 := by rw [oracle_bump_likelihood d h b theta hb hbsmall] have hm := macroBump_mem h z.1 rcases z with ⟨x,A,Y⟩ cases A <;> cases Y <;> cases theta <;> norm_num [thetaSign] <;> constructor <;> nlinarith [hm.1, hm.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_likelihood_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:33
theorem oracle_sqrt_difference_le Lemma oracle_sqrt_difference_le in the paper ↗

A density floor removes the square-root denominator in the elementary Hellinger identity. Given the specified input a, the specified input b, the specified input ha, the specified input hb, the oracle sqrt difference le conclusion holds.

Formal statement
a b :
ℝ
ha :
1/2 ≤ a
hb :
1/2 ≤ b
(sqrt a-sqrt b)^2 ≤ (a-b)^2
Proof (Lean source)
lemma oracle_sqrt_difference_le (a b : ℝ) (ha : 1/2 ≤ a) (hb : 1/2 ≤ b) : (sqrt a-sqrt b)^2 ≤ (a-b)^2 := by have ha0 : 0 ≤ a := by linarith have hb0 : 0 ≤ b := by linarith have hsa := Real.sq_sqrt ha0 have hsb := Real.sq_sqrt hb0 have hsum : 1 ≤ (sqrt a+sqrt b)^2 := by nlinarith [Real.sqrt_nonneg a, Real.sqrt_nonneg b] have hid : (a-b)^2 = (sqrt a-sqrt b)^2 * (sqrt a+sqrt b)^2 := by rw [show (sqrt a-sqrt b)^2 * (sqrt a+sqrt b)^2 = ((sqrt a)^2-(sqrt b)^2)^2 by ring, hsa, hsb] rw [hid] exact le_mul_of_one_le_right (sq_nonneg _) hsum
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_sqrt_difference_le · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:44

The centered localization box has its Euclidean product volume. Given the specified input d, the specified input h, the specified input hh, the oracle loc cube volume conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
volume (locCube d h) = ofReal (h^d)
Proof (Lean source)
lemma oracle_locCube_volume (d : ℕ) (h : ℝ) (hh : 0 < h) : volume (locCube d h) = ofReal (h^d) := by have heq : locCube d h = ofLp ⁻¹' pi univ (fun _ : Fin d => Icc (1/2-h/2) (1/2+h/2)) := by ext x simp only [locCube, mem_setOf_eq, mem_preimage, mem_pi, mem_univ, forall_const] rw [heq, (PiLp.volume_preserving_ofLp (Fin d)).measure_preimage ((MeasurableSet.univ_pi (fun _ : Fin d => measurableSet_Icc)).nullMeasurableSet), volume_pi_pi] simp only [Real.volume_Icc, show (1/2+h/2)-(1/2-h/2) = h by ring, Finset.prod_const, Finset.card_univ, Fintype.card_fin, ENNReal.ofReal_pow hh.le]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_locCube_volume · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:59
theorem oracle_bump_square_energy Lemma oracle_bump_square_energy in the paper ↗

Squared bump energy is at most its support volume under the uniform design. Given the specified input d, the specified input h, the specified input hh, the specified input hh1, the oracle bump square energy conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh1 :
h ≤ 1
(∫ x : Cov d, (macroBump h x)^2 ∂uniformLaw d) ≤ h^d
Proof (Lean source)
lemma oracle_bump_square_energy (d : ℕ) (h : ℝ) (hh : 0 < h) (hh1 : h ≤ 1) : (∫ x : Cov d, (macroBump h x)^2 ∂uniformLaw d) ≤ h^d := by letI := uniformLaw_probability d have hi : Integrable (fun x : Cov d => (macroBump h x)^2) (uniformLaw d) := by apply (integrable_const (1:ℝ)).mono' (by fun_prop) filter_upwards [] with x rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hm := macroBump_mem h x nlinarith [hm.1, hm.2] have hsub : locCube d h ⊆ cube d := by intro x hx i constructor <;> linarith [(hx i).1, (hx i).2] calc _ ≤ ∫ x : Cov d, (locCube d h).indicator (fun _ => (1:ℝ)) x ∂uniformLaw d := by apply integral_mono hi ((integrable_const (1:ℝ)).indicator (isClosed_locCube d h).measurableSet) intro x by_cases hx : x ∈ locCube d h · rw [indicator_of_mem hx] have hm := macroBump_mem h x nlinarith [hm.1, hm.2] · simp [indicator_of_notMem hx, macroBump_zero_outside h hh x hx] _ = h^d := by rw [integral_indicator (isClosed_locCube d h).measurableSet, integral_const] simp only [smul_eq_mul, mul_one, measureReal_def, Measure.restrict_apply_univ] rw [uniformLaw, Measure.restrict_apply (isClosed_locCube d h).measurableSet, inter_eq_left.mpr hsub, oracle_locCube_volume d h hh, ENNReal.toReal_ofReal (pow_nonneg hh.le _)]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_square_energy · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:72
theorem oracle_bump_hellinger_bound Lemma oracle_bump_hellinger_bound in the paper ↗

The one-record Hellinger cost of the two oracle alternatives is of bump-squared times volume order. Given the specified input d, the specified input h, the specified input b, the specified input hh, the specified input hh1, the specified input hb, the specified input hbsmall, the oracle bump hellinger bound conclusion holds.

Formal statement
d :
ℕ
h b :
ℝ
hh :
0 < h
hh1 :
h ≤ 1
hb :
0 ≤ b
hbsmall :
b ≤ 1/8
≤ 16*b^2*h^d
Proof (Lean source)
lemma oracle_bump_hellinger_bound (d : ℕ) (h b : ℝ) (hh : 0 < h) (hh1 : h ≤ 1) (hb : 0 ≤ b) (hbsmall : b ≤ 1/8) : hellingerSq (obsLaw (oracleBumpPrimitive d h b false)) (obsLaw (oracleBumpPrimitive d h b true)) ≤ 16*b^2*h^d := by let P0 := oracleBumpPrimitive d h b false let P1 := oracleBumpPrimitive d h b true let f := fun z : Cov d × (Bool × Bool) => labelLikelihood P0 z.1 z.2 let g := fun z : Cov d × (Bool × Bool) => labelLikelihood P1 z.1 z.2 letI := uniformLaw_probability d letI := bern_probability (1/2) (by norm_num) letI : IsProbabilityMeasure fairObserved := by unfold fairObserved; infer_instance letI := obsLaw_probability P0 letI := obsLaw_probability P1 have hf : Measurable f := measurable_labelLikelihood P0 have hg : Measurable g := measurable_labelLikelihood P1 have hfbound (z) := oracle_bump_likelihood_bounds d h b false hb hbsmall z have hgbound (z) := oracle_bump_likelihood_bounds d h b true hb hbsmall z change hellingerSq (obsLaw P0) (obsLaw P1) ≤ _ have hd0 : obsLaw P0 = ((uniformLaw d).prod fairObserved).withDensity (fun z => ofReal (f z)) := independent_obsLaw_density d _ _ _ _ _ _ have hd1 : obsLaw P1 = ((uniformLaw d).prod fairObserved).withDensity (fun z => ofReal (g z)) := independent_obsLaw_density d _ _ _ _ _ _ rw [hellingerSq_real_density (obsLaw P0) (obsLaw P1) ((uniformLaw d).prod fairObserved) f g hf hg (fun z => by dsimp [f, P0]; linarith [(hfbound z).1]) (fun z => by dsimp [g, P1]; linarith [(hgbound z).1]) hd0 hd1] unfold hellingerSqDensity have hpoint (z : Cov d × (Bool × Bool)) : (sqrt (f z)-sqrt (g z))^2 ≤ 16*b^2*(macroBump h z.1)^2 := by calc _ ≤ (f z-g z)^2 := oracle_sqrt_difference_le _ _ (hfbound z).1 (hgbound z).1 _ ≤ _ := by dsimp only [f, g, P0, P1] rw [oracle_bump_likelihood d h b false hb hbsmall, oracle_bump_likelihood d h b true hb hbsmall] rcases z with ⟨x,A,Y⟩ cases A <;> cases Y <;> simp [thetaSign] <;> nlinarith [sq_nonneg (b*macroBump h x)] have hi : Integrable (fun z : Cov d × (Bool × Bool) => (sqrt (f z)-sqrt (g z))^2) ((uniformLaw d).prod fairObserved) := by apply (integrable_const (16:ℝ)).mono' (by fun_prop) filter_upwards [] with z rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hs : sqrt (f z) ≤ 2 := Real.sqrt_le_iff.mpr ⟨by norm_num, by dsimp [f, P0]; linarith [(hfbound z).2]⟩ have ht : sqrt (g z) ≤ 2 := Real.sqrt_le_iff.mpr ⟨by norm_num, by dsimp [g, P1]; linarith [(hgbound z).2]⟩ nlinarith [Real.sqrt_nonneg (f z), Real.sqrt_nonneg (g z)] have hbi : Integrable (fun z : Cov d × (Bool × Bool) => 16*b^2*(macroBump h z.1)^2) ((uniformLaw d).prod fairObserved) := by apply (integrable_const (16*b^2)).mono' (by fun_prop) filter_upwards [] with z rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)] have hm := macroBump_mem h z.1 have hsq : (macroBump h z.1)^2 ≤ 1 := by nlinarith [hm.1, hm.2] nlinarith [sq_nonneg b] calc _ ≤ ∫ z, 16*b^2*(macroBump h z.1)^2 ∂(uniformLaw d).prod fairObserved := integral_mono hi hbi hpoint _ = 16*b^2*(∫ x : Cov d, (macroBump h x)^2 ∂uniformLaw d) := by rw [integral_const_mul, integral_fun_fst (fun x : Cov d => (macroBump h x)^2)] simp _ ≤ _ := mul_le_mul_of_nonneg_left (oracle_bump_square_energy d h hh hh1) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_hellinger_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/OracleBumpInformation.lean:101
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.TargetIdentification 10 declarations Identification of marked targets from the original-record experiment laws.

Identification of marked targets from the original-record experiment laws.

The conditional observed Bernoulli law is a measurable kernel. Given the specified input d, the specified input P, conditional observed kernel is the corresponding construction.

Definition (Lean source)
d :
ℕ
P :
conditionalObservedKernel P :
Kernel (Cov d) (Bool × Bool)
⟨conditionalObserved P, by apply Measure.measurable_of_measurable_coe intro A hA rw [show (fun x => conditionalObserved P x A) = (fun x => ∑ s : Bool × Bool, if s ∈ A then conditionalObserved P x {s} else 0) by funext x rw [← Measure.sum_smul_dirac (conditionalObserved P x)] simp [Measure.sum_apply, hA, tsum_fintype, Measure.dirac_apply' _ hA, indicator, mul_ite]] apply Finset.measurable_fun_sum intro s _ by_cases hs : s ∈ A · simp only [if_pos hs, conditionalObserved_singleton] have he := (Measure.measurable_coe (measurableSet_singleton s.1)).comp (measurable_bern P.e P.measurable_e) have hm : Measurable (fun x => if s.1 then P.mu1 x else P.mu0 x) := by cases s.1 <;> simp only [Bool.false_eq_true, if_false, if_true] <;> first | exact P.measurable_mu0 | exact P.measurable_mu1 exact he.mul ((Measure.measurable_coe (measurableSet_singleton s.2)).comp (measurable_bern _ hm)) · simp only [if_neg hs]; exact measurable_const⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObservedKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:14
theorem conditionalObservedKernel_markov Lemma conditionalObservedKernel_markov in the paper ↗

Probability-valued margins make the observed conditional kernel Markov. Given the specified input d, the specified input P, the specified input he, the specified input hp, the specified input hq, the conditional observed kernel markov conclusion holds.

Formal statement
d :
ℕ
P :
he :
∀ x, P.e x ∈ Icc 0 1
hp :
∀ x, P.mu0 x ∈ Icc 0 1
hq :
∀ x, P.mu1 x ∈ Icc 0 1
Proof (Lean source)
lemma conditionalObservedKernel_markov {d : ℕ} (P : PrimitiveLaw d) (he : ∀ x, P.e x ∈ Icc 0 1) (hp : ∀ x, P.mu0 x ∈ Icc 0 1) (hq : ∀ x, P.mu1 x ∈ Icc 0 1) : IsMarkovKernel (conditionalObservedKernel P) := by constructor intro x change IsProbabilityMeasure (conditionalObserved P x) constructor rw [← Measure.sum_smul_dirac (conditionalObserved P x)] rw [Measure.sum_apply _ MeasurableSet.univ] simp only [tsum_fintype, Measure.smul_apply, Measure.dirac_apply_of_mem (mem_univ _), smul_eq_mul, mul_one] simp only [conditionalObserved_singleton, Fintype.sum_prod_type] simp [bern, ENNReal.ofReal_add (sub_nonneg.mpr (hp x).2) (hp x).1, ENNReal.ofReal_add (sub_nonneg.mpr (hq x).2) (hq x).1, ← mul_add, ← ENNReal.ofReal_add (sub_nonneg.mpr (he x).2) (he x).1] rw [← ENNReal.ofReal_add (hq x).1 (sub_nonneg.mpr (hq x).2), ← ENNReal.ofReal_add (hp x).1 (sub_nonneg.mpr (hp x).2)] simp only [add_sub_cancel, ENNReal.ofReal_one, mul_one] rw [← ENNReal.ofReal_add (he x).1 (sub_nonneg.mpr (he x).2)] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObservedKernel_markov · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:38
theorem independent_obsLaw_compProd Lemma independent_obsLaw_compProd in the paper ↗

The explicit independent extension has its observed conditional kernel as disintegration. Given the specified input d, the specified input e, the specified input p, the specified input q, the specified input he, the specified input hp, the specified input hq, the independent obs law comp prod conclusion holds.

Formal statement
d :
ℕ
e p q :
Cov d → ℝ
he :
hp :
hq :
P :
independentPrimitive e p q he hp hq
Proof (Lean source)
lemma independent_obsLaw_compProd {d : ℕ} (e p q : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) : let P := independentPrimitive e p q he hp hq obsLaw P = uniformLaw d ⊗ₘ conditionalObservedKernel P := by dsimp only let P := independentPrimitive e p q he hp hq letI := uniformLaw_probability d letI := conditionalObservedKernel_markov P (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) rw [independent_obsLaw] ext s hs have hm : Measurable (fun x => (Measure.dirac x).prod (conditionalObserved P x)) := by apply Measure.measurable_of_measurable_coe intro A hA have heq (x : Cov d) : (Measure.dirac x).prod (conditionalObserved P x) = ∑ s : Bool × Bool, conditionalObserved P x {s} • Measure.dirac (x,s) := by conv_lhs => rw [← Measure.sum_smul_dirac (conditionalObserved P x)] rw [Measure.prod_sum_right, Measure.sum_fintype] simp only [Measure.prod_smul_right, Measure.dirac_prod_dirac] simp_rw [heq, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] apply Finset.measurable_fun_sum intro s _ exact ((conditionalObservedKernel P).measurable_coe (measurableSet_singleton s)).mul ((Measure.measurable_coe hA).comp (Measure.measurable_dirac.comp (by fun_prop))) rw [Measure.bind_apply hs hm.aemeasurable, Measure.compProd_apply hs] apply lintegral_congr intro x rw [Measure.dirac_prod, Measure.map_apply (by fun_prop) hs] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_obsLaw_compProd · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:60
theorem raw_propensity_overlap_ae Lemma raw_propensity_overlap_ae in the paper ↗

Class overlap also holds almost everywhere for any probability-valued raw propensity witness. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input he, the raw propensity overlap ae conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
he :
∀ x, P.e x ∈ Icc 0 1
∀ᵐ x ∂uniformLaw d, P.e x ∈ Icc eps (1 - eps)
Proof (Lean source)
lemma raw_propensity_overlap_ae {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (he : ∀ x, P.e x ∈ Icc 0 1) : ∀ᵐ x ∂uniformLaw d, P.e x ∈ Icc eps (1 - eps) := by let W := canonicalLaw P hP have hW := canonicalLaw_spec P hP letI := uniformLaw_probability d letI : IsMarkovKernel (bernKernel P.e P.measurable_e) := ⟨fun x => bern_probability _ (he x)⟩ let wc := bernKernel (fun x => versionClip (W.e x)) (measurable_versionClip.comp W.measurable_e) letI : IsMarkovKernel wc := bernKernel_versionClip_markov W.e W.measurable_e letI := bernKernel_sfinite_of_margin W (fun w => w.2.1) (by fun_prop) W.e W.measurable_e W.margin_e have hcube : MeasurableSet (cube d) := by have heq : cube d = ⋂ i : Fin d, (fun x : Cov d => x i) ⁻¹' Icc (0:ℝ) 1 := by ext x; simp [cube] rw [heq] exact MeasurableSet.iInter fun i => measurableSet_Icc.preimage (by fun_prop) have hclip : bernKernel W.e W.measurable_e =ᵐ[uniformLaw d] wc := by filter_upwards [ae_restrict_mem hcube] with x hx change bern (W.e x) = bern (versionClip (W.e x)) rw [versionClip_eq _ (hW.2.2.2.1.unit x hx)] have hu : UniformDesign P := by change P.law.map fst = _ rw [← hW.1] exact hW.2.1 have hmargin : uniformLaw d ⊗ₘ bernKernel P.e P.measurable_e = uniformLaw d ⊗ₘ wc := by rw [← Measure.compProd_congr hclip, ← hW.2.1, ← W.margin_e, hW.1, P.margin_e, hu] have hkernel := Kernel.ae_eq_of_compProd_eq hmargin filter_upwards [hkernel, hclip, ae_restrict_mem hcube] with x hx hcx hxc have hb : bern (P.e x) = bern (W.e x) := hx.trans hcx.symm have ht := congrArg (fun μ : Measure Bool => μ {true}) hb simp [bern] at ht have hband := hW.2.2.2.1.2 x hxc have heq := (ENNReal.ofReal_eq_ofReal_iff (he x).1 (hW.2.2.2.1.unit x hxc).1).mp ht rw [heq] exact hband
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.raw_propensity_overlap_ae · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:91
theorem conditionalObserved_identifies_margins Lemma conditionalObserved_identifies_margins in the paper ↗

The four observed cells determine the propensity and both arm means under overlap. Given the specified input d, the specified input P, the specified input Q, the specified input x, the specified input heP, the specified input heQ, the specified input hpP, the specified input hqP, the specified input hpQ, the specified input hqQ, the specified input hobs, the overlap level eps, the conditional observed identifies margins conclusion holds.

Formal statement
d :
ℕ
P Q :
x :
Cov d
eps :
ℝ
heps :
0 < eps
heP :
P.e x ∈ Icc eps (1 - eps)
heQ :
Q.e x ∈ Icc 0 1
hpP :
P.mu0 x ∈ Icc 0 1
hqP :
P.mu1 x ∈ Icc 0 1
hpQ :
Q.mu0 x ∈ Icc 0 1
hqQ :
Q.mu1 x ∈ Icc 0 1
conclusion 1
P.e x = Q.e x
conclusion 2
P.mu0 x = Q.mu0 x
conclusion 3
P.mu1 x = Q.mu1 x
Proof (Lean source)
lemma conditionalObserved_identifies_margins {d : ℕ} (P Q : PrimitiveLaw d) (x : Cov d) (eps : ℝ) (heps : 0 < eps) (heP : P.e x ∈ Icc eps (1 - eps)) (heQ : Q.e x ∈ Icc 0 1) (hpP : P.mu0 x ∈ Icc 0 1) (hqP : P.mu1 x ∈ Icc 0 1) (hpQ : Q.mu0 x ∈ Icc 0 1) (hqQ : Q.mu1 x ∈ Icc 0 1) (hobs : conditionalObserved P x = conditionalObserved Q x) : P.e x = Q.e x ∧ P.mu0 x = Q.mu0 x ∧ P.mu1 x = Q.mu1 x := by have heP0 : 0 ≤ P.e x := by linarith [heP.1] have heP1 : 0 ≤ 1-P.e x := by linarith [heP.2] have hcell (s : Bool × Bool) := congrArg (fun μ : Measure (Bool × Bool) => (μ {s}).toReal) hobs have hTT := hcell (true,true) have hTF := hcell (true,false) have hFT := hcell (false,true) have hFF := hcell (false,false) simp [conditionalObserved_singleton, bern, ENNReal.toReal_mul, ENNReal.toReal_ofReal, heP0, heP1, heQ.1, sub_nonneg.mpr heQ.2, hpP.1, sub_nonneg.mpr hpP.2, hqP.1, sub_nonneg.mpr hqP.2, hpQ.1, sub_nonneg.mpr hpQ.2, hqQ.1, sub_nonneg.mpr hqQ.2] at hTT hTF hFT hFF have he : P.e x = Q.e x := by nlinarith only [hTT, hTF] refine ⟨he, ?_, ?_⟩ · rw [← he] at hFT nlinarith only [hFT, heP.2, heps] · rw [← he] at hTT nlinarith only [hTT, heP.1, heps]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.conditionalObserved_identifies_margins · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:132
theorem independent_fullLaw_eq_of_obsLaw Lemma independent_fullLaw_eq_of_obsLaw in the paper ↗

In the overlapping independent Bernoulli subfamily, equality of observed laws identifies the full primitive law, up to null covariates. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input e, the specified input p, the specified input q, the specified input e', the specified input p', the specified input q', the specified input he, the specified input hp, the specified input hq, the specified input he', the specified input hp', the specified input hq', the specified input hP, the specified input hobs, the independent full law eq of obs law conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
e p q e' p' q' :
Cov d → ℝ
he :
hp :
hq :
he' :
hp' :
hq' :
hP :
PrimitiveClass alpha beta gamma L eps (independentPrimitive e p q he hp hq)
hobs :
obsLaw (independentPrimitive e p q he hp hq)
= obsLaw (independentPrimitive e' p' q' he' hp' hq')
Proof (Lean source)
lemma independent_fullLaw_eq_of_obsLaw {d : ℕ} {alpha beta gamma L eps : ℝ} (e p q e' p' q' : Cov d → ℝ) (he : Measurable e) (hp : Measurable p) (hq : Measurable q) (he' : Measurable e') (hp' : Measurable p') (hq' : Measurable q') (hP : PrimitiveClass alpha beta gamma L eps (independentPrimitive e p q he hp hq)) (hobs : obsLaw (independentPrimitive e p q he hp hq) = obsLaw (independentPrimitive e' p' q' he' hp' hq')) : independentFullLaw e p q = independentFullLaw e' p' q' := by let P := independentPrimitive e p q he hp hq let Q := independentPrimitive e' p' q' he' hp' hq' letI := uniformLaw_probability d letI := conditionalObservedKernel_markov P (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) letI := conditionalObservedKernel_markov Q (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) (fun x => probabilityClip_mem _) have hk : conditionalObservedKernel P =ᵐ[uniformLaw d] conditionalObservedKernel Q := by apply Kernel.ae_eq_of_compProd_eq rw [← independent_obsLaw_compProd, ← independent_obsLaw_compProd] exact hobs have ho := raw_propensity_overlap_ae P hP (fun x => probabilityClip_mem _) unfold independentFullLaw apply Measure.bind_congr_right filter_upwards [hk, ho] with x hx hox have hm := conditionalObserved_identifies_margins P Q x eps hP.eps_pos hox (probabilityClip_mem _) (probabilityClip_mem _) (probabilityClip_mem _) (probabilityClip_mem _) (probabilityClip_mem _) hx change probabilityClip (e x) = probabilityClip (e' x) ∧ probabilityClip (p x) = probabilityClip (p' x) ∧ probabilityClip (q x) = probabilityClip (q' x) at hm rw [hm.1, hm.2.1, hm.2.2]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.independent_fullLaw_eq_of_obsLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:158

The first labeled coordinate has exactly the observed-record law. Given the specified input d, the specified input n, the specified input m, the specified input P, the specified input j, the experiment map labeled conclusion holds.

Formal statement
d n m :
ℕ
P :
j :
Fin n
(experiment P n m).map (fun w => w.1.1 j) = obsLaw P
Proof (Lean source)
lemma experiment_map_labeled {d n m : ℕ} (P : PrimitiveLaw d) (j : Fin n) : (experiment P n m).map (fun w => w.1.1 j) = obsLaw P := by letI := obsLaw_probability P letI := xaLaw_probability P letI := population_randomizer_probability have heq : (fun w : Sample d n m => w.1.1 j) = (Function.eval j) ∘ fst ∘ fst := rfl rw [heq, ← Measure.map_map (by fun_prop) (by fun_prop), ← Measure.map_map (by fun_prop) (by fun_prop)] unfold experiment rw [Measure.map_fst_prod, measure_univ, one_smul, Measure.map_fst_prod, measure_univ, one_smul, Measure.pi_map_eval] simp
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.experiment_map_labeled · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:191
theorem marked_target_eq_of_experiment Lemma marked_target_eq_of_experiment in the paper ↗

Equal full experiments identify the canonical target within the marked subfamily. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hn, the specified input hMembers, the specified input theta, the specified input theta', the specified input sigma, the specified input sigma', the specified input hE, the marked target eq of experiment conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h delta a b :
ℝ
hn :
0 < n
hMembers :
∀ theta sigma,
PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)
theta theta' :
sigma sigma' :
SignArray d h delta
hE :
experiment ((markedHandle d h delta a b).law theta sigma) n m
= experiment ((markedHandle d h delta a b).law theta' sigma') n m
tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d)
= tau ((markedHandle d h delta a b).law theta' sigma') (hMembers theta' sigma') (x0 d)
Proof (Lean source)
lemma marked_target_eq_of_experiment {d n m : ℕ} {alpha beta gamma L eps h delta a b : ℝ} (hn : 0 < n) (hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)) (theta theta' : Bool) (sigma sigma' : SignArray d h delta) (hE : experiment ((markedHandle d h delta a b).law theta sigma) n m = experiment ((markedHandle d h delta a b).law theta' sigma') n m) : tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d) = tau ((markedHandle d h delta a b).law theta' sigma') (hMembers theta' sigma') (x0 d) := by have ho := congrArg (fun μ : Measure (Sample d n m) => μ.map (fun w => w.1.1 (⟨0, hn⟩ : Fin n))) hE rw [experiment_map_labeled, experiment_map_labeled] at ho have hl := independent_fullLaw_eq_of_obsLaw _ _ _ _ _ _ (measurable_markedPropensity h delta a sigma) (measurable_markedMean h delta a b theta false sigma) (measurable_markedMean h delta a b theta true sigma) (measurable_markedPropensity h delta a sigma') (measurable_markedMean h delta a b theta' false sigma') (measurable_markedMean h delta a b theta' true sigma') (hMembers theta sigma) ho have hu := admissible_versions_unique _ _ (hMembers theta sigma) (hMembers theta' sigma') hl exact (hu (x0 d) (by intro i; norm_num [x0, cube])).2.2.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_target_eq_of_experiment · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:206
theorem exists_function_on_image Lemma exists_function_on_image in the paper ↗

A target constant on experiment fibers has a well-defined extension to all laws. Given the specified input A, the specified input B, the specified input E, the specified input t, the specified input ht, the exists function on image conclusion holds.

Formal statement
A B :
Type*
E :
A → B
t :
A → ℝ
ht :
∀ x y
if
E x = E y
then
t x = t y
∃ f : B → ℝ, ∀ x, f (E x) = t x
Proof (Lean source)
lemma exists_function_on_image {A B : Type*} (E : A → B) (t : A → ℝ) (ht : ∀ x y, E x = E y → t x = t y) : ∃ f : B → ℝ, ∀ x, f (E x) = t x := by classical let f : B → ℝ := fun b => if hb : ∃ x, E x = b then t hb.choose else 0 refine ⟨f, ?_⟩ intro x have hx : ∃ y, E y = E x := ⟨x, rfl⟩ simp only [f, dif_pos hx] exact ht hx.choose x hx.choose_spec
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.exists_function_on_image · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:231
theorem marked_experiment_target_exists Lemma marked_experiment_target_exists in the paper ↗

The canonical marked target is a functional of the full randomized experiment law. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hn, the specified input hMembers, the marked experiment target exists conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h delta a b :
ℝ
hn :
0 < n
hMembers :
PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)
∃ Ψ : Measure (Sample d n m) → ℝ,
Ψ (experiment ((markedHandle d h delta a b).law theta sigma) n m)
= tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d)
Proof (Lean source)
lemma marked_experiment_target_exists {d n m : ℕ} {alpha beta gamma L eps h delta a b : ℝ} (hn : 0 < n) (hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)) : ∃ Ψ : Measure (Sample d n m) → ℝ, ∀ theta sigma, Ψ (experiment ((markedHandle d h delta a b).law theta sigma) n m) = tau ((markedHandle d h delta a b).law theta sigma) (hMembers theta sigma) (x0 d) := by obtain ⟨Ψ, hΨ⟩ := exists_function_on_image (fun z : Bool × SignArray d h delta => experiment ((markedHandle d h delta a b).law z.1 z.2) n m) (fun z => tau ((markedHandle d h delta a b).law z.1 z.2) (hMembers z.1 z.2) (x0 d)) (fun z z' heq => marked_target_eq_of_experiment hn hMembers z.1 z'.1 z.2 z'.2 heq) exact ⟨Ψ, fun theta sigma => hΨ (theta,sigma)⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_experiment_target_exists · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TargetIdentification.lean:243
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.TreeCount 5 declarations Two-channel point-CATE annotation frontier: Lower/TreeCount constructions and obligations.

Lower/TreeCount

Two-channel point-CATE annotation frontier: Lower/TreeCount constructions and obligations.

theorem labeled_record_count_integrable Lemma labeled_record_count_integrable in the paper ↗

The informative-component count is integrable under the finite uniform covariate experiment. Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input p, the specified input hp, the labeled record count integrable conclusion holds.

Formal statement
d n m :
ℕ
h delta :
ℝ
p :
ℕ
hp :
2 ≤ p
Integrable (fun x : Fin (n+m) → Cov d => ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ)) (Measure.pi (fun _ : Fin (n+m) => uniformLaw d))
Proof (Lean source)
lemma labeled_record_count_integrable (d n m : ℕ) (h delta : ℝ) (p : ℕ) (hp : 2 ≤ p) : Integrable (fun x : Fin (n+m) → Cov d => ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ)) (Measure.pi (fun _ : Fin (n+m) => uniformLaw d)) := by letI := uniformLaw_probability d simp_rw [← labeledComponentCount_eq_record_count d n m h delta p hp] exact integrable_labeledComponentCount _ _ _ _ _ (fun _ => (isClosed_locCube d h).measurableSet)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.labeled_record_count_integrable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeCount.lean:202
theorem uniformLaw_locCube_real Lemma uniformLaw_locCube_real in the paper ↗

The uniform design mass of the localization cube is its side length to the ambient dimension. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the uniform law loc cube real conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1 / 2
(uniformLaw d).real (locCube d h) = h ^ d
Proof (Lean source)
lemma uniformLaw_locCube_real (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1 / 2) : (uniformLaw d).real (locCube d h) = h ^ d := by have hsub : locCube d h ⊆ cube d := by intro x hx i exact ⟨by linarith [hx i |>.1], by linarith [hx i |>.2]⟩ rw [measureReal_def, uniformLaw, Measure.restrict_apply] · rw [inter_eq_left.2 hsub] rw [← (PiLp.volume_preserving_toLp (Fin d)).measure_preimage (isClosed_locCube d h).measurableSet.nullMeasurableSet] rw [show toLp 2 ⁻¹' locCube d h = Icc (fun _ : Fin d => 1 / 2 - h / 2) (fun _ : Fin d => 1 / 2 + h / 2) by ext x simp only [Set.mem_preimage, locCube, Set.mem_setOf_eq, Set.mem_Icc, Pi.le_def] constructor · intro hx exact ⟨fun i => by linarith [(hx i).1], fun i => (hx i).2⟩ · rintro ⟨hxl, hxu⟩ i exact ⟨by linarith [hxl i], hxu i⟩] change (volume (Icc (fun _ : Fin d => 1 / 2 - h / 2) (fun _ : Fin d => 1 / 2 + h / 2))).toReal = h ^ d rw [Real.volume_Icc_pi_toReal] · simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] congr 1 ring · intro i linarith · exact isClosed_locCube d h |>.measurableSet
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.uniformLaw_locCube_real · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeCount.lean:214
theorem labeled_root_tree_count Lemma labeled_root_tree_count in the paper ↗

Given the specified input d, the specified input n, the specified input m, the specified input h, the specified input delta, the specified input hh, the specified input hh', the specified input hd, the specified input hdh, the specified input p, the specified input hp, the labeled root tree count conclusion holds.

Formal statement
d n m :
ℕ
h delta :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
hd :
0 < delta
hdh :
delta ≤ h
p :
ℕ
hp :
2 ≤ p
(∫ x : Fin (n+m) → Cov d, ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d))
≤ (n:ℝ)*h^d*(choose (n+m-1) (p-1):ℝ)*(p:ℝ)^(p-1)*((4*delta)^d)^(p-1)
Proof (Lean source)
lemma labeled_root_tree_count (d n m : ℕ) (h delta : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (hd : 0 < delta) (hdh : delta ≤ h) (p : ℕ) (hp : 2 ≤ p) : (∫ x : Fin (n+m) → Cov d, ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = p ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d)) ≤ (n:ℝ)*h^d*(choose (n+m-1) (p-1):ℝ)*(p:ℝ)^(p-1)*((4*delta)^d)^(p-1) := by let _ := uniformLaw_probability d let M := recordCoordinateGraph d n m h delta let R := Finset.univ.filter fun i : Fin (n + m) => i.val < n have hrootMass : ∀ r ∈ R, uniformLaw d (locCube d h) ≤ ofReal (h ^ d) := by intro r hr have htop : uniformLaw d (locCube d h) ≠ ∞ := measure_ne_top _ _ calc uniformLaw d (locCube d h) = ofReal ((uniformLaw d).real (locCube d h)) := by rw [measureReal_def, ENNReal.ofReal_toReal htop] _ ≤ ofReal (h ^ d) := by rw [uniformLaw_locCube_real d h hh hh'] have hbound := expected_labeled_component_count_le (fun _ : Fin (n + m) => uniformLaw d) M R (fun _ => locCube d h) p hp (h ^ d) ((4 * delta) ^ d) (pow_nonneg hh.le d) (pow_nonneg (mul_nonneg (by norm_num) hd.le) d) (fun _ => (isClosed_locCube d h).measurableSet) hrootMass (fun i j hij y => uniformLaw_edge_section_le d n m h delta hd i j y) dsimp [M, R] at hbound calc _ = ∫ x, labeledComponentCount (recordCoordinateGraph d n m h delta) (Finset.univ.filter fun i : Fin (n + m) => i.val < n) (fun _ => locCube d h) p x ∂Measure.pi (fun _ : Fin (n + m) => uniformLaw d) := by apply integral_congr_ae filter_upwards with x exact (labeledComponentCount_eq_record_count d n m h delta p hp x).symm _ ≤ ((Finset.univ.filter fun i : Fin (n + m) => i.val < n).card : ℝ) * (choose (card (Fin (n + m)) - 1) (p - 1) : ℝ) * (p : ℝ) ^ (p - 1) * h ^ d * ((4 * delta) ^ d) ^ (p - 1) := hbound _ = (n:ℝ)*h^d*(choose (n+m-1) (p-1):ℝ)*(p:ℝ)^(p-1)* ((4*delta)^d)^(p-1) := by rw [show (Finset.univ.filter fun i : Fin (n + m) => i.val < n).card = n by rw [Fin.card_filter_val_lt, min_eq_right (by omega : n ≤ n + m)], Fintype.card_fin] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.labeled_root_tree_count · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeCount.lean:245

The exponential series bounds the rooted-tree factorial ratio. Given the specified input p, the specified input hp, the factorial tree bound conclusion holds.

Formal statement
p :
ℕ
hp :
2 ≤ p
(p:ℝ)^(p-1)/(factorial (p-1):ℝ) ≤ exp (p:ℝ)
Proof (Lean source)
lemma factorial_tree_bound (p : ℕ) (hp : 2 ≤ p) : (p:ℝ)^(p-1)/(factorial (p-1):ℝ) ≤ exp (p:ℝ) := by exact Real.pow_div_factorial_le_exp (p : ℝ) (Nat.cast_nonneg p) (p-1)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.factorial_tree_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeCount.lean:291

the tree series summable conclusion holds.

Formal statement
Summable (fun p : ℕ => ((p+2:ℕ):ℝ)^4*(1/2:ℝ)^p)
Proof (Lean source)
lemma tree_series_summable : Summable (fun p : ℕ => ((p+2:ℕ):ℝ)^4*(1/2:ℝ)^p) := by have hs : Summable (fun p : ℕ => (p:ℝ)^4*(1/2:ℝ)^p) := summable_pow_mul_geometric_of_norm_lt_one 4 (by norm_num) have ht : Summable (fun p : ℕ => ((p+2:ℕ):ℝ)^4*(1/2:ℝ)^(p+2)) := (summable_nat_add_iff 2).2 hs convert ht.mul_left 4 using 1 <;> try rfl ext p rw [pow_add] ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tree_series_summable · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeCount.lean:295
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.TreeSeries 5 declarations The numerical steps MC34–MC37: a binomial/factorial estimate and a polynomial geometric-series bound under the small-occupancy condition.

Summation of the labeled-root tree envelope

The numerical steps MC34–MC37: a binomial/factorial estimate and a polynomial geometric-series bound under the small-occupancy condition. These estimates do not assert the geometric component count or the Hellinger product assembly, which remain separate obligations.

theorem binomial_rooted_tree_bound Lemma binomial_rooted_tree_bound in the paper ↗

The binomial coefficient and rooted-parent count have an exponential envelope. Given the specified input N, the specified input p, the specified input hp, the binomial rooted tree bound conclusion holds.

Formal statement
N p :
ℕ
hp :
2 ≤ p
(choose (N-1) (p-1) : ℝ) * (p:ℝ)^(p-1) ≤ (N:ℝ)^(p-1) * exp (p:ℝ)
Proof (Lean source)
lemma binomial_rooted_tree_bound (N p : ℕ) (hp : 2 ≤ p) : (choose (N-1) (p-1) : ℝ) * (p:ℝ)^(p-1) ≤ (N:ℝ)^(p-1) * exp (p:ℝ) := by have hchoose : (choose (N-1) (p-1) : ℝ) ≤ (N:ℝ)^(p-1) / (factorial (p-1):ℝ) := by apply (Nat.choose_le_pow_div (p-1) (N-1)).trans gcongr exact_mod_cast sub_le N 1 calc _ ≤ ((N:ℝ)^(p-1) / (factorial (p-1):ℝ)) * (p:ℝ)^(p-1) := mul_le_mul_of_nonneg_right hchoose (by positivity) _ = (N:ℝ)^(p-1) * ((p:ℝ)^(p-1) / (factorial (p-1):ℝ)) := by ring _ ≤ _ := mul_le_mul_of_nonneg_left (factorial_tree_bound p hp) (by positivity)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.binomial_rooted_tree_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeSeries.lean:21
theorem finite_tree_series_bound Lemma finite_tree_series_bound in the paper ↗

A finite polynomial-geometric sum has a bound linear in its small ratio. Given the specified input M, the specified input z, the specified input hz, the specified input hzhalf, the finite tree series bound conclusion holds.

Formal statement
M :
ℕ
z :
ℝ
hz :
0 ≤ z
hzhalf :
z ≤ 1/2
(∑ j ∈ range M, ((j+2:ℕ):ℝ)^4 * z^(j+1)) ≤ z * ∑' j : ℕ, ((j+2:ℕ):ℝ)^4 * (1/2:ℝ)^j
Proof (Lean source)
lemma finite_tree_series_bound (M : ℕ) (z : ℝ) (hz : 0 ≤ z) (hzhalf : z ≤ 1/2) : (∑ j ∈ range M, ((j+2:ℕ):ℝ)^4 * z^(j+1)) ≤ z * ∑' j : ℕ, ((j+2:ℕ):ℝ)^4 * (1/2:ℝ)^j := by calc _ ≤ ∑ j ∈ range M, z * (((j+2:ℕ):ℝ)^4 * (1/2:ℝ)^j) := by apply Finset.sum_le_sum intro j hj rw [pow_succ z] have hpow := pow_le_pow_left₀ hz hzhalf j nlinarith [mul_le_mul_of_nonneg_left hpow (mul_nonneg hz (by positivity : 0 ≤ ((j+2:ℕ):ℝ)^4))] _ = z * ∑ j ∈ range M, ((j+2:ℕ):ℝ)^4 * (1/2:ℝ)^j := by rw [Finset.mul_sum] _ ≤ _ := mul_le_mul_of_nonneg_left (tree_series_summable.sum_le_tsum (range M) (fun j hj => by positivity)) hz
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.finite_tree_series_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeSeries.lean:36
theorem tree_envelope_term_bound Lemma tree_envelope_term_bound in the paper ↗

One summand of the tree envelope is controlled by its occupancy ratio. Given the specified input N, the specified input j, the specified input K, the specified input v, the specified input hK, the specified input hv, the tree envelope term bound conclusion holds.

Formal statement
N j :
ℕ
K v :
ℝ
hK :
0 ≤ K
hv :
0 ≤ v
K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (N-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * v^(j+1)
≤ K * exp 1 * ((j+2:ℕ):ℝ)^4 * (K * exp 1 * N * v)^(j+1)
Proof (Lean source)
lemma tree_envelope_term_bound (N j : ℕ) (K v : ℝ) (hK : 0 ≤ K) (hv : 0 ≤ v) : K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (N-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * v^(j+1) ≤ K * exp 1 * ((j+2:ℕ):ℝ)^4 * (K * exp 1 * N * v)^(j+1) := by have ht := binomial_rooted_tree_bound N (j+2) (by omega) simp only [show j+2-1 = j+1 by omega] at ht have he : exp ((j+2:ℕ):ℝ) = exp 1 * (exp 1)^(j+1) := by rw [show ((j+2:ℕ):ℝ) = 1 + ((j+1:ℕ):ℝ)*1 by push_cast; ring, Real.exp_add, Real.exp_nat_mul] calc _ = (K^(j+2) * ((j+2:ℕ):ℝ)^4 * v^(j+1)) * ((choose (N-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1)) := by ring _ ≤ (K^(j+2) * ((j+2:ℕ):ℝ)^4 * v^(j+1)) * ((N:ℝ)^(j+1) * exp ((j+2:ℕ):ℝ)) := mul_le_mul_of_nonneg_left ht (by positivity) _ = _ := by rw [he, show j+2 = (j+1)+1 by omega, pow_succ]; simp only [mul_pow]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tree_envelope_term_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeSeries.lean:53
theorem tree_envelope_sum_bound Lemma tree_envelope_sum_bound in the paper ↗

Small occupancy controls the entire tree envelope uniformly in the truncation and total number of records. This is the numerical content of MC35–MC37. Given the specified input d, the specified input K, the specified input hK, the tree envelope sum bound conclusion holds.

Formal statement
d :
ℕ
K :
ℝ
hK :
0 < K
∃ c0 C : ℝ,
0 < c0
0 < C
conclusion 1
N M :
ℕ
delta :
ℝ
0 ≤ delta
(N:ℝ)*delta^d ≤ c0
(∑ j ∈ range M, K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (N-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * ((4*delta)^d)^(j+1))
≤ C*(N:ℝ)*delta^d
Proof (Lean source)
lemma tree_envelope_sum_bound (d : ℕ) (K : ℝ) (hK : 0 < K) : ∃ c0 C : ℝ, 0 < c0 ∧ 0 < C ∧ ∀ (N M : ℕ) (delta : ℝ), 0 ≤ delta → (N:ℝ)*delta^d ≤ c0 → (∑ j ∈ range M, K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (N-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * ((4*delta)^d)^(j+1)) ≤ C*(N:ℝ)*delta^d := by let S : ℝ := ∑' j : ℕ, ((j+2:ℕ):ℝ)^4 * (1/2:ℝ)^j have hS : 0 ≤ S := by simpa only [Finset.sum_empty] using tree_series_summable.sum_le_tsum (∅ : Finset ℕ) (fun j hj => by positivity) let E : ℝ := K * exp 1 * (4:ℝ)^d have hE : 0 < E := by dsimp [E]; positivity refine ⟨1/(2*E), (S+1)*(K*exp 1)^2*(4:ℝ)^d, by positivity, by positivity, ?_⟩ intro N M delta hd hocc let z : ℝ := E * (N:ℝ) * delta^d have hz : 0 ≤ z := by dsimp [z]; positivity have hzhalf : z ≤ 1/2 := by have ht := mul_le_mul_of_nonneg_left hocc hE.le have hid : E*(1/(2*E)) = 1/2 := by field_simp simpa only [hid, z, mul_assoc] using ht have hbase : K * exp 1 * (N:ℝ) * (4*delta)^d = z := by dsimp [z, E] rw [mul_pow] ring calc _ ≤ ∑ j ∈ range M, K * exp 1 * ((j+2:ℕ):ℝ)^4 * z^(j+1) := by apply Finset.sum_le_sum intro j hj simpa only [hbase] using tree_envelope_term_bound N j K ((4*delta)^d) hK.le (by positivity) _ = K * exp 1 * (∑ j ∈ range M, ((j+2:ℕ):ℝ)^4 * z^(j+1)) := by simp only [Finset.mul_sum, mul_assoc] _ ≤ K * exp 1 * (z*S) := mul_le_mul_of_nonneg_left (finite_tree_series_bound M z hz hzhalf) (by positivity) _ ≤ K * exp 1 * (z*(S+1)) := by gcongr; linarith _ = _ := by dsimp [z, E]; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.tree_envelope_sum_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeSeries.lean:71
theorem labeled_component_series_bound Lemma labeled_component_series_bound in the paper ↗

Applying the geometric count lemma to the numerical envelope gives the labeled-root factor nN, uniformly in the auxiliary-to-labeled ratio. The geometric count itself is a separate, currently unfinished dependency. Given the specified input d, the specified input K, the specified input hK, the labeled component series bound conclusion holds.

Formal statement
d :
ℕ
K :
ℝ
hK :
0 < K
∃ c0 C : ℝ,
0 < c0
0 < C
conclusion 1
n m :
ℕ
h delta :
ℝ
0 < h
h ≤ 1/2
0 < delta
delta ≤ h
((n:ℝ)+m)*delta^d ≤ c0
(∑ j ∈ range (n+m), K^(j+2) * ((j+2:ℕ):ℝ)^4 * (∫ x : Fin (n+m) → Cov d, ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = j+2 ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d)))
≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d
Proof (Lean source)
lemma labeled_component_series_bound (d : ℕ) (K : ℝ) (hK : 0 < K) : ∃ c0 C : ℝ, 0 < c0 ∧ 0 < C ∧ ∀ (n m : ℕ) (h delta : ℝ), 0 < h → h ≤ 1/2 → 0 < delta → delta ≤ h → ((n:ℝ)+m)*delta^d ≤ c0 → (∑ j ∈ range (n+m), K^(j+2) * ((j+2:ℕ):ℝ)^4 * (∫ x : Fin (n+m) → Cov d, ((Finset.univ.filter (fun c : (recordGraph h delta x).ConnectedComponent => (componentVertices h delta x c).card = j+2 ∧ ∃ i ∈ componentVertices h delta x c, i.val < n)).card : ℝ) ∂Measure.pi (fun _ : Fin (n+m) => uniformLaw d))) ≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d := by obtain ⟨c0, C, hc0, hC, hsum⟩ := tree_envelope_sum_bound d K hK refine ⟨c0, C, hc0, hC, ?_⟩ intro n m h delta hh hhhalf hd hdh hocc have hb := hsum (n+m) (n+m) delta hd.le (by simpa only [Nat.cast_add] using hocc) calc _ ≤ ∑ j ∈ range (n+m), ((n:ℝ)*h^d) * (K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (n+m-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * ((4*delta)^d)^(j+1)) := by apply Finset.sum_le_sum intro j hj have ht := labeled_root_tree_count d n m h delta hh hhhalf hd hdh (j+2) (by omega) simp only [show j+2-1 = j+1 by omega] at ht have hm := mul_le_mul_of_nonneg_left ht (by positivity : 0 ≤ K^(j+2) * ((j+2:ℕ):ℝ)^4) convert hm using 1 <;> ring _ = ((n:ℝ)*h^d) * (∑ j ∈ range (n+m), K^(j+2) * ((j+2:ℕ):ℝ)^4 * (choose (n+m-1) (j+1):ℝ) * ((j+2:ℕ):ℝ)^(j+1) * ((4*delta)^d)^(j+1)) := by rw [Finset.mul_sum] _ ≤ ((n:ℝ)*h^d) * (C*(n+m:ℕ)*delta^d) := mul_le_mul_of_nonneg_left hb (by positivity) _ = _ := by push_cast; ring
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.labeled_component_series_bound · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TreeSeries.lean:112
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Lower.TwoPoint 1 declarations Two-channel point-CATE annotation frontier: Lower/TwoPoint constructions and obligations.

Lower/TwoPoint

Two-channel point-CATE annotation frontier: Lower/TwoPoint constructions and obligations.

Constant-propensity bump alternatives remain members of the exact primitive class. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle bump pair conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ eta C : ℝ,
0 < eta
0 < C
conclusion 1
n :
ℕ
2 ≤ n
H :
(n:ℝ)^(-(1/(2*gamma+d)))
bn :
eta*oracleRate d gamma n
∃ P0 P1 : PrimitiveLaw d,
∃ (hP0 : PrimitiveClass alpha beta gamma L eps P0) (hP1 : PrimitiveClass alpha beta gamma L eps P1),
x ∈ cube d :
(designatedPropensity P0 hP0) x = 1/2
(designatedPropensity P1 hP1) x = 1/2
(designatedControl P0 hP0) x = 1/2
(designatedControl P1 hP1) x = 1/2
x ∈ cube d :
tau P0 hP0 x = -bn*macroBump H x
tau P1 hP1 x = bn*macroBump H x
hellingerSq (obsLaw P0) (obsLaw P1) ≤ C*bn^2*H^d
Proof (Lean source)
lemma oracle_bump_pair (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ eta C : ℝ, 0 < eta ∧ 0 < C ∧ ∀ (n : ℕ), 2 ≤ n → let H := (n:ℝ)^(-(1/(2*gamma+d))) let bn := eta*oracleRate d gamma n ∃ P0 P1 : PrimitiveLaw d, ∃ (hP0 : PrimitiveClass alpha beta gamma L eps P0) (hP1 : PrimitiveClass alpha beta gamma L eps P1), (∀ x ∈ cube d, (designatedPropensity P0 hP0) x = 1/2 ∧ (designatedPropensity P1 hP1) x = 1/2 ∧ (designatedControl P0 hP0) x = 1/2 ∧ (designatedControl P1 hP1) x = 1/2) ∧ (∀ x ∈ cube d, tau P0 hP0 x = -bn*macroBump H x ∧ tau P1 hP1 x = bn*macroBump H x) ∧ hellingerSq (obsLaw P0) (obsLaw P1) ≤ C*bn^2*H^d := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hL : 1/2 ≤ L := hdom.2.2.2.2.2.2.2.1.le have heps : 0 < eps := hdom.2.2.2.2.2.2.2.2.1 have heps' : eps ≤ 1/2 := hdom.2.2.2.2.2.2.2.2.2.le obtain ⟨D, hD, hprofile⟩ := oracle_macro_holder d gamma hg let eta := (8*(D+1))⁻¹ have heta : 0 < eta := by dsimp [eta]; positivity have hetaD : eta*(D+1) = 1/8 := by dsimp [eta]; field_simp have hetasmall : eta ≤ 1/8 := by nlinarith have hDeta : eta*D ≤ L := by nlinarith refine ⟨eta, 16, heta, by norm_num, ?_⟩ intro n hn dsimp only let H : ℝ := (n:ℝ)^(-(1/(2*gamma+d))) let bn : ℝ := eta*oracleRate d gamma n have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hn1 : (1:ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hden : 0 < 2*gamma+(d:ℝ) := by positivity have hH : 0 < H := Real.rpow_pos_of_pos hn0 _ have hH1 : H ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hn1 (neg_nonpos.mpr (one_div_nonneg.mpr hden.le)) have hrate : H^gamma = oracleRate d gamma n := by dsimp only [H, oracleRate] rw [← Real.rpow_mul hn0.le] congr 1 ring have hbn : 0 < bn := by dsimp [bn, oracleRate]; positivity have hbsmall : bn ≤ 1/8 := by dsimp only [bn] rw [← hrate] exact (mul_le_mul_of_nonneg_left (Real.rpow_le_one hH.le hH1 hg.le) heta.le).trans (by simpa using hetasmall) have hsmooth : holderNorm (fun x : Cov d => bn*macroBump H x) gamma ≤ ofReal L := by have hs := holderNorm_const_mul_bound (macroBump (d:=d) H) gamma (D*H^(-gamma)) bn (by positivity) (hprofile H hH hH1) rw [abs_of_pos hbn] at hs have hid : bn*(D*H^(-gamma)) = eta*D := by dsimp only [bn] rw [← hrate] calc eta*H^gamma*(D*H^(-gamma)) = eta*D*(H^gamma*H^(-gamma)) := by ring _ = eta*D := by rw [← Real.rpow_add hH, add_neg_cancel, Real.rpow_zero, mul_one] rw [hid] at hs exact hs.trans (ENNReal.ofReal_le_ofReal hDeta) obtain ⟨hP0, hp0⟩ := oracleBumpPrimitive_membership d alpha beta gamma L eps H bn hL heps heps' hbn.le hbsmall hsmooth false obtain ⟨hP1, hp1⟩ := oracleBumpPrimitive_membership d alpha beta gamma L eps H bn hL heps heps' hbn.le hbsmall hsmooth true refine ⟨oracleBumpPrimitive d H bn false, oracleBumpPrimitive d H bn true, hP0, hP1, ?_, ?_, oracle_bump_hellinger_bound d H bn hH hH1 hbn.le hbsmall⟩ · intro x hx exact ⟨(hp0 x hx).1, (hp1 x hx).1, (hp0 x hx).2.1, (hp1 x hx).2.1⟩ · intro x hx constructor · simpa [thetaSign, H, bn] using (hp0 x hx).2.2 · simpa [thetaSign, H, bn] using (hp1 x hx).2.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_pair · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Lower/TwoPoint.lean:25
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.Projection 38 declarations Two-channel point-CATE annotation frontier: Projection constructions and obligations.

Projection

Two-channel point-CATE annotation frontier: Projection constructions and obligations.

def PolyIdx

Multi-indices of total degree at most two. Given the specified input d, poly idx is the corresponding construction.

Definition (Lean source)
d :
ℕ
PolyIdx d :
Type
{κ : Fin d → ℕ // (∑ i, κ i) ≤ 2}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.PolyIdx · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:33

Given the specified input d, the poly idx finite conclusion holds.

Formal statement
d :
ℕ
Finite (PolyIdx d)
Proof (Lean source)
lemma polyIdx_finite (d : ℕ) : Finite (PolyIdx d) := by let encode : PolyIdx d → (Fin d → Fin 3) := fun κ i => ⟨κ.1 i, Nat.lt_succ_of_le ((Finset.single_le_sum (fun j _ => zero_le (κ.1 j)) (Finset.mem_univ i)).trans κ.2)⟩ apply Finite.of_injective encode intro κ κ' h apply Subtype.ext funext i exact congrArg val (congrFun h i)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.polyIdx_finite · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:35
instance instFintypePolyIdx

For dimension d, the degree-at-most-two multi-indices form a finite type.

Definition (Lean source)
instance (d : ℕ) : Fintype (PolyIdx d) := @ofFinite _ (polyIdx_finite d)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.instFintypePolyIdx · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:45
def FineIdx

Given the specified input d, the specified input J, fine idx is the corresponding construction.

Definition (Lean source)
d J :
ℕ
FineIdx d J :
Type
(Fin d → Fin J) × PolyIdx d
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.FineIdx · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:47

Given the specified input d, the poly idx card conclusion holds.

Formal statement
d :
ℕ
card (PolyIdx d) = choose (d+2) 2
Proof (Lean source)
lemma polyIdx_card (d : ℕ) : card (PolyIdx d) = choose (d+2) 2 := by -- Add a slack coordinate to turn the degree bound into total degree exactly two. let slack : PolyIdx d ≃ {f : Fin (d+1) → ℕ // ∑ i, f i = 2} := { toFun := fun κ => ⟨Fin.cons (2 - ∑ i, κ.1 i) κ.1, by rw [Fin.sum_univ_succ] simp only [Fin.cons_zero, Fin.cons_succ] exact Nat.sub_add_cancel κ.2⟩ invFun := fun f => ⟨fun i => f.1 i.succ, by change (∑ i : Fin d, f.1 i.succ) ≤ 2 have hf := f.2 rw [Fin.sum_univ_succ] at hf omega⟩ left_inv := fun κ => by apply Subtype.ext funext i rfl right_inv := fun f => by apply Subtype.ext funext i refine Fin.cases ?_ (fun j => ?_) i · simp only [Fin.cons_zero] have hf := f.2 rw [Fin.sum_univ_succ] at hf omega · rfl } calc card (PolyIdx d) = card (Sym (Fin (d+1)) 2) := Fintype.card_congr (slack.trans (Sym.equivNatSumOfFintype (Fin (d+1)) 2).symm) _ = choose (d+2) 2 := by rw [Sym.card_sym_eq_choose, Fintype.card_fin] congr 1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.polyIdx_card · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:49

Given the specified input d, the specified input J, the fine idx card conclusion holds.

Formal statement
d J :
ℕ
card (FineIdx d J) = card (PolyIdx d) * J^d
Proof (Lean source)
lemma fineIdx_card (d J : ℕ) : card (FineIdx d J) = card (PolyIdx d) * J^d := by rw [Fintype.card_prod, Fintype.card_fun, Fintype.card_fin, Fintype.card_fin] exact Nat.mul_comm _ _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineIdx_card · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:81
def locCube

Given the specified input d, the specified input h, loc cube is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
locCube d h :
Set (Cov d)
{x | ∀ i, x i ∈ Icc (1/2-h/2) (1/2+h/2)}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locCube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:85
def locWeight

Given the specified input h, the specified input x, loc weight is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
x :
Cov d
locWeight h x :
ℝ
if x ∈ locCube d h then h^(-(d:ℝ)) else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locWeight · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:88
def locLaw

Given the specified input d, the specified input h, loc law is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
locLaw d h :
Measure (Cov d)
ofReal (h^(-(d:ℝ))) • volume.restrict (locCube d h)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.locLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:90
def legendre

Given the specified input k, the specified input u, legendre is the corresponding construction.

Definition (Lean source)
k :
ℕ
u :
ℝ
legendre k u :
ℝ
if k = 0 then 1 else if k = 1 then sqrt 12 * u else sqrt 5 * (6*u^2-1/2)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendre · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:93

Given the specified input h, the specified input x, coarse basis is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
x :
Cov d
κ :
coarseBasis h x κ :
ℝ
∏ i, legendre (κ.1 i) ((x i-1/2)/h)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coarseBasis · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:96
def r0

Given the specified input d, the specified input h, r0 is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
r0 d h :
PolyIdx d → ℝ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.r0 · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:99
def pv

Given the specified input h, the specified input v, the specified input x, pv is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
v :
PolyIdx d → ℝ
x :
Cov d
pv h v x :
ℝ
∑ κ, coarseBasis h x κ * v κ
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.pv · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:101
def cell

Given the specified input h, the specified input J, the specified input z, cell is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
J :
ℕ
z :
Fin d → Fin J
cell h J z :
Set (Cov d)
{x | ∀ i, 1/2-h/2 + (z i:ℝ)*(h/J) ≤ x i ∧ (if (z i).val + 1 = J then x i ≤ 1/2+h/2 else x i < 1/2-h/2 + ((z i:ℝ)+1)*(h/J))}
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cell · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:103
def fineBasis

Given the specified input h, the specified input J, the specified input x, the specified input z, fine basis is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
h :
ℝ
J :
ℕ
x :
Cov d
zκ :
fineBasis h J x zκ :
ℝ
if x ∈ cell h J zκ.1 then sqrt ((J:ℝ)^d) * ∏ i, legendre (zκ.2.1 i) ((x i-(1/2-h/2+((zκ.1 i:ℝ)+1/2)*(h/J)))/(h/J)) else 0
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineBasis · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:107
def fineKernel

Given the specified input d, the specified input h, the specified input J, the specified input x, the specified input xp, fine kernel is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
J :
ℕ
x xp :
Cov d
fineKernel d h J x xp :
ℝ
∑ z : FineIdx d J, fineBasis h J x z * fineBasis h J xp z
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:112
def projOp

Given the specified input d, the specified input h, the specified input J, the specified input f, the specified input x, proj op is the corresponding construction.

Definition (Lean source)
d :
ℕ
h :
ℝ
J :
ℕ
f :
Cov d → ℝ
x :
Cov d
projOp d h J f x :
ℝ
∫ xp, fineKernel d h J x xp * f xp ∂locLaw d h
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projOp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:116

Localization windows are closed boxes. Given the specified input d, the specified input h, the is closed loc cube conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
Proof (Lean source)
lemma isClosed_locCube (d : ℕ) (h : ℝ) : IsClosed (locCube d h) := by unfold locCube simp only [setOf_forall] apply isClosed_iInter intro i exact isClosed_Icc.preimage (by fun_prop)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.isClosed_locCube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:119

Given the specified input d, the specified input h, the specified input J, the specified input z, the measurable set cell conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
z :
Fin d → Fin J
MeasurableSet (cell h J z)
Proof (Lean source)
lemma measurableSet_cell (d : ℕ) (h : ℝ) (J : ℕ) (z : Fin d → Fin J) : MeasurableSet (cell h J z) := by unfold cell simp only [setOf_forall] apply MeasurableSet.iInter intro i by_cases hi : (z i).val + 1 = J · simp only [if_pos hi] exact (measurableSet_le measurable_const (show Measurable (fun x : Cov d => x i) by fun_prop)).inter (measurableSet_le (show Measurable (fun x : Cov d => x i) by fun_prop) measurable_const) · simp only [if_neg hi] exact (measurableSet_le measurable_const (show Measurable (fun x : Cov d => x i) by fun_prop)).inter (measurableSet_lt (show Measurable (fun x : Cov d => x i) by fun_prop) measurable_const)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurableSet_cell · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:127

Given the specified input k, the measurable legendre conclusion holds.

Formal statement
k :
ℕ
Proof (Lean source)
@[fun_prop] lemma measurable_legendre (k : ℕ) : Measurable (legendre k) := by unfold legendre split_ifs <;> fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_legendre · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:142

Given the specified input d, the specified input h, the specified input u, the measurable coarse basis conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
u :
Measurable (fun x : Cov d => coarseBasis h x u)
Proof (Lean source)
@[fun_prop] lemma measurable_coarseBasis (d : ℕ) (h : ℝ) (u : PolyIdx d) : Measurable (fun x : Cov d => coarseBasis h x u) := by unfold coarseBasis fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_coarseBasis · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:147

Given the specified input d, the specified input h, the measurable loc weight conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
Proof (Lean source)
@[fun_prop] lemma measurable_locWeight (d : ℕ) (h : ℝ) : Measurable (locWeight (d:=d) h) := by unfold locWeight exact Measurable.ite (isClosed_locCube d h).measurableSet measurable_const measurable_const
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_locWeight · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:153

Given the specified input d, the specified input h, the specified input J, the specified input z, the measurable fine basis conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
z :
Measurable (fun x : Cov d => fineBasis h J x z)
Proof (Lean source)
@[fun_prop] lemma measurable_fineBasis (d : ℕ) (h : ℝ) (J : ℕ) (z : FineIdx d J) : Measurable (fun x : Cov d => fineBasis h J x z) := by unfold fineBasis apply Measurable.ite (measurableSet_cell d h J z.1) <;> fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_fineBasis · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:159

Given the specified input d, the specified input h, the specified input J, the measurable fine kernel conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
Measurable (fun p : Cov d × Cov d => fineKernel d h J p.1 p.2)
Proof (Lean source)
@[fun_prop] lemma measurable_fineKernel (d : ℕ) (h : ℝ) (J : ℕ) : Measurable (fun p : Cov d × Cov d => fineKernel d h J p.1 p.2) := by unfold fineKernel fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.measurable_fineKernel · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:165
theorem legendre_interval_orthogonality Lemma legendre_interval_orthogonality in the paper ↗

Direct integration gives orthogonality for degrees zero, one and two on the reference interval. Given the specified input k, the specified input l, the specified input hk, the specified input hl, the legendre interval orthogonality conclusion holds.

Formal statement
k l :
ℕ
hk :
k ≤ 2
hl :
l ≤ 2
(∫ x in (-1/2:ℝ)..(1/2:ℝ), legendre k x * legendre l x) = if k = l then 1 else 0
Proof (Lean source)
lemma legendre_interval_orthogonality (k l : ℕ) (hk : k ≤ 2) (hl : l ≤ 2) : (∫ x in (-1/2:ℝ)..(1/2:ℝ), legendre k x * legendre l x) = if k = l then 1 else 0 := by interval_cases k <;> interval_cases l <;> norm_num [legendre] <;> (conv_lhs => arg 1; ext x; ring_nf) <;> simp (disch := apply Continuous.intervalIntegrable; fun_prop) [intervalIntegral.integral_add, intervalIntegral.integral_sub, intervalIntegral.integral_const_mul, intervalIntegral.integral_mul_const, integral_pow, integral_id, Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5), Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 12)] <;> norm_num <;> (rw [intervalIntegral.integral_const_mul, integral_id]; norm_num)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.legendre_interval_orthogonality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:171

For degree k, the corresponding Legendre polynomial is continuous on the real line.

Formal statement
k :
ℕ
Proof (Lean source)
@[fun_prop] lemma continuous_legendre (k : ℕ) : Continuous (legendre k) := by unfold legendre split_ifs <;> fun_prop
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.continuous_legendre · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:185
theorem scaled_legendre_orthogonality Lemma scaled_legendre_orthogonality in the paper ↗

Affine rescaling multiplies each one-dimensional orthogonality integral by the side length. Given the specified input h, the specified input hh, the specified input k, the specified input l, the specified input hk, the specified input hl, the scaled legendre orthogonality conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
k l :
ℕ
hk :
k ≤ 2
hl :
l ≤ 2
(∫ x in Icc (1/2-h/2) (1/2+h/2), legendre k ((x-1/2)/h) * legendre l ((x-1/2)/h))
= h * (if k = l then 1 else 0)
Proof (Lean source)
lemma scaled_legendre_orthogonality (h : ℝ) (hh : 0 < h) (k l : ℕ) (hk : k ≤ 2) (hl : l ≤ 2) : (∫ x in Icc (1/2-h/2) (1/2+h/2), legendre k ((x-1/2)/h) * legendre l ((x-1/2)/h)) = h * (if k = l then 1 else 0) := by rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith : (1/2-h/2:ℝ) ≤ 1/2+h/2)] simp_rw [sub_div] rw [intervalIntegral.integral_comp_div_sub (fun x => legendre k x * legendre l x) hh.ne' ((1/2)/h)] have ha : (1/2-h/2)/h - (1/2)/h = (-1/2:ℝ) := by field_simp; ring have hb : (1/2+h/2)/h - (1/2)/h = (1/2:ℝ) := by field_simp; ring rw [ha, hb, legendre_interval_orthogonality k l hk hl] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.scaled_legendre_orthogonality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:190
theorem euclidean_box_product_integral Lemma euclidean_box_product_integral in the paper ↗

Integration of a coordinate product over a Euclidean box factors into one-dimensional integrals. Given the specified input d, the specified input a, the specified input b, the specified input f, the euclidean box product integral conclusion holds.

Formal statement
d :
ℕ
a b :
ℝ
f :
Fin d → ℝ → ℝ
(∫ x : Cov d in {x | ∀ i, x i ∈ Icc a b}, ∏ i, f i (x i)) = ∏ i, ∫ x in Icc a b, f i x
Proof (Lean source)
lemma euclidean_box_product_integral (d : ℕ) (a b : ℝ) (f : Fin d → ℝ → ℝ) : (∫ x : Cov d in {x | ∀ i, x i ∈ Icc a b}, ∏ i, f i (x i)) = ∏ i, ∫ x in Icc a b, f i x := by have ht := (PiLp.volume_preserving_ofLp (Fin d)).setIntegral_preimage_emb (MeasurableEquiv.toLp 2 (Fin d → ℝ)).symm.measurableEmbedding (fun x : Fin d → ℝ => ∏ i, f i (x i)) (pi univ (fun _ => Icc a b)) change (∫ x : Cov d in ofLp ⁻¹' pi univ (fun _ => Icc a b), ∏ i, f i (x i)) = _ at ht rw [show {x : Cov d | ∀ i, x i ∈ Icc a b} = ofLp ⁻¹' pi univ (fun _ => Icc a b) by ext x; simp [Pi.le_def, forall_and]] rw [ht] change (∫ y : Fin d → ℝ, ∏ i, f i (y i) ∂(Measure.pi (fun _ => volume)).restrict _) = _ rw [Measure.restrict_pi_pi] exact integral_fintype_prod_eq_prod _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.euclidean_box_product_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:206
theorem euclidean_product_set_integral Lemma euclidean_product_set_integral in the paper ↗

Euclidean product-set integrals factor across arbitrary coordinate sets. Given the specified input d, the specified input s, the specified input f, the euclidean product set integral conclusion holds.

Formal statement
d :
ℕ
s :
Fin d → Set ℝ
f :
Fin d → ℝ → ℝ
(∫ x : Cov d in {x | ∀ i, x i ∈ s i}, ∏ i, f i (x i)) = ∏ i, ∫ x in s i, f i x
Proof (Lean source)
lemma euclidean_product_set_integral (d : ℕ) (s : Fin d → Set ℝ) (f : Fin d → ℝ → ℝ) : (∫ x : Cov d in {x | ∀ i, x i ∈ s i}, ∏ i, f i (x i)) = ∏ i, ∫ x in s i, f i x := by have ht := (PiLp.volume_preserving_ofLp (Fin d)).setIntegral_preimage_emb (MeasurableEquiv.toLp 2 (Fin d → ℝ)).symm.measurableEmbedding (fun x : Fin d → ℝ => ∏ i, f i (x i)) (pi univ s) change (∫ x : Cov d in ofLp ⁻¹' pi univ s, ∏ i, f i (x i)) = _ at ht rw [show {x : Cov d | ∀ i, x i ∈ s i} = ofLp ⁻¹' pi univ s by ext x; simp only [Set.mem_setOf_eq, Set.mem_preimage, Set.mem_pi, Set.mem_univ, forall_const]] rw [ht] change (∫ y : Fin d → ℝ, ∏ i, f i (y i) ∂(Measure.pi (fun _ => volume)).restrict _) = _ rw [Measure.restrict_pi_pi] exact integral_fintype_prod_eq_prod _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.euclidean_product_set_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:222
theorem centered_legendre_orthogonality Lemma centered_legendre_orthogonality in the paper ↗

A centered cell of any positive side length has the same Legendre orthogonality. Given the specified input c, the specified input t, the specified input ht, the specified input k, the specified input l, the specified input hk, the specified input hl, the centered legendre orthogonality conclusion holds.

Formal statement
c t :
ℝ
ht :
0 < t
k l :
ℕ
hk :
k ≤ 2
hl :
l ≤ 2
(∫ x in Icc (c-t/2) (c+t/2), legendre k ((x-c)/t) * legendre l ((x-c)/t))
= t * (if k = l then 1 else 0)
Proof (Lean source)
lemma centered_legendre_orthogonality (c t : ℝ) (ht : 0 < t) (k l : ℕ) (hk : k ≤ 2) (hl : l ≤ 2) : (∫ x in Icc (c-t/2) (c+t/2), legendre k ((x-c)/t) * legendre l ((x-c)/t)) = t * (if k = l then 1 else 0) := by rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith : c-t/2 ≤ c+t/2)] simp_rw [sub_div] rw [intervalIntegral.integral_comp_div_sub (fun x => legendre k x * legendre l x) ht.ne' (c/t)] have ha : (c-t/2)/t - c/t = (-1/2:ℝ) := by field_simp; ring have hb : (c+t/2)/t - c/t = (1/2:ℝ) := by field_simp; ring rw [ha, hb, legendre_interval_orthogonality k l hk hl] rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.centered_legendre_orthogonality · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:240

Every cell stays inside the localization box, including its assigned upper face. Given the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the cell subset loc cube conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z :
Fin d → Fin J
cell h J z ⊆ locCube d h
Proof (Lean source)
lemma cell_subset_locCube (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z : Fin d → Fin J) : cell h J z ⊆ locCube d h := by have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj intro x hx i have hi := hx i have hz : (z i:ℝ) + 1 ≤ J := by exact_mod_cast (z i).isLt constructor · have hn : 0 ≤ (z i:ℝ)*(h/J) := mul_nonneg (Nat.cast_nonneg _) ht.le linarith [hi.1] · by_cases hf : (z i).val + 1 = J · simpa only [if_pos hf] using hi.2 · have hu : ((z i:ℝ)+1)*(h/J) ≤ h := by calc _ ≤ (J:ℝ)*(h/J) := mul_le_mul_of_nonneg_right hz ht.le _ = h := by field_simp have hi' := hi.2 rw [if_neg hf] at hi' linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cell_subset_locCube · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:256

Distinct half-open grid cells are disjoint. Given the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the specified input w, the specified input hzw, the cells disjoint conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z w :
Fin d → Fin J
hzw :
z ≠ w
Disjoint (cell h J z) (cell h J w)
Proof (Lean source)
lemma cells_disjoint (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z w : Fin d → Fin J) (hzw : z ≠ w) : Disjoint (cell h J z) (cell h J w) := by have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj have hne : ∃ i, z i ≠ w i := by by_contra hn apply hzw funext i exact not_ne_iff.mp (not_exists.mp hn i) obtain ⟨i, hi⟩ := hne apply Set.disjoint_left.mpr intro x hx hy have horder (z w : Fin J) (hlt : z < w) (hz : 1/2-h/2+(z:ℝ)*(h/J) ≤ x i ∧ (if z.val+1 = J then x i ≤ 1/2+h/2 else x i < 1/2-h/2+((z:ℝ)+1)*(h/J))) (hw : 1/2-h/2+(w:ℝ)*(h/J) ≤ x i) : False := by have hfinal : z.val+1 ≠ J := by have := w.isLt; change z.val < w.val at hlt; omega rw [if_neg hfinal] at hz have hle : (z:ℝ)+1 ≤ w := by exact_mod_cast hlt have hm := mul_le_mul_of_nonneg_right hle ht.le linarith [hz.2] rcases lt_or_gt_of_ne hi with hlt | hlt · exact horder (z i) (w i) hlt (hx i) (hy i).1 · exact horder (w i) (z i) hlt (hy i) (hx i).1
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cells_disjoint · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:277
theorem cell_legendre_product_integral Lemma cell_legendre_product_integral in the paper ↗

Cell face assignments do not change the product Legendre integrals. Given the specified input h, the specified input J, the specified input hh, the specified input hJ, the specified input z, the specified input u, the specified input v, the cell legendre product integral conclusion holds.

Formal statement
d :
ℕ
shared
h :
ℝ
J :
ℕ
hh :
0 < h
hJ :
1 ≤ J
z :
Fin d → Fin J
u v :
(∫ x in cell h J z, ∏ i, legendre (u.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J)) * legendre (v.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J)))
= (h/(J:ℝ))^d * (if u = v then 1 else 0)
Proof (Lean source)
lemma cell_legendre_product_integral (h : ℝ) (J : ℕ) (hh : 0 < h) (hJ : 1 ≤ J) (z : Fin d → Fin J) (u v : PolyIdx d) : (∫ x in cell h J z, ∏ i, legendre (u.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J)) * legendre (v.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J))) = (h/(J:ℝ))^d * (if u = v then 1 else 0) := by classical have hj : (0:ℝ) < J := by exact_mod_cast hJ have ht : 0 < h/(J:ℝ) := div_pos hh hj let c : Fin d → ℝ := fun i => 1/2-h/2+((z i:ℝ)+1/2)*(h/J) let s : Fin d → Set ℝ := fun i => if (z i).val+1 = J then Icc (c i-(h/J)/2) (c i+(h/J)/2) else Ico (c i-(h/J)/2) (c i+(h/J)/2) have hlo (i : Fin d) : c i-(h/J)/2 = 1/2-h/2+(z i:ℝ)*(h/J) := by dsimp [c]; ring have hup (i : Fin d) : c i+(h/J)/2 = 1/2-h/2+((z i:ℝ)+1)*(h/J) := by dsimp [c]; ring have hfinal (i : Fin d) (hi : (z i).val+1 = J) : c i+(h/J)/2 = 1/2+h/2 := by rw [hup] have hz : (z i:ℝ)+1 = J := by exact_mod_cast hi rw [hz] field_simp ring have hs : cell h J z = {x : Cov d | ∀ i, x i ∈ s i} := by ext x simp only [cell, Set.mem_setOf_eq] apply forall_congr' intro i by_cases hi : (z i).val+1 = J · simp only [s, if_pos hi, Set.mem_Icc, hlo, hfinal i hi] · simp only [s, if_neg hi, Set.mem_Ico, hlo, hup] rw [hs, euclidean_product_set_integral d s (fun i x => legendre (u.1 i) ((x-c i)/(h/J)) * legendre (v.1 i) ((x-c i)/(h/J)))] have hk (w : PolyIdx d) (i : Fin d) : w.1 i ≤ 2 := (Finset.single_le_sum (fun j _ => zero_le (w.1 j)) (Finset.mem_univ i)).trans w.2 have hint (i : Fin d) : (∫ x in s i, legendre (u.1 i) ((x-c i)/(h/J)) * legendre (v.1 i) ((x-c i)/(h/J))) = (h/J) * (if u.1 i = v.1 i then 1 else 0) := by by_cases hi : (z i).val+1 = J · simp only [s, if_pos hi] exact centered_legendre_orthogonality (c i) (h/J) ht _ _ (hk u i) (hk v i) · simp only [s, if_neg hi] rw [restrict_Ico_eq_restrict_Icc] exact centered_legendre_orthogonality (c i) (h/J) ht _ _ (hk u i) (hk v i) simp_rw [hint] rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, Fintype.card_fin] congr 1 by_cases huv : u = v · subst v; simp · rw [if_neg huv] have hne : ∃ i, u.1 i ≠ v.1 i := by by_contra hn apply huv apply Subtype.ext funext i exact not_ne_iff.mp (not_exists.mp hn i) obtain ⟨i, hi⟩ := hne exact Finset.prod_eq_zero (Finset.mem_univ i) (if_neg hi)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.cell_legendre_product_integral · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:302

The scaled coarse Legendre basis is orthonormal under localization measure. Given the specified input d, the specified input h, the specified input hh, the specified input hh', the specified input u, the specified input v, the coarse orthonormal conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
hh :
0 < h
hh' :
h ≤ 1/2
u v :
(∫ x, coarseBasis h x u * coarseBasis h x v ∂locLaw d h) = if u = v then 1 else 0
Proof (Lean source)
lemma coarse_orthonormal (d : ℕ) (h : ℝ) (hh : 0 < h) (hh' : h ≤ 1/2) (u v : PolyIdx d) : (∫ x, coarseBasis h x u * coarseBasis h x v ∂locLaw d h) = if u = v then 1 else 0 := by classical rw [locLaw, integral_smul_measure, ENNReal.toReal_ofReal (by positivity)] simp only [coarseBasis, ← Finset.prod_mul_distrib] rw [locCube] rw [euclidean_box_product_integral d (1/2-h/2) (1/2+h/2) (fun i x => legendre (u.1 i) ((x-1/2)/h) * legendre (v.1 i) ((x-1/2)/h))] simp only [smul_eq_mul] have hk (w : PolyIdx d) (i : Fin d) : w.1 i ≤ 2 := (Finset.single_le_sum (fun j _ => zero_le (w.1 j)) (Finset.mem_univ i)).trans w.2 simp_rw [scaled_legendre_orthogonality h hh _ _ (hk u _) (hk v _)] rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, Fintype.card_fin] have hnorm : h ^ (-(d:ℝ)) * h^d = 1 := by rw [Real.rpow_neg hh.le, Real.rpow_natCast, inv_mul_cancel₀ (pow_ne_zero _ hh.ne')] rw [← mul_assoc, hnorm, one_mul] by_cases huv : u = v · subst v simp · rw [if_neg huv] have hne : ∃ i, u.1 i ≠ v.1 i := by by_contra hn apply huv apply Subtype.ext funext i exact not_ne_iff.mp (not_exists.mp hn i) obtain ⟨i, hi⟩ := hne exact Finset.prod_eq_zero (Finset.mem_univ i) (if_neg hi)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.coarse_orthonormal · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:360

The cellwise Legendre basis is orthonormal, including the assigned grid faces. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the specified input v, the fine orthonormal conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u v :
(∫ x, fineBasis h J x u * fineBasis h J x v ∂locLaw d h) = if u = v then 1 else 0
Proof (Lean source)
lemma fine_orthonormal (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u v : FineIdx d J) : (∫ x, fineBasis h J x u * fineBasis h J x v ∂locLaw d h) = if u = v then 1 else 0 := by classical by_cases hz : u.1 = v.1 · rcases u with ⟨z, u⟩ rcases v with ⟨w, v⟩ dsimp only at hz subst w have heq (x : Cov d) : fineBasis h J x (z,u) * fineBasis h J x (z,v) = (cell h J z).indicator (fun x => (J:ℝ)^d * ∏ i, legendre (u.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J)) * legendre (v.1 i) ((x i-(1/2-h/2+((z i:ℝ)+1/2)*(h/J)))/(h/J))) x := by by_cases hx : x ∈ cell h J z · simp only [fineBasis, hx, if_true, Set.indicator_of_mem hx] rw [Finset.prod_mul_distrib] rw [mul_mul_mul_comm, ← pow_two, Real.sq_sqrt (show (0:ℝ) ≤ (J:ℝ)^d by positivity)] · simp [fineBasis, hx] simp_rw [heq] rw [locLaw, integral_smul_measure, ENNReal.toReal_ofReal (by positivity), integral_indicator (measurableSet_cell d h J z), Measure.restrict_restrict (measurableSet_cell d h J z), Set.inter_eq_left.mpr (cell_subset_locCube h J hh hJ z), integral_const_mul, cell_legendre_product_integral h J hh hJ z u v] simp only [smul_eq_mul, Prod.mk.injEq, true_and] have hj : (J:ℝ) ≠ 0 := by exact_mod_cast (show J ≠ 0 by omega) have hnorm : h ^ (-(d:ℝ)) * (J:ℝ)^d * (h/(J:ℝ))^d = 1 := by rw [Real.rpow_neg hh.le, Real.rpow_natCast, div_pow] field_simp simp only [← mul_assoc] rw [hnorm, one_mul] · rw [if_neg (fun huv => hz (congrArg fst huv))] have hzero (x : Cov d) : fineBasis h J x u * fineBasis h J x v = 0 := by by_cases hu : x ∈ cell h J u.1 · have hv : x ∉ cell h J v.1 := fun hv => Set.disjoint_left.mp (cells_disjoint h J hh hJ u.1 v.1 hz) hu hv simp [fineBasis, hv] · simp [fineBasis, hu] simp_rw [hzero] exact integral_zero _ _
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fine_orthonormal · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:389

The diagonal orthonormality integral supplies square integrability of each fine basis entry. Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input u, the fine basis mem lp conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
u :
MemLp (fun x => fineBasis h J x u) 2 (locLaw d h)
Proof (Lean source)
lemma fineBasis_memLp (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (u : FineIdx d J) : MemLp (fun x => fineBasis h J x u) 2 (locLaw d h) := by apply (memLp_two_iff_integrable_sq (by fun_prop)).2 by_contra hi have hz := integral_undef hi have ho := fine_orthonormal d h J hh hh' hJ u u simp only [ite_true, ← pow_two] at ho rw [hz] at ho norm_num at ho
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.fineBasis_memLp · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:430

Given the specified input d, the specified input h, the specified input J, the specified input hh, the specified input hh', the specified input hJ, the specified input f, the specified input hf, the projection pythagoras conclusion holds.

Formal statement
d :
ℕ
h :
ℝ
J :
ℕ
hh :
0 < h
hh' :
h ≤ 1/2
hJ :
1 ≤ J
f :
Cov d → ℝ
hf :
MemLp f 2 (locLaw d h)
(∫ x, f x^2 ∂locLaw d h)
= (∫ x, (projOp d h J f x)^2 ∂locLaw d h) + (∫ x, (f x - projOp d h J f x)^2 ∂locLaw d h)
Proof (Lean source)
lemma projection_pythagoras (d : ℕ) (h : ℝ) (J : ℕ) (hh : 0 < h) (hh' : h ≤ 1/2) (hJ : 1 ≤ J) (f : Cov d → ℝ) (hf : MemLp f 2 (locLaw d h)) : (∫ x, f x^2 ∂locLaw d h) = (∫ x, (projOp d h J f x)^2 ∂locLaw d h) + (∫ x, (f x - projOp d h J f x)^2 ∂locLaw d h) := by have hb := fineBasis_memLp d h J hh hh' hJ have hexpand (x : Cov d) : projOp d h J f x = ∑ i : FineIdx d J, fineBasis h J x i * (∫ y, fineBasis h J y i * f y ∂locLaw d h) := by unfold projOp fineKernel simp_rw [Finset.sum_mul, mul_assoc] rw [integral_finsetSum (f := fun i y => fineBasis h J x i * (fineBasis h J y i * f y)) univ (fun i _ => ((hb i).integrable_mul hf).const_mul (fineBasis h J x i))] simp_rw [integral_const_mul] simp_rw [hexpand] exact finite_orthonormal_pythagoras (locLaw d h) (fun i x => fineBasis h J x i) hb (fun i j => by have ho := fine_orthonormal d h J hh hh' hJ i j by_cases hij : i = j · simp only [if_pos hij] at ho ⊢; exact ho · simp only [if_neg hij] at ho ⊢; exact ho) f hf
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.projection_pythagoras · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:442
def taylorPoly

Given the specified input f, the specified input p, the specified input x, taylor poly is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
f :
Cov d → ℝ
p :
ℕ
x :
Cov d
taylorPoly f p x :
ℝ
∑ κ ∈ Finset.univ.filter (fun κ : PolyIdx d => multiOrder κ.1 ≤ p), coordinatePartial f κ.1 (x0 d) / (∏ i, (factorial (κ.1 i) : ℝ)) * ∏ i, (x i - 1/2)^(κ.1 i)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.taylorPoly · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/Projection.lean:464
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.T_AnnotationThreshold 13 declarations Two-channel point-CATE annotation frontier: T_AnnotationThreshold constructions and obligations.

T_AnnotationThreshold

Two-channel point-CATE annotation frontier: T_AnnotationThreshold constructions and obligations.

theorem published_benchmark_eq_supervised_rate Lemma published_benchmark_eq_supervised_rate in the paper ↗

Kennedy, Balakrishnan, Robins and Wasserman (2024), Section 3, Theorem 1, has exactly the same numerical supervised exponents and cutoff after substituting the nuisance-average smoothness. This is only a descriptive formula comparison. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input n, the published benchmark eq supervised rate conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
n :
ℕ
kbrwBenchmarkRate d alpha beta gamma n = sharpRate d alpha beta gamma n 0
Proof (Lean source)
lemma published_benchmark_eq_supervised_rate (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (n : ℕ) : kbrwBenchmarkRate d alpha beta gamma n = sharpRate d alpha beta gamma n 0 := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hA : 0 < 2*gamma+(d:ℝ) := by positivity have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity have hden : 0 < 1+(d:ℝ)/(2*gamma) := by positivity have hcut : ((d:ℝ)/4)/(1+(d:ℝ)/(2*gamma)) = sCrit d gamma/2 := by dsimp [sCrit] field_simp <;> ring have hpair : 1/(1+(d:ℝ)/(2*gamma)+(d:ℝ)/(4*((alpha+beta)/2))) = 2*gamma/bigDelta d alpha beta gamma := by dsimp [bigDelta] field_simp <;> ring have horacle : 1/(2+(d:ℝ)/gamma) = gamma/(2*gamma+(d:ℝ)) := by field_simp have hcond : (alpha+beta)/2 < ((d:ℝ)/4)/(1+(d:ℝ)/(2*gamma)) ↔ alpha+beta < sCrit d gamma := by rw [hcut]; constructor <;> intro h <;> linarith unfold kbrwBenchmarkRate simp only [hcond, hpair, horacle] by_cases hn : 2 ≤ n · obtain ⟨hsmall, hlarge⟩ := supervised_rate_branches d alpha beta gamma L eps hdom n hn by_cases hs : alpha+beta < sCrit d gamma · rw [if_pos hs, hsmall hs] · rw [if_neg hs, hlarge (le_of_not_gt hs)] rfl · have hn01 : n = 0 ∨ n = 1 := by omega rcases hn01 with rfl | rfl · have ho : -(gamma/(2*gamma+(d:ℝ))) ≠ 0 := ne_of_lt (neg_neg_of_pos (div_pos hg hA)) have hp : -(gamma/bigDelta d alpha beta gamma) ≠ 0 := ne_of_lt (neg_neg_of_pos (div_pos hg hD)) have hp2 : -(2*gamma/bigDelta d alpha beta gamma) ≠ 0 := ne_of_lt (neg_neg_of_pos (div_pos (mul_pos (by norm_num) hg) hD)) simp only [sharpRate, Nat.cast_zero, add_zero, zero_mul] change (if alpha+beta < sCrit d gamma then _ else _) = max ((0:ℝ)^(-(gamma/(2*gamma+(d:ℝ))))) ((0:ℝ)^(-(gamma/bigDelta d alpha beta gamma))) split_ifs <;> simp [Real.zero_rpow, ho, hp, hp2] · split_ifs <;> simp [sharpRate]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.published_benchmark_eq_supervised_rate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:29
theorem published_cate_benchmark Lemma 7 in the paper ↗

For positive dimension, positive first nuisance smoothness, positive second nuisance smoothness, and effect smoothness at least one, the published point-CATE benchmark's two exponent identities, cutoff equivalence, and piecewise maximum formula all hold.

Formal statement
d :
ℕ
alpha beta gamma :
ℝ
PublishedCateBenchmark d alpha beta gamma
Proof (Lean source)
lemma published_cate_benchmark (d : ℕ) (alpha beta gamma : ℝ) : PublishedCateBenchmark d alpha beta gamma := by intro hd ha hb hg have hd0 : 0 < (d : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hd) have hg0 : 0 < gamma := lt_of_lt_of_le zero_lt_one hg have hS : 0 < alpha + beta := add_pos ha hb have hA : 0 < 2 * gamma + (d : ℝ) := by positivity have hD : 0 < 2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta) := by positivity have hpair : 1 / (1 + (d : ℝ) / (2 * gamma) + (d : ℝ) / (4 * ((alpha + beta) / 2))) = 2 * gamma / (2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta)) := by field_simp <;> ring have horacle : 1 / (2 + (d : ℝ) / gamma) = gamma / (2 * gamma + (d : ℝ)) := by field_simp have hcutEq : ((d : ℝ) / 4) / (1 + (d : ℝ) / (2 * gamma)) = (gamma * (d : ℝ) / (2 * gamma + (d : ℝ))) / 2 := by field_simp <;> ring have hcut : (alpha + beta) / 2 < ((d : ℝ) / 4) / (1 + (d : ℝ) / (2 * gamma)) ↔ alpha + beta < gamma * (d : ℝ) / (2 * gamma + (d : ℝ)) := by rw [hcutEq] constructor <;> intro h <;> linarith refine ⟨hpair, horacle, hcut, ?_⟩ intro n hn have hn1 : 1 ≤ (n : ℝ) := by exact_mod_cast (show 1 ≤ n by omega) unfold kbrwBenchmarkRate rw [hpair, horacle] by_cases hs : alpha + beta < gamma * (d : ℝ) / (2 * gamma + (d : ℝ)) · rw [if_pos (hcut.mpr hs)] symm apply max_eq_right apply Real.rpow_le_rpow_of_exponent_le hn1 have hSA : (alpha + beta) * (2 * gamma + (d : ℝ)) < gamma * (d : ℝ) := (lt_div_iff₀ hA).mp hs have hAS : 2 * gamma + (d : ℝ) < gamma * (d : ℝ) / (alpha + beta) := by apply (lt_div_iff₀ hS).mpr nlinarith have htwice : 2 * (2 * gamma + (d : ℝ)) ≤ 2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta) := by linarith have hexp : 2 * gamma / (2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta)) ≤ gamma / (2 * gamma + (d : ℝ)) := by apply (div_le_div_iff₀ hD hA).mpr nlinarith [mul_le_mul_of_nonneg_left htwice hg0.le] linarith · rw [if_neg (mt hcut.mp hs)] symm apply max_eq_left apply Real.rpow_le_rpow_of_exponent_le hn1 have hs' : gamma * (d : ℝ) / (2 * gamma + (d : ℝ)) ≤ alpha + beta := le_of_not_gt hs have hgd : gamma * (d : ℝ) ≤ (alpha + beta) * (2 * gamma + (d : ℝ)) := (div_le_iff₀ hA).mp hs' have hquot : gamma * (d : ℝ) / (alpha + beta) ≤ 2 * gamma + (d : ℝ) := by apply (div_le_iff₀ hS).mpr nlinarith have htwice : 2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta) ≤ 2 * (2 * gamma + (d : ℝ)) := by linarith have hexp : gamma / (2 * gamma + (d : ℝ)) ≤ 2 * gamma / (2 * gamma + (d : ℝ) + gamma * (d : ℝ) / (alpha + beta)) := by apply (div_le_div_iff₀ hA hD).mpr nlinarith [mul_le_mul_of_nonneg_left htwice hg0.le] linarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.published_cate_benchmark · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:75

The frontier lower bound and its explicit decision give both sample-growth directions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the annotation acquisition conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
r :
sharpRate d alpha beta gamma
∃ c C : ℝ,
0 < c
0 < C
conclusion 1
epsilon :
ℝ
0 < epsilon
epsilon < 1
n m :
ℕ
2 ≤ n
(∃ T : Decision d n m, ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk T P hP ≤ ofReal epsilon)
c*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ)
c*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
C*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ)
C*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ P hP ≤ ofReal epsilon
r n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧
epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
(n:ℝ) ≤ (n:ℝ)+m
Proof (Lean source)
lemma annotation_acquisition (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : let r := sharpRate d alpha beta gamma ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ -- @realizes c(positive necessity constant) @realizes C(finite positive sufficiency constant) ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 → -- @realizes epsilon(target absolute-error scale) ∀ (n m : ℕ), 2 ≤ n → ((∃ T : Decision d n m, ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk T P hP ≤ ofReal epsilon) → c*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧ c*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)) ∧ (C*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) → C*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m) → ∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ P hP ≤ ofReal epsilon) ∧ (r n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧ epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)) ∧ (n:ℝ) ≤ (n:ℝ)+m := by obtain ⟨cF, CF, hcF, hcFC, hfrontier⟩ := sharp_annotation_frontier d alpha beta gamma L eps hdom have hCF : 0 < CF := hcF.trans_le hcFC let p0 : ℝ := 2+(d:ℝ)/gamma let p1 : ℝ := 2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta) have hscale (e c p : ℝ) (he : 0 < e) (hc : 0 < c) : (e/c)^(-p) = c^p * e^(-p) := by rw [Real.div_rpow he.le hc.le, Real.rpow_neg hc.le, div_eq_mul_inv, inv_inv] ring refine ⟨min (cF^p0) (cF^p1), max (CF^p0) (CF^p1), lt_min (by positivity) (by positivity), lt_of_lt_of_le (by positivity : 0 < CF^p0) (le_max_left _ _), ?_⟩ intro epsilon he he1 n m hn obtain ⟨hMeas, hlower, hmin, hupper, hall, hbranches⟩ := hfrontier n m hn refine ⟨?_, ?_, sharpRate_acquisition_iff d alpha beta gamma L eps hdom n m hn epsilon he, le_add_of_nonneg_right (Nat.cast_nonneg m)⟩ · rintro ⟨T, hT⟩ have hminT : minimaxRisk d alpha beta gamma L eps n m ≤ ofReal epsilon := (minimaxValueENNReal_le_worstCaseRisk T).trans (worstCaseRiskENNReal_le (fun P => hT P.1 P.2)) have hreal : cF*sharpRate d alpha beta gamma n m ≤ epsilon := (ENNReal.ofReal_le_ofReal_iff he.le).mp (hlower.trans hminT) have hr : sharpRate d alpha beta gamma n m ≤ epsilon/cF := (le_div_iff₀ hcF).mpr (by nlinarith [hreal]) obtain ⟨h0, h1⟩ := (sharpRate_acquisition_iff d alpha beta gamma L eps hdom n m hn (epsilon/cF) (div_pos he hcF)).mp hr change (epsilon/cF)^(-p0) ≤ (n:ℝ) at h0 change (epsilon/cF)^(-p1) ≤ (n:ℝ)*((n:ℝ)+m) at h1 rw [hscale epsilon cF p0 he hcF] at h0 rw [hscale epsilon cF p1 he hcF] at h1 exact ⟨(mul_le_mul_of_nonneg_right (min_le_left _ _) (by positivity)).trans h0, (mul_le_mul_of_nonneg_right (min_le_right _ _) (by positivity)).trans h1⟩ · intro h0 h1 have hr : sharpRate d alpha beta gamma n m ≤ epsilon/CF := by apply (sharpRate_acquisition_iff d alpha beta gamma L eps hdom n m hn (epsilon/CF) (div_pos he hCF)).mpr change (epsilon/CF)^(-p0) ≤ (n:ℝ) ∧ (epsilon/CF)^(-p1) ≤ (n:ℝ)*((n:ℝ)+m) rw [hscale epsilon CF p0 he hCF, hscale epsilon CF p1 he hCF] exact ⟨(mul_le_mul_of_nonneg_right (le_max_left _ _) (by positivity)).trans h0, (mul_le_mul_of_nonneg_right (le_max_right _ _) (by positivity)).trans h1⟩ refine ⟨hMeas, ?_⟩ intro P hP have hpoint : risk ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ P hP ≤ ofReal (CF*sharpRate d alpha beta gamma n m) := (le_worstCaseRiskENNReal (risk := classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ (⟨P, hP⟩ : {P : PrimitiveLaw d // PrimitiveClass alpha beta gamma L eps P})).trans hupper apply hpoint.trans apply ENNReal.ofReal_le_ofReal have hh := (le_div_iff₀ hCF).mp hr nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_acquisition · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:153

Finite extended-real bounds retain both inequalities after taking real values. Given the specified input R, the specified input a, the specified input b, the specified input ha, the specified input hb, the specified input hl, the specified input hu, the risk to real sandwich conclusion holds.

Formal statement
R :
ℝ≥0∞
a b :
ℝ
ha :
0 ≤ a
hb :
0 ≤ b
hl :
ofReal a ≤ R
hu :
R ≤ ofReal b
conclusion 1
a ≤ R.toReal
conclusion 2
R.toReal ≤ b
Proof (Lean source)
lemma risk_toReal_sandwich (R : ℝ≥0∞) (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hl : ofReal a ≤ R) (hu : R ≤ ofReal b) : a ≤ R.toReal ∧ R.toReal ≤ b := by have hfinite : R ≠ ⊤ := ne_top_of_le_ne_top ENNReal.ofReal_ne_top hu refine ⟨?_, ENNReal.toReal_le_of_le_ofReal hb hu⟩ simpa only [ENNReal.toReal_ofReal ha] using ENNReal.toReal_mono hfinite hl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.risk_toReal_sandwich · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:228
theorem smooth_oracle_risk_ratio Lemma smooth_oracle_risk_ratio in the paper ↗

In the smooth regime the frontier upper bound divided by the oracle floor is uniform. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input hs, the smooth oracle risk ratio conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
hs :
sCrit d gamma ≤ alpha+beta
∃ K : ℝ,
0 < K
conclusion 1
n m :
2 ≤ n
(minimaxRisk d alpha beta gamma L eps n m).toReal / (oracleRisk d alpha beta gamma L eps n m).toReal
≤ K
Proof (Lean source)
lemma smooth_oracle_risk_ratio (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (hs : sCrit d gamma ≤ alpha+beta) : ∃ K : ℝ, 0 < K ∧ ∀ n m, 2 ≤ n → (minimaxRisk d alpha beta gamma L eps n m).toReal / (oracleRisk d alpha beta gamma L eps n m).toReal ≤ K := by obtain ⟨cF, CF, hcF, hcFC, hfrontier⟩ := sharp_annotation_frontier d alpha beta gamma L eps hdom obtain ⟨cO, CO, hcO, hcOC, horacle⟩ := supplied_propensity d alpha beta gamma L eps hdom have hCF : 0 < CF := hcF.trans_le hcFC have hCO : 0 < CO := hcO.trans_le hcOC refine ⟨CF/cO, div_pos hCF hcO, ?_⟩ intro n m hn have hnpos : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have hro : 0 < oracleRate d gamma n := Real.rpow_pos_of_pos hnpos _ obtain ⟨hMeas, hl, hm, hu, hall, hbranches⟩ := hfrontier n m hn rw [hbranches.1 hs] at hl have hupper := hm.trans hu rw [hbranches.1 hs] at hupper have hrealF := risk_toReal_sandwich _ _ _ (mul_pos hcF hro).le (mul_pos hCF hro).le hl hupper have hrealO := risk_toReal_sandwich _ _ _ (mul_pos hcO hro).le (mul_pos hCO hro).le (horacle n m hn).1 (horacle n m hn).2.1 have hden : 0 < (oracleRisk d alpha beta gamma L eps n m).toReal := (mul_pos hcO hro).trans_le hrealO.1 apply (div_le_iff₀ hden).mpr calc (minimaxRisk d alpha beta gamma L eps n m).toReal ≤ CF * oracleRate d gamma n := hrealF.2 _ = (CF/cO) * (cO * oracleRate d gamma n) := by field_simp _ ≤ (CF/cO) * (oracleRisk d alpha beta gamma L eps n m).toReal := mul_le_mul_of_nonneg_left hrealO.1 (div_pos hCF hcO).le
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.smooth_oracle_risk_ratio · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:236
theorem sharpRate_bounded_auxiliary_comparison Lemma sharpRate_bounded_auxiliary_comparison in the paper ↗

Bounded auxiliary counts change either branch of the maximum rate by only a fixed factor. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input K, the specified input hK, the specified input n, the specified input m, the specified input hn, the specified input hm, the sharp rate bounded auxiliary comparison conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
K :
ℝ
hK :
0 ≤ K
n m :
ℕ
hn :
2 ≤ n
hm :
(m:ℝ) ≤ K*(n:ℝ)
conclusion 1
sharpRate d alpha beta gamma n m ≤ sharpRate d alpha beta gamma n 0
conclusion 2
sharpRate d alpha beta gamma n 0
≤ (1+K)^(gamma/bigDelta d alpha beta gamma) * sharpRate d alpha beta gamma n m
Proof (Lean source)
lemma sharpRate_bounded_auxiliary_comparison (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (K : ℝ) (hK : 0 ≤ K) (n m : ℕ) (hn : 2 ≤ n) (hm : (m:ℝ) ≤ K*(n:ℝ)) : sharpRate d alpha beta gamma n m ≤ sharpRate d alpha beta gamma n 0 ∧ sharpRate d alpha beta gamma n 0 ≤ (1+K)^(gamma/bigDelta d alpha beta gamma) * sharpRate d alpha beta gamma n m := by have hg : 0 < gamma := lt_of_lt_of_le zero_lt_one hdom.2.2.2.2.2.1 have hS : 0 < alpha+beta := add_pos hdom.2.1 hdom.2.2.2.1 have hD : 0 < bigDelta d alpha beta gamma := by dsimp [bigDelta]; positivity have hnpos : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) let p : ℝ := gamma/bigDelta d alpha beta gamma let M : ℝ := (1+K)^p have hp : 0 < p := div_pos hg hD have hM : 0 < M := Real.rpow_pos_of_pos (by linarith) _ have hM1 : 1 ≤ M := Real.one_le_rpow (by linarith) hp.le have hbase : (n:ℝ)*(n:ℝ) ≤ (n:ℝ)*((n:ℝ)+m) := by nlinarith [show (0:ℝ) ≤ m from Nat.cast_nonneg m] have hbase' : (n:ℝ)*((n:ℝ)+m) ≤ (1+K)*((n:ℝ)*(n:ℝ)) := by nlinarith have hpair := Real.rpow_le_rpow_of_nonpos (mul_pos hnpos hnpos) hbase (neg_nonpos.mpr hp.le) have hpair' := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < (n:ℝ)*((n:ℝ)+m)) hbase' (neg_nonpos.mpr hp.le) rw [Real.mul_rpow (by linarith : 0 ≤ 1+K) (mul_self_nonneg (n:ℝ)), Real.rpow_neg (by linarith : 0 ≤ 1+K)] at hpair' have hscaled : ((n:ℝ)*(n:ℝ))^(-p) ≤ M*((n:ℝ)*((n:ℝ)+m))^(-p) := by have ht := mul_le_mul_of_nonneg_left hpair' hM.le change M * (M⁻¹ * ((n:ℝ)*(n:ℝ))^(-p)) ≤ _ at ht simpa only [← mul_assoc, mul_inv_cancel₀ hM.ne', one_mul] using ht change max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-p)) ≤ max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+(0:ℕ)))^(-p)) ∧ max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+(0:ℕ)))^(-p)) ≤ M * max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-p)) simp only [Nat.cast_zero, add_zero] refine ⟨max_le_max le_rfl hpair, max_le ?_ ?_⟩ · calc oracleRate d gamma n ≤ M * oracleRate d gamma n := le_mul_of_one_le_left (Real.rpow_nonneg (Nat.cast_nonneg n) _) hM1 _ ≤ M * max (oracleRate d gamma n) (((n:ℝ)*((n:ℝ)+m))^(-p)) := mul_le_mul_of_nonneg_left (le_max_left _ _) hM.le · exact hscaled.trans (mul_le_mul_of_nonneg_left (le_max_right _ _) hM.le)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpRate_bounded_auxiliary_comparison · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:270
theorem bounded_auxiliary_risk_order Lemma bounded_auxiliary_risk_order in the paper ↗

A bounded auxiliary-to-labeled ratio preserves the supervised minimax order in both directions. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input mseq, the specified input hseq, the bounded auxiliary risk order conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
mseq :
ℕ → ℕ
hseq :
IsBigO atTop (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) (fun _ : ℕ => (1:ℝ))
conclusion 1
IsBigO atTop (fun n => (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal) (fun n => (minimaxRisk d alpha beta gamma L eps n 0).toReal)
conclusion 2
IsBigO atTop (fun n => (minimaxRisk d alpha beta gamma L eps n 0).toReal) (fun n => (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal)
Proof (Lean source)
lemma bounded_auxiliary_risk_order (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (mseq : ℕ → ℕ) (hseq : IsBigO atTop (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) (fun _ : ℕ => (1:ℝ))) : IsBigO atTop (fun n => (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal) (fun n => (minimaxRisk d alpha beta gamma L eps n 0).toReal) ∧ IsBigO atTop (fun n => (minimaxRisk d alpha beta gamma L eps n 0).toReal) (fun n => (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal) := by obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp hseq obtain ⟨c, C, hc, hcC, hfrontier⟩ := sharp_annotation_frontier d alpha beta gamma L eps hdom have hC : 0 < C := hc.trans_le hcC let M : ℝ := (1+max K 0)^(gamma/bigDelta d alpha beta gamma) have hM : 0 < M := Real.rpow_pos_of_pos (by positivity) _ have hreal (n m : ℕ) (hn : 2 ≤ n) : c*sharpRate d alpha beta gamma n m ≤ (minimaxRisk d alpha beta gamma L eps n m).toReal ∧ (minimaxRisk d alpha beta gamma L eps n m).toReal ≤ C*sharpRate d alpha beta gamma n m := by obtain ⟨hMeas, hl, hm, hu, hall, hb⟩ := hfrontier n m hn have hr : 0 ≤ sharpRate d alpha beta gamma n m := (Real.rpow_nonneg (Nat.cast_nonneg n) _).trans (le_max_left _ _) exact risk_toReal_sandwich _ _ _ (mul_nonneg hc.le hr) (mul_nonneg hC.le hr) hl (hm.trans hu) have hevent : ∀ᶠ n : ℕ in atTop, (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal ≤ (C/c)*(minimaxRisk d alpha beta gamma L eps n 0).toReal ∧ (minimaxRisk d alpha beta gamma L eps n 0).toReal ≤ (C*M/c)*(minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal := by filter_upwards [hK, Filter.eventually_ge_atTop (2 : ℕ)] with n hkn hn have hnpos : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) simp only [Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ (mseq n:ℝ)/(n:ℝ) from div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)), abs_one, mul_one] at hkn have hm : (mseq n:ℝ) ≤ max K 0 * (n:ℝ) := (div_le_iff₀ hnpos).mp (hkn.trans (le_max_left _ _)) have hrates := sharpRate_bounded_auxiliary_comparison d alpha beta gamma L eps hdom (max K 0) (le_max_right _ _) n (mseq n) hn hm obtain ⟨hl0, hu0⟩ := hreal n 0 hn obtain ⟨hlm, hum⟩ := hreal n (mseq n) hn constructor · calc _ ≤ C*sharpRate d alpha beta gamma n (mseq n) := hum _ ≤ C*sharpRate d alpha beta gamma n 0 := mul_le_mul_of_nonneg_left hrates.1 hC.le _ = (C/c)*(c*sharpRate d alpha beta gamma n 0) := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_left hl0 (div_pos hC hc).le · calc _ ≤ C*sharpRate d alpha beta gamma n 0 := hu0 _ ≤ C*(M*sharpRate d alpha beta gamma n (mseq n)) := mul_le_mul_of_nonneg_left hrates.2 hC.le _ = (C*M/c)*(c*sharpRate d alpha beta gamma n (mseq n)) := by field_simp _ ≤ _ := mul_le_mul_of_nonneg_left hlm (by positivity) constructor · apply Asymptotics.isBigO_iff.mpr refine ⟨C/c, ?_⟩ filter_upwards [hevent] with n hn simpa only [Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg] using hn.1 · apply Asymptotics.isBigO_iff.mpr refine ⟨C*M/c, ?_⟩ filter_upwards [hevent] with n hn simpa only [Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg] using hn.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.bounded_auxiliary_risk_order · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:310
theorem positive_sandwich_ratio_bounds Lemma positive_sandwich_ratio_bounds in the paper ↗

Uniform positive sandwiches compare ratios in both directions. Given the specified input f, the specified input g, the specified input r, the specified input s, the specified input cF, the specified input CF, the specified input cG, the specified input CG, the specified input hcF, the specified input hCF, the specified input hcG, the specified input hCG, the specified input hr, the specified input hs, the specified input hf, the specified input hg, the positive sandwich ratio bounds conclusion holds.

Formal statement
f g r s cF CF cG CG :
ℝ
hcF :
0 < cF
hCF :
0 < CF
hcG :
0 < cG
hCG :
0 < CG
hr :
0 < r
hs :
0 < s
hf :
cF*r ≤ f ∧ f ≤ CF*r
hg :
cG*s ≤ g ∧ g ≤ CG*s
conclusion 1
0 ≤ f/g
conclusion 2
f/g ≤ (CF/cG)*(r/s)
conclusion 3
r/s ≤ (CG/cF)*(f/g)
Proof (Lean source)
lemma positive_sandwich_ratio_bounds (f g r s cF CF cG CG : ℝ) (hcF : 0 < cF) (hCF : 0 < CF) (hcG : 0 < cG) (hCG : 0 < CG) (hr : 0 < r) (hs : 0 < s) (hf : cF*r ≤ f ∧ f ≤ CF*r) (hg : cG*s ≤ g ∧ g ≤ CG*s) : 0 ≤ f/g ∧ f/g ≤ (CF/cG)*(r/s) ∧ r/s ≤ (CG/cF)*(f/g) := by have hfpos := (mul_pos hcF hr).trans_le hf.1 have hgpos := (mul_pos hcG hs).trans_le hg.1 refine ⟨(div_pos hfpos hgpos).le, ?_, ?_⟩ · calc f/g ≤ (CF*r)/(cG*s) := div_le_div₀ (mul_pos hCF hr).le hf.2 (mul_pos hcG hs) hg.1 _ = (CF/cG)*(r/s) := by ring · have ht : (cF*r)/(CG*s) ≤ f/g := div_le_div₀ hfpos.le hf.1 hgpos hg.2 have ht' := mul_le_mul_of_nonneg_left ht (div_pos hCG hcF).le have heq : (CG/cF)*((cF*r)/(CG*s)) = r/s := by field_simp rwa [heq] at ht'
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.positive_sandwich_ratio_bounds · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:371
theorem comparable_nonnegative_sequences Lemma comparable_nonnegative_sequences in the paper ↗

Comparable nonnegative sequences have the same boundedness and zero-limit behavior. Given the specified input f, the specified input g, the specified input A, the specified input B, the specified input hA, the specified input hB, the specified input h, the comparable nonnegative sequences conclusion holds.

Formal statement
f g :
ℕ → ℝ
A B :
ℝ
hA :
0 ≤ A
hB :
0 ≤ B
h :
∀ᶠ n in atTop, 0 ≤ f n ∧ 0 ≤ g n ∧ f n ≤ A*g n ∧ g n ≤ B*f n
conclusion 1
IsBigO atTop f (fun _ => (1:ℝ))
↔ IsBigO atTop g (fun _ => (1:ℝ))
conclusion 2
Proof (Lean source)
lemma comparable_nonnegative_sequences (f g : ℕ → ℝ) (A B : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) (h : ∀ᶠ n in atTop, 0 ≤ f n ∧ 0 ≤ g n ∧ f n ≤ A*g n ∧ g n ≤ B*f n) : (IsBigO atTop f (fun _ => (1:ℝ)) ↔ IsBigO atTop g (fun _ => (1:ℝ))) ∧ (Tendsto f atTop (nhds 0) ↔ Tendsto g atTop (nhds 0)) := by constructor · constructor · intro hf obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp hf apply Asymptotics.isBigO_iff.mpr refine ⟨B*K, ?_⟩ filter_upwards [h, hK] with n hn hkn simp only [Real.norm_eq_abs, abs_of_nonneg hn.1, abs_one, mul_one] at hkn simpa only [Real.norm_eq_abs, abs_of_nonneg hn.2.1, abs_one, mul_one] using hn.2.2.2.trans (mul_le_mul_of_nonneg_left hkn hB) · intro hg obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp hg apply Asymptotics.isBigO_iff.mpr refine ⟨A*K, ?_⟩ filter_upwards [h, hK] with n hn hkn simp only [Real.norm_eq_abs, abs_of_nonneg hn.2.1, abs_one, mul_one] at hkn simpa only [Real.norm_eq_abs, abs_of_nonneg hn.1, abs_one, mul_one] using hn.2.2.1.trans (mul_le_mul_of_nonneg_left hkn hA) · constructor · intro hf apply squeeze_zero' (h.mono fun n hn => hn.2.1) (h.mono fun n hn => hn.2.2.2) simpa only [mul_zero] using hf.const_mul B · intro hg apply squeeze_zero' (h.mono fun n hn => hn.1) (h.mono fun n hn => hn.2.2.1) simpa only [mul_zero] using hg.const_mul A
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.comparable_nonnegative_sequences · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:390
theorem nonnegative_rate_bigO_div_iff Lemma nonnegative_rate_bigO_div_iff in the paper ↗

Dividing by a positive rate converts a big-O comparison into boundedness. Given the specified input r, the specified input s, the specified input h, the nonnegative rate big o div iff conclusion holds.

Formal statement
r s :
ℕ → ℝ
h :
∀ᶠ n in atTop, 0 ≤ r n ∧ 0 < s n
IsBigO atTop (fun n => r n/s n) (fun _ => (1:ℝ))
↔ IsBigO atTop r s
Proof (Lean source)
lemma nonnegative_rate_bigO_div_iff (r s : ℕ → ℝ) (h : ∀ᶠ n in atTop, 0 ≤ r n ∧ 0 < s n) : IsBigO atTop (fun n => r n/s n) (fun _ => (1:ℝ)) ↔ IsBigO atTop r s := by constructor <;> intro hh · obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp hh apply Asymptotics.isBigO_iff.mpr refine ⟨K, ?_⟩ filter_upwards [h, hK] with n hn hkn simp only [Real.norm_eq_abs, abs_of_nonneg (div_nonneg hn.1 hn.2.le), abs_one, mul_one] at hkn simpa only [Real.norm_eq_abs, abs_of_nonneg hn.1, abs_of_pos hn.2] using (div_le_iff₀ hn.2).mp hkn · obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp hh apply Asymptotics.isBigO_iff.mpr refine ⟨K, ?_⟩ filter_upwards [h, hK] with n hn hkn simp only [Real.norm_eq_abs, abs_of_nonneg hn.1, abs_of_pos hn.2] at hkn simpa only [Real.norm_eq_abs, abs_of_nonneg (div_nonneg hn.1 hn.2.le), abs_one, mul_one] using (div_le_iff₀ hn.2).mpr hkn
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.nonnegative_rate_bigO_div_iff · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:423
theorem annotation_risk_sandwiches Lemma annotation_risk_sandwiches in the paper ↗

The frontier and supplied-propensity bounds give real-valued uniform sandwiches. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the annotation risk sandwiches conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ cF CF cO CO : ℝ,
0 < cF
0 < CF
0 < cO
0 < CO
conclusion 1
n m :
2 ≤ n
cF*sharpRate d alpha beta gamma n m ≤ (minimaxRisk d alpha beta gamma L eps n m).toReal
(minimaxRisk d alpha beta gamma L eps n m).toReal ≤ CF*sharpRate d alpha beta gamma n m
cO*oracleRate d gamma n ≤ (oracleRisk d alpha beta gamma L eps n m).toReal
(oracleRisk d alpha beta gamma L eps n m).toReal ≤ CO*oracleRate d gamma n
Proof (Lean source)
lemma annotation_risk_sandwiches (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ cF CF cO CO : ℝ, 0 < cF ∧ 0 < CF ∧ 0 < cO ∧ 0 < CO ∧ ∀ n m, 2 ≤ n → (cF*sharpRate d alpha beta gamma n m ≤ (minimaxRisk d alpha beta gamma L eps n m).toReal ∧ (minimaxRisk d alpha beta gamma L eps n m).toReal ≤ CF*sharpRate d alpha beta gamma n m) ∧ (cO*oracleRate d gamma n ≤ (oracleRisk d alpha beta gamma L eps n m).toReal ∧ (oracleRisk d alpha beta gamma L eps n m).toReal ≤ CO*oracleRate d gamma n) := by obtain ⟨cF, CF, hcF, hcFC, hfrontier⟩ := sharp_annotation_frontier d alpha beta gamma L eps hdom obtain ⟨cO, CO, hcO, hcOC, horacle⟩ := supplied_propensity d alpha beta gamma L eps hdom have hCF := hcF.trans_le hcFC have hCO := hcO.trans_le hcOC refine ⟨cF, CF, cO, CO, hcF, hCF, hcO, hCO, ?_⟩ intro n m hn have hro : 0 ≤ oracleRate d gamma n := Real.rpow_nonneg (Nat.cast_nonneg n) _ have hr : 0 ≤ sharpRate d alpha beta gamma n m := hro.trans (le_max_left _ _) obtain ⟨hMeas, hl, hm, hu, hall, hb⟩ := hfrontier n m hn exact ⟨risk_toReal_sandwich _ _ _ (mul_nonneg hcF.le hr) (mul_nonneg hCF.le hr) hl (hm.trans hu), risk_toReal_sandwich _ _ _ (mul_nonneg hcO.le hro) (mul_nonneg hCO.le hro) (horacle n m hn).1 (horacle n m hn).2.1⟩
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_risk_sandwiches · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:445
theorem annotation_risk_rate_equivalences Lemma annotation_risk_rate_equivalences in the paper ↗

Risk and numerical rate comparisons coincide along every auxiliary-size sequence. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the specified input mseq, the annotation risk rate equivalences conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
mseq :
ℕ → ℕ
R :
fun n m => (minimaxRisk d alpha beta gamma L eps n m).toReal
Re :
fun n m => (oracleRisk d alpha beta gamma L eps n m).toReal
r :
sharpRate d alpha beta gamma
ro :
oracleRate d gamma
IsBigO atTop (fun n => R n (mseq n)/Re n (mseq n)) (fun _ => (1:ℝ))
↔ IsBigO atTop (fun n => r n (mseq n)) ro
Tendsto (fun n => R n (mseq n)/R n 0) atTop (nhds 0)
↔ Tendsto (fun n => r n (mseq n)/r n 0) atTop (nhds 0)
IsBigO atTop (fun n => R n (mseq n)/Re n (mseq n)) (fun _ => (1:ℝ))
↔ ∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta
Proof (Lean source)
lemma annotation_risk_rate_equivalences (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) (mseq : ℕ → ℕ) : let R := fun n m => (minimaxRisk d alpha beta gamma L eps n m).toReal let Re := fun n m => (oracleRisk d alpha beta gamma L eps n m).toReal let r := sharpRate d alpha beta gamma let ro := oracleRate d gamma (IsBigO atTop (fun n => R n (mseq n)/Re n (mseq n)) (fun _ => (1:ℝ)) ↔ IsBigO atTop (fun n => r n (mseq n)) ro) ∧ (Tendsto (fun n => R n (mseq n)/R n 0) atTop (nhds 0) ↔ Tendsto (fun n => r n (mseq n)/r n 0) atTop (nhds 0)) ∧ (IsBigO atTop (fun n => R n (mseq n)/Re n (mseq n)) (fun _ => (1:ℝ)) ↔ ∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta) := by obtain ⟨cF, CF, cO, CO, hcF, hCF, hcO, hCO, hb⟩ := annotation_risk_sandwiches d alpha beta gamma L eps hdom have hpos (n : ℕ) (hn : 2 ≤ n) : 0 < oracleRate d gamma n ∧ ∀ m, 0 < sharpRate d alpha beta gamma n m := by have hnp : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) have ho : 0 < oracleRate d gamma n := Real.rpow_pos_of_pos hnp _ exact ⟨ho, fun m => ho.trans_le (le_max_left _ _)⟩ have hratios : ∀ᶠ n : ℕ in atTop, 0 ≤ (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal / (oracleRisk d alpha beta gamma L eps n (mseq n)).toReal ∧ 0 ≤ sharpRate d alpha beta gamma n (mseq n)/oracleRate d gamma n ∧ (minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal / (oracleRisk d alpha beta gamma L eps n (mseq n)).toReal ≤ (CF/cO)*(sharpRate d alpha beta gamma n (mseq n)/oracleRate d gamma n) ∧ sharpRate d alpha beta gamma n (mseq n)/oracleRate d gamma n ≤ (CO/cF)*((minimaxRisk d alpha beta gamma L eps n (mseq n)).toReal / (oracleRisk d alpha beta gamma L eps n (mseq n)).toReal) := by filter_upwards [Filter.eventually_ge_atTop (2 : ℕ)] with n hn have hh := positive_sandwich_ratio_bounds _ _ _ _ _ _ _ _ hcF hCF hcO hCO ((hpos n hn).2 _) (hpos n hn).1 (hb n (mseq n) hn).1 (hb n (mseq n) hn).2 exact ⟨hh.1, (div_pos ((hpos n hn).2 _) (hpos n hn).1).le, hh.2⟩ have hbig := (comparable_nonnegative_sequences _ _ (CF/cO) (CO/cF) (div_pos hCF hcO).le (div_pos hCO hcF).le hratios).1 have hrate := nonnegative_rate_bigO_div_iff (fun n => sharpRate d alpha beta gamma n (mseq n)) (oracleRate d gamma) (by filter_upwards [Filter.eventually_ge_atTop (2 : ℕ)] with n hn exact ⟨((hpos n hn).2 _).le, (hpos n hn).1⟩) refine ⟨hbig.trans hrate, ?_, ?_⟩ · apply (comparable_nonnegative_sequences _ _ (CF/cF) (CF/cF) (div_pos hCF hcF).le (div_pos hCF hcF).le ?_).2 filter_upwards [Filter.eventually_ge_atTop (2 : ℕ)] with n hn have hh := positive_sandwich_ratio_bounds _ _ _ _ _ _ _ _ hcF hCF hcF hCF ((hpos n hn).2 _) ((hpos n hn).2 0) (hb n (mseq n) hn).1 (hb n 0 hn).1 exact ⟨hh.1, (div_pos ((hpos n hn).2 _) ((hpos n hn).2 0)).le, hh.2⟩ · rw [hbig.trans hrate] constructor · intro h obtain ⟨K, hK⟩ := Asymptotics.isBigO_iff.mp h refine ⟨max K 1, le_max_right _ _, ?_⟩ filter_upwards [hK, Filter.eventually_ge_atTop (2 : ℕ)] with n hkn hn have hp := hpos n hn simp only [Real.norm_eq_abs, abs_of_pos (hp.2 _), abs_of_pos hp.1] at hkn exact ⟨hn, hkn.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hp.1.le)⟩ · rintro ⟨zeta, hzeta, hregion⟩ apply Asymptotics.isBigO_iff.mpr refine ⟨zeta, ?_⟩ filter_upwards [hregion] with n hn have hp := hpos n hn.1 simpa only [Real.norm_eq_abs, abs_of_pos (hp.2 _), abs_of_pos hp.1] using hn.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_risk_rate_equivalences · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:469
theorem annotation_threshold

Oracle attainment, strict benefit, all rate branches, supervised comparison, and necessary and sufficient acquisition requirements for the established frontier. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the annotation threshold conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
R :
fun n m => (minimaxRisk d alpha beta gamma L eps n m).toReal
Re :
fun n m => (oracleRisk d alpha beta gamma L eps n m).toReal
r :
sharpRate d alpha beta gamma
ro :
oracleRate d gamma
mseq :
ℕ → ℕ
IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ))
↔ IsBigO atTop (fun n : ℕ => r n (mseq n)) ro
Tendsto (fun n : ℕ => R n (mseq n)/R n 0) atTop (nhds 0)
↔ Tendsto (fun n : ℕ => r n (mseq n)/r n 0) atTop (nhds 0)
IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ))
↔ ∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta
IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ))
↔ 0 < liminf (fun n : ℕ => ofReal (((n:ℝ)+mseq n)/(n:ℝ)^qStar d alpha beta gamma)) atTop
Tendsto (fun n : ℕ => R n (mseq n)/R n 0) atTop (nhds 0) ↔ alpha+beta < sCrit d gamma ∧
Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop
alpha+beta < sCrit d gamma
1 < qStar d alpha beta gamma
mseq :
ℕ → ℕ
IsBigO atTop (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) (fun _ : ℕ => (1:ℝ))
IsBigO atTop (fun n : ℕ => R n (mseq n)) (fun n : ℕ => R n 0)
IsBigO atTop (fun n : ℕ => R n 0) (fun n : ℕ => R n (mseq n))
sCrit d gamma ≤ alpha+beta
mseq :
ℕ → ℕ
IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ))
∃ c C : ℝ,
0 < c
c ≤ C
n m :
ℕ
2 ≤ n
ofReal (c*r n m) ≤ minimaxRisk d alpha beta gamma L eps n m
minimaxRisk d alpha beta gamma L eps n m ≤ ofReal (C*r n m)
sCrit d gamma ≤ alpha+beta
r n m = ro n
alpha+beta < sCrit d gamma
(n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma
r n m = ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))
alpha+beta < sCrit d gamma
(n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m
r n m = ro n
(n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma
((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = ro n
n :
2 ≤ n
alpha+beta < sCrit d gamma
r n 0 = (n:ℝ)^(-(2*gamma/bigDelta d alpha beta gamma))
sCrit d gamma ≤ alpha+beta
r n 0 = ro n
n :
kbrwBenchmarkRate d alpha beta gamma n = r n 0
∃ c C : ℝ,
0 < c
0 < C
epsilon :
ℝ
0 < epsilon
epsilon < 1
n m :
ℕ
2 ≤ n
(∃ T : Decision d n m, ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk T P hP ≤ ofReal epsilon)
c*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ)
c*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
C*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ)
C*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ P hP ≤ ofReal epsilon
r n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧
epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)
(n:ℝ) ≤ (n:ℝ)+m
Proof (Lean source)
theorem annotation_threshold (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : let R := fun n m => (minimaxRisk d alpha beta gamma L eps n m).toReal let Re := fun n m => (oracleRisk d alpha beta gamma L eps n m).toReal let r := sharpRate d alpha beta gamma let ro := oracleRate d gamma (∀ mseq : ℕ → ℕ, -- @realizes mn(auxiliary-size sequence) (IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ)) ↔ IsBigO atTop (fun n : ℕ => r n (mseq n)) ro) ∧ (Tendsto (fun n : ℕ => R n (mseq n)/R n 0) atTop (nhds 0) ↔ Tendsto (fun n : ℕ => r n (mseq n)/r n 0) atTop (nhds 0)) ∧ (IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ)) ↔ ∃ zeta : ℝ, 1 ≤ zeta ∧ ∀ᶠ n in atTop, (n,mseq n) ∈ annotationRegion d alpha beta gamma zeta) ∧ -- @realizes zeta(finite oracle-order tolerance) (IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ)) ↔ 0 < liminf (fun n : ℕ => ofReal (((n:ℝ)+mseq n)/(n:ℝ)^qStar d alpha beta gamma)) atTop) ∧ (Tendsto (fun n : ℕ => R n (mseq n)/R n 0) atTop (nhds 0) ↔ alpha+beta < sCrit d gamma ∧ Tendsto (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) atTop atTop)) ∧ (alpha+beta < sCrit d gamma → 1 < qStar d alpha beta gamma) ∧ (∀ mseq : ℕ → ℕ, IsBigO atTop (fun n : ℕ => (mseq n:ℝ)/(n:ℝ)) (fun _ : ℕ => (1:ℝ)) → IsBigO atTop (fun n : ℕ => R n (mseq n)) (fun n : ℕ => R n 0) ∧ IsBigO atTop (fun n : ℕ => R n 0) (fun n : ℕ => R n (mseq n))) ∧ (sCrit d gamma ≤ alpha+beta → ∀ mseq : ℕ → ℕ, IsBigO atTop (fun n : ℕ => R n (mseq n)/Re n (mseq n)) (fun _ : ℕ => (1:ℝ))) ∧ (∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ -- @realizes c(positive claim-local constant) @realizes C(finite claim-local upper constant) ∀ (n m : ℕ), 2 ≤ n → ofReal (c*r n m) ≤ minimaxRisk d alpha beta gamma L eps n m ∧ minimaxRisk d alpha beta gamma L eps n m ≤ ofReal (C*r n m) ∧ (sCrit d gamma ≤ alpha+beta → r n m = ro n) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma → r n m = ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m → r n m = ro n) ∧ ((n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma → ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = ro n)) ∧ (∀ n, 2 ≤ n → (alpha+beta < sCrit d gamma → r n 0 = (n:ℝ)^(-(2*gamma/bigDelta d alpha beta gamma))) ∧ (sCrit d gamma ≤ alpha+beta → r n 0 = ro n)) ∧ (∀ n, kbrwBenchmarkRate d alpha beta gamma n = r n 0) ∧ (∃ c C : ℝ, 0 < c ∧ 0 < C ∧ -- @realizes c(positive necessity constant) @realizes C(finite positive sufficiency constant) ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 → -- @realizes epsilon(target absolute-error scale) ∀ (n m : ℕ), 2 ≤ n → ((∃ T : Decision d n m, ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk T P hP ≤ ofReal epsilon) → c*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧ c*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)) ∧ (C*epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) → C*epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m) → ∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ P hP ≤ ofReal epsilon) ∧ (r n m ≤ epsilon ↔ epsilon^(-(2+(d:ℝ)/gamma)) ≤ (n:ℝ) ∧ epsilon^(-(2+(d:ℝ)/gamma+(d:ℝ)/(alpha+beta))) ≤ (n:ℝ)*((n:ℝ)+m)) ∧ (n:ℝ) ≤ (n:ℝ)+m) := by refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro mseq obtain ⟨hbig, hzero, hregion⟩ := annotation_risk_rate_equivalences d alpha beta gamma L eps hdom mseq refine ⟨hbig, hzero, hregion, ?_, ?_⟩ · exact hregion.trans (annotationRegion_liminf_iff d alpha beta gamma L eps hdom mseq) · exact hzero.trans (annotation_rate_improvement_iff d alpha beta gamma L eps hdom mseq) · exact qStar_gt_one d alpha beta gamma L eps hdom · exact bounded_auxiliary_risk_order d alpha beta gamma L eps hdom · intro hs mseq obtain ⟨K, hK, hbound⟩ := smooth_oracle_risk_ratio d alpha beta gamma L eps hdom hs apply Asymptotics.isBigO_iff.mpr refine ⟨K, ?_⟩ filter_upwards [Filter.eventually_ge_atTop (2 : ℕ)] with n hn simp only [Real.norm_eq_abs, abs_of_nonneg (div_nonneg ENNReal.toReal_nonneg ENNReal.toReal_nonneg), abs_one, mul_one] exact hbound n (mseq n) hn · obtain ⟨c, C, hc, hcC, hfrontier⟩ := sharp_annotation_frontier d alpha beta gamma L eps hdom refine ⟨c, C, hc, hcC, ?_⟩ intro n m hn obtain ⟨hMeas, hlower, hmin, hupper, hall, hbranches⟩ := hfrontier n m hn exact ⟨hlower, hmin.trans hupper, hbranches⟩ · exact fun n hn => supervised_rate_branches d alpha beta gamma L eps hdom n hn · exact published_benchmark_eq_supervised_rate d alpha beta gamma L eps hdom · exact annotation_acquisition d alpha beta gamma L eps hdom
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.annotation_threshold · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_AnnotationThreshold.lean:538
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.T_MarkedComponentCertificate 4 declarations Two-channel point-CATE annotation frontier: T_MarkedComponentCertificate constructions and obligations.

T_MarkedComponentCertificate

Two-channel point-CATE annotation frontier: T_MarkedComponentCertificate constructions and obligations.

theorem designatedPropensity_eq_of_xaLaw Lemma designatedPropensity_eq_of_xaLaw in the paper ↗

Equal treatment-record marginals identify the entire designated propensity on the cube. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input Q, the specified input hP, the specified input hQ, the specified input hxa, the designated propensity eq of xa law conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P Q :
hP :
PrimitiveClass alpha beta gamma L eps P
hQ :
PrimitiveClass alpha beta gamma L eps Q
hxa :
xaLaw P = xaLaw Q
Proof (Lean source)
lemma designatedPropensity_eq_of_xaLaw {d : ℕ} {alpha beta gamma L eps : ℝ} (P Q : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hQ : PrimitiveClass alpha beta gamma L eps Q) (hxa : xaLaw P = xaLaw Q) : EqOn (designatedPropensity P hP) (designatedPropensity Q hQ) (cube d) := by let W := canonicalLaw P hP let V := canonicalLaw Q hQ have hW := canonicalLaw_spec P hP have hV := canonicalLaw_spec Q hQ have hWu : W.law.map fst = uniformLaw d := hW.2.1 have hVu : V.law.map fst = uniformLaw d := hV.2.1 let : IsFiniteMeasure (uniformLaw d) := by rw [← hWu] infer_instance let := bernKernel_sfinite_of_margin W (fun w => w.2.1) (by fun_prop) W.e W.measurable_e W.margin_e let := bernKernel_sfinite_of_margin V (fun w => w.2.1) (by fun_prop) V.e V.measurable_e V.margin_e have he : EqOn W.e V.e (cube d) := by apply bern_margin_versions_unique _ _ W.measurable_e V.measurable_e (holderNorm_continuousOn _ _ _ hW.2.2.2.2.1) (holderNorm_continuousOn _ _ _ hV.2.2.2.2.1) · exact hW.2.2.2.1.unit · exact hV.2.2.2.1.unit · calc (uniformLaw d) ⊗ₘ bernKernel W.e W.measurable_e = xaLaw W := by rw [← hWu, ← W.margin_e] rfl _ = xaLaw V := by simpa only [xaLaw, W, V, hW.1, hV.1] using hxa _ = (uniformLaw d) ⊗ₘ bernKernel V.e V.measurable_e := by rw [xaLaw, V.margin_e, hVu] intro x hx simpa only [designatedPropensity, if_pos hx] using he hx
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.designatedPropensity_eq_of_xaLaw · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_MarkedComponentCertificate.lean:24
theorem marked_designated_propensity_marginal Lemma marked_designated_propensity_marginal in the paper ↗

The sign involution preserves the law of the designated, continuous propensity function. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input delta, the specified input a, the specified input b, the specified input hMembers, the marked designated propensity marginal conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps h delta a b :
ℝ
hMembers :
PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)
H :
markedHandle d h delta a b
(signPrior H true).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law true sigma) (hMembers true sigma) x.1)
= (signPrior H false).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law false sigma) (hMembers false sigma) x.1)
Proof (Lean source)
lemma marked_designated_propensity_marginal (d : ℕ) (alpha beta gamma L eps h delta a b : ℝ) (hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma)) : let H := markedHandle d h delta a b (signPrior H true).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law true sigma) (hMembers true sigma) x.1) = (signPrior H false).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law false sigma) (hMembers false sigma) x.1) := by dsimp only unfold signPrior rw [Measure.map_finset_sum' (measurable_of_countable _).aemeasurable, Measure.map_finset_sum' (measurable_of_countable _).aemeasurable] simp only [Measure.map_smul, Measure.map_dirac' (measurable_of_countable _)] apply Fintype.sum_equiv (flipOutcomeSigns d h delta) intro sigma change ofReal (markedWeight h delta true sigma) • _ = ofReal (markedWeight h delta false (flipOutcomeSigns d h delta sigma)) • _ rw [markedWeight_flipOutcomeSigns] congr 2 funext x exact designatedPropensity_eq_of_xaLaw _ _ (hMembers true sigma) (hMembers false (flipOutcomeSigns d h delta sigma)) (marked_xaLaw_flipOutcomeSigns d h delta a b sigma) x.2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_designated_propensity_marginal · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_MarkedComponentCertificate.lean:59
theorem marked_contrast_at_target Lemma marked_contrast_at_target in the paper ↗

The prescribed macro bump equals one at the target, giving the signed contrast. Given the specified input d, the specified input h, the specified input a, the specified input b, the specified input theta, the marked contrast at target conclusion holds.

Formal statement
d :
ℕ
h a b :
ℝ
theta :
markedContrast (d := d) h a b theta (x0 d) = -2 * thetaSign theta * a * b
Proof (Lean source)
lemma marked_contrast_at_target (d : ℕ) (h a b : ℝ) (theta : Bool) : markedContrast (d := d) h a b theta (x0 d) = -2 * thetaSign theta * a * b := by simp [markedContrast, macroBump, x0, flatExp, Real.exp_ne_zero]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_contrast_at_target · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_MarkedComponentCertificate.lean:86
theorem marked_component_certificate

The explicit sign-pair construction satisfies membership, exact cancellations, component factorization and the fixed-size information bound. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the marked component certificate conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c c0 C : ℝ,
0 < c
c ≤ 1
0 < c0
0 < C
conclusion 1
n m :
ℕ
h delta a b :
ℝ
2 ≤ n
0 < delta
delta ≤ h
h ≤ 1/2
0 < a
a ≤ c*delta^alpha
0 < b
b ≤ c*delta^beta
a*b ≤ c*h^gamma
((n:ℝ)+m)*delta^d ≤ c0
H :
markedHandle d h delta a b
theta :
sigma :
0 ≤ H.weight theta sigma
(∑ sigma : PriorSign H, H.weight theta sigma) = 1
∃ hMembers : ∀ theta sigma,
PrimitiveClass alpha beta gamma L eps (H.law theta sigma), (∀ theta sigma x, x ∈ cube d → tau (H.law theta sigma) (hMembers theta sigma) x = H.contrast theta x)
(signPrior H true).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law true sigma) (hMembers true sigma) x.1)
= (signPrior H false).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law false sigma) (hMembers false sigma) x.1)
theta :
H.contrast theta (x0 d) = -2*thetaSign theta*a*b
H.contrast false (x0 d)-H.contrast true (x0 d) = 4*a*b
c*a*b ≤ 4*a*b
≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d*a^2*b^2
kAux :
x :
Fin kAux → Cov d
(∀ i, x i ∈ cube d)
theta x :
x ∈ cube d
Proof (Lean source)
theorem marked_component_certificate (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c c0 C : ℝ, 0 < c ∧ c ≤ 1 ∧ 0 < c0 ∧ 0 < C ∧ -- @realizes c(admissibility constant) @realizes c0(occupancy constant) @realizes C(information constant) ∀ (n m : ℕ) (h delta a b : ℝ), 2 ≤ n → 0 < delta → delta ≤ h → h ≤ 1/2 → 0 < a → a ≤ c*delta^alpha → 0 < b → b ≤ c*delta^beta → a*b ≤ c*h^gamma → ((n:ℝ)+m)*delta^d ≤ c0 → let H := markedHandle d h delta a b (∀ theta, (∀ sigma : PriorSign H, 0 ≤ H.weight theta sigma) ∧ (∑ sigma : PriorSign H, H.weight theta sigma) = 1) ∧ -- @realizes Pi(probability-vector normalization) (∃ hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps (H.law theta sigma), (∀ theta sigma x, x ∈ cube d → tau (H.law theta sigma) (hMembers theta sigma) x = H.contrast theta x) ∧ (signPrior H true).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law true sigma) (hMembers true sigma) x.1) = (signPrior H false).map (fun sigma => fun x : {x : Cov d // x ∈ cube d} => designatedPropensity (H.law false sigma) (hMembers false sigma) x.1)) ∧ (∀ theta, H.contrast theta (x0 d) = -2*thetaSign theta*a*b) ∧ (H.contrast false (x0 d)-H.contrast true (x0 d) = 4*a*b ∧ c*a*b ≤ 4*a*b) ∧ hellingerSq (markedMixture H true n m) (markedMixture H false n m) ≤ C*(n:ℝ)*((n:ℝ)+m)*h^d*delta^d*a^2*b^2 ∧ (∀ kAux, auxiliaryMixture H true kAux = auxiliaryMixture H false kAux ∧ ∀ x : Fin kAux → Cov d, (∀ i, x i ∈ cube d) → conditionalAuxiliaryMixture H true kAux x = conditionalAuxiliaryMixture H false kAux x) ∧ (∀ theta x, x ∈ cube d → singletonMixture H theta x = fairObserved) ∧ ConditionalFactorization H h delta n m ∧ UninformativeComponentsAgree H h delta n m := by obtain ⟨cM, hcM, hcM1, hmem⟩ := marked_membership d alpha beta gamma L eps hdom obtain ⟨cS, hcS, hcS1, hsingle⟩ := singleton_cancellation d alpha beta gamma L eps hdom obtain ⟨cU, hcU, hcU1, huninform⟩ := uninformative_component_equality d alpha beta gamma L eps hdom obtain ⟨cI, c0, C, hcI, hcI1, hc0, hC, hinfo⟩ := marked_information_bound d alpha beta gamma L eps hdom let c := min cM (min cS (min cU cI)) have hc : 0 < c := lt_min hcM (lt_min hcS (lt_min hcU hcI)) have hc1 : c ≤ 1 := (min_le_left _ _).trans hcM1 have hcM' : c ≤ cM := min_le_left _ _ have hcS' : c ≤ cS := (min_le_right _ _).trans (min_le_left _ _) have hcU' : c ≤ cU := ((min_le_right _ _).trans (min_le_right _ _)).trans (min_le_left _ _) have hcI' : c ≤ cI := ((min_le_right _ _).trans (min_le_right _ _)).trans (min_le_right _ _) refine ⟨c, c0, C, hc, hc1, hc0, hC, ?_⟩ intro n m h delta a b hn hd hdh hh ha hac hb hbc hab hocc have hh0 : 0 < h := hd.trans_le hdh have hamp (c' : ℝ) (hcc : c ≤ c') : a ≤ c'*delta^alpha ∧ b ≤ c'*delta^beta ∧ a*b ≤ c'*h^gamma := by exact ⟨hac.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos hd _).le), hbc.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos hd _).le), hab.trans (mul_le_mul_of_nonneg_right hcc (Real.rpow_pos_of_pos hh0 _).le)⟩ have hm := hamp cM hcM' have hs := hamp cS hcS' have hu := hamp cU hcU' have hi := hamp cI hcI' have hmembers := hmem h delta a b hd hdh hh ha hm.1 hb hm.2.1 hm.2.2 let hMembers : ∀ theta sigma, PrimitiveClass alpha beta gamma L eps ((markedHandle d h delta a b).law theta sigma) := fun theta sigma => (hmembers theta sigma).choose refine ⟨?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro theta exact marked_prior_mass d h delta theta · refine ⟨hMembers, ?_, marked_designated_propensity_marginal d alpha beta gamma L eps h delta a b hMembers⟩ intro theta sigma x hx exact (hmembers theta sigma).choose_spec.1 x hx · intro theta exact marked_contrast_at_target d h a b theta · constructor · change markedContrast h a b false (x0 d) - markedContrast h a b true (x0 d) = _ rw [marked_contrast_at_target, marked_contrast_at_target] norm_num [thetaSign] <;> ring · calc c*a*b = c*(a*b) := by ring _ ≤ 4*(a*b) := mul_le_mul_of_nonneg_right (hc1.trans (by norm_num : (1:ℝ) ≤ 4)) (mul_pos ha hb).le _ = 4*a*b := by ring · exact hinfo n m h delta a b hn hd hdh hh ha hi.1 hb hi.2.1 hi.2.2 hocc · intro kAux refine ⟨(auxiliary_only_equality d h delta a b kAux).1, ?_⟩ intro x _ exact (auxiliary_only_equality d h delta a b kAux).2 x · intro theta x _ exact hsingle h delta a b hd hdh hh ha hs.1 hb hs.2.1 hs.2.2 theta x · exact marked_conditional_factorization d h delta a b hd hdh hh n m · exact huninform h delta a b hd hdh hh ha hu.1 hb hu.2.1 hu.2.2 n m
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.marked_component_certificate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_MarkedComponentCertificate.lean:92
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.T_RectangularUpper 1 declarations Two-channel point-CATE annotation frontier: T_RectangularUpper constructions and obligations.

T_RectangularUpper

Two-channel point-CATE annotation frontier: T_RectangularUpper constructions and obligations.

theorem rectangular_upper

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the rectangular upper conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ C : ℝ,
0 < C
conclusion 1
n m :
ℕ
h :
ℝ
J :
ℕ
2 ≤ n
0 < h
h ≤ 1/2
1 ≤ J
∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨fun w
=> tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*min 1 (h^gamma+(h/J)^(alpha+beta)+ ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))))
conclusion 2
n m :
ℕ
2 ≤ n
∃ hMeas : Measurable (fun w : Sample d n m => tUp d alpha beta gamma eps n m w.1),
∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P),
risk ⟨fun w
=> tUp d alpha beta gamma eps n m w.1, hMeas⟩ P hP ≤ ofReal (C*upperRate d alpha beta gamma n m)
Proof (Lean source)
theorem rectangular_upper (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ C : ℝ, 0 < C ∧ -- @realizes C(finite positive claim-local constant) (∀ (n m : ℕ) (h : ℝ) (J : ℕ), 2 ≤ n → 0 < h → h ≤ 1/2 → 1 ≤ J → ∃ hMeas : Measurable (fun w : Sample d n m => tHat eps h J w.1), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨fun w => tHat eps h J w.1, hMeas⟩ P hP ≤ ofReal (C*min 1 (h^gamma+(h/J)^(alpha+beta)+ ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))))) ∧ (∀ (n m : ℕ), 2 ≤ n → ∃ hMeas : Measurable (fun w : Sample d n m => tUp d alpha beta gamma eps n m w.1), ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), risk ⟨fun w => tUp d alpha beta gamma eps n m w.1, hMeas⟩ P hP ≤ ofReal (C*upperRate d alpha beta gamma n m)) := by obtain ⟨A, hA, hfixed⟩ := rectangular_fixed_tuning_risk d alpha beta gamma L eps hdom obtain ⟨B, hB, htuning⟩ := tuning_balance d alpha beta gamma L eps hdom refine ⟨A*(B+1), by positivity, ?_, ?_⟩ · intro n m h J hn hh hh' hJ obtain ⟨hMeas, hrisk⟩ := hfixed n m h J hn hh hh' hJ refine ⟨hMeas, ?_⟩ intro P hP refine (hrisk P hP).trans (ENNReal.ofReal_le_ofReal ?_) have hnonneg : 0 ≤ min 1 (h^gamma+(h/J)^(alpha+beta)+ ((n:ℝ)*h^d)^(-(1/2:ℝ))+ ((n:ℝ)*((n:ℝ)+m)*h^d*(h/J)^d)^(-(1/2:ℝ))) := by positivity exact mul_le_mul_of_nonneg_right (by nlinarith) hnonneg · intro n m hn obtain ⟨hh, hh', hJ, hbalance⟩ := htuning n m hn obtain ⟨hMeas, hrisk⟩ := hfixed n m (hStar d alpha beta gamma n m) (jStar d alpha beta gamma n m) hn hh hh' hJ refine ⟨hMeas, ?_⟩ intro P hP change risk ⟨fun w => tHat eps (hStar d alpha beta gamma n m) (jStar d alpha beta gamma n m) w.1, hMeas⟩ P hP ≤ _ refine (hrisk P hP).trans (ENNReal.ofReal_le_ofReal ?_) have hrate : 0 ≤ upperRate d alpha beta gamma n m := by unfold upperRate oracleRate positivity have hm := mul_le_mul_of_nonneg_left ((min_le_right (1:ℝ) _).trans hbalance) hA.le nlinarith
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.rectangular_upper · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_RectangularUpper.lean:24
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.T_SharpAnnotationFrontier 3 declarations Two-channel point-CATE annotation frontier: T_SharpAnnotationFrontier constructions and obligations.

T_SharpAnnotationFrontier

Two-channel point-CATE annotation frontier: T_SharpAnnotationFrontier constructions and obligations.

theorem oracleRisk_le_minimaxRisk Lemma oracleRisk_le_minimaxRisk in the paper ↗

An original-record rule can be supplied to the oracle while ignoring its extra input. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, the oracle risk le minimax risk conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
oracleRisk d alpha beta gamma L eps n m ≤ minimaxRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma oracleRisk_le_minimaxRisk (d : ℕ) (alpha beta gamma L eps : ℝ) (n m : ℕ) : oracleRisk d alpha beta gamma L eps n m ≤ minimaxRisk d alpha beta gamma L eps n m := by unfold oracleRisk minimaxRisk apply minimaxValueENNReal_le_minimaxValue intro T refine ⟨⟨fun w _ => T.1 w, fun _ => T.2⟩, ?_⟩ exact le_rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleRisk_le_minimaxRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SharpAnnotationFrontier.lean:25
theorem sharpRate_minimax_lower Lemma sharpRate_minimax_lower in the paper ↗

The oracle floor and the nuisance converse give one constant valid across all branches. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the sharp rate minimax lower conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
conclusion 1
n m :
2 ≤ n
ofReal (c * sharpRate d alpha beta gamma n m)
≤ minimaxRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma sharpRate_minimax_lower (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ ∀ n m, 2 ≤ n → ofReal (c * sharpRate d alpha beta gamma n m) ≤ minimaxRisk d alpha beta gamma L eps n m := by obtain ⟨cO, CO, hcO, hcOC, horacle⟩ := supplied_propensity d alpha beta gamma L eps hdom have hfloor (n m : ℕ) (hn : 2 ≤ n) : ofReal (cO * oracleRate d gamma n) ≤ minimaxRisk d alpha beta gamma L eps n m := (horacle n m hn).1.trans (oracleRisk_le_minimaxRisk d alpha beta gamma L eps n m) by_cases hS : alpha + beta < sCrit d gamma · obtain ⟨cB, hcB, hpair⟩ := nuisance_frontier_converse d alpha beta gamma L eps hdom hS refine ⟨min cO cB, lt_min hcO hcB, ?_⟩ intro n m hn have hbranches := rate_branches d alpha beta gamma L eps hdom n m hn by_cases hN : (n : ℝ) + m ≤ (n : ℝ) ^ qStar d alpha beta gamma · rw [hbranches.2.1 hS hN] exact (ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_right (min_le_right cO cB) (Real.rpow_nonneg (by positivity) _))).trans (hpair n m hn hN) · rw [hbranches.2.2.1 hS (le_of_not_ge hN)] exact (ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_right (min_le_left cO cB) (Real.rpow_nonneg (Nat.cast_nonneg n) _))).trans (hfloor n m hn) · refine ⟨cO, hcO, ?_⟩ intro n m hn rw [(rate_branches d alpha beta gamma L eps hdom n m hn).1 (le_of_not_gt hS)] exact hfloor n m hn
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharpRate_minimax_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SharpAnnotationFrontier.lean:34
theorem sharp_annotation_frontier

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the sharp annotation frontier conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c C : ℝ,
0 < c
c ≤ C
conclusion 1
n m :
ℕ
2 ≤ n
∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m),
ofReal (c*sharpRate d alpha beta gamma n m)
≤ minimaxRisk d alpha beta gamma L eps n m
minimaxRisk d alpha beta gamma L eps n m
≤ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩
worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩
≤ ofReal (C*sharpRate d alpha beta gamma n m)
T :
Decision d n m
ofReal (c*sharpRate d alpha beta gamma n m)
≤ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) T
sCrit d gamma ≤ alpha+beta
sharpRate d alpha beta gamma n m = oracleRate d gamma n
alpha+beta < sCrit d gamma
(n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma
sharpRate d alpha beta gamma n m
= ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))
alpha+beta < sCrit d gamma
(n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m
sharpRate d alpha beta gamma n m = oracleRate d gamma n
(n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma
((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = oracleRate d gamma n
Proof (Lean source)
theorem sharp_annotation_frontier (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ -- @realizes c(positive claim-local constant) @realizes C(finite claim-local upper constant) ∀ (n m : ℕ), 2 ≤ n → ∃ hMeas : Measurable (sharpDecision d alpha beta gamma eps n m), ofReal (c*sharpRate d alpha beta gamma n m) ≤ minimaxRisk d alpha beta gamma L eps n m ∧ minimaxRisk d alpha beta gamma L eps n m ≤ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ ∧ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m,hMeas⟩ ≤ ofReal (C*sharpRate d alpha beta gamma n m) ∧ (∀ T : Decision d n m, ofReal (c*sharpRate d alpha beta gamma n m) ≤ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) T) ∧ (sCrit d gamma ≤ alpha+beta → sharpRate d alpha beta gamma n m = oracleRate d gamma n) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)+m ≤ (n:ℝ)^qStar d alpha beta gamma → sharpRate d alpha beta gamma n m = ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma))) ∧ (alpha+beta < sCrit d gamma → (n:ℝ)^qStar d alpha beta gamma ≤ (n:ℝ)+m → sharpRate d alpha beta gamma n m = oracleRate d gamma n) ∧ ((n:ℝ)+m = (n:ℝ)^qStar d alpha beta gamma → ((n:ℝ)*((n:ℝ)+m))^(-(gamma/bigDelta d alpha beta gamma)) = oracleRate d gamma n) := by obtain ⟨c, hc, hlower⟩ := sharpRate_minimax_lower d alpha beta gamma L eps hdom obtain ⟨CU, hCU, hrect, hup⟩ := rectangular_upper d alpha beta gamma L eps hdom refine ⟨c, max c CU, hc, le_max_left _ _, ?_⟩ intro n m hn obtain ⟨hMeas, hpoint⟩ := hup n m hn have hsharp : Measurable (sharpDecision d alpha beta gamma eps n m) := hMeas have hupper : worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m, hsharp⟩ ≤ ofReal (max c CU * sharpRate d alpha beta gamma n m) := by apply worstCaseRiskENNReal_le intro P have hr := hpoint P.1 P.2 change risk ⟨sharpDecision d alpha beta gamma eps n m, hsharp⟩ P.1 P.2 ≤ _ at hr apply hr.trans rw [← sharpRate_eq_upperRate] apply ENNReal.ofReal_le_ofReal apply mul_le_mul_of_nonneg_right (le_max_right c CU) exact le_trans (Real.rpow_nonneg (Nat.cast_nonneg n) _) (le_max_left _ _) have hmin : minimaxRisk d alpha beta gamma L eps n m ≤ worstCaseRiskENNReal (classRisk d alpha beta gamma L eps n m) ⟨sharpDecision d alpha beta gamma eps n m, hsharp⟩ := minimaxValueENNReal_le_worstCaseRisk _ refine ⟨hsharp, hlower n m hn, hmin, hupper, ?_, rate_branches d alpha beta gamma L eps hdom n m hn⟩ intro T exact (hlower n m hn).trans (minimaxValueENNReal_le_worstCaseRisk T)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.sharp_annotation_frontier · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SharpAnnotationFrontier.lean:65
CausalSmith.Stat.STAT_TwosamplePointcateAnnotationFrontier_Research.T_SuppliedPropensity 7 declarations Two-channel point-CATE annotation frontier: T_SuppliedPropensity constructions and obligations.

T_SuppliedPropensity

Two-channel point-CATE annotation frontier: T_SuppliedPropensity constructions and obligations.

Given the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, constant nuisance is the corresponding construction.

Definition (Lean source)
d :
ℕ
shared
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
x ∈ cube d :
ConstantNuisance P hP :
Prop
clause 1
clause 2
designatedControl P hP x = 1/2
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.ConstantNuisance · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:30

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, oracle subfamily risk is the corresponding construction.

Definition (Lean source)
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
oracleSubfamilyRisk d alpha beta gamma L eps n m :
ℝ≥0∞
minimaxValueENNReal (fun (T : OracleDecision d n m) (P : {P : PrimitiveLaw d // ∃ hP : PrimitiveClass alpha beta gamma L eps P, ConstantNuisance P hP}) => ∫⁻ w, ofReal |T.1 w (designatedPropensity P.1 P.2.choose)-tau P.1 P.2.choose (x0 d)| ∂experiment P.1 n m)
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSubfamilyRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:34
theorem oracleSubfamilyRisk_le_oracleRisk Lemma oracleSubfamilyRisk_le_oracleRisk in the paper ↗

Restricting to the constant-nuisance subfamily can only decrease oracle minimax risk. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input n, the specified input m, the oracle subfamily risk le oracle risk conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
n m :
ℕ
oracleSubfamilyRisk d alpha beta gamma L eps n m ≤ oracleRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma oracleSubfamilyRisk_le_oracleRisk (d : ℕ) (alpha beta gamma L eps : ℝ) (n m : ℕ) : oracleSubfamilyRisk d alpha beta gamma L eps n m ≤ oracleRisk d alpha beta gamma L eps n m := by unfold oracleSubfamilyRisk oracleRisk apply minimaxValueENNReal_mono_class (fun P => ⟨P.1, P.2.choose⟩) intro T P exact le_rfl
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracleSubfamilyRisk_le_oracleRisk · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:40
theorem constantNuisance_propensity_eq Lemma constantNuisance_propensity_eq in the paper ↗

The supplied function is identical on the whole covariate space for every member of the constant-nuisance subfamily, including its zero extension. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input P, the specified input hP, the specified input hconst, the constant nuisance propensity eq conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
P :
hP :
PrimitiveClass alpha beta gamma L eps P
hconst :
designatedPropensity P hP = (fun x => if x ∈ cube d then 1/2 else 0)
Proof (Lean source)
lemma constantNuisance_propensity_eq {d : ℕ} {alpha beta gamma L eps : ℝ} (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P) (hconst : ConstantNuisance P hP) : designatedPropensity P hP = (fun x => if x ∈ cube d then 1/2 else 0) := by funext x by_cases hx : x ∈ cube d · rw [if_pos hx] exact (hconst x hx).1 · simp only [designatedPropensity, if_neg hx]
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.constantNuisance_propensity_eq · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:49
theorem oracle_bump_testing_lower Lemma oracle_bump_testing_lower in the paper ↗

Singleton priors at the two explicit bump laws give an oracle-subfamily lower bound: their supplied input is common, so the cited block test applies. Given the specified input d, the specified input n, the specified input m, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input h, the specified input b, the specified input hb, the specified input hn, the specified input hMembers, the specified input hconst, the specified input htarget, the specified input hhell, the oracle bump testing lower conclusion holds.

Formal statement
d n m :
ℕ
alpha beta gamma L eps h b :
ℝ
hb :
0 < b
hn :
0 < n
hMembers :
∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)
hconst :
∀ theta, ConstantNuisance _ (hMembers theta)
htarget :
∀ theta, tau _ (hMembers theta) (x0 d) = thetaSign theta*b
hhell :
ofReal ((3/8:ℝ)*b) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma oracle_bump_testing_lower {d n m : ℕ} {alpha beta gamma L eps h b : ℝ} (hb : 0 < b) (hn : 0 < n) (hMembers : ∀ theta, PrimitiveClass alpha beta gamma L eps (oracleBumpPrimitive d h b theta)) (hconst : ∀ theta, ConstantNuisance _ (hMembers theta)) (htarget : ∀ theta, tau _ (hMembers theta) (x0 d) = thetaSign theta*b) (hhell : hellingerSq (experiment (oracleBumpPrimitive d h b true) n m) (experiment (oracleBumpPrimitive d h b false) n m) ≤ 1/16) : ofReal ((3/8:ℝ)*b) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m := by obtain ⟨Ψ, hΨ⟩ := oracle_bump_experiment_target_exists hn hMembers let E := fun theta => experiment (oracleBumpPrimitive d h b theta) n m let omega : Measure Unit := Measure.dirac () let B : Kernel Unit (Sample d n m) := Kernel.const Unit (E true) let C : Kernel Unit (Sample d n m) := Kernel.const Unit (E false) letI := population_experiment_probability (oracleBumpPrimitive d h b true) n m letI := population_experiment_probability (oracleBumpPrimitive d h b false) n m have hsep : ∀ z z', 2*b ≤ Ψ (B z) - Ψ (C z') := by intro z z' change 2*b ≤ Ψ (E true) - Ψ (E false) rw [hΨ, hΨ, htarget, htarget] simp only [thetaSign, if_true, Bool.false_eq_true, if_false] linarith have hh : hellingerSq (omega.bind (fun z => B z)) (omega.bind (fun z => C z)) ≤ 1/16 := by simpa [omega, B, C, E, Measure.dirac_bind, Kernel.measurable] using hhell unfold oracleSubfamilyRisk apply Causalean.Stat.le_minimaxValueENNReal intro T let e : Cov d → ℝ := fun x => if x ∈ cube d then 1/2 else 0 let Model : Set (Measure (Sample d n m)) := range E have htest := published_fuzzy_testing_block omega B C Model (fun _ => ⟨true, rfl⟩) (fun _ => ⟨false, rfl⟩) Ψ (2*b) (1/16) (by positivity) (by norm_num) (by norm_num) hsep hh (fun w => T.1 w e) (T.2 e) have hconstant : (3/8:ℝ)*b ≤ (2*b/4)*(1-sqrt ((1/16:ℝ)*(1-(1/16:ℝ)/4))) := by have ho := mul_le_mul_of_nonneg_left fuzzy_testing_overlap_sixteenth hb.le nlinarith apply (ENNReal.ofReal_le_ofReal hconstant).trans (htest.trans ?_) apply iSup_le intro P apply iSup_le rintro ⟨theta, rfl⟩ rw [hΨ] have hprop := constantNuisance_propensity_eq _ (hMembers theta) (hconst theta) rw [show e = designatedPropensity _ (hMembers theta) from hprop.symm] exact le_worstCaseRiskENNReal T (⟨oracleBumpPrimitive d h b theta, ⟨hMembers theta, hconst theta⟩⟩ : {P : PrimitiveLaw d // ∃ hP : PrimitiveClass alpha beta gamma L eps P, ConstantNuisance P hP})
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_bump_testing_lower · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:61
theorem oracle_subfamily_lower_rate Lemma oracle_subfamily_lower_rate in the paper ↗

The same-class constant-nuisance subfamily has the irreducible oracle outcome rate, uniformly over every auxiliary sample size. Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the oracle subfamily lower rate conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c : ℝ,
0 < c
conclusion 1
n m :
ℕ
2 ≤ n
ofReal (c*oracleRate d gamma n) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m
Proof (Lean source)
lemma oracle_subfamily_lower_rate (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c : ℝ, 0 < c ∧ ∀ (n m : ℕ), 2 ≤ n → ofReal (c*oracleRate d gamma n) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m := by obtain ⟨eta, heta, hetas, hfamily⟩ := oracle_bump_testing_family d alpha beta gamma L eps hdom refine ⟨(3/8:ℝ)*eta, by positivity, ?_⟩ intro n m hn obtain ⟨hmem, hinfo⟩ := hfamily n hn let H := (n:ℝ)^(-(1/(2*gamma+d))) let b := eta*oracleRate d gamma n let hMembers := fun theta => (hmem theta).choose have hversions (theta : Bool) := (hmem theta).choose_spec have hc : ∀ theta, ConstantNuisance _ (hMembers theta) := by intro theta x hx exact ⟨(hversions theta x hx).1, (hversions theta x hx).2.1⟩ have ht : ∀ theta, tau _ (hMembers theta) (x0 d) = thetaSign theta*b := by intro theta have hx : x0 d ∈ cube d := by intro i; norm_num [x0, cube] simpa only [macroBump_at_x0, mul_one] using (hversions theta (x0 d) hx).2.2 have hb : 0 < b := by dsimp [b, oracleRate]; positivity have hh : hellingerSq (experiment (oracleBumpPrimitive d H b true) n m) (experiment (oracleBumpPrimitive d H b false) n m) ≤ 1/16 := by have hsym : hellingerSq (experiment (oracleBumpPrimitive d H b true) n m) (experiment (oracleBumpPrimitive d H b false) n m) = hellingerSq (experiment (oracleBumpPrimitive d H b false) n m) (experiment (oracleBumpPrimitive d H b true) n m) := by unfold hellingerSq hellingerSqDensity simp only [add_comm] apply integral_congr_ae filter_upwards [] with w ring rw [hsym] exact hinfo m have htest := oracle_bump_testing_lower hb (by omega : 0 < n) hMembers hc ht hh simpa only [b, mul_assoc] using htest
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.oracle_subfamily_lower_rate · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:113
theorem supplied_propensity

Given the specified input d, the specified input alpha, the specified input beta, the specified input gamma, the specified input L, the overlap level eps, the specified input hdom, the supplied propensity conclusion holds.

Formal statement
d :
ℕ
alpha beta gamma L eps :
ℝ
hdom :
PublicDomain d alpha beta gamma L eps
∃ c C : ℝ,
0 < c
c ≤ C
conclusion 1
n m :
ℕ
2 ≤ n
ofReal (c*oracleRate d gamma n) ≤ oracleRisk d alpha beta gamma L eps n m
oracleRisk d alpha beta gamma L eps n m ≤ ofReal (C*oracleRate d gamma n)
P :
hP :
PrimitiveClass alpha beta gamma L eps P
Measurable (fun w => oracleSmoother d gamma n m w (designatedPropensity P hP))
w :
|oracleSmoother d gamma n m w (designatedPropensity P hP)| ≤ 1
(∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP)-tau P hP (x0 d)| ∂experiment P n m)
≤ ofReal (C*oracleRate d gamma n)
ofReal (c*oracleRate d gamma n) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m
Proof (Lean source)
theorem supplied_propensity (d : ℕ) (alpha beta gamma L eps : ℝ) (hdom : PublicDomain d alpha beta gamma L eps) : ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ -- @realizes c(positive claim-local constant) @realizes C(finite claim-local upper constant) ∀ (n m : ℕ), 2 ≤ n → ofReal (c*oracleRate d gamma n) ≤ oracleRisk d alpha beta gamma L eps n m ∧ oracleRisk d alpha beta gamma L eps n m ≤ ofReal (C*oracleRate d gamma n) ∧ (∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), Measurable (fun w => oracleSmoother d gamma n m w (designatedPropensity P hP)) ∧ (∀ w, |oracleSmoother d gamma n m w (designatedPropensity P hP)| ≤ 1) ∧ (∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP)-tau P hP (x0 d)| ∂experiment P n m) ≤ ofReal (C*oracleRate d gamma n)) ∧ ofReal (c*oracleRate d gamma n) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m := by suffices hcontent : ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ ∀ (n m : ℕ), 2 ≤ n → (∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), (∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m) ≤ ofReal (C*oracleRate d gamma n)) ∧ ofReal (c*oracleRate d gamma n) ≤ oracleSubfamilyRisk d alpha beta gamma L eps n m by obtain ⟨c, C, hc, hcC, hcontent⟩ := hcontent refine ⟨c, C, hc, hcC, ?_⟩ intro n m hn obtain ⟨hupper, hlower⟩ := hcontent n m hn refine ⟨hlower.trans (oracleSubfamilyRisk_le_oracleRisk d alpha beta gamma L eps n m), oracleRisk_le_of_oracleSmoother d alpha beta gamma L eps n m _ hupper, ?_, hlower⟩ intro P hP exact ⟨measurable_oracleSmoother_designated P hP n m, fun w => oracleSmoother_bounded d gamma n m w _, hupper P hP⟩ obtain ⟨c, hc, hlower⟩ := oracle_subfamily_lower_rate d alpha beta gamma L eps hdom suffices hupper : ∃ C : ℝ, 0 < C ∧ ∀ (n m : ℕ), 2 ≤ n → ∀ (P : PrimitiveLaw d) (hP : PrimitiveClass alpha beta gamma L eps P), (∫⁻ w, ofReal |oracleSmoother d gamma n m w (designatedPropensity P hP) - tau P hP (x0 d)| ∂experiment P n m) ≤ ofReal (C*oracleRate d gamma n) by obtain ⟨C, hC, hupper⟩ := hupper refine ⟨c, max c C, hc, le_max_left _ _, ?_⟩ intro n m hn refine ⟨?_, hlower n m hn⟩ intro P hP apply (hupper n m hn P hP).trans apply ENNReal.ofReal_le_ofReal exact mul_le_mul_of_nonneg_right (le_max_right c C) (Real.rpow_nonneg (Nat.cast_nonneg n) _) exact oracle_smoother_upper_rate d alpha beta gamma L eps hdom
CausalSmith.Stat.TwosamplePointcateAnnotationFrontier.supplied_propensity · CausalSmith/Stat/STAT_TwosamplePointcateAnnotationFrontier_Research/T_SuppliedPropensity.lean:152