Formalization: Uniform Estimation and Honest Inference in Regression Discontinuity with a Mismeasured Score

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

CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Basic 52 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

def Latent

The latent coordinates are score, two binary potential outcomes, and error.

Definition (Lean source)
Latent :
Type
ℝ × Bool × Bool × ℝ
CausalSmith.Stat.RdTruesideNoiseFrontier.Latent · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:31
def Obs

The observed coordinates are proxy score, true treatment side, and binary outcome.

Definition (Lean source)
Obs :
Type
ℝ × Bool × Bool
CausalSmith.Stat.RdTruesideNoiseFrontier.Obs · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:33
def bit

Binary outcomes take their usual numerical values. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
y :
bit y :
ℝ
if y then 1 else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.bit · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:35
def score

The latent score coordinate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
ω :
score ω :
ℝ
ω.1
CausalSmith.Stat.RdTruesideNoiseFrontier.score · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:37
def pot

Both potential outcomes remain in the latent schedule. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
ω :
pot d ω :
ℝ
bit (if d then ω.2.2.1 else ω.2.1)
CausalSmith.Stat.RdTruesideNoiseFrontier.pot · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:39
def errorCoord

The latent perturbation coordinate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
ω :
errorCoord ω :
ℝ
ω.2.2.2
CausalSmith.Stat.RdTruesideNoiseFrontier.errorCoord · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:42
def side

Treatment uses the true latent score. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
ω :
side ω :
decide (0 ≤ score ω)
CausalSmith.Stat.RdTruesideNoiseFrontier.side · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:44
def outcome

The observed outcome is the potential outcome at the assigned side. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
ω :
outcome ω :
if side ω then ω.2.2.1 else ω.2.1
CausalSmith.Stat.RdTruesideNoiseFrontier.outcome · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:46
def proxy

Known-scale perturbation of the latent score. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
ω :
proxy σ ω :
ℝ
score ω + σ * errorCoord ω
CausalSmith.Stat.RdTruesideNoiseFrontier.proxy · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:49
def obs

The common observation map. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
ω :
obs σ ω :
Obs
(proxy σ ω, side ω, outcome ω)
CausalSmith.Stat.RdTruesideNoiseFrontier.obs · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:51

Ambient latent law with its density and continuous conditional-mean versions.

Definition (Lean source)
supp :
∀ᵐ ω ∂P, score ω ∈ Icc (-1) 1
f :
ℝ → ℝ
f_cont :
ContinuousOn f (Icc (-1) 1)
f_zero :
∀ x ∉ Icc (-1) 1, f x = 0
f_nonneg :
∀ x, 0 ≤ f x
f_int :
(∫ x in (-1)..1, f x) = 1
density :
P.map score = volume.withDensity (fun x => ofReal (f x))
mu :
Bool → ℝ → ℝ
mu_cont :
∀ d, ContinuousOn (mu d) (Icc (-1) 1)
mu_version :
∀ d B
then
(∫ ω in {ω | score ω ∈ B}, pot d ω ∂P) = ∫ x in B ∩ Icc (-1) 1, mu d x * f x
CausalSmith.Stat.RdTruesideNoiseFrontier.LatentLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:54
def Pobs

The observed law is the common pushforward. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
σ :
ℝ
Pobs L σ :
L.P.map (obs σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.Pobs · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:71

The cutoff causal contrast. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
theta L :
ℝ
L.mu true 0 - L.mu false 0
CausalSmith.Stat.RdTruesideNoiseFrontier.theta · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:73
def holderSeminorm

The fractional seminorm on the whole latent interval. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
v :
ℝ → ℝ
holderSeminorm β v :
ℝ≥0∞
sSup {r | ∃ x ∈ Icc (-1 : ℝ) 1, ∃ t ∈ Icc (-1 : ℝ) 1, x ≠ t ∧ r = ofReal (|v x - v t| / |x - t| ^ β)}
CausalSmith.Stat.RdTruesideNoiseFrontier.holderSeminorm · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:75
def sgn

Arm reflection. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
sgn d :
ℝ
if d then 1 else -1
CausalSmith.Stat.RdTruesideNoiseFrontier.sgn · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:79
def phi

Centered Gaussian density at the public noise scale. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ w :
ℝ
phi σ w :
ℝ
(sqrt (2 * pi * σ ^ 2))⁻¹ * exp (-w ^ 2 / (2 * σ ^ 2))
CausalSmith.Stat.RdTruesideNoiseFrontier.phi · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:81
def legendreP

Mathlib shifted Legendre uses the reversed interval orientation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
j :
ℕ
t :
ℝ
legendreP j t :
ℝ
aeval ((1 - t) / 2) (shiftedLegendre j)
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:84
def GaussianError

Standard Gaussian error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
GaussianError L :
Prop
L.P.map errorCoord = gaussianReal 0 1
CausalSmith.Stat.RdTruesideNoiseFrontier.GaussianError · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:91
def ErrorIndependence

Error is independent of the whole potential-outcome schedule jointly with the score. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ErrorIndependence L :
Prop
IndepFun errorCoord (fun ω : Latent => (score ω, ω.2.1, ω.2.2.1)) L.P
CausalSmith.Stat.RdTruesideNoiseFrontier.ErrorIndependence · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:94
def DensityBounds

Global lower and upper density bounds. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
x ∈ Icc (-1 : ℝ) 1 :
DensityBounds L :
Prop
clause 1
1/4 ≤ L.f x
clause 2
L.f x ≤ 3/4
CausalSmith.Stat.RdTruesideNoiseFrontier.DensityBounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:98
def MeanBounds

Interior bounds for each potential-mean version. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
d :
x ∈ Icc (-1 : ℝ) 1 :
MeanBounds L :
Prop
clause 1
1/4 ≤ L.mu d x
clause 2
L.mu d x ≤ 3/4
CausalSmith.Stat.RdTruesideNoiseFrontier.MeanBounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:102
def MeanHolder

Radius-two Hölder restriction, written pointwise to avoid a real-supremum junk value. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
shared
L :
d :
x ∈ Icc (-1 : ℝ) 1 :
t ∈ Icc (-1 : ℝ) 1 :
MeanHolder β L :
Prop
|L.mu d x - L.mu d t| ≤ 2 * |x - t| ^ β
CausalSmith.Stat.RdTruesideNoiseFrontier.MeanHolder · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:106
structure LatentModel

The exact benchmark class contains precisely the five maintained member atoms.

Definition (Lean source)
β σ :
ℝ
L :
gaussian :

@realizes Model(benchmark class)

independent :
density :
means :
holder :
CausalSmith.Stat.RdTruesideNoiseFrontier.LatentModel · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:111

The noise scale indexes the observed experiment, and does not change latent membership.

Definition (Lean source)
β σ :
ℝ
L :
Model β σ L :
Prop
LatentModel β σ L
CausalSmith.Stat.RdTruesideNoiseFrontier.Model · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:120
def Sample

Finite observed sample.

Definition (Lean source)
n :
ℕ
Sample n :
Type
Fin n → Obs
CausalSmith.Stat.RdTruesideNoiseFrontier.Sample · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:125
def Input

Randomized procedure input, with an independent unit-interval seed.

Definition (Lean source)
n :
ℕ
Input n :
Type
Sample n × unitInterval
CausalSmith.Stat.RdTruesideNoiseFrontier.Input · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:127
def seedLaw

The seed has uniform probability measure on the unit interval. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
seedLaw :
CausalSmith.Stat.RdTruesideNoiseFrontier.seedLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:129
def sampleLaw

IID observation law before procedure randomization. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
σ :
ℝ
n :
ℕ
sampleLaw L σ n :
Measure (Sample n)
Measure.pi (fun _ : Fin n => Pobs L σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:131

The sample experiment includes the independent uniform seed. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
σ :
ℝ
n :
ℕ
experiment L σ n :
(sampleLaw L σ n).prod seedLaw
CausalSmith.Stat.RdTruesideNoiseFrontier.experiment · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:134
def Estimator

Every measurable real-valued procedure is permitted.

Definition (Lean source)
n :
ℕ
Estimator n :
Type
{T : Input n → ℝ // Measurable T}
CausalSmith.Stat.RdTruesideNoiseFrontier.Estimator · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:137

Connected closed intervals with measurable endpoints, lying in the declared target region.

Definition (Lean source)
n :
ℕ
@realizes Intervals(interval procedure carrier)
lo :
Input n → ℝ
hi :
Input n → ℝ
lo_meas :
hi_meas :
endpoints :
∀ z, -1 ≤ lo z ∧ lo z ≤ hi z ∧ hi z ≤ 1
CausalSmith.Stat.RdTruesideNoiseFrontier.IntervalProc · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:139
def honestIntervals

Uniform ninety-percent coverage on the exact benchmark. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
honestIntervals β n σ :
{I | ∀ L, Model β σ L → (9/10 : ℝ) ≤ (experiment L σ n).real (coverageEvent I.lo I.hi (theta L))}
CausalSmith.Stat.RdTruesideNoiseFrontier.honestIntervals · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:146

Extended absolute loss risk retains infinite loss of arbitrary procedures. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
σ :
ℝ
n :
ℕ
T :
Input n → ℝ
absRisk L σ n T :
ℝ≥0∞
∫⁻ z, ofReal |T z - theta L| ∂experiment L σ n
CausalSmith.Stat.RdTruesideNoiseFrontier.absRisk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:151
def expectedLength

Extended expected length. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
σ :
ℝ
n :
ℕ
I :
expectedLength L σ n I :
ℝ≥0∞
∫⁻ z, ofReal (intervalLength (I.lo z) (I.hi z)) ∂experiment L σ n
CausalSmith.Stat.RdTruesideNoiseFrontier.expectedLength · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:154

Minimax absolute risk, converted to real only after minimizing extended loss. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
risk β n σ :
ℝ
(minimaxValueENNReal (fun (T : Estimator n) (L : {L // Model β σ L}) => absRisk L.val σ n T.val)).toReal
CausalSmith.Stat.RdTruesideNoiseFrontier.risk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:157

Minimax honest expected length. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
lengthRisk β n σ :
ℝ
(minimaxValueENNReal (fun (I : {I // I ∈ honestIntervals β n σ}) (L : {L // Model β σ L}) => expectedLength L.val σ n I.val)).toReal
CausalSmith.Stat.RdTruesideNoiseFrontier.lengthRisk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:161
def chiSqExt

Extended chi-square, with infinity when absolute continuity fails. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
Ω :
μ ν :
chiSqExt μ ν :
ℝ≥0∞
if μ ≪ ν then ∫⁻ x, ofReal (((μ.rnDeriv ν x).toReal - 1) ^ 2) ∂ν else ⊤
CausalSmith.Stat.RdTruesideNoiseFrontier.chiSqExt · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:167
def tvDist

Event-supremum total variation.

Definition (Lean source)
Ω :
μ ν :
tvDist μ ν :
ℝ
tvDist μ ν
CausalSmith.Stat.RdTruesideNoiseFrontier.tvDist · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:170

Off absolute continuity, the extended divergence is infinite. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
μ ν :
h :
¬ μ ≪ ν
chiSqExt μ ν = ⊤
Proof (Lean source)
lemma chiSqExt_of_not_ac {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) (h : ¬ μ ≪ ν) : chiSqExt μ ν = ⊤ := by simp only [chiSqExt, if_neg h]
CausalSmith.Stat.RdTruesideNoiseFrontier.chiSqExt_of_not_ac · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:173
theorem chiSqExt_eq_ofReal_chiSqDiv Lemma chiSqExt_eq_ofReal_chiSqDiv in the paper ↗

The extended divergence agrees with the finite-real substrate when the density square is integrable. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
hac :
μ ≪ ν
hint :
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν
chiSqExt μ ν = ofReal (chiSqDiv μ ν)
Proof (Lean source)
lemma chiSqExt_eq_ofReal_chiSqDiv {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (hac : μ ≪ ν) (hint : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν) : chiSqExt μ ν = ofReal (chiSqDiv μ ν) := by rw [chiSqExt, if_pos hac, chiSqDiv] exact (ofReal_integral_eq_lintegral_ofReal hint (Filter.Eventually.of_forall fun x => sq_nonneg _)).symm
CausalSmith.Stat.RdTruesideNoiseFrontier.chiSqExt_eq_ofReal_chiSqDiv · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:177

Finiteness discharges both hypotheses needed by the finite-real chi-square API. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
chiSqExt μ ν ≠ ⊤ ↔ μ ≪ ν ∧ Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν
Proof (Lean source)
lemma chiSqExt_ne_top_iff {Ω : Type*} [MeasurableSpace Ω] (μ ν : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : chiSqExt μ ν ≠ ⊤ ↔ μ ≪ ν ∧ Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν := by by_cases hac : μ ≪ ν · rw [chiSqExt, if_pos hac] have hmeas : AEStronglyMeasurable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν := by exact (((μ.measurable_rnDeriv ν).ennreal_toReal.sub measurable_const).pow_const 2).aestronglyMeasurable rw [lintegral_ofReal_ne_top_iff_integrable hmeas (Filter.Eventually.of_forall fun x => sq_nonneg _)] exact (and_iff_right hac).symm · rw [chiSqExt_of_not_ac μ ν hac] simp only [ne_eq, not_true_eq_false, hac, false_and]
CausalSmith.Stat.RdTruesideNoiseFrontier.chiSqExt_ne_top_iff · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:185
structure GaussianLawData

Laws on the unrestricted score space with locally continuous potential-mean versions.

Definition (Lean source)
a :
ℝ → ℝ
density :
Q.map score = volume.withDensity (fun x => ofReal (a x))
density_nonneg :
∀ x, 0 ≤ a x
v :
Bool → ℝ → ℝ
version :
∀ d B
then
(∫ ω in {ω | score ω ∈ B}, pot d ω ∂Q) = ∫ x in B, v d x * a x
mean_cont :
∃ r > 0, ∀ d, ContinuousOn (v d) (Ioo (-r) r)
CausalSmith.Stat.RdTruesideNoiseFrontier.GaussianLawData · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:200
def GaussianIdClass

The larger Gaussian observed-treatment identification class. The cutoff versions are means of binary potentials, so their range is explicitly recorded as [0,1]. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
GaussianIdClass σ Q :
Prop
clause 1
∃ r > 0,
ContinuousOn Q.a (Ioo (-r) r)
x ∈ Ioo (-r) r :
0 < Q.a x
clause 2
Q.Q.map errorCoord = gaussianReal 0 1
clause 3
IndepFun errorCoord (fun ω => (score ω, bit (outcome ω))) Q.Q
clause 4
d :
0 ≤ Q.v d 0
Q.v d 0 ≤ 1
CausalSmith.Stat.RdTruesideNoiseFrontier.GaussianIdClass · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:211
def gaussianPobs

Observed law in the larger identification class. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
gaussianPobs Q σ :
Q.Q.map (obs σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianPobs · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:218
def gaussianTarget

The larger-class causal target. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
gaussianTarget Q :
ℝ
Q.v true 0 - Q.v false 0
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianTarget · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:220
def gaussianExperiment

The larger-class experiment uses the same finite product and independent seed. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
n :
ℕ
gaussianExperiment Q σ n :
(Measure.pi (fun _ : Fin n => gaussianPobs Q σ)).prod seedLaw
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianExperiment · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:222
def gaussianHonestIntervals

Honest intervals on the larger identification class. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
σ :
ℝ
gaussianHonestIntervals n σ :
{I | ∀ Q, GaussianIdClass σ Q → (9/10 : ℝ) ≤ (gaussianExperiment Q σ n).real (coverageEvent I.lo I.hi (gaussianTarget Q))}
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianHonestIntervals · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:225
def gaussianRisk

Extended minimax risk on the larger class, before its finite value is converted to real. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
σ :
ℝ
gaussianRisk n σ :
ℝ
(minimaxValueENNReal (fun (T : Estimator n) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal |T.val z - gaussianTarget Q.val| ∂gaussianExperiment Q.val σ n)).toReal
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianRisk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:229
def gaussianLength

Minimax honest expected length on the larger class. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
σ :
ℝ
gaussianLength n σ :
ℝ
(minimaxValueENNReal (fun (I : {I // I ∈ gaussianHonestIntervals n σ}) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal (intervalLength (I.val.lo z) (I.val.hi z)) ∂gaussianExperiment Q.val σ n)).toReal
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianLength · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:234
def PeiShen1Y

Pei and Shen Assumption 1Y, jointly nondifferential measurement error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
PeiShen1Y σ Q :
Prop
IndepFun (fun ω => σ * errorCoord ω) (fun ω => (score ω, bit (outcome ω))) Q.Q
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShen1Y · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:240
def PeiShen2C

Pei and Shen Assumption 2C, positive score density on a cutoff neighborhood. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
PeiShen2C Q :
Prop
∃ r > 0, ∀ x ∈ Ioo (-r) r, 0 < Q.a x
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShen2C · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:243
def PeiShen7

Pei and Shen Assumption 7, centered Gaussian measurement error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
PeiShen7 σ Q :
Prop
Q.Q.map (fun ω => σ * errorCoord ω) = gaussianReal 0 ⟨σ ^ 2, sq_nonneg σ⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShen7 · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Basic.lean:246
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.CitedGates 12 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

theorem classicalLegendreFacts Theorem 4 in the paper ↗

The exact cited Legendre interface follows from the neutral Mathlib/Causalean proof. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
-- @node: lem:classical-legendre-facts theorem classicalLegendreFacts : ClassicalLegendreFacts := classicalLegendreFacts_of_mathlib
CausalSmith.Stat.RdTruesideNoiseFrontier.classicalLegendreFacts · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:24
theorem classicalHermiteFacts

The exact cited Hermite interface follows from the reusable neutral substrate. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
theorem classicalHermiteFacts : ClassicalHermiteFacts := classicalHermiteFacts
CausalSmith.Stat.RdTruesideNoiseFrontier.classicalHermiteFacts · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:29
def PeiShenLatent

Pei--Shen's score, real observed outcome, and measurement error; no binary or potential-mean-continuity restriction is built into this cited theorem's domain.

Definition (Lean source)
PeiShenLatent :
Type
ℝ × ℝ × ℝ
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenLatent · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:33
def peiShenObservedLaw

Source convention: treatment is assigned below the cutoff, Section 2, display (1). Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
peiShenObservedLaw Q :
Measure (ℝ × Bool × ℝ)
Q.map (fun z => (z.1 + z.2.2, decide (z.1 < 0), z.2.1))
CausalSmith.Stat.RdTruesideNoiseFrontier.peiShenObservedLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:36
def PeiShenSharpRDDomain

The continuous-score sharp-RD domain: a score density and a genuine local observed regression with finite left and right limits. These are the meanings of the conditional means and limit contrast in Section 2, not continuity assumptions on potential outcomes. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
a m :
ℝ → ℝ
left right :
ℝ
PeiShenSharpRDDomain Q a m left right :
Prop
clause 3
x :
0 ≤ a x
clause 4
Q.map (fun z => z.1) = volume.withDensity (fun x => ofReal (a x))
clause 5
∃ r > 0,
IsRegressionFunction (Q.restrict {z | z.1 ∈ Ioo (-r) r}) (fun z => z.1) (fun z => z.2.1) m
clause 6
Tendsto m (nhdsWithin 0 (Iio 0)) (nhds left)
clause 7
Tendsto m (nhdsWithin 0 (Ioi 0)) (nhds right)
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenSharpRDDomain · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:39
def PeiShenObserved1Y

Assumption 1Y on the full real-outcome cited domain. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
PeiShenObserved1Y Q :
Prop
IndepFun (fun z => z.2.2) (fun z => (z.1, z.2.1)) Q
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenObserved1Y · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:50
def PeiShenObserved2C

Assumption 2C requires positivity throughout an open cutoff neighborhood. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
a :
ℝ → ℝ
PeiShenObserved2C a :
Prop
∃ r > 0, ∀ x ∈ Ioo (-r) r, 0 < a x
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenObserved2C · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:53
def PeiShenObserved7

Assumption 7 specifies the actual centered Gaussian measurement error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
PeiShenObserved7 Q σ :
Prop
Q.map (fun z => z.2.2) = gaussianReal 0 ⟨σ^2, sq_nonneg σ⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenObserved7 · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:56

Pei and Shen (2017), cite:peishen2017, Section 2 and Section 4.1, Assumptions 1Y, 2C, 7 and Proposition 4(b), printed pp.4,18,28--29; https://arxiv.org/pdf/1609.01396. Identification of the real-outcome continuous-score sharp RD contrast, the left observed-regression limit minus the right limit under source display (1). The domain is not restricted to the benchmark's binary potentials or locally continuous potential-mean versions. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
PeiShenIdentificationHypotheses :
Sort 0
∀ (Q₁ Q₂ : Measure PeiShenLatent) (a₁ a₂ m₁ m₂ : ℝ → ℝ) (left₁ right₁ left₂ right₂ σ₁ σ₂ : ℝ)
if
0 < σ₁
and
0 < σ₂
and
PeiShenSharpRDDomain Q₁ a₁ m₁ left₁ right₁
and
PeiShenSharpRDDomain Q₂ a₂ m₂ left₂ right₂
and
PeiShenObserved7 Q₁ σ₁
and
PeiShenObserved7 Q₂ σ₂
then
left₁ - right₁ = left₂ - right₂
CausalSmith.Stat.RdTruesideNoiseFrontier.PeiShenIdentificationHypotheses · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:59

Dong (2018), cite:dong2018-identification, Chapter 2 Section 2.2, Assumptions 8--9, printed p.49; https://etheses.lse.ac.uk/3756/1/Dong__essays-in-microeconometrics.pdf. Frozen bibliographic metadata, with zero logical consumers. Attested literal source: Assumption 8. f_{R*}(0) > 0 and E[Y_d|R* = r] is continuous at r = 0 for d = 0, 1. Assumption 9. R* and ε are continuous, and ε ⊥⊥ (Y, R*). Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
dongIdentificationHypothesesRecord :
_root_.String
"Dong (2018, PhD thesis, LSE), Chapter 2, Section 2.2, printed p. 49. Assumption 8: f_{R*}(0) > 0 and E[Y_d | R* = r] is continuous at r
= 0 for d = 0, 1. Assumption 9: R* and epsilon are continuous (continuous random variables, not necessarily continuous densities), and epsilon is independent of (Y, R*). These are identification-level conditions. Assumption 8 credits Hahn, Todd and Van der Klaauw (2001) A1-2; Assumption 9 is Dong's own measurement-error summary."
CausalSmith.Stat.RdTruesideNoiseFrontier.dongIdentificationHypothesesRecord · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:74

Dong (2018), cite:dong2018-inference, Chapter 2 Section 2.4, Assumptions 11,13 and Theorem 6, printed pp.59,61, PDF pages 69,71; https://researchonline.lse.ac.uk/id/eprint/134713/1/Dong_essays-in-microeconometrics.pdf. Pointwise Gaussian specialization of the actual observed-treatment local-linear estimator (2.3.3), with the source's defining averages and leading Lyapunov summand. This is a logical cited claim, with no consumers in this paper. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
DongSupersmoothInferenceComparison :
Sort 0
∀ (P : Measure DongLatent) (f : ℝ → ℝ) (mu : Bool → ℝ → ℝ) (K : ℝ → ℝ) (σ b : ℝ)
if
and
DongA8 f mu
and
DongA11 P f mu K
and
DongA13Gaussian P f mu K σ b
and
2 < b
CausalSmith.Stat.RdTruesideNoiseFrontier.DongSupersmoothInferenceComparison · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:83

Zhang and Karunamuni (2009), cite:zhangkarunamuni2009, DOI 10.1016/j.jspi.2008.10.021; publisher abstract, Section 1 introduction and estimator (1.3), Section 4 opening and Section 5 excerpt; https://www.sciencedirect.com/science/article/abs/pii/S0378375808004175. Frozen bibliographic metadata, with zero logical consumers. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
zhangKarunamuniAccessibleScopeRecord :
_root_.String
"Zhang and Karunamuni (2009), Journal of Statistical Planning and Inference 139, 2269
CausalSmith.Stat.RdTruesideNoiseFrontier.zhangKarunamuniAccessibleScopeRecord · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/CitedGates.lean:95
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.ClassicalFactInterfaces 2 declarations The cited Legendre and Hermite propositions are kept verbatim in this neutral interface module so their proofs can be imported without a cycle through the remaining cited-source declarations.

Classical polynomial fact interfaces

The cited Legendre and Hermite propositions are kept verbatim in this neutral interface module so their proofs can be imported without a cycle through the remaining cited-source declarations.

def ClassicalLegendreFacts

NIST DLMF (2026 access), cite:nistdlmf-legendre, Tables 18.3.1 and 18.6.1, equation 18.14.1 at zero Jacobi parameters; https://dlmf.nist.gov/18.3. Orthogonality, reflection symmetry, unit bound, and the normalized left endpoint. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
ClassicalLegendreFacts :
Sort 0
∀ j k : ℕ,
((∫ t in (-1 : ℝ)..1, legendreP j t * legendreP k t) = if j = k then 2 / (2 * (j : ℝ) + 1) else 0) ∧
(∀ t : ℝ, legendreP j (-t) = (-1 : ℝ)^j * legendreP j t) ∧
(∀ t ∈ Icc (-1 : ℝ) 1, |legendreP j t| ≤ 1) ∧
legendreP j (-1) = (-1 : ℝ)^j
CausalSmith.Stat.RdTruesideNoiseFrontier.ClassicalLegendreFacts · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ClassicalFactInterfaces.lean:21
def ClassicalHermiteFacts

NIST DLMF (2026 access), cite:nistdlmf-hermite, equation 18.12.16 and Table 18.3.1, probabilists' Hermite row; https://dlmf.nist.gov/18.12.E16. The generating series and Gaussian-normalized orthogonality. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
ClassicalHermiteFacts :
Sort 0
(∀ z t : ℝ, HasSum (fun j : ℕ => (aeval z (hermite j) : ℝ) * t^j / (Nat.factorial j : ℝ)) (exp (z*t - t^2/2))) ∧
(∀ j k : ℕ, (∫ z, (aeval z (hermite j) : ℝ) * aeval z (hermite k) ∂gaussianReal 0 1) = if j = k then (Nat.factorial j : ℝ) else 0) ∧
hermite 0 = 1
CausalSmith.Stat.RdTruesideNoiseFrontier.ClassicalHermiteFacts · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ClassicalFactInterfaces.lean:31
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Covariance 23 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

The removable quotient has degree at most one less than its Chebyshev index. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
(endpointF L).natDegree ≤ L - 1
Proof (Lean source)
lemma endpointF_natDegree_le (L : ℕ) : (endpointF L).natDegree ≤ L - 1 := by have ha : (1 - C (2 : ℝ) * X).natDegree ≤ 1 := by apply (Polynomial.natDegree_sub_le _ _).trans simp only [Polynomial.natDegree_one] exact max_le (by omega) ((Polynomial.natDegree_C_mul_le _ _).trans (by simp)) have hc : ((chebyshev L).comp (1 - C 2 * X)).natDegree ≤ L := by apply Polynomial.natDegree_comp_le.trans simpa [chebyshev, Polynomial.Chebyshev.natDegree_T] using Nat.mul_le_mul_left L ha have hn : (1 - (chebyshev L).comp (1 - C 2 * X)).natDegree ≤ L := (Polynomial.natDegree_sub_le _ _).trans (by simpa using hc) exact (Polynomial.natDegree_C_mul_le _ _).trans (by rw [Polynomial.natDegree_divX_eq_natDegree_tsub_one] exact Nat.sub_le_sub_right hn 1)
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_natDegree_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:24
theorem endpointKernel_natDegree_le Lemma endpointKernel_natDegree_le in the paper ↗

Cubing the endpoint quotient gives the declared kernel degree bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
Proof (Lean source)
lemma endpointKernel_natDegree_le (L : ℕ) : (endpointKernel L).natDegree ≤ kernelDegree L := by apply (Polynomial.natDegree_C_mul_le _ _).trans rw [Polynomial.natDegree_pow] exact Nat.mul_le_mul_left 3 (endpointF_natDegree_le L)
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_natDegree_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:39
theorem polynomial_derivative_square_factorial_bound Lemma polynomial_derivative_square_factorial_bound in the paper ↗

Squaring the factorial derivative norm estimate gives the covariance summands. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m j :
ℕ
hm :
p.natDegree ≤ m
hj :
j ≤ m
(∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2)
≤ 16^j * ((m : ℝ)+1)^(4*j) * (∫ x in (0 : ℝ)..1, (p.eval x)^2) / (Nat.factorial j : ℝ)^2
Proof (Lean source)
lemma polynomial_derivative_square_factorial_bound (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m j : ℕ) (hm : p.natDegree ≤ m) (hj : j ≤ m) : (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2) ≤ 16^j * ((m : ℝ)+1)^(4*j) * (∫ x in (0 : ℝ)..1, (p.eval x)^2) / (Nat.factorial j : ℝ)^2 := by by_cases hz : j = 0 · subst j simp [polyDeriv] have hE : 0 ≤ ∫ x in (0 : ℝ)..1, (p.eval x)^2 := intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; positivity) have hD : 0 ≤ ∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2 := intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; positivity) have hn := factorial_derivatives p m j hm (by omega) hj have hs := pow_le_pow_left₀ (Real.sqrt_nonneg _) hn 2 rw [Real.sq_sqrt hD] at hs have hfour : ((4 : ℝ)^j)^2 = 16^j := by rw [← pow_mul, Nat.mul_comm j 2, pow_mul] norm_num have hexp : (2*j)*2 = 4*j := by omega simpa only [div_pow, mul_pow, Real.sq_sqrt hE, hfour, ← pow_mul, hexp] using hs
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_derivative_square_factorial_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:46
theorem kernelVariance_factorial_envelope Lemma kernelVariance_factorial_envelope in the paper ↗

The finite cubic-factorial variance series follows from endpoint mass and derivative bounds. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
∃ C : ℝ,
0 < C
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
≤ C * (L : ℝ)^2 * ∑ j ∈ range (kernelDegree L + 1), (C * σ^2 * (L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3
Proof (Lean source)
lemma kernelVariance_factorial_envelope (hleg : ClassicalLegendreFacts) : ∃ C : ℝ, 0 < C ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, kernelVariance L σ ≤ C * (L : ℝ)^2 * ∑ j ∈ range (kernelDegree L + 1), (C * σ^2 * (L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3 := by obtain ⟨A, hA, hkernel⟩ := positive_endpoint 1 (by norm_num) let C : ℝ := max A 1296 have hAC : A ≤ C := le_max_left _ _ have hbig : 1296 ≤ C := le_max_right _ _ have hC : 0 < C := lt_of_lt_of_le hA hAC refine ⟨C, hC, ?_⟩ intro L hL σ hσ have hσ0 : 0 ≤ σ := hσ.1 have hL0 : (0 : ℝ) ≤ L := by positivity have hdegree : (kernelDegree L : ℝ)+1 ≤ 3*(L : ℝ) := by unfold kernelDegree have hsub : L - 1 + 1 = L := Nat.sub_add_cancel hL have hh : (L - 1 : ℕ) + 1 = L := hsub have hr : ((L - 1 : ℕ) : ℝ) + 1 = (L : ℝ) := by exact_mod_cast hh push_cast linarith have hmass := (hkernel L hL).2.2.2 have hmassC : (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ C*(L : ℝ)^2 := hmass.trans (mul_le_mul_of_nonneg_right hAC (sq_nonneg _)) have hterm (j : ℕ) (hj : j ∈ range (kernelDegree L+1)) : σ^(2*j) / (Nat.factorial j : ℝ) * (∫ x in (0 : ℝ)..1, ((polyDeriv j (endpointKernel L)).eval x)^2) ≤ C*(L : ℝ)^2 * ((C*σ^2*(L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3) := by have hd := polynomial_derivative_square_factorial_bound hleg (endpointKernel L) (kernelDegree L) j (endpointKernel_natDegree_le L) (le_of_lt_succ (Finset.mem_range.mp hj)) have hpow : 16^j * ((kernelDegree L : ℝ)+1)^(4*j) ≤ (C*(L : ℝ)^4)^j := by calc _ = (16 * (((kernelDegree L : ℝ)+1)^4))^j := by rw [mul_pow, ← pow_mul] _ ≤ (C*(L : ℝ)^4)^j := by apply pow_le_pow_left₀ (by positivity) have hp := pow_le_pow_left₀ (by positivity) hdegree 4 have hc := mul_le_mul_of_nonneg_right hbig (pow_nonneg hL0 4) nlinarith [hp] calc _ ≤ σ^(2*j) / (Nat.factorial j : ℝ) * (16^j * ((kernelDegree L : ℝ)+1)^(4*j) * (C*(L : ℝ)^2) / (Nat.factorial j : ℝ)^2) := by apply mul_le_mul_of_nonneg_left _ (by positivity) exact hd.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hmassC (by positivity)) (by positivity)) _ ≤ σ^(2*j) / (Nat.factorial j : ℝ) * ((C*(L : ℝ)^4)^j * (C*(L : ℝ)^2) / (Nat.factorial j : ℝ)^2) := by gcongr _ = _ := by rw [mul_pow, mul_pow, ← pow_mul] ring have hs := Finset.sum_le_sum hterm rw [← Finset.mul_sum] at hs unfold kernelVariance have hsum : 0 ≤ ∑ j ∈ range (kernelDegree L+1), σ^(2*j) / (Nat.factorial j : ℝ) * (∫ x in (0 : ℝ)..1, ((polyDeriv j (endpointKernel L)).eval x)^2) := by apply Finset.sum_nonneg intro j hj apply mul_nonneg (by positivity) exact intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; positivity) exact (show (3/4 : ℝ) * _ ≤ _ from by nlinarith [hsum]).trans hs
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_factorial_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:68

With zero noise the finite inverse-heat operator is the identity polynomial. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
Proof (Lean source)
lemma inverseHeat_zero (L : ℕ) : inverseHeat L 0 = endpointKernel L := by unfold inverseHeat rw [Finset.sum_eq_single 0] · simp [polyDeriv] · intro k hk hk0 simp [zero_pow hk0] · simp
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:133
theorem inverseHeat_zero_covariance Lemma inverseHeat_zero_covariance in the paper ↗

Zero noise leaves the kernel mean and square unchanged under the Gaussian expectation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x :
ℝ
conclusion 1
(∫ z, (inverseHeat L 0).eval (x + 0*z) ∂gaussianReal 0 1) = (endpointKernel L).eval x
conclusion 2
(∫ z, ((inverseHeat L 0).eval (x + 0*z))^2 ∂gaussianReal 0 1)
= ∑ j ∈ range (kernelDegree L + 1), (0 : ℝ)^(2*j) * ((polyDeriv j (endpointKernel L)).eval x)^2 / (Nat.factorial j : ℝ)
Proof (Lean source)
lemma inverseHeat_zero_covariance (L : ℕ) (x : ℝ) : (∫ z, (inverseHeat L 0).eval (x + 0*z) ∂gaussianReal 0 1) = (endpointKernel L).eval x ∧ (∫ z, ((inverseHeat L 0).eval (x + 0*z))^2 ∂gaussianReal 0 1) = ∑ j ∈ range (kernelDegree L + 1), (0 : ℝ)^(2*j) * ((polyDeriv j (endpointKernel L)).eval x)^2 / (Nat.factorial j : ℝ) := by rw [inverseHeat_zero] constructor · simp · rw [Finset.sum_eq_single 0] · simp [polyDeriv] · intro j hj hj0 have hpow : 2*j ≠ 0 := by omega simp [zero_pow hpow] · simp
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat_zero_covariance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:142

Nonnegative diagonal cubes are bounded by the cube of their finite sum. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
f :
ℕ → ℝ
hf :
∀ j, 0 ≤ f j
N :
ℕ
(∑ j ∈ range N, (f j)^3) ≤ (∑ j ∈ range N, f j)^3
Proof (Lean source)
lemma sum_cubes_le_cube_sum (f : ℕ → ℝ) (hf : ∀ j, 0 ≤ f j) (N : ℕ) : (∑ j ∈ range N, (f j)^3) ≤ (∑ j ∈ range N, f j)^3 := by induction N with | zero => simp | succ N ih => rw [Finset.sum_range_succ, Finset.sum_range_succ] exact (add_le_add ih (le_refl ((f N)^3))).trans (pow_add_pow_le (n := 3) (x := ∑ j ∈ range N, f j) (y := f N) (Finset.sum_nonneg (fun j _ => hf j)) (hf N) (by norm_num))
CausalSmith.Stat.RdTruesideNoiseFrontier.sum_cubes_le_cube_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:160
theorem cubic_factorial_series_le_exp Lemma cubic_factorial_series_le_exp in the paper ↗

The cubic-factorial series is bounded by the cube of the exponential series. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
z :
ℝ
hz :
0 ≤ z
N :
ℕ
(∑ j ∈ range N, (z^3)^j / (Nat.factorial j : ℝ)^3) ≤ exp (3*z)
Proof (Lean source)
lemma cubic_factorial_series_le_exp (z : ℝ) (hz : 0 ≤ z) (N : ℕ) : (∑ j ∈ range N, (z^3)^j / (Nat.factorial j : ℝ)^3) ≤ exp (3*z) := by have hseries : HasSum (fun j : ℕ => z^j / (Nat.factorial j : ℝ)) (exp z) := by rw [Real.exp_eq_exp_ℝ] exact NormedSpace.expSeries_div_hasSum_exp z have hsum : (∑ j ∈ range N, z^j / (Nat.factorial j : ℝ)) ≤ exp z := by rw [← hseries.tsum_eq] exact hseries.summable.sum_le_tsum (range N) (fun j _ => by positivity) calc _ = ∑ j ∈ range N, (z^j / (Nat.factorial j : ℝ))^3 := by apply Finset.sum_congr rfl intro j hj rw [div_pow, ← pow_mul, ← pow_mul, Nat.mul_comm 3 j] _ ≤ (∑ j ∈ range N, z^j / (Nat.factorial j : ℝ))^3 := sum_cubes_le_cube_sum _ (fun j => by positivity) N _ ≤ (exp z)^3 := pow_le_pow_left₀ (Finset.sum_nonneg (fun j _ => by positivity)) hsum 3 _ = exp (3*z) := by simpa using (Real.exp_nat_mul z 3).symm
CausalSmith.Stat.RdTruesideNoiseFrontier.cubic_factorial_series_le_exp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:171
theorem kernelVariance_low_noise_envelope Lemma kernelVariance_low_noise_envelope in the paper ↗

Below the endpoint resolution, the factorial series has an absolute exponential bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
∃ D : ℝ,
0 < D
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
σ ≤ (L : ℝ)^(-2 : ℝ)
kernelVariance L σ ≤ D * (L : ℝ)^2 * exp D
Proof (Lean source)
lemma kernelVariance_low_noise_envelope (hleg : ClassicalLegendreFacts) : ∃ D : ℝ, 0 < D ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, σ ≤ (L : ℝ)^(-2 : ℝ) → kernelVariance L σ ≤ D * (L : ℝ)^2 * exp D := by obtain ⟨C, hC, hvariance⟩ := kernelVariance_factorial_envelope hleg let D : ℝ := max C (3*(C+1)) have hCD : C ≤ D := le_max_left _ _ have hexpD : 3*(C+1) ≤ D := le_max_right _ _ refine ⟨D, lt_of_lt_of_le hC hCD, ?_⟩ intro L hL σ hσ hsmall have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hres : (L : ℝ)^(-2 : ℝ) = ((L : ℝ)^2)⁻¹ := by rw [Real.rpow_neg hLp.le, Real.rpow_two] rw [hres] at hsmall have hscale : σ * (L : ℝ)^2 ≤ 1 := by have hh := mul_le_mul_of_nonneg_right hsmall (sq_nonneg (L : ℝ)) simpa [ne_of_gt hLp] using hh have hscale0 : 0 ≤ σ * (L : ℝ)^2 := mul_nonneg hσ.1 (sq_nonneg _) have hsquare : σ^2 * (L : ℝ)^4 ≤ 1 := by have hs := pow_le_pow_left₀ hscale0 hscale 2 nlinarith [hs] have hbase : C*σ^2*(L : ℝ)^4 ≤ (C+1)^3 := by have hc := mul_le_mul_of_nonneg_left hsquare hC.le nlinarith [sq_nonneg C] have hseries : (∑ j ∈ range (kernelDegree L+1), (C*σ^2*(L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3) ≤ exp D := by calc _ ≤ ∑ j ∈ range (kernelDegree L+1), ((C+1)^3)^j / (Nat.factorial j : ℝ)^3 := by apply Finset.sum_le_sum intro j hj gcongr _ ≤ exp (3*(C+1)) := cubic_factorial_series_le_exp (C+1) (by positivity) _ _ ≤ exp D := Real.exp_le_exp.mpr hexpD calc _ ≤ C*(L : ℝ)^2 * _ := hvariance L hL σ hσ _ ≤ C*(L : ℝ)^2 * exp D := mul_le_mul_of_nonneg_left hseries (by positivity) _ ≤ D*(L : ℝ)^2 * exp D := by gcongr
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_low_noise_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:191
theorem kernelVariance_power_noise_envelope Lemma kernelVariance_power_noise_envelope in the paper ↗

The diagonal-series argument controls variance by the two-thirds noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
∃ D : ℝ,
0 < D
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
kernelVariance L σ ≤ D * (L : ℝ)^2 * exp (D * (σ * (L : ℝ)^2)^(2/3 : ℝ))
Proof (Lean source)
lemma kernelVariance_power_noise_envelope (hleg : ClassicalLegendreFacts) : ∃ D : ℝ, 0 < D ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, kernelVariance L σ ≤ D * (L : ℝ)^2 * exp (D * (σ * (L : ℝ)^2)^(2/3 : ℝ)) := by obtain ⟨C, hC, hvariance⟩ := kernelVariance_factorial_envelope hleg let D : ℝ := max C (3*(C+1)) have hCD : C ≤ D := le_max_left _ _ have hexpD : 3*(C+1) ≤ D := le_max_right _ _ refine ⟨D, lt_of_lt_of_le hC hCD, ?_⟩ intro L hL σ hσ let a : ℝ := σ * (L : ℝ)^2 let z : ℝ := (C+1) * a^(2/3 : ℝ) have ha : 0 ≤ a := mul_nonneg hσ.1 (sq_nonneg _) have hz : 0 ≤ z := by dsimp [z]; positivity have hcub : (a^(2/3 : ℝ))^3 = a^2 := by rw [← Real.rpow_natCast _ 3, ← Real.rpow_mul ha] norm_num have hbase : C*σ^2*(L : ℝ)^4 ≤ z^3 := by dsimp [z] rw [mul_pow, hcub] have hc : C ≤ (C+1)^3 := by nlinarith [sq_nonneg C] have hb := mul_le_mul_of_nonneg_right hc (sq_nonneg a) dsimp [a] at hb nlinarith [hb] have hseries : (∑ j ∈ range (kernelDegree L+1), (C*σ^2*(L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3) ≤ exp (D * a^(2/3 : ℝ)) := by calc _ ≤ ∑ j ∈ range (kernelDegree L+1), (z^3)^j / (Nat.factorial j : ℝ)^3 := by apply Finset.sum_le_sum intro j hj gcongr _ ≤ exp (3*z) := cubic_factorial_series_le_exp z hz _ _ ≤ exp (D * a^(2/3 : ℝ)) := by apply Real.exp_le_exp.mpr dsimp [z] nlinarith [mul_le_mul_of_nonneg_right hexpD (Real.rpow_nonneg ha (2/3 : ℝ))] calc _ ≤ C*(L : ℝ)^2 * _ := hvariance L hL σ hσ _ ≤ C*(L : ℝ)^2 * exp (D * a^(2/3 : ℝ)) := mul_le_mul_of_nonneg_left hseries (by positivity) _ ≤ D*(L : ℝ)^2 * exp (D * a^(2/3 : ℝ)) := by gcongr
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_power_noise_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:231
theorem endpoint_intermediate_noiseCost Lemma endpoint_intermediate_noiseCost in the paper ↗

The intermediate cost exactly equals the two-thirds endpoint noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
hσ :
0 ≤ σ
hsmall :
¬ σ ≤ (L : ℝ)^(-2 : ℝ)
hpower :
σ^4 ≤ (L : ℝ)^(-2 : ℝ)
1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ = (σ * (L : ℝ)^2)^(2/3 : ℝ)
Proof (Lean source)
lemma endpoint_intermediate_noiseCost (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) (hσ : 0 ≤ σ) (hsmall : ¬ σ ≤ (L : ℝ)^(-2 : ℝ)) (hpower : σ^4 ≤ (L : ℝ)^(-2 : ℝ)) : 1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ = (σ * (L : ℝ)^2)^(2/3 : ℝ) := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hres : (L : ℝ)^(-2 : ℝ) = ((L : ℝ)^2)⁻¹ := by rw [Real.rpow_neg hLp.le, Real.rpow_two] simp only [noiseCost, if_neg hsmall, if_pos hpower] rw [hres, div_inv_eq_mul] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.endpoint_intermediate_noiseCost · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:276
theorem kernelVariance_noncompact_noise_envelope Lemma kernelVariance_noncompact_noise_envelope in the paper ↗

Below the compact-support interface, the public variance has the exact cost envelope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
∃ D : ℝ,
0 < D
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
(σ ≤ (L : ℝ)^(-2 : ℝ) ∨ σ^4 ≤ (L : ℝ)^(-2 : ℝ))
kernelVariance L σ ≤ D * (L : ℝ)^2 * exp (D * (1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ))
Proof (Lean source)
lemma kernelVariance_noncompact_noise_envelope (hleg : ClassicalLegendreFacts) : ∃ D : ℝ, 0 < D ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, (σ ≤ (L : ℝ)^(-2 : ℝ) ∨ σ^4 ≤ (L : ℝ)^(-2 : ℝ)) → kernelVariance L σ ≤ D * (L : ℝ)^2 * exp (D * (1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := by obtain ⟨D, hD, hbound⟩ := kernelVariance_power_noise_envelope hleg refine ⟨D, hD, ?_⟩ intro L hL σ hσ hbranch apply (hbound L hL σ hσ).trans apply mul_le_mul_of_nonneg_left _ (by positivity) apply Real.exp_le_exp.mpr apply mul_le_mul_of_nonneg_left _ hD.le by_cases hsmall : σ ≤ (L : ℝ)^(-2 : ℝ) · have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hres : (L : ℝ)^(-2 : ℝ) = ((L : ℝ)^2)⁻¹ := by rw [Real.rpow_neg hLp.le, Real.rpow_two] have hscale : σ * (L : ℝ)^2 ≤ 1 := by rw [hres] at hsmall have hh := mul_le_mul_of_nonneg_right hsmall (sq_nonneg (L : ℝ)) simpa [ne_of_gt hLp] using hh simp only [noiseCost, if_pos hsmall, add_zero] exact Real.rpow_le_one (mul_nonneg hσ.1 (sq_nonneg _)) hscale (by norm_num) · rw [endpoint_intermediate_noiseCost L hL σ hσ.1 hsmall (hbranch.resolve_left hsmall)]
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_noncompact_noise_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:288
theorem finite_cubic_factorial_log_bound Lemma finite_cubic_factorial_log_bound in the paper ↗

A finite cubic-factorial series admits a logarithmic bound at a fixed degree scale. The exponential coefficient estimate is the uniform version of the factorial/logarithm estimate: each normalized coefficient at scale L is bounded by exp L. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
a :
ℝ
ha :
1 ≤ a
N :
ℕ
hN :
N ≤ 3*L+1
(∑ j ∈ range N, (a*(L : ℝ)^3)^j / (Nat.factorial j : ℝ)^3)
≤ exp ((L : ℝ)*(7 + 3*log a))
Proof (Lean source)
lemma finite_cubic_factorial_log_bound (L : ℕ) (hL : 1 ≤ L) (a : ℝ) (ha : 1 ≤ a) (N : ℕ) (hN : N ≤ 3*L+1) : (∑ j ∈ range N, (a*(L : ℝ)^3)^j / (Nat.factorial j : ℝ)^3) ≤ exp ((L : ℝ)*(7 + 3*log a)) := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hterm (j : ℕ) (hj : j ∈ range N) : (a*(L : ℝ)^3)^j / (Nat.factorial j : ℝ)^3 ≤ a^(3*L) * exp (3*(L : ℝ)) := by have hjL : j ≤ 3*L := by have := Finset.mem_range.mp hj; omega calc _ = a^j * ((L : ℝ)^j / (Nat.factorial j : ℝ))^3 := by rw [mul_pow, div_pow, ← pow_mul, ← pow_mul, Nat.mul_comm 3 j] ring _ ≤ a^(3*L) * (exp (L : ℝ))^3 := by apply mul_le_mul · exact pow_le_pow_right₀ ha hjL · exact pow_le_pow_left₀ (by positivity) (Real.pow_div_factorial_le_exp (L : ℝ) hLp.le j) 3 · positivity · positivity _ = _ := by rw [← Real.exp_nat_mul]; norm_num have hcard : (N : ℝ) ≤ exp (4*(L : ℝ)) := by have hN' : (N : ℝ) ≤ 3*(L : ℝ)+1 := by exact_mod_cast hN have hL' : (1 : ℝ) ≤ L := by exact_mod_cast hL exact (hN'.trans (by linarith : 3*(L : ℝ)+1 ≤ 4*(L : ℝ)+1)).trans (Real.add_one_le_exp _) calc _ ≤ ∑ j ∈ range N, a^(3*L) * exp (3*(L : ℝ)) := Finset.sum_le_sum hterm _ = (N : ℝ) * (a^(3*L) * exp (3*(L : ℝ))) := by simp _ ≤ exp (4*(L : ℝ)) * (a^(3*L) * exp (3*(L : ℝ))) := mul_le_mul_of_nonneg_right hcard (by positivity) _ = exp ((L : ℝ)*(7 + 3*log a)) := by rw [← Real.exp_log (lt_of_lt_of_le (by norm_num) ha), ← Real.exp_nat_mul] simp only [Real.log_exp, Nat.cast_mul, Nat.cast_ofNat] rw [← Real.exp_add, ← Real.exp_add] congr 1 ring
CausalSmith.Stat.RdTruesideNoiseFrontier.finite_cubic_factorial_log_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:313
theorem endpoint_compact_noiseCost Lemma endpoint_compact_noiseCost in the paper ↗

On the compact-support branch, the endpoint cost is the degree times a logarithm. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
hsmall :
¬ σ ≤ (L : ℝ)^(-2 : ℝ)
hpower :
¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ)
1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ = (L : ℝ)*(1 + log (σ^2*(L : ℝ)))
Proof (Lean source)
lemma endpoint_compact_noiseCost (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) (hsmall : ¬ σ ≤ (L : ℝ)^(-2 : ℝ)) (hpower : ¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ)) : 1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ = (L : ℝ)*(1 + log (σ^2*(L : ℝ))) := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hres : (L : ℝ)^(-2 : ℝ) = ((L : ℝ)^2)⁻¹ := by rw [Real.rpow_neg hLp.le, Real.rpow_two] have hsqrt : sqrt ((L : ℝ)^(-2 : ℝ)) = (L : ℝ)⁻¹ := by rw [hres, Real.sqrt_inv, Real.sqrt_sq hLp.le] have hroot : ((L : ℝ)^(-2 : ℝ))^(-1/2 : ℝ) = (L : ℝ) := by rw [show (-1/2 : ℝ) = -(1/2 : ℝ) by norm_num, Real.rpow_neg (by positivity), ← Real.sqrt_eq_rpow, hsqrt, inv_inv] simp only [noiseCost, if_neg hsmall, if_neg hpower, hroot, hsqrt, div_inv_eq_mul] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.endpoint_compact_noiseCost · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:355
theorem endpoint_compact_noise_scale Lemma endpoint_compact_noise_scale in the paper ↗

Above the compact-support interface the logarithmic noise scale is at least one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
hpower :
¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ)
1 ≤ σ^2*(L : ℝ)
Proof (Lean source)
lemma endpoint_compact_noise_scale (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) (hpower : ¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ)) : 1 ≤ σ^2*(L : ℝ) := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hres : (L : ℝ)^(-2 : ℝ) = ((L : ℝ)^2)⁻¹ := by rw [Real.rpow_neg hLp.le, Real.rpow_two] have hp : ((L : ℝ)^2)⁻¹ < σ^4 := by simpa [hres] using lt_of_not_ge hpower have hp' : 1 < σ^4*(L : ℝ)^2 := by have hh := mul_lt_mul_of_pos_right hp (sq_pos_of_pos hLp) simpa [ne_of_gt hLp] using hh have hn : 0 ≤ σ^2*(L : ℝ) := by positivity nlinarith [sq_nonneg (σ^2*(L : ℝ)-1)]
CausalSmith.Stat.RdTruesideNoiseFrontier.endpoint_compact_noise_scale · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:372
theorem endpoint_noiseCost_factor_nonneg Lemma endpoint_noiseCost_factor_nonneg in the paper ↗

The exponential cost factor is nonnegative in every endpoint noise branch. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
hσ :
0 ≤ σ
0 ≤ 1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ
Proof (Lean source)
lemma endpoint_noiseCost_factor_nonneg (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) (hσ : 0 ≤ σ) : 0 ≤ 1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ := by by_cases hsmall : σ ≤ (L : ℝ)^(-2 : ℝ) · simp only [noiseCost, if_pos hsmall, add_zero] norm_num · by_cases hpower : σ^4 ≤ (L : ℝ)^(-2 : ℝ) · rw [endpoint_intermediate_noiseCost L hL σ hσ hsmall hpower] positivity · rw [endpoint_compact_noiseCost L hL σ hsmall hpower] have hlog := Real.log_nonneg (endpoint_compact_noise_scale L hL σ hpower) positivity
CausalSmith.Stat.RdTruesideNoiseFrontier.endpoint_noiseCost_factor_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:385
theorem kernelVariance_compact_noise_envelope Lemma kernelVariance_compact_noise_envelope in the paper ↗

The finite degree and cubic factorial yield the compact-support variance envelope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
∃ D : ℝ,
0 < D
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
(¬ σ ≤ (L : ℝ)^(-2 : ℝ))
(¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ))
kernelVariance L σ ≤ D*(L : ℝ)^2 * exp (D*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ))
Proof (Lean source)
lemma kernelVariance_compact_noise_envelope (hleg : ClassicalLegendreFacts) : ∃ D : ℝ, 0 < D ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, (¬ σ ≤ (L : ℝ)^(-2 : ℝ)) → (¬ σ^4 ≤ (L : ℝ)^(-2 : ℝ)) → kernelVariance L σ ≤ D*(L : ℝ)^2 * exp (D*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := by obtain ⟨C, hC, hvariance⟩ := kernelVariance_factorial_envelope hleg let D : ℝ := max C (7 + 3*log (C+1)) have hCD : C ≤ D := le_max_left _ _ have hlogD : 7 + 3*log (C+1) ≤ D := le_max_right _ _ have hlogC : 0 ≤ log (C+1) := Real.log_nonneg (by linarith) have hD : 0 < D := lt_of_lt_of_le hC hCD refine ⟨D, hD, ?_⟩ intro L hL σ hσ hsmall hpower have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hscale : 1 ≤ σ^2*(L : ℝ) := endpoint_compact_noise_scale L hL σ hpower have hscale0 : 0 < σ^2*(L : ℝ) := lt_of_lt_of_le (by norm_num) hscale have ha : 1 ≤ (C+1)*(σ^2*(L : ℝ)) := by nlinarith have hN : kernelDegree L+1 ≤ 3*L+1 := by unfold kernelDegree; omega have hseries : (∑ j ∈ range (kernelDegree L+1), (C*σ^2*(L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3) ≤ exp (D*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := by calc _ ≤ ∑ j ∈ range (kernelDegree L+1), (((C+1)*(σ^2*(L : ℝ)))*(L : ℝ)^3)^j / (Nat.factorial j : ℝ)^3 := by apply Finset.sum_le_sum intro j hj apply div_le_div_of_nonneg_right _ (by positivity) apply pow_le_pow_left₀ (by positivity) nlinarith [mul_nonneg (sq_nonneg σ) (pow_nonneg hLp.le 4)] _ ≤ exp ((L : ℝ)*(7 + 3*log ((C+1)*(σ^2*(L : ℝ))))) := finite_cubic_factorial_log_bound L hL _ ha _ hN _ ≤ _ := by apply Real.exp_le_exp.mpr rw [endpoint_compact_noiseCost L hL σ hsmall hpower, Real.log_mul (by positivity) (ne_of_gt hscale0)] have hlogscale : 0 ≤ log (σ^2*(L : ℝ)) := Real.log_nonneg hscale have hD3 : 3 ≤ D := by linarith have hprod := mul_le_mul_of_nonneg_right hD3 hlogscale nlinarith [mul_nonneg hLp.le (show 0 ≤ D*(1+log (σ^2*(L : ℝ))) - (7+3*(log (C+1)+log (σ^2*(L : ℝ)))) by nlinarith)] calc _ ≤ C*(L : ℝ)^2 * _ := hvariance L hL σ hσ _ ≤ C*(L : ℝ)^2 * exp (D*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := mul_le_mul_of_nonneg_left hseries (by positivity) _ ≤ D*(L : ℝ)^2 * exp (D*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := by gcongr
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_compact_noise_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:398

The nonzero diagonal orthogonality integral supplies square integrability. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
MemLp (fun z : ℝ => (aeval z (hermite j) : ℝ)) 2 (gaussianReal 0 1)
Proof (Lean source)
lemma hermite_memLp_two (hherm : ClassicalHermiteFacts) (j : ℕ) : MemLp (fun z : ℝ => (aeval z (hermite j) : ℝ)) 2 (gaussianReal 0 1) := by apply (memLp_two_iff_integrable_sq (by fun_prop)).mpr by_contra hn have hz := integral_undef hn have hd := hherm.2.1 j j simp only [pow_two] at hz rw [hz, if_pos rfl] at hd have hp : (0 : ℝ) < (Nat.factorial j : ℝ) := by positivity linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.hermite_memLp_two · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:446

The constant Hermite mode extracts the Gaussian mean of every mode. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
(∫ z, (aeval z (hermite j) : ℝ) ∂gaussianReal 0 1)
= if j = 0 then 1 else 0
Proof (Lean source)
lemma hermite_gaussian_mean (hherm : ClassicalHermiteFacts) (j : ℕ) : (∫ z, (aeval z (hermite j) : ℝ) ∂gaussianReal 0 1) = if j = 0 then 1 else 0 := by have h := hherm.2.1 j 0 rw [hherm.2.2] at h simp only [map_one, mul_one] at h split_ifs with hj · subst j simpa using h · simpa [hj] using h
CausalSmith.Stat.RdTruesideNoiseFrontier.hermite_gaussian_mean · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:459
theorem hermite_finite_sum_mean Lemma hermite_finite_sum_mean in the paper ↗

A finite Hermite series has mean equal to its constant coefficient. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
c :
ℕ → ℝ
N :
ℕ
hN :
0 < N
(∫ z, ∑ j ∈ range N, c j * (aeval z (hermite j) : ℝ) ∂gaussianReal 0 1)
= c 0
Proof (Lean source)
lemma hermite_finite_sum_mean (hherm : ClassicalHermiteFacts) (c : ℕ → ℝ) (N : ℕ) (hN : 0 < N) : (∫ z, ∑ j ∈ range N, c j * (aeval z (hermite j) : ℝ) ∂gaussianReal 0 1) = c 0 := by rw [integral_finset_sum] · simp_rw [integral_const_mul, hermite_gaussian_mean hherm] simp [mul_ite, hN] · intro j hj exact ((hermite_memLp_two hherm j).integrable (by norm_num)).const_mul _
CausalSmith.Stat.RdTruesideNoiseFrontier.hermite_finite_sum_mean · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:471
theorem hermite_finite_sum_square Lemma hermite_finite_sum_square in the paper ↗

Orthogonality removes all cross terms in the square of a finite Hermite series. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
c :
ℕ → ℝ
N :
ℕ
(∫ z, (∑ j ∈ range N, c j * (aeval z (hermite j) : ℝ))^2 ∂gaussianReal 0 1)
= ∑ j ∈ range N, (c j)^2 * (Nat.factorial j : ℝ)
Proof (Lean source)
lemma hermite_finite_sum_square (hherm : ClassicalHermiteFacts) (c : ℕ → ℝ) (N : ℕ) : (∫ z, (∑ j ∈ range N, c j * (aeval z (hermite j) : ℝ))^2 ∂gaussianReal 0 1) = ∑ j ∈ range N, (c j)^2 * (Nat.factorial j : ℝ) := by have hint (j k : ℕ) : Integrable (fun z : ℝ => c j * (aeval z (hermite j) : ℝ) * (c k * (aeval z (hermite k) : ℝ))) (gaussianReal 0 1) := by exact ((hermite_memLp_two hherm j).const_mul (c j)).integrable_mul ((hermite_memLp_two hherm k).const_mul (c k)) simp_rw [pow_two, Finset.sum_mul, Finset.mul_sum] rw [integral_finset_sum _ (fun j hj => integrable_finset_sum _ (fun k hk => hint j k))] apply Finset.sum_congr rfl intro j hj rw [integral_finset_sum _ (fun k hk => hint j k)] have he (k : ℕ) : (∫ z, c j * (aeval z (hermite j) : ℝ) * (c k * (aeval z (hermite k) : ℝ)) ∂gaussianReal 0 1) = c j * c k * (if j = k then (Nat.factorial j : ℝ) else 0) := by calc _ = ∫ z, (c j * c k) * ((aeval z (hermite j) : ℝ) * aeval z (hermite k)) ∂gaussianReal 0 1 := by congr 1 funext z ring _ = _ := by rw [integral_const_mul, hherm.2.1] simp_rw [he] simp [mul_ite, Finset.mem_range.mp hj, pow_two]
CausalSmith.Stat.RdTruesideNoiseFrontier.hermite_finite_sum_square · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:482
theorem exact_covariance

Exact inverse-heat mean, exact second moment, and absolute factorial covariance envelope. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
∃ C : ℝ,
0 < C
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
x :
ℝ
(∫ z, (inverseHeat L σ).eval (x + σ*z) ∂gaussianReal 0 1) = (endpointKernel L).eval x
(∫ z, ((inverseHeat L σ).eval (x + σ*z))^2 ∂gaussianReal 0 1)
= ∑ j ∈ range (kernelDegree L + 1), σ^(2*j) * ((polyDeriv j (endpointKernel L)).eval x)^2 / (Nat.factorial j : ℝ)
≤ C * (L : ℝ)^2 * ∑ j ∈ range (kernelDegree L + 1), (C * σ^2 * (L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3
Proof (Lean source)
-- @node: lem:exact-covariance lemma exact_covariance : ∃ C : ℝ, 0 < C ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, (∀ x : ℝ, (∫ z, (inverseHeat L σ).eval (x + σ*z) ∂gaussianReal 0 1) = (endpointKernel L).eval x ∧ (∫ z, ((inverseHeat L σ).eval (x + σ*z))^2 ∂gaussianReal 0 1) = ∑ j ∈ range (kernelDegree L + 1), σ^(2*j) * ((polyDeriv j (endpointKernel L)).eval x)^2 / (Nat.factorial j : ℝ)) ∧ kernelVariance L σ ≤ C * (L : ℝ)^2 * ∑ j ∈ range (kernelDegree L + 1), (C * σ^2 * (L : ℝ)^4)^j / (Nat.factorial j : ℝ)^3 := by let hermite_of_gate : ClassicalHermiteFacts := classicalHermiteFacts let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts obtain ⟨C, hC, hvariance⟩ := kernelVariance_factorial_envelope legendre_of_gate refine ⟨C, hC, ?_⟩ intro L hL σ hσ refine ⟨?_, hvariance L hL σ hσ⟩ by_cases hzero : σ = 0 · subst σ exact inverseHeat_zero_covariance L · intro x have hexp : ∀ z : ℝ, (inverseHeat L σ).eval (x + σ*z) = ∑ j ∈ range (kernelDegree L + 1), (σ^j * (polyDeriv j (endpointKernel L)).eval x / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ) := by intro z rw [inverseHeat_eq_finiteInverseHeat] exact finiteInverseHeat_hermite_expansion (endpointKernel L) (kernelDegree L) (endpointKernel_natDegree_le L) x σ z constructor · simp_rw [hexp] simpa [polyDeriv] using hermite_finite_sum_mean hermite_of_gate (fun j => σ^j * (polyDeriv j (endpointKernel L)).eval x / (Nat.factorial j : ℝ)) (kernelDegree L + 1) (by omega) · simp_rw [hexp] rw [hermite_finite_sum_square hermite_of_gate] apply Finset.sum_congr rfl intro j hj have hf : (Nat.factorial j : ℝ) ≠ 0 := by positivity rw [div_pow, mul_pow, ← pow_mul, Nat.mul_comm j 2] field_simp
CausalSmith.Stat.RdTruesideNoiseFrontier.exact_covariance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:512
theorem variance_cost_envelope

An absolute exponential cost envelope for the exact public variance. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
∃ C : ℝ,
0 < C
conclusion 1
L :
ℕ
1 ≤ L
σ ∈ Icc (0 : ℝ) 1 :
kernelVariance L σ ≤ C * (L : ℝ)^2 * exp (C * (1 + noiseCost ((L : ℝ) ^ (-2 : ℝ)) σ))
Proof (Lean source)
-- @node: lem:variance-cost-envelope lemma variance_cost_envelope : ∃ C : ℝ, 0 < C ∧ ∀ L : ℕ, 1 ≤ L → ∀ σ ∈ Icc (0 : ℝ) 1, kernelVariance L σ ≤ C * (L : ℝ)^2 * exp (C * (1 + noiseCost ((L : ℝ) ^ (-2 : ℝ)) σ)) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts obtain ⟨D, hD, hnoncompact⟩ := kernelVariance_noncompact_noise_envelope legendre_of_gate obtain ⟨E, hE, hcompact⟩ := kernelVariance_compact_noise_envelope legendre_of_gate let C : ℝ := max D E have hDC : D ≤ C := le_max_left _ _ have hEC : E ≤ C := le_max_right _ _ refine ⟨C, lt_of_lt_of_le hD hDC, ?_⟩ intro L hL σ hσ have hcost := endpoint_noiseCost_factor_nonneg L hL σ hσ.1 have henlarge (A : ℝ) (hA : 0 < A) (hAC : A ≤ C) : A*(L : ℝ)^2 * exp (A*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) ≤ C*(L : ℝ)^2 * exp (C*(1 + noiseCost ((L : ℝ)^(-2 : ℝ)) σ)) := by apply mul_le_mul · exact mul_le_mul_of_nonneg_right hAC (sq_nonneg _) · exact Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right hAC hcost) · positivity · positivity by_cases hsmall : σ ≤ (L : ℝ)^(-2 : ℝ) · exact (hnoncompact L hL σ hσ (inl hsmall)).trans (henlarge D hD hDC) · by_cases hpower : σ^4 ≤ (L : ℝ)^(-2 : ℝ) · exact (hnoncompact L hL σ hσ (inr hpower)).trans (henlarge D hD hDC) · exact (hcompact L hL σ hσ hsmall hpower).trans (henlarge E hE hEC)
CausalSmith.Stat.RdTruesideNoiseFrontier.variance_cost_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Covariance.lean:554
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DerivativeBounds 8 declarations Prefix-weight telescoping supplies the factorial gain in powers of the shifted-Legendre differentiation matrix; weighted Cauchy--Schwarz bounds its action.

Weighted increasing-chain bounds for differentiation

Prefix-weight telescoping supplies the factorial gain in powers of the shifted-Legendre differentiation matrix; weighted Cauchy--Schwarz bounds its action.

theorem shiftedLegendre_prefix_power_bound Lemma shiftedLegendre_prefix_power_bound in the paper ↗

Summing prefix powers of the endpoint weights gains one power and its divisor. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n r :
ℕ
(r+1 : ℝ) * (∑ i ∈ range n, (2*(i : ℝ)+1) * ((i : ℝ)^2)^r) ≤ ((n : ℝ)^2)^(r+1)
Proof (Lean source)
lemma shiftedLegendre_prefix_power_bound (n r : ℕ) : (r+1 : ℝ) * (∑ i ∈ range n, (2*(i : ℝ)+1) * ((i : ℝ)^2)^r) ≤ ((n : ℝ)^2)^(r+1) := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, mul_add] have h := nonnegative_power_linear_terms_le ((n : ℝ)^2) (2*(n : ℝ)+1) (sq_nonneg _) (by positivity) r have he : (n : ℝ)^2 + (2*(n : ℝ)+1) = ((n+1 : ℕ) : ℝ)^2 := by push_cast; ring rw [he] at h calc _ ≤ ((n : ℝ)^2)^(r+1) + (r+1 : ℝ)*((2*(n : ℝ)+1)*((n : ℝ)^2)^r) := add_le_add ih le_rfl _ ≤ _ := by simpa only [mul_assoc] using h
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_prefix_power_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:15

The entries of the iterated derivative matrix, multiplied on the right. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
legendreDerivativePower m :
ℕ → ℕ → ℕ → ℝ
clause 1
| 0, k, l => if k = l then 1 else 0
clause 2
| j+1, k, l
=> ∑ i ∈ range (m+1), legendreDerivativePower m j k i * legendreDerivativeEntry i l
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativePower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:33
theorem legendreDerivativePower_nonneg Lemma legendreDerivativePower_nonneg in the paper ↗

Matrix entries are nonnegative, so deleting parity restrictions preserves an upper bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j k l :
ℕ
Proof (Lean source)
lemma legendreDerivativePower_nonneg (m j k l : ℕ) : 0 ≤ legendreDerivativePower m j k l := by induction j generalizing k l with | zero => simp only [legendreDerivativePower]; split_ifs <;> norm_num | succ j ih => apply Finset.sum_nonneg intro i hi apply mul_nonneg (ih k i) unfold legendreDerivativeEntry split_ifs <;> first | positivity | exact le_rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativePower_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:39
theorem legendreDerivativePower_eq_zero Lemma legendreDerivativePower_eq_zero in the paper ↗

After positive differentiation order only strictly increasing index paths survive. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j k l :
ℕ
hj :
1 ≤ j
hkl :
l ≤ k
Proof (Lean source)
lemma legendreDerivativePower_eq_zero (m j k l : ℕ) (hj : 1 ≤ j) (hkl : l ≤ k) : legendreDerivativePower m j k l = 0 := by cases j with | zero => omega | succ j => induction j generalizing k l with | zero => simp only [legendreDerivativePower] apply Finset.sum_eq_zero intro i hi by_cases hki : k = i · subst i; simp [legendreDerivativeEntry, show ¬ k < l by omega] · simp [hki] | succ j ih => apply Finset.sum_eq_zero intro i hi by_cases hil : i < l · rw [ih k i (by omega) (by omega)] simp · simp [legendreDerivativeEntry, hil]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativePower_eq_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:51
theorem legendreDerivativePower_entry_bound Lemma legendreDerivativePower_entry_bound in the paper ↗

Prefix-weight telescoping bounds all increasing chains, with one factorial per internal index. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j k l :
ℕ
hj :
1 ≤ j
≤ 2^j * (2*(k : ℝ)+1) * ((l : ℝ)^2)^(j-1) / (factorial (j-1) : ℝ)
Proof (Lean source)
lemma legendreDerivativePower_entry_bound (m j k l : ℕ) (hj : 1 ≤ j) : legendreDerivativePower m j k l ≤ 2^j * (2*(k : ℝ)+1) * ((l : ℝ)^2)^(j-1) / (Nat.factorial (j-1) : ℝ) := by cases j with | zero => omega | succ j => induction j generalizing k l with | zero => simp only [legendreDerivativePower] calc _ ≤ legendreDerivativeEntry k l := by by_cases hk : k ∈ range (m+1) · simp [hk] · have hz : (∑ i ∈ range (m+1), (if k = i then (1 : ℝ) else 0) * legendreDerivativeEntry i l) = 0 := by apply Finset.sum_eq_zero intro i hi have hki : k ≠ i := by intro he; subst i; exact hk hi simp [hki] rw [hz] unfold legendreDerivativeEntry split_ifs <;> positivity _ ≤ _ := by simp [legendreDerivativeEntry]; split_ifs <;> first | positivity | exact le_rfl | succ j ih => have hsum : legendreDerivativePower m (j+2) k l ≤ ∑ i ∈ range l, (2^(j+1) * (2*(k : ℝ)+1) * ((i : ℝ)^2)^j / (Nat.factorial j : ℝ)) * (2*(2*(i : ℝ)+1)) := by unfold legendreDerivativePower calc _ ≤ ∑ i ∈ range (m+1), if i < l then (2^(j+1) * (2*(k : ℝ)+1) * ((i : ℝ)^2)^j / (Nat.factorial j : ℝ)) * (2*(2*(i : ℝ)+1)) else 0 := by apply Finset.sum_le_sum intro i hi by_cases hil : i < l · simp only [hil, if_true] apply mul_le_mul (by simpa using ih k i (by omega)) (by simp [legendreDerivativeEntry]; split_ifs <;> first | positivity | exact le_rfl) (by unfold legendreDerivativeEntry; split_ifs <;> first | positivity | exact le_rfl) (by positivity) · simp [legendreDerivativeEntry, hil] _ ≤ _ := by rw [← Finset.sum_filter] apply Finset.sum_le_sum_of_subset_of_nonneg · intro i hi exact Finset.mem_range.mpr (Finset.mem_filter.mp hi).2 · intro i hi hn; positivity have hp := shiftedLegendre_prefix_power_bound l j have hf : (Nat.factorial (j+1) : ℝ) = (j+1 : ℝ)*(Nat.factorial j : ℝ) := by rw [Nat.factorial_succ]; push_cast; rfl calc _ ≤ _ := hsum _ = (2^(j+2) * (2*(k : ℝ)+1) / (Nat.factorial j : ℝ)) * (∑ i ∈ range l, (2*(i : ℝ)+1)*((i : ℝ)^2)^j) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i hi rw [pow_succ] ring _ ≤ 2^(j+2) * (2*(k : ℝ)+1) * ((l : ℝ)^2)^(j+1) / (Nat.factorial (j+1) : ℝ) := by rw [hf] have hp' : (∑ i ∈ range l, (2*(i : ℝ)+1)*((i : ℝ)^2)^j) ≤ ((l : ℝ)^2)^(j+1)/(j+1 : ℝ) := (le_div_iff₀ (by positivity)).mpr (by simpa only [mul_comm] using hp) have hh := mul_le_mul_of_nonneg_left hp' (show 0 ≤ 2^(j+2) * (2*(k : ℝ)+1) / (Nat.factorial j : ℝ) by positivity) calc _ ≤ _ := hh _ = _ := by field_simp <;> ring _ = _ := by simp only [Nat.add_sub_cancel]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativePower_entry_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:73
theorem legendreDerivativePower_action Lemma legendreDerivativePower_action in the paper ↗

The recursively multiplied entries act on coefficients exactly as repeated differentiation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j :
ℕ
c :
ℕ → ℝ
k :
ℕ
hk :
k ∈ range (m+1)
= ∑ l ∈ range (m+1), legendreDerivativePower m j k l * c l
Proof (Lean source)
lemma legendreDerivativePower_action (m j : ℕ) (c : ℕ → ℝ) (k : ℕ) (hk : k ∈ range (m+1)) : ((legendreDerivativeAction m)^[j]) c k = ∑ l ∈ range (m+1), legendreDerivativePower m j k l * c l := by induction j generalizing c with | zero => simp [legendreDerivativePower, hk] | succ j ih => rw [Function.iterate_succ_apply, ih] simp only [legendreDerivativeAction, Finset.mul_sum, legendreDerivativePower, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro l hl apply Finset.sum_congr rfl intro i hi ring
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativePower_action · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:149
theorem weighted_derivative_matrix_action_bound Lemma weighted_derivative_matrix_action_bound in the paper ↗

Weighted Cauchy--Schwarz transfers a separable entry bound to the weighted coefficient norm. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
s :
Finset ℕ
D :
ℕ → ℕ → ℝ
c w :
ℕ → ℝ
B :
ℝ
hw :
∀ k ∈ s, 0 < w k
hD :
∀ k ∈ s, ∀ l ∈ s, (D k l)^2 ≤ B^2*(w k)^2
(∑ k ∈ s, (∑ l ∈ s, D k l*c l)^2 / w k) ≤ B^2*(∑ k ∈ s, w k)^2*(∑ l ∈ s, (c l)^2/w l)
Proof (Lean source)
lemma weighted_derivative_matrix_action_bound (s : Finset ℕ) (D : ℕ → ℕ → ℝ) (c w : ℕ → ℝ) (B : ℝ) (hw : ∀ k ∈ s, 0 < w k) (hD : ∀ k ∈ s, ∀ l ∈ s, (D k l)^2 ≤ B^2*(w k)^2) : (∑ k ∈ s, (∑ l ∈ s, D k l*c l)^2 / w k) ≤ B^2*(∑ k ∈ s, w k)^2*(∑ l ∈ s, (c l)^2/w l) := by have hE : 0 ≤ ∑ l ∈ s, (c l)^2/w l := Finset.sum_nonneg (fun l hl => div_nonneg (sq_nonneg _) (hw l hl).le) calc _ ≤ ∑ k ∈ s, B^2*w k*(∑ l ∈ s, w l)*(∑ l ∈ s, (c l)^2/w l) := by apply Finset.sum_le_sum intro k hk have hcs := Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul s (r := fun l => D k l*c l) (f := fun l => (D k l)^2*w l) (g := fun l => (c l)^2/w l) (by intro l hl; exact mul_nonneg (sq_nonneg _) (hw l hl).le) (by intro l hl; exact div_nonneg (sq_nonneg _) (hw l hl).le) (by intro l hl; apply le_of_eq; field_simp [(hw l hl).ne'] <;> ring) have hmass : (∑ l ∈ s, (D k l)^2*w l) ≤ B^2*(w k)^2*(∑ l ∈ s, w l) := by rw [Finset.mul_sum] apply Finset.sum_le_sum intro l hl exact mul_le_mul_of_nonneg_right (hD k hk l hl) (hw l hl).le have hpoint := hcs.trans (mul_le_mul_of_nonneg_right hmass hE) calc _ ≤ (B^2*(w k)^2*(∑ l ∈ s, w l)*(∑ l ∈ s, (c l)^2/w l))/w k := div_le_div_of_nonneg_right hpoint (hw k hk).le _ = _ := by field_simp [(hw k hk).ne'] <;> ring _ = _ := by simp_rw [mul_assoc, ← Finset.mul_sum, ← Finset.sum_mul] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.weighted_derivative_matrix_action_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:167
theorem legendreDerivativeAction_factorial_bound Lemma legendreDerivativeAction_factorial_bound in the paper ↗

Every power of the Legendre differentiation action has the roadmap's factorial norm bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j :
ℕ
hj :
1 ≤ j
c :
ℕ → ℝ
(∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) c k)^2/(2*(k : ℝ)+1))
≤ (4^j*((m : ℝ)+1)^(2*j)/(Nat.factorial j : ℝ))^2 * (∑ k ∈ range (m+1), (c k)^2/(2*(k : ℝ)+1))
Proof (Lean source)
lemma legendreDerivativeAction_factorial_bound (m j : ℕ) (hj : 1 ≤ j) (c : ℕ → ℝ) : (∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) c k)^2/(2*(k : ℝ)+1)) ≤ (4^j*((m : ℝ)+1)^(2*j)/(Nat.factorial j : ℝ))^2 * (∑ k ∈ range (m+1), (c k)^2/(2*(k : ℝ)+1)) := by let B : ℝ := 2^j*((m : ℝ)+1)^(2*(j-1))/(Nat.factorial (j-1) : ℝ) have hB : 0 ≤ B := by dsimp [B]; positivity have hentry (k l : ℕ) (hl : l ∈ range (m+1)) : legendreDerivativePower m j k l ≤ B*(2*(k : ℝ)+1) := by have hlm : (l : ℝ) ≤ (m : ℝ)+1 := by exact_mod_cast le_of_lt (Finset.mem_range.mp hl) have hp : ((l : ℝ)^2)^(j-1) ≤ (((m : ℝ)+1)^2)^(j-1) := by gcongr calc _ ≤ 2^j*(2*(k : ℝ)+1)*((l : ℝ)^2)^(j-1)/(Nat.factorial (j-1) : ℝ) := legendreDerivativePower_entry_bound m j k l hj _ ≤ 2^j*(2*(k : ℝ)+1)*(((m : ℝ)+1)^2)^(j-1)/(Nat.factorial (j-1) : ℝ) := by apply div_le_div_of_nonneg_right _ (by positivity) exact mul_le_mul_of_nonneg_left hp (by positivity) _ = _ := by dsimp [B]; rw [← pow_mul]; ring have hsquare (k : ℕ) (hk : k ∈ range (m+1)) (l : ℕ) (hl : l ∈ range (m+1)) : (legendreDerivativePower m j k l)^2 ≤ B^2*(2*(k : ℝ)+1)^2 := by have h := mul_self_le_mul_self (legendreDerivativePower_nonneg m j k l) (hentry k l hl) simpa only [pow_two, mul_assoc, mul_left_comm, mul_comm] using h have hm := weighted_derivative_matrix_action_bound (range (m+1)) (legendreDerivativePower m j) c (fun k => 2*(k : ℝ)+1) B (by intro k hk; positivity) hsquare have hcoeff : (∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) c k)^2/(2*(k : ℝ)+1)) = ∑ k ∈ range (m+1), (∑ l ∈ range (m+1), legendreDerivativePower m j k l*c l)^2/(2*(k : ℝ)+1) := by apply Finset.sum_congr rfl intro k hk rw [legendreDerivativePower_action m j c k hk] rw [hcoeff] rw [shiftedLegendre_total_weight] at hm have hfactor : B*((m : ℝ)+1)^2 ≤ 4^j*((m : ℝ)+1)^(2*j)/(Nat.factorial j : ℝ) := by have he : 2*(j-1)+2 = 2*j := by omega have hf := mul_le_mul_of_nonneg_right (derivative_chain_factorial_gain j hj) (show 0 ≤ ((m : ℝ)+1)^(2*j) by positivity) calc _ = (2^j/(Nat.factorial (j-1) : ℝ))*((m : ℝ)+1)^(2*j) := by dsimp [B] rw [div_mul_eq_mul_div, mul_assoc, ← pow_add, he] ring _ ≤ _ := by simpa only [div_mul_eq_mul_div] using hf have hfactorSq : B^2*(((m : ℝ)+1)^2)^2 ≤ (4^j*((m : ℝ)+1)^(2*j)/(Nat.factorial j : ℝ))^2 := by have h := mul_self_le_mul_self (mul_nonneg hB (sq_nonneg _)) hfactor simpa only [pow_two, mul_assoc, mul_left_comm, mul_comm] using h exact hm.trans (mul_le_mul_of_nonneg_right hfactorSq (Finset.sum_nonneg (fun k hk => by positivity)))
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativeAction_factorial_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeBounds.lean:200
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DerivativeChains 9 declarations The increasing-chain argument for factorial_derivatives: fixed-size subset products admit a factorial bound, shifted-Legendre weights sum to the square of the basis dimension, and squared matrix entries bound coefficient

Nonnegative chain weights for the factorial derivative bound

The increasing-chain argument for factorial_derivatives: fixed-size subset products admit a factorial bound, shifted-Legendre weights sum to the square of the basis dimension, and squared matrix entries bound coefficient-vector norms. The identification of iterated polynomial differentiation with these chains remains in Kernel.lean.

theorem nonnegative_power_linear_terms_le Lemma nonnegative_power_linear_terms_le in the paper ↗

The constant and linear binomial terms are bounded by the full power. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
S a :
ℝ
hS :
0 ≤ S
ha :
0 ≤ a
n :
ℕ
S^(n+1) + (n+1 : ℝ)*a*S^n ≤ (S+a)^(n+1)
Proof (Lean source)
lemma nonnegative_power_linear_terms_le (S a : ℝ) (hS : 0 ≤ S) (ha : 0 ≤ a) (n : ℕ) : S^(n+1) + (n+1 : ℝ)*a*S^n ≤ (S+a)^(n+1) := by induction n with | zero => simp | succ n ih => have hm := mul_le_mul_of_nonneg_right ih (add_nonneg hS ha) have hp : 0 ≤ (n+1 : ℝ)*a^2*S^n := by positivity calc _ ≤ (S^(n+1) + (n+1 : ℝ)*a*S^n)*(S+a) := by simp only [Nat.cast_add, Nat.cast_one, pow_succ] at * nlinarith _ ≤ _ := by simpa only [pow_succ, Nat.add_assoc] using hm
CausalSmith.Stat.RdTruesideNoiseFrontier.nonnegative_power_linear_terms_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:22
theorem subset_product_sum_insert Lemma subset_product_sum_insert in the paper ↗

Splitting fixed-size subsets according to a newly inserted element gives an exact recurrence for their weighted products. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
Type*
s :
a :
α
ha :
a ∉ s
w :
α → ℝ
r :
ℕ
(∑ t ∈ (insert a s).powersetCard (r+1), ∏ i ∈ t, w i)
= (∑ t ∈ s.powersetCard (r+1), ∏ i ∈ t, w i)
+ w a * (∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i)
Proof (Lean source)
lemma subset_product_sum_insert {α : Type*} [DecidableEq α] (s : Finset α) (a : α) (ha : a ∉ s) (w : α → ℝ) (r : ℕ) : (∑ t ∈ (insert a s).powersetCard (r+1), ∏ i ∈ t, w i) = (∑ t ∈ s.powersetCard (r+1), ∏ i ∈ t, w i) + w a * (∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i) := by rw [Finset.powersetCard_succ_insert ha, Finset.sum_union] · rw [Finset.sum_image] · congr 1 rw [Finset.mul_sum] apply Finset.sum_congr rfl intro t ht exact Finset.prod_insert (fun hat => ha ((Finset.mem_powersetCard.mp ht).1 hat)) · intro t ht u hu h have ht' : a ∉ t := fun hat => ha ((Finset.mem_powersetCard.mp ht).1 hat) have hu' : a ∉ u := fun hau => ha ((Finset.mem_powersetCard.mp hu).1 hau) simpa [ht', hu'] using congrArg (erase · a) h · apply Finset.disjoint_left.mpr intro t ht hi obtain ⟨u, hu, rfl⟩ := Finset.mem_image.mp hi exact ha ((Finset.mem_powersetCard.mp ht).1 (Finset.mem_insert_self a u))
CausalSmith.Stat.RdTruesideNoiseFrontier.subset_product_sum_insert · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:36
theorem subset_product_sum_factorial_bound Lemma subset_product_sum_factorial_bound in the paper ↗

Each increasing chain contributes once to a fixed-size subset sum; its factorial multiple is bounded by the full nonnegative power expansion. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
Type*
s :
w :
α → ℝ
hw :
∀ i ∈ s, 0 ≤ w i
r :
ℕ
(Nat.factorial r : ℝ) * (∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i) ≤ (∑ i ∈ s, w i)^r
Proof (Lean source)
lemma subset_product_sum_factorial_bound {α : Type*} (s : Finset α) (w : α → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (r : ℕ) : (Nat.factorial r : ℝ) * (∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i) ≤ (∑ i ∈ s, w i)^r := by classical induction s using Finset.induction_on generalizing r with | empty => cases r with | zero => simp [Finset.powersetCard_zero] | succ r => rw [Finset.powersetCard_eq_empty.mpr (by simp)] simp | @insert a s ha ih => have hwa := hw a (Finset.mem_insert_self a s) have hws : ∀ i ∈ s, 0 ≤ w i := fun i hi => hw i (Finset.mem_insert_of_mem hi) have hS : 0 ≤ ∑ i ∈ s, w i := Finset.sum_nonneg hws cases r with | zero => simp [Finset.powersetCard_zero] | succ r => rw [subset_product_sum_insert s a ha, Finset.sum_insert ha] have h0 := ih hws (r+1) have h1 := mul_le_mul_of_nonneg_left (ih hws r) (show 0 ≤ (r+1 : ℝ)*w a by positivity) have hsum := add_le_add h0 h1 calc _ = (Nat.factorial (r+1) : ℝ) * (∑ t ∈ s.powersetCard (r+1), ∏ i ∈ t, w i) + (r+1 : ℝ)*w a*((Nat.factorial r : ℝ)*(∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i)) := by rw [Nat.factorial_succ] push_cast ring _ ≤ (∑ i ∈ s, w i)^(r+1) + (r+1 : ℝ)*w a*(∑ i ∈ s, w i)^r := hsum _ ≤ _ := by simpa [add_comm] using nonnegative_power_linear_terms_le _ _ hS hwa r
CausalSmith.Stat.RdTruesideNoiseFrontier.subset_product_sum_factorial_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:59
theorem filtered_subset_product_sum_le Lemma filtered_subset_product_sum_le in the paper ↗

Deleting restrictions on nonnegative chain weights bounds any retained collection of distinct-index products by the total weight power divided by its factorial. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
Type*
s :
w :
α → ℝ
hw :
∀ i ∈ s, 0 ≤ w i
r :
ℕ
keep :
Finset α → Prop
(∑ t ∈ (s.powersetCard r).filter keep, ∏ i ∈ t, w i)
≤ (∑ i ∈ s, w i)^r / (Nat.factorial r : ℝ)
Proof (Lean source)
lemma filtered_subset_product_sum_le {α : Type*} (s : Finset α) (w : α → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (r : ℕ) (keep : Finset α → Prop) [DecidablePred keep] : (∑ t ∈ (s.powersetCard r).filter keep, ∏ i ∈ t, w i) ≤ (∑ i ∈ s, w i)^r / (Nat.factorial r : ℝ) := by classical have hsub : (∑ t ∈ (s.powersetCard r).filter keep, ∏ i ∈ t, w i) ≤ ∑ t ∈ s.powersetCard r, ∏ i ∈ t, w i := by apply Finset.sum_le_sum_of_subset_of_nonneg (filter_subset _ _) intro t ht hnot exact Finset.prod_nonneg (fun i hi => hw i ((Finset.mem_powersetCard.mp ht).1 hi)) apply hsub.trans rw [le_div_iff₀ (by positivity)] simpa only [mul_comm] using subset_product_sum_factorial_bound s w hw r
CausalSmith.Stat.RdTruesideNoiseFrontier.filtered_subset_product_sum_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:92
theorem shiftedLegendre_total_weight Lemma shiftedLegendre_total_weight in the paper ↗

The total shifted-Legendre endpoint weight is the square of the basis dimension. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∑ i ∈ range (m+1), (2*(i : ℝ)+1)) = ((m : ℝ)+1)^2
Proof (Lean source)
lemma shiftedLegendre_total_weight (m : ℕ) : (∑ i ∈ range (m+1), (2*(i : ℝ)+1)) = ((m : ℝ)+1)^2 := by have hs (n : ℕ) : (∑ i ∈ range n, (2*(i : ℝ)+1)) = (n : ℝ)^2 := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih]; push_cast; ring simpa using hs (m+1)
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_total_weight · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:109
theorem shiftedLegendre_chain_weight_bound Lemma shiftedLegendre_chain_weight_bound in the paper ↗

The increasing-chain factor in the jth derivative matrix has the roadmap's factorial bound, even after arbitrary parity and endpoint restrictions. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j :
ℕ
keep :
Finset ℕ → Prop
(∑ t ∈ ((range (m+1)).powersetCard (j-1)).filter keep, ∏ i ∈ t, (2*(i : ℝ)+1))
≤ ((m : ℝ)+1)^(2*(j-1)) / (factorial (j-1) : ℝ)
Proof (Lean source)
lemma shiftedLegendre_chain_weight_bound (m j : ℕ) (keep : Finset ℕ → Prop) [DecidablePred keep] : (∑ t ∈ ((range (m+1)).powersetCard (j-1)).filter keep, ∏ i ∈ t, (2*(i : ℝ)+1)) ≤ ((m : ℝ)+1)^(2*(j-1)) / (factorial (j-1) : ℝ) := by have h := filtered_subset_product_sum_le (range (m+1)) (fun i => 2*(i : ℝ)+1) (by intro i hi; positivity) (j-1) keep rw [shiftedLegendre_total_weight, ← pow_mul] at h exact h
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_chain_weight_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:118
theorem derivative_chain_factorial_gain Lemma derivative_chain_factorial_gain in the paper ↗

The loss of one factorial index in the chain bound is absorbed by the extra factor two per derivative, as in the last inequality of the roadmap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
hj :
1 ≤ j
(2 : ℝ)^j / (Nat.factorial (j-1) : ℝ) ≤ (4 : ℝ)^j / (Nat.factorial j : ℝ)
Proof (Lean source)
lemma derivative_chain_factorial_gain (j : ℕ) (hj : 1 ≤ j) : (2 : ℝ)^j / (Nat.factorial (j-1) : ℝ) ≤ (4 : ℝ)^j / (Nat.factorial j : ℝ) := by have hnat (n : ℕ) : n ≤ 2^n := by induction n with | zero => simp | succ n ih => rw [pow_succ] have hp : 1 ≤ 2^n := Nat.one_le_pow n 2 (by omega) omega have hreal : (j : ℝ) ≤ (2 : ℝ)^j := by exact_mod_cast hnat j have hfact : (Nat.factorial j : ℝ) = (j : ℝ)*(Nat.factorial (j-1) : ℝ) := by have hf := Nat.factorial_succ (j-1) rw [Nat.sub_add_cancel hj] at hf exact_mod_cast hf have hpow : (4 : ℝ)^j = (2 : ℝ)^j * (2 : ℝ)^j := by rw [← mul_pow] norm_num rw [div_le_div_iff₀ (by positivity) (by positivity), hfact, hpow] have h := mul_le_mul_of_nonneg_left hreal (show 0 ≤ (2 : ℝ)^j * (Nat.factorial (j-1) : ℝ) by positivity) nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.derivative_chain_factorial_gain · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:130
theorem finite_matrix_square_action_bound Lemma finite_matrix_square_action_bound in the paper ↗

Bounding every squared matrix entry bounds its action by the squared Frobenius norm; this is the coefficient-vector estimate in the roadmap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
Type*
s :
D :
α → α → ℝ
c :
α → ℝ
(∑ k ∈ s, (∑ l ∈ s, D k l * c l)^2) ≤ (∑ k ∈ s, ∑ l ∈ s, (D k l)^2) * (∑ l ∈ s, (c l)^2)
Proof (Lean source)
lemma finite_matrix_square_action_bound {α : Type*} (s : Finset α) (D : α → α → ℝ) (c : α → ℝ) : (∑ k ∈ s, (∑ l ∈ s, D k l * c l)^2) ≤ (∑ k ∈ s, ∑ l ∈ s, (D k l)^2) * (∑ l ∈ s, (c l)^2) := by calc _ ≤ ∑ k ∈ s, (∑ l ∈ s, (D k l)^2) * (∑ l ∈ s, (c l)^2) := by apply Finset.sum_le_sum intro k hk exact Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul s (f := fun l => (D k l)^2) (g := fun l => (c l)^2) (by intro l hl; positivity) (by intro l hl; positivity) (by intro l hl; simp [mul_pow]) _ = _ := by rw [Finset.sum_mul]
CausalSmith.Stat.RdTruesideNoiseFrontier.finite_matrix_square_action_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:155
theorem weighted_matrix_square_action_bound Lemma weighted_matrix_square_action_bound in the paper ↗

The separable endpoint weights in the chain entry bound give the full basis-dimension factor after summing the squared matrix entries. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
Type*
s :
D :
α → α → ℝ
c w :
α → ℝ
A :
ℝ
hD :
∀ k ∈ s, ∀ l ∈ s, (D k l) ^ 2 ≤ A ^ 2 * w k * w l
(∑ k ∈ s, (∑ l ∈ s, D k l * c l)^2) ≤ A^2 * (∑ k ∈ s, w k)^2 * (∑ l ∈ s, (c l)^2)
Proof (Lean source)
lemma weighted_matrix_square_action_bound {α : Type*} (s : Finset α) (D : α → α → ℝ) (c w : α → ℝ) (A : ℝ) (hD : ∀ k ∈ s, ∀ l ∈ s, (D k l) ^ 2 ≤ A ^ 2 * w k * w l) : (∑ k ∈ s, (∑ l ∈ s, D k l * c l)^2) ≤ A^2 * (∑ k ∈ s, w k)^2 * (∑ l ∈ s, (c l)^2) := by have hmass : (∑ k ∈ s, ∑ l ∈ s, (D k l)^2) ≤ A^2 * (∑ k ∈ s, w k)^2 := by calc _ ≤ ∑ k ∈ s, ∑ l ∈ s, A^2*w k*w l := by apply Finset.sum_le_sum intro k hk exact Finset.sum_le_sum (fun l hl => hD k hk l hl) _ = _ := by simp_rw [← Finset.mul_sum]; rw [← Finset.sum_mul, ← Finset.mul_sum]; ring exact (finite_matrix_square_action_bound s D c).trans (mul_le_mul_of_nonneg_right hmass (Finset.sum_nonneg (fun l hl => sq_nonneg _)))
CausalSmith.Stat.RdTruesideNoiseFrontier.weighted_matrix_square_action_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeChains.lean:171
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DerivativeCoefficients 6 declarations The exact finite differentiation matrix acts on every degree-bounded polynomial expansion.

Coefficients of iterated shifted-Legendre differentiation

The exact finite differentiation matrix acts on every degree-bounded polynomial expansion. Iteration identifies all derivative coefficients before the chain bound and Parseval steps in the factorial derivative estimate.

Differentiation in the unnormalized shifted-Legendre basis, retaining parity. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
k l :
ℕ
legendreDerivativeEntry k l :
ℝ
if k < l ∧ Odd (l-k) then 2 * (2*(k : ℝ)+1) else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativeEntry · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:19

The finite coefficient action of ordinary differentiation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
c :
ℕ → ℝ
k :
ℕ
legendreDerivativeAction m c k :
ℝ
∑ l ∈ range (m+1), legendreDerivativeEntry k l * c l
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreDerivativeAction · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:23
theorem forwardLegendrePolynomial_derivative_matrix Lemma forwardLegendrePolynomial_derivative_matrix in the paper ↗

The derivative of each basis polynomial has exactly the matrix's column. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m l :
ℕ
hl :
l ≤ m
Proof (Lean source)
lemma forwardLegendrePolynomial_derivative_matrix (hleg : ClassicalLegendreFacts) (m l : ℕ) (hl : l ≤ m) : (forwardLegendrePolynomial l).derivative = ∑ k ∈ range (m+1), C (legendreDerivativeEntry k l) * forwardLegendrePolynomial k := by apply Polynomial.funext intro x rw [forwardLegendrePolynomial_derivative_eval, shiftedLegendre_derivative_expansion hleg] simp only [Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, forwardLegendrePolynomial_eval] rw [Finset.sum_filter, Finset.mul_sum] symm calc _ = ∑ k ∈ range l, legendreDerivativeEntry k l * shiftedLegendre k x := by symm apply Finset.sum_subset (Finset.range_mono (by omega)) intro k hk hn have hkl : ¬ k < l := by simpa using hn simp [legendreDerivativeEntry, hkl] _ = _ := by apply Finset.sum_congr rfl intro k hk simp only [legendreDerivativeEntry, Finset.mem_range.mp hk, true_and] split_ifs <;> ring
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial_derivative_matrix · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:27
theorem legendre_expansion_derivative_action Lemma legendre_expansion_derivative_action in the paper ↗

Differentiating a finite basis expansion applies the coefficient matrix once. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
c :
ℕ → ℝ
(∑ l ∈ range (m+1), C (c l) * forwardLegendrePolynomial l).derivative
Proof (Lean source)
lemma legendre_expansion_derivative_action (hleg : ClassicalLegendreFacts) (m : ℕ) (c : ℕ → ℝ) : (∑ l ∈ range (m+1), C (c l) * forwardLegendrePolynomial l).derivative = ∑ k ∈ range (m+1), C (legendreDerivativeAction m c k) * forwardLegendrePolynomial k := by simp only [Polynomial.derivative_sum, Polynomial.derivative_C_mul] have he : (∑ l ∈ range (m+1), C (c l) * (forwardLegendrePolynomial l).derivative) = ∑ l ∈ range (m+1), C (c l) * (∑ k ∈ range (m+1), C (legendreDerivativeEntry k l) * forwardLegendrePolynomial k) := by apply Finset.sum_congr rfl intro l hl rw [forwardLegendrePolynomial_derivative_matrix hleg m l (by have := Finset.mem_range.mp hl; omega)] rw [he] simp_rw [Finset.mul_sum] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro k hk simp only [legendreDerivativeAction, map_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro l hl rw [map_mul] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.legendre_expansion_derivative_action · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:54
theorem legendre_expansion_iterated_derivative Lemma legendre_expansion_iterated_derivative in the paper ↗

Iterating the matrix action gives every coefficient of the iterated derivative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m j :
ℕ
c :
ℕ → ℝ
polyDeriv j (∑ l ∈ range (m+1), C (c l) * forwardLegendrePolynomial l)
= ∑ k ∈ range (m+1), C (((legendreDerivativeAction m)^[j]) c k) * forwardLegendrePolynomial k
Proof (Lean source)
lemma legendre_expansion_iterated_derivative (hleg : ClassicalLegendreFacts) (m j : ℕ) (c : ℕ → ℝ) : polyDeriv j (∑ l ∈ range (m+1), C (c l) * forwardLegendrePolynomial l) = ∑ k ∈ range (m+1), C (((legendreDerivativeAction m)^[j]) c k) * forwardLegendrePolynomial k := by induction j with | zero => rfl | succ j ih => rw [polyDeriv, Function.iterate_succ_apply', ← polyDeriv, ih, legendre_expansion_derivative_action hleg] simp only [Function.iterate_succ_apply']
CausalSmith.Stat.RdTruesideNoiseFrontier.legendre_expansion_iterated_derivative · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:82
theorem polynomial_legendre_coefficient_identity Lemma polynomial_legendre_coefficient_identity in the paper ↗

The canonical orthogonal coefficients reconstruct the polynomial itself. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
hm :
p.natDegree ≤ m
p
= ∑ k ∈ range (m+1), C ((2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x)) * forwardLegendrePolynomial k
Proof (Lean source)
lemma polynomial_legendre_coefficient_identity (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m : ℕ) (hm : p.natDegree ≤ m) : p = ∑ k ∈ range (m+1), C ((2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x)) * forwardLegendrePolynomial k := by apply Polynomial.funext intro x simp only [Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, forwardLegendrePolynomial_eval] exact polynomial_shiftedLegendre_expansion hleg p (m+1) (lt_of_le_of_lt Polynomial.degree_le_natDegree (by exact_mod_cast Nat.lt_succ_of_le hm)) x
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_legendre_coefficient_identity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DerivativeCoefficients.lean:97
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DirectGaussianChannel 10 declarations Gaussian channel for the direct lower bound

Gaussian channel for the direct lower bound

def observedNoiseMechanism

Add independent Gaussian score noise while retaining the true-side arm and observed outcome. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
sigma :
ℝ
z :
Obs × ℝ
observedNoiseMechanism sigma z :
Obs
(z.1.1 + sigma * z.2, z.1.2)
CausalSmith.Stat.RdTruesideNoiseFrontier.observedNoiseMechanism · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:22
def observedNoiseKernel

The common Gaussian channel from the error-free observation to an observation at noise scale sigma.

Definition (Lean source)
sigma :
ℝ
observedNoiseKernel sigma :
Kernel Obs Obs
CausalSmith.Stat.RdTruesideNoiseFrontier.observedNoiseKernel · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:28
instance observedNoiseKernel_markov

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
CausalSmith.Stat.RdTruesideNoiseFrontier.observedNoiseKernel_markov · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:35
theorem observedNoiseKernel_comp_eq_prod_map

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
mu :
sigma :
ℝ
observedNoiseKernel sigma ∘ₘ mu
= (mu.prod (gaussianReal 0 1)).map (observedNoiseMechanism sigma)
Proof (Lean source)
lemma observedNoiseKernel_comp_eq_prod_map (mu : Measure Obs) [SFinite mu] (sigma : ℝ) : observedNoiseKernel sigma ∘ₘ mu = (mu.prod (gaussianReal 0 1)).map (observedNoiseMechanism sigma) := by have hm : Measurable (observedNoiseMechanism sigma) := by unfold observedNoiseMechanism fun_prop rw [← Measure.snd_compProd] unfold observedNoiseKernel rw [← map_graph_prod_eq_compProd mu (gaussianReal 0 1) hm] rw [Measure.snd, Measure.map_map measurable_snd (measurable_fst.prodMk hm)] rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.observedNoiseKernel_comp_eq_prod_map · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:43
theorem observedNoiseKernel_comp_Pobs_zero

Gaussian error independence makes every noisy observed law a common Markov garbling of its error-free observed law. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
sigma :
ℝ
hgauss :
observedNoiseKernel sigma ∘ₘ Pobs L 0 = Pobs L sigma
Proof (Lean source)
lemma observedNoiseKernel_comp_Pobs_zero (L : LatentLaw) (sigma : ℝ) (hgauss : GaussianError L) (hind : ErrorIndependence L) : observedNoiseKernel sigma ∘ₘ Pobs L 0 = Pobs L sigma := by letI := L.prob letI : IsProbabilityMeasure (Pobs L 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable let schedule : Latent → ℝ × Bool × Bool := fun omega => (score omega, omega.2.1, omega.2.2.1) let cleanObs : ℝ × Bool × Bool → Obs := fun z => (z.1, decide (0 ≤ z.1), if decide (0 ≤ z.1) then z.2.2 else z.2.1) have hclean : cleanObs ∘ schedule = obs 0 := by funext omega by_cases hs : 0 ≤ omega.1 <;> simp [cleanObs, schedule, obs, proxy, side, outcome, score, hs] have hcleanMeas : Measurable cleanObs := by dsimp [cleanObs] have hs : MeasurableSet {z : ℝ × Bool × Bool | 0 ≤ z.1} := measurableSet_le measurable_const measurable_fst have hd : Measurable (fun z : ℝ × Bool × Bool => decide (0 ≤ z.1)) := by change Measurable (fun z : ℝ × Bool × Bool => if 0 ≤ z.1 then true else false) exact measurable_const.ite hs measurable_const have hs' : MeasurableSet {z : ℝ × Bool × Bool | decide (0 ≤ z.1) = true} := by simpa using hs exact measurable_fst.prodMk (hd.prodMk (measurable_snd.snd.ite hs' measurable_snd.fst)) have herrorMeas : Measurable errorCoord := by unfold errorCoord fun_prop have hindClean : IndepFun (obs 0) errorCoord L.P := by have h := hind.symm.comp hcleanMeas measurable_id rw [hclean, Function.id_comp] at h exact h have hjoint : L.P.map (fun omega => (obs 0 omega, errorCoord omega)) = (Pobs L 0).prod (gaussianReal 0 1) := by have h := (indepFun_iff_map_prod_eq_prod_map_map (obs_measurable 0).aemeasurable herrorMeas.aemeasurable).mp hindClean unfold GaussianError at hgauss rw [hgauss] at h simpa [Pobs] using h have hmechanism : Measurable (observedNoiseMechanism sigma) := by unfold observedNoiseMechanism fun_prop have hpair : Measurable (fun omega : Latent => (obs 0 omega, errorCoord omega)) := (obs_measurable 0).prodMk herrorMeas have hobs : observedNoiseMechanism sigma ∘ (fun omega : Latent => (obs 0 omega, errorCoord omega)) = obs sigma := by funext omega simp [observedNoiseMechanism, obs, proxy, errorCoord] rw [observedNoiseKernel_comp_eq_prod_map] rw [← hjoint, Measure.map_map hmechanism hpair] exact congrArg (fun f => L.P.map f) hobs
CausalSmith.Stat.RdTruesideNoiseFrontier.observedNoiseKernel_comp_Pobs_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:58
def sampleObservedNoiseMechanism

Coordinatewise Gaussian randomization of an error-free sample. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
sigma :
ℝ
z :
(Fin n → Obs) × (Fin n → ℝ)
sampleObservedNoiseMechanism n sigma z :
Fin n → Obs
fun i => observedNoiseMechanism sigma (z.1 i, z.2 i)
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleObservedNoiseMechanism · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:113
def sampleObservedNoiseKernel

Given the sample size and noise scale, this definition specifies the coordinatewise Gaussian observation kernel.

Definition (Lean source)
n :
ℕ
sigma :
ℝ
sampleObservedNoiseKernel n sigma :
Kernel (Fin n → Obs) (Fin n → Obs)
mechanismKernel (Measure.pi (fun _ : Fin n => gaussianReal 0 1)) (sampleObservedNoiseMechanism n sigma)
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleObservedNoiseKernel · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:119
instance sampleObservedNoiseKernel_markov

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleObservedNoiseKernel_markov · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:127
theorem sampleObservedNoiseKernel_comp_sampleLaw

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
sigma :
ℝ
n :
ℕ
hgauss :
sampleObservedNoiseKernel n sigma ∘ₘ sampleLaw L 0 n = sampleLaw L sigma n
Proof (Lean source)
lemma sampleObservedNoiseKernel_comp_sampleLaw (L : LatentLaw) (sigma : ℝ) (n : ℕ) (hgauss : GaussianError L) (hind : ErrorIndependence L) : sampleObservedNoiseKernel n sigma ∘ₘ sampleLaw L 0 n = sampleLaw L sigma n := by letI := L.prob let mu := Pobs L 0 let nu := gaussianReal 0 1 letI : IsProbabilityMeasure mu := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable let e := MeasurableEquiv.arrowProdEquivProdArrow Obs ℝ (Fin n) have hmech : Measurable (sampleObservedNoiseMechanism n sigma) := by unfold sampleObservedNoiseMechanism observedNoiseMechanism fun_prop have hpair : ((Measure.pi (fun _ : Fin n => mu)).prod (Measure.pi (fun _ : Fin n => nu))).map e.symm = Measure.pi (fun _ : Fin n => mu.prod nu) := by exact (measurePreserving_arrowProdEquivProdArrow Obs ℝ (Fin n) (fun _ => mu) (fun _ => nu)).symm.map_eq rw [show sampleObservedNoiseKernel n sigma ∘ₘ sampleLaw L 0 n = ((sampleLaw L 0 n).prod (Measure.pi (fun _ : Fin n => nu))).map (sampleObservedNoiseMechanism n sigma) by have hsfinite : SFinite (sampleLaw L 0 n) := by unfold sampleLaw infer_instance letI : IsSFiniteKernel (sampleObservedNoiseKernel n sigma) := inferInstance rw [← Measure.snd_compProd] unfold sampleObservedNoiseKernel rw [← map_graph_prod_eq_compProd (sampleLaw L 0 n) (Measure.pi (fun _ : Fin n => nu)) hmech] rw [Measure.snd, Measure.map_map measurable_snd (measurable_fst.prodMk hmech)] rfl] change ((Measure.pi (fun _ : Fin n => mu)).prod (Measure.pi (fun _ : Fin n => nu))).map (sampleObservedNoiseMechanism n sigma) = sampleLaw L sigma n calc _ = (((Measure.pi (fun _ : Fin n => mu)).prod (Measure.pi (fun _ : Fin n => nu))).map e.symm).map (fun z : Fin n → Obs × ℝ => fun i => observedNoiseMechanism sigma (z i)) := by rw [Measure.map_map (by unfold observedNoiseMechanism fun_prop) e.symm.measurable] rfl _ = (Measure.pi (fun _ : Fin n => mu.prod nu)).map (fun z : Fin n → Obs × ℝ => fun i => observedNoiseMechanism sigma (z i)) := by rw [hpair] _ = Measure.pi (fun _ : Fin n => (mu.prod nu).map (observedNoiseMechanism sigma)) := by exact Measure.pi_map_pi (fun _ => (by unfold observedNoiseMechanism fun_prop : AEMeasurable (observedNoiseMechanism sigma) (mu.prod nu))) _ = sampleLaw L sigma n := by unfold sampleLaw congr 1 funext i rw [← observedNoiseKernel_comp_eq_prod_map mu sigma, observedNoiseKernel_comp_Pobs_zero L sigma hgauss hind]
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleObservedNoiseKernel_comp_sampleLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:135
theorem sampleLaw_tv_le_zero_of_model

Adding the same independent Gaussian noise coordinatewise cannot increase sample total variation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta sigma :
ℝ
n :
ℕ
P Q :
hP :
Model beta sigma P
hQ :
Model beta sigma Q
tvDist (sampleLaw P sigma n) (sampleLaw Q sigma n)
≤ tvDist (sampleLaw P 0 n) (sampleLaw Q 0 n)
Proof (Lean source)
lemma sampleLaw_tv_le_zero_of_model (beta sigma : ℝ) (n : ℕ) (P Q : LatentLaw) (hP : Model beta sigma P) (hQ : Model beta sigma Q) : tvDist (sampleLaw P sigma n) (sampleLaw Q sigma n) ≤ tvDist (sampleLaw P 0 n) (sampleLaw Q 0 n) := by letI := P.prob letI := Q.prob letI : IsProbabilityMeasure (Pobs P 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable letI : IsProbabilityMeasure (Pobs Q 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable letI : IsProbabilityMeasure (sampleLaw P 0 n) := by unfold sampleLaw infer_instance letI : IsProbabilityMeasure (sampleLaw Q 0 n) := by unfold sampleLaw infer_instance rw [← sampleObservedNoiseKernel_comp_sampleLaw P sigma n hP.gaussian hP.independent, ← sampleObservedNoiseKernel_comp_sampleLaw Q sigma n hQ.gaussian hQ.independent] exact tvDist_bind_le (sampleLaw P 0 n) (sampleLaw Q 0 n) (sampleObservedNoiseKernel n sigma)
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleLaw_tv_le_zero_of_model · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectGaussianChannel.lean:195
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DirectTestingAssembly 3 declarations IID testing and two-point direct lower-bound assembly

IID testing and two-point direct lower-bound assembly

theorem directResolution_balance

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta :
ℝ
n :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
conclusion 1
(n : ℝ) * (directResolution beta n)^(2*beta+1) = 1
conclusion 2
(directResolution beta n)^beta = (n : ℝ)^(-beta/(2*beta+1))
Proof (Lean source)
lemma directResolution_balance (beta : ℝ) (n : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) : (n : ℝ) * (directResolution beta n)^(2*beta+1) = 1 ∧ (directResolution beta n)^beta = (n : ℝ)^(-beta/(2*beta+1)) := by have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hden : 2 * beta + 1 ≠ 0 := by linarith [hbeta.1] unfold directResolution constructor · rw [← Real.rpow_mul hnpos.le] have he : (-1 / (2 * beta + 1)) * (2 * beta + 1) = -1 := by field_simp rw [he, Real.rpow_neg_one] field_simp · rw [← Real.rpow_mul hnpos.le] congr 1 field_simp
CausalSmith.Stat.RdTruesideNoiseFrontier.directResolution_balance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectTestingAssembly.lean:23
theorem direct_two_point_transfer

The generic two-point calculation specialized to the legal direct bump alternatives. Its hypothesis is exactly the observed-product testing bound; the independent procedure seed is appended by experiment_tv_le. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h σ :
ℝ
n :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
htv :
tvDist (sampleLaw (directAltLaw β h true hβ hh) σ n) (sampleLaw (directAltLaw β h false hβ hh) σ n)
≤ (1/5 : ℝ)
conclusion 1
(4/5 : ℝ) * kappa * h^β ≤ risk β n σ
conclusion 2
(6/5 : ℝ) * kappa * h^β ≤ lengthRisk β n σ
Proof (Lean source)
lemma direct_two_point_transfer (β h σ : ℝ) (n : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (htv : tvDist (sampleLaw (directAltLaw β h true hβ hh) σ n) (sampleLaw (directAltLaw β h false hβ hh) σ n) ≤ (1/5 : ℝ)) : (4/5 : ℝ) * kappa * h^β ≤ risk β n σ ∧ (6/5 : ℝ) * kappa * h^β ≤ lengthRisk β n σ := by let P := directAltLaw β h true hβ hh let Q := directAltLaw β h false hβ hh have hP : Model β σ P := directAltLaw_model β h σ true hβ hh have hQ : Model β σ Q := directAltLaw_model β h σ false hβ hh have hsep : |theta P - theta Q| = 2 * kappa * h^β := directAltLaw_separation β h hβ hh letI := experiment_probability P σ n letI := experiment_probability Q σ n have ht : tvDist (experiment P σ n) (experiment Q σ n) ≤ (1/5 : ℝ) := (experiment_tv_le P Q σ n).trans htv have hk : 0 ≤ kappa * h^β := mul_nonneg (by norm_num [kappa]) (Real.rpow_nonneg hh.1.le _) constructor · apply (ENNReal.ofReal_le_iff_le_toReal (risk_value_ne_top β σ n)).mp apply le_minimaxValueENNReal_of_two_point (⟨P,hP⟩ : {P // Model β σ P}) (⟨Q,hQ⟩ : {P // Model β σ P}) intro T apply twoPoint_max_of_sum _ _ _ (by nlinarith [hk]) have hs := twoPoint_absRisk_sum (experiment P σ n) (experiment Q σ n) T.val T.property (theta P) (theta Q) change ofReal (2 * ((4/5 : ℝ) * kappa * h^β)) ≤ _ apply le_trans _ hs apply ENNReal.ofReal_le_ofReal rw [hsep] nlinarith · apply (ENNReal.ofReal_le_iff_le_toReal (length_value_ne_top β σ n)).mp apply le_minimaxValueENNReal intro I have hs := twoPoint_interval_lower (experiment P σ n) (experiment Q σ n) I.val.lo I.val.hi I.val.lo_meas I.val.hi_meas (theta P) (theta Q) (I.property P hP) (I.property Q hQ) ht rw [hsep] at hs have he : (3/5 : ℝ) * (2 * kappa * h^β) = (6/5 : ℝ) * kappa * h^β := by ring rw [he] at hs exact hs.trans (le_worstCaseRiskENNReal (risk := fun (I : {I // I ∈ honestIntervals β n σ}) (L : {L // Model β σ L}) => expectedLength L.val σ n I.val) I ⟨Q,hQ⟩)
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_two_point_transfer · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectTestingAssembly.lean:41
theorem direct_uniform_lower

The legal direct witnesses give the ordinary boundary-regression lower bound uniformly over every public noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta :
ℝ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
c :
(4 / 5 : ℝ) * kappa
0 < c
n :
ℕ
2 ≤ n
sigma ∈ Icc (0 : ℝ) 1 :
c * (n : ℝ)^(-beta/(2*beta+1)) ≤ risk beta n sigma
c * (n : ℝ)^(-beta/(2*beta+1)) ≤ lengthRisk beta n sigma
Proof (Lean source)
lemma direct_uniform_lower (beta : ℝ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) : let c := (4 / 5 : ℝ) * kappa 0 < c ∧ ∀ n : ℕ, 2 ≤ n → ∀ sigma ∈ Icc (0 : ℝ) 1, c * (n : ℝ)^(-beta/(2*beta+1)) ≤ risk beta n sigma ∧ c * (n : ℝ)^(-beta/(2*beta+1)) ≤ lengthRisk beta n sigma := by dsimp only refine ⟨by norm_num [kappa], ?_⟩ intro n hn sigma hsigma let h := directResolution beta n have hh : h ∈ Ioc (0 : ℝ) 1 := by have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hnone : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hcoef : 0 < 2 * beta + 1 := by linarith [hbeta.1] have hexp : -1 / (2 * beta + 1) ≤ 0 := div_nonpos_of_nonpos_of_nonneg (by norm_num) hcoef.le exact ⟨Real.rpow_pos_of_pos hnpos _, Real.rpow_le_one_of_one_le_of_nonpos hnone hexp⟩ let P := directAltLaw beta h true hbeta hh let Q := directAltLaw beta h false hbeta hh letI := P.prob letI := Q.prob letI : IsProbabilityMeasure (Pobs P 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable letI : IsProbabilityMeasure (Pobs Q 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable have hac : Pobs P 0 ≪ Pobs Q 0 := directAltLaw_observed_ac_zero beta h hbeta hh have hint : Integrable (fun o => (((Pobs P 0).rnDeriv (Pobs Q 0) o).toReal - 1)^2) (Pobs Q 0) := directAltLaw_observed_likelihood_square_integrable_zero beta h hbeta hh have hbalance := directResolution_balance beta n hbeta hn change (n : ℝ) * h^(2*beta+1) = 1 ∧ h^beta = (n : ℝ)^(-beta/(2*beta+1)) at hbalance have hchi := directAltLaw_observed_chiSqDiv_zero_le beta h hbeta hh have hbudget : (n : ℝ) * chiSqDiv (Pobs P 0) (Pobs Q 0) ≤ 1 / 100 := by calc _ ≤ (n : ℝ) * ((16 / 3 : ℝ) * kappa^2 * h^(2*beta+1)) := mul_le_mul_of_nonneg_left hchi (Nat.cast_nonneg n) _ = (16 / 3 : ℝ) * kappa^2 := by calc _ = ((16 / 3 : ℝ) * kappa^2) * ((n : ℝ) * h^(2*beta+1)) := by ring _ = _ := by rw [hbalance.1, mul_one] _ ≤ 1 / 100 := by norm_num [kappa] have htv0 : tvDist (sampleLaw P 0 n) (sampleLaw Q 0 n) ≤ (1 / 5 : ℝ) := by exact iid_tv_le_one_fifth_of_chiSqDiv (Pobs P 0) (Pobs Q 0) hac hint n hbudget have hP : Model beta sigma P := directAltLaw_model beta h sigma true hbeta hh have hQ : Model beta sigma Q := directAltLaw_model beta h sigma false hbeta hh have htv : tvDist (sampleLaw P sigma n) (sampleLaw Q sigma n) ≤ (1 / 5 : ℝ) := (sampleLaw_tv_le_zero_of_model beta sigma n P Q hP hQ).trans htv0 have htransfer := direct_two_point_transfer beta h sigma n hbeta hh hn hsigma htv rw [hbalance.2] at htransfer exact ⟨htransfer.1, htransfer.2.trans' (by have hrpow : 0 ≤ (n : ℝ)^(-beta/(2*beta+1)) := Real.rpow_nonneg (by positivity) _ have hk : 0 ≤ kappa := by norm_num [kappa] nlinarith)⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_uniform_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectTestingAssembly.lean:90
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DirectWitness 12 declarations The clipped linear bump has the global modulus required by the direct-reduction roadmap.

Direct bump witness legality

The clipped linear bump has the global modulus required by the direct-reduction roadmap. Its Bernoulli perturbations belong to the same latent model class at every noise scale, and their cutoff targets have the stated separation.

theorem directBump_lipschitz_bound Lemma directBump_lipschitz_bound in the paper ↗

Both clipping operations contract distance, giving the global direct-bump Lipschitz bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x t :
ℝ
|directBump h x - directBump h t| ≤ |x-t| / h
Proof (Lean source)
lemma directBump_lipschitz_bound (h : ℝ) (hh : 0 < h) (x t : ℝ) : |directBump h x - directBump h t| ≤ |x-t| / h := by rw [directBump_eq_clipped h hh x, directBump_eq_clipped h hh t] calc _ ≤ |(1 - max x 0 / h) - (1 - max t 0 / h)| := abs_max_sub_max_le_abs _ _ 0 _ = |max x 0 - max t 0| / h := by rw [show (1 - max x 0 / h) - (1 - max t 0 / h) = -( (max x 0 - max t 0) / h) by ring, abs_neg, abs_div, abs_of_pos hh] _ ≤ |x-t| / h := div_le_div_of_nonneg_right (abs_max_sub_max_le_abs x t 0) hh.le
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_lipschitz_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:20
theorem directBump_oscillation_le_one Lemma directBump_oscillation_le_one in the paper ↗

The full bump has oscillation at most one, including on the negative half-line. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x t :
ℝ
|directBump h x - directBump h t| ≤ 1
Proof (Lean source)
lemma directBump_oscillation_le_one (h : ℝ) (hh : 0 < h) (x t : ℝ) : |directBump h x - directBump h t| ≤ 1 := by have hx := directBump_mem h hh x have ht := directBump_mem h hh t exact abs_le.mpr ⟨by linarith [hx.1, ht.2], by linarith [hx.2, ht.1]⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_oscillation_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:32
theorem directBump_holder_pointwise Lemma directBump_holder_pointwise in the paper ↗

The unit oscillation and Lipschitz bound interpolate to the roadmap's fractional modulus. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
0 < h
x t :
ℝ
|directBump h x - directBump h t| ≤ h^(-β) * |x-t|^β
Proof (Lean source)
lemma directBump_holder_pointwise (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : 0 < h) (x t : ℝ) : |directBump h x - directBump h t| ≤ h^(-β) * |x-t|^β := by by_cases he : x = t · subst t simp only [sub_self, abs_zero] positivity have hd : 0 < |x-t| := abs_pos.mpr (sub_ne_zero.mpr he) have hz : 0 < |x-t| / h := div_pos hd hh have hid : (|x-t| / h)^β = h^(-β) * |x-t|^β := by rw [Real.div_rpow (abs_nonneg _) hh.le, Real.rpow_neg hh.le] ring rw [← hid] by_cases hs : |x-t| / h ≤ 1 · exact (directBump_lipschitz_bound h hh x t).trans (by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_ge hz hs hβ.2) · exact (directBump_oscillation_le_one h hh x t).trans (Real.one_le_rpow (le_of_not_ge hs) hβ.1.le)
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_holder_pointwise · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:39
theorem directProbability_mean_bounds Lemma directProbability_mean_bounds in the paper ↗

The small direct perturbations stay inside the benchmark's mean interval everywhere. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
x :
ℝ
directProbability β h s x ∈ Icc (1/4 : ℝ) (3/4)
Proof (Lean source)
lemma directProbability_mean_bounds (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (x : ℝ) : directProbability β h s x ∈ Icc (1/4 : ℝ) (3/4) := by have hv := directBump_mem h hh.1 x have hp0 := Real.rpow_nonneg hh.1.le β have hp1 := Real.rpow_le_one hh.1.le hh.2 hβ.1.le have hprod0 := mul_nonneg hp0 hv.1 have hprod1 : h^β * directBump h x ≤ 1 := by simpa using mul_le_mul hp1 hv.2 hv.1 (by norm_num : (0 : ℝ) ≤ 1) cases s <;> simp only [directProbability, witnessSign, Bool.false_eq_true, if_false, if_true, kappa] all_goals constructor <;> nlinarith [hprod0, hprod1]
CausalSmith.Stat.RdTruesideNoiseFrontier.directProbability_mean_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:60
theorem directProbability_holder Lemma directProbability_holder in the paper ↗

Scaling the bump cancels its Hölder resolution factor, giving a modulus at most kappa. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
0 < h
x t :
ℝ
|directProbability β h s x - directProbability β h s t| ≤ kappa * |x-t|^β
Proof (Lean source)
lemma directProbability_holder (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : 0 < h) (x t : ℝ) : |directProbability β h s x - directProbability β h s t| ≤ kappa * |x-t|^β := by have hp0 := Real.rpow_nonneg hh.le β have hcancel : h^β * h^(-β) = 1 := by rw [← Real.rpow_add hh] simp have hv := directBump_holder_pointwise β h hβ hh x t have hsign : |witnessSign s| = 1 := by cases s <;> norm_num [witnessSign] rw [show directProbability β h s x - directProbability β h s t = witnessSign s * kappa * h^β * (directBump h x - directBump h t) by unfold directProbability; ring, abs_mul, abs_mul, abs_mul, hsign, abs_of_nonneg hp0, abs_of_nonneg (by norm_num [kappa] : 0 ≤ kappa), one_mul] calc _ ≤ kappa * h^β * (h^(-β) * |x-t|^β) := mul_le_mul_of_nonneg_left hv (by unfold kappa; positivity) _ = kappa * (h^β * h^(-β)) * |x-t|^β := by ring _ = _ := by rw [hcancel, mul_one]
CausalSmith.Stat.RdTruesideNoiseFrontier.directProbability_holder · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:73

Each direct latent witness satisfies every model atom at every noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h σ :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Model β σ (directAltLaw β h s hβ hh)
Proof (Lean source)
lemma directAltLaw_model (β h σ : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Model β σ (directAltLaw β h s hβ hh) := by have hp := directProbability_properties β h s hβ hh constructor · exact witnessMeasure_error _ hp.1 hp.2.2 · exact witnessMeasure_error_independent _ hp.1 hp.2.2 · intro x hx change 1/4 ≤ uniformDensity x ∧ uniformDensity x ≤ 3/4 norm_num [uniformDensity, hx] · intro d x hx change witnessMu (directProbability β h s) d x ∈ Icc (1/4 : ℝ) (3/4) cases d · norm_num [witnessMu] · exact directProbability_mean_bounds β h s hβ hh x · intro d x hx t ht change |witnessMu (directProbability β h s) d x - witnessMu (directProbability β h s) d t| ≤ _ cases d · simp only [witnessMu, Bool.false_eq_true, if_false, sub_self, abs_zero] positivity · exact (directProbability_holder β h s hβ hh.1 x t).trans (mul_le_mul_of_nonneg_right (by norm_num [kappa] : kappa ≤ 2) (Real.rpow_nonneg (abs_nonneg _) _))
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_model · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:93

The direct witness's causal target is its signed cutoff perturbation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
theta (directAltLaw β h s hβ hh) = witnessSign s * kappa * h^β
Proof (Lean source)
lemma directAltLaw_theta (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : theta (directAltLaw β h s hβ hh) = witnessSign s * kappa * h^β := by simp [theta, directAltLaw, bernoulliWitness, witnessMu, directProbability, directBump]
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_theta · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:119
theorem directAltLaw_separation Lemma directAltLaw_separation in the paper ↗

The direct alternatives have the target separation used by the two-point argument. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
|theta (directAltLaw β h true hβ hh) - theta (directAltLaw β h false hβ hh)|
= 2 * kappa * h^β
Proof (Lean source)
lemma directAltLaw_separation (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : |theta (directAltLaw β h true hβ hh) - theta (directAltLaw β h false hβ hh)| = 2 * kappa * h^β := by rw [directAltLaw_theta, directAltLaw_theta] have hp0 := Real.rpow_nonneg hh.1.le β norm_num only [witnessSign, if_true, Bool.false_eq_true, if_false] rw [show 1 * kappa * h^β - -1 * kappa * h^β = 2 * kappa * h^β by ring, abs_of_nonneg (by unfold kappa; positivity)]
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_separation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:125
theorem directBump_eq_linear_on Lemma directBump_eq_linear_on in the paper ↗

On its positive support the direct bump is exactly the declining linear segment. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) h
directBump h x = 1-x/h
Proof (Lean source)
lemma directBump_eq_linear_on (h : ℝ) (hh : 0 < h) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) h) : directBump h x = 1-x/h := by rw [directBump, if_neg (not_lt.mpr hx.1), max_eq_left] have hd : x/h ≤ 1 := (div_le_one hh).mpr hx.2 linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_eq_linear_on · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:136
theorem directBump_eq_zero_of_width_le Lemma directBump_eq_zero_of_width_le in the paper ↗

The direct bump vanishes to the right of its positive support. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x :
ℝ
hx :
h ≤ x
directBump h x = 0
Proof (Lean source)
lemma directBump_eq_zero_of_width_le (h : ℝ) (hh : 0 < h) {x : ℝ} (hx : h ≤ x) : directBump h x = 0 := by rw [directBump, if_neg (not_lt.mpr (hh.le.trans hx)), max_eq_right] have hd : 1 ≤ x/h := (le_div_iff₀ hh).mpr (by simpa using hx) linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_eq_zero_of_width_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:143
theorem directBump_sq_integral_support Lemma directBump_sq_integral_support in the paper ↗

The direct bump has squared mass h/3 on its support, as used in DR.1. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
(∫ x in (0 : ℝ)..h, (directBump h x)^2) = h/3
Proof (Lean source)
lemma directBump_sq_integral_support (h : ℝ) (hh : 0 < h) : (∫ x in (0 : ℝ)..h, (directBump h x)^2) = h/3 := by have he : (∫ x in (0 : ℝ)..h, (directBump h x)^2) = ∫ x in (0 : ℝ)..h, (1-x/h)^2 := by apply intervalIntegral.integral_congr intro x hx change (directBump h x)^2 = (1-x/h)^2 rw [directBump_eq_linear_on h hh (by simpa only [uIcc_of_le hh.le] using hx)] rw [he] have hc := intervalIntegral.integral_comp_sub_div (fun x : ℝ => x^2) (a := 0) (b := h) (ne_of_gt hh) 1 norm_num [integral_pow, hh.ne', smul_eq_mul] at hc ⊢ simpa only [div_eq_mul_inv, one_mul] using hc
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_sq_integral_support · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:150
theorem directBump_sq_integral_arm Lemma directBump_sq_integral_arm in the paper ↗

Integrating over the whole treated arm gives the same squared mass, with no tail truncation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
h ∈ Ioc (0 : ℝ) 1
(∫ x in (0 : ℝ)..1, (directBump h x)^2) = h/3
Proof (Lean source)
lemma directBump_sq_integral_arm (h : ℝ) (hh : h ∈ Ioc (0 : ℝ) 1) : (∫ x in (0 : ℝ)..1, (directBump h x)^2) = h/3 := by have hi : ∀ a b : ℝ, IntervalIntegrable (fun x => (directBump h x)^2) volume a b := by intro a b exact ((directBump_continuous h hh.1).pow 2).intervalIntegrable a b rw [← intervalIntegral.integral_add_adjacent_intervals (hi 0 h) (hi h 1), directBump_sq_integral_support h hh.1] have hz : (∫ x in h..(1 : ℝ), (directBump h x)^2) = 0 := by calc _ = ∫ x in h..(1 : ℝ), (0 : ℝ) := by apply intervalIntegral.integral_congr intro x hx have hx' : h ≤ x := (uIcc_of_le hh.2 ▸ hx).1 change (directBump h x)^2 = 0 rw [directBump_eq_zero_of_width_le h hh.1 hx', zero_pow (by norm_num : 2 ≠ 0)] _ = 0 := by simp rw [hz, add_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_sq_integral_arm · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectWitness.lean:166
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DirectZeroInformation 23 declarations Noiseless direct-witness information bound

Noiseless direct-witness information bound

theorem direct_observed_treated_cell_zero

At zero noise, a treated observed cell is exactly its latent score cell. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s y :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma direct_observed_treated_cell_zero (β h : ℝ) (s y : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : observedCellMeasure (directAltLaw β h s hβ hh) 0 true y = treatedLatentCell (directProbability β h s) y := by have hp := directProbability_properties β h s hβ hh letI := uniformScore_probability let μ := uniformScore.restrict (Ici (0 : ℝ)) haveI : IsFiniteMeasure μ := by dsimp [μ]; infer_instance have hsupp : ∀ᵐ x ∂μ, x ∈ Icc (-1 : ℝ) 1 := Measure.absolutelyContinuous_restrict.ae_le uniformScore_support have hden : (fun x : ℝ => ofReal (if y then directProbability β h s x else 1 - directProbability β h s x)) ≤ᵐ[μ] (fun _ => 1) := by filter_upwards [hsupp] with x hx have hb := hp.2.2 x hx cases y <;> simp only [Bool.false_eq_true, if_false, if_true] <;> rw [ENNReal.ofReal_le_one] <;> linarith haveI : IsFiniteMeasure (treatedLatentCell (directProbability β h s) y) := by unfold treatedLatentCell exact isFiniteMeasure_of_le μ (by simpa [μ] using withDensity_mono hden) unfold directAltLaw rw [witness_observed_treated_cell_eq_conv (directProbability β h s) hp.1 hp.2.1 hp.2.2] have hmap : (gaussianReal 0 1).map (fun z => (0 : ℝ) * z) = Measure.dirac 0 := by rw [show (fun z : ℝ => (0 : ℝ) * z) = fun _ => (0 : ℝ) by funext z; simp, Measure.map_const] simp rw [hmap, MeasureTheory.Measure.conv_dirac_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_observed_treated_cell_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:21
theorem direct_observed_control_cell_zero

At zero noise, either control observed cell is the common latent score cell. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s y :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma direct_observed_control_cell_zero (β h : ℝ) (s y : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : observedCellMeasure (directAltLaw β h s hβ hh) 0 false y = controlLatentCell := by have hp := directProbability_properties β h s hβ hh letI := uniformScore_probability haveI : IsFiniteMeasure controlLatentCell := by unfold controlLatentCell let μ := uniformScore.restrict (Iio (0 : ℝ)) haveI : IsFiniteMeasure μ := by dsimp [μ]; infer_instance exact isFiniteMeasure_of_le μ (by have hle := withDensity_mono (μ := μ) (by filter_upwards [] with x norm_num : (fun x : ℝ => ofReal (1 / 2 : ℝ)) ≤ᵐ[μ] (fun _ => 1)) simpa [μ] using hle) unfold directAltLaw rw [witness_observed_control_cell_eq_conv (directProbability β h s) hp.1 hp.2.1 hp.2.2] have hmap : (gaussianReal 0 1).map (fun z => (0 : ℝ) * z) = Measure.dirac 0 := by rw [show (fun z : ℝ => (0 : ℝ) * z) = fun _ => (0 : ℝ) by funext z; simp, Measure.map_const] simp rw [hmap, MeasureTheory.Measure.conv_dirac_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_observed_control_cell_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:53
def directZeroDensity

Density of the noiseless observed direct alternative with respect to Lebesgue measure on the score and counting measure on the two marks. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
s :
o :
Obs
directZeroDensity β h s o :
ℝ
if o.2.1 then if o.1 ∈ Icc (0 : ℝ) 1 then (1 / 2 : ℝ) * (if o.2.2 then directProbability β h s o.1 else 1 - directProbability β h s o.1) else 0 else if o.1 ∈ Ico (-1 : ℝ) 0 then 1 / 4 else 0
theorem directZeroDensity_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
Proof (Lean source)
lemma directZeroDensity_measurable (β h : ℝ) (s : Bool) : Measurable (directZeroDensity β h s) := by have hp : Measurable (directProbability β h s) := by unfold directProbability directBump apply measurable_const.add apply measurable_const.mul apply Measurable.ite measurableSet_Iio measurable_const exact (measurable_const.sub (measurable_id.div_const h)).max measurable_const unfold directZeroDensity apply Measurable.ite · exact (measurableSet_singleton true).preimage (measurable_fst.comp measurable_snd) · apply Measurable.ite · exact measurableSet_Icc.preimage measurable_fst · exact measurable_const.mul (Measurable.ite ((measurableSet_singleton true).preimage (measurable_snd.comp measurable_snd)) (hp.comp measurable_fst) (measurable_const.sub (hp.comp measurable_fst))) · exact measurable_const · apply Measurable.ite · exact measurableSet_Ico.preimage measurable_fst · exact measurable_const · exact measurable_const
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroDensity_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:90
theorem directAltLaw_observed_density_zero

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Pobs (directAltLaw β h s hβ hh) 0
= observedReference.withDensity (fun o => ofReal (directZeroDensity β h s o))
Proof (Lean source)
lemma directAltLaw_observed_density_zero (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Pobs (directAltLaw β h s hβ hh) 0 = observedReference.withDensity (fun o => ofReal (directZeroDensity β h s o)) := by let L := directAltLaw β h s hβ hh have hdens : Measurable (fun o : Obs => ofReal (directZeroDensity β h s o)) := (directZeroDensity_measurable β h s).ennreal_ofReal ext A hA rw [measure_apply_eq_sum_observedCellMeasure L 0 A hA] unfold observedReference rw [withDensity_apply _ hA, ← lintegral_indicator hA] rw [lintegral_prod _ (hdens.indicator hA).aemeasurable] simp_rw [lintegral_count, tsum_fintype] rw [lintegral_finset_sum] swap · intro i _ exact ((hdens.comp (measurable_id.prodMk measurable_const)).indicator (hA.preimage (measurable_id.prodMk measurable_const))) apply Finset.sum_congr rfl intro i _ rcases i with ⟨d, y⟩ change observedCellMeasure L 0 d y (observedCellEmbed d y ⁻¹' A) = ∫⁻ w : ℝ, (observedCellEmbed d y ⁻¹' A).indicator (fun w => ofReal (directZeroDensity β h s (observedCellEmbed d y w))) w have hcellA : MeasurableSet (observedCellEmbed d y ⁻¹' A) := hA.preimage (measurable_id.prodMk (measurable_const.prodMk measurable_const)) rw [lintegral_indicator hcellA] cases d · rw [direct_observed_control_cell_zero β h s y hβ hh, controlLatentCell_eq_withDensity, withDensity_apply _ hcellA] apply lintegral_congr intro w by_cases hw : w ∈ Ico (-1 : ℝ) 0 · simp [directZeroDensity, observedCellEmbed, controlCellBaseDensity, hw] · simp [directZeroDensity, observedCellEmbed, controlCellBaseDensity, hw] · rw [direct_observed_treated_cell_zero β h s y hβ hh, treatedLatentCell_eq_withDensity _ _ (directProbability_properties β h s hβ hh).1, withDensity_apply _ hcellA] apply lintegral_congr intro w by_cases hw : w ∈ Icc (0 : ℝ) 1 · simp only [directZeroDensity, observedCellEmbed, if_true, treatedCellBaseDensity, Set.indicator_of_mem hw] have hb := (directProbability_properties β h s hβ hh).2.2 w ⟨by linarith [hw.1], by linarith [hw.2]⟩ cases y <;> simp only [Bool.false_eq_true, if_false, if_true] <;> rw [← ENNReal.ofReal_mul (by norm_num : 0 ≤ (1 / 2 : ℝ))] <;> congr 1 <;> simp [hw] · simp [directZeroDensity, observedCellEmbed, treatedCellBaseDensity, hw]
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_observed_density_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:116
def directZeroLikelihoodRatio

Likelihood ratio of the plus direct alternative against the minus direct alternative on the common noiseless support. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
o :
Obs
directZeroLikelihoodRatio β h o :
ℝ
if o.2.1 ∧
o.1 ∈ Icc (0 : ℝ) 1 then directZeroDensity β h true o / directZeroDensity β h false o else 1
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroLikelihoodRatio · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:172
theorem directZeroLikelihoodRatio_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
Proof (Lean source)
lemma directZeroLikelihoodRatio_measurable (β h : ℝ) : Measurable (directZeroLikelihoodRatio β h) := by unfold directZeroLikelihoodRatio apply Measurable.ite · exact ((measurableSet_singleton true).preimage (measurable_fst.comp measurable_snd)).inter (measurableSet_Icc.preimage measurable_fst) · exact (directZeroDensity_measurable β h true).div (directZeroDensity_measurable β h false) · exact measurable_const
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroLikelihoodRatio_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:180
theorem directZeroDensity_nonneg

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
o :
Obs
0 ≤ directZeroDensity β h s o
Proof (Lean source)
lemma directZeroDensity_nonneg (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (o : Obs) : 0 ≤ directZeroDensity β h s o := by unfold directZeroDensity split_ifs with hd hx hy hx · exact mul_nonneg (by norm_num) ((directProbability_properties β h s hβ hh).2.2 o.1 ⟨by linarith [hx.1], by linarith [hx.2]⟩).1 · exact mul_nonneg (by norm_num) (sub_nonneg.mpr ((directProbability_properties β h s hβ hh).2.2 o.1 ⟨by linarith [hx.1], by linarith [hx.2]⟩).2) all_goals norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroDensity_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:192
theorem directZeroDensity_false_pos

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
o :
Obs
ho :
o.2.1 = true
hx :
o.1 ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma directZeroDensity_false_pos (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (o : Obs) (ho : o.2.1 = true) (hx : o.1 ∈ Icc (0 : ℝ) 1) : 0 < directZeroDensity β h false o := by unfold directZeroDensity rw [if_pos ho, if_pos hx] have hb := directProbability_mean_bounds β h false hβ hh o.1 cases o.2.2 <;> simp only [Bool.false_eq_true, if_false, if_true] <;> nlinarith [hb.1, hb.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroDensity_false_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:207
theorem directZeroDensity_mul_likelihoodRatio

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
o :
Obs
Proof (Lean source)
lemma directZeroDensity_mul_likelihoodRatio (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (o : Obs) : ofReal (directZeroDensity β h false o) * ofReal (directZeroLikelihoodRatio β h o) = ofReal (directZeroDensity β h true o) := by by_cases hs : o.2.1 = true ∧ o.1 ∈ Icc (0 : ℝ) 1 · rw [directZeroLikelihoodRatio, if_pos hs] rw [ENNReal.ofReal_div_of_pos (directZeroDensity_false_pos β h hβ hh o hs.1 hs.2)] exact ENNReal.mul_div_cancel (by simp [directZeroDensity_false_pos β h hβ hh o hs.1 hs.2]) ENNReal.ofReal_ne_top · rw [directZeroLikelihoodRatio, if_neg hs] simp only [ENNReal.ofReal_one, mul_one] unfold directZeroDensity by_cases hd : o.2.1 = true · have hx : o.1 ∉ Icc (0 : ℝ) 1 := fun hx => hs ⟨hd, hx⟩ simp [hd, hx] · simp [hd]
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroDensity_mul_likelihoodRatio · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:219
theorem directAltLaw_plus_eq_minus_withDensity_zero

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Pobs (directAltLaw β h true hβ hh) 0
= (Pobs (directAltLaw β h false hβ hh) 0).withDensity (fun o => ofReal (directZeroLikelihoodRatio β h o))
Proof (Lean source)
lemma directAltLaw_plus_eq_minus_withDensity_zero (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Pobs (directAltLaw β h true hβ hh) 0 = (Pobs (directAltLaw β h false hβ hh) 0).withDensity (fun o => ofReal (directZeroLikelihoodRatio β h o)) := by rw [directAltLaw_observed_density_zero β h true hβ hh, directAltLaw_observed_density_zero β h false hβ hh, ← withDensity_mul] · congr 1 funext o exact (directZeroDensity_mul_likelihoodRatio β h hβ hh o).symm · exact (directZeroDensity_measurable β h false).ennreal_ofReal · exact (directZeroLikelihoodRatio_measurable β h).ennreal_ofReal
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_plus_eq_minus_withDensity_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:241
theorem directAltLaw_observed_rnDeriv_zero

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
(fun o => ((Pobs (directAltLaw β h true hβ hh) 0).rnDeriv (Pobs (directAltLaw β h false hβ hh) 0) o).toReal)
=ᵐ[ Pobs (directAltLaw β h false hβ hh) 0] directZeroLikelihoodRatio β h
Proof (Lean source)
lemma directAltLaw_observed_rnDeriv_zero (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : (fun o => ((Pobs (directAltLaw β h true hβ hh) 0).rnDeriv (Pobs (directAltLaw β h false hβ hh) 0) o).toReal) =ᵐ[ Pobs (directAltLaw β h false hβ hh) 0] directZeroLikelihoodRatio β h := by letI := (directAltLaw β h false hβ hh).prob letI : IsProbabilityMeasure (Pobs (directAltLaw β h false hβ hh) 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable rw [directAltLaw_plus_eq_minus_withDensity_zero β h hβ hh] filter_upwards [Measure.rnDeriv_withDensity (Pobs (directAltLaw β h false hβ hh) 0) (directZeroLikelihoodRatio_measurable β h).ennreal_ofReal] with o ho rw [ho, ENNReal.toReal_ofReal] unfold directZeroLikelihoodRatio split_ifs with hs · exact div_nonneg (directZeroDensity_nonneg β h true hβ hh o) (directZeroDensity_nonneg β h false hβ hh o) · norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_observed_rnDeriv_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:256
theorem directZeroLikelihoodRatio_bounds

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
o :
Obs
conclusion 1
conclusion 2
Proof (Lean source)
lemma directZeroLikelihoodRatio_bounds (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (o : Obs) : 0 ≤ directZeroLikelihoodRatio β h o ∧ directZeroLikelihoodRatio β h o ≤ 3 := by unfold directZeroLikelihoodRatio split_ifs with hs · have hp := directProbability_mean_bounds β h true hβ hh o.1 have hm := directProbability_mean_bounds β h false hβ hh o.1 have hden := directZeroDensity_false_pos β h hβ hh o hs.1 hs.2 unfold directZeroDensity rw [if_pos hs.1, if_pos hs.2, if_pos hs.1, if_pos hs.2] cases o.2.2 <;> simp only [Bool.false_eq_true, if_false, if_true] <;> constructor · exact div_nonneg (by nlinarith [hp.1, hp.2]) (by nlinarith [hm.1, hm.2]) · have hden' : 0 < (1 / 2 : ℝ) * (1 - directProbability β h false o.1) := by nlinarith [hm.1, hm.2] apply (div_le_iff₀ hden').2 nlinarith [hp.1, hp.2, hm.1, hm.2] · exact div_nonneg (by nlinarith [hp.1, hp.2]) (by nlinarith [hm.1, hm.2]) · have hden' : 0 < (1 / 2 : ℝ) * directProbability β h false o.1 := by nlinarith [hm.1, hm.2] apply (div_le_iff₀ hden').2 nlinarith [hp.1, hp.2, hm.1, hm.2] · norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroLikelihoodRatio_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:279
theorem directAltLaw_observed_likelihood_square_integrable_zero

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Integrable (fun o => (((Pobs (directAltLaw β h true hβ hh) 0).rnDeriv (Pobs (directAltLaw β h false hβ hh) 0) o).toReal - 1)^2) (Pobs (directAltLaw β h false hβ hh) 0)
Proof (Lean source)
lemma directAltLaw_observed_likelihood_square_integrable_zero (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Integrable (fun o => (((Pobs (directAltLaw β h true hβ hh) 0).rnDeriv (Pobs (directAltLaw β h false hβ hh) 0) o).toReal - 1)^2) (Pobs (directAltLaw β h false hβ hh) 0) := by letI := (directAltLaw β h false hβ hh).prob letI : IsProbabilityMeasure (Pobs (directAltLaw β h false hβ hh) 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable have hr := directAltLaw_observed_rnDeriv_zero β h hβ hh have hi : Integrable (fun o => (directZeroLikelihoodRatio β h o - 1)^2) (Pobs (directAltLaw β h false hβ hh) 0) := Integrable.of_bound (((directZeroLikelihoodRatio_measurable β h).sub measurable_const).pow_const 2).aestronglyMeasurable 4 (Filter.Eventually.of_forall fun o => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hb := directZeroLikelihoodRatio_bounds β h hβ hh o nlinarith [sq_nonneg (directZeroLikelihoodRatio β h o - 1)]) apply hi.congr filter_upwards [hr] with o ho rw [ho]
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_observed_likelihood_square_integrable_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:306
theorem directAltLaw_observed_ac_zero

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Pobs (directAltLaw β h true hβ hh) 0 ≪ Pobs (directAltLaw β h false hβ hh) 0
Proof (Lean source)
lemma directAltLaw_observed_ac_zero (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Pobs (directAltLaw β h true hβ hh) 0 ≪ Pobs (directAltLaw β h false hβ hh) 0 := by rw [directAltLaw_plus_eq_minus_withDensity_zero β h hβ hh] exact withDensity_absolutelyContinuous _ _
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_observed_ac_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:328
def directZeroChiIntegrand

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
o :
Obs
directZeroChiIntegrand β h o :
ℝ
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiIntegrand · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:337
def directZeroChiMajorant

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
o :
Obs
directZeroChiMajorant β h o :
ℝ
if o.2.1 ∧ o.1 ∈ Icc (0 : ℝ) 1 then 8 * (kappa * h^β * directBump h o.1)^2 else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiMajorant · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:342
theorem directZeroChiIntegrand_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
Proof (Lean source)
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiIntegrand_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:349
theorem directZeroChiMajorant_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
Proof (Lean source)
lemma directZeroChiMajorant_measurable (β h : ℝ) : Measurable (directZeroChiMajorant β h) := by have hb : Measurable (directBump h) := by unfold directBump apply Measurable.ite measurableSet_Iio measurable_const exact (measurable_const.sub (measurable_id.div_const h)).max measurable_const unfold directZeroChiMajorant apply Measurable.ite · exact ((measurableSet_singleton true).preimage (measurable_fst.comp measurable_snd)).inter (measurableSet_Icc.preimage measurable_fst) · exact measurable_const.mul ((measurable_const.mul (hb.comp measurable_fst)).pow_const 2) · exact measurable_const
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiMajorant_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:356
theorem directZeroChiIntegrand_le_majorant

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
o :
Obs
conclusion 1
conclusion 2
Proof (Lean source)
lemma directZeroChiIntegrand_le_majorant (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) (o : Obs) : 0 ≤ directZeroChiIntegrand β h o ∧ directZeroChiIntegrand β h o ≤ directZeroChiMajorant β h o := by by_cases hs : o.2.1 = true ∧ o.1 ∈ Icc (0 : ℝ) 1 · have hp := directProbability_mean_bounds β h true hβ hh o.1 have hm := directProbability_mean_bounds β h false hβ hh o.1 have hbump := directBump_mem h hh.1 o.1 have hhpow : h^β ≤ 1 := Real.rpow_le_one hh.1.le hh.2 hβ.1.le have ha : 0 ≤ kappa * h^β * directBump h o.1 ∧ kappa * h^β * directBump h o.1 ≤ 1 / 100 := by constructor · exact mul_nonneg (mul_nonneg (by norm_num [kappa]) (Real.rpow_nonneg hh.1.le _)) hbump.1 · change kappa * h^β * directBump h o.1 ≤ kappa calc _ ≤ kappa * (1 * 1) := by simpa only [mul_assoc] using mul_le_mul_of_nonneg_left (mul_le_mul hhpow hbump.2 hbump.1 (by norm_num)) (by norm_num [kappa]) _ = kappa := by ring unfold directZeroChiIntegrand directZeroChiMajorant directZeroLikelihoodRatio rw [if_pos hs, if_pos hs] unfold directZeroDensity directProbability rw [if_pos hs.1, if_pos hs.2, if_pos hs.1, if_pos hs.2] cases o.2.2 <;> simp only [Bool.false_eq_true, if_false, if_true, witnessSign, one_mul, neg_one_mul] · change 0 ≤ (1 / 2 : ℝ) * (1 - (1 / 2 + (-kappa) * h^β * directBump h o.1)) * (((1 / 2 : ℝ) * (1 - (1 / 2 + kappa * h^β * directBump h o.1))) / ((1 / 2 : ℝ) * (1 - (1 / 2 + (-kappa) * h^β * directBump h o.1))) - 1)^2 ∧ (1 / 2 : ℝ) * (1 - (1 / 2 + (-kappa) * h^β * directBump h o.1)) * (((1 / 2 : ℝ) * (1 - (1 / 2 + kappa * h^β * directBump h o.1))) / ((1 / 2 : ℝ) * (1 - (1 / 2 + (-kappa) * h^β * directBump h o.1))) - 1)^2 ≤ 8 * (kappa * h^β * directBump h o.1)^2 have hminus : (1 / 2 : ℝ) + (-kappa) * h^β * directBump h o.1 = 1 / 2 - kappa * h^β * directBump h o.1 := by ring rw [hminus] have hd : 0 < (1 / 2 : ℝ) * (1 - (1 / 2 - kappa * h^β * directBump h o.1)) := by nlinarith [ha.1, ha.2] have hq : (1 / 8 : ℝ) ≤ (1 / 2 : ℝ) * (1 - (1 / 2 - kappa * h^β * directBump h o.1)) := by nlinarith [ha.1, ha.2] have hratio : (1 / 2 * (1 - (1 / 2 + kappa * h^β * directBump h o.1))) / (1 / 2 * (1 - (1 / 2 - kappa * h^β * directBump h o.1))) - 1 = -(kappa * h^β * directBump h o.1) / (1 / 2 * (1 - (1 / 2 - kappa * h^β * directBump h o.1))) := by rw [div_sub_one hd.ne'] field_simp [hd.ne'] ring constructor · exact mul_nonneg (by nlinarith [ha.1, ha.2]) (sq_nonneg _) · rw [hratio] have heq : (1 / 2 * (1 - (1 / 2 - kappa * h^β * directBump h o.1))) * (-(kappa * h^β * directBump h o.1) / (1 / 2 * (1 - (1 / 2 - kappa * h^β * directBump h o.1))))^2 = (kappa * h^β * directBump h o.1)^2 / (1 / 2 * (1 - (1 / 2 - kappa * h^β * directBump h o.1))) := by field_simp [hd.ne'] rw [heq] apply (div_le_iff₀ hd).2 nlinarith [hq, sq_nonneg (kappa * h^β * directBump h o.1)] · change 0 ≤ (1 / 2 : ℝ) * (1 / 2 + (-kappa) * h^β * directBump h o.1) * (((1 / 2 : ℝ) * (1 / 2 + kappa * h^β * directBump h o.1)) / ((1 / 2 : ℝ) * (1 / 2 + (-kappa) * h^β * directBump h o.1)) - 1)^2 ∧ (1 / 2 : ℝ) * (1 / 2 + (-kappa) * h^β * directBump h o.1) * (((1 / 2 : ℝ) * (1 / 2 + kappa * h^β * directBump h o.1)) / ((1 / 2 : ℝ) * (1 / 2 + (-kappa) * h^β * directBump h o.1)) - 1)^2 ≤ 8 * (kappa * h^β * directBump h o.1)^2 have hminus : (1 / 2 : ℝ) + (-kappa) * h^β * directBump h o.1 = 1 / 2 - kappa * h^β * directBump h o.1 := by ring rw [hminus] have hd : 0 < (1 / 2 : ℝ) * (1 / 2 - kappa * h^β * directBump h o.1) := by nlinarith [ha.1, ha.2] have hq : (1 / 8 : ℝ) ≤ (1 / 2 : ℝ) * (1 / 2 - kappa * h^β * directBump h o.1) := by nlinarith [ha.1, ha.2] have hratio : (1 / 2 * (1 / 2 + kappa * h^β * directBump h o.1)) / (1 / 2 * (1 / 2 - kappa * h^β * directBump h o.1)) - 1 = (kappa * h^β * directBump h o.1) / (1 / 2 * (1 / 2 - kappa * h^β * directBump h o.1)) := by rw [div_sub_one hd.ne'] field_simp [hd.ne'] ring constructor · exact mul_nonneg (by nlinarith [ha.1, ha.2]) (sq_nonneg _) · rw [hratio] have heq : (1 / 2 * (1 / 2 - kappa * h^β * directBump h o.1)) * ((kappa * h^β * directBump h o.1) / (1 / 2 * (1 / 2 - kappa * h^β * directBump h o.1)))^2 = (kappa * h^β * directBump h o.1)^2 / (1 / 2 * (1 / 2 - kappa * h^β * directBump h o.1)) := by field_simp [hd.ne'] rw [heq] apply (div_le_iff₀ hd).2 nlinarith [hq, sq_nonneg (kappa * h^β * directBump h o.1)] · have hr : directZeroLikelihoodRatio β h o = 1 := by unfold directZeroLikelihoodRatio rw [if_neg hs] have hm : directZeroChiMajorant β h o = 0 := by unfold directZeroChiMajorant rw [if_neg hs] rw [hm] simp [directZeroChiIntegrand, hr]
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiIntegrand_le_majorant · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:372
theorem directZeroChiMajorant_integrable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma directZeroChiMajorant_integrable (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Integrable (directZeroChiMajorant β h) observedReference := by unfold observedReference refine (integrable_prod_iff (directZeroChiMajorant_measurable β h).aestronglyMeasurable).2 ⟨Filter.Eventually.of_forall (fun w => Integrable.of_finite), ?_⟩ have hc : Continuous (fun w : ℝ => 16 * (kappa * h^β * directBump h w)^2) := by exact continuous_const.mul ((continuous_const.mul (directBump_continuous h hh.1)).pow 2) have hi : Integrable ((Icc (0 : ℝ) 1).indicator (fun w => 16 * (kappa * h^β * directBump h w)^2)) volume := hc.integrableOn_Icc.integrable_indicator measurableSet_Icc apply hi.congr filter_upwards [] with w rw [integral_count] simp only [Real.norm_eq_abs, Fintype.sum_prod_type, Fintype.sum_bool] by_cases hw : w ∈ Icc (0 : ℝ) 1 · simp [directZeroChiMajorant, hw] have ha : |kappa| * |h^β| * |directBump h w| = |kappa * h^β * directBump h w| := by rw [abs_mul, abs_mul] rw [ha, sq_abs] ring · simp [directZeroChiMajorant, hw]
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiMajorant_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:486
theorem directZeroChiMajorant_integral

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
(∫ o, directZeroChiMajorant β h o ∂observedReference) = (16 / 3 : ℝ) * kappa^2 * h^(2*β+1)
Proof (Lean source)
lemma directZeroChiMajorant_integral (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : (∫ o, directZeroChiMajorant β h o ∂observedReference) = (16 / 3 : ℝ) * kappa^2 * h^(2*β+1) := by unfold observedReference rw [integral_prod _ (directZeroChiMajorant_integrable β h hβ hh)] have heq : (fun w : ℝ => ∫ z : Bool × Bool, directZeroChiMajorant β h (w, z) ∂Measure.count) = fun w => (Icc (0 : ℝ) 1).indicator (fun w => 16 * (kappa * h^β * directBump h w)^2) w := by funext w rw [integral_count] simp only [Fintype.sum_prod_type, Fintype.sum_bool] by_cases hw : w ∈ Icc (0 : ℝ) 1 · simp [directZeroChiMajorant, hw] ring · simp [directZeroChiMajorant, hw] rw [heq, integral_indicator measurableSet_Icc] rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] rw [show (∫ x in (0 : ℝ)..1, 16 * (kappa * h^β * directBump h x)^2) = 16 * (kappa * h^β)^2 * ∫ x in (0 : ℝ)..1, (directBump h x)^2 by rw [← intervalIntegral.integral_const_mul] apply intervalIntegral.integral_congr intro x hx ring] rw [directBump_sq_integral_arm h hh] rw [show h^(2*β+1) = (h^β)^2 * h by rw [show 2 * β + 1 = β * 2 + 1 by ring, Real.rpow_add hh.1, Real.rpow_mul hh.1.le] norm_num] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.directZeroChiMajorant_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:514
theorem directAltLaw_observed_chiSqDiv_zero_le

The noiseless direct alternatives have one-observation chi-squared divergence of the boundary-bump order h^(2*beta+1). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
chiSqDiv (Pobs (directAltLaw β h true hβ hh) 0) (Pobs (directAltLaw β h false hβ hh) 0)
≤ (16 / 3 : ℝ) * kappa^2 * h^(2*β+1)
Proof (Lean source)
lemma directAltLaw_observed_chiSqDiv_zero_le (β h : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : chiSqDiv (Pobs (directAltLaw β h true hβ hh) 0) (Pobs (directAltLaw β h false hβ hh) 0) ≤ (16 / 3 : ℝ) * kappa^2 * h^(2*β+1) := by let P := directAltLaw β h true hβ hh let Q := directAltLaw β h false hβ hh letI := P.prob letI := Q.prob letI : IsProbabilityMeasure (Pobs P 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable letI : IsProbabilityMeasure (Pobs Q 0) := Measure.isProbabilityMeasure_map (obs_measurable 0).aemeasurable have hmaj := directZeroChiMajorant_integrable β h hβ hh have hint : Integrable (directZeroChiIntegrand β h) observedReference := by apply hmaj.mono' (directZeroChiIntegrand_measurable β h).aestronglyMeasurable filter_upwards [] with o have hb := directZeroChiIntegrand_le_majorant β h hβ hh o simpa [Real.norm_eq_abs, abs_of_nonneg hb.1] using hb.2 rw [chiSqDiv] calc (∫ o, (((Pobs P 0).rnDeriv (Pobs Q 0) o).toReal - 1)^2 ∂Pobs Q 0) = ∫ o, (directZeroLikelihoodRatio β h o - 1)^2 ∂Pobs Q 0 := by apply integral_congr_ae filter_upwards [directAltLaw_observed_rnDeriv_zero β h hβ hh] with o ho rw [ho] _ = ∫ o, directZeroChiIntegrand β h o ∂observedReference := by dsimp [Q] rw [directAltLaw_observed_density_zero β h false hβ hh] rw [integral_withDensity_eq_integral_toReal_smul (directZeroDensity_measurable β h false).ennreal_ofReal (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] simp_rw [ENNReal.toReal_ofReal (directZeroDensity_nonneg β h false hβ hh _)] simp only [smul_eq_mul] rfl _ ≤ ∫ o, directZeroChiMajorant β h o ∂observedReference := by exact integral_mono hint hmaj (fun o => (directZeroChiIntegrand_le_majorant β h hβ hh o).2) _ = _ := directZeroChiMajorant_integral β h hβ hh
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw_observed_chiSqDiv_zero_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DirectZeroInformation.lean:551
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.DongInference 26 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

def DongLatent

Dong's comparison allows real-valued potential outcomes.

Definition (Lean source)
DongLatent :
Type
ℝ × ℝ × ℝ × ℝ
def dongY

Observed-treatment outcome in Dong's experiment. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
dongY z :
ℝ
if 0 ≤ z.1 then z.2.2.1 else z.2.1
def dongChar

Ordinary characteristic function, with the source's positive Fourier sign. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
Ω :
P :
X :
Ω → ℝ
t :
ℝ
dongChar P X t :
ℂ
∫ z, exp (I * (t * X z : ℝ)) ∂P
def dongFourier

Fourier transform of the source's real kernel. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
t :
ℝ
dongFourier K t :
ℂ
∫ x : ℝ, (K x : ℂ) * exp (I * (t*x : ℝ))
def dongFourierDeriv

The source's iterated Fourier derivative. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
k :
ℕ
dongFourierDeriv K k :
ℝ → ℂ
CausalSmith.Stat.RdTruesideNoiseFrontier.dongFourierDeriv · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:38
def dongWeight

Actual observed-treatment deconvolution weights, Section 2.3.1, printed p.53. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
h :
ℝ
k :
ℕ
r :
ℝ
dongWeight P K h k r :
ℝ
((1 / (2 * (Real.pi : ℂ) * I ^ k)) * ∫ t : ℝ, dongFourierDeriv K k (t*h) / dongChar P (fun z => z.2.2.2) (-t) * exp (-I * (t*r : ℝ))).re
def dongArm

Arm membership uses true treatment status, as in the source. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
s :
x :
ℝ
dongArm s x :
ℝ
if (decide (0 ≤ x) : Bool) = s then 1 else 0
def dongA

Source's unmarked sample average. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
h :
ℝ
s :
k :
ℕ
n :
ℕ
z :
dongA P K h s k z :
ℝ
(n : ℝ)⁻¹ * ∑ i, dongWeight P K h k ((z i).1 + (z i).2.2.2) * dongArm s (z i).1
def dongB

Source's marked sample average. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
h :
ℝ
s :
k :
ℕ
n :
ℕ
z :
dongB P K h s k z :
ℝ
(n : ℝ)⁻¹ * ∑ i, dongWeight P K h k ((z i).1 + (z i).2.2.2) * dongY (z i) * dongArm s (z i).1
def dongIntercept

Source's local-linear arm intercept, with exactly its displayed ratio. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
h :
ℝ
s :
n :
ℕ
z :
dongIntercept P K h s z :
ℝ
(dongA P K h s 2 z * dongB P K h s 0 z - dongA P K h s 1 z * dongB P K h s 1 z) / (dongA P K h s 2 z * dongA P K h s 0 z - dongA P K h s 1 z ^ 2)
CausalSmith.Stat.RdTruesideNoiseFrontier.dongIntercept · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:55
def dongEstimator

Dong's observed-treatment contrast estimator (2.3.3). Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
h :
ℝ
n :
ℕ
z :
dongEstimator P K h z :
ℝ
CausalSmith.Stat.RdTruesideNoiseFrontier.dongEstimator · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:60
def DongConditionalMeans

Genuine conditional potential means on a cutoff neighborhood. The reused regression predicate requires integrability of each potential outcome and of its mean representative on that neighborhood before its measurable-slice integral characterization applies. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
mu :
Bool → ℝ → ℝ
DongConditionalMeans P mu :
Prop
∃ r > 0,
∀ d : Bool,
IsRegressionFunction (P.restrict {z | z.1 ∈ Ioo (-r) r}) (fun z => z.1) (fun z => if d then z.2.2.1 else z.2.1) (mu d)
CausalSmith.Stat.RdTruesideNoiseFrontier.DongConditionalMeans · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:64
def DongVersions

The score density and well-defined local conditional potential means are pinned to the law. No unrestricted Bochner integral of a nonintegrable counterfactual is used as a version certificate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
f :
ℝ → ℝ
mu :
Bool → ℝ → ℝ
DongVersions P f mu :
Prop
clause 2
x :
0 ≤ f x
clause 3
P.map (fun z => z.1) = volume.withDensity (fun x => ofReal (f x))
def dongTarget

Dong's cutoff target. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
mu :
Bool → ℝ → ℝ
dongTarget mu :
ℝ
mu true 0 - mu false 0
def dongRegression

Continuous part of the observed regression after removing the cutoff jump. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
mu :
Bool → ℝ → ℝ
x :
ℝ
dongRegression mu x :
ℝ
if 0 ≤ x then mu true x - dongTarget mu else mu false x
CausalSmith.Stat.RdTruesideNoiseFrontier.dongRegression · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:79
def DongA8

Assumption 8: positive cutoff density and continuous potential means at zero. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
f :
ℝ → ℝ
mu :
Bool → ℝ → ℝ
DongA8 f mu :
Prop
clause 1
0 < f 0
clause 2
d :
ContinuousAt (mu d) 0
def DongA9Gaussian

Assumption 9, specialized to a fixed positive-scale Gaussian error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
DongA9Gaussian P σ :
Prop
clause 1
0 < σ
clause 2
P.map (fun z => z.2.2.2) = gaussianReal 0 ⟨σ^2, sq_nonneg σ⟩
clause 3
IndepFun (fun z => z.2.2.2) (fun z => (dongY z, z.1)) P
CausalSmith.Stat.RdTruesideNoiseFrontier.DongA9Gaussian · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:85
def DongA11

Source's Assumption 11 on transforms, local smoothness, and real symmetric kernel moments. IID sampling and a known fixed error law are built into the experiment and weights. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
f :
ℝ → ℝ
mu :
Bool → ℝ → ℝ
K :
ℝ → ℝ
DongA11 P f mu K :
Prop
clause 1
Integrable (fun t => ‖dongChar P (fun z => z.1) t‖)
clause 2
t :
dongChar P (fun z => z.2.2.2) t ≠ 0
clause 3
k ≤ 2 :
∃ t, dongFourierDeriv K k t ≠ 0
h > 0 :
Integrable (fun t => ‖dongFourierDeriv K k (t*h) / dongChar P (fun z => z.2.2.2) t‖)
clause 4
∃ r > 0,
ContDiffOn ℝ 2 f (Ioo (-r) r)
∃ c > 0, ∀ x ∈ Ioo (-r) r, c ≤ f x
ContDiffOn ℝ 2 (dongRegression mu) (Ioo (-r) 0 ∪ Ioo 0 r)
k ∈ ({1, 2} : Finset ℕ) :
∃ left right : ℝ,
Tendsto (deriv^[k] (dongRegression mu)) (nhdsWithin 0 (Iio 0)) (nhds left)
Tendsto (deriv^[k] (dongRegression mu)) (nhdsWithin 0 (Ioi 0)) (nhds right)
clause 5
x :
K (-x) = K x
clause 6
(∫ x, K x) = 1
clause 7
k ≤ 3 :
Integrable (fun x => |x|^k * |K x|)
def dongKernelMoment

One-sided kernel moments and the population linearization constants. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
s :
k :
ℕ
dongKernelMoment K s k :
ℝ
∫ x in (if s then Ioi (0 : ℝ) else Iio (0 : ℝ)), x^k * K x
CausalSmith.Stat.RdTruesideNoiseFrontier.dongKernelMoment · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:107
def dongLeading

Source's Section 2.8.1 leading summand P_{1,n,1}, with its displayed residual. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
f :
ℝ → ℝ
mu :
Bool → ℝ → ℝ
K :
ℝ → ℝ
h :
ℝ
s :
dongLeading P f mu K h s z :
ℝ
a0 :
f 0 * dongKernelMoment K s 0
a1 :
f 0 * dongKernelMoment K s 1
a2 :
f 0 * dongKernelMoment K s 2
residual :
dongY z - (if 0 ≤ z.1 then dongTarget mu else 0) - dongRegression mu 0
(a2 * dongWeight P K h 0 (z.1 + z.2.2.2) - a1 * dongWeight P K h 1 (z.1 + z.2.2.2)) / (a0*a2 - a1^2) * residual * dongArm s z.1
def dongBandwidth

The source's logarithmic bandwidth at Gaussian supersmooth exponent two. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ b :
ℝ
n :
ℕ
dongBandwidth σ b n :
ℝ
(b * (σ^2/2)) ^ (1/2 : ℝ) * (log n) ^ (-1/2 : ℝ)
CausalSmith.Stat.RdTruesideNoiseFrontier.dongBandwidth · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:119
def DongA13Gaussian

Assumption 13 at fixed Gaussian scale, with the exact leading-summand Lyapunov restriction. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
f :
ℝ → ℝ
mu :
Bool → ℝ → ℝ
K :
ℝ → ℝ
σ b :
ℝ
DongA13Gaussian P f mu K σ b :
Prop
clause 1
t ∉ Icc (-1 : ℝ) 1 :
dongFourier K t = 0
clause 2
k ≤ 2 :
∃ C : ℝ, ∀ t, ‖dongFourierDeriv K k t‖ ≤ C
clause 3
∃ η > 0,
∀ s : Bool,
Tendsto (fun n : ℕ => (∫ z, |dongLeading P f mu K (dongBandwidth σ b n) s z|^2 ∂P) * (n : ℝ) ^ (η/(2+η)) * (dongBandwidth σ b n) ^ ((2+2*η)/(2+η)) * exp (-(σ^2) * (dongBandwidth σ b n) ^ (-2 : ℝ))) atTop atTop
CausalSmith.Stat.RdTruesideNoiseFrontier.DongA13Gaussian · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:122
def dongExperiment

Dong's IID latent sample experiment, with the observed estimator using only observable coordinates. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
dongExperiment P n :
Measure.pi (fun _ : Fin n => P)
CausalSmith.Stat.RdTruesideNoiseFrontier.dongExperiment · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:132
def dongBias

Actual estimator bias; no freely supplied centering sequence. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
mu :
Bool → ℝ → ℝ
K :
ℝ → ℝ
σ b :
ℝ
n :
ℕ
dongBias P mu K σ b n :
ℝ
(∫ z, dongEstimator P K (dongBandwidth σ b n) z ∂dongExperiment P n) - dongTarget mu
def dongVariance

Actual estimator variance; no freely supplied normalization sequence. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
K :
ℝ → ℝ
σ b :
ℝ
n :
ℕ
dongVariance P K σ b n :
ℝ
def DongGaussianAsymptoticNormality

Pointwise asymptotic normality, using the equivalent CDF convergence for a continuous Gaussian limit. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
mu :
Bool → ℝ → ℝ
K :
ℝ → ℝ
σ b :
ℝ
t :
ℝ
DongGaussianAsymptoticNormality P mu K σ b :
Prop
Tendsto (fun n : ℕ => (dongExperiment P n).real {z | (dongEstimator P K (dongBandwidth σ b n) z - dongTarget mu - dongBias P mu K σ b n) / sqrt (dongVariance P K σ b n) ≤ t}) atTop ((nhds ((gaussianReal 0 1).real (Iic t))))
CausalSmith.Stat.RdTruesideNoiseFrontier.DongGaussianAsymptoticNormality · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/DongInference.lean:142
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.EmpiricalMoments 6 declarations The IID second-moment calculation in FC.5 is unchanged by appending the independent procedure seed.

Seeded empirical-average moments

The IID second-moment calculation in FC.5 is unchanged by appending the independent procedure seed. The remaining population calculations concern a single observed summand, rather than the full sample experiment.

theorem seeded_iid_centered_moments Lemma seeded_iid_centered_moments in the paper ↗

An IID empirical average retains its mean and centered second-moment bound when an independent probability seed is appended, as required in FC.5. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
μ :
ν :
n :
ℕ
hn :
0 < n
F :
Ω → ℝ
hF :
MemLp F 2 μ
V :
ℝ
hV :
(∫ o, (F o)^2 ∂μ) ≤ V
Z :
fun z : (Fin n → Ω) × T => (n : ℝ)⁻¹ * ∑ i, F (z.1 i) - ∫ o, F o ∂μ
Q :
(Measure.pi fun _ : Fin n => μ).prod ν
MemLp Z 2 Q
(∫ z, Z z ∂Q) = 0
(∫ z, (Z z)^2 ∂Q) ≤ V / n
Proof (Lean source)
lemma seeded_iid_centered_moments {Ω T : Type*} [MeasurableSpace Ω] [MeasurableSpace T] (μ : Measure Ω) (ν : Measure T) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (n : ℕ) (hn : 0 < n) (F : Ω → ℝ) (hF : MemLp F 2 μ) (V : ℝ) (hV : (∫ o, (F o)^2 ∂μ) ≤ V) : let Z := fun z : (Fin n → Ω) × T => (n : ℝ)⁻¹ * ∑ i, F (z.1 i) - ∫ o, F o ∂μ let Q := (Measure.pi fun _ : Fin n => μ).prod ν MemLp Z 2 Q ∧ (∫ z, Z z ∂Q) = 0 ∧ (∫ z, (Z z)^2 ∂Q) ≤ V / n := by let S := Measure.pi fun _ : Fin n => μ let A := fun s : Fin n → Ω => (n : ℝ)⁻¹ * ∑ i, F (s i) have hA : MemLp A 2 S := by exact (memLp_finset_sum univ (fun i _ => hF.comp_measurePreserving (measurePreserving_eval (fun _ : Fin n => μ) i))).const_mul _ have hZ : MemLp (fun s => A s - ∫ o, F o ∂μ) 2 S := hA.sub (memLp_const _) have hf : MeasurePreserving fst (S.prod ν) S := measurePreserving_fst have hm : (∫ s, A s ∂S) = ∫ o, F o ∂μ := iid_average_integral μ n hn F (hF.integrable (by norm_num)) refine ⟨hZ.comp_measurePreserving hf, ?_, ?_⟩ · change (∫ z, ((fun s => A s - ∫ o, F o ∂μ) ∘ fst) z ∂S.prod ν) = 0 rw [integral_prod _ ((hZ.comp_measurePreserving hf).integrable (by norm_num))] dsimp only [Function.comp_def] simp only [integral_const, probReal_univ, one_smul] rw [integral_sub (hA.integrable (by norm_num)) (integrable_const _), hm] simp · change (∫ z, (((fun s => A s - ∫ o, F o ∂μ) ∘ fst) z)^2 ∂S.prod ν) ≤ V / n rw [integral_prod _ (hZ.comp_measurePreserving hf).integrable_sq] dsimp only [Function.comp_def] simp only [integral_const, probReal_univ, one_smul] exact (iid_mean_sq_le μ hn F hF).trans (div_le_div_of_nonneg_right hV (by positivity))
CausalSmith.Stat.RdTruesideNoiseFrontier.seeded_iid_centered_moments · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:18
theorem empirical_Pobs_probability Lemma empirical_Pobs_probability in the paper ↗

The observed law is normalized independently of the noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
Proof (Lean source)
lemma empirical_Pobs_probability (P : LatentLaw) (σ : ℝ) : IsProbabilityMeasure (Pobs P σ) := by letI := P.prob exact Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable
CausalSmith.Stat.RdTruesideNoiseFrontier.empirical_Pobs_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:53
theorem seeded_iid_average_integral Lemma seeded_iid_average_integral in the paper ↗

The expectation of a seeded IID average is its single-observation mean. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
μ :
ν :
n :
ℕ
hn :
0 < n
F :
Ω → ℝ
hF :
(∫ z : (Fin n → Ω) × T, (n : ℝ)⁻¹ * ∑ i, F (z.1 i) ∂(Measure.pi fun _ : Fin n => μ).prod ν)
= ∫ o, F o ∂μ
Proof (Lean source)
lemma seeded_iid_average_integral {Ω T : Type*} [MeasurableSpace Ω] [MeasurableSpace T] (μ : Measure Ω) (ν : Measure T) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] (n : ℕ) (hn : 0 < n) (F : Ω → ℝ) (hF : Integrable F μ) : (∫ z : (Fin n → Ω) × T, (n : ℝ)⁻¹ * ∑ i, F (z.1 i) ∂(Measure.pi fun _ : Fin n => μ).prod ν) = ∫ o, F o ∂μ := by have hA : Integrable (fun s : Fin n → Ω => (n : ℝ)⁻¹ * ∑ i, F (s i)) (Measure.pi fun _ : Fin n => μ) := (integrable_finset_sum univ (fun i _ => (measurePreserving_eval (fun _ : Fin n => μ) i).integrable_comp_of_integrable hF)).const_mul _ have hi := (measurePreserving_fst (μ := Measure.pi fun _ : Fin n => μ) (ν := ν)).integrable_comp_of_integrable hA change (∫ z, ((fun s : Fin n → Ω => (n : ℝ)⁻¹ * ∑ i, F (s i)) ∘ fst) z ∂(Measure.pi fun _ : Fin n => μ).prod ν) = _ rw [integral_prod _ hi] dsimp only [Function.comp_def] simp only [integral_const, probReal_univ, one_smul] exact iid_average_integral μ n hn F hF
CausalSmith.Stat.RdTruesideNoiseFrontier.seeded_iid_average_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:59
theorem unmarkedMean_eq_single_observation Lemma unmarkedMean_eq_single_observation in the paper ↗

The population denominator expectation reduces to one observed weight. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
n L :
ℕ
d :
hn :
0 < n
hF :
Integrable (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1)) (Pobs P σ)
unmarkedMean d L σ P n
= ∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ
Proof (Lean source)
lemma unmarkedMean_eq_single_observation (P : LatentLaw) (σ : ℝ) (n L : ℕ) (d : Bool) (hn : 0 < n) (hF : Integrable (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1)) (Pobs P σ)) : unmarkedMean d L σ P n = ∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ := by letI := empirical_Pobs_probability P σ haveI : IsProbabilityMeasure seedLaw := by unfold seedLaw; infer_instance exact seeded_iid_average_integral (Pobs P σ) seedLaw n hn _ hF
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarkedMean_eq_single_observation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:78
theorem markedAvg_centered_moments_of_single_observation Lemma markedAvg_centered_moments_of_single_observation in the paper ↗

Single-observation marked moments suffice for all centered marked-average moments under the actual seeded experiment; no sample-level bound is assumed. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
n L :
ℕ
d :
hn :
0 < n
hF :
MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1)) 2 (Pobs P σ)
hV :
(∫ o : Obs, ((if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1))^2 ∂Pobs P σ)
A :
∫ o : Obs, (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ
MemLp (fun z : Input n => markedAvg d L σ z.1 - A) 2 (experiment P σ n)
(∫ z : Input n, markedAvg d L σ z.1 - A ∂experiment P σ n) = 0
(∫ z : Input n, (markedAvg d L σ z.1 - A)^2 ∂experiment P σ n) ≤ kernelVariance L σ / n
Proof (Lean source)
lemma markedAvg_centered_moments_of_single_observation (P : LatentLaw) (σ : ℝ) (n L : ℕ) (d : Bool) (hn : 0 < n) (hF : MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1)) 2 (Pobs P σ)) (hV : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1))^2 ∂Pobs P σ) ≤ kernelVariance L σ) : let A := ∫ o : Obs, (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ MemLp (fun z : Input n => markedAvg d L σ z.1 - A) 2 (experiment P σ n) ∧ (∫ z : Input n, markedAvg d L σ z.1 - A ∂experiment P σ n) = 0 ∧ (∫ z : Input n, (markedAvg d L σ z.1 - A)^2 ∂experiment P σ n) ≤ kernelVariance L σ / n := by letI := empirical_Pobs_probability P σ haveI : IsProbabilityMeasure seedLaw := by unfold seedLaw; infer_instance exact seeded_iid_centered_moments (Pobs P σ) seedLaw n hn _ hF _ hV
CausalSmith.Stat.RdTruesideNoiseFrontier.markedAvg_centered_moments_of_single_observation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:89
theorem unmarkedAvg_centered_moments_of_single_observation Lemma unmarkedAvg_centered_moments_of_single_observation in the paper ↗

Single-observation unmarked moments suffice for all centered denominator moments under the actual seeded experiment. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
n L :
ℕ
d :
hn :
0 < n
hF :
MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1)) 2 (Pobs P σ)
hV :
(∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1))^2 ∂Pobs P σ)
B :
∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ
MemLp (fun z : Input n => unmarkedAvg d L σ z.1 - B) 2 (experiment P σ n)
(∫ z : Input n, unmarkedAvg d L σ z.1 - B ∂experiment P σ n) = 0
(∫ z : Input n, (unmarkedAvg d L σ z.1 - B)^2 ∂experiment P σ n) ≤ kernelVariance L σ / n
Proof (Lean source)
lemma unmarkedAvg_centered_moments_of_single_observation (P : LatentLaw) (σ : ℝ) (n L : ℕ) (d : Bool) (hn : 0 < n) (hF : MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1)) 2 (Pobs P σ)) (hV : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1))^2 ∂Pobs P σ) ≤ kernelVariance L σ) : let B := ∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * o.1) ∂Pobs P σ MemLp (fun z : Input n => unmarkedAvg d L σ z.1 - B) 2 (experiment P σ n) ∧ (∫ z : Input n, unmarkedAvg d L σ z.1 - B ∂experiment P σ n) = 0 ∧ (∫ z : Input n, (unmarkedAvg d L σ z.1 - B)^2 ∂experiment P σ n) ≤ kernelVariance L σ / n := by letI := empirical_Pobs_probability P σ haveI : IsProbabilityMeasure seedLaw := by unfold seedLaw; infer_instance exact seeded_iid_centered_moments (Pobs P σ) seedLaw n hn _ hF _ hV
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarkedAvg_centered_moments_of_single_observation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalMoments.lean:107
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.EmpiricalPopulationBridge 28 declarations This file isolates the product-law reduction used by the single-observation calculations.

Population bridges for the finite certificate

This file isolates the product-law reduction used by the single-observation calculations. In particular, reflecting the Gaussian error for either arm does not change its law or its independence from the latent schedule.

def latentSchedule

The part of a latent observation independent of the measurement error. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
ω :
latentSchedule ω :
ℝ × Bool × Bool
(score ω, ω.2.1, ω.2.2.1)
theorem latentSchedule_measurable

Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
lemma latentSchedule_measurable : Measurable latentSchedule := by unfold latentSchedule score fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.latentSchedule_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:25
theorem latentSchedule_fst

The first coordinate of the latent schedule is the latent score. Given the latent observation, this records the defining projection identity.

Formal statement
ω :
(latentSchedule ω).1 = score ω
Proof (Lean source)
@[simp] lemma latentSchedule_fst (ω : Latent) : (latentSchedule ω).1 = score ω := by rfl
theorem integral_Pobs_eq_integral_obs_comp

Pull an observed integral back to the latent law. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
σ :
ℝ
H :
Obs → ℝ
hH :
(∫ o, H o ∂Pobs Q σ) = ∫ ω, H (obs σ ω) ∂Q.P
Proof (Lean source)
lemma integral_Pobs_eq_integral_obs_comp (Q : LatentLaw) (σ : ℝ) (H : Obs → ℝ) (hH : AEStronglyMeasurable H (Pobs Q σ)) : (∫ o, H o ∂Pobs Q σ) = ∫ ω, H (obs σ ω) ∂Q.P := by exact integral_map (obs_measurable σ).aemeasurable hH
CausalSmith.Stat.RdTruesideNoiseFrontier.integral_Pobs_eq_integral_obs_comp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:34
theorem inverseHeat_schedule_gaussian_memLp_two

On the independent schedule/Gaussian product, the inverse-heat evaluation at the reflected compactly-supported score is square integrable. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
d :
J :
ℕ
σ :
ℝ
MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2)) 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1))
Proof (Lean source)
lemma inverseHeat_schedule_gaussian_memLp_two (hherm : ClassicalHermiteFacts) (Q : LatentLaw) (d : Bool) (J : ℕ) (σ : ℝ) : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2)) 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by letI : IsProbabilityMeasure Q.P := Q.prob letI : IsProbabilityMeasure (Q.P.map latentSchedule) := Measure.isProbabilityMeasure_map latentSchedule_measurable.aemeasurable have hsupp : ∀ᵐ s ∂Q.P.map latentSchedule, s.1 ∈ Icc (-1 : ℝ) 1 := by rw [ae_map_iff latentSchedule_measurable.aemeasurable (measurableSet_Icc.preimage measurable_fst)] simpa [latentSchedule] using Q.supp have hmode (j : ℕ) : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => (σ ^ j * (polyDeriv j (endpointKernel J)).eval (sgn d * sz.1.1) / (Nat.factorial j : ℝ)) * (aeval sz.2 (hermite j) : ℝ)) 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by let c : (ℝ × Bool × Bool) → ℝ := fun s => σ ^ j * (polyDeriv j (endpointKernel J)).eval (sgn d * s.1) / (Nat.factorial j : ℝ) have hcmeas : Measurable c := by dsimp [c] fun_prop have hccont : ContinuousOn (fun x : ℝ => σ ^ j * (polyDeriv j (endpointKernel J)).eval (sgn d * x) / (Nat.factorial j : ℝ)) (Icc (-1 : ℝ) 1) := by fun_prop obtain ⟨C, hC⟩ := isCompact_Icc.exists_bound_of_continuousOn hccont have hcTop : MemLp c ⊤ (Q.P.map latentSchedule) := by apply memLp_top_of_bound hcmeas.aestronglyMeasurable C filter_upwards [hsupp] with s hs exact hC s.1 hs have hcProd : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => c sz.1) ⊤ ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := hcTop.comp_measurePreserving measurePreserving_fst have hhProd : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => (aeval sz.2 (hermite j) : ℝ)) 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := (hermite_memLp_two hherm j).comp_measurePreserving measurePreserving_snd change MemLp ((fun sz : (ℝ × Bool × Bool) × ℝ => c sz.1) * fun sz => (aeval sz.2 (hermite j) : ℝ)) 2 _ exact hhProd.mul hcProd have hsum : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => ∑ j ∈ range (kernelDegree J + 1), (σ ^ j * (polyDeriv j (endpointKernel J)).eval (sgn d * sz.1.1) / (Nat.factorial j : ℝ)) * (aeval sz.2 (hermite j) : ℝ)) 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := memLp_finsetSum _ (fun j _ => hmode j) have hexp (sz : (ℝ × Bool × Bool) × ℝ) : (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2) = ∑ j ∈ range (kernelDegree J + 1), (σ ^ j * (polyDeriv j (endpointKernel J)).eval (sgn d * sz.1.1) / (Nat.factorial j : ℝ)) * (aeval sz.2 (hermite j) : ℝ) := by rw [inverseHeat_eq_finiteInverseHeat] exact finiteInverseHeat_hermite_expansion (endpointKernel J) (kernelDegree J) (endpointKernel_natDegree_le J) (sgn d * sz.1.1) σ sz.2 simpa only [hexp] using hsum
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat_schedule_gaussian_memLp_two · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:40
theorem signedError_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
Measurable (fun ω : Latent => sgn d * errorCoord ω)
Proof (Lean source)
lemma signedError_measurable (d : Bool) : Measurable (fun ω : Latent => sgn d * errorCoord ω) := by unfold errorCoord fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.signedError_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:102
theorem sgn_mul_proxy

Reflecting the proxy splits into the reflected score and the reflected error with the original nonnegative noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
σ :
ℝ
ω :
sgn d * proxy σ ω = sgn d * score ω + σ * (sgn d * errorCoord ω)
Proof (Lean source)
lemma sgn_mul_proxy (d : Bool) (σ : ℝ) (ω : Latent) : sgn d * proxy σ ω = sgn d * score ω + σ * (sgn d * errorCoord ω) := by unfold proxy ring
theorem arm_indicator_outcome_eq_pot

On an observation assigned to arm d, the observed binary mark is exactly the corresponding latent potential. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
ω :
(if side ω = d then (1 : ℝ) else 0) * bit (outcome ω)
= (if side ω = d then (1 : ℝ) else 0) * pot d ω
Proof (Lean source)
lemma arm_indicator_outcome_eq_pot (d : Bool) (ω : Latent) : (if side ω = d then (1 : ℝ) else 0) * bit (outcome ω) = (if side ω = d then (1 : ℝ) else 0) * pot d ω := by by_cases hs : side ω = d · cases d <;> simp_all [outcome, pot] · simp [hs]
CausalSmith.Stat.RdTruesideNoiseFrontier.arm_indicator_outcome_eq_pot · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:116
theorem pot_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
Proof (Lean source)
lemma pot_measurable (d : Bool) : Measurable (pot d) := by have hb : Measurable bit := measurable_of_countable bit cases d · change Measurable (fun ω : Latent => bit ω.2.1) exact hb.comp measurable_snd.fst · change Measurable (fun ω : Latent => bit ω.2.2.1) exact hb.comp measurable_snd.snd.fst
theorem pot_nonneg

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
ω :
0 ≤ pot d ω
Proof (Lean source)
lemma pot_nonneg (d : Bool) (ω : Latent) : 0 ≤ pot d ω := by cases d · cases h : ω.2.1 <;> simp [pot, bit, h] · cases h : ω.2.2.1 <;> simp [pot, bit, h]
theorem mu_mul_f_measurable

The conditional-mean density is globally measurable even though the version itself is only controlled on the score support. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
Measurable (fun x => Q.mu d x * Q.f x)
Proof (Lean source)
lemma mu_mul_f_measurable (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) : Measurable (fun x => Q.mu d x * Q.f x) := by have hc : ContinuousOn (fun x => Q.mu d x * Q.f x) (Icc (-1 : ℝ) 1) := (Q.mu_cont d).mul Q.f_cont have heq : (fun x => Q.mu d x * Q.f x) = (Icc (-1 : ℝ) 1).piecewise (fun x => Q.mu d x * Q.f x) 0 := by funext x by_cases hx : x ∈ Icc (-1 : ℝ) 1 · simp [hx] · simp [hx, Q.f_zero x hx] rw [heq] exact hc.measurable_piecewise continuous_const.continuousOn measurableSet_Icc
theorem density_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
Proof (Lean source)
lemma density_measurable (Q : LatentLaw) : Measurable Q.f := by have heq : Q.f = (Icc (-1 : ℝ) 1).piecewise Q.f 0 := by funext x by_cases hx : x ∈ Icc (-1 : ℝ) 1 · simp [hx] · simp [hx, Q.f_zero x hx] rw [heq] exact Q.f_cont.measurable_piecewise continuous_const.continuousOn measurableSet_Icc
theorem mu_mul_f_nonneg

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
x :
ℝ
0 ≤ Q.mu d x * Q.f x
Proof (Lean source)
lemma mu_mul_f_nonneg (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) (x : ℝ) : 0 ≤ Q.mu d x * Q.f x := by by_cases hx : x ∈ Icc (-1 : ℝ) 1 · exact mul_nonneg (le_trans (by norm_num) (hQ.means d x hx).1) (Q.f_nonneg x) · rw [Q.f_zero x hx, mul_zero]
theorem mu_mul_f_integrable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
Integrable (fun x => Q.mu d x * Q.f x)
Proof (Lean source)
lemma mu_mul_f_integrable (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) : Integrable (fun x => Q.mu d x * Q.f x) := by have hc : ContinuousOn (fun x => Q.mu d x * Q.f x) (Icc (-1 : ℝ) 1) := (Q.mu_cont d).mul Q.f_cont have heq : (fun x => Q.mu d x * Q.f x) = (Icc (-1 : ℝ) 1).indicator (fun x => Q.mu d x * Q.f x) := by funext x by_cases hx : x ∈ Icc (-1 : ℝ) 1 · simp [hx] · simp [hx, Q.f_zero x hx] rw [heq] exact (integrable_indicator_iff measurableSet_Icc).2 hc.integrableOn_Icc
def potentialWeightedLaw

The finite measure obtained by weighting the latent law by a binary potential outcome. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
Q :
d :
potentialWeightedLaw Q d :
Q.P.withDensity (fun ω => ofReal (pot d ω))
theorem potentialWeightedLaw_map_score

The score pushforward of the potential-weighted latent law has density mu d * f. This promotes the eventwise mu_version axiom to a measure identity that can be integrated against arbitrary measurable weights. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
= volume.withDensity (fun x => ofReal (Q.mu d x * Q.f x))
Proof (Lean source)
lemma potentialWeightedLaw_map_score (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) : (potentialWeightedLaw Q d).map score = volume.withDensity (fun x => ofReal (Q.mu d x * Q.f x)) := by letI : IsProbabilityMeasure Q.P := Q.prob apply Measure.ext intro B hB have hs : Measurable score := by unfold score fun_prop rw [Measure.map_apply hs hB] unfold potentialWeightedLaw rw [withDensity_apply _ (hs hB)] rw [withDensity_apply _ hB] have hpint : Integrable (pot d) Q.P := by apply Integrable.of_bound (pot_measurable d).aestronglyMeasurable 1 exact Filter.Eventually.of_forall fun ω => by cases d · cases h : ω.2.1 <;> simp [pot, bit, h] · cases h : ω.2.2.1 <;> simp [pot, bit, h] have hgint := mu_mul_f_integrable β σ Q hQ d rw [← ofReal_integral_eq_lintegral_ofReal hpint.integrableOn (Filter.Eventually.of_forall fun ω => pot_nonneg d ω), ← ofReal_integral_eq_lintegral_ofReal hgint.integrableOn (Filter.Eventually.of_forall fun x => mu_mul_f_nonneg β σ Q hQ d x)] congr 1 have hv := Q.mu_version d B hB change (∫ ω in score ⁻¹' B, pot d ω ∂Q.P) = ∫ x in B ∩ Icc (-1 : ℝ) 1, Q.mu d x * Q.f x at hv rw [hv] symm apply setIntegral_eq_of_subset_of_forall_sdiff_eq_zero hB inter_subset_left intro x hx have hout : x ∉ Icc (-1 : ℝ) 1 := by intro hin exact hx.2 ⟨hx.1, hin⟩ rw [Q.f_zero x hout, mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.potentialWeightedLaw_map_score · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:192
theorem integral_scoreWeight_mul_pot

The eventwise conditional-mean identity integrates against every measurable real score weight. Integrability is handled by the Bochner integral convention and can be strengthened separately when needed. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
w :
ℝ → ℝ
hw :
(∫ ω, w (score ω) * pot d ω ∂Q.P) = ∫ x, w x * (Q.mu d x * Q.f x)
Proof (Lean source)
lemma integral_scoreWeight_mul_pot (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) (w : ℝ → ℝ) (hw : Measurable w) : (∫ ω, w (score ω) * pot d ω ∂Q.P) = ∫ x, w x * (Q.mu d x * Q.f x) := by have hs : Measurable score := by unfold score fun_prop have hpmeas : Measurable (fun ω => ofReal (pot d ω)) := (pot_measurable d).ennreal_ofReal have hgmeas : Measurable (fun x => ofReal (Q.mu d x * Q.f x)) := (mu_mul_f_measurable β σ Q hQ d).ennreal_ofReal calc (∫ ω, w (score ω) * pot d ω ∂Q.P) = ∫ ω, w (score ω) ∂potentialWeightedLaw Q d := by unfold potentialWeightedLaw rw [integral_withDensity_eq_integral_toReal_smul hpmeas (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top) ] apply integral_congr_ae exact Filter.Eventually.of_forall fun ω => by change w (score ω) * pot d ω = (ofReal (pot d ω)).toReal * w (score ω) rw [ENNReal.toReal_ofReal (pot_nonneg d ω)] ring _ = ∫ x, w x ∂(potentialWeightedLaw Q d).map score := by exact (integral_map hs.aemeasurable hw.aestronglyMeasurable).symm _ = ∫ x, w x ∂volume.withDensity (fun x => ofReal (Q.mu d x * Q.f x)) := by rw [potentialWeightedLaw_map_score β σ Q hQ d] _ = ∫ x, w x * (Q.mu d x * Q.f x) := by rw [integral_withDensity_eq_integral_toReal_smul hgmeas (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by change (ofReal (Q.mu d x * Q.f x)).toReal * w x = w x * (Q.mu d x * Q.f x) rw [ENNReal.toReal_ofReal (mu_mul_f_nonneg β σ Q hQ d x)] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.integral_scoreWeight_mul_pot · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:233
theorem integral_scoreWeight

The ordinary score-density identity also integrates against every measurable real weight. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
w :
ℝ → ℝ
hw :
(∫ ω, w (score ω) ∂Q.P) = ∫ x, w x * Q.f x
Proof (Lean source)
lemma integral_scoreWeight (Q : LatentLaw) (w : ℝ → ℝ) (hw : Measurable w) : (∫ ω, w (score ω) ∂Q.P) = ∫ x, w x * Q.f x := by have hs : Measurable score := by unfold score fun_prop calc (∫ ω, w (score ω) ∂Q.P) = ∫ x, w x ∂Q.P.map score := by exact (integral_map hs.aemeasurable hw.aestronglyMeasurable).symm _ = ∫ x, w x ∂volume.withDensity (fun x => ofReal (Q.f x)) := by rw [Q.density] _ = ∫ x, w x * Q.f x := by rw [integral_withDensity_eq_integral_toReal_smul (density_measurable Q).ennreal_ofReal (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] apply integral_congr_ae exact Filter.Eventually.of_forall fun x => by change (ofReal (Q.f x)).toReal * w x = w x * Q.f x rw [ENNReal.toReal_ofReal (Q.f_nonneg x)] ring
theorem score_eq_zero_null

A score law with a Lebesgue density has no atom at the cutoff. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
Q.P {ω | score ω = 0} = 0
Proof (Lean source)
lemma score_eq_zero_null (Q : LatentLaw) : Q.P {ω | score ω = 0} = 0 := by have hs : Measurable score := by unfold score fun_prop have hsingle : (volume : Measure ℝ) ({0} : Set ℝ) = 0 := measure_singleton 0 have hac := withDensity_absolutelyContinuous volume (fun x => ofReal (Q.f x)) calc Q.P {ω | score ω = 0} = Q.P (score ⁻¹' ({0} : Set ℝ)) := by rfl _ = (Q.P.map score) ({0} : Set ℝ) := (Measure.map_apply hs (s := ({0} : Set ℝ)) (measurableSet_singleton (0 : ℝ))).symm _ = (volume.withDensity (fun x => ofReal (Q.f x))) {0} := by rw [Q.density] _ = 0 := hac hsingle
theorem arm_indicator_ae_eq_reflected_Icc

Apart from the null cutoff atom, true-side assignment is exactly membership of the reflected score in [0,1]. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
d :
(fun ω => if side ω = d then (1 : ℝ) else 0)
=ᵐ[Q.P] fun ω => if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0
Proof (Lean source)
lemma arm_indicator_ae_eq_reflected_Icc (Q : LatentLaw) (d : Bool) : (fun ω => if side ω = d then (1 : ℝ) else 0) =ᵐ[Q.P] fun ω => if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 := by have hzero : ∀ᵐ ω ∂Q.P, ω ∉ {ω | score ω = 0} := (measure_eq_zero_iff_ae_notMem).1 (score_eq_zero_null Q) filter_upwards [Q.supp, hzero] with ω hsupp hne have hs0 : score ω ≠ 0 := by simpa only [Set.mem_setOf_eq, not_false_eq_true] using hne unfold side sgn cases d · change (if decide (0 ≤ score ω) = false then (1 : ℝ) else 0) = if (if false = true then 1 else -1) * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 simp only [Bool.false_eq_true, ↓reduceIte, neg_one_mul] have hcases : score ω < 0 ∨ 0 < score ω := lt_or_gt_of_ne hs0 rcases hcases with hneg | hpos · have hnside : ¬0 ≤ score ω := by linarith have href0 : 0 ≤ -score ω := by linarith have href1 : -score ω ≤ 1 := by linarith [hsupp.1] simp [hnside, href0, href1] · have hside : 0 ≤ score ω := hpos.le have hnref : ¬0 ≤ -score ω := by linarith simp [hside, hnref] · change (if decide (0 ≤ score ω) = true then (1 : ℝ) else 0) = if (if true = true then 1 else -1) * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 simp only [↓reduceIte, one_mul] by_cases h : 0 ≤ score ω · simp [h, hsupp.2] · simp [h]
CausalSmith.Stat.RdTruesideNoiseFrontier.arm_indicator_ae_eq_reflected_Icc · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:312
theorem inverseHeat_proxy_memLp_two

The inverse-heat evaluation of one observed proxy is square integrable. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
J :
ℕ
MemLp (fun o : Obs => (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ)
Proof (Lean source)
lemma inverseHeat_proxy_memLp_two (hherm : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) (J : ℕ) : MemLp (fun o : Obs => (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ) := by letI : IsProbabilityMeasure Q.P := Q.prob letI : IsProbabilityMeasure (Q.P.map latentSchedule) := Measure.isProbabilityMeasure_map latentSchedule_measurable.aemeasurable have hm : Measurable (fun ω : Latent => (latentSchedule ω, sgn d * errorCoord ω)) := latentSchedule_measurable.prodMk (signedError_measurable d) have hmp : MeasurePreserving (fun ω : Latent => (latentSchedule ω, sgn d * errorCoord ω)) Q.P ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by refine ⟨hm, ?_⟩ have hi : IndepFun latentSchedule (fun ω : Latent => sgn d * errorCoord ω) Q.P := by unfold latentSchedule simpa only [Function.comp_def] using (hQ.independent.comp (by fun_prop : Measurable (fun x : ℝ => sgn d * x)) (by fun_prop : Measurable (fun x : ℝ × Bool × Bool => x))).symm rw [hi.map_prod_eq_prod_map_map latentSchedule_measurable.aemeasurable (signedError_measurable d).aemeasurable] have he : Measurable errorCoord := by unfold errorCoord fun_prop cases d with | false => rw [show (fun ω : Latent => sgn false * errorCoord ω) = (fun x : ℝ => -x) ∘ errorCoord by funext ω; simp [sgn] ] rw [← Measure.map_map (by fun_prop : Measurable (fun x : ℝ => -x)) he, show Q.P.map errorCoord = gaussianReal 0 1 from hQ.gaussian, gaussianReal_map_neg] norm_num | true => rw [show Q.P.map (fun ω => sgn true * errorCoord ω) = gaussianReal 0 1 by simpa [sgn, GaussianError] using hQ.gaussian] have hlatent := (inverseHeat_schedule_gaussian_memLp_two hherm Q d J σ).comp_measurePreserving hmp have hobs : AEStronglyMeasurable (fun o : Obs => (inverseHeat J σ).eval (sgn d * o.1)) (Pobs Q σ) := by fun_prop apply (memLp_map_measure_iff hobs (obs_measurable σ).aemeasurable).2 change MemLp (fun ω : Latent => (inverseHeat J σ).eval (sgn d * proxy σ ω)) 2 Q.P convert hlatent using 1 funext ω exact congrArg (inverseHeat J σ).eval (sgn_mul_proxy d σ ω)
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat_proxy_memLp_two · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:342
theorem observed_arm_summands_memLp_two

Both arm-weighted observed summands inherit square integrability from the unweighted inverse-heat proxy. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
J :
ℕ
conclusion 1
MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ)
conclusion 2
MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ)
Proof (Lean source)
lemma observed_arm_summands_memLp_two (hherm : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) (J : ℕ) : MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ) ∧ MemLp (fun o : Obs => (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ) := by have hbase := inverseHeat_proxy_memLp_two hherm β σ Q hQ d J have hiMeas : Measurable (fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) := by exact measurable_const.ite ((measurableSet_singleton d).preimage measurable_snd.fst) measurable_const have hbMeas : Measurable (fun o : Obs => bit o.2.2) := by exact (measurable_of_countable bit).comp measurable_snd.snd have hiTop : MemLp (fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) ⊤ (Pobs Q σ) := by apply memLp_top_of_bound hiMeas.aestronglyMeasurable 1 exact Filter.Eventually.of_forall fun o => by split_ifs <;> norm_num have hibTop : MemLp (fun o : Obs => (if o.2.1 = d then (1 : ℝ) else 0) * bit o.2.2) ⊤ (Pobs Q σ) := by apply memLp_top_of_bound (hiMeas.mul hbMeas).aestronglyMeasurable 1 exact Filter.Eventually.of_forall fun o => by cases h : o.2.2 <;> simp [bit, h] <;> split_ifs <;> norm_num constructor · change MemLp ((fun o : Obs => (if o.2.1 = d then (1 : ℝ) else 0) * bit o.2.2) * fun o => (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ) exact hbase.mul hibTop · change MemLp ((fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) * fun o => (inverseHeat J σ).eval (sgn d * o.1)) 2 (Pobs Q σ) exact hbase.mul hiTop
CausalSmith.Stat.RdTruesideNoiseFrontier.observed_arm_summands_memLp_two · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:391
theorem signedError_map_eq_gaussian

Reflection into either treatment arm preserves the standard Gaussian error marginal. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Q :
hQ :
d :
Q.P.map (fun ω => sgn d * errorCoord ω) = gaussianReal 0 1
Proof (Lean source)
lemma signedError_map_eq_gaussian (Q : LatentLaw) (hQ : GaussianError Q) (d : Bool) : Q.P.map (fun ω => sgn d * errorCoord ω) = gaussianReal 0 1 := by have he : Measurable errorCoord := by unfold errorCoord fun_prop cases d with | false => rw [show (fun ω : Latent => sgn false * errorCoord ω) = (fun x : ℝ => -x) ∘ errorCoord by funext ω; simp [sgn] ] rw [← Measure.map_map (by fun_prop : Measurable (fun x : ℝ => -x)) he, show Q.P.map errorCoord = gaussianReal 0 1 from hQ, gaussianReal_map_neg] norm_num | true => simpa [sgn, GaussianError] using hQ
CausalSmith.Stat.RdTruesideNoiseFrontier.signedError_map_eq_gaussian · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:423
theorem latentSchedule_signedError_jointLaw

The same factorization with the schedule first, convenient for applying the Gaussian covariance identities as inner integrals. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
Q.P.map (fun ω => (latentSchedule ω, sgn d * errorCoord ω))
= (Q.P.map latentSchedule).prod (gaussianReal 0 1)
Proof (Lean source)
lemma latentSchedule_signedError_jointLaw (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) : Q.P.map (fun ω => (latentSchedule ω, sgn d * errorCoord ω)) = (Q.P.map latentSchedule).prod (gaussianReal 0 1) := by letI : IsProbabilityMeasure Q.P := Q.prob have hi : IndepFun latentSchedule (fun ω : Latent => sgn d * errorCoord ω) Q.P := by exact (by unfold latentSchedule simpa only [Function.comp_def] using (hQ.independent.comp (by fun_prop : Measurable (fun x : ℝ => sgn d * x)) (by fun_prop : Measurable (fun x : ℝ × Bool × Bool => x))).symm) rw [hi.map_prod_eq_prod_map_map latentSchedule_measurable.aemeasurable (signedError_measurable d).aemeasurable] rw [signedError_map_eq_gaussian Q hQ.gaussian d]
CausalSmith.Stat.RdTruesideNoiseFrontier.latentSchedule_signedError_jointLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:442
theorem integral_latentSchedule_signedError

Schedule-first Fubini reduction, matching the shape of exact_covariance. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
d :
H :
(ℝ × Bool × Bool) × ℝ → ℝ
hH :
(∫ ω, H (latentSchedule ω, sgn d * errorCoord ω) ∂Q.P)
= ∫ s, ∫ z, H (s, z) ∂gaussianReal 0 1 ∂Q.P.map latentSchedule
Proof (Lean source)
lemma integral_latentSchedule_signedError (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (d : Bool) (H : (ℝ × Bool × Bool) × ℝ → ℝ) (hH : Integrable H ((Q.P.map latentSchedule).prod (gaussianReal 0 1))) : (∫ ω, H (latentSchedule ω, sgn d * errorCoord ω) ∂Q.P) = ∫ s, ∫ z, H (s, z) ∂gaussianReal 0 1 ∂Q.P.map latentSchedule := by letI : IsProbabilityMeasure Q.P := Q.prob have hm : Measurable (fun ω : Latent => (latentSchedule ω, sgn d * errorCoord ω)) := latentSchedule_measurable.prodMk (signedError_measurable d) have hj := latentSchedule_signedError_jointLaw β σ Q hQ d have hHmap : Integrable H (Q.P.map (fun ω => (latentSchedule ω, sgn d * errorCoord ω))) := by rw [hj] exact hH rw [← integral_map hm.aemeasurable hHmap.aestronglyMeasurable] rw [hj] exact integral_prod H hH
CausalSmith.Stat.RdTruesideNoiseFrontier.integral_latentSchedule_signedError · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:461
theorem reflected_Icc_integral

Reflection sends either arm's compact score half to the common endpoint interval, with the cutoff discrepancy already absorbed by Lebesgue nullity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
g :
ℝ → ℝ
(∫ x, (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g (sgn d * x))
= ∫ x in (0 : ℝ)..1, g x
Proof (Lean source)
lemma reflected_Icc_integral (d : Bool) (g : ℝ → ℝ) : (∫ x, (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g (sgn d * x)) = ∫ x in (0 : ℝ)..1, g x := by have hset : (∫ x in Icc (0 : ℝ) 1, g x) = ∫ x in (0 : ℝ)..1, g x := by rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num)] cases d · have href := integral_neg_eq_self (fun x : ℝ => (if x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g x) volume rw [show (fun x : ℝ => (if sgn false * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g (sgn false * x)) = (fun x : ℝ => (if x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g x) ∘ fun x => -x by funext x; simp [sgn]] change (∫ x : ℝ, (if -x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g (-x)) = _ rw [href] rw [show (fun x : ℝ => (if x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g x) = (Icc (0 : ℝ) 1).indicator g by funext x; by_cases hx : x ∈ Icc (0 : ℝ) 1 <;> simp [hx]] rw [integral_indicator measurableSet_Icc, hset] · simp only [sgn, ↓reduceIte, one_mul] rw [show (fun x : ℝ => (if x ∈ Icc (0 : ℝ) 1 then 1 else 0) * g x) = (Icc (0 : ℝ) 1).indicator g by funext x; by_cases hx : x ∈ Icc (0 : ℝ) 1 <;> simp [hx]] rw [integral_indicator measurableSet_Icc, hset]
CausalSmith.Stat.RdTruesideNoiseFrontier.reflected_Icc_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:481
theorem unmarked_observed_integral_eq_endpoint

Exact FC.1 population identity for the unmarked arm summand. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
hσ :
σ ∈ Icc (0 : ℝ) 1
J :
ℕ
hJ :
1 ≤ J
d :
(∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ)
= ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x)
Proof (Lean source)
lemma unmarked_observed_integral_eq_endpoint (legendre : ClassicalLegendreFacts) (hermite : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (hσ : σ ∈ Icc (0 : ℝ) 1) (J : ℕ) (hJ : 1 ≤ J) (d : Bool) : (∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ) = ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x) := by obtain ⟨C, hC, hall⟩ := exact_covariance have hcov := (hall J hJ σ hσ).1 let I : (ℝ × Bool × Bool) → ℝ := fun s => if decide (0 ≤ s.1) = d then 1 else 0 let H : (ℝ × Bool × Bool) × ℝ → ℝ := fun sz => I sz.1 * (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2) letI : IsProbabilityMeasure Q.P := Q.prob letI : IsProbabilityMeasure (Q.P.map latentSchedule) := Measure.isProbabilityMeasure_map latentSchedule_measurable.aemeasurable have hImeas : Measurable I := by dsimp [I] have hs : Measurable (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) := by have hset : MeasurableSet {s : ℝ × Bool × Bool | 0 ≤ s.1} := measurableSet_le measurable_const measurable_fst have heq : (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) = fun s => if 0 ≤ s.1 then true else false := by funext s by_cases h : 0 ≤ s.1 <;> simp [h] rw [heq] exact measurable_const.ite hset measurable_const exact measurable_const.ite ((measurableSet_singleton d).preimage hs) measurable_const have hITop : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1) ⊤ ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by apply memLp_top_of_bound (hImeas.comp measurable_fst).aestronglyMeasurable 1 exact Filter.Eventually.of_forall fun sz => by dsimp [I]; split_ifs <;> norm_num have hHLp : MemLp H 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by have hb := inverseHeat_schedule_gaussian_memLp_two hermite Q d J σ change MemLp ((fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1) * fun sz => (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2)) 2 _ exact hb.mul hITop have hHintegrable : Integrable H ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := hHLp.integrable (by norm_num) have hpull : (∫ o : Obs, (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ) = ∫ ω, H (latentSchedule ω, sgn d * errorCoord ω) ∂Q.P := by rw [integral_Pobs_eq_integral_obs_comp] · apply integral_congr_ae exact Filter.Eventually.of_forall fun ω => by dsimp [H, I, obs, latentSchedule] rw [sgn_mul_proxy] rfl · have hiobs : Measurable (fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) := measurable_const.ite ((measurableSet_singleton d).preimage measurable_snd.fst) measurable_const have hpoly : Measurable (fun o : Obs => (inverseHeat J σ).eval (sgn d * o.1)) := by fun_prop exact (hiobs.mul hpoly).aestronglyMeasurable rw [hpull, integral_latentSchedule_signedError β σ Q hQ d H hHintegrable] have hinner (s : ℝ × Bool × Bool) : (∫ z, H (s, z) ∂gaussianReal 0 1) = I s * (endpointKernel J).eval (sgn d * s.1) := by dsimp [H] rw [integral_const_mul, (hcov (sgn d * s.1)).1] simp_rw [hinner] rw [integral_map latentSchedule_measurable.aemeasurable (by fun_prop)] have harmint : (∫ ω, I (latentSchedule ω) * (endpointKernel J).eval (sgn d * (latentSchedule ω).1) ∂Q.P) = ∫ ω, (if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * score ω) ∂Q.P := by apply integral_congr_ae filter_upwards [arm_indicator_ae_eq_reflected_Icc Q d] with ω harm dsimp [I, latentSchedule] rw [show (if decide (0 ≤ score ω) = d then (1 : ℝ) else 0) = if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 by change (if side ω = d then (1 : ℝ) else 0) = _ exact harm] rw [harmint] have hwmeas : Measurable (fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * x)) := by have hs : MeasurableSet {x : ℝ | sgn d * x ∈ Icc (0 : ℝ) 1} := measurableSet_Icc.preimage (by fun_prop) exact (measurable_const.ite hs measurable_const).mul (by fun_prop) rw [integral_scoreWeight Q (fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * x)) hwmeas] rw [show (fun x => ((if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * x)) * Q.f x) = fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * ((endpointKernel J).eval (sgn d * x) * Q.f x) by funext x; ring] cases d · simpa [sgn, mul_assoc] using reflected_Icc_integral false (fun x => (endpointKernel J).eval x * Q.f (sgn false * x)) · simpa [sgn, mul_assoc] using reflected_Icc_integral true (fun x => (endpointKernel J).eval x * Q.f (sgn true * x))
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarked_observed_integral_eq_endpoint · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:505
theorem marked_observed_integral_eq_endpoint

Exact FC.1 population identity for the marked arm summand. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
hσ :
σ ∈ Icc (0 : ℝ) 1
J :
ℕ
hJ :
1 ≤ J
d :
(∫ o : Obs, (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ)
= ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x) * Q.mu d (sgn d * x)
Proof (Lean source)
lemma marked_observed_integral_eq_endpoint (legendre : ClassicalLegendreFacts) (hermite : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (hσ : σ ∈ Icc (0 : ℝ) 1) (J : ℕ) (hJ : 1 ≤ J) (d : Bool) : (∫ o : Obs, (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ) = ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x) * Q.mu d (sgn d * x) := by obtain ⟨C, hC, hall⟩ := exact_covariance have hcov := (hall J hJ σ hσ).1 let I : (ℝ × Bool × Bool) → ℝ := fun s => if decide (0 ≤ s.1) = d then 1 else 0 let M : (ℝ × Bool × Bool) → ℝ := fun s => bit (if d then s.2.2 else s.2.1) let H : (ℝ × Bool × Bool) × ℝ → ℝ := fun sz => I sz.1 * M sz.1 * (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2) letI : IsProbabilityMeasure Q.P := Q.prob letI : IsProbabilityMeasure (Q.P.map latentSchedule) := Measure.isProbabilityMeasure_map latentSchedule_measurable.aemeasurable have hImeas : Measurable I := by dsimp [I] have hs : Measurable (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) := by have hset : MeasurableSet {s : ℝ × Bool × Bool | 0 ≤ s.1} := measurableSet_le measurable_const measurable_fst have heq : (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) = fun s => if 0 ≤ s.1 then true else false := by funext s; by_cases h : 0 ≤ s.1 <;> simp [h] rw [heq] exact measurable_const.ite hset measurable_const exact measurable_const.ite ((measurableSet_singleton d).preimage hs) measurable_const have hMmeas : Measurable M := by dsimp [M] exact (measurable_of_countable bit).comp (measurable_snd.snd.ite (by simp) measurable_snd.fst) have hIMTop : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1 * M sz.1) ⊤ ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by apply memLp_top_of_bound (((hImeas.mul hMmeas).comp measurable_fst).aestronglyMeasurable) 1 exact Filter.Eventually.of_forall fun sz => by dsimp [I, M]; cases d <;> cases h : sz.1.2.1 <;> cases k : sz.1.2.2 <;> simp [bit, h, k] <;> split_ifs <;> norm_num have hHLp : MemLp H 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by have hb := inverseHeat_schedule_gaussian_memLp_two hermite Q d J σ change MemLp ((fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1 * M sz.1) * fun sz => (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2)) 2 _ exact hb.mul hIMTop have hHint : Integrable H ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := hHLp.integrable (by norm_num) have hpull : (∫ o : Obs, (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1) ∂Pobs Q σ) = ∫ ω, H (latentSchedule ω, sgn d * errorCoord ω) ∂Q.P := by rw [integral_Pobs_eq_integral_obs_comp] · apply integral_congr_ae exact Filter.Eventually.of_forall fun ω => by dsimp [H, I, M, obs, latentSchedule] rw [sgn_mul_proxy] calc (if side ω = d then 1 else 0) * bit (outcome ω) * (inverseHeat J σ).eval (sgn d * score ω + σ * (sgn d * errorCoord ω)) = ((if side ω = d then 1 else 0) * bit (outcome ω)) * (inverseHeat J σ).eval (sgn d * score ω + σ * (sgn d * errorCoord ω)) := by ring _ = ((if side ω = d then 1 else 0) * pot d ω) * (inverseHeat J σ).eval (sgn d * score ω + σ * (sgn d * errorCoord ω)) := by rw [arm_indicator_outcome_eq_pot] _ = _ := by rfl · have hiobs : Measurable (fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) := measurable_const.ite ((measurableSet_singleton d).preimage measurable_snd.fst) measurable_const exact ((hiobs.mul ((measurable_of_countable bit).comp measurable_snd.snd)).mul (by fun_prop)).aestronglyMeasurable rw [hpull, integral_latentSchedule_signedError β σ Q hQ d H hHint] have hinner (s : ℝ × Bool × Bool) : (∫ z, H (s,z) ∂gaussianReal 0 1) = I s * M s * (endpointKernel J).eval (sgn d * s.1) := by dsimp [H] change (∫ z, (I s * M s) * (inverseHeat J σ).eval (sgn d * s.1 + σ * z) ∂gaussianReal 0 1) = _ rw [integral_const_mul, (hcov (sgn d * s.1)).1] simp_rw [hinner] rw [integral_map latentSchedule_measurable.aemeasurable (by fun_prop)] have harmint : (∫ ω, I (latentSchedule ω) * M (latentSchedule ω) * (endpointKernel J).eval (sgn d * (latentSchedule ω).1) ∂Q.P) = ∫ ω, ((if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * score ω)) * pot d ω ∂Q.P := by apply integral_congr_ae filter_upwards [arm_indicator_ae_eq_reflected_Icc Q d] with ω harm dsimp [I, M, latentSchedule] rw [show (if decide (0 ≤ score ω) = d then (1 : ℝ) else 0) = if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 by change (if side ω = d then (1 : ℝ) else 0) = _; exact harm] unfold pot ring rw [harmint] have hwmeas : Measurable (fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * x)) := by exact (measurable_const.ite (measurableSet_Icc.preimage (by fun_prop)) measurable_const).mul (by fun_prop) rw [integral_scoreWeight_mul_pot β σ Q hQ d _ hwmeas] rw [show (fun x => ((if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (endpointKernel J).eval (sgn d * x)) * (Q.mu d x * Q.f x)) = fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * ((endpointKernel J).eval (sgn d * x) * (Q.f x * Q.mu d x)) by funext x; ring] cases d · simpa [sgn, mul_assoc, mul_comm, mul_left_comm] using reflected_Icc_integral false (fun x => (endpointKernel J).eval x * (Q.f (sgn false * x) * Q.mu false (sgn false * x))) · simpa [sgn, mul_assoc, mul_comm, mul_left_comm] using reflected_Icc_integral true (fun x => (endpointKernel J).eval x * (Q.f (sgn true * x) * Q.mu true (sgn true * x)))
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_observed_integral_eq_endpoint · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationBridge.lean:601
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.EmpiricalPopulationMoments 7 declarations
def inverseHeatSquareSeries

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
J :
ℕ
σ x :
ℝ
inverseHeatSquareSeries J σ x :
ℝ
∑ j ∈ range (kernelDegree J + 1), σ ^ (2 * j) * ((polyDeriv j (endpointKernel J)).eval x) ^ 2 / (Nat.factorial j : ℝ)
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeatSquareSeries · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:11
theorem inverseHeatSquareSeries_continuous

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
J :
ℕ
σ :
ℝ
Proof (Lean source)
lemma inverseHeatSquareSeries_continuous (J : ℕ) (σ : ℝ) : Continuous (inverseHeatSquareSeries J σ) := by unfold inverseHeatSquareSeries fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeatSquareSeries_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:18
theorem inverseHeatSquareSeries_nonneg

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
J :
ℕ
σ x :
ℝ
Proof (Lean source)
lemma inverseHeatSquareSeries_nonneg (J : ℕ) (σ x : ℝ) : 0 ≤ inverseHeatSquareSeries J σ x := by unfold inverseHeatSquareSeries apply Finset.sum_nonneg intro j hj apply div_nonneg · apply mul_nonneg · rw [show 2 * j = j * 2 by omega, pow_mul] positivity · positivity · positivity
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeatSquareSeries_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:24
theorem unmarked_observed_sq_eq_interval

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
hσ :
σ ∈ Icc (0 : ℝ) 1
J :
ℕ
hJ :
1 ≤ J
d :
(∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ)
= ∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x * Q.f (sgn d * x)
Proof (Lean source)
lemma unmarked_observed_sq_eq_interval (legendre : ClassicalLegendreFacts) (hermite : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (hσ : σ ∈ Icc (0 : ℝ) 1) (J : ℕ) (hJ : 1 ≤ J) (d : Bool) : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ) = ∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x * Q.f (sgn d * x) := by obtain ⟨C, hC, hall⟩ := exact_covariance have hcov := (hall J hJ σ hσ).1 let I : (ℝ × Bool × Bool) → ℝ := fun s => if decide (0 ≤ s.1) = d then 1 else 0 let K : (ℝ × Bool × Bool) × ℝ → ℝ := fun sz => I sz.1 * (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2) let H : (ℝ × Bool × Bool) × ℝ → ℝ := fun sz => (K sz) ^ 2 letI : IsProbabilityMeasure Q.P := Q.prob letI : IsProbabilityMeasure (Q.P.map latentSchedule) := Measure.isProbabilityMeasure_map latentSchedule_measurable.aemeasurable have hImeas : Measurable I := by dsimp [I] have hs : Measurable (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) := by have hset : MeasurableSet {s : ℝ × Bool × Bool | 0 ≤ s.1} := measurableSet_le measurable_const measurable_fst have heq : (fun s : ℝ × Bool × Bool => decide (0 ≤ s.1)) = fun s => if 0 ≤ s.1 then true else false := by funext s; by_cases h : 0 ≤ s.1 <;> simp [h] rw [heq] exact measurable_const.ite hset measurable_const exact measurable_const.ite ((measurableSet_singleton d).preimage hs) measurable_const have hITop : MemLp (fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1) ⊤ ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by apply memLp_top_of_bound (hImeas.comp measurable_fst).aestronglyMeasurable 1 exact Filter.Eventually.of_forall fun sz => by dsimp [I]; split_ifs <;> norm_num have hKLp : MemLp K 2 ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := by have hb := inverseHeat_schedule_gaussian_memLp_two hermite Q d J σ change MemLp ((fun sz : (ℝ × Bool × Bool) × ℝ => I sz.1) * fun sz => (inverseHeat J σ).eval (sgn d * sz.1.1 + σ * sz.2)) 2 _ exact hb.mul hITop have hHint : Integrable H ((Q.P.map latentSchedule).prod (gaussianReal 0 1)) := hKLp.integrable_sq have hpull : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ) = ∫ ω, H (latentSchedule ω, sgn d * errorCoord ω) ∂Q.P := by rw [integral_Pobs_eq_integral_obs_comp] · apply integral_congr_ae exact Filter.Eventually.of_forall fun ω => by dsimp [H, K, I, obs, latentSchedule] rw [sgn_mul_proxy] rw [latentSchedule_fst] change ((if side ω = d then (1 : ℝ) else 0) * _) ^ 2 = ((if decide (0 ≤ score ω) = d then (1 : ℝ) else 0) * _) ^ 2 rfl · have hiobs : Measurable (fun o : Obs => if o.2.1 = d then (1 : ℝ) else 0) := measurable_const.ite ((measurableSet_singleton d).preimage measurable_snd.fst) measurable_const exact ((hiobs.mul (by fun_prop)).pow_const 2).aestronglyMeasurable rw [hpull, integral_latentSchedule_signedError β σ Q hQ d H hHint] have hinner (s : ℝ × Bool × Bool) : (∫ z, H (s,z) ∂gaussianReal 0 1) = I s * inverseHeatSquareSeries J σ (sgn d * s.1) := by dsimp [H, K] have hI : I s = 0 ∨ I s = 1 := by dsimp [I]; split_ifs <;> simp rcases hI with hI | hI · simp [hI] · simp [hI, inverseHeatSquareSeries, (hcov (sgn d * s.1)).2] simp_rw [hinner] have houtmeas : AEStronglyMeasurable (fun s => I s * inverseHeatSquareSeries J σ (sgn d * s.1)) (Q.P.map latentSchedule) := (hImeas.mul ((inverseHeatSquareSeries_continuous J σ).measurable.comp (by fun_prop))).aestronglyMeasurable rw [integral_map latentSchedule_measurable.aemeasurable houtmeas] have harmint : (∫ ω, I (latentSchedule ω) * inverseHeatSquareSeries J σ (sgn d * (latentSchedule ω).1) ∂Q.P) = ∫ ω, (if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0) * inverseHeatSquareSeries J σ (sgn d * score ω) ∂Q.P := by apply integral_congr_ae filter_upwards [arm_indicator_ae_eq_reflected_Icc Q d] with ω harm simp only [I, latentSchedule_fst] change (if decide (0 ≤ score ω) = d then (1 : ℝ) else 0) * _ = _ rw [show (if decide (0 ≤ score ω) = d then (1 : ℝ) else 0) = if sgn d * score ω ∈ Icc (0 : ℝ) 1 then 1 else 0 by change (if side ω = d then (1 : ℝ) else 0) = _; exact harm] rw [harmint] have hw : Measurable (fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * inverseHeatSquareSeries J σ (sgn d * x)) := by exact (measurable_const.ite (measurableSet_Icc.preimage (by fun_prop)) measurable_const).mul ((inverseHeatSquareSeries_continuous J σ).measurable.comp (by fun_prop)) rw [integral_scoreWeight Q _ hw] rw [show (fun x => ((if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * inverseHeatSquareSeries J σ (sgn d * x)) * Q.f x) = fun x => (if sgn d * x ∈ Icc (0 : ℝ) 1 then 1 else 0) * (inverseHeatSquareSeries J σ (sgn d * x) * Q.f x) by funext x; ring] cases d · simpa [sgn, mul_assoc] using reflected_Icc_integral false (fun x => inverseHeatSquareSeries J σ x * Q.f (sgn false * x)) · simpa [sgn, mul_assoc] using reflected_Icc_integral true (fun x => inverseHeatSquareSeries J σ x * Q.f (sgn true * x))
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarked_observed_sq_eq_interval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:37
theorem inverseHeatSquareSeries_interval

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
J :
ℕ
σ :
ℝ
(3 / 4 : ℝ) * (∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x) = kernelVariance J σ
Proof (Lean source)
lemma inverseHeatSquareSeries_interval (J : ℕ) (σ : ℝ) : (3 / 4 : ℝ) * (∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x) = kernelVariance J σ := by unfold inverseHeatSquareSeries kernelVariance rw [intervalIntegral.integral_finsetSum] · congr 1 apply Finset.sum_congr rfl intro j hj simp_rw [show ∀ x : ℝ, σ ^ (2 * j) * ((polyDeriv j (endpointKernel J)).eval x) ^ 2 / (Nat.factorial j : ℝ) = (σ ^ (2 * j) / (Nat.factorial j : ℝ)) * ((polyDeriv j (endpointKernel J)).eval x) ^ 2 by intro x; ring] rw [intervalIntegral.integral_const_mul] · intro j hj exact (by fun_prop : Continuous (fun x : ℝ => σ ^ (2 * j) * ((polyDeriv j (endpointKernel J)).eval x) ^ 2 / (Nat.factorial j : ℝ))).intervalIntegrable (0 : ℝ) 1
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeatSquareSeries_interval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:135
theorem unmarked_observed_sq_le_kernelVariance

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
hσ :
σ ∈ Icc (0 : ℝ) 1
J :
ℕ
hJ :
1 ≤ J
d :
(∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ)
Proof (Lean source)
lemma unmarked_observed_sq_le_kernelVariance (legendre : ClassicalLegendreFacts) (hermite : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (hσ : σ ∈ Icc (0 : ℝ) 1) (J : ℕ) (hJ : 1 ≤ J) (d : Bool) : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ) ≤ kernelVariance J σ := by rw [unmarked_observed_sq_eq_interval legendre hermite β σ Q hQ hσ J hJ d] calc (∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x * Q.f (sgn d * x)) ≤ ∫ x in (0 : ℝ)..1, (3 / 4 : ℝ) * inverseHeatSquareSeries J σ x := by apply intervalIntegral.integral_mono_on (by norm_num) · have hc : ContinuousOn (fun u : ℝ => inverseHeatSquareSeries J σ u * Q.f (sgn d * u)) (Icc (0 : ℝ) 1) := (inverseHeatSquareSeries_continuous J σ).continuousOn.mul (continuousOn_arm_reflection d Q.f Q.f_cont) exact (hc.mono (by simpa [uIcc_of_le (by norm_num : (0 : ℝ) ≤ 1)])).intervalIntegrable · exact ((inverseHeatSquareSeries_continuous J σ).const_mul (3 / 4 : ℝ)).intervalIntegrable (0 : ℝ) 1 · intro x hx have hf := (hQ.density (sgn d * x) (arm_reflection_mem d hx)).2 have hs := inverseHeatSquareSeries_nonneg J σ x nlinarith _ = (3 / 4 : ℝ) * (∫ x in (0 : ℝ)..1, inverseHeatSquareSeries J σ x) := by rw [intervalIntegral.integral_const_mul] _ = kernelVariance J σ := inverseHeatSquareSeries_interval J σ
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarked_observed_sq_le_kernelVariance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:155
theorem marked_observed_sq_le_kernelVariance

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
Q :
hQ :
Model β σ Q
hσ :
σ ∈ Icc (0 : ℝ) 1
J :
ℕ
hJ :
1 ≤ J
d :
(∫ o : Obs, ((if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ)
Proof (Lean source)
lemma marked_observed_sq_le_kernelVariance (legendre : ClassicalLegendreFacts) (hermite : ClassicalHermiteFacts) (β σ : ℝ) (Q : LatentLaw) (hQ : Model β σ Q) (hσ : σ ∈ Icc (0 : ℝ) 1) (J : ℕ) (hJ : 1 ≤ J) (d : Bool) : (∫ o : Obs, ((if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1)) ^ 2 ∂Pobs Q σ) ≤ kernelVariance J σ := by have hm := observed_arm_summands_memLp_two hermite β σ Q hQ d J apply (integral_mono hm.1.integrable_sq hm.2.integrable_sq ?_).trans (unmarked_observed_sq_le_kernelVariance legendre hermite β σ Q hQ hσ J hJ d) intro o cases h : o.2.2 <;> simp [bit, h] <;> positivity
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_observed_sq_le_kernelVariance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/EmpiricalPopulationMoments.lean:184
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.FrontierComparison 2 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

Matched minimax chains and honesty, retaining extended expectations of the observable procedures. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ c C :
ℝ
MatchedFrontier β n σ c C :
Prop
clause 1
c * frontierRate β n σ ≤ risk β n σ
clause 2
ofReal (risk β n σ) ≤ attainerRisk β n σ
clause 3
attainerRisk β n σ ≤ ofReal (certificate β n σ)
clause 4
certificate β n σ ≤ C * frontierRate β n σ
clause 5
c * frontierRate β n σ ≤ lengthRisk β n σ
clause 6
ofReal (lengthRisk β n σ) ≤ attainerLength β n σ
clause 7
attainerLength β n σ ≤ ofReal (2 * certificate β n σ)
clause 8
2 * certificate β n σ ≤ C * frontierRate β n σ
clause 9
honestAttainer β n σ ∈ honestIntervals β n σ
theorem matched_frontier

Constructed upper procedures and all-procedure lower witnesses give the matched minimax chains. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
hermite_of_gate :
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ c C : ℝ,
0 < c
0 < C
conclusion 1
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
MatchedFrontier β n σ c C
Proof (Lean source)
lemma matched_frontier (legendre_of_gate : ClassicalLegendreFacts) (hermite_of_gate : ClassicalHermiteFacts) (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, MatchedFrontier β n σ c C := by obtain ⟨c, hc, hlower⟩ := frontierRate_lower_bounds legendre_of_gate hermite_of_gate β hβ obtain ⟨C, hC, hupper⟩ := certificate_le_frontierRate legendre_of_gate hermite_of_gate β hβ refine ⟨c, 2 * C, hc, by positivity, ?_⟩ intro n hn σ hσ have hl := hlower n hn σ hσ exact matchedFrontier_of_scalar_bounds legendre_of_gate hermite_of_gate β n σ c C hβ hn hσ hc.le hC.le hl.1 hl.2 (hupper n hn σ hσ)
CausalSmith.Stat.RdTruesideNoiseFrontier.matched_frontier · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierComparison.lean:89
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.FrontierRoot 2 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

The constructed resolution is a root in the declared interval and is its only root there. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ c C :
ℝ
FrontierBranches β n σ c C :
Prop
clause 1
σ ≤ directResolution β n
clause 2
rateResolution β n σ < σ
IntermediateCondition β n σ ↔ σ^4 ≤ rateResolution β n σ
∃ z : ℝ,
1 < z
z ≤ σ ^ (-2 : ℝ)
rateResolution β n σ = σ * z ^ (-3/2 : ℝ)
z' :
ℝ
1 < z'
z' ≤ σ ^ (-2 : ℝ)
z' = z
c * (σ / (1 + log ((n : ℝ) * σ^(2*β+1)))^(3/2 : ℝ)) ≤ rateResolution β n σ
rateResolution β n σ ≤ C * (σ / (1 + log ((n : ℝ) * σ^(2*β+1)))^(3/2 : ℝ))
∃ τ : ℝ,
σ ^ (-2 : ℝ) < τ
CompactEquation β n σ τ
rateResolution β n σ = τ ^ (-2 : ℝ)
τ' :
ℝ
σ ^ (-2 : ℝ) < τ'
CompactEquation β n σ τ'
τ' = τ
c * ((1 + log n) / log (exp 1 + σ^2 * (1 + log n))) ≤ τ
τ ≤ C * ((1 + log n) / log (exp 1 + σ^2 * (1 + log n)))
c * (log (exp 1 + σ^2 * (1 + log n)) / (1 + log n))^(2*β)
≤ frontierRate β n σ
frontierRate β n σ
≤ C * (log (exp 1 + σ^2 * (1 + log n)) / (1 + log n))^(2*β)
clause 3
0 < σ
log ((n : ℝ) * σ^(4*(2*β+1))) = σ ^ (-2 : ℝ) - 1
rateResolution β n σ = σ^4
IntermediateEquation β n σ (σ ^ (-2 : ℝ))
CompactEquation β n σ (σ ^ (-2 : ℝ))
clause 4
CausalSmith.Stat.RdTruesideNoiseFrontier.FrontierBranches · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierRoot.lean:22
theorem frontier_branches

The scalar branch formulas and both interfaces have constants uniform in sample size and noise. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ c C : ℝ,
0 < c
0 < C
conclusion 1
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
FrontierBranches β n σ c C
Proof (Lean source)
lemma frontier_branches (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, FrontierBranches β n σ c C := by let A := (1 + 3 * (2 * β + 1) / 2) ^ (3 / 2 : ℝ) let ct := 1 / (2 * (1 + 2 * (2 * β + 1))) let Ct := exp 1 + 6 let cr := Ct ^ (-2 * β) let Cr := ct ^ (-2 * β) let c := min 1 (min ct cr) let C := max A (max Ct Cr) have hct : 0 < ct := by dsimp [ct] apply one_div_pos.mpr nlinarith [hβ.1] have hCt : 0 < Ct := by dsimp [Ct]; positivity have hcr : 0 < cr := Real.rpow_pos_of_pos hCt _ have hCr : 0 < Cr := Real.rpow_pos_of_pos hct _ have hA : 0 < A := by dsimp [A] apply Real.rpow_pos_of_pos nlinarith [hβ.1] have hc : 0 < c := by dsimp [c]; positivity have hC : 0 < C := by dsimp [C]; positivity refine ⟨c, C, hc, hC, ?_⟩ intro n hn σ hσ have hd := directResolution_pos_le_one β n hβ hn have hnR : (1 : ℝ) < n := by exact_mod_cast (show 1 < n by omega) have hB : 0 < 1 + log n := by linarith [Real.log_pos hnR] have hD : 0 < log (exp 1 + σ ^ 2 * (1 + log n)) := by apply Real.log_pos have hexp : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have : 0 ≤ σ ^ 2 * (1 + log n) := mul_nonneg (sq_nonneg σ) hB.le linarith unfold FrontierBranches refine ⟨?_, ?_, ?_, ?_⟩ · intro hs exact rateResolution_eq_direct_of_le β n σ hβ hn hσ hs · intro hnoisy have hspos : 0 < σ := hd.1.trans hnoisy have hi := noisy_rateResolution_interior β n σ hβ hn hσ hnoisy refine ⟨hi.1, hi.2, intermediateCondition_iff β n σ hβ hn hσ hnoisy, ?_, ?_⟩ · intro hinter obtain ⟨z, hz1, hzup, hzeq, hres, hu⟩ := intermediate_branch_representation β n σ hβ hn hσ hnoisy hinter have hb := intermediate_branch_bounds β n σ hβ hn hσ hnoisy hinter let S := 1 + log ((n : ℝ) * σ ^ (2 * β + 1)) have hk : 0 < 3 * (2 * β + 1) / 2 := by nlinarith [hβ.1] have hS : 0 < S := by unfold IntermediateEquation at hzeq dsimp [S] have := Real.log_pos hz1 nlinarith have hproxy : 0 ≤ σ / S ^ (3 / 2 : ℝ) := (div_pos hspos (Real.rpow_pos_of_pos hS _)).le have hc1 : c ≤ 1 := by dsimp [c]; exact min_le_left _ _ have hAC : A ≤ C := by dsimp [C]; exact le_max_left _ _ refine ⟨z, hz1, hzup, hzeq, hres, hu, ?_, ?_⟩ · exact (mul_le_mul_of_nonneg_right hc1 hproxy).trans (by simpa [S] using hb.1) · exact hb.2.trans (mul_le_mul_of_nonneg_right hAC hproxy) · intro hcompact obtain ⟨τ, hτ, heq, hres, hu, hlo, hhi⟩ := compact_branch_bounds β n σ hβ hn hσ hnoisy hcompact let B := 1 + log n let D := log (exp 1 + σ ^ 2 * B) have hτpos : 0 < τ := (Real.rpow_pos_of_pos hspos _).trans hτ have hp := compactPower_bounds β B D τ ct Ct hβ.1 (by simpa [B] using hB) (by simpa [D, B] using hD) hτpos hct hCt (by simpa [ct, B, D] using hlo) (by simpa [Ct, B, D] using hhi) have hrate : frontierRate β n σ = τ ^ (-2 * β) := by unfold frontierRate rw [hres] calc (τ ^ (-2 : ℝ)) ^ β = τ ^ ((-2 : ℝ) * β) := (Real.rpow_mul hτpos.le (-2 : ℝ) β).symm _ = τ ^ (-2 * β) := by ring have hR : 0 ≤ B / D := (div_pos (by simpa [B] using hB) (by simpa [D, B] using hD)).le have hQ : 0 ≤ D / B := (div_pos (by simpa [D, B] using hD) (by simpa [B] using hB)).le have hpowQ : 0 ≤ (D / B) ^ (2 * β) := Real.rpow_nonneg hQ _ have hcct : c ≤ ct := (min_le_right 1 (min ct cr)).trans (min_le_left ct cr) have hccr : c ≤ cr := (min_le_right 1 (min ct cr)).trans (min_le_right ct cr) have hCtC : Ct ≤ C := le_trans (le_max_left Ct Cr) (le_max_right A (max Ct Cr)) have hCrC : Cr ≤ C := le_trans (le_max_right Ct Cr) (le_max_right A (max Ct Cr)) refine ⟨τ, hτ, heq, hres, hu, ?_, ?_, ?_, ?_⟩ · exact (mul_le_mul_of_nonneg_right hcct hR).trans (by simpa [ct, B, D] using hlo) · have hhi' : τ ≤ Ct * (B / D) := by simpa [Ct, B, D] using hhi exact hhi'.trans (mul_le_mul_of_nonneg_right hCtC hR) · rw [hrate] exact (mul_le_mul_of_nonneg_right hccr hpowQ).trans (by simpa [cr] using hp.1) · rw [hrate] have hp' : τ ^ (-2 * β) ≤ Cr * (D / B) ^ (2 * β) := by simpa [Cr] using hp.2 exact hp'.trans (mul_le_mul_of_nonneg_right hCrC hpowQ) · intro hspos heq exact intermediate_compact_interface β n σ hβ hn hσ hspos heq · intro heq exact direct_interface β n σ hβ hn hσ heq
CausalSmith.Stat.RdTruesideNoiseFrontier.frontier_branches · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierRoot.lean:119
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.FrontierSequences 4 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

Explicit eventually-in-size comparisons for shrinking and fixed noise, and exact direct sequences. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
FrontierSequences β :
Prop
clause 1
a :
ℝ
0 < a
a < 1/(2*β+1)
∃ c C : ℝ,
0 < c
0 < C
∃ N : ℕ,
2 ≤ N
n :
ℕ
N ≤ n
c * ((n : ℝ)^(-a*β) * (log n)^(-3*β/2)) ≤ frontierRate β n ((n : ℝ)^(-a))
frontierRate β n ((n : ℝ)^(-a)) ≤ C * ((n : ℝ)^(-a*β) * (log n)^(-3*β/2))
clause 2
a :
ℝ
1/(2*β+1) ≤ a
n :
ℕ
2 ≤ n
rateResolution β n ((n : ℝ)^(-a)) = directResolution β n
frontierRate β n ((n : ℝ)^(-a)) = (n : ℝ)^(-β/(2*β+1))
clause 3
σ ∈ Ioc (0 : ℝ) 1 :
∃ c C : ℝ,
0 < c
0 < C
∃ N : ℕ,
2 ≤ N
n :
ℕ
N ≤ n
c * (log (1 + log n) / (1 + log n))^(2*β) ≤ frontierRate β n σ
frontierRate β n σ ≤ C * (log (1 + log n) / (1 + log n))^(2*β)
CausalSmith.Stat.RdTruesideNoiseFrontier.FrontierSequences · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierSequences.lean:22

The beta-one shrinking-noise specialization holds at every declared sample size. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
BetaOneFrontier :
Prop
∃ c C : ℝ,
0 < c
0 < C
clause 1
n :
ℕ
2 ≤ n
σ :
(n : ℝ) ^ (-1/6 : ℝ)
c * (σ / (1 + (1/2 : ℝ)*log n)^(3/2 : ℝ)) ≤ frontierRate 1 n σ
frontierRate 1 n σ ≤ C * (σ / (1 + (1/2 : ℝ)*log n)^(3/2 : ℝ))
CausalSmith.Stat.RdTruesideNoiseFrontier.BetaOneFrontier · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierSequences.lean:35
theorem frontier_sequences

The exact scalar formulas imply the shrinking-noise and fixed-noise asymptotic comparisons. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma frontier_sequences (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : FrontierSequences β := by obtain ⟨c₀, C₀, hc₀, hC₀, hbranches⟩ := frontier_branches β hβ unfold FrontierSequences refine ⟨?_, ?_, ?_⟩ · intro a ha ha' let d := 1 - a * (2 * β + 1) let K := d + 1 / log 2 let c := (c₀ / K ^ (3 / 2 : ℝ)) ^ β let C := (C₀ / d ^ (3 / 2 : ℝ)) ^ β have hν : 0 < 2 * β + 1 := by linarith [hβ.1] have hd : 0 < d := by dsimp [d] nlinarith [(lt_div_iff₀ hν).mp ha'] have hK : 0 < K := by dsimp [K] have : 0 < log 2 := Real.log_pos (by norm_num) positivity have hc : 0 < c := Real.rpow_pos_of_pos (div_pos hc₀ (Real.rpow_pos_of_pos hK _)) _ have hC : 0 < C := Real.rpow_pos_of_pos (div_pos hC₀ (Real.rpow_pos_of_pos hd _)) _ obtain ⟨N, hN2, hN⟩ := eventually_shrinking_intermediate β a hβ.1 ha refine ⟨c, C, hc, hC, N, hN2, ?_⟩ intro n hn have hbounds := shrinking_intermediate_rate_bounds β a c₀ C₀ hβ.1 ha ha' hc₀ hC₀ hbranches n (hN2.trans hn) (hN n hn) simpa [c, C, d, K] using hbounds · intro a ha n hn have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hnone : (1 : ℝ) < n := by exact_mod_cast (show 1 < n by omega) have hν : 0 < 2 * β + 1 := by linarith [hβ.1] let σ := (n : ℝ) ^ (-a) have hspos : 0 < σ := Real.rpow_pos_of_pos hnpos _ have hsone : σ ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hnone.le (by have : 0 < 1 / (2 * β + 1) := one_div_pos.mpr hν linarith) have hsle : σ ≤ directResolution β n := by unfold directResolution exact Real.rpow_le_rpow_of_exponent_le hnone.le (by have := neg_le_neg ha simpa [neg_div] using this) have hb := hbranches n hn σ ⟨hspos.le, hsone⟩ have hres := hb.1 hsle refine ⟨hres, ?_⟩ unfold frontierRate rw [hres] unfold directResolution calc ((n : ℝ) ^ (-1 / (2 * β + 1))) ^ β = (n : ℝ) ^ ((-1 / (2 * β + 1)) * β) := (Real.rpow_mul hnpos.le _ _).symm _ = (n : ℝ) ^ (-β / (2 * β + 1)) := by congr 1 <;> ring · intro σ hσ exact fixed_noise_rate_bounds β σ c₀ C₀ hβ hσ hc₀ hC₀ hbranches
CausalSmith.Stat.RdTruesideNoiseFrontier.frontier_sequences · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierSequences.lean:385
theorem beta_one_frontier

The beta-one example lies on the intermediate branch at every sample size. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
lemma beta_one_frontier : BetaOneFrontier := by obtain ⟨c, C, hc, hC, hbranches⟩ := frontier_branches 1 (by constructor <;> norm_num) refine ⟨c, C, hc, hC, ?_⟩ intro n hn dsimp only let σ : ℝ := (n : ℝ) ^ (-1 / 6 : ℝ) change directResolution 1 n < σ ∧ IntermediateCondition 1 n σ ∧ frontierRate 1 n σ = rateResolution 1 n σ ∧ c * (σ / (1 + (1 / 2 : ℝ) * log n) ^ (3 / 2 : ℝ)) ≤ frontierRate 1 n σ ∧ frontierRate 1 n σ ≤ C * (σ / (1 + (1 / 2 : ℝ) * log n) ^ (3 / 2 : ℝ)) have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hnone : (1 : ℝ) < n := by exact_mod_cast (show 1 < n by omega) have hspos : 0 < σ := Real.rpow_pos_of_pos hnpos _ have hsone : σ ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hnone.le (by norm_num) have hdirect : directResolution 1 n = (n : ℝ) ^ (-1 / 3 : ℝ) := by unfold directResolution norm_num have hnoisy : directResolution 1 n < σ := by rw [hdirect] dsimp [σ] exact Real.rpow_lt_rpow_of_exponent_lt hnone (by norm_num) have hs12 : σ ^ (12 : ℝ) = (n : ℝ) ^ (-2 : ℝ) := by dsimp [σ] rw [← Real.rpow_mul hnpos.le] norm_num have hs12nat : σ ^ (12 : ℕ) = (n : ℝ) ^ (-2 : ℝ) := by rw [← Real.rpow_natCast] exact hs12 have hsInv2 : σ ^ (-2 : ℝ) = (n : ℝ) ^ (1 / 3 : ℝ) := by dsimp [σ] rw [← Real.rpow_mul hnpos.le] norm_num have hprod : (n : ℝ) * σ ^ (12 : ℝ) = (n : ℝ) ^ (-1 : ℝ) := by rw [hs12] convert (Real.rpow_add hnpos 1 (-2)).symm using 1 <;> norm_num have hprodNat : (n : ℝ) * σ ^ (12 : ℕ) = (n : ℝ) ^ (-1 : ℝ) := by rw [hs12nat] convert (Real.rpow_add hnpos 1 (-2)).symm using 1 <;> norm_num have hsInvNat : (σ ^ (2 : ℕ))⁻¹ = σ ^ (-2 : ℝ) := by rw [← Real.rpow_natCast, ← Real.rpow_neg hspos.le] norm_num have hinter : IntermediateCondition 1 n σ := by unfold IntermediateCondition norm_num rw [hprodNat, hsInvNat, hsInv2, Real.log_rpow hnpos] have hpowone : 1 ≤ (n : ℝ) ^ (1 / 3 : ℝ) := Real.one_le_rpow hnone.le (by norm_num) nlinarith [Real.log_pos hnone] have hb := hbranches n hn σ ⟨hspos.le, hsone⟩ have hi := hb.2.1 hnoisy have hrate : frontierRate 1 n σ = rateResolution 1 n σ := by simp [frontierRate] have hprod3 : (n : ℝ) * σ ^ (3 : ℝ) = (n : ℝ) ^ (1 / 2 : ℝ) := by dsimp [σ] rw [← Real.rpow_mul hnpos.le] convert (Real.rpow_add hnpos 1 (-1 / 6 * 3)).symm using 1 <;> norm_num have hlog : log ((n : ℝ) * σ ^ (3 : ℝ)) = (1 / 2 : ℝ) * log n := by rw [hprod3, Real.log_rpow hnpos] obtain ⟨z, hz1, hzup, hzeq, hres, hu, hlo, hhi⟩ := hi.2.2.2.1 hinter norm_num at hlo hhi refine ⟨hnoisy, hinter, hrate, ?_, ?_⟩ · rw [hrate, ← hlog] simpa using hlo · rw [hrate, ← hlog] simpa using hhi
CausalSmith.Stat.RdTruesideNoiseFrontier.beta_one_frontier · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/FrontierSequences.lean:438
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.GaussianLikelihood 11 declarations The midpoint denominator comparison and absolute integrability of the signed Gaussian cross-kernel justify the Fubini step preceding the moment series ML.5.

Gaussian reference likelihood on the full proxy line

The midpoint denominator comparison and absolute integrability of the signed Gaussian cross-kernel justify the Fubini step preceding the moment series ML.5.

theorem marked_square_midpoint_comparison Lemma marked_square_midpoint_comparison in the paper ↗

Dividing the global midpoint lower bound gives the pointwise ML.3 comparison. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
w :
ℝ
≤ (exp (b^2/(24*σ^2))/b) * (markedConvolution b m σ w ^ 2 / phi σ (w-b/2))
Proof (Lean source)
lemma marked_square_midpoint_comparison (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) (w : ℝ) : markedConvolution b m σ w ^ 2 / treatedConvolution σ w ≤ (exp (b^2/(24*σ^2))/b) * (markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) := by have hbp := hb.1 have hp := phi_pos σ (w-b/2) hσ have hd := treatedConvolution_centered_lower b σ w ⟨hb.1.le, hb.2⟩ calc _ ≤ markedConvolution b m σ w ^ 2 / (b * exp (-b^2/(24*σ^2)) * phi σ (w-b/2)) := div_le_div_of_nonneg_left (sq_nonneg _) (by positivity) hd _ = _ := by rw [show -b^2/(24*σ^2) = -(b^2/(24*σ^2)) by ring, Real.exp_neg] field_simp
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_midpoint_comparison · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:17
theorem centered_cross_exponent_le Lemma centered_cross_exponent_le in the paper ↗

The centered cross exponent stays below λ on the entire support square. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ x t :
ℝ
hb :
0 ≤ b
hx :
x ∈ Icc (0 : ℝ) b
ht :
t ∈ Icc (0 : ℝ) b
(x-b/2)*(t-b/2)/σ^2 ≤ likelihoodLambda b σ
Proof (Lean source)
lemma centered_cross_exponent_le (b σ x t : ℝ) (hb : 0 ≤ b) (hx : x ∈ Icc (0 : ℝ) b) (ht : t ∈ Icc (0 : ℝ) b) : (x-b/2)*(t-b/2)/σ^2 ≤ likelihoodLambda b σ := by have hx' : |x-b/2| ≤ b/2 := abs_le.mpr ⟨by linarith [hx.1], by linarith [hx.2]⟩ have ht' : |t-b/2| ≤ b/2 := abs_le.mpr ⟨by linarith [ht.1], by linarith [ht.2]⟩ have hh := mul_le_mul hx' ht' (abs_nonneg _) (by linarith : 0 ≤ b/2) have hp : (x-b/2)*(t-b/2) ≤ b^2/4 := by have ha := le_abs_self ((x-b/2)*(t-b/2)) rw [abs_mul] at ha nlinarith only [ha, hh] unfold likelihoodLambda simpa only [div_div] using div_le_div_of_nonneg_right hp (sq_nonneg σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_cross_exponent_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:34
theorem signed_gaussian_cross_norm_integral Lemma signed_gaussian_cross_norm_integral in the paper ↗

The absolute signed cross-kernel has an explicit finite Gaussian integral (ML.4). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
x t :
ℝ
hσ :
0 < σ
(∫ w, ‖block m (x/b) * block m (t/b) * (phi σ (w-x) * phi σ (w-t) / phi σ (w-b/2))‖)
= |block m (x/b) * block m (t/b)| * exp ((x-b/2)*(t-b/2)/σ^2)
Proof (Lean source)
lemma signed_gaussian_cross_norm_integral (b σ : ℝ) (m : ℕ) (x t : ℝ) (hσ : 0 < σ) : (∫ w, ‖block m (x/b) * block m (t/b) * (phi σ (w-x) * phi σ (w-t) / phi σ (w-b/2))‖) = |block m (x/b) * block m (t/b)| * exp ((x-b/2)*(t-b/2)/σ^2) := by simp_rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (div_nonneg (mul_nonneg (phi_nonneg σ _) (phi_nonneg σ _)) (phi_nonneg σ _))] rw [integral_const_mul, phi_product_div_integral σ x t (b/2) hσ]
CausalSmith.Stat.RdTruesideNoiseFrontier.signed_gaussian_cross_norm_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:48
theorem signed_gaussian_cross_integrable Lemma signed_gaussian_cross_integrable in the paper ↗

Absolute cross-kernel integrability justifies signed Fubini over both latent coordinates and every real proxy value, with no discarded tails (ML.4--ML.5). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 < b
hσ :
0 < σ
Integrable (fun z : (ℝ × ℝ) × ℝ => block m (z.1.1/b) * block m (z.1.2/b) * (phi σ (z.2-z.1.1) * phi σ (z.2-z.1.2) / phi σ (z.2-b/2))) (((volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b))).prod volume)
Proof (Lean source)
lemma signed_gaussian_cross_integrable (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : 0 < b) (hσ : 0 < σ) : Integrable (fun z : (ℝ × ℝ) × ℝ => block m (z.1.1/b) * block m (z.1.2/b) * (phi σ (z.2-z.1.1) * phi σ (z.2-z.1.2) / phi σ (z.2-b/2))) (((volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b))).prod volume) := by have hm : StronglyMeasurable (fun z : (ℝ × ℝ) × ℝ => block m (z.1.1/b) * block m (z.1.2/b) * (phi σ (z.2-z.1.1) * phi σ (z.2-z.1.2) / phi σ (z.2-b/2))) := by unfold block legendreP fun_prop apply (integrable_prod_iff hm.aestronglyMeasurable).mpr constructor · exact ae_of_all _ (fun p => (phi_product_div_integrable σ p.1 p.2 (b/2) hσ).const_mul (block m (p.1/b) * block m (p.2/b))) · simp_rw [signed_gaussian_cross_norm_integral b σ m _ _ hσ] apply (integrable_const (exp (likelihoodLambda b σ))).mono' · have hc : StronglyMeasurable (fun p : ℝ × ℝ => |block m (p.1/b) * block m (p.2/b)| * exp ((p.1-b/2)*(p.2-b/2)/σ^2)) := by unfold block legendreP fun_prop exact hc.aestronglyMeasurable · rw [Measure.prod_restrict] filter_upwards [ae_restrict_mem (measurableSet_Ioc.prod measurableSet_Ioc)] with p hp rcases p with ⟨x, t⟩ rcases hp with ⟨hx, ht⟩ have hx' : x/b ∈ Icc (0 : ℝ) 1 := ⟨div_nonneg hx.1.le hb.le, (div_le_one hb).mpr hx.2⟩ have ht' : t/b ∈ Icc (0 : ℝ) 1 := ⟨div_nonneg ht.1.le hb.le, (div_le_one hb).mpr ht.2⟩ have hblock : |block m (x/b) * block m (t/b)| ≤ 1 := by rw [abs_mul] simpa using mul_le_mul (block_abs_le_one hleg m _ hx') (block_abs_le_one hleg m _ ht') (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)] calc _ ≤ exp ((x-b/2)*(t-b/2)/σ^2) := by simpa using mul_le_mul_of_nonneg_right hblock (Real.exp_pos _).le _ ≤ _ := Real.exp_le_exp.mpr (centered_cross_exponent_le b σ x t hb.le ⟨hx.1.le, hx.2⟩ ⟨ht.1.le, ht.2⟩)
CausalSmith.Stat.RdTruesideNoiseFrontier.signed_gaussian_cross_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:60
theorem marked_square_as_cross_integral Lemma marked_square_as_cross_integral in the paper ↗

Multiplying the two compact latent integrals gives the square of the marked convolution, with the positive Gaussian reference denominator left outside. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 ≤ b
w :
ℝ
(∫ p : ℝ × ℝ, block m (p.1/b) * block m (p.2/b) * (phi σ (w-p.1) * phi σ (w-p.2) / phi σ (w-b/2)) ∂(volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b)))
= markedConvolution b m σ w ^ 2 / phi σ (w-b/2)
Proof (Lean source)
lemma marked_square_as_cross_integral (b σ : ℝ) (m : ℕ) (hb : 0 ≤ b) (w : ℝ) : (∫ p : ℝ × ℝ, block m (p.1/b) * block m (p.2/b) * (phi σ (w-p.1) * phi σ (w-p.2) / phi σ (w-b/2)) ∂(volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b))) = markedConvolution b m σ w ^ 2 / phi σ (w-b/2) := by have he : (fun p : ℝ × ℝ => block m (p.1/b) * block m (p.2/b) * (phi σ (w-p.1) * phi σ (w-p.2) / phi σ (w-b/2))) = (fun p : ℝ × ℝ => ((block m (p.1/b) * phi σ (w-p.1)) * (block m (p.2/b) * phi σ (w-p.2))) / phi σ (w-b/2)) := by funext p ring rw [he, integral_div, integral_prod_mul (fun x : ℝ => block m (x/b) * phi σ (w-x)) (fun t : ℝ => block m (t/b) * phi σ (w-t))] simp only [markedConvolution, intervalIntegral.integral_of_le hb, pow_two]
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_as_cross_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:106
theorem marked_square_reference_integrable Lemma marked_square_reference_integrable in the paper ↗

The Gaussian-reference square is integrable on all real proxy values; this follows from the signed three-variable absolute-integrability bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 < b
hσ :
0 < σ
Integrable (fun w => markedConvolution b m σ w ^ 2 / phi σ (w-b/2))
Proof (Lean source)
lemma marked_square_reference_integrable (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : 0 < b) (hσ : 0 < σ) : Integrable (fun w => markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) := by have hi := (signed_gaussian_cross_integrable hleg b σ m hb hσ).integral_prod_right simp_rw [marked_square_as_cross_integral b σ m hb.le] at hi exact hi
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_reference_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:125
theorem marked_square_reference_integral Lemma marked_square_reference_integral in the paper ↗

Signed Fubini and the exact Gaussian cross-kernel give the compact double integral in ML.5, retaining every real proxy value. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 < b
hσ :
0 < σ
(∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2))
= ∫ x in (0 : ℝ)..b, ∫ t in (0 : ℝ)..b, block m (x/b) * block m (t/b) * exp ((x-b/2)*(t-b/2)/σ^2)
Proof (Lean source)
lemma marked_square_reference_integral (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : 0 < b) (hσ : 0 < σ) : (∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) = ∫ x in (0 : ℝ)..b, ∫ t in (0 : ℝ)..b, block m (x/b) * block m (t/b) * exp ((x-b/2)*(t-b/2)/σ^2) := by have hi := signed_gaussian_cross_integrable hleg b σ m hb hσ have hswap := integral_integral_swap (f := fun (p : ℝ × ℝ) (w : ℝ) => block m (p.1/b) * block m (p.2/b) * (phi σ (w-p.1) * phi σ (w-p.2) / phi σ (w-b/2))) hi simp_rw [marked_square_as_cross_integral b σ m hb.le] at hswap rw [← hswap] simp_rw [integral_const_mul, phi_product_div_integral σ _ _ (b/2) hσ] have hc : Continuous (fun p : ℝ × ℝ => block m (p.1/b) * block m (p.2/b) * exp ((p.1-b/2)*(p.2-b/2)/σ^2)) := by unfold block legendreP fun_prop have hcompact : Integrable (fun p : ℝ × ℝ => block m (p.1/b) * block m (p.2/b) * exp ((p.1-b/2)*(p.2-b/2)/σ^2)) ((volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b))) := by rw [Measure.prod_restrict] exact (hc.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set (Set.prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) rw [integral_prod _ hcompact] simp only [intervalIntegral.integral_of_le hb.le]
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_reference_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:134
theorem marked_square_integral_midpoint_comparison Lemma marked_square_integral_midpoint_comparison in the paper ↗

Integrating ML.3 reduces the actual likelihood square to the finite Gaussian-reference square, using the just-proved full-domain integrability. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
(∫ w, markedConvolution b m σ w ^ 2 / treatedConvolution σ w)
≤ (exp (b^2/(24*σ^2))/b) * (∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2))
Proof (Lean source)
lemma marked_square_integral_midpoint_comparison (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) : (∫ w, markedConvolution b m σ w ^ 2 / treatedConvolution σ w) ≤ (exp (b^2/(24*σ^2))/b) * (∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) := by rw [← integral_const_mul] exact integral_mono (markedConvolution_square_div_integrable hleg b σ m hb hσ) ((marked_square_reference_integrable hleg b σ m hb.1 hσ).const_mul _) (marked_square_midpoint_comparison b σ m hb hσ)
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_integral_midpoint_comparison · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:162
theorem centered_cross_exponent_abs_le Lemma centered_cross_exponent_abs_le in the paper ↗

The absolute cross exponent is uniformly controlled on the support square, so its exponential power series has a summable constant majorant. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ x t :
ℝ
hb :
0 ≤ b
hx :
x ∈ Icc (0 : ℝ) b
ht :
t ∈ Icc (0 : ℝ) b
|(x-b/2)*(t-b/2)/σ^2| ≤ likelihoodLambda b σ
Proof (Lean source)
lemma centered_cross_exponent_abs_le (b σ x t : ℝ) (hb : 0 ≤ b) (hx : x ∈ Icc (0 : ℝ) b) (ht : t ∈ Icc (0 : ℝ) b) : |(x-b/2)*(t-b/2)/σ^2| ≤ likelihoodLambda b σ := by have hx' : |x-b/2| ≤ b/2 := abs_le.mpr ⟨by linarith [hx.1], by linarith [hx.2]⟩ have ht' : |t-b/2| ≤ b/2 := abs_le.mpr ⟨by linarith [ht.1], by linarith [ht.2]⟩ have hh := mul_le_mul hx' ht' (abs_nonneg _) (by linarith : 0 ≤ b/2) rw [abs_div, abs_mul, abs_of_nonneg (sq_nonneg σ)] unfold likelihoodLambda have hp : |x-b/2| * |t-b/2| ≤ b^2/4 := by nlinarith only [hh] simpa only [div_div] using div_le_div_of_nonneg_right hp (sq_nonneg σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_cross_exponent_abs_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:174
theorem marked_square_reference_moment_series Lemma marked_square_reference_moment_series in the paper ↗

Expanding the compact cross-kernel and integrating its summable majorant proves the exact centered-moment series ML.5. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 < b
hσ :
0 < σ
(∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2))
= ∑' j : ℕ, (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ))
Proof (Lean source)
lemma marked_square_reference_moment_series (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : 0 < b) (hσ : 0 < σ) : (∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) = ∑' j : ℕ, (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)) := by let μ := (volume.restrict (Ioc (0 : ℝ) b)).prod (volume.restrict (Ioc (0 : ℝ) b)) let F : ℕ → ℝ × ℝ → ℝ := fun j p => block m (p.1/b) * block m (p.2/b) * (((p.1-b/2)*(p.2-b/2)/σ^2)^j / (Nat.factorial j : ℝ)) have hFi (j : ℕ) : Integrable (F j) μ := by have hc : Continuous (F j) := by dsimp [F] unfold block legendreP fun_prop dsimp [μ] rw [Measure.prod_restrict] exact (hc.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set (Set.prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) have hbound (j : ℕ) : ∀ᵐ p ∂μ, ‖F j p‖ ≤ likelihoodLambda b σ^j / (Nat.factorial j : ℝ) := by dsimp [μ] rw [Measure.prod_restrict] filter_upwards [ae_restrict_mem (measurableSet_Ioc.prod measurableSet_Ioc)] with p hp have hx : p.1/b ∈ Icc (0 : ℝ) 1 := ⟨div_nonneg hp.1.1.le hb.le, (div_le_one hb).mpr hp.1.2⟩ have ht : p.2/b ∈ Icc (0 : ℝ) 1 := ⟨div_nonneg hp.2.1.le hb.le, (div_le_one hb).mpr hp.2.2⟩ have hg : |block m (p.1/b) * block m (p.2/b)| ≤ 1 := by rw [abs_mul] simpa using mul_le_mul (block_abs_le_one hleg m _ hx) (block_abs_le_one hleg m _ ht) (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) dsimp [F] rw [abs_mul, abs_div, abs_pow, abs_of_nonneg (show 0 ≤ (Nat.factorial j : ℝ) by positivity)] calc _ ≤ 1 * (likelihoodLambda b σ^j / (Nat.factorial j : ℝ)) := by apply mul_le_mul hg (div_le_div_of_nonneg_right (pow_le_pow_left₀ (abs_nonneg _) (centered_cross_exponent_abs_le b σ p.1 p.2 hb.le ⟨hp.1.1.le, hp.1.2⟩ ⟨hp.2.1.le, hp.2.2⟩) j) (by positivity)) (by positivity) (by norm_num) _ = _ := one_mul _ have hnorm : Summable (fun j : ℕ => ∫ p, ‖F j p‖ ∂μ) := by apply ((Real.summable_pow_div_factorial (likelihoodLambda b σ)).mul_left (μ.real univ)).of_nonneg_of_le (fun j => integral_nonneg (fun p => norm_nonneg _)) intro j have hh := integral_mono_ae (hFi j).norm (integrable_const (likelihoodLambda b σ^j / (Nat.factorial j : ℝ))) (hbound j) simpa only [integral_const, smul_eq_mul] using hh have hseries := integral_tsum_of_summable_integral_norm hFi hnorm have hpoint (p : ℝ × ℝ) : (∑' j : ℕ, F j p) = block m (p.1/b) * block m (p.2/b) * exp ((p.1-b/2)*(p.2-b/2)/σ^2) := by dsimp [F] rw [tsum_mul_left] congr 1 have hs := NormedSpace.expSeries_div_hasSum_exp ((p.1-b/2)*(p.2-b/2)/σ^2) simpa only [← Real.exp_eq_exp_ℝ] using hs.tsum_eq have hterm (j : ℕ) : (∫ p, F j p ∂μ) = (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)) := by have he : F j = (fun p : ℝ × ℝ => (block m (p.1/b) * (p.1-b/2)^j) * (block m (p.2/b) * (p.2-b/2)^j) / (σ^(2*j) * (Nat.factorial j : ℝ))) := by funext p dsimp [F] rw [div_pow, mul_pow, ← pow_mul] ring rw [he, integral_div] dsimp [μ] rw [integral_prod_mul (fun x : ℝ => block m (x/b) * (x-b/2)^j) (fun t : ℝ => block m (t/b) * (t-b/2)^j)] simp only [intervalIntegral.integral_of_le hb.le, pow_two] simp_rw [hterm, hpoint] at hseries rw [marked_square_reference_integral hleg b σ m hb hσ] have hi : Integrable (fun p : ℝ × ℝ => block m (p.1/b) * block m (p.2/b) * exp ((p.1-b/2)*(p.2-b/2)/σ^2)) μ := by have hc : Continuous (fun p : ℝ × ℝ => block m (p.1/b) * block m (p.2/b) * exp ((p.1-b/2)*(p.2-b/2)/σ^2)) := by unfold block legendreP fun_prop dsimp [μ] rw [Measure.prod_restrict] exact (hc.continuousOn.integrableOn_compact (isCompact_Icc.prod isCompact_Icc)).mono_set (Set.prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) rw [integral_prod _ hi] at hseries simpa only [intervalIntegral.integral_of_le hb.le] using hseries.symm
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_reference_moment_series · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:187
theorem marked_square_factorial_tail_bound Lemma marked_square_factorial_tail_bound in the paper ↗

ML.3--ML.6 bound the full proxy-domain likelihood square by the retained factorial tail; no observed-law identities are assumed in this analytic step. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
hm :
2 ≤ m
(∫ w, markedConvolution b m σ w ^ 2 / treatedConvolution σ w)
≤ (b/blockNorm m) * exp (b^2/(24*σ^2)) * ∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0
Proof (Lean source)
lemma marked_square_factorial_tail_bound (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) (hm : 2 ≤ m) : (∫ w, markedConvolution b m σ w ^ 2 / treatedConvolution σ w) ≤ (b/blockNorm m) * exp (b^2/(24*σ^2)) * ∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0 := by have hmoment := (centered_block_moment_series_bound hleg b σ m hb.1 hσ hm).2 calc _ ≤ (exp (b^2/(24*σ^2))/b) * (∫ w, markedConvolution b m σ w ^ 2 / phi σ (w-b/2)) := marked_square_integral_midpoint_comparison hleg b σ m hb hσ _ = (exp (b^2/(24*σ^2))/b) * (∑' j : ℕ, (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ))) := by rw [marked_square_reference_moment_series hleg b σ m hb.1 hσ] _ ≤ (exp (b^2/(24*σ^2))/b) * ((b^2/blockNorm m) * ∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0) := mul_le_mul_of_nonneg_left hmoment (div_nonneg (Real.exp_pos _).le hb.1.le) _ = _ := by have hbp := hb.1.ne' field_simp
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_square_factorial_tail_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/GaussianLikelihood.lean:277
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Handle 2 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

structure FrontierHandleData

The endpoint handle records objects only; it carries no comparability or legality premises.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
target :
LatentLaw → ℝ
variance :
ℕ → ℝ
certificate :
ℝ
cancellation :
(m : ℕ) → 2 ≤ m → σ ∈ Ioc (0 : ℝ) 1 → Bool → LatentLaw
direct :
(h : ℝ) → h ∈ Ioc (0 : ℝ) 1 → Bool → LatentLaw
frontier :
ℝ
estimate :
interval :
CausalSmith.Stat.RdTruesideNoiseFrontier.FrontierHandleData · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Handle.lean:23
def frontierHandle

Endpoint precision handle over the constructed objects in Definitions 3--10. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
frontierHandle hleg β n σ hβ :
clause 1
target := theta
clause 2
variance := fun L => kernelVariance L σ
clause 3
clause 4
cancellation := fun m hm hσ s
=> altLaw hleg β (noiseSupport σ m) m s hβ (noiseSupport_mem σ m hσ hm) hm
clause 5
direct := fun h hh s => directAltLaw β h s hβ hh
clause 6
clause 7
estimate := attainer β n σ
clause 8
interval := honestAttainer β n σ
CausalSmith.Stat.RdTruesideNoiseFrontier.frontierHandle · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Handle.lean:33
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.HeatAlgebra 13 declarations The transform is linear, its truncation is independent of an upper degree bound, and its action on every monomial has explicit descending-factorial coefficients.

Finite coefficient algebra for the inverse heat transform

The transform is linear, its truncation is independent of an upper degree bound, and its action on every monomial has explicit descending-factorial coefficients. These facts reduce the covariance roadmap's finite Hermite identity to monomials.

The inverse heat operator with an arbitrary public degree cutoff. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
σ :
ℝ
p :
finiteInverseHeat m σ p :
∑ k ∈ range (m / 2 + 1), C ((-σ^2/2)^k / (Nat.factorial k : ℝ)) * polyDeriv (2*k) p
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:18

Iterated polynomial differentiation distributes over finite sums. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
ι :
Type*
j :
ℕ
s :
p :
ι → Polynomial ℝ
polyDeriv j (∑ i ∈ s, p i) = ∑ i ∈ s, polyDeriv j (p i)
Proof (Lean source)
lemma polyDeriv_sum {ι : Type*} (j : ℕ) (s : Finset ι) (p : ι → Polynomial ℝ) : polyDeriv j (∑ i ∈ s, p i) = ∑ i ∈ s, polyDeriv j (p i) := by exact Polynomial.iterate_derivative_sum j s p
CausalSmith.Stat.RdTruesideNoiseFrontier.polyDeriv_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:23

Scalar polynomial coefficients commute with iterated differentiation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
a :
ℝ
p :
polyDeriv j (C a * p) = C a * polyDeriv j p
Proof (Lean source)
lemma polyDeriv_C_mul (j : ℕ) (a : ℝ) (p : Polynomial ℝ) : polyDeriv j (C a * p) = C a * polyDeriv j p := by exact Polynomial.iterate_derivative_C_mul a p j
CausalSmith.Stat.RdTruesideNoiseFrontier.polyDeriv_C_mul · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:28

Every monomial derivative has its descending-factorial coefficient, including zero derivatives above the monomial degree. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j n :
ℕ
polyDeriv j (X^n : Polynomial ℝ)
= C (Nat.descFactorial n j : ℝ) * X^(n-j)
Proof (Lean source)
lemma polyDeriv_X_pow (j n : ℕ) : polyDeriv j (X^n : Polynomial ℝ) = C (Nat.descFactorial n j : ℝ) * X^(n-j) := by exact Polynomial.iterate_derivative_X_pow_eq_C_mul n j
CausalSmith.Stat.RdTruesideNoiseFrontier.polyDeriv_X_pow · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:33
theorem polyDeriv_eq_zero_of_degree_lt Lemma polyDeriv_eq_zero_of_degree_lt in the paper ↗

Derivatives above any upper degree bound vanish. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
j m :
ℕ
hp :
p.natDegree ≤ m
hj :
m < j
polyDeriv j p = 0
Proof (Lean source)
lemma polyDeriv_eq_zero_of_degree_lt (p : Polynomial ℝ) (j m : ℕ) (hp : p.natDegree ≤ m) (hj : m < j) : polyDeriv j p = 0 := by exact Polynomial.iterate_derivative_eq_zero (hp.trans_lt hj)
CausalSmith.Stat.RdTruesideNoiseFrontier.polyDeriv_eq_zero_of_degree_lt · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:40

The finite heat operator distributes over finite polynomial sums. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
ι :
Type*
m :
ℕ
σ :
ℝ
s :
p :
ι → Polynomial ℝ
finiteInverseHeat m σ (∑ i ∈ s, p i) = ∑ i ∈ s, finiteInverseHeat m σ (p i)
Proof (Lean source)
lemma finiteInverseHeat_sum {ι : Type*} (m : ℕ) (σ : ℝ) (s : Finset ι) (p : ι → Polynomial ℝ) : finiteInverseHeat m σ (∑ i ∈ s, p i) = ∑ i ∈ s, finiteInverseHeat m σ (p i) := by simp only [finiteInverseHeat, polyDeriv_sum, Finset.mul_sum] rw [Finset.sum_comm]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:45
theorem finiteInverseHeat_C_mul Lemma finiteInverseHeat_C_mul in the paper ↗

The finite heat operator commutes with scalar polynomial coefficients. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
σ a :
ℝ
p :
finiteInverseHeat m σ (C a * p) = C a * finiteInverseHeat m σ p
Proof (Lean source)
lemma finiteInverseHeat_C_mul (m : ℕ) (σ a : ℝ) (p : Polynomial ℝ) : finiteInverseHeat m σ (C a * p) = C a * finiteInverseHeat m σ p := by simp only [finiteInverseHeat, polyDeriv_C_mul, Finset.mul_sum] apply Finset.sum_congr rfl intro k hk ring
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_C_mul · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:52
theorem finiteInverseHeat_cutoff Lemma finiteInverseHeat_cutoff in the paper ↗

Enlarging a degree cutoff adds only identically zero heat terms. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
σ :
ℝ
m M :
ℕ
hp :
p.natDegree ≤ m
hmM :
m ≤ M
Proof (Lean source)
lemma finiteInverseHeat_cutoff (p : Polynomial ℝ) (σ : ℝ) (m M : ℕ) (hp : p.natDegree ≤ m) (hmM : m ≤ M) : finiteInverseHeat M σ p = finiteInverseHeat m σ p := by symm apply Finset.sum_subset (Finset.range_mono (by omega : m/2+1 ≤ M/2+1)) intro k hk hknot have hj : m < 2*k := by have hnot : ¬ k < m/2+1 := by simpa using hknot omega rw [polyDeriv_eq_zero_of_degree_lt p (2*k) m hp hj, mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_cutoff · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:61
theorem finiteInverseHeat_X_pow_eval Lemma finiteInverseHeat_X_pow_eval in the paper ↗

The exact scalar action of inverse heat on a monomial is a finite sum with no convergence assumptions. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m n :
ℕ
σ w :
ℝ
(finiteInverseHeat m σ (X^n)).eval w
= ∑ k ∈ range (m/2+1), ((-σ^2/2)^k / (Nat.factorial k : ℝ)) * (descFactorial n (2*k) : ℝ) * w^(n-2*k)
Proof (Lean source)
lemma finiteInverseHeat_X_pow_eval (m n : ℕ) (σ w : ℝ) : (finiteInverseHeat m σ (X^n)).eval w = ∑ k ∈ range (m/2+1), ((-σ^2/2)^k / (Nat.factorial k : ℝ)) * (descFactorial n (2*k) : ℝ) * w^(n-2*k) := by simp only [finiteInverseHeat, Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, polyDeriv_X_pow, Polynomial.eval_pow, Polynomial.eval_X] apply Finset.sum_congr rfl intro k hk ring
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_X_pow_eval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:73
theorem inverseHeat_eq_finiteInverseHeat Lemma inverseHeat_eq_finiteInverseHeat in the paper ↗

The public transform is exactly the general finite operator at the declared kernel degree. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
σ :
ℝ
Proof (Lean source)
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat_eq_finiteInverseHeat · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:86
theorem finiteInverseHeat_coeff_decomposition Lemma finiteInverseHeat_coeff_decomposition in the paper ↗

Applying inverse heat coefficientwise gives the finite monomial decomposition prescribed in the covariance proof roadmap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
σ :
ℝ
hp :
p.natDegree ≤ m
= ∑ n ∈ range (m+1), C (p.coeff n) * finiteInverseHeat m σ (X^n)
Proof (Lean source)
lemma finiteInverseHeat_coeff_decomposition (p : Polynomial ℝ) (m : ℕ) (σ : ℝ) (hp : p.natDegree ≤ m) : finiteInverseHeat m σ p = ∑ n ∈ range (m+1), C (p.coeff n) * finiteInverseHeat m σ (X^n) := by have he := p.as_sum_range_C_mul_X_pow' (by omega : p.natDegree < m+1) calc _ = finiteInverseHeat m σ (∑ n ∈ range (m+1), C (p.coeff n) * X^n) := congrArg _ he _ = _ := by simp only [finiteInverseHeat_sum, finiteInverseHeat_C_mul]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_coeff_decomposition · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:92
theorem finiteInverseHeat_eval_coeff_decomposition Lemma finiteInverseHeat_eval_coeff_decomposition in the paper ↗

Evaluating the coefficientwise heat decomposition reduces the transform to its explicit finite descending-factorial sums. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
σ w :
ℝ
hp :
p.natDegree ≤ m
(finiteInverseHeat m σ p).eval w
= ∑ n ∈ range (m+1), p.coeff n * (∑ k ∈ range (m/2+1), ((-σ^2/2)^k / (Nat.factorial k : ℝ)) * (descFactorial n (2*k) : ℝ) * w^(n-2*k))
Proof (Lean source)
lemma finiteInverseHeat_eval_coeff_decomposition (p : Polynomial ℝ) (m : ℕ) (σ w : ℝ) (hp : p.natDegree ≤ m) : (finiteInverseHeat m σ p).eval w = ∑ n ∈ range (m+1), p.coeff n * (∑ k ∈ range (m/2+1), ((-σ^2/2)^k / (Nat.factorial k : ℝ)) * (descFactorial n (2*k) : ℝ) * w^(n-2*k)) := by rw [finiteInverseHeat_coeff_decomposition p m σ hp] simp only [Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, finiteInverseHeat_X_pow_eval]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_eval_coeff_decomposition · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:104
theorem finiteHermite_coeff_decomposition Lemma finiteHermite_coeff_decomposition in the paper ↗

The finite Hermite expression is likewise coefficientwise linear in the input polynomial. This is the other half of the monomial reduction. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
σ x z :
ℝ
hp :
p.natDegree ≤ m
(∑ j ∈ range (m+1), (σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ))
= ∑ n ∈ range (m+1), p.coeff n * (∑ j ∈ range (m+1), (σ^j * (Nat.descFactorial n j : ℝ) * x^(n-j) / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ))
Proof (Lean source)
lemma finiteHermite_coeff_decomposition (p : Polynomial ℝ) (m : ℕ) (σ x z : ℝ) (hp : p.natDegree ≤ m) : (∑ j ∈ range (m+1), (σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ)) = ∑ n ∈ range (m+1), p.coeff n * (∑ j ∈ range (m+1), (σ^j * (Nat.descFactorial n j : ℝ) * x^(n-j) / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ)) := by have he := p.as_sum_range_C_mul_X_pow' (by omega : p.natDegree < m+1) conv_lhs => rw [he] simp only [polyDeriv_sum, Polynomial.eval_finsetSum, polyDeriv_C_mul, Polynomial.eval_mul, Polynomial.eval_C, polyDeriv_X_pow, Polynomial.eval_pow, Polynomial.eval_X] simp only [Finset.mul_sum, Finset.sum_div, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro n hn apply Finset.sum_congr rfl intro j hj ring
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteHermite_coeff_decomposition · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatAlgebra.lean:115
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.HeatHermite 7 declarations Coefficient comparison identifies inverse heat on monomials with Hermite polynomials.

Finite Hermite expansion of inverse heat

Coefficient comparison identifies inverse heat on monomials with Hermite polynomials. Affine substitution and the finite Taylor formula extend this identity to arbitrary polynomials, without any infinite-series interchange.

The even factorial splits into its even and odd double-factorial products. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
k :
ℕ
factorial (2*k) = 2^k * factorial k * doubleFactorial (2*k-1)
Proof (Lean source)
lemma heat_even_factorial (k : ℕ) : factorial (2*k) = 2^k * factorial k * doubleFactorial (2*k-1) := by cases k with | zero => norm_num [doubleFactorial] | succ k => have h := Nat.factorial_eq_mul_doubleFactorial (2*(k+1)-1) rw [show 2*(k+1)-1+1 = 2*(k+1) by omega] at h rw [h, Nat.doubleFactorial_two_mul]
CausalSmith.Stat.RdTruesideNoiseFrontier.heat_even_factorial · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:15
theorem hermite_heat_coefficient Lemma hermite_heat_coefficient in the paper ↗

Each nonzero Hermite coefficient equals the corresponding inverse-heat coefficient. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
k j :
ℕ
((hermite (2*k+j)).coeff j : ℝ)
= (-1/2 : ℝ)^k / (Nat.factorial k : ℝ) * (descFactorial (2*k+j) (2*k) : ℝ)
Proof (Lean source)
lemma hermite_heat_coefficient (k j : ℕ) : ((hermite (2*k+j)).coeff j : ℝ) = (-1/2 : ℝ)^k / (Nat.factorial k : ℝ) * (descFactorial (2*k+j) (2*k) : ℝ) := by rw [Polynomial.coeff_hermite_explicit] push_cast have hdesc := Nat.factorial_mul_descFactorial (show 2*k ≤ 2*k+j by omega) have hchoose := Nat.choose_mul_factorial_mul_factorial (show j ≤ 2*k+j by omega) rw [show 2*k+j-2*k = j by omega] at hdesc rw [show 2*k+j-j = 2*k by omega, heat_even_factorial] at hchoose have hd : (Nat.factorial j : ℝ) * (descFactorial (2*k+j) (2*k) : ℝ) = (Nat.factorial (2*k+j) : ℝ) := by exact_mod_cast hdesc have hc : (choose (2*k+j) j : ℝ) * (Nat.factorial j : ℝ) * (2^k * (Nat.factorial k : ℝ) * (doubleFactorial (2*k-1) : ℝ)) = (Nat.factorial (2*k+j) : ℝ) := by exact_mod_cast hchoose have hj : (Nat.factorial j : ℝ) ≠ 0 := by positivity have hk : (Nat.factorial k : ℝ) ≠ 0 := by positivity have he : (descFactorial (2*k+j) (2*k) : ℝ) = (choose (2*k+j) j : ℝ) * (2^k * (Nat.factorial k : ℝ) * (doubleFactorial (2*k-1) : ℝ)) := by apply mul_left_cancel₀ hj nlinarith [hd, hc] rw [he, div_pow] field_simp
CausalSmith.Stat.RdTruesideNoiseFrontier.hermite_heat_coefficient · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:24
theorem finiteInverseHeat_unit_monomial Lemma finiteInverseHeat_unit_monomial in the paper ↗

Unit-noise inverse heat maps a monomial to the corresponding Hermite polynomial. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n :
ℕ
Proof (Lean source)
lemma finiteInverseHeat_unit_monomial (n : ℕ) : finiteInverseHeat n 1 (X^n) = (hermite n).map (castRingHom ℝ) := by ext j simp only [finiteInverseHeat, polyDeriv_X_pow, Polynomial.finsetSum_coeff, Polynomial.coeff_C_mul, Polynomial.coeff_X_pow, Polynomial.coeff_map, castRingHom] by_cases hj : j ≤ n · by_cases heven : Even (n-j) · obtain ⟨k, hk⟩ := heven have hn : n = 2*k+j := by omega subst n rw [Finset.sum_eq_single k] · simp only [show 2*k+j-2*k = j by omega, if_true] norm_num only [one_pow, neg_div, neg_one_sq, one_mul] simpa [div_eq_mul_inv] using (hermite_heat_coefficient k j).symm · intro l hl hne by_cases hlbig : 2*k+j < 2*l · rw [Nat.descFactorial_of_lt hlbig] simp · have hne' : 2*k+j-2*l ≠ j := by omega simp [hne', Ne.symm hne'] · intro hnot have : k < (2*k+j)/2+1 := by omega exact (hnot (Finset.mem_range.mpr this)).elim · rw [Polynomial.coeff_hermite_of_odd_add (by apply Nat.not_even_iff_odd.mp intro h obtain ⟨r, hr⟩ := h apply heven exact ⟨r-j, by omega⟩)] simp only [map_zero] apply Finset.sum_eq_zero intro l hl by_cases hlbig : n < 2*l · rw [Nat.descFactorial_of_lt hlbig] simp · have hne : n-2*l ≠ j := by intro h apply heven exact ⟨l, by omega⟩ simp [hne, Ne.symm hne] · rw [Polynomial.coeff_hermite_of_lt (by omega)] simp only [map_zero] apply Finset.sum_eq_zero intro l hl simp [show j ≠ n-2*l by omega]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_unit_monomial · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:49

Affine substitution multiplies the iterated derivative by the appropriate power of its slope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
x σ :
ℝ
j :
ℕ
polyDeriv j (p.comp (C x + C σ * X))
= C (σ^j) * (polyDeriv j p).comp (C x + C σ * X)
Proof (Lean source)
lemma polyDeriv_affine (p : Polynomial ℝ) (x σ : ℝ) (j : ℕ) : polyDeriv j (p.comp (C x + C σ * X)) = C (σ^j) * (polyDeriv j p).comp (C x + C σ * X) := by induction j generalizing p with | zero => simp [polyDeriv] | succ j ih => simp only [polyDeriv, Function.iterate_succ_apply'] at ih ⊢ rw [ih, Polynomial.derivative_C_mul, Polynomial.derivative_comp] simp only [Polynomial.derivative_add, Polynomial.derivative_C, Polynomial.derivative_C_mul, Polynomial.derivative_X, mul_one, zero_add] rw [pow_succ, Polynomial.C_mul] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.polyDeriv_affine · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:97
theorem affine_coeff_derivative Lemma affine_coeff_derivative in the paper ↗

The coefficients after affine substitution are the scaled finite Taylor coefficients. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
x σ :
ℝ
j :
ℕ
(p.comp (C x + C σ * X)).coeff j
= σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ)
Proof (Lean source)
lemma affine_coeff_derivative (p : Polynomial ℝ) (x σ : ℝ) (j : ℕ) : (p.comp (C x + C σ * X)).coeff j = σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ) := by have ht := Polynomial.taylor_coeff (r := x) (f := p) j have hd := congrArg (fun f : Polynomial ℝ → Polynomial ℝ => (f p).eval x) (Polynomial.factorial_smul_hasseDeriv (R := ℝ) (k := j)) simp only [LinearMap.smul_apply, map_nsmul, nsmul_eq_mul] at hd have hf : (Nat.factorial j : ℝ) ≠ 0 := by positivity have he : (Polynomial.hasseDeriv j p).eval x = (polyDeriv j p).eval x / (Nat.factorial j : ℝ) := by apply (eq_div_iff hf).mpr simpa [polyDeriv, mul_comm] using hd have ha : p.comp (C x + C σ * X) = (Polynomial.taylor x p).comp (C σ * X) := by simp only [Polynomial.taylor_apply, Polynomial.comp_assoc, Polynomial.add_comp, Polynomial.X_comp, Polynomial.C_comp] congr 1 ring rw [ha, Polynomial.comp_C_mul_X_coeff, ht, he] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.affine_coeff_derivative · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:111
theorem finiteInverseHeat_affine_eval Lemma finiteInverseHeat_affine_eval in the paper ↗

Translation and scaling reduce inverse heat evaluation to the unit-noise operator. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
x σ z :
ℝ
(finiteInverseHeat m σ p).eval (x+σ*z)
= (finiteInverseHeat m 1 (p.comp (C x + C σ * X))).eval z
Proof (Lean source)
lemma finiteInverseHeat_affine_eval (p : Polynomial ℝ) (m : ℕ) (x σ z : ℝ) : (finiteInverseHeat m σ p).eval (x+σ*z) = (finiteInverseHeat m 1 (p.comp (C x + C σ * X))).eval z := by simp only [finiteInverseHeat, Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C, polyDeriv_affine, Polynomial.eval_comp, Polynomial.eval_add, Polynomial.eval_X] apply Finset.sum_congr rfl intro k hk rw [show -σ^2/2 = (-1/2 : ℝ)*σ^2 by ring, mul_pow, pow_mul] norm_num only [one_pow] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_affine_eval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:132
theorem finiteInverseHeat_hermite_expansion Lemma finiteInverseHeat_hermite_expansion in the paper ↗

A polynomial of bounded degree has the exact finite inverse-heat Hermite expansion. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
hp :
p.natDegree ≤ m
x σ z :
ℝ
(finiteInverseHeat m σ p).eval (x+σ*z)
= ∑ j ∈ range (m+1), (σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ)
Proof (Lean source)
lemma finiteInverseHeat_hermite_expansion (p : Polynomial ℝ) (m : ℕ) (hp : p.natDegree ≤ m) (x σ z : ℝ) : (finiteInverseHeat m σ p).eval (x+σ*z) = ∑ j ∈ range (m+1), (σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ)) * (aeval z (hermite j) : ℝ) := by let q := p.comp (C x + C σ * X) have hq : q.natDegree ≤ m := by apply (Polynomial.natDegree_comp_le).trans have ha : (C x + C σ * X).natDegree ≤ 1 := by apply (Polynomial.natDegree_add_le _ _).trans simp only [Polynomial.natDegree_C] exact max_le (by omega) ((Polynomial.natDegree_C_mul_le _ _).trans (by simp)) exact (Nat.mul_le_mul_left _ ha).trans (by simpa using hp) rw [finiteInverseHeat_affine_eval, finiteInverseHeat_coeff_decomposition q m 1 hq] simp only [Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C] apply Finset.sum_congr rfl intro j hj rw [finiteInverseHeat_cutoff (X^j) 1 j m (by simp) (by have := Finset.mem_range.mp hj; omega), finiteInverseHeat_unit_monomial] rw [show q.coeff j = σ^j * (polyDeriv j p).eval x / (Nat.factorial j : ℝ) from affine_coeff_derivative p x σ j] have hcast : castRingHom ℝ = algebraMap ℤ ℝ := by ext n simp rw [hcast, Polynomial.eval_map_algebraMap]
CausalSmith.Stat.RdTruesideNoiseFrontier.finiteInverseHeat_hermite_expansion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/HeatHermite.lean:145
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Kernel 25 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

The removable endpoint value of the Chebyshev quotient is the squared index. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
(endpointF L).eval 0 = (L : ℝ)^2
Proof (Lean source)
lemma endpointF_eval_zero (L : ℕ) : (endpointF L).eval 0 = (L : ℝ)^2 := by let p : Polynomial ℝ := 1 - (chebyshev L).comp (1 - C 2 * X) have hid := congrArg (fun q : Polynomial ℝ => q.derivative.eval 0) (Polynomial.X_mul_divX_add p) simp only [Polynomial.derivative_add, Polynomial.derivative_mul, Polynomial.derivative_X, Polynomial.derivative_C, Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_X, zero_mul, add_zero, one_mul] at hid have hd : p.derivative.eval 0 = 2 * (L : ℝ)^2 := by simp [p, chebyshev, Polynomial.derivative_comp, Polynomial.Chebyshev.T_derivative_eq_U, Polynomial.Chebyshev.U_eval_one] ring simp only [endpointF, Polynomial.eval_mul, Polynomial.eval_C] change (1/2 : ℝ) * (Polynomial.divX p).eval 0 = (L : ℝ)^2 rw [hid, hd] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_eval_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:30

Multiplication by the score recovers the Chebyshev numerator, including zero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x :
ℝ
2 * x * (endpointF L).eval x = 1 - (chebyshev L).eval (1 - 2*x)
Proof (Lean source)
lemma endpointF_mul_score (L : ℕ) (x : ℝ) : 2 * x * (endpointF L).eval x = 1 - (chebyshev L).eval (1 - 2*x) := by have hid := congrArg (fun p : Polynomial ℝ => p.eval x) (Polynomial.X_mul_divX_add (1 - (chebyshev L).comp (1 - C 2 * X))) have hz : (1 - (chebyshev L).comp (1 - C 2 * X)).coeff 0 = 0 := by simp [Polynomial.coeff_zero_eq_eval_zero, chebyshev] simp only [Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_X, Polynomial.eval_C, Polynomial.eval_sub, Polynomial.eval_one, Polynomial.eval_comp, hz] at hid simp only [endpointF, Polynomial.eval_mul, Polynomial.eval_C] nlinarith [hid]
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_mul_score · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:47
theorem endpointF_sine_identity Lemma endpointF_sine_identity in the paper ↗

The quotient has the sine-square representation used for endpoint concentration. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
u :
ℝ
(sin u)^2 * (endpointF L).eval ((sin u)^2) = (sin ((L : ℝ)*u))^2
Proof (Lean source)
lemma endpointF_sine_identity (L : ℕ) (u : ℝ) : (sin u)^2 * (endpointF L).eval ((sin u)^2) = (sin ((L : ℝ)*u))^2 := by have hcos : 1 - 2 * (sin u)^2 = cos (2*u) := by nlinarith [Real.cos_two_mul u, Real.sin_sq_add_cos_sq u] have h := endpointF_mul_score L ((sin u)^2) rw [hcos, chebyshev, Polynomial.Chebyshev.T_real_cos] at h have hh := Real.sin_sq_eq_half_sub ((L : ℝ)*u) have he : (L : ℝ) * (2*u) = 2*((L : ℝ)*u) := by ring norm_cast at h rw [he] at h nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_sine_identity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:62
theorem endpoint_sin_nat_mul_bound Lemma endpoint_sin_nat_mul_bound in the paper ↗

The sine addition formula bounds an integer frequency by its index times the base sine. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
u :
ℝ
|sin ((L : ℝ)*u)| ≤ (L : ℝ) * |sin u|
Proof (Lean source)
lemma endpoint_sin_nat_mul_bound (L : ℕ) (u : ℝ) : |sin ((L : ℝ)*u)| ≤ (L : ℝ) * |sin u| := by induction L with | zero => simp | succ L ih => rw [Nat.cast_succ, add_mul, one_mul, Real.sin_add] calc _ ≤ |sin ((L : ℝ)*u) * cos u| + |cos ((L : ℝ)*u) * sin u| := abs_add_le _ _ _ ≤ |sin ((L : ℝ)*u)| + |sin u| := by rw [abs_mul, abs_mul] exact add_le_add (mul_le_of_le_one_right (abs_nonneg _) (Real.abs_cos_le_one _)) (mul_le_of_le_one_left (abs_nonneg _) (Real.abs_cos_le_one _)) _ ≤ ((L : ℝ)+1) * |sin u| := by nlinarith [ih]
CausalSmith.Stat.RdTruesideNoiseFrontier.endpoint_sin_nat_mul_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:76

The quotient is uniformly bounded by the squared index throughout the latent arm. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) 1
(endpointF L).eval x ≤ (L : ℝ)^2
Proof (Lean source)
lemma endpointF_le_index_sq (L : ℕ) (x : ℝ) (hx : x ∈ Icc (0 : ℝ) 1) : (endpointF L).eval x ≤ (L : ℝ)^2 := by by_cases hz : x = 0 · subst x; exact le_of_eq (endpointF_eval_zero L) have hxp : 0 < x := lt_of_le_of_ne hx.1 (Ne.symm hz) let u := Real.arcsin (sqrt x) have hs : sin u = sqrt x := Real.sin_arcsin (by linarith [Real.sqrt_nonneg x]) ((Real.sqrt_le_one).mpr hx.2) have hs2 : (sin u)^2 = x := by rw [hs, Real.sq_sqrt hx.1] have hid := endpointF_sine_identity L u rw [hs2] at hid have hb := endpoint_sin_nat_mul_bound L u have hsq := mul_self_le_mul_self (abs_nonneg (sin ((L : ℝ)*u))) hb rw [← sq, ← sq, sq_abs, mul_pow, sq_abs, hs2] at hsq nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_le_index_sq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:93

Away from zero the quotient is bounded by the reciprocal score. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x :
ℝ
hx :
x ∈ Ioc (0 : ℝ) 1
(endpointF L).eval x ≤ x⁻¹
Proof (Lean source)
lemma endpointF_le_inv_score (L : ℕ) (x : ℝ) (hx : x ∈ Ioc (0 : ℝ) 1) : (endpointF L).eval x ≤ x⁻¹ := by have hc : -1 ≤ (chebyshev L).eval (1 - 2*x) := by rw [chebyshev, ← Real.cos_arccos (show -1 ≤ 1 - 2*x by linarith [hx.2]) (show 1 - 2*x ≤ 1 by linarith [hx.1]), Polynomial.Chebyshev.T_real_cos] exact Real.neg_one_le_cos _ have hid := endpointF_mul_score L x apply (mul_le_mul_iff_left₀ hx.1).mp rw [inv_mul_cancel₀ hx.1.ne'] nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_le_inv_score · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:110

On the endpoint window, Jordan's sine inequality gives a squared-index lower bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) (1 / (16*(L : ℝ)^2))
(2 / pi)^2 * (L : ℝ)^2 ≤ (endpointF L).eval x
Proof (Lean source)
lemma endpointF_lower_window (L : ℕ) (hL : 1 ≤ L) (x : ℝ) (hx : x ∈ Icc (0 : ℝ) (1 / (16*(L : ℝ)^2))) : (2 / pi)^2 * (L : ℝ)^2 ≤ (endpointF L).eval x := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hLr : (1 : ℝ) ≤ L := by exact_mod_cast hL have ha : 0 < 2 / pi := by positivity have ha1 : 2 / pi ≤ 1 := (div_le_one Real.pi_pos).mpr (by linarith [Real.two_le_pi]) by_cases hz : x = 0 · subst x rw [endpointF_eval_zero] exact mul_le_of_le_one_left (sq_nonneg _) (by nlinarith) have hxp : 0 < x := lt_of_le_of_ne hx.1 (Ne.symm hz) have hx1 : x ≤ 1 := by have hb := (le_div_iff₀ (by positivity : 0 < 16*(L : ℝ)^2)).mp hx.2 nlinarith let u := Real.arcsin (sqrt x) have hu : 0 ≤ u := Real.arcsin_nonneg.mpr (Real.sqrt_nonneg x) have hs : sin u = sqrt x := Real.sin_arcsin (by linarith [Real.sqrt_nonneg x]) (Real.sqrt_le_one.mpr hx1) have hs2 : (sin u)^2 = x := by rw [hs, Real.sq_sqrt hx.1] have hbase := Real.mul_le_sin hu (Real.arcsin_le_pi_div_two (sqrt x)) have hroot : (L : ℝ) * sqrt x ≤ 1/4 := by have hb := (le_div_iff₀ (by positivity : 0 < 16*(L : ℝ)^2)).mp hx.2 nlinarith [Real.sq_sqrt hx.1, mul_nonneg hLp.le (Real.sqrt_nonneg x)] have hLu : (L : ℝ) * u ≤ pi / 2 := by rw [hs] at hbase have hm := mul_le_mul_of_nonneg_left hbase hLp.le have hp := (div_le_iff₀ Real.pi_pos).mp (show 2*((L : ℝ)*u)/pi ≤ 1/4 by calc _ = (L : ℝ) * (2/pi*u) := by ring _ ≤ (L : ℝ) * sqrt x := hm _ ≤ 1/4 := hroot) linarith [Real.pi_pos] have hlow := Real.mul_le_sin (mul_nonneg hLp.le hu) hLu have hup : sin u ≤ u := Real.sin_le hu have hsinL : 0 ≤ sin ((L : ℝ)*u) := le_trans (mul_nonneg ha.le (mul_nonneg hLp.le hu)) hlow have hscale : (2/pi) * (L : ℝ) * sin u ≤ sin ((L : ℝ)*u) := by calc _ ≤ (2/pi) * (L : ℝ) * u := mul_le_mul_of_nonneg_left hup (mul_nonneg ha.le hLp.le) _ ≤ _ := by simpa only [mul_assoc] using hlow have hsq := mul_self_le_mul_self (mul_nonneg (mul_nonneg ha.le hLp.le) (by rw [hs]; positivity)) hscale have hid := endpointF_sine_identity L u rw [← sq, ← sq, mul_pow, mul_pow, hs2, ← hid, hs2] at hsq exact (mul_le_mul_iff_left₀ hxp).mp (by simpa only [mul_comm] using hsq)
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_lower_window · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:122

The nonnegative cubed endpoint quotient has strictly positive normalization for every positive index. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
0 < ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3
Proof (Lean source)
lemma endpointNormalizer_pos (L : ℕ) (hL : 1 ≤ L) : 0 < ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 := by apply intervalIntegral.integral_pos (by norm_num) · fun_prop · intro x hx exact pow_nonneg (endpointF_nonneg L x ⟨hx.1.le, hx.2⟩) 3 · refine ⟨0, by norm_num, ?_⟩ rw [endpointF_eval_zero] have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) positivity
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointNormalizer_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:172
theorem endpointNormalizer_lower_bound Lemma endpointNormalizer_lower_bound in the paper ↗

Integrating the endpoint window gives the normalization lower bound from the roadmap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
4 / pi^6 * (L : ℝ)^4 ≤ ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3
Proof (Lean source)
lemma endpointNormalizer_lower_bound (L : ℕ) (hL : 1 ≤ L) : 4 / pi^6 * (L : ℝ)^4 ≤ ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 := by have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hLr : (1 : ℝ) ≤ L := by exact_mod_cast hL let δ : ℝ := 1 / (16*(L : ℝ)^2) have hδ : 0 ≤ δ := by positivity have hδ1 : δ ≤ 1 := by apply (div_le_one (by positivity : 0 < 16*(L : ℝ)^2)).mpr nlinarith have hint : IntervalIntegrable (fun t => (endpointF L).eval t ^ 3) volume 0 1 := by apply Continuous.intervalIntegrable fun_prop have hsub : (∫ t in (0 : ℝ)..δ, (endpointF L).eval t ^ 3) ≤ ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 := by apply intervalIntegral.integral_mono_interval le_rfl hδ hδ1 _ hint filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht exact pow_nonneg (endpointF_nonneg L t ⟨ht.1.le, ht.2⟩) 3 have hlocal : (∫ _t in (0 : ℝ)..δ, ((2/pi)^2*(L : ℝ)^2)^3) ≤ ∫ t in (0 : ℝ)..δ, (endpointF L).eval t ^ 3 := by apply intervalIntegral.integral_mono_on hδ (continuous_const.intervalIntegrable 0 δ) (((endpointF L).continuous.pow 3).intervalIntegrable 0 δ) intro t ht exact pow_le_pow_left₀ (by positivity) (endpointF_lower_window L hL t ht) 3 have heq : (∫ _t in (0 : ℝ)..δ, ((2/pi)^2*(L : ℝ)^2)^3) = 4 / pi^6 * (L : ℝ)^4 := by rw [intervalIntegral.integral_const] simp only [sub_zero, smul_eq_mul, δ] field_simp <;> ring rw [heq] at hlocal exact hlocal.trans hsub
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointNormalizer_lower_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:184
theorem endpointKernel_integral_one Lemma endpointKernel_integral_one in the paper ↗

The endpoint kernel has unit mass because its cubed quotient normalization is nonzero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x) = 1
Proof (Lean source)
lemma endpointKernel_integral_one (L : ℕ) (hL : 1 ≤ L) : (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x) = 1 := by have hz := endpointNormalizer_pos L hL simp only [endpointKernel, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_pow] rw [intervalIntegral.integral_const_mul] exact inv_mul_cancel₀ hz.ne'
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_integral_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:219
theorem endpointKernel_le_index_sq Lemma endpointKernel_le_index_sq in the paper ↗

Normalization converts the quotient bound into a uniform squared-index kernel envelope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) 1
(endpointKernel L).eval x ≤ (pi^6 / 4) * (L : ℝ)^2
Proof (Lean source)
lemma endpointKernel_le_index_sq (L : ℕ) (hL : 1 ≤ L) (x : ℝ) (hx : x ∈ Icc (0 : ℝ) 1) : (endpointKernel L).eval x ≤ (pi^6 / 4) * (L : ℝ)^2 := by let Z : ℝ := ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 have hZ : 0 < Z := endpointNormalizer_pos L hL have hlow := endpointNormalizer_lower_bound L hL have hc : 0 ≤ pi^6 / 4 * (L : ℝ)^2 := by positivity have hmul := mul_le_mul_of_nonneg_left hlow hc have heq : (pi^6 / 4 * (L : ℝ)^2) * (4 / pi^6 * (L : ℝ)^4) = (L : ℝ)^6 := by field_simp <;> ring rw [heq] at hmul have hcube : ((endpointF L).eval x)^3 ≤ (L : ℝ)^6 := by have h := pow_le_pow_left₀ (endpointF_nonneg L x hx) (endpointF_le_index_sq L x hx) 3 simpa only [← pow_mul] using h simp only [endpointKernel, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_pow] change Z⁻¹ * ((endpointF L).eval x)^3 ≤ _ apply (mul_le_mul_iff_right₀ hZ).mp calc Z * (Z⁻¹ * ((endpointF L).eval x)^3) = ((endpointF L).eval x)^3 := by rw [← mul_assoc, mul_inv_cancel₀ hZ.ne', one_mul] _ ≤ (L : ℝ)^6 := hcube _ ≤ Z * (pi^6 / 4 * (L : ℝ)^2) := by simpa only [Z, mul_comm] using hmul
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_le_index_sq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:227
theorem endpointKernel_square_integral_bound Lemma endpointKernel_square_integral_bound in the paper ↗

Unit mass and the uniform kernel envelope give its square-mass bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
(∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ (pi^6 / 4) * (L : ℝ)^2
Proof (Lean source)
lemma endpointKernel_square_integral_bound (L : ℕ) (hL : 1 ≤ L) : (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ (pi^6 / 4) * (L : ℝ)^2 := by calc _ ≤ ∫ x in (0 : ℝ)..1, (pi^6 / 4 * (L : ℝ)^2) * (endpointKernel L).eval x := by apply intervalIntegral.integral_mono_on (by norm_num) (((endpointKernel L).continuous.pow 2).intervalIntegrable 0 1) ((continuous_const.mul (endpointKernel L).continuous).intervalIntegrable 0 1) intro x hx simpa only [Pi.mul_apply, pow_two] using mul_le_mul_of_nonneg_right (endpointKernel_le_index_sq L hL x hx) (endpointKernel_nonneg L x hx) _ = _ := by rw [intervalIntegral.integral_const_mul, endpointKernel_integral_one L hL, mul_one]
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_square_integral_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:254
theorem endpointKernel_tail_bound Lemma endpointKernel_tail_bound in the paper ↗

The reciprocal-score quotient bound and normalization give the cubic kernel tail. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
x :
ℝ
hx :
x ∈ Ioc (0 : ℝ) 1
(endpointKernel L).eval x ≤ (pi^6 / 4) * ((L : ℝ)^2)⁻¹^2 * x ^ (-3 : ℝ)
Proof (Lean source)
lemma endpointKernel_tail_bound (L : ℕ) (hL : 1 ≤ L) (x : ℝ) (hx : x ∈ Ioc (0 : ℝ) 1) : (endpointKernel L).eval x ≤ (pi^6 / 4) * ((L : ℝ)^2)⁻¹^2 * x ^ (-3 : ℝ) := by let Z : ℝ := ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 have hZ : 0 < Z := endpointNormalizer_pos L hL have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hlow := endpointNormalizer_lower_bound L hL have hcube := pow_le_pow_left₀ (endpointF_nonneg L x ⟨hx.1.le, hx.2⟩) (endpointF_le_inv_score L x hx) 3 have heq : (pi^6 / 4 * ((L : ℝ)^2)⁻¹^2 * x ^ (-3 : ℝ)) * (4 / pi^6 * (L : ℝ)^4) = x⁻¹^3 := by rw [Real.rpow_neg hx.1.le] norm_num [Real.rpow_ofNat] field_simp <;> ring have hm := mul_le_mul_of_nonneg_left hlow (show 0 ≤ pi^6 / 4 * ((L : ℝ)^2)⁻¹^2 * x ^ (-3 : ℝ) by exact mul_nonneg (by positivity) (Real.rpow_nonneg hx.1.le _)) rw [heq] at hm simp only [endpointKernel, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_pow] change Z⁻¹ * ((endpointF L).eval x)^3 ≤ _ apply (mul_le_mul_iff_right₀ hZ).mp calc Z * (Z⁻¹ * ((endpointF L).eval x)^3) = ((endpointF L).eval x)^3 := by rw [← mul_assoc, mul_inv_cancel₀ hZ.ne', one_mul] _ ≤ x⁻¹^3 := hcube _ ≤ Z * _ := by simpa only [Z, mul_comm] using hm
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_tail_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:270
theorem endpointKernel_moment_bound Lemma endpointKernel_moment_bound in the paper ↗

Splitting at the squared-index resolution bounds the endpoint bias moment. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
L :
ℕ
hL :
1 ≤ L
kernelMoment L β ≤ (2 * (pi^6 / 4)) * (L : ℝ) ^ (-2 * β)
Proof (Lean source)
lemma endpointKernel_moment_bound (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (L : ℕ) (hL : 1 ≤ L) : kernelMoment L β ≤ (2 * (pi^6 / 4)) * (L : ℝ) ^ (-2 * β) := by let δ : ℝ := ((L : ℝ)^2)⁻¹ let C : ℝ := pi^6 / 4 have hLp : (0 : ℝ) < L := by exact_mod_cast (show 0 < L by omega) have hLr : (1 : ℝ) ≤ L := by exact_mod_cast hL have hδ : 0 < δ := by positivity have hδ1 : δ ≤ 1 := by dsimp [δ] apply inv_le_one_of_one_le₀ nlinarith have hC : 0 ≤ C := by positivity have hβ0 : 0 ≤ β := hβ.1.le have hcont : Continuous (fun x : ℝ => x ^ β * (endpointKernel L).eval x) := by fun_prop have hlo : (∫ x in (0 : ℝ)..δ, x ^ β * (endpointKernel L).eval x) ≤ C * δ ^ β := by calc _ ≤ ∫ _x in (0 : ℝ)..δ, δ ^ β * (C * (L : ℝ)^2) := by apply intervalIntegral.integral_mono_on hδ.le (hcont.intervalIntegrable 0 δ) (continuous_const.intervalIntegrable 0 δ) intro x hx exact mul_le_mul (Real.rpow_le_rpow hx.1 hx.2 hβ.1.le) (endpointKernel_le_index_sq L hL x ⟨hx.1, hx.2.trans hδ1⟩) (endpointKernel_nonneg L x ⟨hx.1, hx.2.trans hδ1⟩) (Real.rpow_nonneg hδ.le β) _ = C * δ ^ β := by rw [intervalIntegral.integral_const] simp only [sub_zero, smul_eq_mul] dsimp [δ] field_simp have hpow : ContinuousOn (fun x : ℝ => x ^ (β - 3)) (Icc δ 1) := by apply ContinuousOn.rpow_const continuousOn_id intro x hx exact inl (ne_of_gt (hδ.trans_le hx.1)) have hint : IntervalIntegrable (fun x : ℝ => x ^ (β - 3)) volume δ 1 := hpow.intervalIntegrable_of_Icc hδ1 have hhi : (∫ x in δ..1, x ^ β * (endpointKernel L).eval x) ≤ C * δ ^ β := by calc _ ≤ ∫ x in δ..1, C * δ^2 * x ^ (β - 3) := by apply intervalIntegral.integral_mono_on hδ1 (hcont.intervalIntegrable δ 1) (hint.const_mul (C * δ^2)) intro x hx have hxpos := hδ.trans_le hx.1 calc _ ≤ x ^ β * (C * δ^2 * x ^ (-3 : ℝ)) := mul_le_mul_of_nonneg_left (endpointKernel_tail_bound L hL x ⟨hxpos, hx.2⟩) (Real.rpow_nonneg hxpos.le β) _ = C * δ^2 * x ^ (β - 3) := by rw [sub_eq_add_neg, Real.rpow_add hxpos] ring _ = C * δ^2 * ((δ ^ (β - 2) - 1) / (2 - β)) := by rw [intervalIntegral.integral_const_mul, integral_rpow] · simp only [Real.one_rpow] congr 1 have he : β - 3 + 1 = β - 2 := by ring rw [he] field_simp [show β - 2 ≠ 0 by linarith [hβ.2], show 2 - β ≠ 0 by linarith [hβ.2]] <;> ring · right refine ⟨by linarith [hβ.2], ?_⟩ rw [uIcc_of_le hδ1] exact fun h => (not_le_of_gt hδ) h.1 _ ≤ C * δ^2 * δ ^ (β - 2) := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply (div_le_iff₀ (show 0 < 2 - β by linarith [hβ.2])).mpr nlinarith [Real.rpow_nonneg hδ.le (β - 2), hβ.2] _ = C * δ ^ β := by rw [Real.rpow_sub hδ] norm_num [Real.rpow_ofNat] field_simp have hres : δ ^ β = (L : ℝ) ^ (-2 * β) := by have hd : δ = (L : ℝ) ^ (-2 : ℝ) := by dsimp [δ] rw [Real.rpow_neg hLp.le] norm_num [Real.rpow_ofNat] rw [hd, ← Real.rpow_mul hLp.le] unfold kernelMoment rw [← intervalIntegral.integral_add_adjacent_intervals (hcont.intervalIntegrable 0 δ) (hcont.intervalIntegrable δ 1)] calc _ ≤ C * δ ^ β + C * δ ^ β := add_le_add hlo hhi _ = _ := by rw [hres]; dsimp [C]; ring
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_moment_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:299
theorem positive_endpoint

Positive normalized endpoint kernels and their bias and square-mass bounds. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ C : ℝ,
0 < C
conclusion 1
L :
ℕ
1 ≤ L
x ∈ Icc (0 : ℝ) 1 :
0 ≤ (endpointKernel L).eval x
(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x) = 1
kernelMoment L β ≤ C * (L : ℝ) ^ (-2 * β)
(∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ C * (L : ℝ)^2
Proof (Lean source)
-- @node: lem:positive-endpoint lemma positive_endpoint (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ C : ℝ, 0 < C ∧ ∀ L : ℕ, 1 ≤ L → -- @realizes C(beta-dependent positive constant) (∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ (endpointKernel L).eval x) ∧ (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x) = 1 ∧ kernelMoment L β ≤ C * (L : ℝ) ^ (-2 * β) ∧ (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ C * (L : ℝ)^2 := by suffices hmoment : ∃ C : ℝ, 0 < C ∧ ∀ L : ℕ, 1 ≤ L → kernelMoment L β ≤ C * (L : ℝ) ^ (-2 * β) by obtain ⟨C, hC, hb⟩ := hmoment refine ⟨max C (pi^6 / 4), lt_max_of_lt_left hC, ?_⟩ intro L hL refine ⟨endpointKernel_nonneg L, endpointKernel_integral_one L hL, ?_, ?_⟩ · exact (hb L hL).trans (mul_le_mul_of_nonneg_right (le_max_left _ _) (Real.rpow_nonneg (by positivity) _)) · exact (endpointKernel_square_integral_bound L hL).trans (mul_le_mul_of_nonneg_right (le_max_right _ _) (sq_nonneg _)) refine ⟨2 * (pi^6 / 4), by positivity, ?_⟩ exact fun L hL => endpointKernel_moment_bound β hβ L hL
CausalSmith.Stat.RdTruesideNoiseFrontier.positive_endpoint · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:385
theorem shiftedLegendre_parity_weight_sum Lemma shiftedLegendre_parity_weight_sum in the paper ↗

The odd-parity Legendre derivative weights have the exact endpoint total. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
2 * (∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1))
= (j : ℝ) * (j+1)
Proof (Lean source)
lemma shiftedLegendre_parity_weight_sum (j : ℕ) : 2 * (∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1)) = (j : ℝ) * (j+1) := by have hall (n : ℕ) : (∑ k ∈ range n, (2 * (k : ℝ) + 1)) = (n : ℝ)^2 := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih] push_cast ring induction j with | zero => simp | succ j ih => have hsum : (∑ k ∈ (range (j+1)).filter (fun k => Odd (j+1-k)), (2*(k : ℝ)+1)) + (∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1)) = ((j : ℝ)+1)^2 := by simp only [Finset.sum_filter] rw [Finset.sum_range_succ] have hflip : (∑ k ∈ range j, if Odd (j+1-k) then (2*(k : ℝ)+1) else 0) + (∑ k ∈ range j, if Odd (j-k) then (2*(k : ℝ)+1) else 0) = (j : ℝ)^2 := by rw [← Finset.sum_add_distrib, ← hall j] apply Finset.sum_congr rfl intro k hk have heq : j+1-k = (j-k)+1 := by have := Finset.mem_range.mp hk; omega rw [heq] by_cases ho : Odd (j-k) <;> simp [Nat.odd_add_one, ho] have hone : j+1-j = 1 := by omega simp only [hone, show Odd (1 : ℕ) from odd_one, if_true] nlinarith [hflip] simp only [Nat.cast_succ] nlinarith [hsum]
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_parity_weight_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:405
theorem shiftedLegendre_deriv_bound_of_expansion Lemma shiftedLegendre_deriv_bound_of_expansion in the paper ↗

The cited unit bound and derivative expansion imply the sharp endpoint derivative bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
hexp :
∀ t : ℝ,
= 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) * shiftedLegendre k t
t ∈ Set.Icc (0 : ℝ) 1 :
|deriv (shiftedLegendre j) t| ≤ (j : ℝ) * (j+1)
Proof (Lean source)
lemma shiftedLegendre_deriv_bound_of_expansion (hleg : ClassicalLegendreFacts) (j : ℕ) (hexp : ∀ t : ℝ, deriv (shiftedLegendre j) t = 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) * shiftedLegendre k t) : ∀ t ∈ Icc (0 : ℝ) 1, |deriv (shiftedLegendre j) t| ≤ (j : ℝ) * (j+1) := by intro t ht have hunit (k : ℕ) : |shiftedLegendre k t| ≤ 1 := by exact (hleg k 0).2.2.1 (2*t-1) ⟨by linarith [ht.1], by linarith [ht.2]⟩ rw [hexp t, abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] calc _ ≤ 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), |(2 * (k : ℝ) + 1) * shiftedLegendre k t| := mul_le_mul_of_nonneg_left (Finset.abs_sum_le_sum_abs _ _) (by norm_num) _ ≤ 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) apply Finset.sum_le_sum intro k hk rw [abs_mul, abs_of_nonneg (by positivity : 0 ≤ 2 * (k : ℝ) + 1)] exact mul_le_of_le_one_right (by positivity) (hunit k) _ = _ := shiftedLegendre_parity_weight_sum j
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_deriv_bound_of_expansion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:440
theorem shifted_legendre_derivative

Derivative expansion with the odd parity restriction, and its endpoint bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
hj :
1 ≤ j
conclusion 1
t :
ℝ
= 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) * shiftedLegendre k t
conclusion 2
t ∈ Icc (0 : ℝ) 1 :
|deriv (shiftedLegendre j) t| ≤ (j : ℝ) * (j+1)
Proof (Lean source)
-- @node: lem:shifted-legendre-derivative lemma shifted_legendre_derivative (j : ℕ) (hj : 1 ≤ j) : (∀ t : ℝ, deriv (shiftedLegendre j) t = 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) * shiftedLegendre k t) ∧ (∀ t ∈ Icc (0 : ℝ) 1, |deriv (shiftedLegendre j) t| ≤ (j : ℝ) * (j+1)) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts suffices hexp : ∀ t : ℝ, deriv (shiftedLegendre j) t = 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2 * (k : ℝ) + 1) * shiftedLegendre k t by exact ⟨hexp, shiftedLegendre_deriv_bound_of_expansion legendre_of_gate j hexp⟩ exact shiftedLegendre_derivative_expansion legendre_of_gate j
CausalSmith.Stat.RdTruesideNoiseFrontier.shifted_legendre_derivative · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:463
theorem shiftedLegendre_sum_square_integral Lemma shiftedLegendre_sum_square_integral in the paper ↗

Finite shifted Legendre expansions have the diagonal square integral prescribed by orthogonality. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
s :
Finset ℕ
c :
ℕ → ℝ
(∫ x in (0 : ℝ)..1, (∑ k ∈ s, c k * shiftedLegendre k x)^2)
= ∑ k ∈ s, (c k)^2 / (2*(k : ℝ)+1)
Proof (Lean source)
lemma shiftedLegendre_sum_square_integral (hleg : ClassicalLegendreFacts) (s : Finset ℕ) (c : ℕ → ℝ) : (∫ x in (0 : ℝ)..1, (∑ k ∈ s, c k * shiftedLegendre k x)^2) = ∑ k ∈ s, (c k)^2 / (2*(k : ℝ)+1) := by classical have hint (j k : ℕ) : IntervalIntegrable (fun x => c j * shiftedLegendre j x * (c k * shiftedLegendre k x)) volume 0 1 := by apply Continuous.intervalIntegrable unfold shiftedLegendre fun_prop simp_rw [pow_two, Finset.sum_mul, Finset.mul_sum] rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_congr rfl intro j hj rw [intervalIntegral.integral_finsetSum] · have heq (k : ℕ) : (∫ x in (0 : ℝ)..1, c j * shiftedLegendre j x * (c k * shiftedLegendre k x)) = if j = k then (c j)^2 / (2*(j : ℝ)+1) else 0 := by have hf : (fun x => c j * shiftedLegendre j x * (c k * shiftedLegendre k x)) = (fun x => (c j * c k) * (legendreP j (2*x-1) * legendreP k (2*x-1))) := by funext x unfold shiftedLegendre ring rw [hf, intervalIntegral.integral_const_mul, shiftedLegendre_orthogonal hleg] split_ifs with h · subst k; ring · ring simp_rw [heq] simp [hj, pow_two] · intro k hk exact hint j k · intro j hj apply Continuous.intervalIntegrable unfold shiftedLegendre fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_sum_square_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:476
theorem polynomial_shiftedLegendre_parseval Lemma polynomial_shiftedLegendre_parseval in the paper ↗

Orthogonal expansion gives Parseval's identity for every degree-bounded real polynomial. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
hm :
p.natDegree ≤ m
(∫ x in (0 : ℝ)..1, (p.eval x)^2)
= ∑ k ∈ range (m+1), ((2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x))^2 / (2*(k : ℝ)+1)
Proof (Lean source)
lemma polynomial_shiftedLegendre_parseval (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m : ℕ) (hm : p.natDegree ≤ m) : (∫ x in (0 : ℝ)..1, (p.eval x)^2) = ∑ k ∈ range (m+1), ((2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x))^2 / (2*(k : ℝ)+1) := by have hd : p.degree < (m+1 : ℕ) := lt_of_le_of_lt (Polynomial.degree_le_natDegree) (by exact_mod_cast (Nat.lt_succ_of_le hm)) conv_lhs => arg 1; ext x; rw [polynomial_shiftedLegendre_expansion hleg p (m+1) hd x] exact shiftedLegendre_sum_square_integral hleg _ _
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_shiftedLegendre_parseval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:513
theorem polynomial_iterated_derivative_parseval Lemma polynomial_iterated_derivative_parseval in the paper ↗

Parseval identifies the square mass of every iterated derivative with the weighted squared norm of the iterated differentiation coefficients. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m j :
ℕ
hm :
p.natDegree ≤ m
(∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2)
= ∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) (fun l => (2*(l : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre l x)) k)^2 / (2*(k : ℝ)+1)
Proof (Lean source)
lemma polynomial_iterated_derivative_parseval (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m j : ℕ) (hm : p.natDegree ≤ m) : (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2) = ∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) (fun l => (2*(l : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre l x)) k)^2 / (2*(k : ℝ)+1) := by have hp := polynomial_legendre_coefficient_identity hleg p m hm have hd := congrArg (polyDeriv j) hp rw [legendre_expansion_iterated_derivative hleg] at hd rw [hd] simp only [Polynomial.eval_finset_sum, Polynomial.eval_mul, Polynomial.eval_C, forwardLegendrePolynomial_eval] exact shiftedLegendre_sum_square_integral hleg _ _
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_iterated_derivative_parseval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:525
theorem shiftedLegendre_derivative_square_integral Lemma shiftedLegendre_derivative_square_integral in the paper ↗

The parity-restricted derivative expansion has exact square mass twice its endpoint weight. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
(∫ x in (0 : ℝ)..1, (deriv (shiftedLegendre j) x)^2) = 2*(j : ℝ)*(j+1)
Proof (Lean source)
lemma shiftedLegendre_derivative_square_integral (hleg : ClassicalLegendreFacts) (j : ℕ) : (∫ x in (0 : ℝ)..1, (deriv (shiftedLegendre j) x)^2) = 2*(j : ℝ)*(j+1) := by simp_rw [shiftedLegendre_derivative_expansion hleg j] have hf : (fun x => (2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1) * shiftedLegendre k x)^2) = (fun x => 4 * (∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1) * shiftedLegendre k x)^2) := by funext x; ring rw [hf, intervalIntegral.integral_const_mul, shiftedLegendre_sum_square_integral hleg] have hs : (∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1)^2 / (2*(k : ℝ)+1)) = ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1) := by apply Finset.sum_congr rfl intro k hk have hn : 2*(k : ℝ)+1 ≠ 0 := by positivity field_simp rw [hs] nlinarith [shiftedLegendre_parity_weight_sum j]
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_derivative_square_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:543
theorem polynomial_first_derivative_square_bound Lemma polynomial_first_derivative_square_bound in the paper ↗

The Legendre coefficient matrix and weighted Cauchy--Schwarz bound the first derivative square mass. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
hm :
p.natDegree ≤ m
(∫ x in (0 : ℝ)..1, (p.derivative.eval x)^2)
≤ 4 * ((m : ℝ)+1)^4 * (∫ x in (0 : ℝ)..1, (p.eval x)^2)
Proof (Lean source)
lemma polynomial_first_derivative_square_bound (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m : ℕ) (hm : p.natDegree ≤ m) : (∫ x in (0 : ℝ)..1, (p.derivative.eval x)^2) ≤ 4 * ((m : ℝ)+1)^4 * (∫ x in (0 : ℝ)..1, (p.eval x)^2) := by classical let c (k : ℕ) : ℝ := (2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x) let E : ℝ := ∫ x in (0 : ℝ)..1, (p.eval x)^2 have hE : 0 ≤ E := intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; exact sq_nonneg _) have hparse : (∑ k ∈ range (m+1), (c k)^2 / (2*(k : ℝ)+1)) = E := (polynomial_shiftedLegendre_parseval hleg p m hm).symm have hd : p.degree < (m+1 : ℕ) := lt_of_le_of_lt Polynomial.degree_le_natDegree (by exact_mod_cast (Nat.lt_succ_of_le hm)) have hexp : (fun x => p.eval x) = (fun x => ∑ k ∈ range (m+1), c k * shiftedLegendre k x) := by funext x exact polynomial_shiftedLegendre_expansion hleg p (m+1) hd x have hder (x : ℝ) : p.derivative.eval x = ∑ k ∈ range (m+1), c k * deriv (shiftedLegendre k) x := by rw [← Polynomial.deriv, hexp] rw [show (fun x => ∑ k ∈ range (m+1), c k * shiftedLegendre k x) = (∑ k ∈ range (m+1), fun x => c k * shiftedLegendre k x) by ext x; simp] rw [deriv_sum] · simp_rw [deriv_const_mul_field] · intro k hk exact ((shiftedLegendre_differentiable k).differentiableAt).const_mul _ have hpoint (x : ℝ) : (p.derivative.eval x)^2 ≤ E * ∑ k ∈ range (m+1), (2*(k : ℝ)+1) * (deriv (shiftedLegendre k) x)^2 := by rw [hder] have hcs := Finset.sum_sq_le_sum_mul_sum_of_sq_le_mul (range (m+1)) (r := fun k => c k * deriv (shiftedLegendre k) x) (f := fun k => (c k)^2 / (2*(k : ℝ)+1)) (g := fun k => (2*(k : ℝ)+1) * (deriv (shiftedLegendre k) x)^2) (by intro k hk; positivity) (by intro k hk; positivity) (by intro k hk have hn : 2*(k : ℝ)+1 ≠ 0 := by positivity apply le_of_eq field_simp <;> ring) rwa [hparse] at hcs have hcont (k : ℕ) : Continuous (fun x => deriv (shiftedLegendre k) x) := by have he : (fun x => deriv (shiftedLegendre k) x) = (fun x => (forwardLegendrePolynomial k).derivative.eval x) := by funext x; exact (forwardLegendrePolynomial_derivative_eval k x).symm rw [he] fun_prop have hint : IntervalIntegrable (fun x => E * ∑ k ∈ range (m+1), (2*(k : ℝ)+1) * (deriv (shiftedLegendre k) x)^2) volume 0 1 := by apply Continuous.intervalIntegrable fun_prop have hi := intervalIntegral.integral_mono (by norm_num : (0 : ℝ) ≤ 1) (p.derivative.continuous.pow 2 |>.intervalIntegrable 0 1) hint hpoint rw [intervalIntegral.integral_const_mul, intervalIntegral.integral_finsetSum] at hi · simp_rw [intervalIntegral.integral_const_mul, shiftedLegendre_derivative_square_integral hleg] at hi have hweights : (∑ k ∈ range (m+1), (2*(k : ℝ)+1) * (2*(k : ℝ)*(k+1))) ≤ 4*((m : ℝ)+1)^4 := by calc _ ≤ ∑ k ∈ range (m+1), (2*(k : ℝ)+1) * (2*((m : ℝ)+1)^2) := by apply Finset.sum_le_sum intro k hk have hkm : (k : ℝ) ≤ m := by exact_mod_cast (le_of_lt_succ (Finset.mem_range.mp hk)) apply mul_le_mul_of_nonneg_left _ (by positivity) nlinarith [show (0 : ℝ) ≤ k by positivity] _ = 2*((m : ℝ)+1)^4 := by rw [← Finset.sum_mul] have hs (n : ℕ) : (∑ k ∈ range n, (2*(k : ℝ)+1)) = (n : ℝ)^2 := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih]; push_cast; ring rw [hs] push_cast ring _ ≤ _ := by nlinarith [sq_nonneg (((m : ℝ)+1)^2)] exact hi.trans (by simpa only [E, mul_comm, mul_left_comm, mul_assoc] using mul_le_mul_of_nonneg_left hweights hE) · intro k hk apply Continuous.intervalIntegrable exact continuous_const.mul ((hcont k).pow 2)
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_first_derivative_square_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:562
theorem polynomial_first_derivative_norm_bound Lemma polynomial_first_derivative_norm_bound in the paper ↗

The first-order case of the factorial bound follows from its Legendre square-mass estimate. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m :
ℕ
hm :
p.natDegree ≤ m
sqrt (∫ x in (0 : ℝ)..1, (p.derivative.eval x)^2)
≤ 4 * ((m : ℝ)+1)^2 * sqrt (∫ x in (0 : ℝ)..1, (p.eval x)^2)
Proof (Lean source)
lemma polynomial_first_derivative_norm_bound (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (m : ℕ) (hm : p.natDegree ≤ m) : sqrt (∫ x in (0 : ℝ)..1, (p.derivative.eval x)^2) ≤ 4 * ((m : ℝ)+1)^2 * sqrt (∫ x in (0 : ℝ)..1, (p.eval x)^2) := by have hE : 0 ≤ ∫ x in (0 : ℝ)..1, (p.eval x)^2 := intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; exact sq_nonneg _) have hb := polynomial_first_derivative_square_bound hleg p m hm have hsqE := Real.sq_sqrt hE apply (Real.sqrt_le_left (by positivity)).mpr calc _ ≤ 4 * ((m : ℝ)+1)^4 * (∫ x in (0 : ℝ)..1, (p.eval x)^2) := hb _ ≤ 16 * ((m : ℝ)+1)^4 * (∫ x in (0 : ℝ)..1, (p.eval x)^2) := by nlinarith [mul_nonneg (pow_nonneg (show 0 ≤ (m : ℝ)+1 by positivity) 4) hE] _ = _ := by simp only [mul_pow, hsqE]; ring
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_first_derivative_norm_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:648
theorem factorial_derivatives Lemma 2 in the paper ↗

Factorial gain in the interval square-integral derivative bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
m j :
ℕ
hm :
p.natDegree ≤ m
hj :
1 ≤ j
hjm :
j ≤ m
sqrt (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2)
≤ 4^j * ((m : ℝ)+1)^(2*j) * sqrt (∫ x in (0 : ℝ)..1, (p.eval x)^2) / (Nat.factorial j : ℝ)
Proof (Lean source)
-- @node: lem:factorial-derivatives lemma factorial_derivatives (p : Polynomial ℝ) (m j : ℕ) (hm : p.natDegree ≤ m) (hj : 1 ≤ j) (hjm : j ≤ m) : -- @realizes Polynomial(real polynomial with degree scope) sqrt (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2) ≤ 4^j * ((m : ℝ)+1)^(2*j) * sqrt (∫ x in (0 : ℝ)..1, (p.eval x)^2) / (Nat.factorial j : ℝ) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts by_cases hj1 : j = 1 · subst j simpa [polyDeriv] using polynomial_first_derivative_norm_bound legendre_of_gate p m hm · let c : ℕ → ℝ := fun l => (2*(l : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre l x) let A : ℝ := 4^j * ((m : ℝ)+1)^(2*j) / (Nat.factorial j : ℝ) have hbase : (∫ x in (0 : ℝ)..1, (p.eval x)^2) = ∑ k ∈ range (m+1), (c k)^2 / (2*(k : ℝ)+1) := polynomial_shiftedLegendre_parseval legendre_of_gate p m hm have hderiv : (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2) = ∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) c k)^2 / (2*(k : ℝ)+1) := polynomial_iterated_derivative_parseval legendre_of_gate p m j hm have hcoeff : (∑ k ∈ range (m+1), (((legendreDerivativeAction m)^[j]) c k)^2 / (2*(k : ℝ)+1)) ≤ A^2 * (∑ k ∈ range (m+1), (c k)^2 / (2*(k : ℝ)+1)) := by -- The increasing-chain prefix bound supplies the factorial gain; -- weighted Cauchy--Schwarz transfers it to the coefficient norm. exact legendreDerivativeAction_factorial_bound m j hj c have hE : 0 ≤ ∫ x in (0 : ℝ)..1, (p.eval x)^2 := intervalIntegral.integral_nonneg (by norm_num) (by intro x hx; exact sq_nonneg _) have hA : 0 ≤ A := by dsimp [A]; positivity have hn : sqrt (∫ x in (0 : ℝ)..1, ((polyDeriv j p).eval x)^2) ≤ A * sqrt (∫ x in (0 : ℝ)..1, (p.eval x)^2) := by apply (Real.sqrt_le_left (mul_nonneg hA (Real.sqrt_nonneg _))).mpr rw [mul_pow, Real.sq_sqrt hE, hderiv, hbase] exact hcoeff simpa only [A, div_mul_eq_mul_div] using hn
CausalSmith.Stat.RdTruesideNoiseFrontier.factorial_derivatives · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Kernel.lean:664
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.LegalRegularity 5 declarations Clamping to the polynomial interval preserves the derivative-based Lipschitz bound.

Full-domain regularity of the tapered Legendre extension

Clamping to the polynomial interval preserves the derivative-based Lipschitz bound. The unit bound and that Lipschitz bound give the required fractional seminorm.

theorem legalExtension_eq_clamp Lemma legalExtension_eq_clamp in the paper ↗

The endpoint continuation is evaluation at the clamped, rescaled argument. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
x :
ℝ
legalExtension b m x = block m (max 0 (min 1 (x/b)))
Proof (Lean source)
lemma legalExtension_eq_clamp (hleg : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 < b) (x : ℝ) : legalExtension b m x = block m (max 0 (min 1 (x/b))) := by by_cases hx : x < 0 · have hxb : x/b < 0 := div_neg_of_neg_of_pos hx hb simp [legalExtension, hx, min_eq_right (by linarith : x/b ≤ 1), max_eq_left hxb.le, block_zero hleg m] · by_cases hxb : x ≤ b · have h0 : 0 ≤ x/b := div_nonneg (le_of_not_gt hx) hb.le have h1 : x/b ≤ 1 := (div_le_one hb).mpr hxb simp [legalExtension, hx, hxb, min_eq_right h1, max_eq_right h0] · have h1 : 1 ≤ x/b := (le_div_iff₀ hb).mpr (by linarith) simp [legalExtension, hx, hxb, min_eq_left h1, block_one m]
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_eq_clamp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegalRegularity.lean:21

Clamping the argument puts it in the polynomial's unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
z :
ℝ
max 0 (min 1 z) ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma unitClamp_mem (z : ℝ) : max 0 (min 1 z) ∈ Icc (0 : ℝ) 1 := by exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
theorem legalExtension_abs_le_one Lemma legalExtension_abs_le_one in the paper ↗

The continuation retains the polynomial's uniform unit bound across both seams. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
x :
ℝ
|legalExtension b m x| ≤ 1
Proof (Lean source)
lemma legalExtension_abs_le_one (hleg : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 < b) (x : ℝ) : |legalExtension b m x| ≤ 1 := by rw [legalExtension_eq_clamp hleg b m hb x] exact block_abs_le_one hleg m _ (unitClamp_mem _)
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_abs_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegalRegularity.lean:40

The polynomial derivative bound extends across both constant pieces by clamping. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
hm :
2 ≤ m
x t :
ℝ
|legalExtension b m x - legalExtension b m t| ≤ (7 * (m : ℝ)^2 / b) * |x-t|
Proof (Lean source)
lemma legalExtension_sub_le (hleg : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 < b) (hm : 2 ≤ m) (x t : ℝ) : |legalExtension b m x - legalExtension b m t| ≤ (7 * (m : ℝ)^2 / b) * |x-t| := by have hd : Differentiable ℝ (block m) := by change Differentiable ℝ (fun t => (1-t) * (blockNorm m)⁻¹ * legendreBlockSum m t) fun_prop have hp := Convex.norm_image_sub_le_of_norm_deriv_le (fun z (_ : z ∈ Icc (0 : ℝ) 1) => hd z) (fun z hz => by simpa only [Real.norm_eq_abs] using block_deriv_bound hleg m hm z hz) (convex_Icc (0 : ℝ) 1) (unitClamp_mem (t/b)) (unitClamp_mem (x/b)) have hc : |max 0 (min 1 (x/b)) - max 0 (min 1 (t/b))| ≤ |x-t|/b := by calc _ ≤ |min 1 (x/b) - min 1 (t/b)| := by simpa only [sub_self, abs_zero, max_eq_right (abs_nonneg (min 1 (x/b) - min 1 (t/b)))] using abs_max_sub_max_le_max (0 : ℝ) (min 1 (x/b)) 0 (min 1 (t/b)) _ ≤ |x/b-t/b| := by simpa only [sub_self, abs_zero, max_eq_right (abs_nonneg (x/b - t/b))] using abs_min_sub_min_le_max (1 : ℝ) (x/b) 1 (t/b) _ = _ := by rw [← sub_div, abs_div, abs_of_pos hb] rw [legalExtension_eq_clamp hleg b m hb x, legalExtension_eq_clamp hleg b m hb t] calc _ ≤ 7 * (m : ℝ)^2 * |max 0 (min 1 (x/b)) - max 0 (min 1 (t/b))| := by simpa only [Real.norm_eq_abs] using hp _ ≤ 7 * (m : ℝ)^2 * (|x-t|/b) := mul_le_mul_of_nonneg_left hc (by positivity) _ = _ := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_sub_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegalRegularity.lean:46
theorem legalExtension_holder_bound Lemma legalExtension_holder_bound in the paper ↗

The unit and Lipschitz bounds imply the full-domain Hölder bound at every legal exponent. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
0 < b
hm :
2 ≤ m
holderSeminorm β (legalExtension b m) ≤ ofReal (7 * (b/(m : ℝ)^2) ^ (-β))
Proof (Lean source)
lemma legalExtension_holder_bound (hleg : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : 0 < b) (hm : 2 ≤ m) : holderSeminorm β (legalExtension b m) ≤ ofReal (7 * (b/(m : ℝ)^2) ^ (-β)) := by have hmpos : 0 < (m : ℝ) := by exact_mod_cast (show 0 < m by omega) let A : ℝ := (m : ℝ)^2 / b have hA : 0 < A := by dsimp [A]; positivity have hscale : A ^ β = (b/(m : ℝ)^2) ^ (-β) := by rw [Real.rpow_neg_eq_inv_rpow] congr 1 dsimp [A] field_simp unfold holderSeminorm apply sSup_le rintro r ⟨x, hx, t, ht, hxt, rfl⟩ apply ENNReal.ofReal_le_ofReal have hd : 0 < |x-t| := abs_pos.mpr (sub_ne_zero.mpr hxt) have hprod : 0 < A * |x-t| := mul_pos hA hd have hpow : (A * |x-t|)^β = A^β * |x-t|^β := Real.mul_rpow hA.le hd.le have hbound : |legalExtension b m x - legalExtension b m t| ≤ 7 * (A * |x-t|)^β := by by_cases hsmall : A * |x-t| ≤ 1 · have hinterp : A * |x-t| ≤ (A * |x-t|)^β := by simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_ge hprod hsmall hβ.2 calc _ ≤ 7 * (A * |x-t|) := by simpa only [A, mul_div_assoc, mul_assoc] using legalExtension_sub_le hleg b m hb hm x t _ ≤ _ := mul_le_mul_of_nonneg_left hinterp (by norm_num) · have hlarge : 1 ≤ (A * |x-t|)^β := Real.one_le_rpow (le_of_not_ge hsmall) hβ.1.le have hunit : |legalExtension b m x - legalExtension b m t| ≤ 2 := by calc _ ≤ |legalExtension b m x| + |legalExtension b m t| := abs_sub _ _ _ ≤ 1+1 := add_le_add (legalExtension_abs_le_one hleg b m hb x) (legalExtension_abs_le_one hleg b m hb t) _ = 2 := by norm_num linarith apply (div_le_iff₀ (Real.rpow_pos_of_pos hd β)).mpr rw [← hscale, mul_assoc, ← hpow] exact hbound
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_holder_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegalRegularity.lean:74
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.LegendreBasis 17 declarations Polynomial spanning, orthogonality, and integration by parts for the endpoint witnesses.

Shifted Legendre basis and derivative coefficients

Polynomial spanning, orthogonality, and integration by parts for the endpoint witnesses.

The usual forward shifted Legendre polynomial. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
j :
ℕ
t :
ℝ
shiftedLegendre j t :
ℝ
legendreP j (2*t - 1)
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:23

Given the Legendre degree, Legendre evaluation is continuous on the real line.

Formal statement
j :
ℕ
Proof (Lean source)
@[fun_prop] lemma legendreP_continuous (j : ℕ) : Continuous (legendreP j) := by unfold legendreP fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:25
theorem shiftedLegendre_orthogonal Lemma shiftedLegendre_orthogonal in the paper ↗

Affine substitution transfers cited Legendre orthogonality to the unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j k :
ℕ
(∫ t in (0 : ℝ)..1, legendreP j (2*t-1) * legendreP k (2*t-1))
= if j = k then 1 / (2 * (j : ℝ) + 1) else 0
Proof (Lean source)
lemma shiftedLegendre_orthogonal (hleg : ClassicalLegendreFacts) (j k : ℕ) : (∫ t in (0 : ℝ)..1, legendreP j (2*t-1) * legendreP k (2*t-1)) = if j = k then 1 / (2 * (j : ℝ) + 1) else 0 := by have h := intervalIntegral.integral_comp_mul_add (fun t => legendreP j t * legendreP k t) (a := (0 : ℝ)) (b := 1) (c := 2) (by norm_num) (-1) norm_num only [mul_zero, zero_add, mul_one, add_neg_cancel, show (2 : ℝ) + -1 = 1 by norm_num, smul_eq_mul] at h simp only [sub_eq_add_neg] at ⊢ rw [h, (hleg j k).1] split_ifs <;> ring
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_orthogonal · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:29

Real coefficient versions of the reversed shifted Legendre polynomials form a polynomial sequence, with the polynomial at index j having degree j. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
reversedLegendreSequence :
clause 1
clause 2
degree_eq' j := by rw [Polynomial.degree_map_eq_of_injective (Int.cast_injective), Polynomial.degree_shiftedLegendre]
CausalSmith.Stat.RdTruesideNoiseFrontier.reversedLegendreSequence · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:41
theorem reversedLegendreSequence_eval Lemma reversedLegendreSequence_eval in the paper ↗

Reflection relates the polynomial sequence to the forward shifted Legendre functions. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
(reversedLegendreSequence j).eval t = (-1 : ℝ)^j * legendreP j (2*t-1)
Proof (Lean source)
lemma reversedLegendreSequence_eval (j : ℕ) (t : ℝ) : (reversedLegendreSequence j).eval t = (-1 : ℝ)^j * legendreP j (2*t-1) := by change eval t ((shiftedLegendre j).map (castRingHom ℝ)) = _ rw [Polynomial.eval_map] change aeval t (shiftedLegendre j) = _ have h := Polynomial.shiftedLegendre_eval_symm j t simpa only [legendreP, show (1 - (2*t-1))/2 = 1-t by ring] using h
CausalSmith.Stat.RdTruesideNoiseFrontier.reversedLegendreSequence_eval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:49
theorem polynomial_shiftedLegendre_orthogonal Lemma polynomial_shiftedLegendre_orthogonal in the paper ↗

Cited Legendre orthogonality and the polynomial-sequence spanning theorem make any polynomial of degree below j orthogonal to the jth shifted Legendre function. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
j :
ℕ
hp :
p.degree < j
(∫ t in (0 : ℝ)..1, p.eval t * legendreP j (2*t-1)) = 0
Proof (Lean source)
lemma polynomial_shiftedLegendre_orthogonal (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (j : ℕ) (hp : p.degree < j) : (∫ t in (0 : ℝ)..1, p.eval t * legendreP j (2*t-1)) = 0 := by have hspan : p ∈ span ℝ (reversedLegendreSequence '' Iio j) := by rw [Polynomial.Sequence.span_degreeLT] · exact Polynomial.mem_degreeLT.mpr hp · intro i hi exact isUnit_iff_ne_zero.mpr (Polynomial.leadingCoeff_ne_zero.mpr (reversedLegendreSequence.ne_zero i)) clear hp induction hspan using Submodule.span_induction with | mem q hq => obtain ⟨k, hk, rfl⟩ := hq simp_rw [reversedLegendreSequence_eval, mul_assoc] rw [intervalIntegral.integral_const_mul, shiftedLegendre_orthogonal hleg] simp [show k ≠ j by exact ne_of_lt hk] | zero => simp | add p q _ _ hp hq => simp only [Polynomial.eval_add, add_mul] rw [intervalIntegral.integral_add, hp, hq, add_zero] all_goals apply Continuous.intervalIntegrable; fun_prop | smul c p _ hp => simp only [Polynomial.eval_smul, smul_eq_mul, mul_assoc] rw [intervalIntegral.integral_const_mul, hp, mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_shiftedLegendre_orthogonal · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:58
theorem shiftedLegendre_differentiable Lemma shiftedLegendre_differentiable in the paper ↗

Given the Legendre degree, shifted Legendre evaluation is differentiable on the real line.

Formal statement
j :
ℕ
Proof (Lean source)
@[fun_prop] lemma shiftedLegendre_differentiable (j : ℕ) : Differentiable ℝ (shiftedLegendre j) := by unfold shiftedLegendre legendreP have hp : Differentiable ℝ (fun x : ℝ => aeval x (shiftedLegendre j)) := Polynomial.differentiable_aeval _ exact hp.comp (show Differentiable ℝ (fun t : ℝ => (1 - (2*t-1))/2) by fun_prop)
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_differentiable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:85
theorem polynomial_shiftedLegendre_expansion Lemma polynomial_shiftedLegendre_expansion in the paper ↗

Orthogonal projection reconstructs every polynomial of degree below the cutoff. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
j :
ℕ
hp :
p.degree < j
t :
ℝ
p.eval t
= ∑ k ∈ range j, (2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x) * shiftedLegendre k t
Proof (Lean source)
lemma polynomial_shiftedLegendre_expansion (hleg : ClassicalLegendreFacts) (p : Polynomial ℝ) (j : ℕ) (hp : p.degree < j) (t : ℝ) : p.eval t = ∑ k ∈ range j, (2*(k : ℝ)+1) * (∫ x in (0 : ℝ)..1, p.eval x * shiftedLegendre k x) * shiftedLegendre k t := by have hspan : p ∈ span ℝ (reversedLegendreSequence '' Iio j) := by rw [Polynomial.Sequence.span_degreeLT] · exact Polynomial.mem_degreeLT.mpr hp · intro i hi exact isUnit_iff_ne_zero.mpr (Polynomial.leadingCoeff_ne_zero.mpr (reversedLegendreSequence.ne_zero i)) clear hp induction hspan using Submodule.span_induction with | mem q hq => obtain ⟨i, hi, rfl⟩ := hq simp_rw [reversedLegendreSequence_eval, mul_assoc] simp_rw [shiftedLegendre, intervalIntegral.integral_const_mul, shiftedLegendre_orthogonal hleg] have hw : 2*(i : ℝ)+1 ≠ 0 := by positivity have hil : i < j := hi simp [Finset.sum_ite_eq, Finset.mem_range, hil, mul_ite, ite_mul] field_simp [hw] | zero => simp | add p q _ _ hp hq => simp only [Polynomial.eval_add, add_mul] have hint (r : Polynomial ℝ) (k : ℕ) : IntervalIntegrable (fun x => r.eval x * shiftedLegendre k x) volume 0 1 := by apply Continuous.intervalIntegrable unfold shiftedLegendre fun_prop simp_rw [intervalIntegral.integral_add (hint p _) (hint q _)] rw [hp, hq, ← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro k hk ring | smul c p _ hp => simp only [Polynomial.eval_smul, smul_eq_mul, mul_assoc] simp_rw [intervalIntegral.integral_const_mul] rw [hp, Finset.mul_sum] apply Finset.sum_congr rfl intro k hk ring
CausalSmith.Stat.RdTruesideNoiseFrontier.polynomial_shiftedLegendre_expansion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:95

A real polynomial realizing the forward shifted Legendre function. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
j :
ℕ
forwardLegendrePolynomial j :
C ((-1 : ℝ)^j) * reversedLegendreSequence j
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:138
theorem forwardLegendrePolynomial_eval Lemma forwardLegendrePolynomial_eval in the paper ↗

The two orientation signs cancel in the forward polynomial evaluation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
Proof (Lean source)
lemma forwardLegendrePolynomial_eval (j : ℕ) (t : ℝ) : (forwardLegendrePolynomial j).eval t = shiftedLegendre j t := by simp only [forwardLegendrePolynomial, Polynomial.eval_mul, Polynomial.eval_C, reversedLegendreSequence_eval, ← mul_assoc, ← mul_pow] norm_num [shiftedLegendre]
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial_eval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:142
theorem forwardLegendrePolynomial_degree Lemma forwardLegendrePolynomial_degree in the paper ↗

Multiplying by the nonzero orientation sign preserves degree. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
Proof (Lean source)
lemma forwardLegendrePolynomial_degree (j : ℕ) : (forwardLegendrePolynomial j).degree = j := by rw [forwardLegendrePolynomial, Polynomial.degree_C_mul (by positivity)] exact reversedLegendreSequence.degree_eq j
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial_degree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:149
theorem forwardLegendrePolynomial_derivative_degree Lemma forwardLegendrePolynomial_derivative_degree in the paper ↗

Differentiation lowers the forward polynomial degree strictly below its index. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
(forwardLegendrePolynomial j).derivative.degree < j
Proof (Lean source)
lemma forwardLegendrePolynomial_derivative_degree (j : ℕ) : (forwardLegendrePolynomial j).derivative.degree < j := by rw [← forwardLegendrePolynomial_degree j] apply Polynomial.degree_derivative_lt intro hz have hd := forwardLegendrePolynomial_degree j rw [hz, Polynomial.degree_zero] at hd exact (WithBot.bot_ne_coe hd)
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial_derivative_degree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:155
theorem forwardLegendrePolynomial_derivative_eval Lemma forwardLegendrePolynomial_derivative_eval in the paper ↗

The forward polynomial derivative is the ordinary function derivative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
(forwardLegendrePolynomial j).derivative.eval t = deriv (shiftedLegendre j) t
Proof (Lean source)
lemma forwardLegendrePolynomial_derivative_eval (j : ℕ) (t : ℝ) : (forwardLegendrePolynomial j).derivative.eval t = deriv (shiftedLegendre j) t := by rw [← Polynomial.deriv] congr 1 funext x exact forwardLegendrePolynomial_eval j x
CausalSmith.Stat.RdTruesideNoiseFrontier.forwardLegendrePolynomial_derivative_eval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:165
theorem shiftedLegendre_endpoints Lemma shiftedLegendre_endpoints in the paper ↗

The cited reflection symmetry and left endpoint fix both shifted endpoint values. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
conclusion 1
shiftedLegendre j 0 = (-1 : ℝ)^j
conclusion 2
Proof (Lean source)
lemma shiftedLegendre_endpoints (hleg : ClassicalLegendreFacts) (j : ℕ) : shiftedLegendre j 0 = (-1 : ℝ)^j ∧ shiftedLegendre j 1 = 1 := by constructor · simpa [shiftedLegendre] using (hleg j 0).2.2.2 · have h := (hleg j 0).2.1 (-1) rw [(hleg j 0).2.2.2, ← mul_pow] at h norm_num at h norm_num [shiftedLegendre] at ⊢ exact h
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_endpoints · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:173
theorem legendre_endpoint_parity Lemma legendre_endpoint_parity in the paper ↗

The endpoint term selects exactly the odd derivative modes. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j k :
ℕ
hk :
k < j
1 - (-1 : ℝ)^k * (-1 : ℝ)^j = if Odd (j-k) then 2 else 0
Proof (Lean source)
lemma legendre_endpoint_parity (j k : ℕ) (hk : k < j) : 1 - (-1 : ℝ)^k * (-1 : ℝ)^j = if Odd (j-k) then 2 else 0 := by have hjpow : (-1 : ℝ)^j = (-1 : ℝ)^(j-k) * (-1 : ℝ)^k := by rw [← pow_add, Nat.sub_add_cancel hk.le] rw [hjpow] have hs : (-1 : ℝ)^k * ((-1 : ℝ)^(j-k) * (-1 : ℝ)^k) = (-1 : ℝ)^(j-k) := by calc _ = (-1 : ℝ)^(j-k) * ((-1 : ℝ)^k * (-1 : ℝ)^k) := by ring _ = _ := by rw [← mul_pow]; norm_num rw [hs] rcases Nat.even_or_odd (j-k) with he | ho · rw [if_neg (by exact Nat.not_odd_iff_even.mpr he), he.neg_one_pow]; norm_num · rw [if_pos ho, ho.neg_one_pow]; norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.legendre_endpoint_parity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:184
theorem shiftedLegendre_derivative_inner Lemma shiftedLegendre_derivative_inner in the paper ↗

Integration by parts removes the lower-degree differentiated mode and leaves the parity-selected boundary coefficient of the forward Legendre derivative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j k :
ℕ
hk :
k < j
(∫ x in (0 : ℝ)..1, (forwardLegendrePolynomial j).derivative.eval x * shiftedLegendre k x)
= if Odd (j-k) then 2 else 0
Proof (Lean source)
lemma shiftedLegendre_derivative_inner (hleg : ClassicalLegendreFacts) (j k : ℕ) (hk : k < j) : (∫ x in (0 : ℝ)..1, (forwardLegendrePolynomial j).derivative.eval x * shiftedLegendre k x) = if Odd (j-k) then 2 else 0 := by have hz : (∫ x in (0 : ℝ)..1, (forwardLegendrePolynomial k).derivative.eval x * shiftedLegendre j x) = 0 := polynomial_shiftedLegendre_orthogonal hleg _ j ((forwardLegendrePolynomial_derivative_degree k).trans (by exact_mod_cast hk)) have hparts := intervalIntegral.integral_mul_deriv_eq_deriv_mul (a := (0 : ℝ)) (b := 1) (u := fun x => (forwardLegendrePolynomial k).eval x) (v := fun x => (forwardLegendrePolynomial j).eval x) (fun x hx => (forwardLegendrePolynomial k).hasDerivAt x) (fun x hx => (forwardLegendrePolynomial j).hasDerivAt x) ((forwardLegendrePolynomial k).derivative.continuous.intervalIntegrable 0 1) ((forwardLegendrePolynomial j).derivative.continuous.intervalIntegrable 0 1) simp_rw [forwardLegendrePolynomial_eval] at hparts rw [hz, (shiftedLegendre_endpoints hleg k).1, (shiftedLegendre_endpoints hleg k).2, (shiftedLegendre_endpoints hleg j).1, (shiftedLegendre_endpoints hleg j).2] at hparts simp only [one_mul, sub_zero] at hparts rw [legendre_endpoint_parity j k hk] at hparts simpa only [mul_comm] using hparts
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_derivative_inner · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:199
theorem shiftedLegendre_derivative_expansion Lemma shiftedLegendre_derivative_expansion in the paper ↗

Expansion of the lower-degree derivative in the orthogonal shifted basis. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
= 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1) * shiftedLegendre k t
Proof (Lean source)
lemma shiftedLegendre_derivative_expansion (hleg : ClassicalLegendreFacts) (j : ℕ) (t : ℝ) : deriv (shiftedLegendre j) t = 2 * ∑ k ∈ (range j).filter (fun k => Odd (j-k)), (2*(k : ℝ)+1) * shiftedLegendre k t := by rw [← forwardLegendrePolynomial_derivative_eval, polynomial_shiftedLegendre_expansion hleg _ j (forwardLegendrePolynomial_derivative_degree j)] rw [Finset.sum_filter, Finset.mul_sum] apply Finset.sum_congr rfl intro k hk rw [shiftedLegendre_derivative_inner hleg j k (Finset.mem_range.mp hk)] split_ifs <;> ring
CausalSmith.Stat.RdTruesideNoiseFrontier.shiftedLegendre_derivative_expansion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBasis.lean:225
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.LegendreBlock 18 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

The initial segment of odd weights has square total mass. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n :
ℕ
(∑ j ∈ range n, (2 * (j : ℝ) + 1)) = (n : ℝ)^2
Proof (Lean source)
lemma oddWeight_sum_range (n : ℕ) : (∑ j ∈ range n, (2 * (j : ℝ) + 1)) = (n : ℝ)^2 := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih] push_cast ring
CausalSmith.Stat.RdTruesideNoiseFrontier.oddWeight_sum_range · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:25

The Legendre block normalizer is its total positive weight. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1)) = blockNorm m
Proof (Lean source)
lemma blockNorm_sum (m : ℕ) : (∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1)) = blockNorm m := by rw [← Finset.Ico_add_one_right_eq_Icc, Finset.sum_Ico_eq_sub _ (by omega), oddWeight_sum_range, oddWeight_sum_range] simp only [Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat] norm_num [blockNorm]
CausalSmith.Stat.RdTruesideNoiseFrontier.blockNorm_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:35

Endpoint signs cancel in the normalized Legendre block. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
m :
ℕ
block m 0 = 1
Proof (Lean source)
lemma block_zero (legendre_of_gate : ClassicalLegendreFacts) (m : ℕ) : block m 0 = 1 := by have hs : (∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (-1)) = blockNorm m := by calc _ = ∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) := by apply Finset.sum_congr rfl intro j hj rw [(legendre_of_gate j 0).2.2.2, mul_assoc, ← mul_pow] simp _ = blockNorm m := blockNorm_sum m simpa [block, hs, (blockNorm_pos m).ne'] using (inv_mul_cancel₀ (blockNorm_pos m).ne')

The taper vanishes at the right endpoint. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
block m 1 = 0
Proof (Lean source)
lemma block_one (m : ℕ) : block m 1 = 0 := by simp [block]

The cited Legendre unit bound controls the tapered block on the whole unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
m :
ℕ
t :
ℝ
ht :
t ∈ Icc (0 : ℝ) 1
|block m t| ≤ 1
Proof (Lean source)
lemma block_abs_le_one (legendre_of_gate : ClassicalLegendreFacts) (m : ℕ) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |block m t| ≤ 1 := by have hleg (j : ℕ) : |legendreP j (2*t-1)| ≤ 1 := (legendre_of_gate j 0).2.2.1 _ ⟨by linarith [ht.1], by linarith [ht.2]⟩ have hsum : |∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (2*t-1)| ≤ blockNorm m := by calc _ ≤ ∑ j ∈ Icc m (2*m), |(2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (2*t-1)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) := by apply Finset.sum_le_sum intro j hj have hw : 0 ≤ 2 * (j : ℝ) + 1 := by positivity simp only [abs_mul, abs_pow, abs_neg, abs_one, one_pow, mul_one, abs_of_nonneg hw] exact mul_le_of_le_one_right hw (hleg j) _ = blockNorm m := blockNorm_sum m have hn := blockNorm_pos m have htaper : |1-t| ≤ 1 := by rw [abs_of_nonneg (by linarith [ht.2])]; linarith [ht.1] unfold block rw [abs_mul, abs_mul, abs_of_pos (inv_pos.mpr hn)] calc _ ≤ 1 * (blockNorm m)⁻¹ * blockNorm m := mul_le_mul (mul_le_mul_of_nonneg_right htaper (le_of_lt (inv_pos.mpr hn))) hsum (abs_nonneg _) (by positivity) _ = 1 := by simp [hn.ne']
CausalSmith.Stat.RdTruesideNoiseFrontier.block_abs_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:61

The legal continuation retains the normalized cutoff value. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
b :
ℝ
m :
ℕ
hb :
0 ≤ b
legalExtension b m 0 = 1
Proof (Lean source)
lemma legalExtension_zero (legendre_of_gate : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 ≤ b) : legalExtension b m 0 = 1 := by simp [legalExtension, hb, block_zero legendre_of_gate m]
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:90

The explicitly constructed alternative has the displayed cutoff effect. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
β b :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
theta (altLaw legendre_of_gate β b m s hβ hb hm) = witnessSign s * kappa * (b/(m : ℝ)^2)^β
Proof (Lean source)
lemma theta_altLaw (legendre_of_gate : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : theta (altLaw legendre_of_gate β b m s hβ hb hm) = witnessSign s * kappa * (b/(m : ℝ)^2)^β := by simp [theta, altLaw, bernoulliWitness, witnessMu, altProbability, legalExtension_zero legendre_of_gate b m hb.1.le]

Opposite Bernoulli perturbations have twice the positive cutoff amplitude. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
β b :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
|theta (altLaw legendre_of_gate β b m true hβ hb hm)
- theta (altLaw legendre_of_gate β b m false hβ hb hm)|
= 2 * kappa * (b/(m : ℝ)^2)^β
Proof (Lean source)
lemma altLaw_separation (legendre_of_gate : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : |theta (altLaw legendre_of_gate β b m true hβ hb hm) - theta (altLaw legendre_of_gate β b m false hβ hb hm)| = 2 * kappa * (b/(m : ℝ)^2)^β := by rw [theta_altLaw legendre_of_gate, theta_altLaw legendre_of_gate] simp only [witnessSign, Bool.false_eq_true, ↓reduceIte, one_mul, neg_one_mul] have ha : 0 ≤ kappa * (b/(m : ℝ)^2)^β := by apply mul_nonneg (by norm_num [kappa]) exact Real.rpow_nonneg (div_nonneg hb.1.le (sq_nonneg _)) _ rw [abs_of_nonneg (by linarith)] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_separation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:103

The unnormalized Legendre block before the endpoint taper. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
t :
ℝ
legendreBlockSum m t :
ℝ
∑ j ∈ Icc m (2*m), (2*(j : ℝ)+1) * (-1 : ℝ)^j * legendreP j (2*t-1)
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreBlockSum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:117
theorem legendreBlockSum_continuous Lemma legendreBlockSum_continuous in the paper ↗

Given the polynomial degree, the finite Legendre block is continuous on the real line.

Formal statement
m :
ℕ
Proof (Lean source)
@[fun_prop] lemma legendreBlockSum_continuous (m : ℕ) : Continuous (legendreBlockSum m) := by unfold legendreBlockSum fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreBlockSum_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:120
theorem legendreBlockSum_sq_integral Lemma legendreBlockSum_sq_integral in the paper ↗

Orthogonality leaves precisely the sum of odd weights in the squared block integral. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∫ t in (0 : ℝ)..1, (legendreBlockSum m t)^2) = blockNorm m
Proof (Lean source)
lemma legendreBlockSum_sq_integral (hleg : ClassicalLegendreFacts) (m : ℕ) : (∫ t in (0 : ℝ)..1, (legendreBlockSum m t)^2) = blockNorm m := by have hint (j k : ℕ) : IntervalIntegrable (fun t : ℝ => ((2*(j : ℝ)+1) * (-1 : ℝ)^j * legendreP j (2*t-1)) * ((2*(k : ℝ)+1) * (-1 : ℝ)^k * legendreP k (2*t-1))) volume 0 1 := by apply Continuous.intervalIntegrable fun_prop have hpair (j k : ℕ) : (∫ t in (0 : ℝ)..1, ((2*(j : ℝ)+1) * (-1 : ℝ)^j * legendreP j (2*t-1)) * ((2*(k : ℝ)+1) * (-1 : ℝ)^k * legendreP k (2*t-1))) = if j = k then 2*(j : ℝ)+1 else 0 := by calc _ = ((2*(j : ℝ)+1) * (-1 : ℝ)^j * ((2*(k : ℝ)+1) * (-1 : ℝ)^k)) * (∫ t in (0 : ℝ)..1, legendreP j (2*t-1) * legendreP k (2*t-1)) := by rw [← intervalIntegral.integral_const_mul] congr 1 ext t ring _ = _ := by rw [shiftedLegendre_orthogonal hleg] split_ifs with h · subst k have hw : 2*(j : ℝ)+1 ≠ 0 := by positivity have hsign : (-1 : ℝ)^j * (-1 : ℝ)^j = 1 := by rw [← mul_pow]; norm_num field_simp nlinarith · ring calc _ = ∫ t in (0 : ℝ)..1, ∑ j ∈ Icc m (2*m), ∑ k ∈ Icc m (2*m), ((2*(j : ℝ)+1) * (-1 : ℝ)^j * legendreP j (2*t-1)) * ((2*(k : ℝ)+1) * (-1 : ℝ)^k * legendreP k (2*t-1)) := by congr 1 ext t simp only [legendreBlockSum, pow_two, Finset.sum_mul, Finset.mul_sum] rw [Finset.sum_comm] _ = ∑ j ∈ Icc m (2*m), ∑ k ∈ Icc m (2*m), if j = k then 2*(j : ℝ)+1 else 0 := by rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_congr rfl intro j hj rw [intervalIntegral.integral_finsetSum (fun k hk => hint j k)] exact Finset.sum_congr rfl (fun k hk => hpair j k) · intro j hj apply Continuous.intervalIntegrable fun_prop _ = blockNorm m := by simp only [Finset.sum_ite_eq, Finset.mem_Icc] have : (∑ j ∈ Icc m (2*m), if m ≤ j ∧ j ≤ 2*m then 2*(j : ℝ)+1 else 0) = ∑ j ∈ Icc m (2*m), (2*(j : ℝ)+1) := by apply Finset.sum_congr rfl intro j hj simp [Finset.mem_Icc.mp hj] rw [this, blockNorm_sum]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreBlockSum_sq_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:124
theorem normalizedBlock_sq_integral Lemma normalizedBlock_sq_integral in the paper ↗

The normalized untapered block has squared mass equal to its inverse normalizer. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∫ t in (0 : ℝ)..1, ((blockNorm m)⁻¹ * legendreBlockSum m t)^2) = 1 / blockNorm m
Proof (Lean source)
lemma normalizedBlock_sq_integral (hleg : ClassicalLegendreFacts) (m : ℕ) : (∫ t in (0 : ℝ)..1, ((blockNorm m)⁻¹ * legendreBlockSum m t)^2) = 1 / blockNorm m := by calc _ = (blockNorm m)⁻¹^2 * (∫ t in (0 : ℝ)..1, (legendreBlockSum m t)^2) := by simp_rw [mul_pow] rw [intervalIntegral.integral_const_mul] _ = 1 / blockNorm m := by rw [legendreBlockSum_sq_integral hleg] field_simp [(blockNorm_pos m).ne']
CausalSmith.Stat.RdTruesideNoiseFrontier.normalizedBlock_sq_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:179

Tapering the normalized block cannot increase its squared mass on the unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∫ t in (0 : ℝ)..1, (block m t)^2) ≤ 1 / blockNorm m
Proof (Lean source)
lemma block_sq_integral_le (hleg : ClassicalLegendreFacts) (m : ℕ) : (∫ t in (0 : ℝ)..1, (block m t)^2) ≤ 1 / blockNorm m := by rw [← normalizedBlock_sq_integral hleg m] have hc : Continuous (block m) := by unfold block fun_prop apply intervalIntegral.integral_mono_on (by norm_num) ((hc.pow 2).intervalIntegrable _ _) (by apply Continuous.intervalIntegrable fun_prop) intro t ht have htaper : (1-t)^2 ≤ 1 := by nlinarith [ht.1, ht.2] change ((1-t) * (blockNorm m)⁻¹ * legendreBlockSum m t)^2 ≤ _ calc _ = (1-t)^2 * ((blockNorm m)⁻¹ * legendreBlockSum m t)^2 := by ring _ ≤ 1 * ((blockNorm m)⁻¹ * legendreBlockSum m t)^2 := mul_le_mul_of_nonneg_right htaper (sq_nonneg _) _ = _ := one_mul _
CausalSmith.Stat.RdTruesideNoiseFrontier.block_sq_integral_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:190
theorem legendreBlockSum_differentiable Lemma legendreBlockSum_differentiable in the paper ↗

Given the polynomial degree, the untapered finite Legendre block is differentiable on the real line.

Formal statement
m :
ℕ
Proof (Lean source)
@[fun_prop] lemma legendreBlockSum_differentiable (m : ℕ) : Differentiable ℝ (legendreBlockSum m) := by change Differentiable ℝ (fun t => ∑ j ∈ Icc m (2*m), (2*(j : ℝ)+1) * (-1 : ℝ)^j * shiftedLegendre j t) fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreBlockSum_differentiable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:210
theorem normalizedBlock_abs_le_one Lemma normalizedBlock_abs_le_one in the paper ↗

The untapered normalized block has absolute value at most one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
t :
ℝ
ht :
t ∈ Icc (0 : ℝ) 1
|(blockNorm m)⁻¹ * legendreBlockSum m t| ≤ 1
Proof (Lean source)
lemma normalizedBlock_abs_le_one (hleg : ClassicalLegendreFacts) (m : ℕ) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |(blockNorm m)⁻¹ * legendreBlockSum m t| ≤ 1 := by have hsum : |legendreBlockSum m t| ≤ blockNorm m := by calc _ ≤ ∑ j ∈ Icc m (2*m), |(2*(j : ℝ)+1) * (-1 : ℝ)^j * legendreP j (2*t-1)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Icc m (2*m), (2*(j : ℝ)+1) := by apply Finset.sum_le_sum intro j hj have hw : 0 ≤ 2*(j : ℝ)+1 := by positivity simp only [abs_mul, abs_pow, abs_neg, abs_one, one_pow, mul_one, abs_of_nonneg hw] exact mul_le_of_le_one_right hw ((hleg j 0).2.2.1 _ ⟨by linarith [ht.1], by linarith [ht.2]⟩) _ = blockNorm m := blockNorm_sum m rw [abs_mul, abs_of_pos (inv_pos.mpr (blockNorm_pos m))] calc _ ≤ (blockNorm m)⁻¹ * blockNorm m := mul_le_mul_of_nonneg_left hsum (inv_pos.mpr (blockNorm_pos m)).le _ = 1 := inv_mul_cancel₀ (blockNorm_pos m).ne'
CausalSmith.Stat.RdTruesideNoiseFrontier.normalizedBlock_abs_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:217
theorem legendreBlockSum_deriv_bound Lemma legendreBlockSum_deriv_bound in the paper ↗

The derivative of the untapered block is bounded by its total weight times the largest shifted Legendre derivative in the block. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
hm :
2 ≤ m
t :
ℝ
ht :
t ∈ Icc (0 : ℝ) 1
|deriv (legendreBlockSum m) t| ≤ blockNorm m * ((2*(m : ℝ))*(2*m+1))
Proof (Lean source)
lemma legendreBlockSum_deriv_bound (hleg : ClassicalLegendreFacts) (m : ℕ) (hm : 2 ≤ m) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |deriv (legendreBlockSum m) t| ≤ blockNorm m * ((2*(m : ℝ))*(2*m+1)) := by have hd : deriv (legendreBlockSum m) t = ∑ j ∈ Icc m (2*m), ((2*(j : ℝ)+1) * (-1 : ℝ)^j) * deriv (shiftedLegendre j) t := by change deriv (fun t => ∑ j ∈ Icc m (2*m), ((2*(j : ℝ)+1) * (-1 : ℝ)^j) * shiftedLegendre j t) t = _ rw [deriv_fun_sum (fun j hj => (shiftedLegendre_differentiable j t).const_mul _)] simp only [deriv_const_mul_field] rw [hd] calc _ ≤ ∑ j ∈ Icc m (2*m), |((2*(j : ℝ)+1) * (-1 : ℝ)^j) * deriv (shiftedLegendre j) t| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Icc m (2*m), (2*(j : ℝ)+1) * ((2*(m : ℝ))*(2*m+1)) := by apply Finset.sum_le_sum intro j hj have hjm := Finset.mem_Icc.mp hj have hjpos : 1 ≤ j := by omega have hjle : (j : ℝ) ≤ 2*(m : ℝ) := by exact_mod_cast hjm.2 have hbound := (shifted_legendre_derivative j hjpos).2 t ht have hw : 0 ≤ 2*(j : ℝ)+1 := by positivity simp only [abs_mul, abs_pow, abs_neg, abs_one, one_pow, mul_one, abs_of_nonneg hw] apply mul_le_mul_of_nonneg_left (hbound.trans ?_) hw exact mul_le_mul hjle (by linarith) (by positivity) (by positivity) _ = blockNorm m * ((2*(m : ℝ))*(2*m+1)) := by rw [← Finset.sum_mul, blockNorm_sum]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreBlockSum_deriv_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:241

Differentiating the endpoint taper gives the paper's uniform derivative bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
hm :
2 ≤ m
t :
ℝ
ht :
t ∈ Icc (0 : ℝ) 1
|deriv (block m) t| ≤ 7*(m : ℝ)^2
Proof (Lean source)
lemma block_deriv_bound (hleg : ClassicalLegendreFacts) (m : ℕ) (hm : 2 ≤ m) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |deriv (block m) t| ≤ 7*(m : ℝ)^2 := by have hd : deriv (block m) t = -((blockNorm m)⁻¹ * legendreBlockSum m t) + (1-t) * ((blockNorm m)⁻¹ * deriv (legendreBlockSum m) t) := by change deriv (fun t => (1-t) * (blockNorm m)⁻¹ * legendreBlockSum m t) t = _ have ha : HasDerivAt (fun t : ℝ => (1-t) * (blockNorm m)⁻¹) (-(blockNorm m)⁻¹) t := by simpa using ((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)).mul_const ((blockNorm m)⁻¹) calc _ = -((blockNorm m)⁻¹) * legendreBlockSum m t + ((1-t) * (blockNorm m)⁻¹) * deriv (legendreBlockSum m) t := (ha.fun_mul (legendreBlockSum_differentiable m t).hasDerivAt).deriv _ = _ := by ring have hn : 0 < blockNorm m := blockNorm_pos m have hnorm : |(blockNorm m)⁻¹ * deriv (legendreBlockSum m) t| ≤ (2*(m : ℝ))*(2*m+1) := by rw [abs_mul, abs_of_pos (inv_pos.mpr hn)] calc _ ≤ (blockNorm m)⁻¹ * (blockNorm m * ((2*(m : ℝ))*(2*m+1))) := mul_le_mul_of_nonneg_left (legendreBlockSum_deriv_bound hleg m hm t ht) (by positivity) _ = _ := by rw [← mul_assoc, inv_mul_cancel₀ hn.ne', one_mul] have htaper : |1-t| ≤ 1 := by rw [abs_of_nonneg (by linarith [ht.2])] linarith [ht.1] rw [hd] calc _ ≤ |(blockNorm m)⁻¹ * legendreBlockSum m t| + |(1-t) * ((blockNorm m)⁻¹ * deriv (legendreBlockSum m) t)| := by simpa only [abs_neg] using abs_add_le (-((blockNorm m)⁻¹ * legendreBlockSum m t)) ((1-t) * ((blockNorm m)⁻¹ * deriv (legendreBlockSum m) t)) _ ≤ 1 + (2*(m : ℝ))*(2*m+1) := by apply add_le_add (normalizedBlock_abs_le_one hleg m t ht) rw [abs_mul] calc _ ≤ 1 * |(blockNorm m)⁻¹ * deriv (legendreBlockSum m) t| := mul_le_mul_of_nonneg_right htaper (abs_nonneg _) _ ≤ _ := by simpa using hnorm _ ≤ 7*(m : ℝ)^2 := by have hmreal : (2 : ℝ) ≤ m := by exact_mod_cast hm nlinarith [sq_nonneg ((m : ℝ)-1)]
CausalSmith.Stat.RdTruesideNoiseFrontier.block_deriv_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:274

The endpoint taper increases degree by at most one, so all prescribed monomials remain orthogonal to every Legendre mode in the block. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m k :
ℕ
hm :
2 ≤ m
hk :
k ≤ m-2
(∫ t in (0 : ℝ)..1, t^k * block m t) = 0
Proof (Lean source)
lemma block_moment_zero (hleg : ClassicalLegendreFacts) (m k : ℕ) (hm : 2 ≤ m) (hk : k ≤ m-2) : (∫ t in (0 : ℝ)..1, t^k * block m t) = 0 := by let p : Polynomial ℝ := Polynomial.X ^ k * (1 - Polynomial.X) have hp : p.natDegree ≤ k+1 := by calc _ ≤ (Polynomial.X ^ k : Polynomial ℝ).natDegree + (1 - Polynomial.X : Polynomial ℝ).natDegree := Polynomial.natDegree_mul_le _ ≤ k+1 := by simp only [Polynomial.natDegree_X_pow] have h := Polynomial.natDegree_sub_le (1 : Polynomial ℝ) Polynomial.X simp only [Polynomial.natDegree_one, Polynomial.natDegree_X, max_eq_right (by omega : 0 ≤ 1)] at h omega have hterm (j : ℕ) (hj : j ∈ Icc m (2*m)) : (∫ t in (0 : ℝ)..1, t^k * (1-t) * legendreP j (2*t-1)) = 0 := by have hkj : k+1 < j := by have := Finset.mem_Icc.mp hj; omega have hdeg : p.degree < j := lt_of_le_of_lt Polynomial.degree_le_natDegree (by exact_mod_cast (lt_of_le_of_lt hp hkj)) simpa [p] using polynomial_shiftedLegendre_orthogonal hleg p j hdeg calc _ = (blockNorm m)⁻¹ * ∑ j ∈ Icc m (2*m), ((2*(j : ℝ)+1) * (-1 : ℝ)^j) * (∫ t in (0 : ℝ)..1, t^k * (1-t) * legendreP j (2*t-1)) := by unfold block simp_rw [Finset.mul_sum] rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_congr rfl intro j hj rw [← intervalIntegral.integral_const_mul, ← intervalIntegral.integral_const_mul] congr 1 ext t ring · intro j hj apply Continuous.intervalIntegrable fun_prop _ = 0 := by rw [Finset.sum_eq_zero (fun j hj => by rw [hterm j hj, mul_zero]), mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.block_moment_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreBlock.lean:321
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.LegendreFacts 6 declarations This module discharges the run's cited Legendre interface from Mathlib's shifted Legendre polynomials and Causalean's Jacobi and Legendre identities.

Exact classical Legendre facts

This module discharges the run's cited Legendre interface from Mathlib's shifted Legendre polynomials and Causalean's Jacobi and Legendre identities.

theorem legendreP_orthogonal_exact

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j k :
ℕ
(∫ t in (-1 : ℝ)..1, legendreP j t * legendreP k t)
= if j = k then 2 / (2 * (j : ℝ) + 1) else 0
Proof (Lean source)
lemma legendreP_orthogonal_exact (j k : ℕ) : (∫ t in (-1 : ℝ)..1, legendreP j t * legendreP k t) = if j = k then 2 / (2 * (j : ℝ) + 1) else 0 := by let F : ℝ → ℝ := fun t => legendreP j t * legendreP k t have h := intervalIntegral.integral_comp_mul_add F (a := (0 : ℝ)) (b := 1) (c := (-2 : ℝ)) (by norm_num) 1 norm_num only [mul_zero, zero_add, mul_one, neg_mul, neg_add_cancel, inv_neg, smul_eq_mul] at h have hleft : (∫ x in (0 : ℝ)..1, F (-2*x+1)) = if j = k then 1 / (2 * (j : ℝ) + 1) else 0 := by simpa only [F, legendreP, show ∀ x : ℝ, (1 - (-2*x+1))/2 = x by intro x; ring] using shiftedLegendre_orthogonal_unit j k have haff : (fun x : ℝ => F (-(2*x)+1)) = fun x => F (-2*x+1) := by funext x congr 1 ring rw [haff, hleft] at h have hsymm : (∫ x in (1 : ℝ)..(-1), F x) = -(∫ x in (-1 : ℝ)..1, F x) := intervalIntegral.integral_symm (-1) 1 rw [hsymm] at h split_ifs with hjk · simp only [if_pos hjk] at h dsimp [F] at h have hd : (2*(j:ℝ)+1) ≠ 0 := by positivity field_simp [hd] at h ⊢ linarith · simp only [if_neg hjk] at h dsimp [F] at h linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_orthogonal_exact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:23
theorem legendreP_reflection_exact

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
legendreP j (-t) = (-1 : ℝ)^j * legendreP j t
Proof (Lean source)
lemma legendreP_reflection_exact (j : ℕ) (t : ℝ) : legendreP j (-t) = (-1 : ℝ)^j * legendreP j t := by unfold legendreP have h := Polynomial.shiftedLegendre_eval_symm j ((1+t)/2 : ℝ) convert h using 1 <;> ring
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_reflection_exact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:54
theorem legendreP_abs_le_one_exact

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
t :
ℝ
ht :
t ∈ Icc (-1 : ℝ) 1
|legendreP j t| ≤ 1
Proof (Lean source)
lemma legendreP_abs_le_one_exact (j : ℕ) (t : ℝ) (ht : t ∈ Icc (-1 : ℝ) 1) : |legendreP j t| ≤ 1 := by unfold legendreP rw [← jacobiShifted_zero_zero_eq_shiftedLegendre] apply jacobiShifted_abs_le_one j 0 0 ((1-t)/2) · norm_num · norm_num · norm_num · constructor <;> linarith [ht.1, ht.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_abs_le_one_exact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:61
theorem legendreP_one_exact

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
legendreP j 1 = 1
Proof (Lean source)
lemma legendreP_one_exact (j : ℕ) : legendreP j 1 = 1 := by unfold legendreP rw [show (1-(1:ℝ))/2 = 0 by norm_num, ← jacobiShifted_zero_zero_eq_shiftedLegendre, jacobiShifted_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_one_exact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:72
theorem legendreP_neg_one_exact

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
legendreP j (-1) = (-1 : ℝ)^j
Proof (Lean source)
lemma legendreP_neg_one_exact (j : ℕ) : legendreP j (-1) = (-1 : ℝ)^j := by rw [legendreP_reflection_exact, legendreP_one_exact, mul_one]
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_neg_one_exact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:79
theorem classicalLegendreFacts_of_mathlib

The exact cited Legendre interface follows from Mathlib's shifted Legendre polynomials and Causalean's normalized Jacobi bound and beta calculus. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
theorem classicalLegendreFacts_of_mathlib : ClassicalLegendreFacts := by intro j k exact ⟨legendreP_orthogonal_exact j k, legendreP_reflection_exact j, legendreP_abs_le_one_exact j, legendreP_neg_one_exact j⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.classicalLegendreFacts_of_mathlib · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LegendreFacts.lean:84
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.LowerWitness 26 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

theorem legal_cancellation

All cancellation and full-domain legality assertions for the actual alternative laws. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
@realizes b(real support width with 0 < b and b ≤ 1)
hm :
2 ≤ m
conclusion 1
block m 0 = 1
conclusion 2
block m 1 = 0
conclusion 3
t ∈ Icc (0 : ℝ) 1 :
|block m t| ≤ 1
conclusion 4
(∫ t in (0 : ℝ)..1, (block m t)^2) ≤ 1 / blockNorm m
conclusion 5
k :
ℕ
k ≤ m-2
(∫ t in (0 : ℝ)..1, t^k * block m t) = 0
conclusion 6
t ∈ Icc (0 : ℝ) 1 :
|deriv (block m) t| ≤ 7 * (m : ℝ)^2
conclusion 7
holderSeminorm β (legalExtension b m) ≤ ofReal (7 * (b/(m : ℝ)^2) ^ (-β))
conclusion 8
s :
Model β σ (altLaw classicalLegendreFacts β b m s hβ hb hm)
conclusion 9
|theta (altLaw classicalLegendreFacts β b m true hβ hb hm)
- theta (altLaw classicalLegendreFacts β b m false hβ hb hm)|
= 2 * kappa * (b/(m : ℝ)^2)^β
Proof (Lean source)
-- @node: lem:legal-cancellation lemma legal_cancellation (β b σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) -- @realizes b(real support width with 0 < b and b ≤ 1) (hm : 2 ≤ m) : block m 0 = 1 ∧ block m 1 = 0 ∧ (∀ t ∈ Icc (0 : ℝ) 1, |block m t| ≤ 1) ∧ (∫ t in (0 : ℝ)..1, (block m t)^2) ≤ 1 / blockNorm m ∧ (∀ k : ℕ, k ≤ m-2 → (∫ t in (0 : ℝ)..1, t^k * block m t) = 0) ∧ (∀ t ∈ Icc (0 : ℝ) 1, |deriv (block m) t| ≤ 7 * (m : ℝ)^2) ∧ holderSeminorm β (legalExtension b m) ≤ ofReal (7 * (b/(m : ℝ)^2) ^ (-β)) ∧ (∀ s : Bool, Model β σ (altLaw classicalLegendreFacts β b m s hβ hb hm)) ∧ |theta (altLaw classicalLegendreFacts β b m true hβ hb hm) - theta (altLaw classicalLegendreFacts β b m false hβ hb hm)| = 2 * kappa * (b/(m : ℝ)^2)^β := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts refine ⟨block_zero legendre_of_gate m, block_one m, block_abs_le_one legendre_of_gate m, ?_⟩ refine ⟨block_sq_integral_le legendre_of_gate m, ?_⟩ refine ⟨fun k hk => block_moment_zero legendre_of_gate m k hm hk, block_deriv_bound legendre_of_gate m hm, ?_⟩ refine ⟨legalExtension_holder_bound legendre_of_gate β b m hβ hb.1 hm, ?_, altLaw_separation legendre_of_gate β b m hβ hb hm⟩ exact fun s => altLaw_model legendre_of_gate β b σ m s hβ hb hm
CausalSmith.Stat.RdTruesideNoiseFrontier.legal_cancellation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:27
def likelihoodTail

The factorial likelihood tail. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
b σ :
ℝ
m :
ℕ
likelihoodTail b σ m :
ℝ
∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodTail · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:50
theorem likelihoodTail_summable Lemma likelihoodTail_summable in the paper ↗

The factorial likelihood tail is absolutely convergent at every support and noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
Summable (fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0)
Proof (Lean source)
lemma likelihoodTail_summable (b σ : ℝ) (m : ℕ) : Summable (fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0) := by have hlam : 0 ≤ likelihoodLambda b σ := by unfold likelihoodLambda positivity apply (Real.summable_pow_div_factorial (likelihoodLambda b σ)).of_norm_bounded intro j have hj : 0 ≤ likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) := by positivity split_ifs <;> simp [Real.norm_eq_abs, abs_of_nonneg hlam, hj]
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodTail_summable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:53

The convergent factorial likelihood tail is nonnegative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
0 ≤ likelihoodTail b σ m
Proof (Lean source)
lemma likelihoodTail_nonneg (b σ : ℝ) (m : ℕ) : 0 ≤ likelihoodTail b σ m := by apply tsum_nonneg intro j unfold likelihoodLambda split_ifs <;> positivity
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodTail_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:65

The retained likelihood terms are bounded by the full exponential series. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
Proof (Lean source)
lemma likelihoodTail_le_exp (b σ : ℝ) (m : ℕ) : likelihoodTail b σ m ≤ exp (likelihoodLambda b σ) := by have hlam : 0 ≤ likelihoodLambda b σ := by unfold likelihoodLambda; positivity have hseries : HasSum (fun j : ℕ => likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ)) (exp (likelihoodLambda b σ)) := by rw [Real.exp_eq_exp_ℝ] exact NormedSpace.expSeries_div_hasSum_exp _ have hbound := tsum_of_norm_bounded hseries (f := fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0) (by intro j have hj : 0 ≤ likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) := by positivity split_ifs <;> simp [Real.norm_eq_abs, abs_of_nonneg hlam, hj]) change ‖likelihoodTail b σ m‖ ≤ exp (likelihoodLambda b σ) at hbound simpa only [Real.norm_eq_abs, abs_of_nonneg (likelihoodTail_nonneg b σ m)] using hbound
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodTail_le_exp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:72
theorem factorial_tail_term_le_geometric Lemma factorial_tail_term_le_geometric in the paper ↗

Above an index whose successor dominates twice the argument, factorial terms are bounded by a geometric sequence with ratio one half. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
z :
ℝ
N k :
ℕ
hz :
0 ≤ z
hsmall :
z ≤ ((N : ℝ) + 1) / 2
z^(k+N) / (Nat.factorial (k+N) : ℝ) ≤ (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k
Proof (Lean source)
lemma factorial_tail_term_le_geometric (z : ℝ) (N k : ℕ) (hz : 0 ≤ z) (hsmall : z ≤ ((N : ℝ) + 1) / 2) : z^(k+N) / (Nat.factorial (k+N) : ℝ) ≤ (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k := by induction k with | zero => simp | succ k ih => have hden : (0 : ℝ) < k+N+1 := by positivity have hratio : z / ((k+N : ℕ) + 1 : ℝ) ≤ 1/2 := by rw [div_le_iff₀ (by positivity)] push_cast linarith [show (0 : ℝ) ≤ k by positivity] have hrec : z^(k+1+N) / (Nat.factorial (k+1+N) : ℝ) = (z^(k+N) / (Nat.factorial (k+N) : ℝ)) * (z / ((k+N : ℕ) + 1 : ℝ)) := by rw [show k+1+N = (k+N)+1 by omega, Nat.factorial_succ, pow_succ] push_cast field_simp rw [hrec, pow_succ] calc _ ≤ (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k * (z / ((k+N : ℕ) + 1 : ℝ)) := mul_le_mul_of_nonneg_right ih (by positivity) _ ≤ (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k * (1/2 : ℝ) := mul_le_mul_of_nonneg_left hratio (by positivity) _ = _ := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.factorial_tail_term_le_geometric · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:88
theorem likelihoodTail_le_twice_first Lemma likelihoodTail_le_twice_first in the paper ↗

Summing the geometric majorant bounds the retained likelihood tail by twice its first term; this is the first inequality in roadmap step CE.1. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hsmall :
likelihoodLambda b σ ≤ (((m-1 : ℕ) : ℝ)+1)/2
likelihoodTail b σ m ≤ 2 * likelihoodLambda b σ^(m-1) / (factorial (m-1) : ℝ)
Proof (Lean source)
lemma likelihoodTail_le_twice_first (b σ : ℝ) (m : ℕ) (hsmall : likelihoodLambda b σ ≤ (((m-1 : ℕ) : ℝ)+1)/2) : likelihoodTail b σ m ≤ 2 * likelihoodLambda b σ^(m-1) / (Nat.factorial (m-1) : ℝ) := by let z := likelihoodLambda b σ let N := m-1 have hz : 0 ≤ z := by unfold z likelihoodLambda; positivity have hshift : likelihoodTail b σ m = ∑' k : ℕ, z^(k+N) / (Nat.factorial (k+N) : ℝ) := by have hzero : (∑ j ∈ range N, if N ≤ j then z^j / (Nat.factorial j : ℝ) else 0) = 0 := by apply Finset.sum_eq_zero intro j hj rw [if_neg (by have := Finset.mem_range.mp hj; omega)] have hs := (likelihoodTail_summable b σ m).sum_add_tsum_nat_add N change (∑ j ∈ range N, if N ≤ j then z^j / (Nat.factorial j : ℝ) else 0) + (∑' k : ℕ, if N ≤ k+N then z^(k+N) / (Nat.factorial (k+N) : ℝ) else 0) = likelihoodTail b σ m at hs simpa only [hzero, zero_add, Nat.le_add_left, if_true] using hs.symm have hmajor : Summable (fun k : ℕ => (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k) := summable_geometric_two.mul_left _ have hterms := factorial_tail_term_le_geometric z N have hsum : Summable (fun k : ℕ => z^(k+N) / (Nat.factorial (k+N) : ℝ)) := hmajor.of_nonneg_of_le (fun k => by positivity) (fun k => hterms k hz hsmall) rw [hshift] calc _ ≤ ∑' k : ℕ, (z^N / (Nat.factorial N : ℝ)) * (1/2 : ℝ)^k := hsum.tsum_le_tsum (fun k => hterms k hz hsmall) hmajor _ = _ := by rw [tsum_mul_left, tsum_geometric_two]; dsimp [z, N]; ring
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodTail_le_twice_first · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:117
theorem full_marked_likelihood

The full observed binary-mark likelihood bound, including absolute continuity and finite density square. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hσ :
σ ∈ Ioc (0 : ℝ) 1
plus :
Pobs (altLaw classicalLegendreFacts β b m true hβ hb hm) σ
minus :
Pobs (altLaw classicalLegendreFacts β b m false hβ hb hm) σ
mid :
16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) * ∫ w : ℝ, markedConvolution b m σ w ^ 2 / treatedConvolution σ w
upper :
16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) * (b/blockNorm m) * exp (b^2/(24*σ^2)) * likelihoodTail b σ m
chiSqExt plus minus ≤ ofReal mid
ofReal mid ≤ ofReal upper
plus ≪ minus
Integrable (fun o => ((plus.rnDeriv minus o).toReal - 1)^2) minus
Integrable (fun w => markedConvolution b m σ w ^ 2 / treatedConvolution σ w)
Summable (fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0)
Proof (Lean source)
-- @node: lem:full-marked-likelihood lemma full_marked_likelihood (β b σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hσ : σ ∈ Ioc (0 : ℝ) 1) : let plus := Pobs (altLaw classicalLegendreFacts β b m true hβ hb hm) σ let minus := Pobs (altLaw classicalLegendreFacts β b m false hβ hb hm) σ let mid := 16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) * ∫ w : ℝ, markedConvolution b m σ w ^ 2 / treatedConvolution σ w let upper := 16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) * (b/blockNorm m) * exp (b^2/(24*σ^2)) * likelihoodTail b σ m chiSqExt plus minus ≤ ofReal mid ∧ ofReal mid ≤ ofReal upper ∧ plus ≪ minus ∧ Integrable (fun o => ((plus.rnDeriv minus o).toReal - 1)^2) minus ∧ Integrable (fun w => markedConvolution b m σ w ^ 2 / treatedConvolution σ w) ∧ Summable (fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ ^ j / (Nat.factorial j : ℝ) else 0) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts refine ⟨?_, ?_, ?_, ?_, markedConvolution_square_div_integrable legendre_of_gate b σ m hb hσ.1, likelihoodTail_summable b σ m⟩ · letI := (altLaw legendre_of_gate β b m true hβ hb hm).prob letI := (altLaw legendre_of_gate β b m false hβ hb hm).prob letI : IsProbabilityMeasure (Pobs (altLaw legendre_of_gate β b m true hβ hb hm) σ) := Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable letI : IsProbabilityMeasure (Pobs (altLaw legendre_of_gate β b m false hβ hb hm) σ) := Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable have hac := altLaw_observed_absolutelyContinuous legendre_of_gate β b σ m true false hβ hb hm have hint := altLaw_observed_likelihood_square_integrable legendre_of_gate β b σ m true false hβ hb hm rw [chiSqExt_eq_ofReal_chiSqDiv _ _ hac hint] apply ENNReal.ofReal_le_ofReal unfold chiSqDiv calc (∫ o, (((Pobs (altLaw legendre_of_gate β b m true hβ hb hm) σ).rnDeriv (Pobs (altLaw legendre_of_gate β b m false hβ hb hm) σ) o).toReal - 1)^2 ∂ Pobs (altLaw legendre_of_gate β b m false hβ hb hm) σ) = ∫ o, (altObservedLikelihoodRatio β b σ m o - 1)^2 ∂ Pobs (altLaw legendre_of_gate β b m false hβ hb hm) σ := by apply integral_congr_ae exact (altLaw_observed_rnDeriv legendre_of_gate β b σ m hβ hb hm hσ.1).fun_comp (fun r => (r - 1)^2) _ = ∫ w : ℝ, ∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w := altLikelihoodRatio_sq_integral_eq legendre_of_gate β b σ m hβ hb hm hσ.1 _ ≤ 16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) * ∫ w : ℝ, markedConvolution b m σ w ^ 2 / treatedConvolution σ w := witnessTreatedCellConvolution_integral_bound legendre_of_gate β b σ m hβ hb hm hσ.1 · apply ENNReal.ofReal_le_ofReal have htail := marked_square_factorial_tail_bound legendre_of_gate b σ m hb hσ.1 hm have hscale : 0 ≤ 16 * kappa^2 * (b/(m : ℝ)^2)^(2*β) := by have hbp := hb.1 positivity have hh := mul_le_mul_of_nonneg_left htail hscale simpa only [likelihoodTail, mul_assoc] using hh · exact altLaw_observed_absolutelyContinuous legendre_of_gate β b σ m true false hβ hb hm · exact altLaw_observed_likelihood_square_integrable legendre_of_gate β b σ m true false hβ hb hm
CausalSmith.Stat.RdTruesideNoiseFrontier.full_marked_likelihood · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:151

Positive noise yields a legal support width. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
noiseSupport σ m ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma noiseSupport_mem (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : noiseSupport σ m ∈ Ioc (0 : ℝ) 1 := by have hmpos : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) change 0 < min 1 (σ * sqrt m / 8) ∧ min 1 (σ * sqrt m / 8) ≤ 1 exact ⟨lt_min (by norm_num) (div_pos (mul_pos hσ.1 (Real.sqrt_pos.2 hmpos)) (by norm_num)), min_le_left _ _⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_mem · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:214
theorem noiseSupport_likelihoodLambda_le Lemma noiseSupport_likelihoodLambda_le in the paper ↗

The noise-adapted support keeps the factorial-series argument below m/256, including the support saturation interface. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
likelihoodLambda (noiseSupport σ m) σ ≤ (m : ℝ)/256
Proof (Lean source)
lemma noiseSupport_likelihoodLambda_le (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : likelihoodLambda (noiseSupport σ m) σ ≤ (m : ℝ)/256 := by have hb := (noiseSupport_mem σ m hσ hm).1.le have hsupport : noiseSupport σ m ≤ σ * sqrt m / 8 := min_le_right _ _ have hs : (noiseSupport σ m)^2 ≤ (σ * sqrt m / 8)^2 := pow_le_pow_left₀ hb hsupport 2 have hroot := Real.sq_sqrt (show (0 : ℝ) ≤ m by positivity) have hσpos := hσ.1 unfold likelihoodLambda rw [div_le_iff₀ (by positivity)] nlinarith [hs]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_likelihoodLambda_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:221
theorem noiseSupport_likelihoodTail_le Lemma noiseSupport_likelihoodTail_le in the paper ↗

The public support's likelihood tail is at most twice its first retained term. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
≤ 2 * likelihoodLambda (noiseSupport σ m) σ^(m-1) / (factorial (m-1) : ℝ)
Proof (Lean source)
lemma noiseSupport_likelihoodTail_le (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : likelihoodTail (noiseSupport σ m) σ m ≤ 2 * likelihoodLambda (noiseSupport σ m) σ^(m-1) / (factorial (m-1) : ℝ) := by apply likelihoodTail_le_twice_first have hlam := noiseSupport_likelihoodLambda_le σ m hσ hm have hcast : ((m-1 : ℕ) : ℝ)+1 = (m : ℝ) := by exact_mod_cast (Nat.sub_add_cancel (show 1 ≤ m by omega)) rw [hcast] exact hlam.trans (by have hm0 : (0 : ℝ) ≤ m := by positivity linarith)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_likelihoodTail_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:236
theorem cancellation_information_first_term_bound Lemma cancellation_information_first_term_bound in the paper ↗

Inserting CE.1 into the full marked likelihood bound retains both binary marks and the whole real proxy domain. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
b :
h :
chiSqExt (Pobs (altLaw hleg β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw hleg β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ)
≤ ofReal (32 * kappa^2 * h^(2*β) * (b/blockNorm m) * exp (b^2/(24*σ^2)) * likelihoodLambda b σ^(m-1) / (factorial (m-1) : ℝ))
Proof (Lean source)
lemma cancellation_information_first_term_bound (hleg : ClassicalLegendreFacts) (β σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : let b := noiseSupport σ m let h := noiseResolution σ m chiSqExt (Pobs (altLaw hleg β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw hleg β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ) ≤ ofReal (32 * kappa^2 * h^(2*β) * (b/blockNorm m) * exp (b^2/(24*σ^2)) * likelihoodLambda b σ^(m-1) / (factorial (m-1) : ℝ)) := by dsimp only have hb := noiseSupport_mem σ m hσ hm have hfull := full_marked_likelihood β (noiseSupport σ m) σ m hβ hb hm hσ apply (hfull.1.trans hfull.2.1).trans apply ENNReal.ofReal_le_ofReal have htail := noiseSupport_likelihoodTail_le σ m hσ hm have hb0 : 0 ≤ noiseSupport σ m := hb.1.le have hcoeff : 0 ≤ 16 * kappa^2 * (noiseSupport σ m/(m : ℝ)^2)^(2*β) * (noiseSupport σ m/blockNorm m) * exp ((noiseSupport σ m)^2/(24*σ^2)) := by exact mul_nonneg (mul_nonneg (by positivity) (div_nonneg hb.1.le (blockNorm_pos m).le)) (Real.exp_pos _).le have hbound := mul_le_mul_of_nonneg_left htail hcoeff simpa only [noiseResolution] using hbound.trans_eq (by ring)
CausalSmith.Stat.RdTruesideNoiseFrontier.cancellation_information_first_term_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:251
theorem log_factorial_lower_bound Lemma log_factorial_lower_bound in the paper ↗

The elementary logarithmic factorial estimate in CE.1, valid at every positive integer, follows by summing the logarithm's tangent-line inequality. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
N :
ℕ
hN :
1 ≤ N
(N : ℝ) * log N - N ≤ log (Nat.factorial N : ℝ)
Proof (Lean source)
lemma log_factorial_lower_bound (N : ℕ) (hN : 1 ≤ N) : (N : ℝ) * log N - N ≤ log (Nat.factorial N : ℝ) := by induction N, hN using Nat.le_induction with | base => norm_num | succ N hN ih => have hNp : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega) have hquot := Real.log_le_sub_one_of_pos (show 0 < ((N : ℝ)+1)/N by positivity) have hlog : (N : ℝ) * (log ((N : ℝ)+1) - log N) ≤ 1 := by rw [Real.log_div (by positivity) hNp.ne'] at hquot have hh := mul_le_mul_of_nonneg_left hquot hNp.le have hcancel : (N : ℝ) * (((N : ℝ)+1)/N - 1) = 1 := by field_simp; ring rwa [hcancel] at hh rw [Nat.factorial_succ, Nat.cast_mul, Real.log_mul (by positivity) (by positivity)] push_cast nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.log_factorial_lower_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:277
theorem factorial_term_le_log_exp Lemma factorial_term_le_log_exp in the paper ↗

The last inequality in CE.1: factorial decay is written in exponential form. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
z :
ℝ
N :
ℕ
hz :
0 < z
hN :
1 ≤ N
z^N / (Nat.factorial N : ℝ) ≤ exp (-(N : ℝ) * log ((N : ℝ)/(exp 1 * z)))
Proof (Lean source)
lemma factorial_term_le_log_exp (z : ℝ) (N : ℕ) (hz : 0 < z) (hN : 1 ≤ N) : z^N / (Nat.factorial N : ℝ) ≤ exp (-(N : ℝ) * log ((N : ℝ)/(exp 1 * z))) := by have hNp : (0 : ℝ) < N := by exact_mod_cast (show 0 < N by omega) have hfac := log_factorial_lower_bound N hN have hlog : log (z^N / (Nat.factorial N : ℝ)) ≤ -(N : ℝ) * log ((N : ℝ)/(exp 1 * z)) := by rw [Real.log_div (by positivity) (by positivity), Real.log_pow, Real.log_div hNp.ne' (by positivity), Real.log_mul (by positivity) hz.ne', Real.log_exp] nlinarith have he := Real.exp_le_exp.mpr hlog rwa [Real.exp_log (by positivity)] at he
CausalSmith.Stat.RdTruesideNoiseFrontier.factorial_term_le_log_exp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:296
theorem factorial_exponent_lower_bound Lemma factorial_exponent_lower_bound in the paper ↗

CE.2 compares the retained factorial exponent to the uniform degree exponent. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
M N z :
ℝ
hM :
2 ≤ M
hN :
M/2 ≤ N
hz :
0 < z
hsmall :
z ≤ M/256
M * (1 + log (M/z))/8 ≤ N * log (N/(exp 1*z)) - z/6
Proof (Lean source)
lemma factorial_exponent_lower_bound (M N z : ℝ) (hM : 2 ≤ M) (hN : M/2 ≤ N) (hz : 0 < z) (hsmall : z ≤ M/256) : M * (1 + log (M/z))/8 ≤ N * log (N/(exp 1*z)) - z/6 := by have hMp : 0 < M := by linarith have hNp : 0 < N := by linarith have hratio : 256 ≤ M/z := (le_div_iff₀ hz).mpr (by linarith) have hlogr : 8 * log 2 ≤ log (M/z) := by have hh := Real.log_le_log (by norm_num : (0 : ℝ) < 256) hratio have hid : log (256 : ℝ) = 8 * log 2 := by rw [show (256 : ℝ) = 2^8 by norm_num, Real.log_pow]; norm_num rwa [hid] at hh have hlogtwo : (1/2 : ℝ) ≤ log 2 := by have hh := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at hh ⊢ exact hh have hlogN : log (M/z) - log 2 - 1 ≤ log (N/(exp 1*z)) := by have hh := Real.log_le_log (show 0 < M/2 by positivity) hN rw [Real.log_div hMp.ne' (by norm_num)] at hh rw [Real.log_div hMp.ne' hz.ne', Real.log_div hNp.ne' (by positivity), Real.log_mul (by positivity) hz.ne', Real.log_exp] linarith have hpos : 0 ≤ log (M/z) - log 2 - 1 := by linarith have hprod := mul_le_mul hN hlogN hpos hNp.le have hgap : 0 ≤ (3/8 : ℝ)*log (M/z) - log 2/2 - 5/8 - 1/1536 := by linarith have hh := mul_nonneg hMp.le hgap nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.factorial_exponent_lower_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:311
theorem noiseSupport_likelihoodTail_exp_bound Lemma noiseSupport_likelihoodTail_exp_bound in the paper ↗

The support choice and CE.1--CE.2 give the exponential likelihood-tail bound CE.3. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
exp ((noiseSupport σ m)^2/(24*σ^2)) * likelihoodTail (noiseSupport σ m) σ m
≤ 2 * exp (-(m : ℝ) * (1 + log ((m : ℝ)/likelihoodLambda (noiseSupport σ m) σ))/8)
Proof (Lean source)
lemma noiseSupport_likelihoodTail_exp_bound (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : exp ((noiseSupport σ m)^2/(24*σ^2)) * likelihoodTail (noiseSupport σ m) σ m ≤ 2 * exp (-(m : ℝ) * (1 + log ((m : ℝ)/likelihoodLambda (noiseSupport σ m) σ))/8) := by let z := likelihoodLambda (noiseSupport σ m) σ have hbp := (noiseSupport_mem σ m hσ hm).1 have hσp := hσ.1 have hz : 0 < z := by dsimp [z, likelihoodLambda]; positivity have hsmall := noiseSupport_likelihoodLambda_le σ m hσ hm have hN : 1 ≤ m-1 := by omega have hcast : ((m-1 : ℕ) : ℝ)+1 = (m : ℝ) := by exact_mod_cast (Nat.sub_add_cancel (show 1 ≤ m by omega)) have hNhalf : (m : ℝ)/2 ≤ ((m-1 : ℕ) : ℝ) := by have hh : (2 : ℝ) ≤ m := by exact_mod_cast hm linarith have hexponent := factorial_exponent_lower_bound (m : ℝ) ((m-1 : ℕ) : ℝ) z (by exact_mod_cast hm) hNhalf hz hsmall have hscale : (noiseSupport σ m)^2/(24*σ^2) = z/6 := by dsimp [z, likelihoodLambda]; ring rw [hscale] calc _ ≤ exp (z/6) * (2 * z^(m-1) / (factorial (m-1) : ℝ)) := mul_le_mul_of_nonneg_left (noiseSupport_likelihoodTail_le σ m hσ hm) (by positivity) _ ≤ exp (z/6) * (2 * exp (-((m-1 : ℕ) : ℝ) * log (((m-1 : ℕ) : ℝ)/(exp 1*z)))) := by apply mul_le_mul_of_nonneg_left _ (by positivity) have hh := mul_le_mul_of_nonneg_left (factorial_term_le_log_exp z (m-1) hz hN) (by norm_num : (0 : ℝ) ≤ 2) simpa only [mul_div_assoc] using hh _ = 2 * exp (z/6 - ((m-1 : ℕ) : ℝ) * log (((m-1 : ℕ) : ℝ)/(exp 1*z))) := by rw [sub_eq_add_neg, Real.exp_add]; ring _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by norm_num) apply Real.exp_le_exp.mpr linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_likelihoodTail_exp_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:342
theorem noiseSupport_div_blockNorm_le Lemma noiseSupport_div_blockNorm_le in the paper ↗

The block normalization converts support mass into one resolution factor. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
noiseSupport σ m / blockNorm m ≤ noiseResolution σ m / 3
Proof (Lean source)
lemma noiseSupport_div_blockNorm_le (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : noiseSupport σ m / blockNorm m ≤ noiseResolution σ m / 3 := by have hb := (noiseSupport_mem σ m hσ hm).1.le have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hnorm : 3*(m : ℝ)^2 ≤ blockNorm m := by unfold blockNorm nlinarith unfold noiseResolution calc _ ≤ noiseSupport σ m / (3*(m : ℝ)^2) := div_le_div_of_nonneg_left hb (by positivity) hnorm _ = _ := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_div_blockNorm_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:382
theorem cancellation_information_degree_bound Lemma cancellation_information_degree_bound in the paper ↗

CE.4 is the full marked information bound with its factorial degree exponent. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
b :
h :
chiSqExt (Pobs (altLaw hleg β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw hleg β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ)
≤ ofReal ((32/3 : ℝ) * kappa^2 * h^(2*β+1) * exp (-(m : ℝ)*(1 + log ((m : ℝ)/likelihoodLambda b σ))/8))
Proof (Lean source)
lemma cancellation_information_degree_bound (hleg : ClassicalLegendreFacts) (β σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : let b := noiseSupport σ m let h := noiseResolution σ m chiSqExt (Pobs (altLaw hleg β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw hleg β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ) ≤ ofReal ((32/3 : ℝ) * kappa^2 * h^(2*β+1) * exp (-(m : ℝ)*(1 + log ((m : ℝ)/likelihoodLambda b σ))/8)) := by dsimp only have hb := noiseSupport_mem σ m hσ hm have hfull := full_marked_likelihood β (noiseSupport σ m) σ m hβ hb hm hσ apply (hfull.1.trans hfull.2.1).trans apply ENNReal.ofReal_le_ofReal have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hbp := hb.1 have hhp : 0 < noiseResolution σ m := by unfold noiseResolution; positivity have htail := noiseSupport_likelihoodTail_exp_bound σ m hσ hm have hnorm := noiseSupport_div_blockNorm_le σ m hσ hm have hrpow : (noiseResolution σ m)^(2*β+1) = (noiseResolution σ m)^(2*β) * noiseResolution σ m := by rw [Real.rpow_add hhp, Real.rpow_one] change 16 * kappa^2 * (noiseResolution σ m)^(2*β) * (noiseSupport σ m/blockNorm m) * exp ((noiseSupport σ m)^2/(24*σ^2)) * likelihoodTail (noiseSupport σ m) σ m ≤ _ calc _ = (16 * kappa^2 * (noiseResolution σ m)^(2*β) * (noiseSupport σ m/blockNorm m)) * (exp ((noiseSupport σ m)^2/(24*σ^2)) * likelihoodTail (noiseSupport σ m) σ m) := by ring _ ≤ (16 * kappa^2 * (noiseResolution σ m)^(2*β) * (noiseSupport σ m/blockNorm m)) * (2 * exp (-(m : ℝ)*(1 + log ((m : ℝ)/likelihoodLambda (noiseSupport σ m) σ))/8)) := mul_le_mul_of_nonneg_left htail (mul_nonneg (by positivity) (div_nonneg hb.1.le (blockNorm_pos m).le)) _ ≤ (16 * kappa^2 * (noiseResolution σ m)^(2*β) * (noiseResolution σ m/3)) * (2 * exp (-(m : ℝ)*(1 + log ((m : ℝ)/likelihoodLambda (noiseSupport σ m) σ))/8)) := by apply mul_le_mul_of_nonneg_right _ (by positivity) exact mul_le_mul_of_nonneg_left hnorm (by positivity) _ = _ := by rw [hrpow]; ring
CausalSmith.Stat.RdTruesideNoiseFrontier.cancellation_information_degree_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:397
theorem noiseSupport_saturated_threshold Lemma noiseSupport_saturated_threshold in the paper ↗

The saturated support implies the scalar threshold in CE.8. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
1 ≤ σ * sqrt m / 8
conclusion 1
noiseSupport σ m = 1
conclusion 2
64 ≤ σ^2 * (m : ℝ)
Proof (Lean source)
lemma noiseSupport_saturated_threshold (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : 1 ≤ σ * sqrt m / 8) : noiseSupport σ m = 1 ∧ 64 ≤ σ^2 * (m : ℝ) := by have hroot := Real.sq_sqrt (show (0 : ℝ) ≤ m by positivity) have hprod : 8 ≤ σ * sqrt m := by linarith have hprod0 : 0 ≤ σ * sqrt m := by positivity constructor · exact min_eq_left hsat · nlinarith [sq_nonneg (σ * sqrt m - 8)]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_saturated_threshold · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:443

At saturated support, the compact cost formula is exact, including the saturation equality; this is the equality in CE.8. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
1 ≤ σ * sqrt m / 8
1 + noiseCost (noiseResolution σ m) σ = (m : ℝ) * (1 + log (σ^2 * (m : ℝ)))
Proof (Lean source)
lemma noiseCost_saturated_eq (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : 1 ≤ σ * sqrt m / 8) : 1 + noiseCost (noiseResolution σ m) σ = (m : ℝ) * (1 + log (σ^2 * (m : ℝ))) := by have hs := noiseSupport_saturated_threshold σ m hσ hm hsat have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hm2 : (2 : ℝ) ≤ m := by exact_mod_cast hm have hh : noiseResolution σ m = 1 / (m : ℝ)^2 := by unfold noiseResolution rw [hs.1] have hcompact : 1 / (m : ℝ)^2 < σ^4 := by rw [div_lt_iff₀ (by positivity)] nlinarith [sq_nonneg (σ^2 * (m : ℝ) - 64)] have hσ4 : σ^4 ≤ σ := by have := pow_le_pow_left₀ hσ.1.le hσ.2 3 nlinarith [mul_le_mul_of_nonneg_left this hσ.1.le] have hroot : sqrt (1 / (m : ℝ)^2) = 1 / (m : ℝ) := by rw [Real.sqrt_div (by norm_num), Real.sqrt_one, Real.sqrt_sq hmp.le] have hpower : (1 / (m : ℝ)^2) ^ (-1/2 : ℝ) = (m : ℝ) := by rw [show (-1/2 : ℝ) = -(1/2 : ℝ) by norm_num, Real.rpow_neg (by positivity), ← Real.sqrt_eq_rpow, hroot] simp rw [hh, noiseCost, if_neg (by linarith), if_neg (not_le.mpr hcompact), hpower, hroot] simp only [div_div_eq_mul_div, div_one] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_saturated_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:455
theorem noiseCost_saturated_le_degree Lemma noiseCost_saturated_le_degree in the paper ↗

The logarithm is monotone under the factor four in the likelihood argument, yielding the inequality in CE.8. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
1 ≤ σ * sqrt m / 8
≤ (m : ℝ) * (1 + log ((m : ℝ) / likelihoodLambda (noiseSupport σ m) σ))
Proof (Lean source)
lemma noiseCost_saturated_le_degree (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : 1 ≤ σ * sqrt m / 8) : 1 + noiseCost (noiseResolution σ m) σ ≤ (m : ℝ) * (1 + log ((m : ℝ) / likelihoodLambda (noiseSupport σ m) σ)) := by have hs := noiseSupport_saturated_threshold σ m hσ hm hsat rw [noiseCost_saturated_eq σ m hσ hm hsat, hs.1, likelihoodLambda] simp only [one_pow, div_div_eq_mul_div, div_one] apply mul_le_mul_of_nonneg_left _ (by positivity) apply add_le_add_right have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hσp := hσ.1 apply Real.log_le_log (by positivity) nlinarith [sq_nonneg σ, show (0 : ℝ) ≤ m by positivity]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_saturated_le_degree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:485
theorem noiseSupport_unsaturated_identities Lemma noiseSupport_unsaturated_identities in the paper ↗

The unsaturated support fixes the likelihood parameter and the scale identity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
σ * sqrt m / 8 < 1
conclusion 1
noiseSupport σ m = σ * sqrt m / 8
conclusion 2
σ^2 * (m : ℝ) = 64 * (noiseSupport σ m)^2
conclusion 3
likelihoodLambda (noiseSupport σ m) σ = (m : ℝ)/256
Proof (Lean source)
lemma noiseSupport_unsaturated_identities (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : σ * sqrt m / 8 < 1) : noiseSupport σ m = σ * sqrt m / 8 ∧ σ^2 * (m : ℝ) = 64 * (noiseSupport σ m)^2 ∧ likelihoodLambda (noiseSupport σ m) σ = (m : ℝ)/256 := by have hb : noiseSupport σ m = σ * sqrt m / 8 := min_eq_right hsat.le have hroot := Real.sq_sqrt (show (0 : ℝ) ≤ m by positivity) have hσp := hσ.1 refine ⟨hb, ?_, ?_⟩ · rw [hb] nlinarith [hroot] · rw [hb, likelihoodLambda] field_simp nlinarith [hroot]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_unsaturated_identities · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:504
theorem noiseCost_unsaturated_intermediate_eq Lemma noiseCost_unsaturated_intermediate_eq in the paper ↗

CE.5: the intermediate cost is exactly four times the degree. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
σ * sqrt m / 8 < 1
hinter :
σ^4 ≤ noiseResolution σ m
1 + noiseCost (noiseResolution σ m) σ = 4 * (m : ℝ)
Proof (Lean source)
lemma noiseCost_unsaturated_intermediate_eq (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : σ * sqrt m / 8 < 1) (hinter : σ^4 ≤ noiseResolution σ m) : 1 + noiseCost (noiseResolution σ m) σ = 4 * (m : ℝ) := by have hid := noiseSupport_unsaturated_identities σ m hσ hm hsat have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hm2 : (2 : ℝ) ≤ m := by exact_mod_cast hm have hσp := hσ.1 have hbp := (noiseSupport_mem σ m hσ hm).1 have hhp : 0 < noiseResolution σ m := by unfold noiseResolution; positivity have hsmall : noiseResolution σ m < σ := by rw [noiseResolution, hid.1] have hr : sqrt m < 8 * (m : ℝ)^2 := by have hr0 := Real.sqrt_nonneg (m : ℝ) have hrs := Real.sq_sqrt hmp.le nlinarith [sq_nonneg ((m : ℝ)-1)] apply (div_lt_iff₀ (by positivity)).mpr nlinarith rw [noiseCost, if_neg (not_le.mpr hsmall), if_pos hinter] have hcube : ((σ / noiseResolution σ m) ^ (2/3 : ℝ))^3 = (4 * (m : ℝ))^3 := by rw [← Real.rpow_mul_natCast (by positivity)] norm_num rw [noiseResolution, div_div_eq_mul_div] field_simp nlinarith [hid.2] have heq : (σ / noiseResolution σ m) ^ (2/3 : ℝ) = 4 * (m : ℝ) := by exact (pow_left_inj₀ (by positivity) (by positivity) (by norm_num : (3 : ℕ) ≠ 0)).mp hcube linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_unsaturated_intermediate_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:521
theorem noiseCost_compact_support_bound Lemma noiseCost_compact_support_bound in the paper ↗

CE.6--CE.7 bound the two compact-cost factors throughout unsaturated support. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ M b :
ℝ
hσ :
0 < σ
hM :
0 < M
hb :
0 < b
hb1 :
b ≤ 1
hscale :
σ^2 * M = 64*b^2
hcompact :
b/M^2 < σ^4
(b/M^2)^(-1/2 : ℝ) * (1 + log (σ^2 / sqrt (b/M^2))) ≤ 4*M*(1 + log 256)
Proof (Lean source)
lemma noiseCost_compact_support_bound (σ M b : ℝ) (hσ : 0 < σ) (hM : 0 < M) (hb : 0 < b) (hb1 : b ≤ 1) (hscale : σ^2 * M = 64*b^2) (hcompact : b/M^2 < σ^4) : (b/M^2)^(-1/2 : ℝ) * (1 + log (σ^2 / sqrt (b/M^2))) ≤ 4*M*(1 + log 256) := by have hfour : σ^4 * M^2 = 4096*b^4 := by have hh := congrArg (fun x : ℝ => x^2) hscale nlinarith only [hh] have hc : b < 4096*b^4 := by have hh := (div_lt_iff₀ (show 0 < M^2 by positivity)).mp hcompact rwa [hfour] at hh have hbmin : (1/16 : ℝ) ≤ b := by by_contra hn have hh : b ≤ (1/16 : ℝ) := (not_le.mp hn).le have hp := pow_le_pow_left₀ hb.le hh 3 norm_num at hp have hmul := mul_le_mul_of_nonneg_left hp hb.le nlinarith only [hc, hmul] have hhp : 0 < b/M^2 := by positivity have hroot : sqrt (b/M^2) = sqrt b / M := by rw [Real.sqrt_div hb.le, Real.sqrt_sq hM.le] have hmin : 1/(4*M) ≤ sqrt (b/M^2) := by have hh := Real.sqrt_le_sqrt (div_le_div_of_nonneg_right hbmin (show 0 ≤ M^2 by positivity)) have he : sqrt ((1/16 : ℝ)/M^2) = 1/(4*M) := by rw [show (1/16 : ℝ)/M^2 = 1/(4*M)^2 by ring, Real.sqrt_div (by norm_num), Real.sqrt_one, Real.sqrt_sq (by positivity)] rwa [he] at hh have hfactor : (b/M^2)^(-1/2 : ℝ) ≤ 4*M := by rw [show (-1/2 : ℝ) = -(1/2 : ℝ) by norm_num, Real.rpow_neg hhp.le, ← Real.sqrt_eq_rpow, ← one_div] apply (div_le_iff₀ (Real.sqrt_pos.mpr hhp)).mpr have hh := (div_le_iff₀ (show 0 < 4*M by positivity)).mp hmin nlinarith only [hh] have hbpow : b^2 ≤ sqrt b := by have hp := pow_le_pow_left₀ hb.le hb1 3 norm_num at hp have hh := mul_le_mul_of_nonneg_left hp hb.le have hs := Real.sq_sqrt hb.le have hr := Real.sqrt_nonneg b nlinarith only [hh, hs, hr, sq_nonneg (b^2 - sqrt b)] have harg : σ^2 / sqrt (b/M^2) ≤ 64 := by rw [hroot] apply (div_le_iff₀ (by positivity : 0 < sqrt b / M)).mpr rw [← mul_div_assoc] apply (le_div_iff₀ hM).mpr nlinarith only [hscale, hbpow] have hlog : log (σ^2 / sqrt (b/M^2)) ≤ log 256 := Real.log_le_log (by positivity) (harg.trans (by norm_num)) have hlogpos : 0 ≤ 1 + log 256 := by have hh := Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 256) linarith calc _ ≤ (b/M^2)^(-1/2 : ℝ) * (1 + log 256) := mul_le_mul_of_nonneg_left (by linarith only [hlog]) (by positivity) _ ≤ _ := mul_le_mul_of_nonneg_right hfactor hlogpos
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_compact_support_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:553
theorem noiseCost_unsaturated_le_degree Lemma noiseCost_unsaturated_le_degree in the paper ↗

CE.5--CE.7 compare both unsaturated cost branches to the likelihood degree exponent. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsat :
σ * sqrt m / 8 < 1
≤ 4 * (m : ℝ) * (1 + log ((m : ℝ) / likelihoodLambda (noiseSupport σ m) σ))
Proof (Lean source)
lemma noiseCost_unsaturated_le_degree (σ : ℝ) (m : ℕ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsat : σ * sqrt m / 8 < 1) : 1 + noiseCost (noiseResolution σ m) σ ≤ 4 * (m : ℝ) * (1 + log ((m : ℝ) / likelihoodLambda (noiseSupport σ m) σ)) := by have hid := noiseSupport_unsaturated_identities σ m hσ hm hsat have hmp : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hm2 : (2 : ℝ) ≤ m := by exact_mod_cast hm have hratio : (m : ℝ) / likelihoodLambda (noiseSupport σ m) σ = 256 := by rw [hid.2.2] field_simp rw [hratio] have hlog := Real.log_nonneg (by norm_num : (1 : ℝ) ≤ 256) by_cases hlow : σ ≤ noiseResolution σ m · rw [noiseCost, if_pos hlow] have hh := mul_nonneg (show 0 ≤ 4*(m : ℝ) by positivity) hlog nlinarith only [hm2, hh] · by_cases hinter : σ^4 ≤ noiseResolution σ m · rw [noiseCost_unsaturated_intermediate_eq σ m hσ hm hsat hinter] exact le_mul_of_one_le_right (by positivity) (by linarith) · have hb := noiseSupport_mem σ m hσ hm have hc := noiseCost_compact_support_bound σ (m : ℝ) (noiseSupport σ m) hσ.1 hmp hb.1 hb.2 hid.2.1 (lt_of_not_ge hinter) rw [noiseCost, if_neg hlow, if_neg hinter] change 1 + ((noiseSupport σ m / (m : ℝ)^2)^(-1/2 : ℝ) * (1 + log (σ^2 / sqrt (noiseSupport σ m / (m : ℝ)^2))) - 1) ≤ _ linarith only [hc]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_unsaturated_le_degree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:611
theorem cancellation_information_envelope

The optimized one-observation extended information envelope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hσ :
σ ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
b :
h :
chiSqExt (Pobs (altLaw classicalLegendreFacts β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw classicalLegendreFacts β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ)
≤ ofReal ((32/3 : ℝ) * kappa^2 * h^(2*β+1) * exp (-(1 + noiseCost h σ)/32))
Proof (Lean source)
-- @node: lem:cancellation-information-envelope lemma cancellation_information_envelope (β σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : let b := noiseSupport σ m let h := noiseResolution σ m chiSqExt (Pobs (altLaw classicalLegendreFacts β b m true hβ (noiseSupport_mem σ m hσ hm) hm) σ) (Pobs (altLaw classicalLegendreFacts β b m false hβ (noiseSupport_mem σ m hσ hm) hm) σ) ≤ ofReal ((32/3 : ℝ) * kappa^2 * h^(2*β+1) * exp (-(1 + noiseCost h σ)/32)) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts -- Assemble the degree bound with the support/cost comparisons CE.5--CE.8. suffices hcost : 1 + noiseCost (noiseResolution σ m) σ ≤ 4 * (m : ℝ) * (1 + log ((m : ℝ)/likelihoodLambda (noiseSupport σ m) σ)) by apply (cancellation_information_degree_bound legendre_of_gate β σ m hβ hσ hm).trans apply ENNReal.ofReal_le_ofReal apply mul_le_mul_of_nonneg_left _ (by have hb := (noiseSupport_mem σ m hσ hm).1.le have hh : 0 ≤ noiseResolution σ m := by unfold noiseResolution; positivity positivity) apply Real.exp_le_exp.mpr linarith by_cases hsat : 1 ≤ σ * sqrt m / 8 · have hbound := noiseCost_saturated_le_degree σ m hσ hm hsat have hbp := (noiseSupport_mem σ m hσ hm).1 have hσp := hσ.1 have hz : 0 < likelihoodLambda (noiseSupport σ m) σ := by unfold likelihoodLambda positivity have hsmall := noiseSupport_likelihoodLambda_le σ m hσ hm have hm0 : (0 : ℝ) ≤ m := by positivity have hratio : 1 ≤ (m : ℝ) / likelihoodLambda (noiseSupport σ m) σ := by rw [le_div_iff₀ hz] linarith have hB : 0 ≤ (m : ℝ) * (1 + log ((m : ℝ) / likelihoodLambda (noiseSupport σ m) σ)) := mul_nonneg hm0 (by linarith [Real.log_nonneg hratio]) linarith · exact noiseCost_unsaturated_le_degree σ m hσ hm (lt_of_not_ge hsat)
CausalSmith.Stat.RdTruesideNoiseFrontier.cancellation_information_envelope · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/LowerWitness.lean:641
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.MarkedCells 9 declarations The full continuation restricts to the compact block on the treated arm.

Treated-cell convolution formulas for the actual witness probabilities

The full continuation restricts to the compact block on the treated arm. Applying Gaussian convolution to the witness success and failure probabilities gives ML.1, and the existing two-cell integral bound supplies ML.2 for these convolutions.

theorem legalExtension_treated_convolution Lemma legalExtension_treated_convolution in the paper ↗

On the treated arm the full continuation has exactly the compact convolution. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
(∫ x in (0 : ℝ)..1, legalExtension b m x * phi σ (w-x)) = markedConvolution b m σ w
Proof (Lean source)
lemma legalExtension_treated_convolution (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : (∫ x in (0 : ℝ)..1, legalExtension b m x * phi σ (w-x)) = markedConvolution b m σ w := by have hbp := hb.1 have hc : Continuous (fun x => legalExtension b m x * phi σ (w-x)) := by fun_prop have hlocal : (∫ x in (0 : ℝ)..b, legalExtension b m x * phi σ (w-x)) = markedConvolution b m σ w := by apply intervalIntegral.integral_congr_Ioo_of_le hb.1.le intro x hx simp [legalExtension, not_lt.mpr hx.1.le, hx.2.le] have htail : (∫ x in b..1, legalExtension b m x * phi σ (w-x)) = 0 := by calc _ = ∫ x in b..1, (0 : ℝ) := by apply intervalIntegral.integral_congr_Ioo_of_le hb.2 intro x hx simp [legalExtension, not_lt.mpr (hb.1.le.trans hx.1.le), not_le.mpr hx.1] _ = 0 := by simp rw [← intervalIntegral.integral_add_adjacent_intervals (hc.intervalIntegrable 0 b) (hc.intervalIntegrable b 1), hlocal, htail, add_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_treated_convolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:18
theorem altProbability_success_convolution Lemma altProbability_success_convolution in the paper ↗

Convolving the actual success probability gives the first treated cell of ML.1. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s :
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
(1/2 : ℝ) * (∫ x in (0 : ℝ)..1, altProbability β b m s x * phi σ (w-x))
+ witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w / 2
Proof (Lean source)
lemma altProbability_success_convolution (β b σ : ℝ) (m : ℕ) (s : Bool) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : (1/2 : ℝ) * (∫ x in (0 : ℝ)..1, altProbability β b m s x * phi σ (w-x)) = treatedConvolution σ w / 4 + witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w / 2 := by have hbp := hb.1 have hp : Continuous (fun x => phi σ (w-x)) := by fun_prop have hv : Continuous (fun x => legalExtension b m x * phi σ (w-x)) := by fun_prop have he : (fun x => altProbability β b m s x * phi σ (w-x)) = (fun x => (1/2 : ℝ) * phi σ (w-x) + (witnessSign s * kappa * (b/(m : ℝ)^2)^β) * (legalExtension b m x * phi σ (w-x))) := by funext x unfold altProbability ring rw [he, intervalIntegral.integral_add ((hp.const_mul _).intervalIntegrable 0 1) ((hv.const_mul _).intervalIntegrable 0 1)] rw [intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul, legalExtension_treated_convolution b σ m hb w] change (1/2 : ℝ) * ((1/2 : ℝ) * treatedConvolution σ w + _) = _ ring
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_success_convolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:41
theorem altProbability_failure_convolution Lemma altProbability_failure_convolution in the paper ↗

Convolving the failure probability gives the second treated cell of ML.1. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s :
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
(1/2 : ℝ) * (∫ x in (0 : ℝ)..1, (1-altProbability β b m s x) * phi σ (w-x))
- witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w / 2
Proof (Lean source)
lemma altProbability_failure_convolution (β b σ : ℝ) (m : ℕ) (s : Bool) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : (1/2 : ℝ) * (∫ x in (0 : ℝ)..1, (1-altProbability β b m s x) * phi σ (w-x)) = treatedConvolution σ w / 4 - witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w / 2 := by have hbp := hb.1 have hp : Continuous (fun x => phi σ (w-x)) := by fun_prop have hv : Continuous (fun x => altProbability β b m s x * phi σ (w-x)) := by fun_prop have he : (fun x => (1-altProbability β b m s x) * phi σ (w-x)) = (fun x => phi σ (w-x) - altProbability β b m s x * phi σ (w-x)) := by funext x ring rw [he, intervalIntegral.integral_sub (hp.intervalIntegrable 0 1) (hv.intervalIntegrable 0 1)] have hs := altProbability_success_convolution β b σ m s hb w change (1/2 : ℝ) * (treatedConvolution σ w - _) = _ linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_failure_convolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:65

The two treated-cell convolutions induced by the actual witness probabilities. The factor one half is the uniform latent score density. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β b σ :
ℝ
m :
ℕ
s y :
w :
ℝ
witnessTreatedCellConvolution β b σ m s y w :
ℝ
(1/2 : ℝ) * ∫ x in (0 : ℝ)..1, (if y then altProbability β b m s x else 1-altProbability β b m s x) * phi σ (w-x)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:84
theorem witnessTreatedCellConvolution_eq Lemma witnessTreatedCellConvolution_eq in the paper ↗

Both actual treated-cell convolutions have the displayed ML.1 form. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s y :
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
+ witnessSign y * witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w/2
Proof (Lean source)
lemma witnessTreatedCellConvolution_eq (β b σ : ℝ) (m : ℕ) (s y : Bool) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : witnessTreatedCellConvolution β b σ m s y w = treatedConvolution σ w/4 + witnessSign y * witnessSign s * kappa * (b/(m : ℝ)^2)^β * markedConvolution b m σ w/2 := by cases y · change (1/2 : ℝ) * (∫ x in (0 : ℝ)..1, (1-altProbability β b m s x) * phi σ (w-x)) = _ rw [altProbability_failure_convolution β b σ m s hb w] simp only [witnessSign, Bool.false_eq_true, if_false] ring · change (1/2 : ℝ) * (∫ x in (0 : ℝ)..1, altProbability β b m s x * phi σ (w-x)) = _ rw [altProbability_success_convolution β b σ m s hb w] simp only [witnessSign, if_true, one_mul]
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:90
theorem witnessTreatedCellConvolution_lower Lemma witnessTreatedCellConvolution_lower in the paper ↗

The actual minus-cell convolutions stay strictly positive everywhere. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s y :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hσ :
0 < σ
w :
ℝ
Proof (Lean source)
lemma witnessTreatedCellConvolution_lower (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (s y : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hσ : 0 < σ) (w : ℝ) : treatedConvolution σ w/8 ≤ witnessTreatedCellConvolution β b σ m s y w := by have hd := marked_cell_denominator_lower (treatedConvolution σ w) (markedConvolution b m σ w) (kappa * (b/(m : ℝ)^2)^β) (treatedConvolution_pos σ w hσ).le (markedConvolution_abs_le hleg b σ m hb w) (marked_likelihood_amplitude_bound β b m hβ hb hm) rw [witnessTreatedCellConvolution_eq β b σ m s y hb w] cases s <;> cases y <;> simp only [witnessSign, Bool.false_eq_true, if_false, if_true] all_goals nlinarith [hd.1, hd.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:107
theorem witnessTreatedCellConvolution_square_difference_sum Lemma witnessTreatedCellConvolution_square_difference_sum in the paper ↗

Summing the squared differences over both actual treated cells gives precisely the integrand already bounded in ML.2. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
= ((kappa * (b/(m : ℝ)^2)^β)*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-kappa*(b/(m : ℝ)^2)^β*markedConvolution b m σ w/2)
+ ((kappa * (b/(m : ℝ)^2)^β)*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+kappa*(b/(m : ℝ)^2)^β*markedConvolution b m σ w/2)
Proof (Lean source)
lemma witnessTreatedCellConvolution_square_difference_sum (β b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : (∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w) = ((kappa * (b/(m : ℝ)^2)^β)*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-kappa*(b/(m : ℝ)^2)^β*markedConvolution b m σ w/2) + ((kappa * (b/(m : ℝ)^2)^β)*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+kappa*(b/(m : ℝ)^2)^β*markedConvolution b m σ w/2) := by simp only [Fintype.sum_bool, witnessTreatedCellConvolution_eq β b σ m _ _ hb w, witnessSign, Bool.false_eq_true, if_false, if_true] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_square_difference_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:120
theorem witnessTreatedCellConvolution_square_difference_integrable Lemma witnessTreatedCellConvolution_square_difference_integrable in the paper ↗

The sum of the actual treated-cell likelihood contributions is integrable on the whole real proxy line. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hσ :
0 < σ
Integrable (fun w : ℝ => ∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w)
Proof (Lean source)
lemma witnessTreatedCellConvolution_square_difference_integrable (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hσ : 0 < σ) : Integrable (fun w : ℝ => ∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w) := by simp_rw [witnessTreatedCellConvolution_square_difference_sum β b σ m hb] exact marked_two_cell_square_integrable hleg b σ (kappa * (b/(m : ℝ)^2)^β) m hb hσ (marked_likelihood_amplitude_bound β b m hβ hb hm)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_square_difference_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:135
theorem witnessTreatedCellConvolution_integral_bound Lemma witnessTreatedCellConvolution_integral_bound in the paper ↗

ML.2 now applies to the convolutions of the actual witness probabilities, with both outcomes summed and no restriction on the real proxy domain. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hσ :
0 < σ
(∫ w : ℝ, ∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w)
≤ 16*kappa^2*(b/(m : ℝ)^2)^(2*β) * ∫ w : ℝ, markedConvolution b m σ w^2 / treatedConvolution σ w
Proof (Lean source)
lemma witnessTreatedCellConvolution_integral_bound (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hσ : 0 < σ) : (∫ w : ℝ, ∑ y : Bool, (witnessTreatedCellConvolution β b σ m true y w - witnessTreatedCellConvolution β b σ m false y w)^2 / witnessTreatedCellConvolution β b σ m false y w) ≤ 16*kappa^2*(b/(m : ℝ)^2)^(2*β) * ∫ w : ℝ, markedConvolution b m σ w^2 / treatedConvolution σ w := by simp_rw [witnessTreatedCellConvolution_square_difference_sum β b σ m hb] exact marked_likelihood_density_integral_bound hleg β b σ m hβ hb hm hσ
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_integral_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedCells.lean:148
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.MarkedConvolution 36 declarations The first marked-likelihood step bounds the signed perturbation by the positive Gaussian mixture on every real proxy value.

Full-domain integrability of the marked Gaussian likelihood

The first marked-likelihood step bounds the signed perturbation by the positive Gaussian mixture on every real proxy value. Fubini and the normalized Gaussian mass then make the density-square ratio integrable without trimming proxy tails. Centered-moment cancellation and Cauchy--Schwarz bound the convergent moment series by the factorial tail used in the second likelihood inequality.

The paper density is the centered Mathlib Gaussian density at variance σ². Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w :
ℝ
phi σ w = gaussianPDFReal 0 (NNReal.mk (σ^2) (sq_nonneg σ)) w
Proof (Lean source)
lemma phi_eq_gaussianPDFReal (σ w : ℝ) : phi σ w = gaussianPDFReal 0 (NNReal.mk (σ^2) (sq_nonneg σ)) w := by simp [phi, gaussianPDFReal, NNReal.coe_mk, div_eq_mul_inv]
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_eq_gaussianPDFReal · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:21

Given the Gaussian scale, the density is continuous in its real argument, including at zero scale.

Formal statement
σ :
ℝ
Continuous (phi σ)
Proof (Lean source)
@[fun_prop] lemma phi_continuous (σ : ℝ) : Continuous (phi σ) := by unfold phi fun_prop

Every value of the Gaussian density is nonnegative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w :
ℝ
0 ≤ phi σ w
Proof (Lean source)
lemma phi_nonneg (σ w : ℝ) : 0 ≤ phi σ w := by rw [phi_eq_gaussianPDFReal] exact gaussianPDFReal_nonneg _ _ _

Positive noise gives a strictly positive Gaussian density everywhere. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w :
ℝ
hσ :
0 < σ
0 < phi σ w
Proof (Lean source)
lemma phi_pos (σ w : ℝ) (hσ : 0 < σ) : 0 < phi σ w := by rw [phi_eq_gaussianPDFReal] apply gaussianPDFReal_pos intro hz have hs := congrArg toReal hz simp only [NNReal.coe_mk, NNReal.coe_zero] at hs exact (ne_of_gt (sq_pos_of_pos hσ)) hs
theorem phi_translate_integrable Lemma phi_translate_integrable in the paper ↗

Every translated Gaussian density is integrable over the whole proxy line. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ x :
ℝ
Integrable (fun w => phi σ (w-x))
Proof (Lean source)
lemma phi_translate_integrable (σ x : ℝ) : Integrable (fun w => phi σ (w-x)) := by simp_rw [phi_eq_gaussianPDFReal, gaussianPDFReal_sub, zero_add] exact integrable_gaussianPDFReal _ _
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_translate_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:45

A translated positive-scale Gaussian density has total mass one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ x :
ℝ
hσ :
0 < σ
(∫ w, phi σ (w-x)) = 1
Proof (Lean source)
lemma phi_translate_integral (σ x : ℝ) (hσ : 0 < σ) : (∫ w, phi σ (w-x)) = 1 := by simp_rw [phi_eq_gaussianPDFReal, gaussianPDFReal_sub, zero_add] apply integral_gaussianPDFReal_eq_one intro hz have hs := congrArg toReal hz simp only [NNReal.coe_mk, NNReal.coe_zero] at hs exact (ne_of_gt (sq_pos_of_pos hσ)) hs
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_translate_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:50

The treated Gaussian mixture is positive at every real proxy value (ML.1). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w :
ℝ
hσ :
0 < σ
Proof (Lean source)
lemma treatedConvolution_pos (σ w : ℝ) (hσ : 0 < σ) : 0 < treatedConvolution σ w := by apply intervalIntegral.integral_pos (by norm_num) · fun_prop · intro x hx exact (phi_pos σ _ hσ).le · exact ⟨0, by norm_num, phi_pos σ _ hσ⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedConvolution_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:60
theorem treatedConvolution_integrable Lemma treatedConvolution_integrable in the paper ↗

Fubini and Gaussian normalization give full-domain mixture integrability. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hσ :
0 < σ
Proof (Lean source)
lemma treatedConvolution_integrable (σ : ℝ) (hσ : 0 < σ) : Integrable (treatedConvolution σ) := by have hm : AEStronglyMeasurable (fun z : ℝ × ℝ => phi σ (z.2-z.1)) ((volume.restrict (Ioc (0 : ℝ) 1)).prod volume) := by unfold phi fun_prop have hi : Integrable (fun z : ℝ × ℝ => phi σ (z.2-z.1)) ((volume.restrict (Ioc (0 : ℝ) 1)).prod volume) := by apply (integrable_prod_iff hm).mpr constructor · exact ae_of_all _ (fun x => phi_translate_integrable σ x) · simp_rw [Real.norm_eq_abs, abs_of_nonneg (phi_nonneg σ _), phi_translate_integral σ _ hσ] exact integrable_const 1 change Integrable (fun w => ∫ x in (0 : ℝ)..1, phi σ (w-x)) simp_rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1)] exact hi.integral_prod_right
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedConvolution_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:69
theorem markedConvolution_abs_le Lemma markedConvolution_abs_le in the paper ↗

The legal block bound dominates the signed mixture by the treated mixture (ML.1). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
w :
ℝ
Proof (Lean source)
lemma markedConvolution_abs_le (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (w : ℝ) : |markedConvolution b m σ w| ≤ treatedConvolution σ w := by have hc : Continuous (fun x : ℝ => block m (x/b) * phi σ (w-x)) := by unfold block legendreP fun_prop have hp : Continuous (fun x : ℝ => phi σ (w-x)) := by unfold phi fun_prop calc _ ≤ ∫ x in (0 : ℝ)..b, |block m (x/b) * phi σ (w-x)| := intervalIntegral.abs_integral_le_integral_abs hb.1.le _ ≤ ∫ x in (0 : ℝ)..b, phi σ (w-x) := by apply intervalIntegral.integral_mono_on hb.1.le (hc.abs.intervalIntegrable 0 b) (hp.intervalIntegrable 0 b) intro x hx have hx' : x/b ∈ Icc (0 : ℝ) 1 := ⟨div_nonneg hx.1 hb.1.le, (div_le_one hb.1).mpr hx.2⟩ rw [abs_mul, abs_of_nonneg (phi_nonneg σ _)] simpa only [one_mul] using mul_le_mul_of_nonneg_right (block_abs_le_one hleg m (x/b) hx') (phi_nonneg σ _) _ ≤ treatedConvolution σ w := by apply intervalIntegral.integral_mono_interval (by norm_num) hb.1.le hb.2 · exact ae_of_all _ (fun x => phi_nonneg σ _) · exact hp.intervalIntegrable 0 1
CausalSmith.Stat.RdTruesideNoiseFrontier.markedConvolution_abs_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:88
theorem markedConvolution_stronglyMeasurable Lemma markedConvolution_stronglyMeasurable in the paper ↗

Given the arm width, noise scale, and polynomial degree, integrating the marked kernel over the fixed latent arm preserves strong measurability.

Formal statement
b σ :
ℝ
m :
ℕ
Proof (Lean source)
@[fun_prop] lemma markedConvolution_stronglyMeasurable (b σ : ℝ) (m : ℕ) : StronglyMeasurable (markedConvolution b m σ) := by have hm : StronglyMeasurable (fun z : ℝ × ℝ => block m (z.2/b) * phi σ (z.1-z.2)) := by unfold block legendreP fun_prop unfold markedConvolution intervalIntegral exact (hm.integral_prod_right' (ν := volume.restrict (Ioc 0 b))).sub (hm.integral_prod_right' (ν := volume.restrict (Ioc b 0)))
CausalSmith.Stat.RdTruesideNoiseFrontier.markedConvolution_stronglyMeasurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:115
theorem treatedConvolution_stronglyMeasurable Lemma treatedConvolution_stronglyMeasurable in the paper ↗

Given the noise scale, integrating the Gaussian kernel over the treated arm preserves strong measurability.

Formal statement
σ :
ℝ
Proof (Lean source)
@[fun_prop] lemma treatedConvolution_stronglyMeasurable (σ : ℝ) : StronglyMeasurable (treatedConvolution σ) := by have hm : StronglyMeasurable (fun z : ℝ × ℝ => phi σ (z.1-z.2)) := by unfold phi fun_prop unfold treatedConvolution intervalIntegral exact (hm.integral_prod_right' (ν := volume.restrict (Ioc 0 1))).sub (hm.integral_prod_right' (ν := volume.restrict (Ioc 1 0)))
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedConvolution_stronglyMeasurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:125
theorem markedConvolution_square_div_integrable Lemma markedConvolution_square_div_integrable in the paper ↗

The domination |u| ≤ q gives u²/q ≤ q and full-domain integrability (ML.2). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
Integrable (fun w => markedConvolution b m σ w ^ 2 / treatedConvolution σ w)
Proof (Lean source)
lemma markedConvolution_square_div_integrable (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) : Integrable (fun w => markedConvolution b m σ w ^ 2 / treatedConvolution σ w) := by apply (treatedConvolution_integrable σ hσ).mono' · exact ((markedConvolution_stronglyMeasurable b σ m).measurable.pow_const 2).div (treatedConvolution_stronglyMeasurable σ).measurable |>.aestronglyMeasurable · apply ae_of_all intro w have hq := treatedConvolution_pos σ w hσ have hu := markedConvolution_abs_le hleg b σ m hb w rw [Real.norm_eq_abs, abs_of_nonneg (div_nonneg (sq_nonneg _) hq.le)] apply (div_le_iff₀ hq).mpr calc _ = |markedConvolution b m σ w|^2 := (sq_abs _).symm _ ≤ (treatedConvolution σ w)^2 := pow_le_pow_left₀ (abs_nonneg _) hu 2 _ = _ := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.markedConvolution_square_div_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:135
theorem marked_cell_denominator_lower Lemma marked_cell_denominator_lower in the paper ↗

Both Bernoulli cells retain at least one eighth of the unmarked density (ML.1). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
q u a :
ℝ
hq :
0 ≤ q
hu :
|u| ≤ q
ha :
|a| ≤ 1/4
conclusion 1
q/8 ≤ q/4 - a*u/2
conclusion 2
q/8 ≤ q/4 + a*u/2
Proof (Lean source)
lemma marked_cell_denominator_lower (q u a : ℝ) (hq : 0 ≤ q) (hu : |u| ≤ q) (ha : |a| ≤ 1/4) : q/8 ≤ q/4 - a*u/2 ∧ q/8 ≤ q/4 + a*u/2 := by have hp : |a*u| ≤ q/4 := by rw [abs_mul] have hh := mul_le_mul ha hu (abs_nonneg u) (by norm_num : (0 : ℝ) ≤ 1/4) nlinarith only [hh] have hh := abs_le.mp hp constructor <;> linarith [hh.1, hh.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_cell_denominator_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:152
theorem marked_two_cell_square_bound Lemma marked_two_cell_square_bound in the paper ↗

Adding the two outcome cells gives the factor sixteen in ML.2. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
q u a :
ℝ
hq :
0 < q
hu :
|u| ≤ q
ha :
|a| ≤ 1/4
(a*u)^2 / (q/4-a*u/2) + (a*u)^2 / (q/4+a*u/2) ≤ 16*a^2*(u^2/q)
Proof (Lean source)
lemma marked_two_cell_square_bound (q u a : ℝ) (hq : 0 < q) (hu : |u| ≤ q) (ha : |a| ≤ 1/4) : (a*u)^2 / (q/4-a*u/2) + (a*u)^2 / (q/4+a*u/2) ≤ 16*a^2*(u^2/q) := by have hd := marked_cell_denominator_lower q u a hq.le hu ha have hb (d : ℝ) (hd : q/8 ≤ d) : (a*u)^2/d ≤ 8*a^2*(u^2/q) := by calc _ ≤ (a*u)^2/(q/8) := div_le_div_of_nonneg_left (sq_nonneg _) (by positivity) hd _ = _ := by field_simp have h₁ := hb _ hd.1 have h₂ := hb _ hd.2 linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_two_cell_square_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:163
theorem marked_two_cell_square_integrable Lemma marked_two_cell_square_integrable in the paper ↗

The full-domain treated-cell square ratio is integrable, without proxy truncation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ a :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
ha :
|a| ≤ 1/4
Integrable (fun w => (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2))
Proof (Lean source)
lemma marked_two_cell_square_integrable (hleg : ClassicalLegendreFacts) (b σ a : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) (ha : |a| ≤ 1/4) : Integrable (fun w => (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2)) := by apply ((markedConvolution_square_div_integrable hleg b σ m hb hσ).const_mul (16*a^2)).mono' · have hu := (markedConvolution_stronglyMeasurable b σ m).measurable have hq := (treatedConvolution_stronglyMeasurable σ).measurable have hn := (hu.const_mul a).pow_const 2 exact ((hn.div ((hq.div_const 4).sub ((hu.const_mul a).div_const 2))).add (hn.div ((hq.div_const 4).add ((hu.const_mul a).div_const 2)))).aestronglyMeasurable · apply ae_of_all intro w have hq := treatedConvolution_pos σ w hσ have hu := markedConvolution_abs_le hleg b σ m hb w have hd := marked_cell_denominator_lower _ _ a hq.le hu ha have hn : 0 ≤ (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2) := by apply add_nonneg <;> apply div_nonneg (sq_nonneg _) · linarith [hd.1] · linarith [hd.2] rw [Real.norm_eq_abs, abs_of_nonneg hn] exact marked_two_cell_square_bound _ _ a hq hu ha
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_two_cell_square_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:177
theorem marked_two_cell_integral_bound Lemma marked_two_cell_integral_bound in the paper ↗

Integrating both outcome-cell contributions gives the full-domain ML.2 bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ a :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hσ :
0 < σ
ha :
|a| ≤ 1/4
(∫ w, (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2))
≤ 16*a^2 * ∫ w, markedConvolution b m σ w^2 / treatedConvolution σ w
Proof (Lean source)
lemma marked_two_cell_integral_bound (hleg : ClassicalLegendreFacts) (b σ a : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hσ : 0 < σ) (ha : |a| ≤ 1/4) : (∫ w, (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2)) ≤ 16*a^2 * ∫ w, markedConvolution b m σ w^2 / treatedConvolution σ w := by rw [← integral_const_mul] apply integral_mono (marked_two_cell_square_integrable hleg b σ a m hb hσ ha) ((markedConvolution_square_div_integrable hleg b σ m hb hσ).const_mul _) intro w exact marked_two_cell_square_bound _ _ a (treatedConvolution_pos σ w hσ) (markedConvolution_abs_le hleg b σ m hb w) ha
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_two_cell_integral_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:208
theorem marked_likelihood_amplitude_bound Lemma marked_likelihood_amplitude_bound in the paper ↗

The paper's perturbation amplitude satisfies the cell-denominator condition. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
|kappa * (b/(m : ℝ)^2)^β| ≤ 1/4
Proof (Lean source)
lemma marked_likelihood_amplitude_bound (β b : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : |kappa * (b/(m : ℝ)^2)^β| ≤ 1/4 := by have hr := cancellationResolution_mem b m hb hm have hp := Real.rpow_le_one hr.1.le hr.2 hβ.1.le have hp0 := Real.rpow_nonneg hr.1.le β rw [abs_of_nonneg (mul_nonneg (by norm_num [kappa]) hp0)] unfold kappa linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_likelihood_amplitude_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:225
theorem marked_likelihood_density_integral_bound Lemma marked_likelihood_density_integral_bound in the paper ↗

ML.2 for the actual witness amplitude, retaining both binary cells and all proxy values. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hσ :
0 < σ
a :
kappa * (b/(m : ℝ)^2)^β
(∫ w, (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2))
≤ 16*kappa^2*(b/(m : ℝ)^2)^(2*β) * ∫ w, markedConvolution b m σ w^2 / treatedConvolution σ w
Proof (Lean source)
lemma marked_likelihood_density_integral_bound (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hσ : 0 < σ) : let a := kappa * (b/(m : ℝ)^2)^β (∫ w, (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4-a*markedConvolution b m σ w/2) + (a*markedConvolution b m σ w)^2 / (treatedConvolution σ w/4+a*markedConvolution b m σ w/2)) ≤ 16*kappa^2*(b/(m : ℝ)^2)^(2*β) * ∫ w, markedConvolution b m σ w^2 / treatedConvolution σ w := by have hr := cancellationResolution_mem b m hb hm have he : ((b/(m : ℝ)^2)^β)^2 = (b/(m : ℝ)^2)^(2*β) := by rw [← Real.rpow_mul_natCast hr.1.le] congr 1 ring simpa only [mul_pow, he, mul_assoc] using marked_two_cell_integral_bound hleg b σ (kappa * (b/(m : ℝ)^2)^β) m hb hσ (marked_likelihood_amplitude_bound β b m hβ hb hm)
CausalSmith.Stat.RdTruesideNoiseFrontier.marked_likelihood_density_integral_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:236
theorem block_polynomial_moment_zero Lemma block_polynomial_moment_zero in the paper ↗

Every polynomial of the canceled degrees is orthogonal to the legal block. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
hm :
2 ≤ m
p :
hp :
p.natDegree ≤ m-2
(∫ t in (0 : ℝ)..1, p.eval t * block m t) = 0
Proof (Lean source)
lemma block_polynomial_moment_zero (hleg : ClassicalLegendreFacts) (m : ℕ) (hm : 2 ≤ m) (p : Polynomial ℝ) (hp : p.natDegree ≤ m-2) : (∫ t in (0 : ℝ)..1, p.eval t * block m t) = 0 := by simp_rw [Polynomial.eval_eq_sum_range, Finset.sum_mul] rw [intervalIntegral.integral_finsetSum] · apply Finset.sum_eq_zero intro k hk have hk' : k ≤ m-2 := (le_of_lt_succ (Finset.mem_range.mp hk)).trans hp simp_rw [mul_assoc] rw [intervalIntegral.integral_const_mul, block_moment_zero hleg m k hm hk', mul_zero] · intro k hk apply Continuous.intervalIntegrable unfold block legendreP fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.block_polynomial_moment_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:256
theorem scaled_block_moment_zero Lemma scaled_block_moment_zero in the paper ↗

Changing scale preserves the canceled monomial moments on the full support. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m k :
ℕ
hb :
0 < b
hm :
2 ≤ m
hk :
k ≤ m-2
(∫ x in (0 : ℝ)..b, x^k * block m (x/b)) = 0
Proof (Lean source)
lemma scaled_block_moment_zero (hleg : ClassicalLegendreFacts) (b : ℝ) (m k : ℕ) (hb : 0 < b) (hm : 2 ≤ m) (hk : k ≤ m-2) : (∫ x in (0 : ℝ)..b, x^k * block m (x/b)) = 0 := by have hs := intervalIntegral.smul_integral_comp_mul_left (a := (0 : ℝ)) (b := 1) (fun x : ℝ => x^k * block m (x/b)) b simp only [mul_zero, mul_one, smul_eq_mul] at hs rw [← hs] simp_rw [mul_div_cancel_left₀ _ hb.ne', mul_pow, mul_assoc] rw [intervalIntegral.integral_const_mul, block_moment_zero hleg m k hm hk] simp
CausalSmith.Stat.RdTruesideNoiseFrontier.scaled_block_moment_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:272
theorem centered_block_moment_zero Lemma centered_block_moment_zero in the paper ↗

Centering does not change the cancellation order (ML.5). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b c :
ℝ
m j :
ℕ
hb :
0 < b
hm :
2 ≤ m
hj :
j ≤ m-2
(∫ x in (0 : ℝ)..b, block m (x/b) * (x-c)^j) = 0
Proof (Lean source)
lemma centered_block_moment_zero (hleg : ClassicalLegendreFacts) (b c : ℝ) (m j : ℕ) (hb : 0 < b) (hm : 2 ≤ m) (hj : j ≤ m-2) : (∫ x in (0 : ℝ)..b, block m (x/b) * (x-c)^j) = 0 := by let p : Polynomial ℝ := (C b * X - C c)^j have hp : p.natDegree ≤ j := by apply Polynomial.natDegree_pow_le.trans have hd : (C b * X - C c).natDegree ≤ 1 := by apply (Polynomial.natDegree_sub_le _ _).trans simp only [Polynomial.natDegree_C] exact max_le ((Polynomial.natDegree_C_mul_le _ _).trans (by simp)) (by omega) exact (Nat.mul_le_mul_left j hd).trans (by omega) have hs := intervalIntegral.smul_integral_comp_mul_left (a := (0 : ℝ)) (b := 1) (fun x : ℝ => block m (x/b) * (x-c)^j) b simp only [mul_zero, mul_one, smul_eq_mul] at hs rw [← hs] simp_rw [mul_div_cancel_left₀ _ hb.ne'] have he : (fun x : ℝ => block m x * (b*x-c)^j) = fun x => p.eval x * block m x := by funext x simp only [p, Polynomial.eval_pow, Polynomial.eval_sub, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_X] exact mul_comm _ _ rw [he, block_polynomial_moment_zero hleg m hm p (hp.trans hj), mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_block_moment_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:284
theorem scaled_block_square_integral_le Lemma scaled_block_square_integral_le in the paper ↗

Scaling the block's squared-mass bound gives its support-width factor (ML.6). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
(∫ x in (0 : ℝ)..b, (block m (x/b))^2) ≤ b / blockNorm m
Proof (Lean source)
lemma scaled_block_square_integral_le (hleg : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 < b) : (∫ x in (0 : ℝ)..b, (block m (x/b))^2) ≤ b / blockNorm m := by rw [intervalIntegral.integral_comp_div (fun t : ℝ => (block m t)^2) hb.ne'] simp only [zero_div, div_self hb.ne', smul_eq_mul] simpa only [div_eq_mul_inv, one_mul] using mul_le_mul_of_nonneg_left (block_sq_integral_le hleg m) hb.le
CausalSmith.Stat.RdTruesideNoiseFrontier.scaled_block_square_integral_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:308
theorem centered_power_square_integral_le Lemma centered_power_square_integral_le in the paper ↗

Every centered power has the compact-support squared-mass bound used in ML.6. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
j :
ℕ
hb :
0 < b
(∫ x in (0 : ℝ)..b, ((x-b/2)^j)^2) ≤ b * (b/2)^(2*j)
Proof (Lean source)
lemma centered_power_square_integral_le (b : ℝ) (j : ℕ) (hb : 0 < b) : (∫ x in (0 : ℝ)..b, ((x-b/2)^j)^2) ≤ b * (b/2)^(2*j) := by calc _ ≤ ∫ x in (0 : ℝ)..b, (b/2)^(2*j) := by apply intervalIntegral.integral_mono_on hb.le (by apply Continuous.intervalIntegrable; fun_prop) (intervalIntegrable_const) intro x hx have ha : |x-b/2| ≤ b/2 := abs_le.mpr ⟨by linarith [hx.1], by linarith [hx.2]⟩ calc _ = |x-b/2|^(2*j) := by rw [pow_mul, sq_abs, ← pow_mul, Nat.mul_comm j 2, pow_mul] _ ≤ _ := pow_le_pow_left₀ (abs_nonneg _) ha _ _ = _ := by simp [intervalIntegral.integral_const, smul_eq_mul, mul_comm]
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_power_square_integral_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:317
theorem support_integral_mul_sq_le Lemma support_integral_mul_sq_le in the paper ↗

Cauchy--Schwarz on the complete latent support, with continuous integrands. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
hb :
0 < b
f g :
ℝ → ℝ
hf :
hg :
(∫ x in (0 : ℝ)..b, f x * g x)^2
≤ (∫ x in (0 : ℝ)..b, (f x)^2) * (∫ x in (0 : ℝ)..b, (g x)^2)
Proof (Lean source)
lemma support_integral_mul_sq_le (b : ℝ) (hb : 0 < b) (f g : ℝ → ℝ) (hf : Continuous f) (hg : Continuous g) : (∫ x in (0 : ℝ)..b, f x * g x)^2 ≤ (∫ x in (0 : ℝ)..b, (f x)^2) * (∫ x in (0 : ℝ)..b, (g x)^2) := by have hf2 : MemLp f 2 (volume.restrict (Ioc (0 : ℝ) b)) := (memLp_two_iff_integrable_sq (by fun_prop)).mpr (hf.pow 2 |>.intervalIntegrable 0 b).1 have hg2 : MemLp g 2 (volume.restrict (Ioc (0 : ℝ) b)) := (memLp_two_iff_integrable_sq (by fun_prop)).mpr (hg.pow 2 |>.intervalIntegrable 0 b).1 have hh := integral_mul_norm_le_Lp_mul_Lq Real.HolderConjugate.two_two (by simpa using hf2) (by simpa using hg2) simp only [Real.norm_eq_abs, Real.rpow_two, sq_abs] at hh rw [← Real.sqrt_eq_rpow, ← Real.sqrt_eq_rpow] at hh have ha : |∫ x in Ioc (0 : ℝ) b, f x * g x| ≤ sqrt (∫ x in Ioc (0 : ℝ) b, (f x)^2) * sqrt (∫ x in Ioc (0 : ℝ) b, (g x)^2) := by exact (abs_integral_le_integral_abs).trans (by simpa only [abs_mul] using hh) have hs := pow_le_pow_left₀ (abs_nonneg _) ha 2 rw [sq_abs, mul_pow, Real.sq_sqrt (integral_nonneg (fun x => sq_nonneg _)), Real.sq_sqrt (integral_nonneg (fun x => sq_nonneg _))] at hs simpa only [intervalIntegral.integral_of_le hb.le] using hs
CausalSmith.Stat.RdTruesideNoiseFrontier.support_integral_mul_sq_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:331
theorem centered_block_moment_square_le Lemma centered_block_moment_square_le in the paper ↗

The centered moments obey the squared-mass estimate ML.6 at every order. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m j :
ℕ
hb :
0 < b
(∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 ≤ b^2 / blockNorm m * (b/2)^(2*j)
Proof (Lean source)
lemma centered_block_moment_square_le (hleg : ClassicalLegendreFacts) (b : ℝ) (m j : ℕ) (hb : 0 < b) : (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 ≤ b^2 / blockNorm m * (b/2)^(2*j) := by have hc : Continuous (fun x : ℝ => block m (x/b)) := by unfold block legendreP fun_prop have hp : Continuous (fun x : ℝ => (x-b/2)^j) := by fun_prop calc _ ≤ (∫ x in (0 : ℝ)..b, (block m (x/b))^2) * (∫ x in (0 : ℝ)..b, ((x-b/2)^j)^2) := support_integral_mul_sq_le b hb _ _ hc hp _ ≤ (b / blockNorm m) * (b * (b/2)^(2*j)) := by apply mul_le_mul (scaled_block_square_integral_le hleg b m hb) (centered_power_square_integral_le b j hb) (intervalIntegral.integral_nonneg hb.le (fun x hx => sq_nonneg _)) (div_nonneg hb.le (blockNorm_pos m).le) _ = _ := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_block_moment_square_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:353
theorem centered_block_normalized_moment_le Lemma centered_block_normalized_moment_le in the paper ↗

Normalizing ML.6 by the Gaussian variance and factorial gives each likelihood-series term. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m j :
ℕ
hb :
0 < b
hσ :
0 < σ
(∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ))
≤ (b^2 / blockNorm m) * likelihoodLambda b σ^j / (Nat.factorial j : ℝ)
Proof (Lean source)
lemma centered_block_normalized_moment_le (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m j : ℕ) (hb : 0 < b) (hσ : 0 < σ) : (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)) ≤ (b^2 / blockNorm m) * likelihoodLambda b σ^j / (Nat.factorial j : ℝ) := by have he : (b/2)^(2*j) / σ^(2*j) = likelihoodLambda b σ^j := by rw [← div_pow, pow_mul] congr 1 unfold likelihoodLambda field_simp <;> ring calc _ ≤ (b^2 / blockNorm m * (b/2)^(2*j)) / (σ^(2*j) * (Nat.factorial j : ℝ)) := div_le_div_of_nonneg_right (centered_block_moment_square_le hleg b m j hb) (by positivity) _ = _ := by rw [div_mul_eq_div_div, mul_div_assoc, he]
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_block_normalized_moment_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:373
theorem centered_block_moment_series_bound Lemma centered_block_moment_series_bound in the paper ↗

Cancellation and ML.6 make the exact centered-moment series convergent and bound it by the retained factorial tail, before the Gaussian identity ML.5 is inserted. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ :
ℝ
m :
ℕ
hb :
0 < b
hσ :
0 < σ
hm :
2 ≤ m
conclusion 1
Summable (fun j : ℕ => (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)))
conclusion 2
(∑' j : ℕ, (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)))
≤ (b^2 / blockNorm m) * ∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0
Proof (Lean source)
lemma centered_block_moment_series_bound (hleg : ClassicalLegendreFacts) (b σ : ℝ) (m : ℕ) (hb : 0 < b) (hσ : 0 < σ) (hm : 2 ≤ m) : Summable (fun j : ℕ => (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ))) ∧ (∑' j : ℕ, (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ))) ≤ (b^2 / blockNorm m) * ∑' j : ℕ, if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0 := by have hlam : 0 ≤ likelihoodLambda b σ := by unfold likelihoodLambda; positivity have htail : Summable (fun j : ℕ => if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0) := by apply (Real.summable_pow_div_factorial (likelihoodLambda b σ)).of_nonneg_of_le · intro j split_ifs <;> positivity · intro j split_ifs <;> first | exact le_rfl | positivity have hmajor := htail.mul_left (b^2 / blockNorm m) have hterm (j : ℕ) : (∫ x in (0 : ℝ)..b, block m (x/b) * (x-b/2)^j)^2 / (σ^(2*j) * (Nat.factorial j : ℝ)) ≤ (b^2 / blockNorm m) * (if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0) := by split_ifs with hj · simpa only [mul_div_assoc] using centered_block_normalized_moment_le hleg b σ m j hb hσ · rw [centered_block_moment_zero hleg b (b/2) m j hb hm (by omega)] simp have hs := hmajor.of_nonneg_of_le (fun j => by positivity) hterm refine ⟨hs, ?_⟩ calc _ ≤ ∑' j : ℕ, (b^2 / blockNorm m) * (if m-1 ≤ j then likelihoodLambda b σ^j / (Nat.factorial j : ℝ) else 0) := hs.tsum_le_tsum hterm hmajor _ = _ := tsum_mul_left
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_block_moment_series_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:392
theorem interval_exp_lower_of_integral_zero Lemma interval_exp_lower_of_integral_zero in the paper ↗

Averaging the tangent inequality for the exponential gives a lower bound when the exponent has zero interval mean (the elementary Jensen step in ML.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
hb :
0 ≤ b
r :
ℝ → ℝ
hr :
hzero :
(∫ x in (0 : ℝ)..b, r x) = 0
b ≤ ∫ x in (0 : ℝ)..b, exp (r x)
Proof (Lean source)
lemma interval_exp_lower_of_integral_zero (b : ℝ) (hb : 0 ≤ b) (r : ℝ → ℝ) (hr : Continuous r) (hzero : (∫ x in (0 : ℝ)..b, r x) = 0) : b ≤ ∫ x in (0 : ℝ)..b, exp (r x) := by have hmono := intervalIntegral.integral_mono_on hb ((hr.add continuous_const).intervalIntegrable (μ := volume) 0 b) ((show Continuous (fun x => exp (r x)) by fun_prop).intervalIntegrable (μ := volume) 0 b) (fun x _ => Real.add_one_le_exp (r x)) simpa only [Pi.add_apply, intervalIntegral.integral_add (hr.intervalIntegrable 0 b) (continuous_const.intervalIntegrable 0 b), hzero, intervalIntegral.integral_const, sub_zero, smul_eq_mul, mul_one, zero_add] using hmono
CausalSmith.Stat.RdTruesideNoiseFrontier.interval_exp_lower_of_integral_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:430
theorem gaussian_centered_exponent_integral_zero Lemma gaussian_centered_exponent_integral_zero in the paper ↗

The centered quadratic Gaussian log-ratio has zero mean on its support (ML.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ w :
ℝ
(∫ x in (0 : ℝ)..b, (-(w-x)^2 + (w-b/2)^2 + b^2/12) / (2*σ^2)) = 0
Proof (Lean source)
lemma gaussian_centered_exponent_integral_zero (b σ w : ℝ) : (∫ x in (0 : ℝ)..b, (-(w-x)^2 + (w-b/2)^2 + b^2/12) / (2*σ^2)) = 0 := by have he : (fun x : ℝ => (-(w-x)^2 + (w-b/2)^2 + b^2/12) / (2*σ^2)) = (fun x : ℝ => ((2*w)*x - x^2 + (-w*b + b^2/3)) / (2*σ^2)) := by funext x ring rw [he, intervalIntegral.integral_div] rw [intervalIntegral.integral_add, intervalIntegral.integral_sub, intervalIntegral.integral_const_mul, integral_id, integral_pow, intervalIntegral.integral_const] · simp only [sub_zero, zero_pow (by omega : 3 ≠ 0), smul_eq_mul] ring all_goals exact (by fun_prop : Continuous _).intervalIntegrable _ _
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussian_centered_exponent_integral_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:443
theorem phi_centered_exponent_factorization Lemma phi_centered_exponent_factorization in the paper ↗

Factoring at the local midpoint exposes the mean-zero exponent of ML.3. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ w x :
ℝ
phi σ (w-x)
= (exp (-b^2/(24*σ^2)) * phi σ (w-b/2)) * exp ((-(w-x)^2 + (w-b/2)^2 + b^2/12) / (2*σ^2))
Proof (Lean source)
lemma phi_centered_exponent_factorization (b σ w x : ℝ) : phi σ (w-x) = (exp (-b^2/(24*σ^2)) * phi σ (w-b/2)) * exp ((-(w-x)^2 + (w-b/2)^2 + b^2/12) / (2*σ^2)) := by unfold phi rw [show exp (-b^2/(24*σ^2)) * ((sqrt (2*pi*σ^2))⁻¹ * exp (-(w-b/2)^2/(2*σ^2))) * exp ((-(w-x)^2 + (w-b/2)^2 + b^2/12)/(2*σ^2)) = (sqrt (2*pi*σ^2))⁻¹ * (exp (-b^2/(24*σ^2)) * exp (-(w-b/2)^2/(2*σ^2)) * exp ((-(w-x)^2 + (w-b/2)^2 + b^2/12)/(2*σ^2))) by ring] rw [← Real.exp_add, ← Real.exp_add] congr 2 ring
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_centered_exponent_factorization · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:459
theorem local_gaussian_mixture_lower Lemma local_gaussian_mixture_lower in the paper ↗

The local Gaussian mixture is bounded below at every real proxy value (ML.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ w :
ℝ
hb :
0 ≤ b
b * exp (-b^2/(24*σ^2)) * phi σ (w-b/2) ≤ ∫ x in (0 : ℝ)..b, phi σ (w-x)
Proof (Lean source)
lemma local_gaussian_mixture_lower (b σ w : ℝ) (hb : 0 ≤ b) : b * exp (-b^2/(24*σ^2)) * phi σ (w-b/2) ≤ ∫ x in (0 : ℝ)..b, phi σ (w-x) := by rw [show (fun x => phi σ (w-x)) = (fun x => (exp (-b^2/(24*σ^2)) * phi σ (w-b/2)) * exp ((-(w-x)^2 + (w-b/2)^2 + b^2/12)/(2*σ^2))) by funext x; exact phi_centered_exponent_factorization b σ w x] rw [intervalIntegral.integral_const_mul] have hc : 0 ≤ exp (-b^2/(24*σ^2)) * phi σ (w-b/2) := mul_nonneg (Real.exp_pos _).le (phi_nonneg _ _) have hi := interval_exp_lower_of_integral_zero b hb (fun x => (-(w-x)^2 + (w-b/2)^2 + b^2/12)/(2*σ^2)) (by fun_prop) (gaussian_centered_exponent_integral_zero b σ w) simpa only [mul_assoc, mul_comm b, mul_left_comm b] using mul_le_mul_of_nonneg_left hi hc
CausalSmith.Stat.RdTruesideNoiseFrontier.local_gaussian_mixture_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:475
theorem treatedConvolution_centered_lower Lemma treatedConvolution_centered_lower in the paper ↗

Restricting the unit mixture to the local support proves the global denominator bound, including the full real proxy line (ML.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b σ w :
ℝ
hb :
b ∈ Icc (0 : ℝ) 1
b * exp (-b^2/(24*σ^2)) * phi σ (w-b/2) ≤ treatedConvolution σ w
Proof (Lean source)
lemma treatedConvolution_centered_lower (b σ w : ℝ) (hb : b ∈ Icc (0 : ℝ) 1) : b * exp (-b^2/(24*σ^2)) * phi σ (w-b/2) ≤ treatedConvolution σ w := by apply (local_gaussian_mixture_lower b σ w hb.1).trans unfold treatedConvolution exact intervalIntegral.integral_mono_interval le_rfl hb.1 hb.2 (ae_of_all _ (fun x => phi_nonneg σ (w-x))) ((show Continuous (fun x => phi σ (w-x)) by fun_prop).intervalIntegrable 0 1)
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedConvolution_centered_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:492
theorem phi_product_square_completion Lemma phi_product_square_completion in the paper ↗

Completing the square factors the product of two Gaussian translates (ML.4). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w x t c :
ℝ
phi σ (w-x) * phi σ (w-t) = (exp ((x-c)*(t-c)/σ^2) * phi σ (w-(x+t-c))) * phi σ (w-c)
Proof (Lean source)
lemma phi_product_square_completion (σ w x t c : ℝ) : phi σ (w-x) * phi σ (w-t) = (exp ((x-c)*(t-c)/σ^2) * phi σ (w-(x+t-c))) * phi σ (w-c) := by unfold phi calc _ = (sqrt (2*pi*σ^2))⁻¹^2 * exp (-(w-x)^2/(2*σ^2) + -(w-t)^2/(2*σ^2)) := by rw [Real.exp_add] ring _ = (sqrt (2*pi*σ^2))⁻¹^2 * exp (((x-c)*(t-c)/σ^2 + -(w-(x+t-c))^2/(2*σ^2)) + -(w-c)^2/(2*σ^2)) := by congr 2 ring _ = _ := by rw [Real.exp_add, Real.exp_add] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_product_square_completion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:502
theorem phi_product_div_centered Lemma phi_product_div_centered in the paper ↗

The positive reference density cancels in the square-completion identity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ w x t c :
ℝ
hσ :
0 < σ
phi σ (w-x) * phi σ (w-t) / phi σ (w-c) = exp ((x-c)*(t-c)/σ^2) * phi σ (w-(x+t-c))
Proof (Lean source)
lemma phi_product_div_centered (σ w x t c : ℝ) (hσ : 0 < σ) : phi σ (w-x) * phi σ (w-t) / phi σ (w-c) = exp ((x-c)*(t-c)/σ^2) * phi σ (w-(x+t-c)) := by rw [phi_product_square_completion] exact mul_div_cancel_right₀ _ (ne_of_gt (phi_pos σ (w-c) hσ))
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_product_div_centered · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:521
theorem phi_product_div_integrable Lemma phi_product_div_integrable in the paper ↗

The square-completed ratio is integrable on the entire proxy line (ML.4). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ x t c :
ℝ
hσ :
0 < σ
Integrable (fun w => phi σ (w-x) * phi σ (w-t) / phi σ (w-c))
Proof (Lean source)
lemma phi_product_div_integrable (σ x t c : ℝ) (hσ : 0 < σ) : Integrable (fun w => phi σ (w-x) * phi σ (w-t) / phi σ (w-c)) := by simp_rw [phi_product_div_centered σ _ x t c hσ] exact (phi_translate_integrable σ (x+t-c)).const_mul _
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_product_div_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:528
theorem phi_product_div_integral Lemma phi_product_div_integral in the paper ↗

Integrating the square completion gives the exact Gaussian cross-kernel (ML.4). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ x t c :
ℝ
hσ :
0 < σ
(∫ w, phi σ (w-x) * phi σ (w-t) / phi σ (w-c)) = exp ((x-c)*(t-c)/σ^2)
Proof (Lean source)
lemma phi_product_div_integral (σ x t c : ℝ) (hσ : 0 < σ) : (∫ w, phi σ (w-x) * phi σ (w-t) / phi σ (w-c)) = exp ((x-c)*(t-c)/σ^2) := by simp_rw [phi_product_div_centered σ _ x t c hσ] rw [integral_const_mul, phi_translate_integral σ (x+t-c) hσ, mul_one]
CausalSmith.Stat.RdTruesideNoiseFrontier.phi_product_div_integral · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedConvolution.lean:534
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.MarkedDomination 8 declarations Interior Bernoulli probabilities bound the latent likelihood ratio.

Domination of the full marked witness laws

Interior Bernoulli probabilities bound the latent likelihood ratio. Measure products and the observation map preserve this domination, providing absolute continuity and square integrability on the entire observed space (ML.1–ML.2).

Given the noise scale, the true-side assignment and Gaussian proxy form a measurable observation map.

Formal statement
σ :
ℝ
Proof (Lean source)
@[fun_prop] lemma obs_measurable (σ : ℝ) : Measurable (obs σ) := by unfold obs proxy outcome side score errorCoord have hs : MeasurableSet {ω : Latent | 0 ≤ ω.1} := measurableSet_le measurable_const measurable_fst have hd : Measurable (fun ω : Latent => decide (0 ≤ ω.1)) := by have he : (fun ω : Latent => decide (0 ≤ ω.1)) = fun ω => if 0 ≤ ω.1 then true else false := by funext ω by_cases h : 0 ≤ ω.1 <;> simp [h] rw [he] exact measurable_const.ite hs measurable_const exact (measurable_fst.add (measurable_const.mul measurable_snd.snd.snd)).prodMk (hd.prodMk (measurable_snd.snd.fst.ite (by simpa using hs) measurable_snd.fst))

Interior success and failure weights dominate each other by a factor three. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p q :
ℝ
hp :
p ∈ Icc (1/4 : ℝ) (3/4)
hq :
q ∈ Icc (1/4 : ℝ) (3/4)
≤ (3 : ℝ≥0∞) • bernoulliBool q
Proof (Lean source)
lemma bernoulliBool_le_three (p q : ℝ) (hp : p ∈ Icc (1/4 : ℝ) (3/4)) (hq : q ∈ Icc (1/4 : ℝ) (3/4)) : bernoulliBool p ≤ (3 : ℝ≥0∞) • bernoulliBool q := by have ht : ofReal p ≤ 3 * ofReal q := by rw [show (3 : ℝ≥0∞) = ofReal (3 : ℝ) by norm_num, ← ENNReal.ofReal_mul (by norm_num)] apply ENNReal.ofReal_le_ofReal linarith [hp.2, hq.1] have hf : ofReal (1-p) ≤ 3 * ofReal (1-q) := by rw [show (3 : ℝ≥0∞) = ofReal (3 : ℝ) by norm_num, ← ENNReal.ofReal_mul (by norm_num)] apply ENNReal.ofReal_le_ofReal linarith [hp.1, hq.2] unfold bernoulliBool rw [smul_add, smul_smul, smul_smul] apply Measure.le_iff'.mpr intro s simp only [Measure.add_apply, Measure.smul_apply, smul_eq_mul] exact add_le_add (mul_le_mul_left ht _) (mul_le_mul_left hf _)
CausalSmith.Stat.RdTruesideNoiseFrontier.bernoulliBool_le_three · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:35
theorem compProd_le_three_of_fibres Lemma compProd_le_three_of_fibres in the paper ↗

Fibrewise bounded domination survives a composition product. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α γ :
μ :
h :
∀ x, κ x ≤ (3 : ℝ≥0∞) • η x
μ ⊗ₘ κ ≤ (3 : ℝ≥0∞) • (μ ⊗ₘ η)
Proof (Lean source)
lemma compProd_le_three_of_fibres {α γ : Type*} [MeasurableSpace α] [MeasurableSpace γ] (μ : Measure α) [SFinite μ] (κ η : Kernel α γ) [IsSFiniteKernel κ] [IsSFiniteKernel η] (h : ∀ x, κ x ≤ (3 : ℝ≥0∞) • η x) : μ ⊗ₘ κ ≤ (3 : ℝ≥0∞) • (μ ⊗ₘ η) := by apply Measure.le_iff.mpr intro s hs rw [Measure.compProd_apply hs, Measure.smul_apply, Measure.compProd_apply hs, smul_eq_mul, ← lintegral_const_mul' _ _ (by norm_num)] apply lintegral_mono intro x simpa only [Measure.smul_apply, smul_eq_mul] using h x (Prod.mk x ⁻¹' s)
CausalSmith.Stat.RdTruesideNoiseFrontier.compProd_le_three_of_fibres · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:57
theorem witnessMeasure_le_three Lemma witnessMeasure_le_three in the paper ↗

The full latent witness, including both potentials and the Gaussian, is dominated. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p q :
ℝ → ℝ
hp :
hq :
hpb :
∀ x, p x ∈ Icc (1/4 : ℝ) (3/4)
hqb :
∀ x, q x ∈ Icc (1/4 : ℝ) (3/4)
witnessMeasure p ≤ (3 : ℝ≥0∞) • witnessMeasure q
Proof (Lean source)
lemma witnessMeasure_le_three (p q : ℝ → ℝ) (hp : Measurable p) (hq : Measurable q) (hpb : ∀ x, p x ∈ Icc (1/4 : ℝ) (3/4)) (hqb : ∀ x, q x ∈ Icc (1/4 : ℝ) (3/4)) : witnessMeasure p ≤ (3 : ℝ≥0∞) • witnessMeasure q := by have h := compProd_le_three_of_fibres (uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) (bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)) (bernoulliMarkKernel (fun z : ℝ × Bool => q z.1)) (by intro z rw [bernoulliMarkKernel_apply (fun z : ℝ × Bool => p z.1) (by fun_prop), bernoulliMarkKernel_apply (fun z : ℝ × Bool => q z.1) (by fun_prop)] exact bernoulliBool_le_three _ _ (hpb z.1) (hqb z.1)) have hprod := Measure.prod_mono h (le_refl (gaussianReal 0 1)) rw [Measure.prod_smul_left] at hprod have hmap := Measure.map_mono hprod (show Measurable (fun z : ((ℝ × Bool) × Bool) × ℝ => (z.1.1.1, z.1.1.2, z.1.2, z.2)) from by fun_prop) simpa only [witnessMeasure, Measure.map_smul] using hmap
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_le_three · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:71
theorem altLaw_observed_le_three Lemma altLaw_observed_le_three in the paper ↗

Both alternative observation laws obey bounded domination at every noise scale. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s t :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
Pobs (altLaw hleg β b m s hβ hb hm) σ ≤ (3 : ℝ≥0∞) • Pobs (altLaw hleg β b m t hβ hb hm) σ
Proof (Lean source)
lemma altLaw_observed_le_three (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (s t : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : Pobs (altLaw hleg β b m s hβ hb hm) σ ≤ (3 : ℝ≥0∞) • Pobs (altLaw hleg β b m t hβ hb hm) σ := by have h := witnessMeasure_le_three (altProbability β b m s) (altProbability β b m t) (altProbability_continuous β b m s hb.1).measurable (altProbability_continuous β b m t hb.1).measurable (altProbability_mean_bounds hleg β b m s hβ hb hm) (altProbability_mean_bounds hleg β b m t hβ hb hm) have hmap := Measure.map_mono h (obs_measurable σ) simpa only [Pobs, altLaw, bernoulliWitness, Measure.map_smul] using hmap
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_le_three · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:91
theorem altLaw_observed_absolutelyContinuous Lemma altLaw_observed_absolutelyContinuous in the paper ↗

Domination gives absolute continuity for the entire observed triple. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s t :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
Pobs (altLaw hleg β b m s hβ hb hm) σ ≪ Pobs (altLaw hleg β b m t hβ hb hm) σ
Proof (Lean source)
lemma altLaw_observed_absolutelyContinuous (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (s t : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : Pobs (altLaw hleg β b m s hβ hb hm) σ ≪ Pobs (altLaw hleg β b m t hβ hb hm) σ := by exact Measure.absolutelyContinuous_of_le_smul (altLaw_observed_le_three hleg β b σ m s t hβ hb hm)
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_absolutelyContinuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:104
theorem rnDeriv_square_integrable_of_le_three Lemma rnDeriv_square_integrable_of_le_three in the paper ↗

A uniformly dominated finite law has an integrable centered likelihood square. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
h :
μ ≤ (3 : ℝ≥0∞) • ν
Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν
Proof (Lean source)
lemma rnDeriv_square_integrable_of_le_three {α : Type*} [MeasurableSpace α] (μ ν : Measure α) [IsFiniteMeasure μ] [IsFiniteMeasure ν] (h : μ ≤ (3 : ℝ≥0∞) • ν) : Integrable (fun x => ((μ.rnDeriv ν x).toReal - 1)^2) ν := by letI : IsFiniteMeasure ((3 : ℝ≥0∞) • ν) := Measure.smul_finite ν (by norm_num) have hle : ∀ᵐ x ∂ν, μ.rnDeriv ((3 : ℝ≥0∞) • ν) x ≤ 1 := (Measure.absolutelyContinuous_smul (μ := ν) (c := (3 : ℝ≥0∞)) (by norm_num)).ae_le (Measure.rnDeriv_le_one_of_le h) have hr := Measure.rnDeriv_smul_right_of_ne_top μ ν (r := (3 : ℝ≥0∞)) (by norm_num) (by norm_num) have hbound : ∀ᵐ x ∂ν, (μ.rnDeriv ν x).toReal ≤ 3 := by filter_upwards [hle, hr] with x hx he rw [he] at hx have ht := ENNReal.toReal_mono (by norm_num : (1 : ℝ≥0∞) ≠ ⊤) hx simp only [Pi.smul_apply, smul_eq_mul, ENNReal.toReal_mul, ENNReal.toReal_inv, ENNReal.toReal_ofNat, ENNReal.toReal_one] at ht linarith apply Integrable.of_bound ((((μ.measurable_rnDeriv ν).ennreal_toReal.sub measurable_const).pow_const 2).aestronglyMeasurable) 4 filter_upwards [hbound] with x hx rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hn := ENNReal.toReal_nonneg (a := μ.rnDeriv ν x) change ((μ.rnDeriv ν x).toReal - 1)^2 ≤ 4 nlinarith [mul_nonneg hn (sub_nonneg.mpr hx)]
CausalSmith.Stat.RdTruesideNoiseFrontier.rnDeriv_square_integrable_of_le_three · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:112
theorem altLaw_observed_likelihood_square_integrable Lemma altLaw_observed_likelihood_square_integrable in the paper ↗

The full observed alternative likelihood square is integrable on all cells. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s t :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
plus :
Pobs (altLaw hleg β b m s hβ hb hm) σ
minus :
Pobs (altLaw hleg β b m t hβ hb hm) σ
Integrable (fun o => ((plus.rnDeriv minus o).toReal - 1)^2) minus
Proof (Lean source)
lemma altLaw_observed_likelihood_square_integrable (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (s t : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : let plus := Pobs (altLaw hleg β b m s hβ hb hm) σ let minus := Pobs (altLaw hleg β b m t hβ hb hm) σ Integrable (fun o => ((plus.rnDeriv minus o).toReal - 1)^2) minus := by letI := (altLaw hleg β b m s hβ hb hm).prob letI := (altLaw hleg β b m t hβ hb hm).prob haveI : IsProbabilityMeasure (Pobs (altLaw hleg β b m s hβ hb hm) σ) := Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable haveI : IsProbabilityMeasure (Pobs (altLaw hleg β b m t hβ hb hm) σ) := Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable exact rnDeriv_square_integrable_of_le_three _ _ (altLaw_observed_le_three hleg β b σ m s t hβ hb hm)
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_likelihood_square_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MarkedDomination.lean:140
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.MatchedFrontierLower 8 declarations This file rounds the scalar noisy resolution to the explicit cancellation witness grid and transfers its information bound to the product experiment.

Noise-adapted lower tuning for the matched frontier

This file rounds the scalar noisy resolution to the explicit cancellation witness grid and transfers its information bound to the product experiment.

theorem noiseSupport_mono

The noise-adapted support is monotone in the integer degree. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hσ :
0 ≤ σ
j m :
ℕ
hjm :
j ≤ m
Proof (Lean source)
lemma noiseSupport_mono {σ : ℝ} (hσ : 0 ≤ σ) {j m : ℕ} (hjm : j ≤ m) : noiseSupport σ j ≤ noiseSupport σ m := by unfold noiseSupport apply min_le_min_left gcongr
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport_mono · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:24
theorem noiseResolution_prev_le_four

Consecutive noise resolutions lose at most a factor four. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
m :
ℕ
hσ :
0 ≤ σ
hm :
2 ≤ m
noiseResolution σ (m - 1) ≤ 4 * noiseResolution σ m
Proof (Lean source)
lemma noiseResolution_prev_le_four (σ : ℝ) (m : ℕ) (hσ : 0 ≤ σ) (hm : 2 ≤ m) : noiseResolution σ (m - 1) ≤ 4 * noiseResolution σ m := by have hmpos : (0 : ℝ) < m := by positivity have hp : (m - 1 : ℕ) ≤ m := sub_le _ _ have hs := noiseSupport_mono hσ hp have hm1 : (0 : ℝ) < (m - 1 : ℕ) := by exact_mod_cast (show 0 < m - 1 by omega) unfold noiseResolution rw [show 4 * (noiseSupport σ m / (m : ℝ)^2) = (4 * noiseSupport σ m) / (m : ℝ)^2 by ring] apply (div_le_div_iff₀ (sq_pos_of_pos hm1) (sq_pos_of_pos hmpos)).2 have hsq : (m : ℝ)^2 ≤ 4 * ((m - 1 : ℕ) : ℝ)^2 := by have hmcast : (2 : ℝ) ≤ m := by exact_mod_cast hm rw [Nat.cast_sub (by omega : 1 ≤ m)] norm_num nlinarith calc noiseSupport σ (m - 1) * (m : ℝ)^2 ≤ noiseSupport σ (m - 1) * (4 * ((m - 1 : ℕ) : ℝ)^2) := mul_le_mul_of_nonneg_left hsq (by unfold noiseSupport; positivity) _ ≤ 4 * noiseSupport σ m * ((m - 1 : ℕ) : ℝ)^2 := by calc _ = (4 * noiseSupport σ (m - 1)) * ((m - 1 : ℕ) : ℝ)^2 := by ring _ ≤ (4 * noiseSupport σ m) * ((m - 1 : ℕ) : ℝ)^2 := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hs (by norm_num)) (sq_nonneg _)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseResolution_prev_le_four · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:31
theorem exists_noiseResolution_le

Every positive target scale is eventually crossed by the explicit noise-resolution grid. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ t :
ℝ
ht :
0 < t
∃ m : ℕ,
conclusion 1
2 ≤ m
conclusion 2
noiseResolution σ m ≤ t
Proof (Lean source)
lemma exists_noiseResolution_le (σ t : ℝ) (ht : 0 < t) : ∃ m : ℕ, 2 ≤ m ∧ noiseResolution σ m ≤ t := by obtain ⟨m, hm⟩ := exists_nat_gt (sqrt (1 / t) + 2) have hm2 : 2 ≤ m := by have : (2 : ℝ) < m := lt_of_le_of_lt (by linarith [Real.sqrt_nonneg (1 / t)]) hm exact_mod_cast this.le have hmpos : (0 : ℝ) < m := by positivity have hmt : 1 / t < (m : ℝ)^2 := by have hs : sqrt (1 / t) < (m : ℝ) := by linarith have harg : 0 ≤ 1 / t := by positivity nlinarith [Real.sq_sqrt harg, mul_self_lt_mul_self (Real.sqrt_nonneg (1 / t)) hs] refine ⟨m, hm2, ?_⟩ unfold noiseResolution noiseSupport have hsupport : min 1 (σ * sqrt m / 8) ≤ 1 := min_le_left _ _ calc min 1 (σ * sqrt m / 8) / (m : ℝ)^2 ≤ 1 / (m : ℝ)^2 := div_le_div_of_nonneg_right hsupport (sq_nonneg _) _ ≤ t := by rw [div_le_iff₀ (sq_pos_of_pos hmpos)] have := (div_lt_iff₀ ht).mp hmt nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.exists_noiseResolution_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:58
theorem exists_noiseResolution_bracket

Minimal grid crossing at H/4096; it lies within a factor four of the requested scale once the scalar root is strictly below the noise level. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ H :
ℝ
hσ :
σ ∈ Ioc (0 : ℝ) 1
hH :
0 < H
hHσ :
H < σ
∃ m : ℕ,
conclusion 1
3 ≤ m
conclusion 2
H / 16384 < noiseResolution σ m
conclusion 3
noiseResolution σ m ≤ H / 4096
Proof (Lean source)
lemma exists_noiseResolution_bracket (σ H : ℝ) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hH : 0 < H) (hHσ : H < σ) : ∃ m : ℕ, 3 ≤ m ∧ H / 16384 < noiseResolution σ m ∧ noiseResolution σ m ≤ H / 4096 := by let p : ℕ → Prop := fun m => 2 ≤ m ∧ noiseResolution σ m ≤ H / 4096 have hex : ∃ m, p m := exists_noiseResolution_le σ (H / 4096) (by positivity) let m := Nat.find hex have hmprop : p m := Nat.find_spec hex have htwo : H / 4096 < noiseResolution σ 2 := by have hsqrt : (1 : ℝ) ≤ sqrt 2 := (Real.le_sqrt (by norm_num) (by norm_num)).2 (by norm_num) have hunsat : σ * sqrt 2 / 8 < 1 := by have hsqrt2 : sqrt 2 < 2 := by nlinarith [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2)] nlinarith [hσ.2] change H / 4096 < min 1 (σ * sqrt (2 : ℝ) / 8) / (2 : ℝ)^2 rw [min_eq_right hunsat.le] norm_num nlinarith have hm3 : 3 ≤ m := by by_contra h have hmle : m ≤ 2 := by omega have hm2 := hmprop.1 have : m = 2 := by omega rw [this] at hmprop linarith [hmprop.2, htwo] have hprev : H / 4096 < noiseResolution σ (m - 1) := by by_contra h have hp : p (m - 1) := ⟨by omega, le_of_not_gt h⟩ have hmin := Nat.find_min' hex hp omega have hratio := noiseResolution_prev_le_four σ m hσ.1.le (by omega) refine ⟨m, hm3, ?_, hmprop.2⟩ nlinarith
CausalSmith.Stat.RdTruesideNoiseFrontier.exists_noiseResolution_bracket · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:83
theorem rounded_noise_information_factor

At the rounded cancellation scale, the likelihood exponential absorbs the exact scalar root balance with a fixed numerical margin. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ H h :
ℝ
n :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Ioc (0 : ℝ) 1
hroot :
H = rateResolution β n σ
hh :
0 < h
hhH :
h ≤ H / 4096
hHσ :
H < σ
(n : ℝ) * h ^ (2 * β + 1) * exp (-(1 + noiseCost h σ) / 32) ≤ exp (-2)
Proof (Lean source)
lemma rounded_noise_information_factor (β σ H h : ℝ) (n : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Ioc (0 : ℝ) 1) (hroot : H = rateResolution β n σ) (hh : 0 < h) (hhH : h ≤ H / 4096) (hHσ : H < σ) : (n : ℝ) * h ^ (2 * β + 1) * exp (-(1 + noiseCost h σ) / 32) ≤ exp (-2) := by have hσclosed : σ ∈ Icc (0 : ℝ) 1 := ⟨hσ.1.le, hσ.2⟩ have hr := unique_rate_root β n σ hβ hn hσclosed have hd := directResolution_pos_le_one β n hβ hn have hHpos : 0 < H := by rw [hroot]; exact hd.1.trans_le hr.1.1 have hHle : H ≤ 1 := by rw [hroot]; exact hr.1.2 have hhH' : h ≤ H := hhH.trans (by nlinarith [hHpos]) have hcostH : 0 ≤ noiseCost H σ := noiseCost_nonneg H σ ⟨hHpos, hHle⟩ hσclosed have hratio := (noise_cost_scaling.2.1 h H σ hh hhH' hHσ.le hσ.2).1 have hquotient : (4096 : ℝ) ≤ H / h := by apply (le_div_iff₀ hh).2 nlinarith have hsqrt : (64 : ℝ) ≤ (H / h) ^ (1 / 2 : ℝ) := by have hp := Real.rpow_le_rpow (by norm_num : (0 : ℝ) ≤ 4096) hquotient (by norm_num : (0 : ℝ) ≤ 1 / 2) norm_num at hp ⊢ exact hp have hcostratio : 64 * (1 + noiseCost H σ) ≤ 1 + noiseCost h σ := by have hden : 0 < 1 + noiseCost H σ := by linarith have hq : (64 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost H σ) := hsqrt.trans hratio exact (le_div_iff₀ hden).mp hq have hexp : exp (-(1 + noiseCost h σ) / 32) ≤ exp (-2 * (1 + noiseCost H σ)) := by apply Real.exp_le_exp.mpr nlinarith have hν : 0 < 2 * β + 1 := by linarith [hβ.1] have hpowers : h ^ (2 * β + 1) ≤ H ^ (2 * β + 1) := Real.rpow_le_rpow hh.le hhH' hν.le have hnnonneg : (0 : ℝ) ≤ n := by positivity have hbalance := rateRoot_exp_balance β n σ hβ hn hσclosed rw [← hroot] at hbalance calc (n : ℝ) * h ^ (2 * β + 1) * exp (-(1 + noiseCost h σ) / 32) ≤ (n : ℝ) * H ^ (2 * β + 1) * exp (-(1 + noiseCost h σ) / 32) := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpowers hnnonneg) (Real.exp_pos _).le _ ≤ (n : ℝ) * H ^ (2 * β + 1) * exp (-2 * (1 + noiseCost H σ)) := mul_le_mul_of_nonneg_left hexp (by positivity) _ = exp (-2 - noiseCost H σ) := by rw [← hbalance, ← Real.exp_add] congr 1 ring _ ≤ exp (-2) := Real.exp_le_exp.mpr (by linarith)
CausalSmith.Stat.RdTruesideNoiseFrontier.rounded_noise_information_factor · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:118
theorem sampleLaw_tv_le_one_fifth_of_chiSqExt

A small one-observation extended chi-square bound gives the testing constant required by two_point_transfer after n IID observations. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P Q :
σ δ :
ℝ
n :
ℕ
hδ :
0 ≤ δ
hnδ :
(n : ℝ) * δ ≤ 1 / 100
hchi :
chiSqExt (Pobs P σ) (Pobs Q σ) ≤ ofReal δ
tvDist (sampleLaw P σ n) (sampleLaw Q σ n) ≤ (1 / 5 : ℝ)
Proof (Lean source)
lemma sampleLaw_tv_le_one_fifth_of_chiSqExt (P Q : LatentLaw) (σ δ : ℝ) (n : ℕ) (hδ : 0 ≤ δ) (hnδ : (n : ℝ) * δ ≤ 1 / 100) (hchi : chiSqExt (Pobs P σ) (Pobs Q σ) ≤ ofReal δ) : tvDist (sampleLaw P σ n) (sampleLaw Q σ n) ≤ (1 / 5 : ℝ) := by let μ := Pobs P σ let ν := Pobs Q σ letI : IsProbabilityMeasure μ := empirical_Pobs_probability P σ letI : IsProbabilityMeasure ν := empirical_Pobs_probability Q σ have hfinite : chiSqExt μ ν ≠ ⊤ := ne_of_lt (hchi.trans_lt ENNReal.ofReal_lt_top) obtain ⟨hac, hint⟩ := (chiSqExt_ne_top_iff μ ν).mp hfinite have heq := chiSqExt_eq_ofReal_chiSqDiv μ ν hac hint have hchiReal : chiSqDiv μ ν ≤ δ := by rw [heq] at hchi exact (ENNReal.ofReal_le_ofReal_iff hδ).mp hchi have hχnonneg : 0 ≤ chiSqDiv μ ν := Causalean.Stat.chiSqDiv_nonneg have hnχ : (n : ℝ) * chiSqDiv μ ν ≤ 1 / 100 := (mul_le_mul_of_nonneg_left hchiReal (by positivity)).trans hnδ change tvDist (sampleLaw P σ n) (sampleLaw Q σ n) ≤ (1 / 5 : ℝ) change tvDist (Measure.pi (fun _ : Fin n => μ)) (Measure.pi (fun _ : Fin n => ν)) ≤ (1 / 5 : ℝ) exact iid_tv_le_one_fifth_of_chiSqDiv μ ν hac hint n hnχ
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleLaw_tv_le_one_fifth_of_chiSqExt · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:172
theorem noisy_frontier_lower

In the genuinely noisy regime, cancellation alternatives attain a fixed multiple of the scalar frontier for both minimax criteria. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
c :
(4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β
0 < c
n :
ℕ
2 ≤ n
σ ∈ Ioc (0 : ℝ) 1 :
rateResolution β n σ < σ
c * frontierRate β n σ ≤ risk β n σ
c * frontierRate β n σ ≤ lengthRisk β n σ
Proof (Lean source)
lemma noisy_frontier_lower (legendre_of_gate : ClassicalLegendreFacts) (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : let c := (4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β 0 < c ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Ioc (0 : ℝ) 1, rateResolution β n σ < σ → c * frontierRate β n σ ≤ risk β n σ ∧ c * frontierRate β n σ ≤ lengthRisk β n σ := by dsimp only have hc : 0 < (4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β := by norm_num [kappa] positivity refine ⟨hc, ?_⟩ intro n hn σ hσ hHσ let H := rateResolution β n σ obtain ⟨m, hm3, hh_lower, hh_upper⟩ := exists_noiseResolution_bracket σ H hσ ((directResolution_pos_le_one β n hβ hn).1.trans_le (unique_rate_root β n σ hβ hn ⟨hσ.1.le, hσ.2⟩).1.1) hHσ let h := noiseResolution σ m let b := noiseSupport σ m have hm : 2 ≤ m := by omega have hb := noiseSupport_mem σ m hσ hm have hhpos : 0 < h := by have hmreal : (0 : ℝ) < m := by exact_mod_cast (show 0 < m by omega) have hsqrt : 0 < sqrt (m : ℝ) := Real.sqrt_pos.2 hmreal have hsupp : 0 < noiseSupport σ m := by unfold noiseSupport exact lt_min (by norm_num) (div_pos (mul_pos hσ.1 hsqrt) (by norm_num)) dsimp [h, noiseResolution] exact div_pos hsupp (sq_pos_of_pos hmreal) let δ : ℝ := (32 / 3 : ℝ) * kappa^2 * h^(2*β+1) * exp (-(1 + noiseCost h σ)/32) have hδ : 0 ≤ δ := by dsimp [δ]; positivity have hnfactor := rounded_noise_information_factor β σ H h n hβ hn hσ rfl hhpos hh_upper hHσ have hnδ : (n : ℝ) * δ ≤ 1 / 100 := by have hexple : exp (-2 : ℝ) ≤ 1 := by exact Real.exp_le_one_iff.mpr (by norm_num) dsimp [δ] have hcoef : (0 : ℝ) ≤ (32 / 3 : ℝ) * kappa^2 := by positivity calc (n : ℝ) * ((32 / 3 : ℝ) * kappa ^ 2 * h ^ (2 * β + 1) * exp (-(1 + noiseCost h σ) / 32)) = ((32 / 3 : ℝ) * kappa^2) * ((n : ℝ) * h^(2*β+1) * exp (-(1 + noiseCost h σ)/32)) := by ring _ ≤ ((32 / 3 : ℝ) * kappa^2) * exp (-2) := mul_le_mul_of_nonneg_left hnfactor hcoef _ ≤ ((32 / 3 : ℝ) * kappa^2) * 1 := mul_le_mul_of_nonneg_left hexple hcoef _ ≤ 1 / 100 := by norm_num [kappa] let P := altLaw legendre_of_gate β b m true hβ hb hm let Q := altLaw legendre_of_gate β b m false hβ hb hm have hchi : chiSqExt (Pobs P σ) (Pobs Q σ) ≤ ofReal δ := by exact cancellation_information_envelope β σ m hβ hσ hm have htv := sampleLaw_tv_le_one_fifth_of_chiSqExt P Q σ δ n hδ hnδ hchi have hlower := two_point_transfer β b σ n m hβ hb hm hn ⟨hσ.1.le, hσ.2⟩ htv change (4/5 : ℝ) * kappa * h^β ≤ risk β n σ ∧ (6/5 : ℝ) * kappa * h^β ≤ lengthRisk β n σ at hlower have hHpos : 0 < H := (directResolution_pos_le_one β n hβ hn).1.trans_le (unique_rate_root β n σ hβ hn ⟨hσ.1.le, hσ.2⟩).1.1 have hscale : (H / 16384)^β = (1 / 16384 : ℝ)^β * H^β := by rw [div_eq_mul_inv, Real.mul_rpow hHpos.le (by positivity : (0 : ℝ) ≤ (16384 : ℝ)⁻¹)] ring_nf have hhpow : (H / 16384)^β ≤ h^β := Real.rpow_le_rpow (by positivity) hh_lower.le hβ.1.le have hcommon : ((4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β) * H^β ≤ (4 / 5 : ℝ) * kappa * h^β := by rw [show ((4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β) * H^β = (4 / 5 : ℝ) * kappa * ((H / 16384)^β) by rw [hscale]; ring] exact mul_le_mul_of_nonneg_left hhpow (by norm_num [kappa]) change _ * H^β ≤ risk β n σ ∧ _ * H^β ≤ lengthRisk β n σ exact ⟨hcommon.trans hlower.1, hcommon.trans (hlower.2.trans' (by have hhnonneg : 0 ≤ kappa * h^β := by exact mul_nonneg (by norm_num [kappa]) (Real.rpow_nonneg hhpos.le _) nlinarith))⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.noisy_frontier_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:198
theorem frontierRate_lower_bounds

Combining the ordinary direct witness below the direct resolution with the cancellation witness above it gives a uniform scalar-frontier converse. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
hermite_of_gate :
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ c : ℝ,
0 < c
conclusion 1
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
c * frontierRate β n σ ≤ risk β n σ
c * frontierRate β n σ ≤ lengthRisk β n σ
Proof (Lean source)
theorem frontierRate_lower_bounds (legendre_of_gate : ClassicalLegendreFacts) (hermite_of_gate : ClassicalHermiteFacts) (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, c * frontierRate β n σ ≤ risk β n σ ∧ c * frontierRate β n σ ≤ lengthRisk β n σ := by obtain ⟨cd, Cd, hcd, hCd, hdirect⟩ := direct_reduction β hβ obtain ⟨hnc, hnoise⟩ := noisy_frontier_lower legendre_of_gate β hβ let cn : ℝ := (4 / 5 : ℝ) * kappa * (1 / 16384 : ℝ)^β let c := min cd cn have hcn : 0 < cn := by exact hnc have hc : 0 < c := lt_min hcd hcn refine ⟨c, hc, ?_⟩ intro n hn σ hσ have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hdirectLower := (hdirect n hn).1 σ hσ by_cases hs : σ ≤ directResolution β n · have hres := rateResolution_eq_direct_of_le β n σ hβ hn hσ hs have hrate : frontierRate β n σ = (n : ℝ)^(-β/(2*β+1)) := by unfold frontierRate rw [hres] unfold directResolution calc ((n : ℝ) ^ (-1 / (2 * β + 1))) ^ β = (n : ℝ) ^ ((-1 / (2 * β + 1)) * β) := (Real.rpow_mul hnpos.le _ _).symm _ = (n : ℝ)^(-β/(2*β+1)) := by congr 1 <;> ring rw [hrate] exact ⟨(mul_le_mul_of_nonneg_right (min_le_left cd cn) (Real.rpow_nonneg hnpos.le _)).trans hdirectLower.1, (mul_le_mul_of_nonneg_right (min_le_left cd cn) (Real.rpow_nonneg hnpos.le _)).trans hdirectLower.2⟩ · have hnoisy : directResolution β n < σ := lt_of_not_ge hs have hσpos : 0 < σ := (directResolution_pos_le_one β n hβ hn).1.trans hnoisy have hHσ := (noisy_rateResolution_interior β n σ hβ hn hσ hnoisy).2 have hnLower := hnoise n hn σ ⟨hσpos, hσ.2⟩ hHσ have hrate : 0 ≤ frontierRate β n σ := by unfold frontierRate exact Real.rpow_nonneg ((directResolution_pos_le_one β n hβ hn).1.trans_le (unique_rate_root β n σ hβ hn hσ).1.1).le _ exact ⟨(mul_le_mul_of_nonneg_right (min_le_right cd cn) hrate).trans hnLower.1, (mul_le_mul_of_nonneg_right (min_le_right cd cn) hrate).trans hnLower.2⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.frontierRate_lower_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierLower.lean:281
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.MatchedFrontierUpper 6 declarations The public finite selector is compared with the scalar frontier using a rounded degree whose squared reciprocal is a fixed dilation of the scalar resolution.

Uniform upper tuning for the matched frontier

The public finite selector is compared with the scalar frontier using a rounded degree whose squared reciprocal is a fixed dilation of the scalar resolution.

theorem rateRoot_exp_balance

Exponentiating the scalar root equation gives the exact balance identity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
= (n : ℝ) * rateResolution β n σ ^ (2 * β + 1)
Proof (Lean source)
lemma rateRoot_exp_balance (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) : exp (noiseCost (rateResolution β n σ) σ) = (n : ℝ) * rateResolution β n σ ^ (2 * β + 1) := by have hr := unique_rate_root β n σ hβ hn hσ have hd := directResolution_pos_le_one β n hβ hn have hH : 0 < rateResolution β n σ := hd.1.trans_le hr.1.1 have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) rw [← hr.2.1, Real.exp_add, Real.exp_log hnpos, Real.rpow_def_of_pos hH, mul_comm (log _) _]
CausalSmith.Stat.RdTruesideNoiseFrontier.rateRoot_exp_balance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:23
theorem ceil_one_two_bounds

Ceiling a number above one loses at most a factor two. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
x :
ℝ
hx :
1 < x
conclusion 1
1 ≤ ⌈x⌉₊
conclusion 2
x ≤ (⌈x⌉₊ : ℝ)
conclusion 3
(⌈x⌉₊ : ℝ) ≤ 2 * x
Proof (Lean source)
lemma ceil_one_two_bounds (x : ℝ) (hx : 1 < x) : 1 ≤ ⌈x⌉₊ ∧ x ≤ (⌈x⌉₊ : ℝ) ∧ (⌈x⌉₊ : ℝ) ≤ 2 * x := by have hx0 : 0 ≤ x := hx.le.trans' (by norm_num) have hceil := Nat.le_ceil x have hlt := Nat.ceil_lt_add_one hx0 have hone : 1 ≤ ⌈x⌉₊ := by apply Nat.one_le_iff_ne_zero.mpr intro hz rw [hz] at hceil norm_num at hceil linarith exact ⟨hone, hceil, by have hxone : 1 ≤ x := hx.le linarith⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.ceil_one_two_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:35
theorem upperDegree_width_bounds

The rounded upper degree has a width between one quarter and one times the requested dilated resolution. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
A H :
ℝ
hA :
0 < A
hH :
0 < H
hsmall :
A * H < 1
x :
(A * H) ^ (-1 / 2 : ℝ)
J :
⌈x⌉₊
1 ≤ J
A * H / 4 ≤ (J : ℝ) ^ (-2 : ℝ)
(J : ℝ) ^ (-2 : ℝ) ≤ A * H
Proof (Lean source)
lemma upperDegree_width_bounds (A H : ℝ) (hA : 0 < A) (hH : 0 < H) (hsmall : A * H < 1) : let x := (A * H) ^ (-1 / 2 : ℝ) let J := ⌈x⌉₊ 1 ≤ J ∧ A * H / 4 ≤ (J : ℝ) ^ (-2 : ℝ) ∧ (J : ℝ) ^ (-2 : ℝ) ≤ A * H := by dsimp only let x := (A * H) ^ (-1 / 2 : ℝ) have hAH : 0 < A * H := mul_pos hA hH have hx : 1 < x := by dsimp [x] exact Real.one_lt_rpow_of_pos_of_lt_one_of_neg hAH hsmall (by norm_num) obtain ⟨hJ, hxJ, hJx⟩ := ceil_one_two_bounds x hx have hJpos : (0 : ℝ) < ⌈x⌉₊ := by exact_mod_cast (show 0 < ⌈x⌉₊ by omega) have hxpos : 0 < x := zero_lt_one.trans hx have hupper := Real.rpow_le_rpow_of_nonpos hxpos hxJ (by norm_num : (-2 : ℝ) ≤ 0) have hlower := Real.rpow_le_rpow_of_nonpos hJpos hJx (by norm_num : (-2 : ℝ) ≤ 0) have hxpow : x ^ (-2 : ℝ) = A * H := by dsimp [x] rw [← Real.rpow_mul hAH.le] norm_num have h2xpow : (2 * x) ^ (-2 : ℝ) = A * H / 4 := by rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≤ 2) hxpos.le, hxpow] norm_num [Real.rpow_neg (by norm_num : (0 : ℝ) ≤ 2)] ring_nf change 1 ≤ ⌈x⌉₊ ∧ A * H / 4 ≤ (⌈x⌉₊ : ℝ) ^ (-2 : ℝ) ∧ (⌈x⌉₊ : ℝ) ^ (-2 : ℝ) ≤ A * H exact ⟨hJ, by rw [← h2xpow]; exact hlower, hupper.trans_eq hxpow⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.upperDegree_width_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:51
theorem upperDegree_le_Lmax

The rounded dilated degree remains in the public finite candidate set. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β A H :
ℝ
n :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hA :
1 ≤ A
hH :
directResolution β n ≤ H
⌈(A * H) ^ (-1 / 2 : ℝ)⌉₊ ≤ Lmax β n
Proof (Lean source)
lemma upperDegree_le_Lmax (β A H : ℝ) (n : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hA : 1 ≤ A) (hH : directResolution β n ≤ H) : ⌈(A * H) ^ (-1 / 2 : ℝ)⌉₊ ≤ Lmax β n := by have hν : 0 < 2 * β + 1 := by linarith [hβ.1] have hd := directResolution_pos_le_one β n hβ hn have hHpos : 0 < H := hd.1.trans_le hH have hAH : H ≤ A * H := by nlinarith have hpowAH := Real.rpow_le_rpow_of_nonpos hHpos hAH (by norm_num : (-1 / 2 : ℝ) ≤ 0) have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hdirect : (directResolution β n) ^ (-1 / 2 : ℝ) = (n : ℝ) ^ (1 / (4 * β + 2)) := by unfold directResolution rw [← Real.rpow_mul hnpos.le] congr 1 have hden : 2 + β * 4 ≠ 0 := by nlinarith [hβ.1] rw [div_eq_mul_inv] apply (eq_div_iff (by nlinarith [hβ.1] : 4 * β + 2 ≠ 0)).2 field_simp [hden] ring have hHdirect := Real.rpow_le_rpow_of_nonpos hd.1 hH (by norm_num : (-1 / 2 : ℝ) ≤ 0) unfold Lmax exact Nat.ceil_mono (hpowAH.trans (hHdirect.trans_eq hdirect))
CausalSmith.Stat.RdTruesideNoiseFrontier.upperDegree_le_Lmax · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:83
theorem dilation_cost_absorption

A dilation by at least (D+1)^2 absorbs the variance-envelope constant in the square-root cost scaling. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
D a c :
ℝ
hD :
0 < D
ha :
(D + 1)^2 ≤ a
hc :
0 ≤ c
D * max 1 (a ^ (-1 / 2 : ℝ) * (1 + c)) ≤ D + (1 + c)
Proof (Lean source)
lemma dilation_cost_absorption (D a c : ℝ) (hD : 0 < D) (ha : (D + 1)^2 ≤ a) (hc : 0 ≤ c) : D * max 1 (a ^ (-1 / 2 : ℝ) * (1 + c)) ≤ D + (1 + c) := by have ha0 : 0 < a := lt_of_lt_of_le (sq_pos_of_pos (by linarith : 0 < D + 1)) ha have hDsqrt : D ≤ sqrt a := by apply (Real.le_sqrt hD.le ha0.le).2 nlinarith have hinv : D * a ^ (-1 / 2 : ℝ) ≤ 1 := by have hsqrt : 0 < sqrt a := Real.sqrt_pos.2 ha0 rw [show (-1 / 2 : ℝ) = -(1 / 2 : ℝ) by norm_num, Real.rpow_neg ha0.le, ← Real.sqrt_eq_rpow] rw [mul_inv_le_iff₀ hsqrt] simpa only [one_mul] using hDsqrt rw [mul_max_of_nonneg 1 (a ^ (-1 / 2 : ℝ) * (1 + c)) hD.le] apply max_le · linarith · calc D * (a ^ (-1 / 2 : ℝ) * (1 + c)) = (D * a ^ (-1 / 2 : ℝ)) * (1 + c) := by ring _ ≤ 1 * (1 + c) := mul_le_mul_of_nonneg_right hinv (by linarith) _ ≤ D + (1 + c) := by linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.dilation_cost_absorption · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:108
theorem certificate_le_frontierRate

The public finite certificate is uniformly bounded by the scalar frontier. The constant depends only on the smoothness exponent (and on the two classical polynomial identities packaged by the cited gates). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
hermite_of_gate :
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ C : ℝ,
0 < C
conclusion 1
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
certificate β n σ ≤ C * frontierRate β n σ
Proof (Lean source)
theorem certificate_le_frontierRate (legendre_of_gate : ClassicalLegendreFacts) (hermite_of_gate : ClassicalHermiteFacts) (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, certificate β n σ ≤ C * frontierRate β n σ := by obtain ⟨K, hK, hmoment⟩ := positive_endpoint β hβ obtain ⟨D, hD, hvariance⟩ := variance_cost_envelope let A : ℝ := 4 * (D + 1)^2 let Q : ℝ := sqrt (160 * D * exp (D + 1)) let C : ℝ := max ((1 / 2 : ℝ) * A ^ β) (12 * K * A ^ β + 28 * Q) have hA : 4 ≤ A := by dsimp [A] nlinarith [sq_nonneg D] have hApos : 0 < A := by linarith have hQ : 0 < Q := by dsimp [Q] positivity have hC : 0 < C := by exact lt_of_lt_of_le (by positivity : 0 < 12 * K * A ^ β + 28 * Q) (le_max_right _ _) refine ⟨C, hC, ?_⟩ intro n hn σ hσ let H := rateResolution β n σ have hr := unique_rate_root β n σ hβ hn hσ have hd := directResolution_pos_le_one β n hβ hn have hHpos : 0 < H := hd.1.trans_le hr.1.1 have hHle : H ≤ 1 := hr.1.2 have hHmem : H ∈ Ioc (0 : ℝ) 1 := ⟨hHpos, hHle⟩ have hHβpos : 0 < H ^ β := Real.rpow_pos_of_pos hHpos β have hfrontier : frontierRate β n σ = H ^ β := rfl by_cases hlarge : 1 ≤ A * H · have hAβpos : 0 < A ^ β := Real.rpow_pos_of_pos hApos β have hAHβ : 1 ≤ (A * H) ^ β := Real.one_le_rpow hlarge (le_of_lt hβ.1) have hmul : A ^ β * H ^ β = (A * H) ^ β := by rw [Real.mul_rpow hApos.le hHpos.le] have hfallback : (1 / 2 : ℝ) ≤ ((1 / 2 : ℝ) * A ^ β) * H ^ β := by rw [mul_assoc, hmul] nlinarith rw [hfrontier] exact (certificate_le_half β n σ).trans (hfallback.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hHβpos.le)) · have hsmall : A * H < 1 := lt_of_not_ge hlarge let x : ℝ := (A * H) ^ (-1 / 2 : ℝ) let J : ℕ := ⌈x⌉₊ obtain ⟨hJ, hwidth_lower, hwidth_upper⟩ := upperDegree_width_bounds A H hApos hHpos hsmall have hJnat : 1 ≤ J := by exact hJ have hJcap : J ≤ Lmax β n := upperDegree_le_Lmax β A H n hβ hn (by linarith) hr.1.1 have hJpos : (0 : ℝ) < J := by exact_mod_cast (show 0 < J by omega) let width : ℝ := (J : ℝ) ^ (-2 : ℝ) let a : ℝ := width / H have hwidth_pos : 0 < width := Real.rpow_pos_of_pos hJpos _ have haH : a * H = width := by dsimp [a] field_simp have ha_lower : (D + 1)^2 ≤ a := by dsimp [a] apply (le_div_iff₀ hHpos).2 calc (D + 1)^2 * H = A * H / 4 := by dsimp [A]; ring _ ≤ width := hwidth_lower have ha_one : 1 ≤ a := by nlinarith [sq_nonneg D] have ha_pos : 0 < a := lt_of_lt_of_le zero_lt_one ha_one have ha_upper : a ≤ A := by dsimp [a] rw [div_le_iff₀ hHpos] simpa only using hwidth_upper have hawidth_le : a * H ≤ 1 := by rw [haH]; exact hwidth_upper.trans hsmall.le have hcost_nonneg : 0 ≤ noiseCost H σ := noiseCost_nonneg H σ hHmem hσ have hcostscale := noise_cost_scaling.2.2 H σ a hHmem hσ ha_one hawidth_le rw [haH] at hcostscale have hcostabs : D * (1 + noiseCost width σ) ≤ D + (1 + noiseCost H σ) := (mul_le_mul_of_nonneg_left hcostscale hD.le).trans (dilation_cost_absorption D a (noiseCost H σ) hD ha_lower hcost_nonneg) have hmomentJ := (hmoment J hJ).2.2.1 have hpow_width : (J : ℝ) ^ (-2 * β) = width ^ β := by dsimp [width] rw [← Real.rpow_mul hJpos.le] have hwidthβ : width ^ β ≤ (A * H) ^ β := Real.rpow_le_rpow hwidth_pos.le hwidth_upper hβ.1.le have hAHpow : (A * H) ^ β = A ^ β * H ^ β := Real.mul_rpow hApos.le hHpos.le have hbias : kernelMoment J β ≤ K * A ^ β * H ^ β := by calc kernelMoment J β ≤ K * (J : ℝ) ^ (-2 * β) := hmomentJ _ = K * width ^ β := by rw [hpow_width] _ ≤ K * (A * H) ^ β := mul_le_mul_of_nonneg_left hwidthβ hK.le _ = K * A ^ β * H ^ β := by rw [hAHpow]; ring have hvar0 := hvariance J hJ σ hσ have hexp : exp (D * (1 + noiseCost width σ)) ≤ exp (D + 1) * exp (noiseCost H σ) := by calc _ ≤ exp (D + (1 + noiseCost H σ)) := Real.exp_le_exp.mpr hcostabs _ = _ := by rw [show D + (1 + noiseCost H σ) = (D + 1) + noiseCost H σ by ring, Real.exp_add] have hvar1 : kernelVariance J σ ≤ D * (J : ℝ)^2 * (exp (D + 1) * exp (noiseCost H σ)) := hvar0.trans (mul_le_mul_of_nonneg_left hexp (by positivity)) have hxgt : 1 < x := by dsimp [x] exact Real.one_lt_rpow_of_pos_of_lt_one_of_neg (mul_pos hApos hHpos) hsmall (by norm_num) have hJx : (J : ℝ) ≤ 2 * x := (ceil_one_two_bounds x hxgt).2.2 have hx_sq : x^2 = (A * H)⁻¹ := by dsimp [x] rw [← Real.rpow_natCast, ← Real.rpow_mul (mul_pos hApos hHpos).le] norm_num [Real.rpow_neg_one] have hJ_sq : (J : ℝ)^2 ≤ 4 / H := by have hsquare := (sq_le_sq₀ (by positivity : (0 : ℝ) ≤ J) (by positivity : 0 ≤ 2 * x)).2 hJx rw [mul_pow, hx_sq] at hsquare have hAHne : A * H ≠ 0 := ne_of_gt (mul_pos hApos hHpos) rw [inv_eq_one_div] at hsquare calc (J : ℝ)^2 ≤ 2^2 * (1 / (A * H)) := hsquare _ ≤ 4 / H := by rw [div_eq_mul_inv, div_eq_mul_inv] have hAinv : (A * H)⁻¹ ≤ H⁻¹ := by apply (inv_le_inv₀ (a := A * H) (b := H) (mul_pos hApos hHpos) hHpos).2 nlinarith [hA] norm_num at hAinv ⊢ linarith have hbalance := rateRoot_exp_balance β n σ hβ hn hσ change exp (noiseCost H σ) = (n : ℝ) * H ^ (2 * β + 1) at hbalance have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hHsplit : H ^ (2 * β + 1) = H ^ (2 * β) * H := by rw [show 2 * β + 1 = 2 * β + 1 by ring, Real.rpow_add hHpos] simp have hvar2 : 40 * kernelVariance J σ / (n : ℝ) ≤ 160 * D * exp (D + 1) * H ^ (2 * β) := by rw [hbalance, hHsplit] at hvar1 apply (div_le_iff₀ hnpos).2 have hJH : (J : ℝ)^2 * H ≤ 4 := by have ht := mul_le_mul_of_nonneg_right hJ_sq hHpos.le calc (J : ℝ)^2 * H ≤ (4 / H) * H := ht _ = 4 := by field_simp have hfac : 0 ≤ 40 * D * exp (D + 1) * (n : ℝ) * H ^ (2 * β) := by positivity calc 40 * kernelVariance J σ ≤ 40 * (D * (J : ℝ)^2 * (exp (D + 1) * ((n : ℝ) * (H ^ (2 * β) * H)))) := mul_le_mul_of_nonneg_left hvar1 (by norm_num) _ = (40 * D * exp (D + 1) * (n : ℝ) * H ^ (2 * β)) * ((J : ℝ)^2 * H) := by ring _ ≤ (40 * D * exp (D + 1) * (n : ℝ) * H ^ (2 * β)) * 4 := mul_le_mul_of_nonneg_left hJH hfac _ = (160 * D * exp (D + 1) * H ^ (2 * β)) * (n : ℝ) := by ring have hsqrt : sqrt (40 * kernelVariance J σ / (n : ℝ)) ≤ Q * H ^ β := by have hsqrt_mono := Real.sqrt_le_sqrt hvar2 have hconst : 0 ≤ 160 * D * exp (D + 1) := by positivity have hpowsq : H ^ (2 * β) = (H ^ β)^2 := by rw [← Real.rpow_natCast, ← Real.rpow_mul hHpos.le] congr 1 ring rw [hpowsq, Real.sqrt_mul hconst, Real.sqrt_sq_eq_abs, abs_of_pos hHβpos] at hsqrt_mono exact hsqrt_mono have hradius : radius β n σ J ≤ (12 * K * A ^ β + 28 * Q) * H ^ β := by simp only [radius, if_neg (Nat.ne_of_gt (lt_of_lt_of_le Nat.zero_lt_one hJnat))] calc 12 * kernelMoment J β + 28 * sqrt (40 * kernelVariance J σ / ↑n) ≤ 12 * (K * A ^ β * H ^ β) + 28 * (Q * H ^ β) := add_le_add (mul_le_mul_of_nonneg_left hbias (by norm_num)) (mul_le_mul_of_nonneg_left hsqrt (by norm_num)) _ = (12 * K * A ^ β + 28 * Q) * H ^ β := by ring rw [hfrontier] exact (selectedDegree_radius_le β n σ J hJcap).trans (hradius.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) hHβpos.le))
CausalSmith.Stat.RdTruesideNoiseFrontier.certificate_le_frontierRate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/MatchedFrontierUpper.lean:132
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.ObservedCellDensity 42 declarations This file derives the treated observed-cell law from the concrete Bernoulli product witness and the independent Gaussian error.

Observed-cell densities for the cancellation witnesses

This file derives the treated observed-cell law from the concrete Bernoulli product witness and the independent Gaussian error. The resulting density is the convolution already used by the marked-likelihood estimates.

def treatedLatentCell

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
p :
ℝ → ℝ
y :
treatedLatentCell p y :
(uniformScore.restrict (Ici 0)).withDensity (fun x => ofReal (if y then p x else 1 - p x))
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedLatentCell · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:22
def treatedCellBaseDensity

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
p :
ℝ → ℝ
y :
x :
ℝ
treatedCellBaseDensity p y x :
ℝ≥0∞
(Icc (0 : ℝ) 1).indicator (fun x => ofReal (1/2 : ℝ) * ofReal (if y then p x else 1-p x)) x
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedCellBaseDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:27
def proxyNoiseDensity

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
sigma w :
ℝ
proxyNoiseDensity sigma w :
ℝ≥0∞
ofReal (phi sigma w)
CausalSmith.Stat.RdTruesideNoiseFrontier.proxyNoiseDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:32
theorem scaledGaussian_eq_withDensity

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
sigma :
ℝ
hsigma :
0 < sigma
(gaussianReal 0 1).map (fun z => sigma * z) = volume.withDensity (proxyNoiseDensity sigma)
Proof (Lean source)
lemma scaledGaussian_eq_withDensity (sigma : ℝ) (hsigma : 0 < sigma) : (gaussianReal 0 1).map (fun z => sigma * z) = volume.withDensity (proxyNoiseDensity sigma) := by rw [gaussianReal_map_const_mul] simp only [mul_zero, mul_one] have hv : NNReal.mk (sigma^2) (sq_nonneg sigma) ≠ 0 := by rw [ne_eq, ← NNReal.coe_eq_zero] simp [hsigma.ne'] rw [gaussianReal_of_var_ne_zero 0 hv] congr 2 funext w rw [gaussianPDF_def] exact congrArg ofReal (phi_eq_gaussianPDFReal sigma w).symm
CausalSmith.Stat.RdTruesideNoiseFrontier.scaledGaussian_eq_withDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:35
theorem treated_lconvolution_eq_witness

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hb :
∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
sigma :
ℝ
y :
w :
ℝ
= ofReal ((1/2 : ℝ) * ∫ x in (0 : ℝ)..1, (if y then p x else 1-p x) * phi sigma (w-x))
Proof (Lean source)
lemma treated_lconvolution_eq_witness (p : ℝ → ℝ) (hp : Continuous p) (hb : ∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) (sigma : ℝ) (y : Bool) (w : ℝ) : (treatedCellBaseDensity p y ⋆ₗ[volume] proxyNoiseDensity sigma) w = ofReal ((1/2 : ℝ) * ∫ x in (0 : ℝ)..1, (if y then p x else 1-p x) * phi sigma (w-x)) := by rw [MeasureTheory.lconvolution_def] simp only [treatedCellBaseDensity, proxyNoiseDensity] have hind : (fun x : ℝ => (Icc (0 : ℝ) 1).indicator (fun x => ofReal (1/2 : ℝ) * ofReal (if y then p x else 1-p x)) x * ofReal (phi sigma (-x+w))) = (Icc (0 : ℝ) 1).indicator (fun x => (ofReal (1/2 : ℝ) * ofReal (if y then p x else 1-p x)) * ofReal (phi sigma (-x+w))) := by funext x by_cases hx : x ∈ Icc (0 : ℝ) 1 <;> simp [indicator, hx] rw [hind] rw [lintegral_indicator measurableSet_Icc] let q : ℝ → ℝ := fun x => if y then p x else 1-p x let f : ℝ → ℝ := fun x => (1/2 : ℝ) * q x * phi sigma (-x+w) have hq_cont : Continuous q := by cases y · change Continuous (fun x => 1-p x) fun_prop · simpa [q] using hp have hf_cont : Continuous f := by unfold f fun_prop have hf_int : IntegrableOn f (Icc (0 : ℝ) 1) := hf_cont.integrableOn_Icc have hf_nonneg : 0 ≤ᵐ[volume.restrict (Icc (0 : ℝ) 1)] f := by filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx have hq0 : 0 ≤ q x := by cases y · simpa [q] using sub_nonneg.mpr (hb x hx).2 · simpa [q] using (hb x hx).1 exact mul_nonneg (mul_nonneg (by norm_num) hq0) (phi_nonneg sigma _) have heq : (fun x => ofReal (1/2 : ℝ) * ofReal (q x) * ofReal (phi sigma (-x+w))) =ᵐ[volume.restrict (Icc (0 : ℝ) 1)] fun x => ofReal (f x) := by filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx have hq0 : 0 ≤ q x := by cases y · simpa [q] using sub_nonneg.mpr (hb x hx).2 · simpa [q] using (hb x hx).1 unfold f rw [← ENNReal.ofReal_mul (by norm_num : 0 ≤ (1/2 : ℝ)), ← ENNReal.ofReal_mul (mul_nonneg (by norm_num) hq0)] change (∫⁻ x in Icc (0 : ℝ) 1, ofReal (1/2 : ℝ) * ofReal (q x) * ofReal (phi sigma (-x+w))) = _ rw [lintegral_congr_ae heq] rw [← ofReal_integral_eq_lintegral_ofReal hf_int hf_nonneg] apply congrArg ofReal unfold f q rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), ← integral_Icc_eq_integral_Ioc, ← integral_const_mul] apply integral_congr_ae filter_upwards [] with x have harg : -x+w = w-x := by ring rw [harg] ring
CausalSmith.Stat.RdTruesideNoiseFrontier.treated_lconvolution_eq_witness · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:50
theorem treatedLatentCell_eq_withDensity

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
y :
hp :
treatedLatentCell p y = volume.withDensity (treatedCellBaseDensity p y)
Proof (Lean source)
lemma treatedLatentCell_eq_withDensity (p : ℝ → ℝ) (y : Bool) (hp : Measurable p) : treatedLatentCell p y = volume.withDensity (treatedCellBaseDensity p y) := by have hq : Measurable (fun x : ℝ => ofReal (if y then p x else 1-p x)) := by cases y · simpa using (measurable_const.sub hp).ennreal_ofReal · simpa using hp.ennreal_ofReal have hrestrict : uniformScore.restrict (Ici 0) = ofReal (1/2 : ℝ) • volume.restrict (Icc 0 1) := by unfold uniformScore rw [Measure.restrict_smul, Measure.restrict_restrict measurableSet_Ici] congr 2 ext x simp only [mem_inter_iff, mem_Ici, mem_Icc] constructor · rintro ⟨hx0, _hxneg, hx1⟩ exact ⟨hx0, hx1⟩ · rintro ⟨hx0, hx1⟩ exact ⟨hx0, by linarith, hx1⟩ unfold treatedLatentCell rw [hrestrict, withDensity_smul_measure] rw [← withDensity_smul _ hq] rw [← withDensity_indicator measurableSet_Icc] congr 2
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedLatentCell_eq_withDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:116
def observedCellMeasure

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
sigma :
ℝ
d y :
observedCellMeasure L sigma d y :
((Pobs L sigma).restrict {o | o.2.1 = d ∧ o.2.2 = y}).map fst
CausalSmith.Stat.RdTruesideNoiseFrontier.observedCellMeasure · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:141
theorem measurableSet_observedCell

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d y :
MeasurableSet {o : Obs | o.2.1 = d ∧ o.2.2 = y}
Proof (Lean source)
lemma measurableSet_observedCell (d y : Bool) : MeasurableSet {o : Obs | o.2.1 = d ∧ o.2.2 = y} := by exact ((measurableSet_singleton d).preimage (measurable_fst.comp measurable_snd)).inter ((measurableSet_singleton y).preimage (measurable_snd.comp measurable_snd))
CausalSmith.Stat.RdTruesideNoiseFrontier.measurableSet_observedCell · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:145
theorem schedule_treated_cell_eq

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
y :
hp :
M₀ :
uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)
M₁ :
M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)
(M₁.restrict {z | 0 ≤ z.1.1 ∧ z.2 = y}).map (fun z => z.1.1) = treatedLatentCell p y
Proof (Lean source)
lemma schedule_treated_cell_eq (p : ℝ → ℝ) (y : Bool) (hp : Measurable p) : let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) (M₁.restrict {z | 0 ≤ z.1.1 ∧ z.2 = y}).map (fun z => z.1.1) = treatedLatentCell p y := by dsimp only letI := uniformScore_probability let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) have hM₀ : M₀.map fst = uniformScore := bernoulli_compProd_fst uniformScore _ measurable_const (by filter_upwards [] with x norm_num) ext A hA rw [Measure.map_apply (by fun_prop) hA] rw [Measure.restrict_apply] swap · exact hA.preimage (measurable_fst.comp measurable_fst) have hpre : (fun z : (ℝ × Bool) × Bool => z.1.1) ⁻¹' A ∩ {z | 0 ≤ z.1.1 ∧ z.2 = y} = (fst ⁻¹' (A ∩ Ici 0)) ×ˢ ({y} : Set Bool) := by ext z simp [and_left_comm, and_comm] rw [hpre, Measure.compProd_apply_prod ((hA.inter measurableSet_Ici).preimage measurable_fst) (measurableSet_singleton y)] cases y · simp_rw [bernoulliMarkKernel_apply_false (fun z : ℝ × Bool => p z.1) (hp.comp measurable_fst)] change (∫⁻ z in fst ⁻¹' (A ∩ Ici 0), ofReal (1 - p z.1) ∂M₀) = _ have hmap := MeasureTheory.setLIntegral_map (f := fun x : ℝ => ofReal (1-p x)) (g := fst) (hA.inter (measurableSet_Ici : MeasurableSet (Ici (0 : ℝ)))) (measurable_const.sub hp).ennreal_ofReal measurable_fst (μ := M₀) rw [hM₀] at hmap rw [← hmap] unfold treatedLatentCell rw [withDensity_apply _ hA] simp only [Bool.false_eq_true, if_false] rw [Measure.restrict_restrict hA] · simp_rw [bernoulliMarkKernel_apply_true (fun z : ℝ × Bool => p z.1) (hp.comp measurable_fst)] change (∫⁻ z in fst ⁻¹' (A ∩ Ici 0), ofReal (p z.1) ∂M₀) = _ have hmap := MeasureTheory.setLIntegral_map (f := fun x : ℝ => ofReal (p x)) (g := fst) (hA.inter (measurableSet_Ici : MeasurableSet (Ici (0 : ℝ)))) hp.ennreal_ofReal measurable_fst (μ := M₀) rw [hM₀] at hmap rw [← hmap] unfold treatedLatentCell rw [withDensity_apply _ hA] simp only [if_true] rw [Measure.restrict_restrict hA]
CausalSmith.Stat.RdTruesideNoiseFrontier.schedule_treated_cell_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:151
theorem witness_observed_treated_cell_eq_conv

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hc :
ContinuousOn p (Icc (-1) 1)
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
sigma :
ℝ
y :
= treatedLatentCell p y ∗ (gaussianReal 0 1).map (fun z => sigma * z)
Proof (Lean source)
lemma witness_observed_treated_cell_eq_conv (p : ℝ → ℝ) (hp : Measurable p) (hc : ContinuousOn p (Icc (-1) 1)) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) (sigma : ℝ) (y : Bool) : observedCellMeasure (bernoulliWitness p hp hc hb) sigma true y = treatedLatentCell p y ∗ (gaussianReal 0 1).map (fun z => sigma * z) := by letI := uniformScore_probability let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) let pack : ((ℝ × Bool) × Bool) × ℝ → Latent := fun z => (z.1.1.1, z.1.1.2, z.1.2, z.2) let cell : Set Obs := {o | o.2.1 = true ∧ o.2.2 = y} let schedCell : Set ((ℝ × Bool) × Bool) := {z | 0 ≤ z.1.1 ∧ z.2 = y} have hcell : MeasurableSet cell := measurableSet_observedCell true y have hsched : MeasurableSet schedCell := by exact ((measurableSet_Ici.preimage (measurable_fst.comp measurable_fst)).inter ((measurableSet_singleton y).preimage measurable_snd)) have hpre : pack ⁻¹' (obs sigma ⁻¹' cell) = schedCell ×ˢ (univ : Set ℝ) := by ext z simp only [pack, obs, cell, schedCell, Set.mem_preimage, Set.mem_ofPred_eq, Set.mem_prod, Set.mem_univ, and_true, side, score, outcome] by_cases hx : 0 ≤ z.1.1.1 · simp [hx] · simp [hx] unfold observedCellMeasure Pobs change Measure.map fst ((Measure.map (obs sigma) (witnessMeasure p)).restrict cell) = _ rw [Measure.restrict_map (obs_measurable sigma) hcell] rw [Measure.map_map measurable_fst (obs_measurable sigma)] unfold witnessMeasure rw [Measure.restrict_map (by fun_prop) (hcell.preimage (obs_measurable sigma))] rw [Measure.map_map ((measurable_fst.comp (obs_measurable sigma))) (by fun_prop)] change Measure.map _ ((M₁.prod (gaussianReal 0 1)).restrict (pack ⁻¹' (obs sigma ⁻¹' cell))) = _ rw [hpre, ← Measure.restrict_prod_eq_prod_univ] rw [← schedule_treated_cell_eq p y hp] change Measure.map _ ((M₁.restrict schedCell).prod (gaussianReal 0 1)) = Measure.map (fun z : ℝ × ℝ => z.1 + z.2) ((Measure.map (fun z => z.1.1) (M₁.restrict schedCell)).prod (Measure.map (fun z => sigma * z) (gaussianReal 0 1))) rw [Measure.map_prod_map _ _ (by fun_prop) (by fun_prop)] rw [Measure.map_map (by fun_prop) (by fun_prop)] apply Measure.map_congr filter_upwards [] with z rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_observed_treated_cell_eq_conv · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:201
theorem altLaw_observed_treated_cell_density

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s y :
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
observedCellMeasure (altLaw hleg beta b m s hbeta hb hm) sigma true y
= volume.withDensity (fun w => ofReal (witnessTreatedCellConvolution beta b sigma m s y w))
Proof (Lean source)
lemma altLaw_observed_treated_cell_density (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (s y : Bool) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : observedCellMeasure (altLaw hleg beta b m s hbeta hb hm) sigma true y = volume.withDensity (fun w => ofReal (witnessTreatedCellConvolution beta b sigma m s y w)) := by let p := altProbability beta b m s have hprops := altProbability_properties hleg beta b m s hbeta hb hm have hpcont : Continuous p := altProbability_continuous beta b m s hb.1 have hbase : Measurable (treatedCellBaseDensity p y) := by unfold treatedCellBaseDensity apply Measurable.indicator · have hq : Measurable (fun x => ofReal (if y then p x else 1-p x)) := by cases y · simpa using (measurable_const.sub hprops.1).ennreal_ofReal · simpa using hprops.1.ennreal_ofReal exact measurable_const.mul hq · exact measurableSet_Icc have hnoise : Measurable (proxyNoiseDensity sigma) := by exact (phi_continuous sigma).measurable.ennreal_ofReal unfold altLaw rw [witness_observed_treated_cell_eq_conv p hprops.1 hprops.2.1 hprops.2.2] rw [treatedLatentCell_eq_withDensity p y hprops.1] rw [scaledGaussian_eq_withDensity sigma hsigma] rw [MeasureTheory.conv_withDensity_eq_lconvolution hbase hnoise] congr 2 funext w simpa only [p, witnessTreatedCellConvolution] using treated_lconvolution_eq_witness p hpcont (fun x hx => hprops.2.2 x ⟨by linarith [hx.1], hx.2⟩) sigma y w
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_treated_cell_density · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:247
def controlLatentCell

The negative-score, fair-outcome latent cell, independent of the treated mark. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
controlLatentCell :
(uniformScore.restrict (Iio 0)).withDensity (fun _ => ofReal (1/2 : ℝ))
CausalSmith.Stat.RdTruesideNoiseFrontier.controlLatentCell · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:280
def witnessControlCellConvolution

Common observed density of either untreated outcome cell. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
sigma w :
ℝ
witnessControlCellConvolution sigma w :
ℝ
(1/4 : ℝ) * ∫ x in (-1 : ℝ)..0, phi sigma (w-x)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessControlCellConvolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:284
def controlCellBaseDensity

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
x :
ℝ
controlCellBaseDensity x :
ℝ≥0∞
(Ico (-1 : ℝ) 0).indicator (fun _ => ofReal (1/4 : ℝ)) x
CausalSmith.Stat.RdTruesideNoiseFrontier.controlCellBaseDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:288
theorem controlLatentCell_eq_withDensity

Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
lemma controlLatentCell_eq_withDensity : controlLatentCell = volume.withDensity controlCellBaseDensity := by have hrestrict : uniformScore.restrict (Iio 0) = ofReal (1/2 : ℝ) • volume.restrict (Ico (-1) 0) := by unfold uniformScore rw [Measure.restrict_smul, Measure.restrict_restrict measurableSet_Iio] congr 2 ext x simp only [mem_inter_iff, mem_Icc, mem_Iio, mem_Ico] constructor · rintro ⟨hx0, hxneg, _hx1⟩ exact ⟨hxneg, hx0⟩ · rintro ⟨hxneg, hx0⟩ exact ⟨hx0, hxneg, by linarith⟩ unfold controlLatentCell rw [hrestrict, withDensity_smul_measure] rw [← withDensity_smul _ measurable_const] rw [← withDensity_indicator measurableSet_Ico] congr 2 funext x simp only [controlCellBaseDensity, Pi.smul_apply, smul_eq_mul] rw [← ENNReal.ofReal_mul (by norm_num : 0 ≤ (1/2 : ℝ))] norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.controlLatentCell_eq_withDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:292
theorem control_lconvolution_eq

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
sigma w :
ℝ
Proof (Lean source)
lemma control_lconvolution_eq (sigma w : ℝ) : (controlCellBaseDensity ⋆ₗ[volume] proxyNoiseDensity sigma) w = ofReal (witnessControlCellConvolution sigma w) := by rw [MeasureTheory.lconvolution_def] simp only [controlCellBaseDensity, proxyNoiseDensity] have hind : (fun x : ℝ => (Ico (-1 : ℝ) 0).indicator (fun _ => ofReal (1/4 : ℝ)) x * ofReal (phi sigma (-x+w))) = (Ico (-1 : ℝ) 0).indicator (fun x => ofReal (1/4 : ℝ) * ofReal (phi sigma (-x+w))) := by funext x by_cases hx : x ∈ Ico (-1 : ℝ) 0 <;> simp [indicator, hx] rw [hind, lintegral_indicator measurableSet_Ico] let f : ℝ → ℝ := fun x => (1/4 : ℝ) * phi sigma (-x+w) have hf_cont : Continuous f := by unfold f fun_prop have hf_int : IntegrableOn f (Ico (-1 : ℝ) 0) := hf_cont.integrableOn_Icc.mono_set Ico_subset_Icc_self have hf_nonneg : 0 ≤ᵐ[volume.restrict (Ico (-1 : ℝ) 0)] f := by filter_upwards [] with x exact mul_nonneg (by norm_num) (phi_nonneg sigma _) have heq : (fun x => ofReal (1/4 : ℝ) * ofReal (phi sigma (-x+w))) =ᵐ[volume.restrict (Ico (-1 : ℝ) 0)] fun x => ofReal (f x) := by filter_upwards [] with x unfold f rw [← ENNReal.ofReal_mul (by norm_num : 0 ≤ (1/4 : ℝ))] rw [lintegral_congr_ae heq, ← ofReal_integral_eq_lintegral_ofReal hf_int hf_nonneg] apply congrArg ofReal unfold witnessControlCellConvolution f rw [intervalIntegral.integral_of_le (by norm_num : (-1 : ℝ) ≤ 0), integral_Ioc_eq_integral_Ioo, integral_Ico_eq_integral_Ioo, ← integral_const_mul] apply integral_congr_ae filter_upwards [] with x have harg : -x+w = w-x := by ring rw [harg]
CausalSmith.Stat.RdTruesideNoiseFrontier.control_lconvolution_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:317
theorem schedule_control_cell_eq

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
y :
M₀ :
uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)
M₁ :
M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)
(M₁.restrict {z | z.1.1 < 0 ∧ z.1.2 = y}).map (fun z => z.1.1) = controlLatentCell
Proof (Lean source)
lemma schedule_control_cell_eq (p : ℝ → ℝ) (hp : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) (y : Bool) : let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) (M₁.restrict {z | z.1.1 < 0 ∧ z.1.2 = y}).map (fun z => z.1.1) = controlLatentCell := by dsimp only letI := uniformScore_probability let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) have hpM₀ : ∀ᵐ z ∂M₀, 0 ≤ p z.1 ∧ p z.1 ≤ 1 := by apply Measure.ae_compProd_of_ae_fst (bernoulliMarkKernel (fun _ : ℝ => 1/2)) ((measurableSet_le measurable_const hp).inter (measurableSet_le hp measurable_const)) filter_upwards [uniformScore_support] with x hx using hb x hx have hM₁ : M₁.map fst = M₀ := bernoulli_compProd_fst M₀ _ (hp.comp measurable_fst) hpM₀ have hM₀ : M₀.map fst = uniformScore := bernoulli_compProd_fst uniformScore _ measurable_const (by filter_upwards [] with x norm_num) ext A hA rw [Measure.map_apply (by fun_prop) hA] rw [Measure.restrict_apply] swap · exact hA.preimage (measurable_fst.comp measurable_fst) have hpre : (fun z : (ℝ × Bool) × Bool => z.1.1) ⁻¹' A ∩ {z | z.1.1 < 0 ∧ z.1.2 = y} = fst ⁻¹' {z : ℝ × Bool | z.1 ∈ A ∩ Iio 0 ∧ z.2 = y} := by ext z simp [and_left_comm, and_comm] rw [hpre] change M₁ (fst ⁻¹' ((A ∩ Iio 0) ×ˢ ({y} : Set Bool))) = _ rw [← Measure.map_apply measurable_fst ((hA.inter measurableSet_Iio).prod (measurableSet_singleton y)), hM₁] change M₀ ((A ∩ Iio 0) ×ˢ ({y} : Set Bool)) = controlLatentCell A rw [Measure.compProd_apply_prod (hA.inter measurableSet_Iio) (measurableSet_singleton y)] cases y · simp_rw [bernoulliMarkKernel_apply_false (fun _ : ℝ => 1/2) measurable_const] unfold controlLatentCell rw [withDensity_apply _ hA, Measure.restrict_restrict hA] norm_num · simp_rw [bernoulliMarkKernel_apply_true (fun _ : ℝ => 1/2) measurable_const] change (∫⁻ _x in A ∩ Iio 0, ofReal (1/2 : ℝ) ∂uniformScore) = _ unfold controlLatentCell rw [withDensity_apply _ hA, Measure.restrict_restrict hA]
CausalSmith.Stat.RdTruesideNoiseFrontier.schedule_control_cell_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:356
theorem witness_observed_control_cell_eq_conv

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hc :
ContinuousOn p (Icc (-1) 1)
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
sigma :
ℝ
y :
= controlLatentCell ∗ (gaussianReal 0 1).map (fun z => sigma * z)
Proof (Lean source)
lemma witness_observed_control_cell_eq_conv (p : ℝ → ℝ) (hp : Measurable p) (hc : ContinuousOn p (Icc (-1) 1)) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) (sigma : ℝ) (y : Bool) : observedCellMeasure (bernoulliWitness p hp hc hb) sigma false y = controlLatentCell ∗ (gaussianReal 0 1).map (fun z => sigma * z) := by letI := uniformScore_probability let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) let pack : ((ℝ × Bool) × Bool) × ℝ → Latent := fun z => (z.1.1.1, z.1.1.2, z.1.2, z.2) let cell : Set Obs := {o | o.2.1 = false ∧ o.2.2 = y} let schedCell : Set ((ℝ × Bool) × Bool) := {z | z.1.1 < 0 ∧ z.1.2 = y} have hcell : MeasurableSet cell := measurableSet_observedCell false y have hsched : MeasurableSet schedCell := by exact ((measurableSet_Iio.preimage (measurable_fst.comp measurable_fst)).inter ((measurableSet_singleton y).preimage (measurable_snd.comp measurable_fst))) have hpre : pack ⁻¹' (obs sigma ⁻¹' cell) = schedCell ×ˢ (univ : Set ℝ) := by ext z simp only [pack, obs, cell, schedCell, Set.mem_preimage, Set.mem_ofPred_eq, Set.mem_prod, Set.mem_univ, and_true, side, score, outcome] by_cases hx : 0 ≤ z.1.1.1 · simp [hx] · simp [hx, lt_of_not_ge hx] unfold observedCellMeasure Pobs change Measure.map fst ((Measure.map (obs sigma) (witnessMeasure p)).restrict cell) = _ rw [Measure.restrict_map (obs_measurable sigma) hcell] rw [Measure.map_map measurable_fst (obs_measurable sigma)] unfold witnessMeasure rw [Measure.restrict_map (by fun_prop) (hcell.preimage (obs_measurable sigma))] rw [Measure.map_map (measurable_fst.comp (obs_measurable sigma)) (by fun_prop)] change Measure.map _ ((M₁.prod (gaussianReal 0 1)).restrict (pack ⁻¹' (obs sigma ⁻¹' cell))) = _ rw [hpre, ← Measure.restrict_prod_eq_prod_univ] rw [← schedule_control_cell_eq p hp hb y] change Measure.map _ ((M₁.restrict schedCell).prod (gaussianReal 0 1)) = Measure.map (fun z : ℝ × ℝ => z.1 + z.2) ((Measure.map (fun z => z.1.1) (M₁.restrict schedCell)).prod (Measure.map (fun z => sigma * z) (gaussianReal 0 1))) rw [Measure.map_prod_map _ _ (by fun_prop) (by fun_prop)] rw [Measure.map_map (by fun_prop) (by fun_prop)] apply Measure.map_congr filter_upwards [] with z rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_observed_control_cell_eq_conv · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:412
theorem altLaw_observed_control_cell_density

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s y :
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
observedCellMeasure (altLaw hleg beta b m s hbeta hb hm) sigma false y
= volume.withDensity (fun w => ofReal (witnessControlCellConvolution sigma w))
Proof (Lean source)
lemma altLaw_observed_control_cell_density (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (s y : Bool) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : observedCellMeasure (altLaw hleg beta b m s hbeta hb hm) sigma false y = volume.withDensity (fun w => ofReal (witnessControlCellConvolution sigma w)) := by let p := altProbability beta b m s have hprops := altProbability_properties hleg beta b m s hbeta hb hm have hbase : Measurable controlCellBaseDensity := by unfold controlCellBaseDensity exact measurable_const.indicator measurableSet_Ico have hnoise : Measurable (proxyNoiseDensity sigma) := (phi_continuous sigma).measurable.ennreal_ofReal unfold altLaw rw [witness_observed_control_cell_eq_conv p hprops.1 hprops.2.1 hprops.2.2] rw [controlLatentCell_eq_withDensity] rw [scaledGaussian_eq_withDensity sigma hsigma] rw [MeasureTheory.conv_withDensity_eq_lconvolution hbase hnoise] congr 2 funext w exact control_lconvolution_eq sigma w
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_control_cell_density · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:461
def observedCell

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d y :
observedCell d y :
Set Obs
{o | o.2.1 = d ∧ o.2.2 = y}
def observedCellEmbed

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d y :
w :
ℝ
observedCellEmbed d y w :
Obs
(w, d, y)
CausalSmith.Stat.RdTruesideNoiseFrontier.observedCellEmbed · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:489
theorem observedCellMeasure_apply_preimage

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
sigma :
ℝ
d y :
A :
Set Obs
hA :
observedCellMeasure L sigma d y (observedCellEmbed d y ⁻¹' A)
= (Pobs L sigma).restrict (observedCell d y) A
Proof (Lean source)
lemma observedCellMeasure_apply_preimage (L : LatentLaw) (sigma : ℝ) (d y : Bool) (A : Set Obs) (hA : MeasurableSet A) : observedCellMeasure L sigma d y (observedCellEmbed d y ⁻¹' A) = (Pobs L sigma).restrict (observedCell d y) A := by have hembed : Measurable (observedCellEmbed d y) := measurable_id.prodMk (measurable_const.prodMk measurable_const) unfold observedCellMeasure rw [Measure.map_apply measurable_fst (hA.preimage hembed)] rw [Measure.restrict_apply] swap · exact (hA.preimage hembed).preimage measurable_fst rw [Measure.restrict_apply hA] congr 1 ext o rcases o with ⟨w, d', y'⟩ simp only [observedCellEmbed, observedCell, Set.mem_inter_iff, Set.mem_preimage, Set.mem_ofPred_eq, fst] aesop
CausalSmith.Stat.RdTruesideNoiseFrontier.observedCellMeasure_apply_preimage · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:492
theorem measure_eq_sum_observed_cells

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
mu :
mu = Measure.sum (fun i : Bool × Bool => mu.restrict (observedCell i.1 i.2))
Proof (Lean source)
lemma measure_eq_sum_observed_cells (mu : Measure Obs) : mu = Measure.sum (fun i : Bool × Bool => mu.restrict (observedCell i.1 i.2)) := by have hs : ∀ i : Bool × Bool, MeasurableSet (observedCell i.1 i.2) := by intro i exact measurableSet_observedCell i.1 i.2 have hdisj : Pairwise (onFun Disjoint (fun i : Bool × Bool => observedCell i.1 i.2)) := by rintro ⟨d, y⟩ ⟨d', y'⟩ hne unfold onFun rw [Set.disjoint_left] intro o ho ho' apply hne ext <;> simp_all [observedCell] have hcover : (⋃ i : Bool × Bool, observedCell i.1 i.2) = univ := by ext o simp only [Set.mem_iUnion, Set.mem_univ, iff_true] exact ⟨(o.2.1, o.2.2), rfl, rfl⟩ have h := Measure.restrict_iUnion (μ := mu) (s := fun i : Bool × Bool => observedCell i.1 i.2) hdisj hs rw [hcover, Measure.restrict_univ] at h exact h
CausalSmith.Stat.RdTruesideNoiseFrontier.measure_eq_sum_observed_cells · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:512
theorem measure_apply_eq_sum_observedCellMeasure

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
sigma :
ℝ
A :
Set Obs
hA :
Pobs L sigma A
= ∑ i : Bool × Bool, observedCellMeasure L sigma i.1 i.2 (observedCellEmbed i.1 i.2 ⁻¹' A)
Proof (Lean source)
lemma measure_apply_eq_sum_observedCellMeasure (L : LatentLaw) (sigma : ℝ) (A : Set Obs) (hA : MeasurableSet A) : Pobs L sigma A = ∑ i : Bool × Bool, observedCellMeasure L sigma i.1 i.2 (observedCellEmbed i.1 i.2 ⁻¹' A) := by conv_lhs => rw [measure_eq_sum_observed_cells (Pobs L sigma)] rw [Measure.sum_apply _ hA, tsum_fintype] apply Finset.sum_congr rfl intro i _ exact (observedCellMeasure_apply_preimage L sigma i.1 i.2 A hA).symm
CausalSmith.Stat.RdTruesideNoiseFrontier.measure_apply_eq_sum_observedCellMeasure · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:535
def observedReference

Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
observedReference :
volume.prod (Measure.count : Measure (Bool × Bool))
CausalSmith.Stat.RdTruesideNoiseFrontier.observedReference · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:546
def altObservedDensity

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
beta b sigma :
ℝ
m :
ℕ
s :
o :
Obs
altObservedDensity beta b sigma m s o :
ℝ
if o.2.1 then witnessTreatedCellConvolution beta b sigma m s o.2.2 o.1 else witnessControlCellConvolution sigma o.1
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:550
theorem witnessControlCellConvolution_continuous

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
sigma :
ℝ
Proof (Lean source)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessControlCellConvolution_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:555
theorem witnessTreatedCellConvolution_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s y :
hb :
b ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma witnessTreatedCellConvolution_measurable (beta b sigma : ℝ) (m : ℕ) (s y : Bool) (hb : b ∈ Ioc (0 : ℝ) 1) : Measurable (witnessTreatedCellConvolution beta b sigma m s y) := by rw [show witnessTreatedCellConvolution beta b sigma m s y = fun w => treatedConvolution sigma w/4 + witnessSign y * witnessSign s * kappa * (b/(m : ℝ)^2)^beta * markedConvolution b m sigma w/2 by funext w exact witnessTreatedCellConvolution_eq beta b sigma m s y hb w] apply StronglyMeasurable.measurable fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessTreatedCellConvolution_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:561
theorem altObservedDensity_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s :
hb :
b ∈ Ioc (0 : ℝ) 1
Measurable (altObservedDensity beta b sigma m s)
Proof (Lean source)
lemma altObservedDensity_measurable (beta b sigma : ℝ) (m : ℕ) (s : Bool) (hb : b ∈ Ioc (0 : ℝ) 1) : Measurable (altObservedDensity beta b sigma m s) := by apply Measurable.ite · exact (measurableSet_singleton true).preimage (measurable_fst.comp measurable_snd) · rw [show (fun x : Obs => witnessTreatedCellConvolution beta b sigma m s x.2.2 x.1) = fun x => if x.2.2 then witnessTreatedCellConvolution beta b sigma m s true x.1 else witnessTreatedCellConvolution beta b sigma m s false x.1 by funext x cases x.2.2 <;> rfl] apply Measurable.ite · exact (measurableSet_singleton true).preimage (measurable_snd.comp measurable_snd) · exact (witnessTreatedCellConvolution_measurable beta b sigma m s true hb).comp measurable_fst · exact (witnessTreatedCellConvolution_measurable beta b sigma m s false hb).comp measurable_fst · exact (witnessControlCellConvolution_continuous sigma).measurable.comp measurable_fst
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedDensity_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:574
theorem altLaw_observed_density

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s :
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
Pobs (altLaw hleg beta b m s hbeta hb hm) sigma
= observedReference.withDensity (fun o => ofReal (altObservedDensity beta b sigma m s o))
Proof (Lean source)
lemma altLaw_observed_density (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (s : Bool) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : Pobs (altLaw hleg beta b m s hbeta hb hm) sigma = observedReference.withDensity (fun o => ofReal (altObservedDensity beta b sigma m s o)) := by let L := altLaw hleg beta b m s hbeta hb hm have hdens : Measurable (fun o : Obs => ofReal (altObservedDensity beta b sigma m s o)) := (altObservedDensity_measurable beta b sigma m s hb).ennreal_ofReal ext A hA rw [measure_apply_eq_sum_observedCellMeasure L sigma A hA] unfold observedReference rw [withDensity_apply _ hA, ← lintegral_indicator hA] rw [lintegral_prod _ (hdens.indicator hA).aemeasurable] simp_rw [lintegral_count, tsum_fintype] rw [lintegral_finset_sum] swap · intro i _ exact ((hdens.comp (measurable_id.prodMk measurable_const)).indicator (hA.preimage (measurable_id.prodMk measurable_const))) apply Finset.sum_congr rfl intro i _ change observedCellMeasure L sigma i.1 i.2 (observedCellEmbed i.1 i.2 ⁻¹' A) = _ rcases i with ⟨d, y⟩ change observedCellMeasure L sigma d y (observedCellEmbed d y ⁻¹' A) = ∫⁻ w : ℝ, (observedCellEmbed d y ⁻¹' A).indicator (fun w => ofReal (altObservedDensity beta b sigma m s (observedCellEmbed d y w))) w have hcellA : MeasurableSet (observedCellEmbed d y ⁻¹' A) := hA.preimage (measurable_id.prodMk (measurable_const.prodMk measurable_const)) rw [lintegral_indicator hcellA] cases d · rw [altLaw_observed_control_cell_density hleg beta b sigma m s y hbeta hb hm hsigma] rw [withDensity_apply] · rfl · exact hA.preimage (measurable_id.prodMk (measurable_const.prodMk measurable_const)) · rw [altLaw_observed_treated_cell_density hleg beta b sigma m s y hbeta hb hm hsigma] rw [withDensity_apply] · rfl · exact hA.preimage (measurable_id.prodMk (measurable_const.prodMk measurable_const))
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_density · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:595
def altObservedLikelihoodRatio

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
beta b sigma :
ℝ
m :
ℕ
o :
Obs
altObservedLikelihoodRatio beta b sigma m o :
ℝ
if o.2.1 then altObservedDensity beta b sigma m true o / altObservedDensity beta b sigma m false o else 1
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedLikelihoodRatio · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:641
theorem altObservedLikelihoodRatio_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma altObservedLikelihoodRatio_measurable (beta b sigma : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) : Measurable (altObservedLikelihoodRatio beta b sigma m) := by unfold altObservedLikelihoodRatio apply Measurable.ite · exact (measurableSet_singleton true).preimage (measurable_fst.comp measurable_snd) · exact (altObservedDensity_measurable beta b sigma m true hb).div (altObservedDensity_measurable beta b sigma m false hb) · fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedLikelihoodRatio_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:649
theorem altObservedDensity_nonneg

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
s :
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
o :
Obs
0 ≤ altObservedDensity beta b sigma m s o
Proof (Lean source)
lemma altObservedDensity_nonneg (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (s : Bool) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) (o : Obs) : 0 ≤ altObservedDensity beta b sigma m s o := by unfold altObservedDensity split · exact (le_trans (div_nonneg (treatedConvolution_pos sigma o.1 hsigma).le (by norm_num)) (witnessTreatedCellConvolution_lower hleg beta b sigma m s o.2.2 hbeta hb hm hsigma o.1)) · unfold witnessControlCellConvolution exact mul_nonneg (by norm_num) (intervalIntegral.integral_nonneg (by norm_num) (fun x _ => phi_nonneg sigma (o.1 - x)))
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedDensity_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:661
theorem altObservedDensity_false_pos_on_treated

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
o :
Obs
ho :
o.2.1 = true
0 < altObservedDensity beta b sigma m false o
Proof (Lean source)
lemma altObservedDensity_false_pos_on_treated (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) (o : Obs) (ho : o.2.1 = true) : 0 < altObservedDensity beta b sigma m false o := by rw [altObservedDensity, if_pos ho] have hlower := witnessTreatedCellConvolution_lower hleg beta b sigma m false o.2.2 hbeta hb hm hsigma o.1 exact lt_of_lt_of_le (div_pos (treatedConvolution_pos sigma o.1 hsigma) (by norm_num)) hlower
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedDensity_false_pos_on_treated · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:676
theorem altObservedDensity_mul_likelihoodRatio

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
o :
Obs
ofReal (altObservedDensity beta b sigma m false o) * ofReal (altObservedLikelihoodRatio beta b sigma m o)
= ofReal (altObservedDensity beta b sigma m true o)
Proof (Lean source)
lemma altObservedDensity_mul_likelihoodRatio (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) (o : Obs) : ofReal (altObservedDensity beta b sigma m false o) * ofReal (altObservedLikelihoodRatio beta b sigma m o) = ofReal (altObservedDensity beta b sigma m true o) := by by_cases hd : o.2.1 = true · rw [altObservedLikelihoodRatio, if_pos hd] rw [ENNReal.ofReal_div_of_pos (altObservedDensity_false_pos_on_treated hleg beta b sigma m hbeta hb hm hsigma o hd)] exact ENNReal.mul_div_cancel (by simp [altObservedDensity_false_pos_on_treated hleg beta b sigma m hbeta hb hm hsigma o hd]) ENNReal.ofReal_ne_top · have hd' : o.2.1 = false := Bool.eq_false_of_not_eq_true hd rw [altObservedLikelihoodRatio, if_neg hd] simp only [ENNReal.ofReal_one, mul_one] unfold altObservedDensity rw [if_neg hd, if_neg hd]
CausalSmith.Stat.RdTruesideNoiseFrontier.altObservedDensity_mul_likelihoodRatio · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:687
theorem altLaw_plus_eq_minus_withDensity

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
Pobs (altLaw hleg beta b m true hbeta hb hm) sigma
= (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma).withDensity (fun o => ofReal (altObservedLikelihoodRatio beta b sigma m o))
Proof (Lean source)
lemma altLaw_plus_eq_minus_withDensity (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : Pobs (altLaw hleg beta b m true hbeta hb hm) sigma = (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma).withDensity (fun o => ofReal (altObservedLikelihoodRatio beta b sigma m o)) := by rw [altLaw_observed_density hleg beta b sigma m true hbeta hb hm hsigma] rw [altLaw_observed_density hleg beta b sigma m false hbeta hb hm hsigma] rw [← withDensity_mul] · congr 1 funext o exact (altObservedDensity_mul_likelihoodRatio hleg beta b sigma m hbeta hb hm hsigma o).symm · exact (altObservedDensity_measurable beta b sigma m false hb).ennreal_ofReal · exact (altObservedLikelihoodRatio_measurable beta b sigma m hb).ennreal_ofReal
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_plus_eq_minus_withDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:708
theorem altLaw_observed_rnDeriv

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
(fun o => ((Pobs (altLaw hleg beta b m true hbeta hb hm) sigma).rnDeriv (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma) o).toReal)
=ᵐ[ Pobs (altLaw hleg beta b m false hbeta hb hm) sigma] altObservedLikelihoodRatio beta b sigma m
Proof (Lean source)
lemma altLaw_observed_rnDeriv (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : (fun o => ((Pobs (altLaw hleg beta b m true hbeta hb hm) sigma).rnDeriv (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma) o).toReal) =ᵐ[ Pobs (altLaw hleg beta b m false hbeta hb hm) sigma] altObservedLikelihoodRatio beta b sigma m := by letI := (altLaw hleg beta b m false hbeta hb hm).prob letI : IsProbabilityMeasure (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma) := Measure.isProbabilityMeasure_map (obs_measurable sigma).aemeasurable rw [altLaw_plus_eq_minus_withDensity hleg beta b sigma m hbeta hb hm hsigma] filter_upwards [Measure.rnDeriv_withDensity (Pobs (altLaw hleg beta b m false hbeta hb hm) sigma) (altObservedLikelihoodRatio_measurable beta b sigma m hb).ennreal_ofReal] with o ho rw [ho, ENNReal.toReal_ofReal] by_cases hd : o.2.1 = true · rw [altObservedLikelihoodRatio, if_pos hd] exact div_nonneg (altObservedDensity_nonneg hleg beta b sigma m true hbeta hb hm hsigma o) (altObservedDensity_nonneg hleg beta b sigma m false hbeta hb hm hsigma o) · simp [altObservedLikelihoodRatio, hd]
CausalSmith.Stat.RdTruesideNoiseFrontier.altLaw_observed_rnDeriv · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:726
def altChiSqReferenceIntegrand

Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
beta b sigma :
ℝ
m :
ℕ
o :
Obs
altChiSqReferenceIntegrand beta b sigma m o :
ℝ
altObservedDensity beta b sigma m false o * (altObservedLikelihoodRatio beta b sigma m o - 1)^2
CausalSmith.Stat.RdTruesideNoiseFrontier.altChiSqReferenceIntegrand · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:751
theorem altChiSqReferenceIntegrand_measurable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma altChiSqReferenceIntegrand_measurable (beta b sigma : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) : Measurable (altChiSqReferenceIntegrand beta b sigma m) := by unfold altChiSqReferenceIntegrand exact (altObservedDensity_measurable beta b sigma m false hb).mul (((altObservedLikelihoodRatio_measurable beta b sigma m hb).sub measurable_const).pow_const 2)
CausalSmith.Stat.RdTruesideNoiseFrontier.altChiSqReferenceIntegrand_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:756
theorem altChiSqReferenceIntegrand_cell

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
w :
ℝ
d y :
altChiSqReferenceIntegrand beta b sigma m (w, d, y)
= if d then (witnessTreatedCellConvolution beta b sigma m true y w - witnessTreatedCellConvolution beta b sigma m false y w)^2 / witnessTreatedCellConvolution beta b sigma m false y w else 0
Proof (Lean source)
lemma altChiSqReferenceIntegrand_cell (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) (w : ℝ) (d y : Bool) : altChiSqReferenceIntegrand beta b sigma m (w, d, y) = if d then (witnessTreatedCellConvolution beta b sigma m true y w - witnessTreatedCellConvolution beta b sigma m false y w)^2 / witnessTreatedCellConvolution beta b sigma m false y w else 0 := by cases d · simp [altChiSqReferenceIntegrand, altObservedLikelihoodRatio, altObservedDensity] · have hq := altObservedDensity_false_pos_on_treated hleg beta b sigma m hbeta hb hm hsigma (w, true, y) rfl have hq' : 0 < witnessTreatedCellConvolution beta b sigma m false y w := by simpa [altObservedDensity] using hq simp only [if_true] change witnessTreatedCellConvolution beta b sigma m false y w * (witnessTreatedCellConvolution beta b sigma m true y w / witnessTreatedCellConvolution beta b sigma m false y w - 1)^2 = _ field_simp [hq'.ne']
CausalSmith.Stat.RdTruesideNoiseFrontier.altChiSqReferenceIntegrand_cell · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:764
theorem altChiSqReferenceIntegrand_integrable

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
Proof (Lean source)
lemma altChiSqReferenceIntegrand_integrable (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : Integrable (altChiSqReferenceIntegrand beta b sigma m) observedReference := by unfold observedReference refine (integrable_prod_iff (altChiSqReferenceIntegrand_measurable beta b sigma m hb).aestronglyMeasurable).2 ⟨Filter.Eventually.of_forall (fun w => Integrable.of_finite), ?_⟩ have hint := witnessTreatedCellConvolution_square_difference_integrable hleg beta b sigma m hbeta hb hm hsigma apply hint.congr filter_upwards [] with w have hden0 : 0 ≤ witnessTreatedCellConvolution beta b sigma m false false w := le_trans (div_nonneg (treatedConvolution_pos sigma w hsigma).le (by norm_num)) (witnessTreatedCellConvolution_lower hleg beta b sigma m false false hbeta hb hm hsigma w) have hden1 : 0 ≤ witnessTreatedCellConvolution beta b sigma m false true w := le_trans (div_nonneg (treatedConvolution_pos sigma w hsigma).le (by norm_num)) (witnessTreatedCellConvolution_lower hleg beta b sigma m false true hbeta hb hm hsigma w) rw [integral_count] simp only [Real.norm_eq_abs, Fintype.sum_prod_type, Fintype.sum_bool] rw [altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w false false, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w false true, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w true false, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w true true] simp only [Bool.false_eq_true, if_false, if_true, abs_zero, zero_add] rw [abs_of_nonneg, abs_of_nonneg] · ring · exact div_nonneg (sq_nonneg _) hden0 · exact div_nonneg (sq_nonneg _) hden1
CausalSmith.Stat.RdTruesideNoiseFrontier.altChiSqReferenceIntegrand_integrable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:787
theorem altLikelihoodRatio_sq_integral_eq

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
beta b sigma :
ℝ
m :
ℕ
hbeta :
beta ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hsigma :
0 < sigma
(∫ o, (altObservedLikelihoodRatio beta b sigma m o - 1)^2 ∂ Pobs (altLaw hleg beta b m false hbeta hb hm) sigma)
= ∫ w : ℝ, ∑ y : Bool, (witnessTreatedCellConvolution beta b sigma m true y w - witnessTreatedCellConvolution beta b sigma m false y w)^2 / witnessTreatedCellConvolution beta b sigma m false y w
Proof (Lean source)
lemma altLikelihoodRatio_sq_integral_eq (hleg : ClassicalLegendreFacts) (beta b sigma : ℝ) (m : ℕ) (hbeta : beta ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hsigma : 0 < sigma) : (∫ o, (altObservedLikelihoodRatio beta b sigma m o - 1)^2 ∂ Pobs (altLaw hleg beta b m false hbeta hb hm) sigma) = ∫ w : ℝ, ∑ y : Bool, (witnessTreatedCellConvolution beta b sigma m true y w - witnessTreatedCellConvolution beta b sigma m false y w)^2 / witnessTreatedCellConvolution beta b sigma m false y w := by rw [altLaw_observed_density hleg beta b sigma m false hbeta hb hm hsigma] rw [integral_withDensity_eq_integral_toReal_smul (altObservedDensity_measurable beta b sigma m false hb).ennreal_ofReal (Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top)] have hnonneg : ∀ o, 0 ≤ altObservedDensity beta b sigma m false o := altObservedDensity_nonneg hleg beta b sigma m false hbeta hb hm hsigma simp_rw [ENNReal.toReal_ofReal (hnonneg _)] simp only [smul_eq_mul] change (∫ o, altChiSqReferenceIntegrand beta b sigma m o ∂observedReference) = _ unfold observedReference rw [integral_prod _ (altChiSqReferenceIntegrand_integrable hleg beta b sigma m hbeta hb hm hsigma)] apply integral_congr_ae filter_upwards [] with w rw [integral_count] simp only [Fintype.sum_prod_type, Fintype.sum_bool] rw [altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w false false, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w false true, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w true false, altChiSqReferenceIntegrand_cell hleg beta b sigma m hbeta hb hm hsigma w true true] simp [Fintype.sum_bool]
CausalSmith.Stat.RdTruesideNoiseFrontier.altLikelihoodRatio_sq_integral_eq · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ObservedCellDensity.lean:821
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.PopulationBias 7 declarations Positive normalized kernels preserve density and mean bounds, and the mean Hölder condition gives the population ratio bias in FC.2–FC.3.

Population endpoint-kernel bias

Positive normalized kernels preserve density and mean bounds, and the mean Hölder condition gives the population ratio bias in FC.2–FC.3.

theorem endpointKernel_weighted_integral_bounds Lemma endpointKernel_weighted_integral_bounds in the paper ↗

A normalized positive endpoint kernel preserves pointwise density bounds (FC.2). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
f :
ℝ → ℝ
hf :
ContinuousOn f (Icc (0 : ℝ) 1)
a b :
ℝ
hbounds :
∀ x ∈ Icc (0 : ℝ) 1, a ≤ f x ∧ f x ≤ b
conclusion 1
a ≤ (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x)
conclusion 2
(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x) ≤ b
Proof (Lean source)
lemma endpointKernel_weighted_integral_bounds (L : ℕ) (hL : 1 ≤ L) (f : ℝ → ℝ) (hf : ContinuousOn f (Icc (0 : ℝ) 1)) (a b : ℝ) (hbounds : ∀ x ∈ Icc (0 : ℝ) 1, a ≤ f x ∧ f x ≤ b) : a ≤ (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x) ∧ (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x) ≤ b := by have hK : ContinuousOn (fun x => (endpointKernel L).eval x) (Icc (0 : ℝ) 1) := by fun_prop have hi := (hK.mul hf).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) (μ := volume) have hia := (hK.mul (continuousOn_const (c := a))).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) (μ := volume) have hib := (hK.mul (continuousOn_const (c := b))).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) (μ := volume) have hlo := intervalIntegral.integral_mono_on (by norm_num : (0 : ℝ) ≤ 1) hia hi (fun x hx => mul_le_mul_of_nonneg_left (hbounds x hx).1 (endpointKernel_nonneg L x hx)) have hhi := intervalIntegral.integral_mono_on (by norm_num : (0 : ℝ) ≤ 1) hi hib (fun x hx => mul_le_mul_of_nonneg_left (hbounds x hx).2 (endpointKernel_nonneg L x hx)) simpa only [Pi.mul_apply, intervalIntegral.integral_mul_const, endpointKernel_integral_one L hL, one_mul] using intro hlo hhi
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_weighted_integral_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:24

Reflecting either arm sends its unit interval into the full latent score interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
x :
ℝ
hx :
x ∈ Icc (0 : ℝ) 1
sgn d * x ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma arm_reflection_mem (d : Bool) {x : ℝ} (hx : x ∈ Icc (0 : ℝ) 1) : sgn d * x ∈ Icc (-1 : ℝ) 1 := by cases d <;> simp only [sgn, Bool.false_eq_true, if_false, if_true, neg_one_mul, one_mul] all_goals constructor <;> linarith [hx.1, hx.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.arm_reflection_mem · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:44
theorem continuousOn_arm_reflection Lemma continuousOn_arm_reflection in the paper ↗

Continuous latent versions stay continuous after restriction and arm reflection. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
f :
ℝ → ℝ
hf :
ContinuousOn f (Icc (-1 : ℝ) 1)
ContinuousOn (fun x => f (sgn d * x)) (Icc (0 : ℝ) 1)
Proof (Lean source)
lemma continuousOn_arm_reflection (d : Bool) (f : ℝ → ℝ) (hf : ContinuousOn f (Icc (-1 : ℝ) 1)) : ContinuousOn (fun x => f (sgn d * x)) (Icc (0 : ℝ) 1) := by exact hf.comp (by fun_prop) (fun x hx => arm_reflection_mem d hx)
CausalSmith.Stat.RdTruesideNoiseFrontier.continuousOn_arm_reflection · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:50
theorem arm_kernel_density_bounds Lemma arm_kernel_density_bounds in the paper ↗

The FC.1 unmarked integral lies between one quarter and three quarters on either arm. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
hP :
d :
L :
ℕ
hL :
1 ≤ L
(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x)) ∈ Icc (1/4 : ℝ) (3/4)
Proof (Lean source)
lemma arm_kernel_density_bounds (P : LatentLaw) (hP : DensityBounds P) (d : Bool) (L : ℕ) (hL : 1 ≤ L) : (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x)) ∈ Icc (1/4 : ℝ) (3/4) := by exact endpointKernel_weighted_integral_bounds L hL _ (continuousOn_arm_reflection d P.f P.f_cont) _ _ (fun x hx => hP _ (arm_reflection_mem d hx))
CausalSmith.Stat.RdTruesideNoiseFrontier.arm_kernel_density_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:56
theorem endpointKernel_weighted_mean_bounds Lemma endpointKernel_weighted_mean_bounds in the paper ↗

A positive density-weighted kernel average preserves the potential-mean range. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
f v :
ℝ → ℝ
hf :
ContinuousOn f (Icc (0 : ℝ) 1)
hv :
ContinuousOn v (Icc (0 : ℝ) 1)
hfb :
∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ f x ∧ f x ≤ 3/4
hvb :
∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ v x ∧ v x ≤ 3/4
((∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * v x) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x)) ∈ Icc (1/4 : ℝ) (3/4)
Proof (Lean source)
lemma endpointKernel_weighted_mean_bounds (L : ℕ) (hL : 1 ≤ L) (f v : ℝ → ℝ) (hf : ContinuousOn f (Icc (0 : ℝ) 1)) (hv : ContinuousOn v (Icc (0 : ℝ) 1)) (hfb : ∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ f x ∧ f x ≤ 3/4) (hvb : ∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ v x ∧ v x ≤ 3/4) : ((∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * v x) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x)) ∈ Icc (1/4 : ℝ) (3/4) := by have hK : ContinuousOn (fun x => (endpointKernel L).eval x) (Icc (0 : ℝ) 1) := by fun_prop have hW := hK.mul hf have hB := endpointKernel_weighted_integral_bounds L hL f hf _ _ hfb have hBp : 0 < ∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x := by linarith [hB.1] have hi := (hW.mul hv).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) (μ := volume) have hlo := intervalIntegral.integral_mono_on (by norm_num : (0 : ℝ) ≤ 1) ((hW.mul (continuousOn_const (c := (1/4 : ℝ)))).intervalIntegrable_of_Icc (by norm_num)) hi (fun x hx => mul_le_mul_of_nonneg_left (hvb x hx).1 (mul_nonneg (endpointKernel_nonneg L x hx) (by linarith [(hfb x hx).1]))) have hhi := intervalIntegral.integral_mono_on (by norm_num : (0 : ℝ) ≤ 1) hi ((hW.mul (continuousOn_const (c := (3/4 : ℝ)))).intervalIntegrable_of_Icc (by norm_num)) (fun x hx => mul_le_mul_of_nonneg_left (hvb x hx).2 (mul_nonneg (endpointKernel_nonneg L x hx) (by linarith [(hfb x hx).1]))) simp only [Pi.mul_apply, intervalIntegral.integral_mul_const] at hlo hhi exact ⟨(le_div_iff₀ hBp).mpr (by simpa only [mul_comm] using hlo), (div_le_iff₀ hBp).mpr (by simpa only [mul_comm] using hhi)⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_weighted_mean_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:65
theorem endpointKernel_weighted_mean_bias Lemma endpointKernel_weighted_mean_bias in the paper ↗

The density and Hölder envelopes imply the six-times-moment population bias (FC.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
β :
ℝ
hβ :
0 ≤ β
f v :
ℝ → ℝ
hf :
ContinuousOn f (Icc (0 : ℝ) 1)
hv :
ContinuousOn v (Icc (0 : ℝ) 1)
hfb :
∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ f x ∧ f x ≤ 3/4
hmod :
∀ x ∈ Icc (0 : ℝ) 1, |v x - v 0| ≤ 2 * x ^ β
|(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * v x) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x)
- v 0|
≤ 6 * kernelMoment L β
Proof (Lean source)
lemma endpointKernel_weighted_mean_bias (L : ℕ) (hL : 1 ≤ L) (β : ℝ) (hβ : 0 ≤ β) (f v : ℝ → ℝ) (hf : ContinuousOn f (Icc (0 : ℝ) 1)) (hv : ContinuousOn v (Icc (0 : ℝ) 1)) (hfb : ∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ f x ∧ f x ≤ 3/4) (hmod : ∀ x ∈ Icc (0 : ℝ) 1, |v x - v 0| ≤ 2 * x ^ β) : |(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * v x) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x) - v 0| ≤ 6 * kernelMoment L β := by let B := ∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x have hB := endpointKernel_weighted_integral_bounds L hL f hf _ _ hfb have hBp : 0 < B := by dsimp [B]; linarith [hB.1] have hK : ContinuousOn (fun x => (endpointKernel L).eval x) (Icc (0 : ℝ) 1) := by fun_prop have hW := hK.mul hf have hpow : ContinuousOn (fun x : ℝ => x ^ β) (Icc (0 : ℝ) 1) := continuousOn_id.rpow_const (fun x hx => inr hβ) have hdiff := hW.mul (hv.sub (continuousOn_const (c := v 0))) have hi : IntervalIntegrable (fun x => (endpointKernel L).eval x * f x * v x) volume 0 1 := by simpa only [Pi.mul_def] using (hW.mul hv).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) have hi0 : IntervalIntegrable (fun x => (endpointKernel L).eval x * f x * v 0) volume 0 1 := by simpa only [Pi.mul_def] using (hW.mul (continuousOn_const (c := v 0))).intervalIntegrable_of_Icc (by norm_num : (0 : ℝ) ≤ 1) have hid : (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * v x) / B - v 0 = (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * (v x - v 0)) / B := by rw [show (fun x => (endpointKernel L).eval x * f x * (v x - v 0)) = (fun x => (endpointKernel L).eval x * f x * v x - (endpointKernel L).eval x * f x * v 0) by funext x; ring] -- `integral_linearity` does not normalize this interval integral. rw [intervalIntegral.integral_sub hi hi0, intervalIntegral.integral_mul_const] have hBn : (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x) ≠ 0 := ne_of_gt hBp dsimp [B] field_simp [hBn] have hnum : |∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * f x * (v x - v 0)| ≤ (3/2) * kernelMoment L β := by apply (intervalIntegral.abs_integral_le_integral_abs (by norm_num)).trans have hm := intervalIntegral.integral_mono_on (by norm_num : (0 : ℝ) ≤ 1) (hdiff.abs.intervalIntegrable_of_Icc (by norm_num) (μ := volume)) (((hpow.mul hK).const_mul (3/2)).intervalIntegrable_of_Icc (by norm_num)) (fun x hx => ?_) · simpa only [Pi.mul_apply, Pi.sub_apply, intervalIntegral.integral_const_mul, kernelMoment] using hm · have hK0 := endpointKernel_nonneg L x hx have hf0 : 0 ≤ f x := by linarith [(hfb x hx).1] change |(endpointKernel L).eval x * f x * (v x - v 0)| ≤ (3/2) * (x ^ β * (endpointKernel L).eval x) rw [abs_mul, abs_of_nonneg (mul_nonneg hK0 hf0)] calc _ ≤ ((endpointKernel L).eval x * f x) * (2 * x ^ β) := mul_le_mul_of_nonneg_left (hmod x hx) (mul_nonneg hK0 hf0) _ ≤ _ := by have hh := mul_le_mul_of_nonneg_left (hfb x hx).2 (mul_nonneg hK0 (Real.rpow_nonneg hx.1 β)) nlinarith have hM : 0 ≤ kernelMoment L β := intervalIntegral.integral_nonneg (by norm_num) (fun x hx => mul_nonneg (Real.rpow_nonneg hx.1 β) (endpointKernel_nonneg L x hx)) rw [hid, abs_div, abs_of_pos hBp] apply (div_le_iff₀ hBp).mpr have hb : 1/4 ≤ B := hB.1 nlinarith [mul_le_mul_of_nonneg_left hb (show 0 ≤ 6 * kernelMoment L β by positivity)]
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_weighted_mean_bias · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:93
theorem arm_kernel_mean_bounds_and_bias Lemma arm_kernel_mean_bounds_and_bias in the paper ↗

Each FC.1 weighted potential mean is interior and approximates its cutoff trace (FC.3). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
β σ :
ℝ
hP :
Model β σ P
hβ :
0 ≤ β
d :
L :
ℕ
hL :
1 ≤ L
a :
(∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x) * P.mu d (sgn d * x)) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x))
a ∈ Icc (1/4 : ℝ) (3/4)
|a - P.mu d 0| ≤ 6 * kernelMoment L β
Proof (Lean source)
lemma arm_kernel_mean_bounds_and_bias (P : LatentLaw) (β σ : ℝ) (hP : Model β σ P) (hβ : 0 ≤ β) (d : Bool) (L : ℕ) (hL : 1 ≤ L) : let a := (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x) * P.mu d (sgn d * x)) / (∫ x in (0 : ℝ)..1, (endpointKernel L).eval x * P.f (sgn d * x)) a ∈ Icc (1/4 : ℝ) (3/4) ∧ |a - P.mu d 0| ≤ 6 * kernelMoment L β := by have hf := continuousOn_arm_reflection d P.f P.f_cont have hv := continuousOn_arm_reflection d (P.mu d) (P.mu_cont d) have hfb : ∀ x ∈ Icc (0 : ℝ) 1, 1/4 ≤ P.f (sgn d * x) ∧ P.f (sgn d * x) ≤ 3/4 := fun x hx => hP.density _ (arm_reflection_mem d hx) constructor · exact endpointKernel_weighted_mean_bounds L hL _ _ hf hv hfb (fun x hx => hP.means d _ (arm_reflection_mem d hx)) · have hmod : ∀ x ∈ Icc (0 : ℝ) 1, |P.mu d (sgn d * x) - P.mu d (sgn d * 0)| ≤ 2 * x ^ β := by intro x hx have h := hP.holder d _ (arm_reflection_mem d hx) 0 (by norm_num) have habs : |sgn d * x| = x := by cases d <;> simp [sgn, abs_of_nonneg hx.1] simpa only [mul_zero, sub_zero, habs] using h simpa only [mul_zero] using endpointKernel_weighted_mean_bias L hL β hβ _ _ hf hv hfb hmod
CausalSmith.Stat.RdTruesideNoiseFrontier.arm_kernel_mean_bounds_and_bias · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/PopulationBias.lean:155
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Procedure 35 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

def chebyshev

Chebyshev polynomial normalized by its cosine identity. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
chebyshev L :
T ℝ L
def endpointF

The polynomial quotient fills the removable singularity at zero. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
endpointF L :
C (1/2) * Polynomial.divX (1 - (chebyshev L).comp (1 - C 2 * X))
def endpointKernel

Normalized cube of the endpoint quotient. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
endpointKernel L :
C ((∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3)⁻¹) * endpointF L ^ 3
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:35
def kernelDegree

Degree of the positive endpoint kernel. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
kernelDegree L :
ℕ
3 * (L - 1)
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelDegree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:39
def polyDeriv

Iterated ordinary polynomial derivative. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
j :
ℕ
p :
polyDeriv j p :
(derivative^[j]) p
def inverseHeat

Finite inverse heat transform, with the exact factorial coefficients. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
σ :
ℝ
inverseHeat L σ :
∑ k ∈ range (kernelDegree L / 2 + 1), C ((-σ ^ 2 / 2) ^ k / (Nat.factorial k : ℝ)) * polyDeriv (2 * k) (endpointKernel L)
CausalSmith.Stat.RdTruesideNoiseFrontier.inverseHeat · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:43
def markedAvg

Marked arm average. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
L :
ℕ
σ :
ℝ
n :
ℕ
s :
Sample n
markedAvg d L σ s :
ℝ
(n : ℝ)⁻¹ * ∑ i, (if (s i).2.1 = d then 1 else 0) * bit (s i).2.2 * (inverseHeat L σ).eval (sgn d * (s i).1)
def unmarkedAvg

Unmarked arm average. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
L :
ℕ
σ :
ℝ
n :
ℕ
s :
Sample n
unmarkedAvg d L σ s :
ℝ
(n : ℝ)⁻¹ * ∑ i, (if (s i).2.1 = d then 1 else 0) * (inverseHeat L σ).eval (sgn d * (s i).1)
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarkedAvg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:52

Denominator floor and ordinary projection onto the interior mean range. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
L :
ℕ
σ :
ℝ
n :
ℕ
s :
Sample n
armRatio d L σ s :
ℝ
max (1/4) (min (3/4) (markedAvg d L σ s / max (unmarkedAvg d L σ s) (1/8)))
def markedMean

Marked population mean. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
L :
ℕ
σ :
ℝ
P :
n :
ℕ
markedMean d L σ P n :
ℝ
∫ z, markedAvg d L σ z.1 ∂experiment P σ n
CausalSmith.Stat.RdTruesideNoiseFrontier.markedMean · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:60

Unmarked population mean. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
d :
L :
ℕ
σ :
ℝ
P :
n :
ℕ
unmarkedMean d L σ P n :
ℝ
∫ z, unmarkedAvg d L σ z.1 ∂experiment P σ n
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarkedMean · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:63

Exact public bias moment. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
β :
ℝ
kernelMoment L β :
ℝ
∫ x in (0 : ℝ)..1, x ^ β * (endpointKernel L).eval x
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelMoment · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:66

Exact finite covariance cost. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
σ :
ℝ
kernelVariance L σ :
ℝ
3/4 * ∑ j ∈ range (kernelDegree L + 1), σ ^ (2 * j) / (Nat.factorial j : ℝ) * ∫ x in (0 : ℝ)..1, ((polyDeriv j (endpointKernel L)).eval x) ^ 2
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:69

The observable effect estimate includes the zero-degree fallback. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
ℕ
σ :
ℝ
n :
ℕ
z :
thetaHat L σ z :
ℝ
if L = 0 then 0 else armRatio true L σ z.1 - armRatio false L σ z.1
def radius

The public bias-aware radius includes the fallback. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
radius β n σ L :
ℝ
if L
= 0 then 1/2 else 12 * kernelMoment L β + 28 * sqrt (40 * kernelVariance L σ / n)
def Lmax

Public finite cap. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
Lmax β n :
ℕ
⌈(n : ℝ) ^ (1 / (4 * β + 2))⌉₊
def minimizingDegrees

Minimizers of the public radius over the finite candidate set. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
minimizingDegrees β n σ :
Finset ℕ
(range (Lmax β n + 1)).filter fun L
=> ∀ J ∈ range (Lmax β n + 1), radius β n σ L ≤ radius β n σ J
CausalSmith.Stat.RdTruesideNoiseFrontier.minimizingDegrees · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:83
theorem minimizingDegrees_nonempty Lemma minimizingDegrees_nonempty in the paper ↗

A finite nonempty candidate set has a radius minimizer. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
(minimizingDegrees β n σ).Nonempty
Proof (Lean source)
lemma minimizingDegrees_nonempty (β : ℝ) (n : ℕ) (σ : ℝ) : (minimizingDegrees β n σ).Nonempty := by classical have hne : (range (Lmax β n + 1)).Nonempty := ⟨0, by simp⟩ obtain ⟨L, hL, hmin⟩ := Finset.exists_min_image (range (Lmax β n + 1)) (radius β n σ) hne refine ⟨L, ?_⟩ simpa only [minimizingDegrees, mem_filter] using intro hL hmin
CausalSmith.Stat.RdTruesideNoiseFrontier.minimizingDegrees_nonempty · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:87
def selectedDegree

Smallest public minimizer, formed structurally from the finite set. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
selectedDegree β n σ :
ℕ
CausalSmith.Stat.RdTruesideNoiseFrontier.selectedDegree · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:96

The exactly evaluable certificate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
certificate β n σ :
ℝ
radius β n σ (selectedDegree β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.certificate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:99
def polyLo

Clipped lower endpoint. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
z :
polyLo β n σ L z :
ℝ
max (-1) (thetaHat L σ z - radius β n σ L)
def polyHi

Clipped upper endpoint. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
z :
polyHi β n σ L z :
ℝ
min 1 (thetaHat L σ z + radius β n σ L)

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n L :
ℕ
σ :
ℝ
Measurable (@thetaHat L σ n)
Proof (Lean source)
@[fun_prop] lemma thetaHat_measurable (n L : ℕ) (σ : ℝ) : Measurable (@thetaHat L σ n) := by have hbit : Measurable bit := measurable_of_countable bit have hcell (d : Bool) (i : Fin n) : Measurable (fun z : Input n => if (z.1 i).2.1 = d then (1 : ℝ) else 0) := by exact (measurable_of_countable (fun y : Bool => if y = d then (1 : ℝ) else 0)).comp ((measurable_pi_apply i).comp measurable_fst |>.snd.fst) have hmark (d : Bool) : Measurable (fun z : Input n => markedAvg d L σ z.1) := by unfold markedAvg fun_prop have hunmark (d : Bool) : Measurable (fun z : Input n => unmarkedAvg d L σ z.1) := by unfold unmarkedAvg fun_prop unfold thetaHat by_cases hL : L = 0 · simp only [if_pos hL] fun_prop · simp only [if_neg hL] unfold armRatio fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:108

The endpoint quotient is nonnegative, including its removable endpoint. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x ∈ Icc (0 : ℝ) 1 :
0 ≤ (endpointF L).eval x
Proof (Lean source)
lemma endpointF_nonneg (L : ℕ) : ∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ (endpointF L).eval x := by have hpos : Ioc (0 : ℝ) 1 ⊆ {x | 0 ≤ (endpointF L).eval x} := by intro x hx have hc : (chebyshev L).eval (1 - 2*x) ≤ 1 := by rw [chebyshev, ← Real.cos_arccos (show -1 ≤ 1 - 2*x by linarith [hx.2]) (show 1 - 2*x ≤ 1 by linarith [hx.1])] rw [Polynomial.Chebyshev.T_real_cos] exact Real.cos_le_one _ have hid := congrArg (fun p : Polynomial ℝ => p.eval x) (Polynomial.X_mul_divX_add (1 - (chebyshev L).comp (1 - C 2 * X))) have hz : (1 - (chebyshev L).comp (1 - C 2 * X)).coeff 0 = 0 := by simp [Polynomial.coeff_zero_eq_eval_zero, chebyshev] simp only [Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_X, Polynomial.eval_C, Polynomial.eval_sub, Polynomial.eval_one, Polynomial.eval_comp, hz] at hid have hdiv : 0 ≤ (Polynomial.divX (1 - (chebyshev L).comp (1 - C 2 * X))).eval x := by nlinarith [hx.1] change 0 ≤ (endpointF L).eval x simpa only [endpointF, Polynomial.eval_mul, Polynomial.eval_C] using mul_nonneg (show (0 : ℝ) ≤ 1/2 by norm_num) hdiv have hclosed : IsClosed {x | 0 ≤ (endpointF L).eval x} := isClosed_le continuous_const (endpointF L).continuous have hclosure := hclosed.closure_subset_iff.mpr hpos rw [closure_Ioc (show (0 : ℝ) ≠ 1 by norm_num)] at hclosure exact hclosure
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointF_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:129

Normalizing a nonnegative cube preserves nonnegativity even at degree zero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
x ∈ Icc (0 : ℝ) 1 :
0 ≤ (endpointKernel L).eval x
Proof (Lean source)
lemma endpointKernel_nonneg (L : ℕ) : ∀ x ∈ Icc (0 : ℝ) 1, 0 ≤ (endpointKernel L).eval x := by have hi : 0 ≤ ∫ t in (0 : ℝ)..1, (endpointF L).eval t ^ 3 := intervalIntegral.integral_nonneg (by norm_num) (fun t ht => pow_nonneg (endpointF_nonneg L t ht) _) intro x hx simp only [endpointKernel, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_pow] exact mul_nonneg (inv_nonneg.mpr hi) (pow_nonneg (endpointF_nonneg L x hx) _)
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:157

The bias moment is nonnegative for every real smoothness exponent. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
β :
ℝ
0 ≤ kernelMoment L β
Proof (Lean source)
lemma kernelMoment_nonneg (L : ℕ) (β : ℝ) : 0 ≤ kernelMoment L β := by apply intervalIntegral.integral_nonneg (by norm_num) intro x hx exact mul_nonneg (Real.rpow_nonneg hx.1 _) (endpointKernel_nonneg L x hx)
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelMoment_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:167

Every public radius is nonnegative, including the fallback. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
0 ≤ radius β n σ L
Proof (Lean source)
lemma radius_nonneg (β : ℝ) (n : ℕ) (σ : ℝ) (L : ℕ) : 0 ≤ radius β n σ L := by unfold radius split_ifs · norm_num · exact add_nonneg (mul_nonneg (by norm_num) (kernelMoment_nonneg L β)) (mul_nonneg (by norm_num) (Real.sqrt_nonneg _))
CausalSmith.Stat.RdTruesideNoiseFrontier.radius_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:173

Clipping the two arm ratios keeps the estimated contrast in its target range. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
σ :
ℝ
n :
ℕ
z :
conclusion 1
-(1/2 : ℝ) ≤ thetaHat L σ z
conclusion 2
thetaHat L σ z ≤ 1/2
Proof (Lean source)
lemma thetaHat_bounds (L : ℕ) (σ : ℝ) {n : ℕ} (z : Input n) : -(1/2 : ℝ) ≤ thetaHat L σ z ∧ thetaHat L σ z ≤ 1/2 := by have ha (d : Bool) : (1/4 : ℝ) ≤ armRatio d L σ z.1 ∧ armRatio d L σ z.1 ≤ 3/4 := by unfold armRatio exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ unfold thetaHat split_ifs · norm_num · constructor <;> linarith [(ha true).1, (ha true).2, (ha false).1, (ha false).2]
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:181
theorem polyInterval_properties Lemma polyInterval_properties in the paper ↗

Clipped interval endpoints are measurable and always ordered inside the target range. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
conclusion 1
Measurable (polyLo β n σ L)
conclusion 2
Measurable (polyHi β n σ L)
conclusion 3
z :
-1 ≤ polyLo β n σ L z
polyLo β n σ L z ≤ polyHi β n σ L z
polyHi β n σ L z ≤ 1
Proof (Lean source)
lemma polyInterval_properties (β : ℝ) (n : ℕ) (σ : ℝ) (L : ℕ) : Measurable (polyLo β n σ L) ∧ Measurable (polyHi β n σ L) ∧ ∀ z, -1 ≤ polyLo β n σ L z ∧ polyLo β n σ L z ≤ polyHi β n σ L z ∧ polyHi β n σ L z ≤ 1 := by refine ⟨?_, ?_, ?_⟩ · unfold polyLo fun_prop · unfold polyHi fun_prop · intro z have hr := radius_nonneg β n σ L have ht := thetaHat_bounds L σ z refine ⟨le_max_left _ _, ?_, min_le_left _ _⟩ apply max_le · apply le_min <;> linarith [ht.1] · apply le_min <;> linarith [ht.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_properties · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:192

The total connected closed interval, including the constant fallback interval. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
polyInterval β n σ L :
⟨polyLo β n σ L, polyHi β n σ L, (polyInterval_properties β n σ L).1, (polyInterval_properties β n σ L).2.1, (polyInterval_properties β n σ L).2.2⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:209
def attainer

The selected measurable estimate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
attainer β n σ :
⟨thetaHat (selectedDegree β n σ) σ, thetaHat_measurable n _ σ⟩

The selected interval procedure; its honesty is proved later. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
honestAttainer β n σ :
polyInterval β n σ (selectedDegree β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.honestAttainer · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:217
def publicSelection

Public finite selection returns the observable estimate and interval. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
publicSelection β n σ :
(attainer β n σ, honestAttainer β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.publicSelection · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:220

Extended worst risk of the selected procedure. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
attainerRisk β n σ :
ℝ≥0∞
worstCaseRiskENNReal (fun (T : Estimator n) (P : {P // Model β σ P}) => absRisk P.val σ n T.val) (attainer β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.attainerRisk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:224

Extended worst expected length of the selected interval. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
attainerLength β n σ :
ℝ≥0∞
worstCaseRiskENNReal (fun (I : IntervalProc n) (P : {P // Model β σ P}) => expectedLength P.val σ n I) (honestAttainer β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.attainerLength · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Procedure.lean:229
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Rate 19 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

def noiseCost

Piecewise continuous endpoint noise cost. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
h σ :
ℝ
noiseCost h σ :
ℝ
if σ
≤ h then 0 else if σ ^ 4 ≤ h then (σ / h) ^ (2 / 3 : ℝ)
- 1 else h ^ (-1 / 2 : ℝ) * (1 + log (σ ^ 2 / sqrt h))
- 1
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:27
def directResolution

Noiseless endpoint resolution. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
directResolution β n :
ℝ
(n : ℝ) ^ (-1 / (2 * β + 1))
CausalSmith.Stat.RdTruesideNoiseFrontier.directResolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:31
def rateResolution

A supremum construction of the root, whose existence and uniqueness are proof obligations. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
rateResolution β n σ :
ℝ
sSup {h ∈ Icc (directResolution β n) 1 | log n + (2 * β + 1) * log h - noiseCost h σ ≤ 0}
CausalSmith.Stat.RdTruesideNoiseFrontier.rateResolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:33
def frontierRate

Endpoint frontier rate. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
frontierRate β n σ :
ℝ
rateResolution β n σ ^ β
CausalSmith.Stat.RdTruesideNoiseFrontier.frontierRate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:37
def uniformRate

Rate and selected observable procedures. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
uniformRate β n σ :
ℝ × Estimator n × IntervalProc n
(frontierRate β n σ, attainer β n σ, honestAttainer β n σ)
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformRate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:40

Each branch of the public noise cost is nonnegative on its stated domain. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h σ :
ℝ
hh :
h ∈ Ioc (0 : ℝ) 1
hσ :
σ ∈ Icc (0 : ℝ) 1
0 ≤ noiseCost h σ
Proof (Lean source)
lemma noiseCost_nonneg (h σ : ℝ) (hh : h ∈ Ioc (0 : ℝ) 1) (hσ : σ ∈ Icc (0 : ℝ) 1) : 0 ≤ noiseCost h σ := by unfold noiseCost split_ifs with hdirect hpower · exact le_rfl · have hratio : 1 ≤ σ / h := (le_div_iff₀ hh.1).2 (by linarith) have hpow := Real.one_le_rpow hratio (by norm_num : (0 : ℝ) ≤ 2/3) linarith · have hsqrt : sqrt h ≤ σ ^ 2 := by have hsq := Real.sq_sqrt hh.1.le have hroot := Real.sqrt_nonneg h have hfour : h < (σ ^ 2)^2 := by calc h < σ ^ 4 := lt_of_not_ge hpower _ = (σ ^ 2)^2 := by ring nlinarith [sq_nonneg σ] have hlog : 0 ≤ log (σ ^ 2 / sqrt h) := Real.log_nonneg ((le_div_iff₀ (Real.sqrt_pos.2 hh.1)).2 (by simpa using hsqrt)) have hfactor : 1 ≤ h ^ (-1 / 2 : ℝ) := Real.one_le_rpow_of_pos_of_le_one_of_nonpos hh.1 hh.2 (by norm_num) have hproduct : 1 ≤ h ^ (-1 / 2 : ℝ) * (1 + log (σ ^ 2 / sqrt h)) := by calc 1 = 1 * 1 := by norm_num _ ≤ _ := mul_le_mul hfactor (by linarith) (by norm_num) (by linarith) linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_nonneg · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:44
theorem noiseCost_compact_interface Lemma noiseCost_compact_interface in the paper ↗

The two nonzero cost branches agree at the compact-support interface. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hσ :
0 < σ
(σ / σ^4) ^ (2/3 : ℝ) - 1
= (σ^4) ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt (σ^4))) - 1
Proof (Lean source)
lemma noiseCost_compact_interface (σ : ℝ) (hσ : 0 < σ) : (σ / σ^4) ^ (2/3 : ℝ) - 1 = (σ^4) ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt (σ^4))) - 1 := by have hsqrt : sqrt (σ^4) = σ^2 := by rw [show σ^4 = (σ^2)^2 by ring, Real.sqrt_sq (sq_nonneg σ)] rw [hsqrt, div_self (pow_ne_zero 2 hσ.ne'), Real.log_one] simp only [add_zero, mul_one] congr 1 rw [Real.div_rpow hσ.le (pow_nonneg hσ.le 4), ← Real.rpow_natCast σ 4, ← Real.rpow_mul hσ.le, ← Real.rpow_sub hσ, ← Real.rpow_mul hσ.le] congr 1 <;> norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_compact_interface · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:69

Gluing the explicit branches gives continuity on the positive resolution domain. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hσ :
σ ∈ Icc (0 : ℝ) 1
ContinuousOn (fun h => noiseCost h σ) (Ioc 0 1)
Proof (Lean source)
lemma noiseCost_continuousOn (σ : ℝ) (hσ : σ ∈ Icc (0 : ℝ) 1) : ContinuousOn (fun h => noiseCost h σ) (Ioc 0 1) := by by_cases hz : σ = 0 · subst σ exact (continuousOn_const : ContinuousOn (fun _ : ℝ => (0 : ℝ)) (Ioc 0 1)).congr (fun h hh => by simp [noiseCost, hh.1.le]) have hpos : 0 < σ := lt_of_le_of_ne hσ.1 (Ne.symm hz) have hc : Continuous (fun h : Ioi (0 : ℝ) => noiseCost h σ) := by unfold noiseCost apply continuous_if_le (by fun_prop) (by fun_prop) (by fun_prop) · apply Continuous.continuousOn apply continuous_if_le (by fun_prop) (by fun_prop) · have : Continuous (fun h : Ioi (0 : ℝ) => (σ / (h : ℝ)) ^ (2/3 : ℝ) - 1) := by exact ((continuous_const.div continuous_subtype_val (fun h => h.property.ne')).rpow_const (fun _ => inr (by norm_num))).sub continuous_const exact this.continuousOn · have : Continuous (fun h : Ioi (0 : ℝ) => (h : ℝ) ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt (h : ℝ))) - 1) := by have hne : ∀ h : Ioi (0 : ℝ), (h : ℝ) ≠ 0 := fun h => h.property.ne' have hsqrt : ∀ h : Ioi (0 : ℝ), sqrt (h : ℝ) ≠ 0 := fun h => (Real.sqrt_pos.2 h.property).ne' have hp : Continuous (fun h : Ioi (0 : ℝ) => (h : ℝ) ^ (-1/2 : ℝ)) := continuous_subtype_val.rpow_const (fun h => inl (hne h)) have hl : Continuous (fun h : Ioi (0 : ℝ) => log (σ^2 / sqrt (h : ℝ))) := (continuous_const.div (Real.continuous_sqrt.comp continuous_subtype_val) hsqrt).log (fun h => div_ne_zero (pow_ne_zero 2 hpos.ne') (hsqrt h)) exact (hp.mul (continuous_const.add hl)).sub continuous_const exact this.continuousOn · intro h heq simpa only [← heq] using noiseCost_compact_interface σ hpos · intro h heq have hfour : σ^4 ≤ σ := by calc σ^4 ≤ σ^1 := pow_le_pow_of_le_one hσ.1 hσ.2 (by omega) _ = σ := pow_one _ simp [← heq, hfour, div_self hpos.ne'] exact (continuousOn_iff_continuous_restrict.mpr hc).mono (fun h hh => hh.1)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_continuousOn · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:83
theorem noiseCost_compact_antitone Lemma noiseCost_compact_antitone in the paper ↗

The compact branch decreases as resolution increases below its interface. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h t σ :
ℝ
hh :
0 < h
hht :
h ≤ t
ht :
t ≤ σ^4
hσ :
0 < σ
t ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt t)) - 1
≤ h ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt h)) - 1
Proof (Lean source)
lemma noiseCost_compact_antitone (h t σ : ℝ) (hh : 0 < h) (hht : h ≤ t) (ht : t ≤ σ^4) (hσ : 0 < σ) : t ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt t)) - 1 ≤ h ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt h)) - 1 := by have htpos : 0 < t := lt_of_lt_of_le hh hht have hsqrt : sqrt t ≤ σ^2 := by have hsq := Real.sq_sqrt htpos.le have hroot := Real.sqrt_nonneg t have ht' : t ≤ (σ^2)^2 := by nlinarith [ht] nlinarith [sq_nonneg σ] have hlogt : 0 ≤ log (σ^2 / sqrt t) := Real.log_nonneg ((le_div_iff₀ (Real.sqrt_pos.2 htpos)).2 (by simpa using hsqrt)) have hlog : log (σ^2 / sqrt t) ≤ log (σ^2 / sqrt h) := Real.log_le_log (div_pos (sq_pos_of_pos hσ) (Real.sqrt_pos.2 htpos)) (div_le_div_of_nonneg_left (sq_nonneg σ) (Real.sqrt_pos.2 hh) (Real.sqrt_le_sqrt hht)) have hp := Real.rpow_le_rpow_of_nonpos hh hht (by norm_num : (-1/2 : ℝ) ≤ 0) have hm := mul_le_mul hp (show 1 + log (σ^2 / sqrt t) ≤ 1 + log (σ^2 / sqrt h) by linarith) (by linarith : 0 ≤ 1 + log (σ^2 / sqrt t)) (Real.rpow_nonneg hh.le _) linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_compact_antitone · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:122
theorem noiseCost_power_antitone Lemma noiseCost_power_antitone in the paper ↗

The power branch decreases on positive resolutions. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h t σ :
ℝ
hh :
0 < h
hht :
h ≤ t
hσ :
0 ≤ σ
(σ/t) ^ (2/3 : ℝ) - 1 ≤ (σ/h) ^ (2/3 : ℝ) - 1
Proof (Lean source)
lemma noiseCost_power_antitone (h t σ : ℝ) (hh : 0 < h) (hht : h ≤ t) (hσ : 0 ≤ σ) : (σ/t) ^ (2/3 : ℝ) - 1 ≤ (σ/h) ^ (2/3 : ℝ) - 1 := by apply sub_le_sub_right exact Real.rpow_le_rpow (div_nonneg hσ (lt_of_lt_of_le hh hht).le) (div_le_div_of_nonneg_left hσ hh hht) (by norm_num)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_power_antitone · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:145

Branchwise comparisons and interface agreement give global monotonicity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hσ :
σ ∈ Icc (0 : ℝ) 1
AntitoneOn (fun h => noiseCost h σ) (Ioc 0 1)
Proof (Lean source)
lemma noiseCost_antitoneOn (σ : ℝ) (hσ : σ ∈ Icc (0 : ℝ) 1) : AntitoneOn (fun h => noiseCost h σ) (Ioc 0 1) := by intro h hh t ht hht by_cases hd : σ ≤ h · simp [noiseCost, hd, hd.trans hht] by_cases td : σ ≤ t · simpa [noiseCost, td] using noiseCost_nonneg h σ hh hσ have hpos : 0 < σ := lt_trans hh.1 (lt_of_not_ge hd) by_cases hp : σ^4 ≤ h · simp only [noiseCost, if_neg hd, if_neg td, if_pos hp, if_pos (hp.trans hht)] exact noiseCost_power_antitone h t σ hh.1 hht hσ.1 by_cases tp : σ^4 ≤ t · simp only [noiseCost, if_neg hd, if_neg td, if_neg hp, if_pos tp] calc (σ/t) ^ (2/3 : ℝ) - 1 ≤ (σ/σ^4) ^ (2/3 : ℝ) - 1 := noiseCost_power_antitone (σ^4) t σ (pow_pos hpos 4) tp hσ.1 _ = (σ^4) ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt (σ^4))) - 1 := noiseCost_compact_interface σ hpos _ ≤ _ := noiseCost_compact_antitone h (σ^4) σ hh.1 (le_of_not_ge hp) le_rfl hpos · simp only [noiseCost, if_neg hd, if_neg td, if_neg hp, if_neg tp] exact noiseCost_compact_antitone h t σ hh.1 hht (le_of_not_ge tp) hpos
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_antitoneOn · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:153

The power expression also holds at the direct-branch endpoint. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h σ :
ℝ
hh :
0 < h
hp :
σ^4 ≤ h
ht :
h ≤ σ
1 + noiseCost h σ = (σ/h) ^ (2/3 : ℝ)
Proof (Lean source)
lemma noiseCost_one_power (h σ : ℝ) (hh : 0 < h) (hp : σ^4 ≤ h) (ht : h ≤ σ) : 1 + noiseCost h σ = (σ/h) ^ (2/3 : ℝ) := by by_cases hd : σ ≤ h · have heq : σ = h := le_antisymm hd ht subst σ simp [noiseCost, div_self hh.ne'] · simp [noiseCost, hd, hp]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_one_power · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:176

The compact expression agrees with the power expression at their interface. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h σ :
ℝ
hh :
0 < h
hp :
h ≤ σ^4
hσ :
σ ≤ 1
hspos :
0 < σ
1 + noiseCost h σ = h ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt h))
Proof (Lean source)
lemma noiseCost_one_compact (h σ : ℝ) (hh : 0 < h) (hp : h ≤ σ^4) (hσ : σ ≤ 1) (hspos : 0 < σ) : 1 + noiseCost h σ = h ^ (-1/2 : ℝ) * (1 + log (σ^2 / sqrt h)) := by have hfour : σ^4 ≤ σ := by calc σ^4 ≤ σ^1 := pow_le_pow_of_le_one hspos.le hσ (by omega) _ = σ := pow_one _ by_cases heq : h = σ^4 · rw [heq, noiseCost_one_power _ _ (pow_pos hspos 4) le_rfl hfour] have hi := noiseCost_compact_interface σ hspos linarith · have hp' : h < σ^4 := lt_of_le_of_ne hp heq simp [noiseCost, not_le.mpr (hp'.trans_le hfour), not_le.mpr hp']
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_one_compact · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:185
theorem noiseCost_power_comparison Lemma noiseCost_power_comparison in the paper ↗

On the power branch the multiplicative cost ratio is a two-thirds power. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h t σ :
ℝ
hh :
0 < h
hht :
h ≤ t
hp :
σ^4 ≤ h
ht :
t ≤ σ
conclusion 1
(t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ
conclusion 2
1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ)
Proof (Lean source)
lemma noiseCost_power_comparison (h t σ : ℝ) (hh : 0 < h) (hht : h ≤ t) (hp : σ^4 ≤ h) (ht : t ≤ σ) : (t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ ∧ 1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ) := by have htpos := lt_of_lt_of_le hh hht have hspos := lt_of_lt_of_le htpos ht rw [noiseCost_one_power h σ hh hp (hht.trans ht), noiseCost_one_power t σ htpos (hp.trans hht) ht] have heq : (σ/h) ^ (2/3 : ℝ) = (t/h) ^ (2/3 : ℝ) * (σ/t) ^ (2/3 : ℝ) := by rw [← Real.mul_rpow (div_nonneg htpos.le hh.le) (div_nonneg hspos.le htpos.le)] congr 1 field_simp rw [heq] have hr : 1 ≤ t/h := (le_div_iff₀ hh).2 (by simpa using hht) constructor · exact mul_le_mul_of_nonneg_right (Real.rpow_le_rpow_of_exponent_le hr (by norm_num)) (Real.rpow_nonneg (by positivity) _) · apply mul_le_mul_of_nonneg_right _ (Real.rpow_nonneg (by positivity) _) simpa using Real.rpow_le_rpow_of_exponent_le hr (show (2/3 : ℝ) ≤ 1 by norm_num)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_power_comparison · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:199
theorem noiseCost_compact_comparison Lemma noiseCost_compact_comparison in the paper ↗

On the compact branch the logarithmic factor grows between zero and the square-root ratio. The bound log r ≤ r - 1 is the integrated upper derivative bound in the roadmap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h t σ :
ℝ
hh :
0 < h
hht :
h ≤ t
ht :
t ≤ σ^4
hσ :
σ ≤ 1
hspos :
0 < σ
conclusion 1
(t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ
conclusion 2
1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ)
Proof (Lean source)
lemma noiseCost_compact_comparison (h t σ : ℝ) (hh : 0 < h) (hht : h ≤ t) (ht : t ≤ σ^4) (hσ : σ ≤ 1) (hspos : 0 < σ) : (t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ ∧ 1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ) := by have htpos := lt_of_lt_of_le hh hht rw [noiseCost_one_compact h σ hh (hht.trans ht) hσ hspos, noiseCost_one_compact t σ htpos ht hσ hspos] let r : ℝ := sqrt t / sqrt h have sh := Real.sqrt_pos.2 hh have st := Real.sqrt_pos.2 htpos have hrpos : 0 < r := div_pos st sh have hr : 1 ≤ r := (le_div_iff₀ sh).2 (by simpa [r] using Real.sqrt_le_sqrt hht) have hroot : sqrt t ≤ σ^2 := by have := Real.sq_sqrt htpos.le have : t ≤ (σ^2)^2 := by nlinarith [ht] nlinarith [Real.sqrt_nonneg t, sq_nonneg σ] have hl : 0 ≤ log (σ^2 / sqrt t) := Real.log_nonneg ((le_div_iff₀ st).2 (by simpa using hroot)) have hlog : log (σ^2 / sqrt h) = log (σ^2 / sqrt t) + log r := by rw [← Real.log_mul (div_ne_zero (pow_ne_zero 2 hspos.ne') st.ne') hrpos.ne'] congr 1 dsimp [r] field_simp have hlow : 1 + log (σ^2 / sqrt t) ≤ 1 + log (σ^2 / sqrt h) := by rw [hlog] linarith [Real.log_nonneg hr] have hupp : 1 + log (σ^2 / sqrt h) ≤ r * (1 + log (σ^2 / sqrt t)) := by rw [hlog] have := Real.log_le_sub_one_of_pos hrpos nlinarith [mul_nonneg (sub_nonneg.mpr hr) hl] have hp (x : ℝ) (hx : 0 < x) : x ^ (-1/2 : ℝ) = (sqrt x)⁻¹ := by rw [show (-1/2 : ℝ) = -(1/2 : ℝ) by norm_num, Real.rpow_neg hx.le, ← Real.sqrt_eq_rpow] have hratio : (t/h) ^ (1/2 : ℝ) = r := by rw [Real.div_rpow htpos.le hh.le, ← Real.sqrt_eq_rpow, ← Real.sqrt_eq_rpow] rw [hp h hh, hp t htpos, hratio] constructor · have := mul_le_mul_of_nonneg_left hlow (inv_nonneg.mpr sh.le) dsimp [r] convert! this using 1 field_simp [sh.ne', st.ne'] · have := mul_le_mul_of_nonneg_left hupp (inv_nonneg.mpr sh.le) dsimp [r] at this convert! this using 1 field_simp [sh.ne', st.ne', hh.ne'] nlinarith [Real.sq_sqrt hh.le, Real.sq_sqrt htpos.le]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_compact_comparison · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:220
theorem noiseCost_comparison_trans Lemma noiseCost_comparison_trans in the paper ↗

Multiplicative branch comparisons compose across an intermediate resolution. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h u t σ :
ℝ
hh :
0 < h
hu :
0 < u
ht :
0 < t
hhu :
(u/h) ^ (1/2 : ℝ) * (1 + noiseCost u σ) ≤ 1 + noiseCost h σ ∧
1 + noiseCost h σ ≤ (u/h) * (1 + noiseCost u σ)
hut :
(t/u) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost u σ ∧
1 + noiseCost u σ ≤ (t/u) * (1 + noiseCost t σ)
conclusion 1
(t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ
conclusion 2
1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ)
Proof (Lean source)
lemma noiseCost_comparison_trans (h u t σ : ℝ) (hh : 0 < h) (hu : 0 < u) (ht : 0 < t) (hhu : (u/h) ^ (1/2 : ℝ) * (1 + noiseCost u σ) ≤ 1 + noiseCost h σ ∧ 1 + noiseCost h σ ≤ (u/h) * (1 + noiseCost u σ)) (hut : (t/u) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost u σ ∧ 1 + noiseCost u σ ≤ (t/u) * (1 + noiseCost t σ)) : (t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ ∧ 1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ) := by have heq : t/h = (u/h) * (t/u) := by field_simp constructor · calc _ = (u/h) ^ (1/2 : ℝ) * ((t/u) ^ (1/2 : ℝ) * (1 + noiseCost t σ)) := by rw [heq, Real.mul_rpow (by positivity) (by positivity), mul_assoc] _ ≤ (u/h) ^ (1/2 : ℝ) * (1 + noiseCost u σ) := mul_le_mul_of_nonneg_left hut.1 (Real.rpow_nonneg (by positivity) _) _ ≤ _ := hhu.1 · calc _ ≤ (u/h) * (1 + noiseCost u σ) := hhu.2 _ ≤ (u/h) * ((t/u) * (1 + noiseCost t σ)) := mul_le_mul_of_nonneg_left hut.2 (by positivity) _ = _ := by rw [heq, mul_assoc]
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_comparison_trans · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:269

Joining the two explicit branch estimates yields the full ratio bounds. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h t σ :
ℝ
hh :
0 < h
hht :
h ≤ t
htσ :
t ≤ σ
hσ :
σ ≤ 1
conclusion 1
(t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ)
conclusion 2
(1 + noiseCost h σ) / (1 + noiseCost t σ) ≤ t/h
Proof (Lean source)
lemma noiseCost_ratio_bounds (h t σ : ℝ) (hh : 0 < h) (hht : h ≤ t) (htσ : t ≤ σ) (hσ : σ ≤ 1) : (t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ) ∧ (1 + noiseCost h σ) / (1 + noiseCost t σ) ≤ t/h := by have htpos := lt_of_lt_of_le hh hht have hspos := lt_of_lt_of_le htpos htσ have hFpos : 0 < 1 + noiseCost t σ := by have := noiseCost_nonneg t σ ⟨htpos, htσ.trans hσ⟩ ⟨hspos.le, hσ⟩ linarith have hcomp : (t/h) ^ (1/2 : ℝ) * (1 + noiseCost t σ) ≤ 1 + noiseCost h σ ∧ 1 + noiseCost h σ ≤ (t/h) * (1 + noiseCost t σ) := by by_cases hp : σ^4 ≤ h · exact noiseCost_power_comparison h t σ hh hht hp htσ by_cases tp : t ≤ σ^4 · exact noiseCost_compact_comparison h t σ hh hht tp hσ hspos · exact noiseCost_comparison_trans h (σ^4) t σ hh (pow_pos hspos 4) htpos (noiseCost_compact_comparison h (σ^4) σ hh (le_of_not_ge hp) le_rfl hσ hspos) (noiseCost_power_comparison (σ^4) t σ (pow_pos hspos 4) (le_of_not_ge tp) le_rfl htσ) exact ⟨(le_div_iff₀ hFpos).2 hcomp.1, (div_le_iff₀ hFpos).2 hcomp.2⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_ratio_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:291
theorem noiseCost_dilation_of_lower_ratio Lemma noiseCost_dilation_of_lower_ratio in the paper ↗

The lower ratio estimate gives dilation decay until the direct branch is reached. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
hratio :
∀ h t σ : ℝ
if
0 < h
and
h ≤ t
and
t ≤ σ
and
σ ≤ 1
then
(t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ)
h σ a :
ℝ
hh :
h ∈ Ioc (0 : ℝ) 1
hσ :
σ ∈ Icc (0 : ℝ) 1
ha :
1 ≤ a
hah :
a*h ≤ 1
1 + noiseCost (a*h) σ ≤ max 1 (a ^ (-1/2 : ℝ) * (1 + noiseCost h σ))
Proof (Lean source)
lemma noiseCost_dilation_of_lower_ratio (hratio : ∀ h t σ : ℝ, 0 < h → h ≤ t → t ≤ σ → σ ≤ 1 → (t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ)) (h σ a : ℝ) (hh : h ∈ Ioc (0 : ℝ) 1) (hσ : σ ∈ Icc (0 : ℝ) 1) (ha : 1 ≤ a) (hah : a*h ≤ 1) : 1 + noiseCost (a*h) σ ≤ max 1 (a ^ (-1/2 : ℝ) * (1 + noiseCost h σ)) := by by_cases hdirect : σ ≤ a*h · simpa [noiseCost, hdirect] using (le_max_left (1 : ℝ) (a ^ (-1/2 : ℝ) * (1 + noiseCost h σ))) have hapos : 0 < a := lt_of_lt_of_le (by norm_num) ha have hahpos : 0 < a*h := mul_pos hapos hh.1 have hht : h ≤ a*h := by nlinarith [hh.1] have hFpos : 0 < 1 + noiseCost (a*h) σ := by have := noiseCost_nonneg (a*h) σ ⟨hahpos, hah⟩ hσ linarith have hr := hratio h (a*h) σ hh.1 hht (le_of_not_ge hdirect) hσ.2 rw [mul_div_cancel_right₀ a hh.1.ne'] at hr have hprod : a ^ (1/2 : ℝ) * (1 + noiseCost (a*h) σ) ≤ 1 + noiseCost h σ := (le_div_iff₀ hFpos).mp hr have hinv : a ^ (-1/2 : ℝ) * a ^ (1/2 : ℝ) = 1 := by rw [← Real.rpow_add hapos] norm_num apply le_trans _ (le_max_right _ _) calc 1 + noiseCost (a*h) σ = (a ^ (-1/2 : ℝ) * a ^ (1/2 : ℝ)) * (1 + noiseCost (a*h) σ) := by rw [hinv, one_mul] _ = a ^ (-1/2 : ℝ) * (a ^ (1/2 : ℝ) * (1 + noiseCost (a*h) σ)) := by ring _ ≤ a ^ (-1/2 : ℝ) * (1 + noiseCost h σ) := mul_le_mul_of_nonneg_left hprod (Real.rpow_nonneg hapos.le _)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseCost_dilation_of_lower_ratio · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:312
theorem noise_cost_scaling Lemma 8 in the paper ↗

Continuity, monotonicity and both scalar scaling inequalities. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
conclusion 1
σ ∈ Icc (0 : ℝ) 1 :
ContinuousOn (fun h => noiseCost h σ) (Ioc 0 1)
h ∈ Ioc (0 : ℝ) 1 :
0 ≤ noiseCost h σ
AntitoneOn (fun h => noiseCost h σ) (Ioc 0 1)
conclusion 2
h t σ :
ℝ
0 < h
h ≤ t
t ≤ σ
σ ≤ 1
(t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ)
(1 + noiseCost h σ) / (1 + noiseCost t σ) ≤ t/h
conclusion 3
h σ a :
ℝ
h ∈ Ioc (0 : ℝ) 1
σ ∈ Icc (0 : ℝ) 1
1 ≤ a
a*h ≤ 1
1 + noiseCost (a*h) σ ≤ max 1 (a ^ (-1/2 : ℝ) * (1 + noiseCost h σ))
Proof (Lean source)
-- @node: lem:noise-cost-scaling lemma noise_cost_scaling : (∀ σ ∈ Icc (0 : ℝ) 1, ContinuousOn (fun h => noiseCost h σ) (Ioc 0 1) ∧ (∀ h ∈ Ioc (0 : ℝ) 1, 0 ≤ noiseCost h σ) ∧ AntitoneOn (fun h => noiseCost h σ) (Ioc 0 1)) ∧ (∀ h t σ : ℝ, 0 < h → h ≤ t → t ≤ σ → σ ≤ 1 → (t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ) ∧ (1 + noiseCost h σ) / (1 + noiseCost t σ) ≤ t/h) ∧ (∀ h σ a : ℝ, h ∈ Ioc (0 : ℝ) 1 → σ ∈ Icc (0 : ℝ) 1 → 1 ≤ a → a*h ≤ 1 → 1 + noiseCost (a*h) σ ≤ max 1 (a ^ (-1/2 : ℝ) * (1 + noiseCost h σ))) := by refine ⟨?_, ?_⟩ · intro σ hσ refine ⟨?_, fun h hh => noiseCost_nonneg h σ hh hσ, ?_⟩ · exact noiseCost_continuousOn σ hσ · exact noiseCost_antitoneOn σ hσ · have hratio : ∀ h t σ : ℝ, 0 < h → h ≤ t → t ≤ σ → σ ≤ 1 → (t/h) ^ (1/2 : ℝ) ≤ (1 + noiseCost h σ) / (1 + noiseCost t σ) ∧ (1 + noiseCost h σ) / (1 + noiseCost t σ) ≤ t/h := by exact noiseCost_ratio_bounds refine ⟨hratio, ?_⟩ exact noiseCost_dilation_of_lower_ratio (fun h t σ hh hht htσ hσ => (hratio h t σ hh hht htσ hσ).1)
CausalSmith.Stat.RdTruesideNoiseFrontier.noise_cost_scaling · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Rate.lean:343
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.ScalarRootCompact 5 declarations Monotonicity, uniqueness, and uniform comparisons for the compact-branch scalar equation.

Compact scalar root analysis

Monotonicity, uniqueness, and uniform comparisons for the compact-branch scalar equation.

def compactScalarLhs

The left side of the compact scalar equation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β σ τ :
ℝ
compactScalarLhs β σ τ :
ℝ
2 * (2 * β + 1) * log τ + τ * (1 + log (σ ^ 2 * τ))
CausalSmith.Stat.RdTruesideNoiseFrontier.compactScalarLhs · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCompact.lean:18
theorem compactScalarLhs_strictMonoOn

Above the compact interface, the compact scalar left side is strictly increasing. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hspos :
0 < σ
StrictMonoOn (compactScalarLhs β σ) (Ioi (σ ^ (-2 : ℝ)))
Proof (Lean source)
lemma compactScalarLhs_strictMonoOn (β σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hspos : 0 < σ) : StrictMonoOn (compactScalarLhs β σ) (Ioi (σ ^ (-2 : ℝ))) := by intro x hx y hy hxy have hs2pos : 0 < σ ^ 2 := sq_pos_of_pos hspos have hbase : σ ^ 2 * σ ^ (-2 : ℝ) = 1 := by rw [← Real.rpow_natCast σ 2, ← Real.rpow_add hspos] norm_num have hx' : σ ^ (-2 : ℝ) < x := hx have hy' : σ ^ (-2 : ℝ) < y := hy have hxpos : 0 < x := (Real.rpow_pos_of_pos hspos _).trans hx' have hypos : 0 < y := hxpos.trans hxy have hax : 1 < σ ^ 2 * x := by calc 1 = σ ^ 2 * σ ^ (-2 : ℝ) := hbase.symm _ < σ ^ 2 * x := mul_lt_mul_of_pos_left hx' hs2pos have hay : 1 < σ ^ 2 * y := by calc 1 = σ ^ 2 * σ ^ (-2 : ℝ) := hbase.symm _ < σ ^ 2 * y := mul_lt_mul_of_pos_left hy' hs2pos have hlogxy : log x < log y := Real.strictMonoOn_log hxpos hypos hxy have hlogaxy : log (σ ^ 2 * x) < log (σ ^ 2 * y) := Real.strictMonoOn_log (mul_pos hs2pos hxpos) (mul_pos hs2pos hypos) (mul_lt_mul_of_pos_left hxy hs2pos) have hfactorx : 0 < 1 + log (σ ^ 2 * x) := by have := Real.log_pos hax linarith have hfactory : 0 < 1 + log (σ ^ 2 * y) := by have := Real.log_pos hay linarith have hmul : x * (1 + log (σ ^ 2 * x)) < y * (1 + log (σ ^ 2 * y)) := by calc x * (1 + log (σ ^ 2 * x)) < y * (1 + log (σ ^ 2 * x)) := mul_lt_mul_of_pos_right hxy hfactorx _ < y * (1 + log (σ ^ 2 * y)) := mul_lt_mul_of_pos_left (by linarith) hypos have hcoef : 0 < 2 * (2 * β + 1) := by linarith [hβ.1] unfold compactScalarLhs nlinarith [mul_lt_mul_of_pos_left hlogxy hcoef]
CausalSmith.Stat.RdTruesideNoiseFrontier.compactScalarLhs_strictMonoOn · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCompact.lean:23
theorem compactScalar_unique

The compact scalar equation has at most one solution above the compact interface. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β n σ τ τ' :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hspos :
0 < σ
hτ :
σ ^ (-2 : ℝ) < τ
hτ' :
σ ^ (-2 : ℝ) < τ'
heq :
2 * (2 * β + 1) * log τ + τ * (1 + log (σ ^ 2 * τ)) = log n + 1
heq' :
2 * (2 * β + 1) * log τ' + τ' * (1 + log (σ ^ 2 * τ')) = log n + 1
τ' = τ
Proof (Lean source)
lemma compactScalar_unique (β n σ τ τ' : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hspos : 0 < σ) (hτ : σ ^ (-2 : ℝ) < τ) (hτ' : σ ^ (-2 : ℝ) < τ') (heq : 2 * (2 * β + 1) * log τ + τ * (1 + log (σ ^ 2 * τ)) = log n + 1) (heq' : 2 * (2 * β + 1) * log τ' + τ' * (1 + log (σ ^ 2 * τ')) = log n + 1) : τ' = τ := by apply (compactScalarLhs_strictMonoOn β σ hβ hspos).injOn hτ' hτ simpa [compactScalarLhs] using heq'.trans heq.symm
CausalSmith.Stat.RdTruesideNoiseFrontier.compactScalar_unique · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCompact.lean:62
theorem compactScalar_bounds

A solution of the compact scalar equation is uniformly comparable to its explicit logarithmic proxy. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β n σ τ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
1 < n
hspos :
0 < σ
hsone :
σ ≤ 1
hτ :
σ ^ (-2 : ℝ) < τ
heq :
2 * (2 * β + 1) * log τ + τ * (1 + log (σ ^ 2 * τ)) = log n + 1
B :
1 + log n
D :
log (exp 1 + σ ^ 2 * B)
(1 / (2 * (1 + 2 * (2 * β + 1)))) * (B / D) ≤ τ
τ ≤ (exp 1 + 6) * (B / D)
Proof (Lean source)
lemma compactScalar_bounds (β n σ τ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 1 < n) (hspos : 0 < σ) (hsone : σ ≤ 1) (hτ : σ ^ (-2 : ℝ) < τ) (heq : 2 * (2 * β + 1) * log τ + τ * (1 + log (σ ^ 2 * τ)) = log n + 1) : let B := 1 + log n let D := log (exp 1 + σ ^ 2 * B) (1 / (2 * (1 + 2 * (2 * β + 1)))) * (B / D) ≤ τ ∧ τ ≤ (exp 1 + 6) * (B / D) := by dsimp only let B := 1 + log n let a := σ ^ 2 let y := a * τ let q := B / τ let J := 1 + log y let D := log (exp 1 + a * B) have hνpos : 0 < 2 * β + 1 := by linarith [hβ.1] have hνle : 2 * β + 1 ≤ 3 := by linarith [hβ.2] have ha : 0 < a := by dsimp [a]; positivity have hsInv : 1 ≤ σ ^ (-2 : ℝ) := Real.one_le_rpow_of_pos_of_le_one_of_nonpos hspos hsone (by norm_num) have hτone : 1 < τ := hsInv.trans_lt hτ have hτpos : 0 < τ := zero_lt_one.trans hτone have hyone : 1 < y := by dsimp [y, a] have hbase : σ ^ 2 * σ ^ (-2 : ℝ) = 1 := by rw [← Real.rpow_natCast σ 2, ← Real.rpow_add hspos] norm_num calc 1 = σ ^ 2 * σ ^ (-2 : ℝ) := hbase.symm _ < σ ^ 2 * τ := mul_lt_mul_of_pos_left hτ (sq_pos_of_pos hspos) have hypos : 0 < y := zero_lt_one.trans hyone have hJone : 1 < J := by dsimp [J]; linarith [Real.log_pos hyone] have hB : 1 < B := by dsimp [B]; linarith [Real.log_pos hn] have hqeq : q = 2 * (2 * β + 1) * log τ / τ + J := by dsimp [q, B, J, y, a] field_simp [hτpos.ne'] at heq ⊢ nlinarith have hlogτnonneg : 0 ≤ log τ := Real.log_nonneg hτone.le have hlogτle : log τ ≤ τ := (Real.log_le_sub_one_of_pos hτpos).trans (by linarith) have hJq : J ≤ q := by rw [hqeq] have : 0 ≤ 2 * (2 * β + 1) * log τ / τ := by exact div_nonneg (mul_nonneg (by nlinarith) hlogτnonneg) hτpos.le linarith have hqJ : q ≤ 2 * (2 * β + 1) + J := by rw [hqeq] have hratio : log τ / τ ≤ 1 := (div_le_one hτpos).2 hlogτle have := mul_le_mul_of_nonneg_left hratio (by nlinarith : 0 ≤ 2 * (2 * β + 1)) calc 2 * (2 * β + 1) * log τ / τ + J = 2 * (2 * β + 1) * (log τ / τ) + J := by ring _ ≤ 2 * (2 * β + 1) * 1 + J := by simpa [add_comm] using add_le_add_right this J _ = 2 * (2 * β + 1) + J := by ring have hqone : 1 < q := hJone.trans_le hJq have haB : a * B = y * q := by dsimp [a, B, y, q] field_simp [hτpos.ne'] have hDpos : 0 < D := by dsimp [D] apply Real.log_pos have hexp : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have haBpos : 0 < a * B := mul_pos ha (zero_lt_one.trans hB) linarith have hD_ge_one : 1 ≤ D := by dsimp [D] rw [← Real.log_exp 1] apply Real.strictMonoOn_log.monotoneOn · exact Real.exp_pos 1 · change 0 < exp (log (exp 1)) + a * B rw [Real.exp_log (Real.exp_pos 1)] exact add_pos (Real.exp_pos 1) (mul_pos ha (zero_lt_one.trans hB)) · have hab : 0 ≤ a * B := mul_nonneg ha.le (zero_lt_one.trans hB).le simpa using add_le_add_left hab (exp 1) have hD_ge_logy : log y ≤ D := by dsimp [D] apply Real.strictMonoOn_log.monotoneOn hypos · exact add_pos (Real.exp_pos 1) (mul_pos ha (zero_lt_one.trans hB)) · rw [haB] have : y ≤ y * q := by nlinarith [mul_lt_mul_of_pos_left hqone hypos] linarith [Real.exp_pos 1] have hJ_le_twoD : J ≤ 2 * D := by dsimp [J] linarith have hq_le : q ≤ (1 + 2 * (2 * β + 1)) * J := by calc q ≤ 2 * (2 * β + 1) + J := hqJ _ ≤ (1 + 2 * (2 * β + 1)) * J := by nlinarith [hJone.le, hνpos] have hD_le : D ≤ (exp 1 + 6) * J := by have hq7 : q ≤ J + 6 := by linarith have harg : exp 1 + a * B ≤ y * (exp 1 + J + 6) := by rw [haB] have hey : exp 1 ≤ y * exp 1 := by nlinarith [Real.exp_pos 1, hyone] nlinarith [mul_le_mul_of_nonneg_left hq7 hypos.le] have hlogarg := Real.strictMonoOn_log.monotoneOn (by positivity : 0 < exp 1 + a * B) (by positivity : 0 < y * (exp 1 + J + 6)) harg have hsumpos : 0 < exp 1 + J + 6 := by positivity have hlogsum : log (exp 1 + J + 6) ≤ exp 1 + J + 5 := by convert Real.log_le_sub_one_of_pos hsumpos using 1 <;> ring have hlogmul : log (y * (exp 1 + J + 6)) = log y + log (exp 1 + J + 6) := Real.log_mul hypos.ne' hsumpos.ne' dsimp [D] at hlogarg ⊢ rw [hlogmul] at hlogarg dsimp [J] at hJone ⊢ nlinarith [Real.exp_pos 1, hlogsum] have hBpos : 0 < B := zero_lt_one.trans hB have hqpos : 0 < q := zero_lt_one.trans hqone have hcoefpos : 0 < 2 * (1 + 2 * (2 * β + 1)) := by nlinarith constructor · have hqD : q ≤ 2 * (1 + 2 * (2 * β + 1)) * D := by calc q ≤ (1 + 2 * (2 * β + 1)) * J := hq_le _ ≤ (1 + 2 * (2 * β + 1)) * (2 * D) := mul_le_mul_of_nonneg_left hJ_le_twoD (by nlinarith) _ = 2 * (1 + 2 * (2 * β + 1)) * D := by ring have hBD : B ≤ τ * (2 * (1 + 2 * (2 * β + 1)) * D) := by have hx := (div_le_iff₀ hτpos).mp (by simpa [q] using hqD) simpa [mul_assoc, mul_left_comm, mul_comm] using hx calc (1 / (2 * (1 + 2 * (2 * β + 1)))) * (B / D) = B / (2 * (1 + 2 * (2 * β + 1)) * D) := by field_simp _ ≤ τ := (div_le_iff₀ (mul_pos hcoefpos hDpos)).2 (by simpa [mul_assoc, mul_left_comm, mul_comm] using hBD) · have hDq : D ≤ (exp 1 + 6) * q := hD_le.trans (mul_le_mul_of_nonneg_left hJq (by positivity)) have hDB : D * τ ≤ (exp 1 + 6) * B := by have hx : D ≤ ((exp 1 + 6) * B) / τ := by calc D ≤ (exp 1 + 6) * q := hDq _ = ((exp 1 + 6) * B) / τ := by dsimp [q]; ring exact (le_div_iff₀ hτpos).mp hx change τ ≤ (exp 1 + 6) * (B / D) calc τ ≤ ((exp 1 + 6) * B) / D := (le_div_iff₀ hDpos).2 (by simpa [mul_assoc, mul_left_comm, mul_comm] using hDB) _ = (exp 1 + 6) * (B / D) := by ring
CausalSmith.Stat.RdTruesideNoiseFrontier.compactScalar_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCompact.lean:72
theorem compactPower_bounds

Raising a positive two-sided compact-scale comparison to the negative Hölder exponent reverses its inequalities and inverts the proxy. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β B D τ c C :
ℝ
hβ :
0 < β
hB :
0 < B
hD :
0 < D
hτ :
0 < τ
hc :
0 < c
hC :
0 < C
hlo :
c * (B / D) ≤ τ
hhi :
τ ≤ C * (B / D)
conclusion 1
C ^ (-2 * β) * (D / B) ^ (2 * β) ≤ τ ^ (-2 * β)
conclusion 2
τ ^ (-2 * β) ≤ c ^ (-2 * β) * (D / B) ^ (2 * β)
Proof (Lean source)
lemma compactPower_bounds (β B D τ c C : ℝ) (hβ : 0 < β) (hB : 0 < B) (hD : 0 < D) (hτ : 0 < τ) (hc : 0 < c) (hC : 0 < C) (hlo : c * (B / D) ≤ τ) (hhi : τ ≤ C * (B / D)) : C ^ (-2 * β) * (D / B) ^ (2 * β) ≤ τ ^ (-2 * β) ∧ τ ^ (-2 * β) ≤ c ^ (-2 * β) * (D / B) ^ (2 * β) := by have hR : 0 < B / D := div_pos hB hD have hp : -2 * β ≤ 0 := by linarith have hinv : (B / D) ^ (-2 * β) = (D / B) ^ (2 * β) := by rw [show -2 * β = -(2 * β) by ring, Real.div_rpow hB.le hD.le, Real.div_rpow hD.le hB.le, Real.rpow_neg hB.le, Real.rpow_neg hD.le] field_simp [ne_of_gt (Real.rpow_pos_of_pos hB _), ne_of_gt (Real.rpow_pos_of_pos hD _)] constructor · have hpow := Real.rpow_le_rpow_of_nonpos hτ hhi hp rw [Real.mul_rpow hC.le hR.le, hinv] at hpow exact hpow · have hpow := Real.rpow_le_rpow_of_nonpos (mul_pos hc hR) hlo hp rw [Real.mul_rpow hc.le hR.le, hinv] at hpow exact hpow
CausalSmith.Stat.RdTruesideNoiseFrontier.compactPower_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCompact.lean:216
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.ScalarRootCore 13 declarations Existence, uniqueness, branch identification, and intermediate-branch bounds for the true-side measurement-error resolution equation.

Scalar root analysis

Existence, uniqueness, branch identification, and intermediate-branch bounds for the true-side measurement-error resolution equation.

Given the smoothness index, sample size, and noise level, the unique-rate-root condition requires the root to lie between the direct resolution and one, the scalar balance equation to hold, and no other point in that interval to solve it.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
UniqueRateRoot β n σ :
Prop
clause 1
rateResolution β n σ ∈ Icc (directResolution β n) 1
clause 2
log n + (2*β+1) * log (rateResolution β n σ)
= noiseCost (rateResolution β n σ) σ
clause 3
h ∈ Icc (directResolution β n) 1 :
log n + (2*β+1) * log h = noiseCost h σ
h = rateResolution β n σ
CausalSmith.Stat.RdTruesideNoiseFrontier.UniqueRateRoot · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:22

The exact intermediate-compact branch criterion. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ :
ℝ
IntermediateCondition β n σ :
Prop
log ((n : ℝ) * σ^(4*(2*β+1))) ≤ σ ^ (-2 : ℝ) - 1
CausalSmith.Stat.RdTruesideNoiseFrontier.IntermediateCondition · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:28

The intermediate branch scalar equation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ z :
ℝ
IntermediateEquation β n σ z :
Prop
z + (3*(2*β+1)/2) * log z = 1 + log ((n : ℝ) * σ^(2*β+1))
CausalSmith.Stat.RdTruesideNoiseFrontier.IntermediateEquation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:31

The compact branch scalar equation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
n :
ℕ
σ τ :
ℝ
CompactEquation β n σ τ :
Prop
2*(2*β+1) * log τ + τ * (1 + log (σ^2 * τ)) = log n + 1
CausalSmith.Stat.RdTruesideNoiseFrontier.CompactEquation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:34
theorem directResolution_pos_le_one

The direct resolution is positive and at most one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
directResolution β n ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma directResolution_pos_le_one (β : ℝ) (n : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) : directResolution β n ∈ Ioc (0 : ℝ) 1 := by have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hnone : (1 : ℝ) ≤ n := by exact_mod_cast (show 1 ≤ n by omega) have hcoef : 0 < 2 * β + 1 := by linarith [hβ.1] have hexp : -1 / (2 * β + 1) ≤ 0 := div_nonpos_of_nonpos_of_nonneg (by norm_num) hcoef.le exact ⟨Real.rpow_pos_of_pos hnpos _, Real.rpow_le_one_of_one_le_of_nonpos hnone hexp⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.directResolution_pos_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:41
theorem unique_rate_root

The supremum construction is the unique root, derived from the piecewise noise cost. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma unique_rate_root (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) : UniqueRateRoot β n σ := by obtain ⟨r, hr, hrzero, hsub⟩ := exists_unique_rateScore_root β n σ hβ hn hσ have hset : {h ∈ Icc (directResolution β n) 1 | log n + (2 * β + 1) * log h - noiseCost h σ ≤ 0} = Icc (directResolution β n) r := by ext h simp only [mem_ofPred_eq, mem_Icc] constructor · intro hh exact ⟨hh.1.1, (hsub h hh.1).mp hh.2⟩ · intro hh have hi : h ∈ Icc (directResolution β n) 1 := ⟨hh.1, hh.2.trans hr.2⟩ exact ⟨hi, (hsub h hi).mpr hh.2⟩ have hrate : rateResolution β n σ = r := by unfold rateResolution rw [hset, csSup_Icc hr.1] unfold UniqueRateRoot rw [hrate] refine ⟨hr, ?_, ?_⟩ · unfold rateScore at hrzero linarith · intro h hh heq apply (rateScore_strictMonoOn β n σ hβ hn hσ).injOn hh hr have hhzero : rateScore β n σ h = 0 := by unfold rateScore linarith exact hhzero.trans hrzero.symm
CausalSmith.Stat.RdTruesideNoiseFrontier.unique_rate_root · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:179
theorem rateResolution_eq_direct_of_le

Noise below the direct resolution leaves the scalar root at the direct rate. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hle :
σ ≤ directResolution β n
Proof (Lean source)
lemma rateResolution_eq_direct_of_le (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hle : σ ≤ directResolution β n) : rateResolution β n σ = directResolution β n := by have hd := directResolution_pos_le_one β n hβ hn have hroot := unique_rate_root β n σ hβ hn hσ symm apply (hroot.2.2 (directResolution β n) ⟨le_rfl, hd.2⟩) rw [show noiseCost (directResolution β n) σ = 0 by simp [noiseCost, hle]] exact direct_log_identity β n hβ hn
CausalSmith.Stat.RdTruesideNoiseFrontier.rateResolution_eq_direct_of_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:210
theorem noisy_rateResolution_interior

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hnoisy :
conclusion 1
conclusion 2
rateResolution β n σ < σ
Proof (Lean source)
lemma noisy_rateResolution_interior (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hnoisy : directResolution β n < σ) : directResolution β n < rateResolution β n σ ∧ rateResolution β n σ < σ := by have hd := directResolution_pos_le_one β n hβ hn have hroot := unique_rate_root β n σ hβ hn hσ have hscoreRoot : rateScore β n σ (rateResolution β n σ) = 0 := by unfold rateScore linarith [hroot.2.1] have hcost : 0 < noiseCost (directResolution β n) σ := noiseCost_pos_of_lt _ _ hd.1 hσ.2 hnoisy have hscoreDirect : rateScore β n σ (directResolution β n) < 0 := by unfold rateScore rw [direct_log_identity β n hβ hn] linarith have hleft : directResolution β n < rateResolution β n σ := by exact lt_of_le_of_ne hroot.1.1 (fun heq => by rw [heq, hscoreRoot] at hscoreDirect linarith) have hspos : 0 < σ := hd.1.trans hnoisy have hscoreSigma : 0 < rateScore β n σ σ := by have hlog := Real.strictMonoOn_log hd.1 hspos hnoisy have hcoef : 0 < 2 * β + 1 := by linarith [hβ.1] have hcostSigma : noiseCost σ σ = 0 := by simp [noiseCost] unfold rateScore rw [hcostSigma] nlinarith [direct_log_identity β n hβ hn, mul_lt_mul_of_pos_left hlog hcoef] have hright : rateResolution β n σ < σ := by by_contra hnot have hle : σ ≤ rateResolution β n σ := le_of_not_gt hnot have hm := (rateScore_strictMonoOn_Ioc β n σ hβ hσ).monotoneOn ⟨hspos, hσ.2⟩ ⟨hd.1.trans_le hroot.1.1, hroot.1.2⟩ hle linarith exact ⟨hleft, hright⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.noisy_rateResolution_interior · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:222
theorem intermediateCondition_iff

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hnoisy :
IntermediateCondition β n σ ↔ σ ^ 4 ≤ rateResolution β n σ
Proof (Lean source)
lemma intermediateCondition_iff (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hnoisy : directResolution β n < σ) : IntermediateCondition β n σ ↔ σ ^ 4 ≤ rateResolution β n σ := by have hd := directResolution_pos_le_one β n hβ hn have hspos : 0 < σ := hd.1.trans hnoisy have hfourpos : 0 < σ ^ 4 := pow_pos hspos 4 have hfourle : σ ^ 4 ≤ 1 := by calc σ ^ 4 ≤ σ ^ 1 := pow_le_pow_of_le_one hspos.le hσ.2 (by omega) _ = σ := pow_one _ _ ≤ 1 := hσ.2 have hroot := unique_rate_root β n σ hβ hn hσ have hrootpos : 0 < rateResolution β n σ := hd.1.trans_le hroot.1.1 have hscoreRoot : rateScore β n σ (rateResolution β n σ) = 0 := by unfold rateScore linarith [hroot.2.1] have hscoreIff : rateScore β n σ (σ ^ 4) ≤ 0 ↔ σ ^ 4 ≤ rateResolution β n σ := by constructor · intro hs by_contra hnot have hlt := lt_of_not_ge hnot have hm := rateScore_strictMonoOn_Ioc β n σ hβ hσ ⟨hrootpos, hroot.1.2⟩ ⟨hfourpos, hfourle⟩ hlt linarith · intro hle have hm := (rateScore_strictMonoOn_Ioc β n σ hβ hσ).monotoneOn ⟨hfourpos, hfourle⟩ ⟨hrootpos, hroot.1.2⟩ hle linarith unfold IntermediateCondition constructor · intro hc apply hscoreIff.mp rw [rateScore_sigma_four β n σ hn hspos hσ.2] linarith · intro hc have hs := hscoreIff.mpr hc rw [rateScore_sigma_four β n σ hn hspos hσ.2] at hs linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.intermediateCondition_iff · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:271
theorem direct_interface

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
heq :
conclusion 1
rateResolution β n σ = σ
conclusion 2
conclusion 3
Proof (Lean source)
lemma direct_interface (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (heq : σ = directResolution β n) : rateResolution β n σ = σ ∧ rateResolution β n σ = directResolution β n ∧ IntermediateEquation β n σ 1 := by have hr := rateResolution_eq_direct_of_le β n σ hβ hn hσ heq.le have hnpos : (0 : ℝ) < n := by positivity have hspos : 0 < σ := heq ▸ (directResolution_pos_le_one β n hβ hn).1 have hprodlog : log ((n : ℝ) * σ ^ (2 * β + 1)) = 0 := by rw [Real.log_mul hnpos.ne' (Real.rpow_pos_of_pos hspos _).ne', Real.log_rpow hspos] simpa [heq] using direct_log_identity β n hβ hn refine ⟨hr.trans heq.symm, hr, ?_⟩ unfold IntermediateEquation simp [hprodlog]
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_interface · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:312
theorem intermediate_compact_interface

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hspos :
0 < σ
heq :
log ((n : ℝ) * σ ^ (4 * (2 * β + 1))) = σ ^ (-2 : ℝ) - 1
conclusion 1
rateResolution β n σ = σ ^ 4
conclusion 2
IntermediateEquation β n σ (σ ^ (-2 : ℝ))
conclusion 3
CompactEquation β n σ (σ ^ (-2 : ℝ))
Proof (Lean source)
lemma intermediate_compact_interface (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hspos : 0 < σ) (heq : log ((n : ℝ) * σ ^ (4 * (2 * β + 1))) = σ ^ (-2 : ℝ) - 1) : rateResolution β n σ = σ ^ 4 ∧ IntermediateEquation β n σ (σ ^ (-2 : ℝ)) ∧ CompactEquation β n σ (σ ^ (-2 : ℝ)) := by have hd := directResolution_pos_le_one β n hβ hn have hfourpos : 0 < σ ^ 4 := pow_pos hspos 4 have hfourle : σ ^ 4 ≤ 1 := by calc σ ^ 4 ≤ σ ^ 1 := pow_le_pow_of_le_one hspos.le hσ.2 (by omega) _ = σ := pow_one _ _ ≤ 1 := hσ.2 have hscoreFour : rateScore β n σ (σ ^ 4) = 0 := by rw [rateScore_sigma_four β n σ hn hspos hσ.2, heq] ring have hdirectle : directResolution β n ≤ σ ^ 4 := by by_contra hnot have hlt : σ ^ 4 < directResolution β n := lt_of_not_ge hnot have hm := rateScore_strictMonoOn_Ioc β n σ hβ hσ ⟨hfourpos, hfourle⟩ hd hlt have hsd := rateScore_direct β n σ hβ hn hσ linarith have hroot := unique_rate_root β n σ hβ hn hσ have hrate : rateResolution β n σ = σ ^ 4 := by symm apply hroot.2.2 (σ ^ 4) ⟨hdirectle, hfourle⟩ unfold rateScore at hscoreFour linarith have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) have hlogProduct : log ((n : ℝ) * σ ^ (2 * β + 1)) = log n + (2 * β + 1) * log σ := by rw [Real.log_mul hnpos.ne' (Real.rpow_pos_of_pos hspos _).ne', Real.log_rpow hspos] have hlogInv : log (σ ^ (-2 : ℝ)) = -2 * log σ := by rw [Real.log_rpow hspos] have hlogThreshold : log n + 4 * (2 * β + 1) * log σ = σ ^ (-2 : ℝ) - 1 := by rw [← heq, Real.log_mul hnpos.ne' (Real.rpow_pos_of_pos hspos _).ne', Real.log_rpow hspos] have hcancel : σ ^ 2 * σ ^ (-2 : ℝ) = 1 := by rw [← Real.rpow_natCast σ 2, ← Real.rpow_add hspos] norm_num refine ⟨hrate, ?_, ?_⟩ · unfold IntermediateEquation rw [hlogInv, hlogProduct] linarith · unfold CompactEquation rw [hlogInv, hcancel, Real.log_one] linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.intermediate_compact_interface · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:328
theorem intermediate_branch_representation

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hnoisy :
hinter :
∃ z : ℝ,
1 < z
z ≤ σ ^ (-2 : ℝ)
rateResolution β n σ = σ * z ^ (-3 / 2 : ℝ)
conclusion 1
z' :
ℝ
1 < z'
z' ≤ σ ^ (-2 : ℝ)
z' = z
Proof (Lean source)
lemma intermediate_branch_representation (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hnoisy : directResolution β n < σ) (hinter : IntermediateCondition β n σ) : ∃ z : ℝ, 1 < z ∧ z ≤ σ ^ (-2 : ℝ) ∧ IntermediateEquation β n σ z ∧ rateResolution β n σ = σ * z ^ (-3 / 2 : ℝ) ∧ ∀ z' : ℝ, 1 < z' → z' ≤ σ ^ (-2 : ℝ) → IntermediateEquation β n σ z' → z' = z := by let H := rateResolution β n σ let z := (σ / H) ^ (2 / 3 : ℝ) have hd := directResolution_pos_le_one β n hβ hn have hi := noisy_rateResolution_interior β n σ hβ hn hσ hnoisy have hHpos : 0 < H := hd.1.trans hi.1 have hspos : 0 < σ := hHpos.trans hi.2 have hbranch : σ ^ 4 ≤ H := (intermediateCondition_iff β n σ hβ hn hσ hnoisy).mp hinter have hzpos : 0 < z := Real.rpow_pos_of_pos (div_pos hspos hHpos) _ have hzone : 1 < z := by apply Real.one_lt_rpow · exact (one_lt_div hHpos).2 hi.2 · norm_num have hzupper : z ≤ σ ^ (-2 : ℝ) := by have hratio : σ / H ≤ σ / σ ^ 4 := div_le_div_of_nonneg_left hspos.le (pow_pos hspos 4) hbranch have hp := Real.rpow_le_rpow (div_nonneg hspos.le hHpos.le) hratio (by norm_num : (0 : ℝ) ≤ 2 / 3) have heq : (σ / σ ^ 4) ^ (2 / 3 : ℝ) = σ ^ (-2 : ℝ) := by rw [Real.div_rpow hspos.le (pow_nonneg hspos.le 4), ← Real.rpow_natCast σ 4, ← Real.rpow_mul hspos.le, ← Real.rpow_sub hspos] norm_num exact hp.trans_eq heq have hcost : 1 + noiseCost H σ = z := by simpa [z] using noiseCost_one_power H σ hHpos hbranch hi.2.le have hroot := unique_rate_root β n σ hβ hn hσ have hrootEq : log n + (2 * β + 1) * log H = z - 1 := by dsimp [H] linarith [hroot.2.1, hcost] have hlogz : log z = (2 / 3 : ℝ) * (log σ - log H) := by dsimp [z] rw [Real.log_rpow (div_pos hspos hHpos), Real.log_div hspos.ne' hHpos.ne'] have hproductlog : log ((n : ℝ) * σ ^ (2 * β + 1)) = log n + (2 * β + 1) * log σ := by have hnpos : (0 : ℝ) < n := Nat.cast_pos.mpr (by omega) rw [Real.log_mul hnpos.ne' (Real.rpow_pos_of_pos hspos _).ne', Real.log_rpow hspos] have hequation : IntermediateEquation β n σ z := by unfold IntermediateEquation rw [hproductlog, hlogz] nlinarith have hresolution : H = σ * z ^ (-3 / 2 : ℝ) := by have hratio : 0 ≤ σ / H := (div_pos hspos hHpos).le dsimp [z] rw [← Real.rpow_mul hratio] norm_num rw [Real.rpow_neg_one] field_simp [hspos.ne', hHpos.ne'] have hunique : ∀ z' : ℝ, 1 < z' → z' ≤ σ ^ (-2 : ℝ) → IntermediateEquation β n σ z' → z' = z := by intro z' hz' _ hz'eq have hcoef : 0 < 3 * (2 * β + 1) / 2 := by nlinarith [hβ.1] apply le_antisymm · by_contra hnot have hlt : z < z' := lt_of_not_ge hnot have hloglt : log z < log z' := Real.strictMonoOn_log hzpos (zero_lt_one.trans hz') hlt unfold IntermediateEquation at hequation hz'eq nlinarith [mul_lt_mul_of_pos_left hloglt hcoef] · by_contra hnot have hlt : z' < z := lt_of_not_ge hnot have hloglt : log z' < log z := Real.strictMonoOn_log (zero_lt_one.trans hz') hzpos hlt unfold IntermediateEquation at hequation hz'eq nlinarith [mul_lt_mul_of_pos_left hloglt hcoef] exact ⟨z, hzone, hzupper, hequation, hresolution, hunique⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.intermediate_branch_representation · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:379
theorem intermediate_branch_bounds

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
hnoisy :
hinter :
S :
1 + log ((n : ℝ) * σ ^ (2 * β + 1))
A :
1 + 3 * (2 * β + 1) / 2
σ / S ^ (3 / 2 : ℝ) ≤ rateResolution β n σ
rateResolution β n σ ≤ A ^ (3 / 2 : ℝ) * (σ / S ^ (3 / 2 : ℝ))
Proof (Lean source)
lemma intermediate_branch_bounds (β : ℝ) (n : ℕ) (σ : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (hnoisy : directResolution β n < σ) (hinter : IntermediateCondition β n σ) : let S := 1 + log ((n : ℝ) * σ ^ (2 * β + 1)) let A := 1 + 3 * (2 * β + 1) / 2 σ / S ^ (3 / 2 : ℝ) ≤ rateResolution β n σ ∧ rateResolution β n σ ≤ A ^ (3 / 2 : ℝ) * (σ / S ^ (3 / 2 : ℝ)) := by dsimp only obtain ⟨z, hz1, _, hzeq, hres, _⟩ := intermediate_branch_representation β n σ hβ hn hσ hnoisy hinter let S := 1 + log ((n : ℝ) * σ ^ (2 * β + 1)) let A := 1 + 3 * (2 * β + 1) / 2 have hspos : 0 < σ := (directResolution_pos_le_one β n hβ hn).1.trans hnoisy have hzpos : 0 < z := zero_lt_one.trans hz1 have hkpos : 0 < 3 * (2 * β + 1) / 2 := by nlinarith [hβ.1] have hApos : 0 < A := by dsimp [A]; linarith have hlognonneg : 0 ≤ log z := Real.log_nonneg hz1.le have hlogle : log z ≤ z := by have := Real.log_le_sub_one_of_pos hzpos linarith have hSeq : S = z + (3 * (2 * β + 1) / 2) * log z := by unfold IntermediateEquation at hzeq dsimp [S] linarith have hSpos : 0 < S := by rw [hSeq]; nlinarith have hzS : z ≤ S := by rw [hSeq]; nlinarith have hSAz : S ≤ A * z := by rw [hSeq] dsimp [A] nlinarith [mul_le_mul_of_nonneg_left hlogle hkpos.le] have hzpowpos : 0 < z ^ (3 / 2 : ℝ) := Real.rpow_pos_of_pos hzpos _ have hSpowpos : 0 < S ^ (3 / 2 : ℝ) := Real.rpow_pos_of_pos hSpos _ have hApowpos : 0 < A ^ (3 / 2 : ℝ) := Real.rpow_pos_of_pos hApos _ have hzpow_le : z ^ (3 / 2 : ℝ) ≤ S ^ (3 / 2 : ℝ) := Real.rpow_le_rpow hzpos.le hzS (by norm_num) have hSpow_le : S ^ (3 / 2 : ℝ) ≤ A ^ (3 / 2 : ℝ) * z ^ (3 / 2 : ℝ) := by calc S ^ (3 / 2 : ℝ) ≤ (A * z) ^ (3 / 2 : ℝ) := Real.rpow_le_rpow hSpos.le hSAz (by norm_num) _ = _ := Real.mul_rpow hApos.le hzpos.le constructor · calc σ / S ^ (3 / 2 : ℝ) ≤ σ / z ^ (3 / 2 : ℝ) := div_le_div_of_nonneg_left hspos.le hzpowpos hzpow_le _ = σ * z ^ (-3 / 2 : ℝ) := by rw [show (-3 / 2 : ℝ) = -(3 / 2 : ℝ) by norm_num, Real.rpow_neg hzpos.le] ring _ = rateResolution β n σ := hres.symm · rw [hres, show (-3 / 2 : ℝ) = -(3 / 2 : ℝ) by norm_num, Real.rpow_neg hzpos.le] change σ / z ^ (3 / 2 : ℝ) ≤ A ^ (3 / 2 : ℝ) * (σ / S ^ (3 / 2 : ℝ)) apply (div_le_iff₀ hzpowpos).2 rw [show A ^ (3 / 2 : ℝ) * (σ / S ^ (3 / 2 : ℝ)) * z ^ (3 / 2 : ℝ) = (A ^ (3 / 2 : ℝ) * σ * z ^ (3 / 2 : ℝ)) / S ^ (3 / 2 : ℝ) by ring] apply (le_div_iff₀ hSpowpos).2 simpa [mul_assoc, mul_left_comm, mul_comm] using (mul_le_mul_of_nonneg_left hSpow_le hspos.le)
CausalSmith.Stat.RdTruesideNoiseFrontier.intermediate_branch_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/ScalarRootCore.lean:454
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.TwoPoint 10 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

The common submeasure bounds the sum of extended absolute risks by separation times overlap. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
T :
Ω → ℝ
hT :
a b :
ℝ
ofReal (|a-b| * (1 - tvDist A B))
≤ (∫⁻ z, ofReal |T z - a| ∂A) + (∫⁻ z, ofReal |T z - b| ∂B)
Proof (Lean source)
lemma twoPoint_absRisk_sum {Ω : Type*} [MeasurableSpace Ω] (A B : Measure Ω) [IsProbabilityMeasure A] [IsProbabilityMeasure B] (T : Ω → ℝ) (hT : Measurable T) (a b : ℝ) : ofReal (|a-b| * (1 - tvDist A B)) ≤ (∫⁻ z, ofReal |T z - a| ∂A) + (∫⁻ z, ofReal |T z - b| ∂B) := by let R := rnCommonPart A B (A+B) have ha : A ≪ A+B := (le_add_of_nonneg_right bot_le).absolutelyContinuous have hb : B ≪ A+B := (le_add_of_nonneg_left bot_le).absolutelyContinuous have hRA := rnCommonPart_le_left A B (A+B) ha have hRB := rnCommonPart_le_right A B (A+B) hb have hmass := rnCommonPart_mass_eq_one_sub_tvDist A B (A+B) ha hb calc ofReal (|a-b| * (1 - tvDist A B)) = ∫⁻ z, ofReal |a-b| ∂(R) := by rw [lintegral_const, hmass, ENNReal.ofReal_mul (abs_nonneg _)] _ ≤ ∫⁻ z, ofReal |T z - a| + ofReal |T z - b| ∂(R) := by apply lintegral_mono intro z calc ofReal |a-b| ≤ ofReal (|T z-a| + |T z-b|) := by apply ENNReal.ofReal_le_ofReal simpa [abs_sub_comm] using abs_sub_le a (T z) b _ ≤ _ := ENNReal.ofReal_add_le _ = (∫⁻ z, ofReal |T z-a| ∂(R)) + (∫⁻ z, ofReal |T z-b| ∂(R)) := by apply lintegral_add_left fun_prop _ ≤ _ := add_le_add (lintegral_mono' hRA le_rfl) (lintegral_mono' hRB le_rfl)
CausalSmith.Stat.RdTruesideNoiseFrontier.twoPoint_absRisk_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:25
theorem twoPoint_interval_lower Lemma twoPoint_interval_lower in the paper ↗

Honesty at two targets and total variation at most one fifth force expected length at least three fifths of separation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
lo hi :
Ω → ℝ
hlo :
hhi :
a b :
ℝ
ha :
(9/10 : ℝ) ≤ A.real (coverageEvent lo hi a)
hb :
(9/10 : ℝ) ≤ B.real (coverageEvent lo hi b)
htv :
tvDist A B ≤ (1/5 : ℝ)
ofReal ((3/5 : ℝ) * |a-b|)
≤ ∫⁻ z, ofReal (intervalLength (lo z) (hi z)) ∂B
Proof (Lean source)
lemma twoPoint_interval_lower {Ω : Type*} [MeasurableSpace Ω] (A B : Measure Ω) [IsProbabilityMeasure A] [IsProbabilityMeasure B] (lo hi : Ω → ℝ) (hlo : Measurable lo) (hhi : Measurable hi) (a b : ℝ) (ha : (9/10 : ℝ) ≤ A.real (Causalean.Stat.coverageEvent lo hi a)) (hb : (9/10 : ℝ) ≤ B.real (Causalean.Stat.coverageEvent lo hi b)) (htv : tvDist A B ≤ (1/5 : ℝ)) : ofReal ((3/5 : ℝ) * |a-b|) ≤ ∫⁻ z, ofReal (intervalLength (lo z) (hi z)) ∂B := by let E := Causalean.Stat.coverageEvent lo hi a let F := Causalean.Stat.coverageEvent lo hi b have hE : MeasurableSet E := Causalean.Stat.measurableSet_coverageEvent hlo hhi have hF : MeasurableSet F := Causalean.Stat.measurableSet_coverageEvent hlo hhi have hgap := abs_measureReal_sub_le_tvDist (μ := A) (ν := B) hE have hboth : (3/5 : ℝ) ≤ B.real (E ∩ F) := by have hu := measureReal_union_add_inter (μ := B) hF (s := E) have hule : B.real (E ∪ F) ≤ 1 := measureReal_le_one change (9/10 : ℝ) ≤ A.real E at ha change (9/10 : ℝ) ≤ B.real F at hb have hg := (abs_le.mp (hgap.trans htv)).2 linarith calc ofReal ((3/5 : ℝ) * |a-b|) ≤ ofReal |a-b| * B (E ∩ F) := by rw [mul_comm (3/5 : ℝ), ENNReal.ofReal_mul (abs_nonneg _)] apply mul_le_mul_right rw [← ENNReal.ofReal_toReal (measure_ne_top B _)] exact ENNReal.ofReal_le_ofReal hboth _ = ∫⁻ z, (E ∩ F).indicator (fun _ => ofReal |a-b|) z ∂B := by rw [lintegral_indicator (hE.inter hF), lintegral_const, Measure.restrict_apply_univ] _ ≤ _ := by apply lintegral_mono intro z by_cases hz : z ∈ E ∩ F · rw [Set.indicator_of_mem hz] apply ENNReal.ofReal_le_ofReal rcases hz with ⟨hza, hzb⟩ change lo z ≤ a ∧ a ≤ hi z at hza change lo z ≤ b ∧ b ≤ hi z at hzb unfold intervalLength exact (show |a-b| ≤ hi z - lo z from abs_le.mpr ⟨by linarith [hza.1, hzb.2], by linarith [hza.2, hzb.1]⟩).trans (le_max_right _ _) · simp [Set.indicator_of_notMem hz]
CausalSmith.Stat.RdTruesideNoiseFrontier.twoPoint_interval_lower · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:55

The independent observed sample is a probability law. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
n :
ℕ
IsProbabilityMeasure (sampleLaw P σ n)
Proof (Lean source)
lemma sampleLaw_probability (P : LatentLaw) (σ : ℝ) (n : ℕ) : IsProbabilityMeasure (sampleLaw P σ n) := by letI := P.prob haveI : IsProbabilityMeasure (Pobs P σ) := by unfold Pobs exact Measure.isProbabilityMeasure_map (obs_measurable σ).aemeasurable unfold sampleLaw infer_instance
CausalSmith.Stat.RdTruesideNoiseFrontier.sampleLaw_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:96

Appending the independent uniform seed preserves probability normalization. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P :
σ :
ℝ
n :
ℕ
Proof (Lean source)
lemma experiment_probability (P : LatentLaw) (σ : ℝ) (n : ℕ) : IsProbabilityMeasure (experiment P σ n) := by letI := sampleLaw_probability P σ n unfold experiment seedLaw infer_instance
CausalSmith.Stat.RdTruesideNoiseFrontier.experiment_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:106

Appending the same independent seed cannot increase total variation. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
P Q :
σ :
ℝ
n :
ℕ
tvDist (experiment P σ n) (experiment Q σ n) ≤ tvDist (sampleLaw P σ n) (sampleLaw Q σ n)
Proof (Lean source)
lemma experiment_tv_le (P Q : LatentLaw) (σ : ℝ) (n : ℕ) : tvDist (experiment P σ n) (experiment Q σ n) ≤ tvDist (sampleLaw P σ n) (sampleLaw Q σ n) := by letI := sampleLaw_probability P σ n letI := sampleLaw_probability Q σ n haveI : IsProbabilityMeasure seedLaw := by unfold seedLaw; infer_instance have h := tvDist_prod_le_add (sampleLaw P σ n) (sampleLaw Q σ n) seedLaw seedLaw have hz : tvDist seedLaw seedLaw = 0 := by unfold tvDist tvDist simp simpa [experiment, hz] using h
CausalSmith.Stat.RdTruesideNoiseFrontier.experiment_tv_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:113

Interior conditional-mean bounds put the target contrast in the half-unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
P :
hP :
Model β σ P
|theta P| ≤ 1/2
Proof (Lean source)
lemma theta_model_bounds (β σ : ℝ) (P : LatentLaw) (hP : Model β σ P) : |theta P| ≤ 1/2 := by have h₀ := hP.means false 0 (by norm_num) have h₁ := hP.means true 0 (by norm_num) unfold theta exact abs_le.mpr ⟨by linarith [h₀.1, h₁.2], by linarith [h₁.1, h₀.2]⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.theta_model_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:127

A lower bound on the sum of two extended risks yields half that bound for their maximum. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
x y :
ℝ≥0∞
c :
ℝ
hc :
0 ≤ c
hsum :
ofReal (2*c) ≤ x+y
ofReal c ≤ max x y
Proof (Lean source)
lemma twoPoint_max_of_sum (x y : ℝ≥0∞) (c : ℝ) (hc : 0 ≤ c) (hsum : ofReal (2*c) ≤ x+y) : ofReal c ≤ max x y := by by_contra h have hx : x < ofReal c := (le_max_left _ _).trans_lt (lt_of_not_ge h) have hy : y < ofReal c := (le_max_right _ _).trans_lt (lt_of_not_ge h) have hadd := ENNReal.add_lt_add hx hy rw [← ENNReal.ofReal_add hc hc, ← two_mul] at hadd exact (not_lt_of_ge hsum) hadd
CausalSmith.Stat.RdTruesideNoiseFrontier.twoPoint_max_of_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:135

The constant-zero estimator makes the extended minimax absolute risk finite. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
minimaxValueENNReal (fun (T : Estimator n) (P : {P // Model β σ P}) => absRisk P.val σ n T.val)
≠ ⊤
Proof (Lean source)
lemma risk_value_ne_top (β σ : ℝ) (n : ℕ) : minimaxValueENNReal (fun (T : Estimator n) (P : {P // Model β σ P}) => absRisk P.val σ n T.val) ≠ ⊤ := by let T : Estimator n := ⟨fun _ => 0, measurable_const⟩ apply ne_top_of_le_ne_top (show (ofReal (1/2 : ℝ)) ≠ ⊤ from ENNReal.ofReal_ne_top) apply (minimaxValueENNReal_le_worstCaseRisk T).trans apply iSup_le intro P letI := experiment_probability P.val σ n change (∫⁻ z, ofReal |0-theta P.val| ∂experiment P.val σ n) ≤ _ simp only [lintegral_const, measure_univ, mul_one] apply ENNReal.ofReal_le_ofReal simpa using theta_model_bounds β σ P.val P.property
CausalSmith.Stat.RdTruesideNoiseFrontier.risk_value_ne_top · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:145

The full target interval is honest and makes the extended minimax length finite. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
minimaxValueENNReal (fun (I : {I // I ∈ honestIntervals β n σ}) (P : {P // Model β σ P}) => expectedLength P.val σ n I.val)
≠ ⊤
Proof (Lean source)
lemma length_value_ne_top (β σ : ℝ) (n : ℕ) : minimaxValueENNReal (fun (I : {I // I ∈ honestIntervals β n σ}) (P : {P // Model β σ P}) => expectedLength P.val σ n I.val) ≠ ⊤ := by let I : IntervalProc n := ⟨fun _ => -1, fun _ => 1, measurable_const, measurable_const, fun _ => by norm_num⟩ have hI : I ∈ honestIntervals β n σ := by intro P hP letI := experiment_probability P σ n have ht := theta_model_bounds β σ P hP have he : coverageEvent I.lo I.hi (theta P) = univ := by ext z simp only [coverageEvent, mem_setOf_eq, mem_Icc, mem_univ, iff_true] change -1 ≤ theta P ∧ theta P ≤ 1 have h := abs_le.mp ht constructor <;> linarith [h.1, h.2] rw [he, probReal_univ] norm_num apply ne_top_of_le_ne_top (show (ofReal (2 : ℝ)) ≠ ⊤ from ENNReal.ofReal_ne_top) apply (minimaxValueENNReal_le_worstCaseRisk ⟨I, hI⟩).trans apply iSup_le intro P letI := experiment_probability P.val σ n change (∫⁻ z, ofReal (intervalLength (-1) 1) ∂experiment P.val σ n) ≤ _ norm_num [intervalLength, lintegral_const]
CausalSmith.Stat.RdTruesideNoiseFrontier.length_value_ne_top · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:160
theorem two_point_transfer

The two-point converse includes the independent random seed and all measurable decisions. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
n m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
hn :
2 ≤ n
hσ :
σ ∈ Icc (0 : ℝ) 1
htv :
tvDist (sampleLaw (altLaw classicalLegendreFacts β b m true hβ hb hm) σ n) (sampleLaw (altLaw classicalLegendreFacts β b m false hβ hb hm) σ n)
≤ (1/5 : ℝ)
conclusion 1
(4/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β ≤ risk β n σ
conclusion 2
(6/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β ≤ lengthRisk β n σ
Proof (Lean source)
-- @node: lem:two-point-transfer lemma two_point_transfer (β b σ : ℝ) (n m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (hn : 2 ≤ n) (hσ : σ ∈ Icc (0 : ℝ) 1) (htv : tvDist (sampleLaw (altLaw classicalLegendreFacts β b m true hβ hb hm) σ n) (sampleLaw (altLaw classicalLegendreFacts β b m false hβ hb hm) σ n) ≤ (1/5 : ℝ)) : (4/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β ≤ risk β n σ ∧ (6/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β ≤ lengthRisk β n σ := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts let P := altLaw legendre_of_gate β b m true hβ hb hm let Q := altLaw legendre_of_gate β b m false hβ hb hm have hlegal := legal_cancellation β b σ m hβ hb hm have hP : Model β σ P := hlegal.2.2.2.2.2.2.2.1 true have hQ : Model β σ Q := hlegal.2.2.2.2.2.2.2.1 false have hsep : |theta P - theta Q| = 2 * kappa * (b/(m : ℝ)^2)^β := hlegal.2.2.2.2.2.2.2.2 letI := experiment_probability P σ n letI := experiment_probability Q σ n have ht : tvDist (experiment P σ n) (experiment Q σ n) ≤ (1/5 : ℝ) := (experiment_tv_le P Q σ n).trans htv have hk : 0 ≤ kappa * (b/(m : ℝ)^2)^β := by apply mul_nonneg (by norm_num [kappa]) exact Real.rpow_nonneg (div_nonneg hb.1.le (sq_nonneg _)) _ constructor · apply (ENNReal.ofReal_le_iff_le_toReal (risk_value_ne_top β σ n)).mp apply le_minimaxValueENNReal_of_two_point (⟨P,hP⟩ : {P // Model β σ P}) (⟨Q,hQ⟩ : {P // Model β σ P}) intro T apply twoPoint_max_of_sum _ _ _ (by nlinarith [hk]) have hs := twoPoint_absRisk_sum (experiment P σ n) (experiment Q σ n) T.val T.property (theta P) (theta Q) change ofReal (2 * ((4/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β)) ≤ _ apply le_trans _ hs apply ENNReal.ofReal_le_ofReal rw [hsep] nlinarith · apply (ENNReal.ofReal_le_iff_le_toReal (length_value_ne_top β σ n)).mp apply le_minimaxValueENNReal intro I have hs := twoPoint_interval_lower (experiment P σ n) (experiment Q σ n) I.val.lo I.val.hi I.val.lo_meas I.val.hi_meas (theta P) (theta Q) (I.property P hP) (I.property Q hQ) ht rw [hsep] at hs have he : (3/5 : ℝ) * (2 * kappa * (b/(m : ℝ)^2)^β) = (6/5 : ℝ) * kappa * (b/(m : ℝ)^2)^β := by ring rw [he] at hs exact hs.trans (le_worstCaseRiskENNReal (risk := fun (I : {I // I ∈ honestIntervals β n σ}) (L : {L // Model β σ L}) => expectedLength L.val σ n I.val) I ⟨Q,hQ⟩)
CausalSmith.Stat.RdTruesideNoiseFrontier.two_point_transfer · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/TwoPoint.lean:188
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.Witness 46 declarations Helpers/Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Helpers/Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

def blockNorm

Legendre block normalizer. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
blockNorm m :
ℝ
(2 * (m : ℝ) + 1) ^ 2 - (m : ℝ) ^ 2
CausalSmith.Stat.RdTruesideNoiseFrontier.blockNorm · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:28
def block

Tapered high-degree Legendre block. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
m :
ℕ
t :
ℝ
block m t :
ℝ
(1 - t) * (blockNorm m)⁻¹ * ∑ j ∈ Icc m (2 * m), (2 * (j : ℝ) + 1) * (-1 : ℝ) ^ j * legendreP j (2 * t - 1)
def legalExtension

Full-interval continuation of the lower perturbation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
b :
ℝ
m :
ℕ
x :
ℝ
legalExtension b m x :
ℝ
if x < 0 then 1 else if x ≤ b then block m (x / b) else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:34
def kappa

The fixed numerical perturbation size. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
kappa :
ℝ
1/100
def witnessSign

The signs index the plus and minus law. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
s :
witnessSign s :
ℝ
if s then 1 else -1
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessSign · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:40
def uniformScore

Uniform latent score law. Given the displayed inputs, this definition specifies the stated object.

Definition (Lean source)
uniformScore :
ofReal (1/2) • volume.restrict (Icc (-1) 1)
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformScore · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:42
def uniformDensity

The uniform score density. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
x :
ℝ
uniformDensity x :
ℝ
if x ∈ Icc (-1 : ℝ) 1 then 1/2 else 0
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformDensity · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:44
def witnessMeasure

Independent conditional Bernoulli potentials and independent Gaussian perturbation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
p :
ℝ → ℝ
witnessMeasure p :
M :
(uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)
(M.prod (gaussianReal 0 1)).map (fun z => (z.1.1.1, z.1.1.2, z.1.2, z.2))
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:46
def witnessMu

Conditional means of the constructed witness law. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
p :
ℝ → ℝ
d :
x :
ℝ
witnessMu p d x :
ℝ
if d then p x else 1/2
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMu · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:51
theorem uniformDensity_properties Lemma uniformDensity_properties in the paper ↗

Uniform density facts, independent of the mean perturbation. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
conclusion 1
conclusion 2
x ∉ Icc (-1 : ℝ) 1 :
conclusion 3
x :
conclusion 4
(∫ x in (-1 : ℝ)..1, uniformDensity x) = 1
Proof (Lean source)
lemma uniformDensity_properties : ContinuousOn uniformDensity (Icc (-1) 1) ∧ (∀ x ∉ Icc (-1 : ℝ) 1, uniformDensity x = 0) ∧ (∀ x, 0 ≤ uniformDensity x) ∧ (∫ x in (-1 : ℝ)..1, uniformDensity x) = 1 := by have heq : EqOn uniformDensity (fun _ => (1/2 : ℝ)) (Icc (-1) 1) := by intro x hx simp [uniformDensity, hx] refine ⟨continuousOn_const.congr heq, ?_, ?_, ?_⟩ · intro x hx simp [uniformDensity, hx] · intro x unfold uniformDensity split_ifs <;> norm_num · rw [intervalIntegral.integral_congr (by simpa using heq)] norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformDensity_properties · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:53
theorem uniformScore_probability Lemma uniformScore_probability in the paper ↗

The uniform score construction has unit total mass. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
Proof (Lean source)
lemma uniformScore_probability : IsProbabilityMeasure uniformScore := by constructor norm_num [uniformScore, Measure.smul_apply, Measure.restrict_apply_univ, Real.volume_Icc] rw [ENNReal.ofReal_div_of_pos (by norm_num)] norm_num exact ENNReal.inv_mul_cancel (by norm_num) (by norm_num)
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformScore_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:69

The uniform score construction is supported on the latent interval. Given the displayed inputs, the stated mathematical conclusion holds.

Formal statement
∀ᵐ x ∂uniformScore, x ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma uniformScore_support : ∀ᵐ x ∂uniformScore, x ∈ Icc (-1 : ℝ) 1 := by exact (Measure.smul_absolutelyContinuous (μ := volume.restrict (Icc (-1 : ℝ) 1)) (c := ofReal (1/2))).ae_le (ae_restrict_mem measurableSet_Icc)
CausalSmith.Stat.RdTruesideNoiseFrontier.uniformScore_support · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:78

A normalized Bernoulli mark preserves the base marginal, including endpoint probabilities. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
μ :
p :
α → ℝ
hm :
hb :
∀ᵐ x ∂μ, 0 ≤ p x ∧ p x ≤ 1
(μ ⊗ₘ bernoulliMarkKernel p).map fst = μ
Proof (Lean source)
lemma bernoulli_compProd_fst {α : Type*} [MeasurableSpace α] (μ : Measure α) [SFinite μ] (p : α → ℝ) (hm : Measurable p) (hb : ∀ᵐ x ∂μ, 0 ≤ p x ∧ p x ≤ 1) : (μ ⊗ₘ bernoulliMarkKernel p).map fst = μ := by have hmass : ∀ᵐ x ∂μ, bernoulliMarkKernel p x univ = 1 := by filter_upwards [hb] with x hx rw [bernoulliMarkKernel_apply p hm x] exact @IsProbabilityMeasure.measure_univ Bool _ _ (bernoulliBool_isProbabilityMeasure hx.1 hx.2) ext s hs rw [Measure.map_apply measurable_fst hs, show fst ⁻¹' s = s ×ˢ univ by ext x; simp, Measure.compProd_apply_prod hs MeasurableSet.univ] calc _ = ∫⁻ _x in s, (1 : ENNReal) ∂μ := by apply setLIntegral_congr_fun_ae hs filter_upwards [hmass] with x hx _ using hx _ = μ s := setLIntegral_one s
CausalSmith.Stat.RdTruesideNoiseFrontier.bernoulli_compProd_fst · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:84

Both conditional marks and the independent Gaussian leave the score marginal unchanged. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hm :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
Proof (Lean source)
lemma witnessMeasure_score (p : ℝ → ℝ) (hm : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : (witnessMeasure p).map score = uniformScore := by letI := uniformScore_probability let K₀ := bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₀ := uniformScore ⊗ₘ K₀ let K₁ := bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) have h₀ : M₀.map fst = uniformScore := bernoulli_compProd_fst uniformScore _ measurable_const (by filter_upwards [] with x; norm_num) have hbound : ∀ᵐ z ∂M₀, 0 ≤ p z.1 ∧ p z.1 ≤ 1 := by change ∀ᵐ z ∂uniformScore ⊗ₘ K₀, 0 ≤ p z.1 ∧ p z.1 ≤ 1 apply Measure.ae_compProd_of_ae_fst (p := fun x => 0 ≤ p x ∧ p x ≤ 1) K₀ ((measurableSet_le measurable_const hm).inter (measurableSet_le hm measurable_const)) filter_upwards [uniformScore_support] with x hx using hb x hx have h₁ : (M₀ ⊗ₘ K₁).map fst = M₀ := bernoulli_compProd_fst M₀ _ (hm.comp measurable_fst) hbound unfold witnessMeasure rw [Measure.map_map (show Measurable score from measurable_fst) (by fun_prop)] change ((M₀ ⊗ₘ K₁).prod (gaussianReal 0 1)).map ((fst ∘ fst) ∘ fst) = uniformScore rw [← Measure.map_map (by fun_prop) measurable_fst, Measure.map_fst_prod] simp only [measure_univ, one_smul] rw [← Measure.map_map measurable_fst measurable_fst, h₁, h₀]
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_score · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:105
theorem witnessMeasure_probability Lemma witnessMeasure_probability in the paper ↗

The conditional Bernoulli construction is a probability law. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hm :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
Proof (Lean source)
lemma witnessMeasure_probability (p : ℝ → ℝ) (hm : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : IsProbabilityMeasure (witnessMeasure p) := by letI := uniformScore_probability have hmap : IsProbabilityMeasure ((witnessMeasure p).map score) := by rw [witnessMeasure_score p hm hb] infer_instance exact Measure.isProbabilityMeasure_of_map score
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:133

Constructed scores stay in the latent interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hm :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
∀ᵐ ω ∂witnessMeasure p, score ω ∈ Icc (-1) 1
Proof (Lean source)
lemma witnessMeasure_support (p : ℝ → ℝ) (hm : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : ∀ᵐ ω ∂witnessMeasure p, score ω ∈ Icc (-1) 1 := by have hs : ∀ᵐ x ∂(witnessMeasure p).map score, x ∈ Icc (-1 : ℝ) 1 := by rw [witnessMeasure_score p hm hb] exact uniformScore_support exact (ae_map_iff (show Measurable score from measurable_fst).aemeasurable measurableSet_Icc).mp hs
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_support · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:142

The score marginal has the fixed uniform density. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hm :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
= volume.withDensity (fun x => ofReal (uniformDensity x))
Proof (Lean source)
lemma witnessMeasure_density (p : ℝ → ℝ) (hm : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : (witnessMeasure p).map score = volume.withDensity (fun x => ofReal (uniformDensity x)) := by rw [witnessMeasure_score p hm hb] have heq : (fun x => ofReal (uniformDensity x)) = (Icc (-1 : ℝ) 1).indicator (fun _ => ofReal (1/2)) := by funext x by_cases hx : x ∈ Icc (-1 : ℝ) 1 <;> simp [uniformDensity, hx] rw [heq, withDensity_indicator measurableSet_Icc, withDensity_const] rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_density · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:151
theorem bernoulli_compProd_setIntegral_bit Lemma bernoulli_compProd_setIntegral_bit in the paper ↗

Integrating the successful Boolean mark over a base event recovers its probability integral. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
α :
μ :
p :
α → ℝ
hm :
hp :
∀ᵐ x ∂μ, 0 ≤ p x
B :
Set α
hB :
(∫ z in fst ⁻¹' B, bit z.2 ∂μ ⊗ₘ bernoulliMarkKernel p)
= ∫ x in B, p x ∂μ
Proof (Lean source)
lemma bernoulli_compProd_setIntegral_bit {α : Type*} [MeasurableSpace α] (μ : Measure α) [SFinite μ] (p : α → ℝ) (hm : Measurable p) (hp : ∀ᵐ x ∂μ, 0 ≤ p x) (B : Set α) (hB : MeasurableSet B) : (∫ z in fst ⁻¹' B, bit z.2 ∂μ ⊗ₘ bernoulliMarkKernel p) = ∫ x in B, p x ∂μ := by have hleft : (∫ z in fst ⁻¹' B, bit z.2 ∂μ ⊗ₘ bernoulliMarkKernel p) = (μ ⊗ₘ bernoulliMarkKernel p).real (B ×ˢ {true}) := by rw [← integral_indicator (hB.preimage measurable_fst)] have heq : (fst ⁻¹' B).indicator (fun z : α × Bool => bit z.2) = (B ×ˢ {true}).indicator (fun _ => (1 : ℝ)) := by funext z rcases z with ⟨x, y⟩ by_cases hx : x ∈ B <;> cases y <;> simp [bit, hx] rw [heq] simpa only [Pi.one_def] using integral_indicator_one (μ := μ ⊗ₘ bernoulliMarkKernel p) (hB.prod (measurableSet_singleton true)) rw [hleft] have hmass : (μ ⊗ₘ bernoulliMarkKernel p) (B ×ˢ {true}) = (μ.withDensity (fun x => ofReal (p x))) B := by rw [Measure.compProd_apply_prod hB (measurableSet_singleton true)] simp_rw [bernoulliMarkKernel_apply_true p hm] exact (withDensity_apply _ hB).symm change toReal _ = _ rw [hmass] calc _ = ∫ _x in B, (1 : ℝ) ∂μ.withDensity (fun x => ofReal (p x)) := by simp [measureReal_def] _ = ∫ x in B, (ofReal (p x)).toReal • (1 : ℝ) ∂μ := setIntegral_withDensity_eq_setIntegral_toReal_smul (by fun_prop) (by filter_upwards [] with x; exact ENNReal.ofReal_lt_top) _ hB _ = ∫ x in B, p x ∂μ := by apply integral_congr_ae filter_upwards [ae_restrict_of_ae hp] with x hx simp [ENNReal.toReal_ofReal hx]
CausalSmith.Stat.RdTruesideNoiseFrontier.bernoulli_compProd_setIntegral_bit · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:162
theorem witnessMeasure_schedule Lemma witnessMeasure_schedule in the paper ↗

Forgetting the independent Gaussian coordinate recovers the two-mark schedule law. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
(witnessMeasure p).map (fun ω => ((score ω, ω.2.1), ω.2.2.1))
= (uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)
Proof (Lean source)
lemma witnessMeasure_schedule (p : ℝ → ℝ) : (witnessMeasure p).map (fun ω => ((score ω, ω.2.1), ω.2.2.1)) = (uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) := by let M := (uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) unfold witnessMeasure rw [Measure.map_map (by unfold score; fun_prop) (by fun_prop)] change (M.prod (gaussianReal 0 1)).map fst = M rw [Measure.map_fst_prod] simp
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_schedule · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:199

The specified Bernoulli probabilities are conditional potential means. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hm :
hc :
ContinuousOn p (Icc (-1) 1)
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
d B :
(∫ ω in {ω | score ω ∈ B}, pot d ω ∂witnessMeasure p)
= ∫ x in B ∩ Icc (-1) 1, witnessMu p d x * uniformDensity x
Proof (Lean source)
lemma witnessMeasure_version (p : ℝ → ℝ) (hm : Measurable p) (hc : ContinuousOn p (Icc (-1) 1)) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : ∀ d B, MeasurableSet B → (∫ ω in {ω | score ω ∈ B}, pot d ω ∂witnessMeasure p) = ∫ x in B ∩ Icc (-1) 1, witnessMu p d x * uniformDensity x := by letI := uniformScore_probability let M₀ := uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2) let M₁ := M₀ ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) have h₀ : M₀.map fst = uniformScore := bernoulli_compProd_fst uniformScore _ measurable_const (by filter_upwards [] with x; norm_num) have hp : ∀ᵐ z ∂M₀, 0 ≤ p z.1 ∧ p z.1 ≤ 1 := by apply Measure.ae_compProd_of_ae_fst (bernoulliMarkKernel (fun _ : ℝ => 1/2)) ((measurableSet_le measurable_const hm).inter (measurableSet_le hm measurable_const)) filter_upwards [uniformScore_support] with x hx using hb x hx have h₁ : M₁.map fst = M₀ := bernoulli_compProd_fst M₀ _ (hm.comp measurable_fst) hp intro d B hB have hschedule := witnessMeasure_schedule p have hpot : Measurable (fun z : (ℝ × Bool) × Bool => bit (if d then z.2 else z.1.2)) := by cases d <;> exact (measurable_of_countable bit).comp (by fun_prop) have hreduce : (∫ ω in {ω | score ω ∈ B}, pot d ω ∂witnessMeasure p) = ∫ z in {z : (ℝ × Bool) × Bool | z.1.1 ∈ B}, bit (if d then z.2 else z.1.2) ∂M₁ := by have heq := setIntegral_map (μ := witnessMeasure p) (g := fun ω => ((score ω, ω.2.1), ω.2.2.1)) (hB.preimage (measurable_fst.comp measurable_fst)) hpot.aestronglyMeasurable (show AEMeasurable (fun ω : Latent => ((score ω, ω.2.1), ω.2.2.1)) (witnessMeasure p) from (by unfold score; fun_prop)) rw [hschedule] at heq exact heq.symm have hmean : (∫ ω in {ω | score ω ∈ B}, pot d ω ∂witnessMeasure p) = ∫ x in B, witnessMu p d x ∂uniformScore := by rw [hreduce] cases d · change (∫ z in fst ⁻¹' (fst ⁻¹' B), bit z.1.2 ∂M₁) = ∫ x in B, (1/2 : ℝ) ∂uniformScore have heq := setIntegral_map (μ := M₁) (g := fst) (f := fun z : ℝ × Bool => bit z.2) (hB.preimage measurable_fst) ((measurable_of_countable bit).comp measurable_snd).aestronglyMeasurable measurable_fst.aemeasurable rw [h₁] at heq exact heq.symm.trans (bernoulli_compProd_setIntegral_bit uniformScore (fun _ => 1/2) measurable_const (by filter_upwards [] with x; norm_num) B hB) · change (∫ z in fst ⁻¹' (fst ⁻¹' B), bit z.2 ∂M₁) = ∫ x in B, p x ∂uniformScore have heq := setIntegral_map (μ := M₀) (g := fst) (f := p) hB hm.aestronglyMeasurable measurable_fst.aemeasurable rw [h₀] at heq exact (bernoulli_compProd_setIntegral_bit M₀ (fun z => p z.1) (hm.comp measurable_fst) (hp.mono fun _ hx => hx.1) _ (hB.preimage measurable_fst)).trans heq.symm rw [hmean] unfold uniformScore rw [Measure.restrict_smul, integral_smul_measure, Measure.restrict_restrict hB] have heq : (fun x => witnessMu p d x * uniformDensity x) =ᵐ[volume.restrict (B ∩ Icc (-1) 1)] fun x => (1/2 : ℝ) • witnessMu p d x := by filter_upwards [ae_restrict_mem (hB.inter measurableSet_Icc)] with x hx simp [uniformDensity, hx.2, smul_eq_mul, mul_comm] rw [integral_congr_ae heq, integral_smul] norm_num
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_version · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:212

Continuous Bernoulli probability yields continuous conditional means. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hc :
ContinuousOn p (Icc (-1) 1)
d :
ContinuousOn (witnessMu p d) (Icc (-1) 1)
Proof (Lean source)
lemma witnessMu_continuous (p : ℝ → ℝ) (hc : ContinuousOn p (Icc (-1) 1)) : ∀ d, ContinuousOn (witnessMu p d) (Icc (-1) 1) := by intro d cases d · exact continuousOn_const · exact hc
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMu_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:275
def bernoulliWitness

Package the explicitly constructed measure and its versions, rather than an arbitrary witness. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
p :
ℝ → ℝ
hm :
hc :
ContinuousOn p (Icc (-1) 1)
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
bernoulliWitness p hm hc hb :
clause 1
clause 2
clause 3
clause 4
clause 5
f_cont := uniformDensity_properties.1
clause 6
f_zero := uniformDensity_properties.2.1
clause 7
f_nonneg := uniformDensity_properties.2.2.1
clause 8
f_int := uniformDensity_properties.2.2.2
clause 9
clause 10
clause 11
mu_cont := witnessMu_continuous p hc
clause 12
mu_version := witnessMeasure_version p hm hc hb
CausalSmith.Stat.RdTruesideNoiseFrontier.bernoulliWitness · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:282
def altProbability

Cancellation witness success probability. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β b :
ℝ
m :
ℕ
s :
x :
ℝ
altProbability β b m s x :
ℝ
1/2 + witnessSign s * kappa * (b / (m : ℝ)^2) ^ β * legalExtension b m x
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:298
theorem legendreP_left_endpoint Lemma legendreP_left_endpoint in the paper ↗

The explicit coefficient formula gives the reversed Legendre left endpoint. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
j :
ℕ
legendreP j (-1) = (-1 : ℝ)^j
Proof (Lean source)
lemma legendreP_left_endpoint (j : ℕ) : legendreP j (-1) = (-1 : ℝ)^j := by have hzero : (aeval (0 : ℝ) (shiftedLegendre j) : ℝ) = 1 := by simp [Polynomial.aeval_def, Polynomial.eval₂_at_zero, Polynomial.coeff_shiftedLegendre] have hs := Polynomial.shiftedLegendre_eval_symm j (1 : ℝ) simpa [legendreP, hzero] using hs
CausalSmith.Stat.RdTruesideNoiseFrontier.legendreP_left_endpoint · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:301
theorem witness_block_weight_sum Lemma witness_block_weight_sum in the paper ↗

The block's positive odd weights sum to its displayed normalization. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
(∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1)) = blockNorm m
Proof (Lean source)
lemma witness_block_weight_sum (m : ℕ) : (∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1)) = blockNorm m := by have hs (n : ℕ) : (∑ j ∈ range n, (2 * (j : ℝ) + 1)) = (n : ℝ)^2 := by induction n with | zero => simp | succ n ih => rw [Finset.sum_range_succ, ih] push_cast ring rw [← Finset.Ico_add_one_right_eq_Icc, Finset.sum_Ico_eq_sub _ (by omega), hs, hs] push_cast unfold blockNorm ring
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_block_weight_sum · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:308

Endpoint normalization follows directly from Mathlib's polynomial coefficients. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
block m 0 = 1
Proof (Lean source)
lemma witness_block_zero (m : ℕ) : block m 0 = 1 := by have hn : 0 < blockNorm m := by unfold blockNorm nlinarith [Nat.cast_nonneg (α := ℝ) m, sq_nonneg (m : ℝ)] have hs : (∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (-1)) = blockNorm m := by calc _ = ∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) := by apply Finset.sum_congr rfl intro j hj rw [legendreP_left_endpoint, mul_assoc, ← mul_pow] simp _ = _ := witness_block_weight_sum m simpa [block, hs] using inv_mul_cancel₀ hn.ne'
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_block_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:323
theorem witness_legalExtension_clamp Lemma witness_legalExtension_clamp in the paper ↗

The continuation is polynomial evaluation at a clamped argument, including both seams. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
x :
ℝ
legalExtension b m x = block m (max 0 (min 1 (x/b)))
Proof (Lean source)
lemma witness_legalExtension_clamp (b : ℝ) (m : ℕ) (hb : 0 < b) (x : ℝ) : legalExtension b m x = block m (max 0 (min 1 (x/b))) := by by_cases hx : x < 0 · have hxb : x/b < 0 := div_neg_of_neg_of_pos hx hb simp [legalExtension, hx, min_eq_right (by linarith : x/b ≤ 1), max_eq_left hxb.le, witness_block_zero] · by_cases hxb : x ≤ b · have h0 : 0 ≤ x/b := div_nonneg (le_of_not_gt hx) hb.le have h1 : x/b ≤ 1 := (div_le_one hb).mpr hxb simp [legalExtension, hx, hxb, min_eq_right h1, max_eq_right h0] · have h1 : 1 ≤ x/b := (le_div_iff₀ hb).mpr (by linarith) simp [legalExtension, hx, hxb, min_eq_left h1, block]
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_legalExtension_clamp · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:339
theorem witness_legalExtension_continuous Lemma witness_legalExtension_continuous in the paper ↗

Given the positive continuation width, matching endpoint values make the full continuation continuous across both seams.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
Proof (Lean source)
@[fun_prop] lemma witness_legalExtension_continuous (b : ℝ) (m : ℕ) (hb : 0 < b) : Continuous (legalExtension b m) := by have heq : legalExtension b m = fun x => block m (max 0 (min 1 (x/b))) := by funext x exact witness_legalExtension_clamp b m hb x rw [heq] unfold block legendreP fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_legalExtension_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:353
theorem altProbability_continuous Lemma altProbability_continuous in the paper ↗

Given the positive continuation width, affine Bernoulli perturbations inherit continuity from the full continuation.

Formal statement
β b :
ℝ
m :
ℕ
s :
hb :
0 < b
Proof (Lean source)
@[fun_prop] lemma altProbability_continuous (β b : ℝ) (m : ℕ) (s : Bool) (hb : 0 < b) : Continuous (altProbability β b m s) := by unfold altProbability fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:363

The block normalizer is strictly positive, including at degree zero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
m :
ℕ
0 < blockNorm m
Proof (Lean source)
lemma blockNorm_pos (m : ℕ) : 0 < blockNorm m := by unfold blockNorm have hm : (0 : ℝ) ≤ m := Nat.cast_nonneg m nlinarith [sq_nonneg (m : ℝ)]
CausalSmith.Stat.RdTruesideNoiseFrontier.blockNorm_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:369
theorem witness_block_abs_le_one Lemma witness_block_abs_le_one in the paper ↗

The cited Legendre unit bound controls the tapered block on the whole unit interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
legendre_of_gate :
m :
ℕ
t :
ℝ
ht :
t ∈ Icc (0 : ℝ) 1
|block m t| ≤ 1
Proof (Lean source)
lemma witness_block_abs_le_one (legendre_of_gate : ClassicalLegendreFacts) (m : ℕ) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : |block m t| ≤ 1 := by have hleg (j : ℕ) : |legendreP j (2*t-1)| ≤ 1 := (legendre_of_gate j 0).2.2.1 _ ⟨by linarith [ht.1], by linarith [ht.2]⟩ have hsum : |∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (2*t-1)| ≤ blockNorm m := by calc _ ≤ ∑ j ∈ Icc m (2*m), |(2 * (j : ℝ) + 1) * (-1 : ℝ)^j * legendreP j (2*t-1)| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Icc m (2*m), (2 * (j : ℝ) + 1) := by apply Finset.sum_le_sum intro j hj have hw : 0 ≤ 2 * (j : ℝ) + 1 := by positivity simp only [abs_mul, abs_pow, abs_neg, abs_one, one_pow, mul_one, abs_of_nonneg hw] exact mul_le_of_le_one_right hw (hleg j) _ = blockNorm m := witness_block_weight_sum m have hn := blockNorm_pos m have htaper : |1-t| ≤ 1 := by rw [abs_of_nonneg (by linarith [ht.2])]; linarith [ht.1] unfold block rw [abs_mul, abs_mul, abs_of_pos (inv_pos.mpr hn)] calc _ ≤ 1 * (blockNorm m)⁻¹ * blockNorm m := mul_le_mul (mul_le_mul_of_nonneg_right htaper (le_of_lt (inv_pos.mpr hn))) hsum (abs_nonneg _) (by positivity) _ = 1 := by simp [hn.ne']
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_block_abs_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:375
theorem witness_legalExtension_abs_le_one Lemma witness_legalExtension_abs_le_one in the paper ↗

Clamping keeps the continuation within the Legendre block's unit bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
0 < b
x :
ℝ
|legalExtension b m x| ≤ 1
Proof (Lean source)
lemma witness_legalExtension_abs_le_one (hleg : ClassicalLegendreFacts) (b : ℝ) (m : ℕ) (hb : 0 < b) (x : ℝ) : |legalExtension b m x| ≤ 1 := by rw [witness_legalExtension_clamp b m hb x] apply witness_block_abs_le_one hleg exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.witness_legalExtension_abs_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:404
theorem altProbability_properties Lemma altProbability_properties in the paper ↗

The displayed scope makes the cancellation construction a continuous Bernoulli probability. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
conclusion 1
conclusion 2
ContinuousOn (altProbability β b m s) (Icc (-1) 1)
conclusion 3
x ∈ Icc (-1 : ℝ) 1 :
0 ≤ altProbability β b m s x
altProbability β b m s x ≤ 1
Proof (Lean source)
lemma altProbability_properties (hleg : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : Measurable (altProbability β b m s) ∧ ContinuousOn (altProbability β b m s) (Icc (-1) 1) ∧ (∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ altProbability β b m s x ∧ altProbability β b m s x ≤ 1) := by have hc := altProbability_continuous β b m s hb.1 refine ⟨hc.measurable, hc.continuousOn, ?_⟩ intro x hx have hm1 : (1 : ℝ) ≤ (m : ℝ)^2 := by have hm2 : (2 : ℝ) ≤ m := by exact_mod_cast hm nlinarith have hr0 : 0 ≤ b / (m : ℝ)^2 := div_nonneg hb.1.le (sq_nonneg _) have hr1 : b / (m : ℝ)^2 ≤ 1 := (div_le_one (by positivity)).mpr (hb.2.trans hm1) have hp0 := Real.rpow_nonneg hr0 β have hp1 := Real.rpow_le_one hr0 hr1 hβ.1.le have hv := witness_legalExtension_abs_le_one hleg b m hb.1 x have hprod : |(b/(m : ℝ)^2)^β * legalExtension b m x| ≤ 1 := by rw [abs_mul, abs_of_nonneg hp0] exact (mul_le_mul_of_nonneg_left hv hp0).trans (by simpa using hp1) have hbounds := abs_le.mp hprod cases s <;> simp only [altProbability, witnessSign, Bool.false_eq_true, if_false, if_true, kappa] · constructor <;> nlinarith [hbounds.1, hbounds.2] · constructor <;> nlinarith [hbounds.1, hbounds.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_properties · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:411
def altLaw

The actual cancellation alternatives, on their stated parameter domains. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β b :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
altLaw hleg β b m s hβ hb hm :
bernoulliWitness (altProbability β b m s) (altProbability_properties hleg β b m s hβ hb hm).1 (altProbability_properties hleg β b m s hβ hb hm).2.1 (altProbability_properties hleg β b m s hβ hb hm).2.2
def noiseSupport

Noise-adapted support width. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
m :
ℕ
noiseSupport σ m :
ℝ
min 1 (σ * sqrt m / 8)
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseSupport · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:442
def noiseResolution

Noise-adapted endpoint resolution. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ :
ℝ
m :
ℕ
noiseResolution σ m :
ℝ
noiseSupport σ m / (m : ℝ)^2
CausalSmith.Stat.RdTruesideNoiseFrontier.noiseResolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:445
def directBump

The direct local bump. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
h x :
ℝ
directBump h x :
ℝ
if x < 0 then 1 else max (1 - x/h) 0
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:447
def directProbability

Direct witness success probability. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
s :
x :
ℝ
directProbability β h s x :
ℝ
1/2 + witnessSign s * kappa * h ^ β * directBump h x
CausalSmith.Stat.RdTruesideNoiseFrontier.directProbability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:450

The direct extension is a continuous clipped linear function for positive width. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x :
ℝ
directBump h x = max (1 - max x 0 / h) 0
Proof (Lean source)
lemma directBump_eq_clipped (h : ℝ) (hh : 0 < h) (x : ℝ) : directBump h x = max (1 - max x 0 / h) 0 := by by_cases hx : x < 0 · simp [directBump, hx, max_eq_right hx.le] · simp [directBump, hx, max_eq_left (le_of_not_gt hx)]
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_eq_clipped · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:453

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
Proof (Lean source)
@[fun_prop] lemma directBump_continuous (h : ℝ) (hh : 0 < h) : Continuous (directBump h) := by have heq : directBump h = fun x => max (1 - max x 0 / h) 0 := funext (directBump_eq_clipped h hh) rw [heq] fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_continuous · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:459

Clipping keeps the full direct extension between zero and one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
h :
ℝ
hh :
0 < h
x :
ℝ
directBump h x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma directBump_mem (h : ℝ) (hh : 0 < h) (x : ℝ) : directBump h x ∈ Icc (0 : ℝ) 1 := by rw [directBump_eq_clipped h hh x] refine ⟨le_max_right _ _, max_le ?_ (by norm_num)⟩ have hdiv : 0 ≤ max x 0 / h := div_nonneg (le_max_right _ _) hh.le linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.directBump_mem · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:466
theorem directProbability_properties Lemma directProbability_properties in the paper ↗

Direct witness probabilities are valid under their stated parameter scope. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
conclusion 1
conclusion 2
ContinuousOn (directProbability β h s) (Icc (-1) 1)
conclusion 3
x ∈ Icc (-1 : ℝ) 1 :
0 ≤ directProbability β h s x
directProbability β h s x ≤ 1
Proof (Lean source)
lemma directProbability_properties (β h : ℝ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hh : h ∈ Ioc (0 : ℝ) 1) : Measurable (directProbability β h s) ∧ ContinuousOn (directProbability β h s) (Icc (-1) 1) ∧ (∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ directProbability β h s x ∧ directProbability β h s x ≤ 1) := by have hhpos : 0 < h := hh.1 have hc : Continuous (directProbability β h s) := by unfold directProbability fun_prop refine ⟨?_, hc.continuousOn, ?_⟩ · fun_prop · intro x hx have hb := directBump_mem h hh.1 x have hp0 := Real.rpow_nonneg hh.1.le β have hp1 := Real.rpow_le_one hh.1.le hh.2 hβ.1.le have hprod0 : 0 ≤ h ^ β * directBump h x := mul_nonneg hp0 hb.1 have hprod1 : h ^ β * directBump h x ≤ 1 := by calc h ^ β * directBump h x ≤ 1 * 1 := mul_le_mul hp1 hb.2 hb.1 (by norm_num) _ = 1 := by norm_num cases s <;> simp only [directProbability, witnessSign, Bool.false_eq_true, if_false, if_true, kappa] · constructor <;> nlinarith [hprod0, hprod1] · constructor <;> nlinarith [hprod0, hprod1]
CausalSmith.Stat.RdTruesideNoiseFrontier.directProbability_properties · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:473
def directAltLaw

The actual direct alternatives, with the same Bernoulli and error construction. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β h :
ℝ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hh :
h ∈ Ioc (0 : ℝ) 1
directAltLaw β h s hβ hh :
CausalSmith.Stat.RdTruesideNoiseFrontier.directAltLaw · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:497
def treatedConvolution

Unmarked treated convolution density. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
σ w :
ℝ
treatedConvolution σ w :
ℝ
∫ x in (0 : ℝ)..1, phi σ (w - x)
CausalSmith.Stat.RdTruesideNoiseFrontier.treatedConvolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:504
def markedConvolution

Signed marked convolution perturbation. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
b :
ℝ
m :
ℕ
σ w :
ℝ
markedConvolution b m σ w :
ℝ
∫ x in (0 : ℝ)..b, block m (x/b) * phi σ (w - x)
CausalSmith.Stat.RdTruesideNoiseFrontier.markedConvolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:507
def likelihoodLambda

Support-to-noise ratio. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
b σ :
ℝ
likelihoodLambda b σ :
ℝ
b ^ 2 / (4 * σ ^ 2)
CausalSmith.Stat.RdTruesideNoiseFrontier.likelihoodLambda · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/Witness.lean:510
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.Helpers.WitnessModel 8 declarations The product construction supplies the Gaussian marginal and joint independence.

Model membership of the cancellation witnesses

The product construction supplies the Gaussian marginal and joint independence. The unit and Hölder bounds keep the conditional means inside the benchmark class.

theorem witnessMeasure_schedule_probability Lemma witnessMeasure_schedule_probability in the paper ↗

The two-mark schedule law is a probability measure for valid Bernoulli probabilities. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
IsProbabilityMeasure ((uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1))
Proof (Lean source)
lemma witnessMeasure_schedule_probability (p : ℝ → ℝ) (hp : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : IsProbabilityMeasure ((uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1)) := by letI := witnessMeasure_probability p hp hb rw [← witnessMeasure_schedule p] exact Measure.isProbabilityMeasure_map (by unfold score; fun_prop)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_schedule_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:19

The independent product Gaussian survives the coordinate rearrangement. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
Proof (Lean source)
lemma witnessMeasure_error (p : ℝ → ℝ) (hp : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : (witnessMeasure p).map errorCoord = gaussianReal 0 1 := by letI := witnessMeasure_schedule_probability p hp hb unfold witnessMeasure rw [Measure.map_map (by unfold errorCoord; fun_prop) (by fun_prop)] change Measure.map snd _ = _ rw [Measure.map_snd_prod, measure_univ, one_smul]
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_error · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:29
theorem witnessMeasure_error_independent Lemma witnessMeasure_error_independent in the paper ↗

The Gaussian is independent of the score and both potentials jointly. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
p :
ℝ → ℝ
hp :
hb :
∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1
IndepFun errorCoord (fun ω : Latent => (score ω, ω.2.1, ω.2.2.1)) (witnessMeasure p)
Proof (Lean source)
lemma witnessMeasure_error_independent (p : ℝ → ℝ) (hp : Measurable p) (hb : ∀ x ∈ Icc (-1 : ℝ) 1, 0 ≤ p x ∧ p x ≤ 1) : IndepFun errorCoord (fun ω : Latent => (score ω, ω.2.1, ω.2.2.1)) (witnessMeasure p) := by let M := (uniformScore ⊗ₘ bernoulliMarkKernel (fun _ : ℝ => 1/2)) ⊗ₘ bernoulliMarkKernel (fun z : ℝ × Bool => p z.1) letI : IsProbabilityMeasure M := witnessMeasure_schedule_probability p hp hb letI := witnessMeasure_probability p hp hb apply (indepFun_iff_map_prod_eq_prod_map_map (by unfold errorCoord; fun_prop) (by unfold score; fun_prop)).2 unfold witnessMeasure rw [Measure.map_map (by unfold errorCoord score; fun_prop) (by fun_prop), Measure.map_map (by unfold errorCoord; fun_prop) (by fun_prop), Measure.map_map (by unfold score; fun_prop) (by fun_prop)] exact (indepFun_prod (μ := M) (ν := gaussianReal 0 1) (X := fun z : (ℝ × Bool) × Bool => (z.1.1, z.1.2, z.2)) (Y := fun z : ℝ => z) (by fun_prop) measurable_id).symm.map_prod_eq_prod_map_map (by unfold errorCoord; fun_prop) (by unfold score; fun_prop)
CausalSmith.Stat.RdTruesideNoiseFrontier.witnessMeasure_error_independent · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:39
theorem cancellationResolution_mem Lemma cancellationResolution_mem in the paper ↗

Legal widths and degrees give a positive endpoint resolution at most one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b :
ℝ
m :
ℕ
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
b / (m : ℝ)^2 ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
lemma cancellationResolution_mem (b : ℝ) (m : ℕ) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : b / (m : ℝ)^2 ∈ Ioc (0 : ℝ) 1 := by have hm1 : (1 : ℝ) ≤ m := by exact_mod_cast (show 1 ≤ m by omega) have hm2 : (1 : ℝ) ≤ (m : ℝ)^2 := by nlinarith exact ⟨div_pos hb.1 (by positivity), (div_le_one (by positivity)).2 (by linarith [hb.2])⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.cancellationResolution_mem · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:59
theorem legalExtension_holder_pointwise Lemma legalExtension_holder_pointwise in the paper ↗

Extract the pointwise modulus from the established full-domain seminorm bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
0 < b
hm :
2 ≤ m
x t :
ℝ
hx :
x ∈ Icc (-1 : ℝ) 1
ht :
t ∈ Icc (-1 : ℝ) 1
|legalExtension b m x - legalExtension b m t| ≤ 7 * (b/(m : ℝ)^2)^(-β) * |x-t|^β
Proof (Lean source)
lemma legalExtension_holder_pointwise (hleg : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : 0 < b) (hm : 2 ≤ m) (x t : ℝ) (hx : x ∈ Icc (-1 : ℝ) 1) (ht : t ∈ Icc (-1 : ℝ) 1) : |legalExtension b m x - legalExtension b m t| ≤ 7 * (b/(m : ℝ)^2)^(-β) * |x-t|^β := by by_cases hxt : x = t · subst t simp only [sub_self, abs_zero] positivity have hd : 0 < |x-t| := abs_pos.mpr (sub_ne_zero.mpr hxt) have hquot : ofReal (|legalExtension b m x - legalExtension b m t| / |x-t|^β) ≤ holderSeminorm β (legalExtension b m) := by exact le_sSup ⟨x, hx, t, ht, hxt, rfl⟩ have hbnd := hquot.trans (legalExtension_holder_bound hleg β b m hβ hb hm) have hr := (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hbnd exact (div_le_iff₀ (Real.rpow_pos_of_pos hd β)).mp hr
CausalSmith.Stat.RdTruesideNoiseFrontier.legalExtension_holder_pointwise · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:66
theorem altProbability_mean_bounds Lemma altProbability_mean_bounds in the paper ↗

The small perturbation keeps the treated mean in the model's interior interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
x :
ℝ
conclusion 1
1/4 ≤ altProbability β b m s x
conclusion 2
altProbability β b m s x ≤ 3/4
Proof (Lean source)
lemma altProbability_mean_bounds (hleg : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (x : ℝ) : 1/4 ≤ altProbability β b m s x ∧ altProbability β b m s x ≤ 3/4 := by have hr := cancellationResolution_mem b m hb hm have hp0 := Real.rpow_nonneg hr.1.le β have hp1 := Real.rpow_le_one hr.1.le hr.2 hβ.1.le have hv := legalExtension_abs_le_one hleg b m hb.1 x have hprod : |(b/(m : ℝ)^2)^β * legalExtension b m x| ≤ 1 := by rw [abs_mul, abs_of_nonneg hp0] exact (mul_le_mul_of_nonneg_left hv hp0).trans (by simpa using hp1) have hbounds := abs_le.mp hprod cases s <;> simp only [altProbability, witnessSign, Bool.false_eq_true, if_false, if_true, kappa] · constructor <;> nlinarith [hbounds.1, hbounds.2] · constructor <;> nlinarith [hbounds.1, hbounds.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_mean_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:84

The perturbation amplitude cancels the resolution factor in its Hölder modulus. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
x t :
ℝ
hx :
x ∈ Icc (-1 : ℝ) 1
ht :
t ∈ Icc (-1 : ℝ) 1
|altProbability β b m s x - altProbability β b m s t| ≤ 2 * |x-t|^β
Proof (Lean source)
lemma altProbability_holder (hleg : ClassicalLegendreFacts) (β b : ℝ) (m : ℕ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) (x t : ℝ) (hx : x ∈ Icc (-1 : ℝ) 1) (ht : t ∈ Icc (-1 : ℝ) 1) : |altProbability β b m s x - altProbability β b m s t| ≤ 2 * |x-t|^β := by have hr := cancellationResolution_mem b m hb hm have hp0 := Real.rpow_nonneg hr.1.le β have hcancel : (b/(m : ℝ)^2)^β * (b/(m : ℝ)^2)^(-β) = 1 := by rw [← Real.rpow_add hr.1] simp have hv := legalExtension_holder_pointwise hleg β b m hβ hb.1 hm x t hx ht have hsign : |witnessSign s| = 1 := by cases s <;> norm_num [witnessSign] have heq : altProbability β b m s x - altProbability β b m s t = witnessSign s * kappa * (b/(m : ℝ)^2)^β * (legalExtension b m x - legalExtension b m t) := by unfold altProbability; ring rw [heq, abs_mul, abs_mul, abs_mul, hsign, abs_of_nonneg hp0] norm_num [kappa] calc _ ≤ 1/100 * (b/(m : ℝ)^2)^β * (7 * (b/(m : ℝ)^2)^(-β) * |x-t|^β) := mul_le_mul_of_nonneg_left hv (by positivity) _ = (7/100 : ℝ) * ((b/(m : ℝ)^2)^β * (b/(m : ℝ)^2)^(-β)) * |x-t|^β := by ring _ = (7/100 : ℝ) * |x-t|^β := by rw [hcancel, mul_one] _ ≤ _ := mul_le_mul_of_nonneg_right (by norm_num) (Real.rpow_nonneg (abs_nonneg _) _)
CausalSmith.Stat.RdTruesideNoiseFrontier.altProbability_holder · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/Helpers/WitnessModel.lean:100

All five model atoms hold for each constructed cancellation alternative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β b σ :
ℝ
m :
ℕ
s :
hβ :
β ∈ Ioc (0 : ℝ) 1
hb :
b ∈ Ioc (0 : ℝ) 1
hm :
2 ≤ m
Model β σ (altLaw hleg β b m s hβ hb hm)
Proof (Lean source)
lemma altLaw_model (hleg : ClassicalLegendreFacts) (β b σ : ℝ) (m : ℕ) (s : Bool) (hβ : β ∈ Ioc (0 : ℝ) 1) (hb : b ∈ Ioc (0 : ℝ) 1) (hm : 2 ≤ m) : Model β σ (altLaw hleg β b m s hβ hb hm) := by have hp := altProbability_properties hleg β b m s hβ hb hm constructor · exact witnessMeasure_error _ hp.1 hp.2.2 · exact witnessMeasure_error_independent _ hp.1 hp.2.2 · intro x hx change 1/4 ≤ uniformDensity x ∧ uniformDensity x ≤ 3/4 norm_num [uniformDensity, hx] · intro d x hx change 1/4 ≤ witnessMu (altProbability β b m s) d x ∧ witnessMu (altProbability β b m s) d x ≤ 3/4 cases d · norm_num [witnessMu] · exact altProbability_mean_bounds hleg β b m s hβ hb hm x · intro d x hx t ht change |witnessMu (altProbability β b m s) d x - witnessMu (altProbability β b m s) d t| ≤ _ cases d · simp only [witnessMu, Bool.false_eq_true, if_false, sub_self, abs_zero] positivity · exact altProbability_holder hleg β b m s hβ hb hm x t hx ht
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.TDirectReduction 9 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

At zero noise only derivative order zero contributes to the public variance. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
kernelVariance L 0 = (3/4 : ℝ) * ∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2
Proof (Lean source)
lemma kernelVariance_zero (L : ℕ) : kernelVariance L 0 = (3/4 : ℝ) * ∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2 := by unfold kernelVariance have ht (j : ℕ) : (0 : ℝ)^(2*j) / (Nat.factorial j : ℝ) * (∫ x in (0 : ℝ)..1, ((polyDeriv j (endpointKernel L)).eval x)^2) = if j = 0 then (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) else 0 := by by_cases hj : j = 0 · subst j simp [polyDeriv] · simp [hj, show 2*j ≠ 0 by omega] simp_rw [ht] simp
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_zero · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:24
theorem direct_degree_floor_bounds Lemma direct_degree_floor_bounds in the paper ↗

Rounding a real degree at least one down loses at most a factor two, even for the small-sample range between one and two. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
a :
ℝ
ha :
1 ≤ a
conclusion 1
1 ≤ ⌊a⌋₊
conclusion 2
a/2 ≤ (⌊a⌋₊ : ℝ)
conclusion 3
(⌊a⌋₊ : ℝ) ≤ a
conclusion 4
⌊a⌋₊ ≤ ⌈a⌉₊
Proof (Lean source)
lemma direct_degree_floor_bounds (a : ℝ) (ha : 1 ≤ a) : 1 ≤ ⌊a⌋₊ ∧ a/2 ≤ (⌊a⌋₊ : ℝ) ∧ (⌊a⌋₊ : ℝ) ≤ a ∧ ⌊a⌋₊ ≤ ⌈a⌉₊ := by have hL := (Nat.one_le_floor_iff a).mpr ha have hLr : (1 : ℝ) ≤ ⌊a⌋₊ := by exact_mod_cast hL have hlt := Nat.lt_floor_add_one a exact ⟨hL, by linarith, Nat.floor_le (by linarith), Nat.floor_le_ceil a⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_degree_floor_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:40
theorem direct_degree_rate_identities Lemma direct_degree_rate_identities in the paper ↗

The direct degree balances the negative kernel-bias exponent and the square-root variance exponent at the same noiseless rate. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β N :
ℝ
hβ :
0 < β
hN :
0 < N
conclusion 1
(N ^ (1/(4*β+2))) ^ (-2*β) = N ^ (-β/(2*β+1))
conclusion 2
N ^ (1/(4*β+2)) / sqrt N = N ^ (-β/(2*β+1))
Proof (Lean source)
lemma direct_degree_rate_identities (β N : ℝ) (hβ : 0 < β) (hN : 0 < N) : (N ^ (1/(4*β+2))) ^ (-2*β) = N ^ (-β/(2*β+1)) ∧ N ^ (1/(4*β+2)) / sqrt N = N ^ (-β/(2*β+1)) := by have hd : 2*β+1 ≠ 0 := by linarith constructor · rw [← Real.rpow_mul hN.le] congr 1 field_simp ring · rw [Real.sqrt_eq_rpow, ← Real.rpow_sub hN] congr 1 field_simp ring
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_degree_rate_identities · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:49
theorem direct_degree_bias_bound Lemma direct_degree_bias_bound in the paper ↗

The rounded direct degree obeys the endpoint bias bound with a uniform factor four because the public smoothness is at most one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β a C :
ℝ
L :
ℕ
hβ :
β ∈ Ioc (0 : ℝ) 1
ha :
1 ≤ a
hC :
0 ≤ C
hLa :
a/2 ≤ (L : ℝ)
hbias :
kernelMoment L β ≤ C * (L : ℝ)^(-2*β)
kernelMoment L β ≤ 4*C*a^(-2*β)
Proof (Lean source)
lemma direct_degree_bias_bound (β a C : ℝ) (L : ℕ) (hβ : β ∈ Ioc (0 : ℝ) 1) (ha : 1 ≤ a) (hC : 0 ≤ C) (hLa : a/2 ≤ (L : ℝ)) (hbias : kernelMoment L β ≤ C * (L : ℝ)^(-2*β)) : kernelMoment L β ≤ 4*C*a^(-2*β) := by have ha0 : 0 < a := by linarith have hp := Real.rpow_le_rpow_of_nonpos (by positivity : 0 < a/2) hLa (by linarith [hβ.1] : -2*β ≤ 0) have he : (a/2)^(-2*β) = a^(-2*β) * (2 : ℝ)^(2*β) := by rw [Real.div_rpow ha0.le (by norm_num), show -2*β = -(2*β) by ring, Real.rpow_neg (by norm_num : (0 : ℝ) ≤ 2)] simp only [div_inv_eq_mul] have htwo : (2 : ℝ)^(2*β) ≤ 4 := by calc _ ≤ (2 : ℝ)^(2 : ℝ) := Real.rpow_le_rpow_of_exponent_le (by norm_num) (by linarith [hβ.2]) _ = 4 := by norm_num calc _ ≤ C*(L : ℝ)^(-2*β) := hbias _ ≤ C*(a/2)^(-2*β) := mul_le_mul_of_nonneg_left hp hC _ = C*(a^(-2*β) * (2 : ℝ)^(2*β)) := by rw [he] _ ≤ 4*C*a^(-2*β) := by have hh := mul_le_mul_of_nonneg_left htwo (mul_nonneg hC (Real.rpow_nonneg ha0.le (-2*β))) simpa only [mul_assoc, mul_comm, mul_left_comm] using hh
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_degree_bias_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:65
theorem direct_degree_variance_bound Lemma direct_degree_variance_bound in the paper ↗

The zero-noise covariance formula and endpoint squared-mass estimate bound the public standard-deviation contribution at any degree below a. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
a C N :
ℝ
L :
ℕ
ha :
0 ≤ a
hC :
0 ≤ C
hN :
0 < N
hLa :
(L : ℝ) ≤ a
hsq :
(∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ C*(L : ℝ)^2
sqrt (40*kernelVariance L 0/N) ≤ sqrt (30*C)*a/sqrt N
Proof (Lean source)
lemma direct_degree_variance_bound (a C N : ℝ) (L : ℕ) (ha : 0 ≤ a) (hC : 0 ≤ C) (hN : 0 < N) (hLa : (L : ℝ) ≤ a) (hsq : (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) ≤ C*(L : ℝ)^2) : sqrt (40*kernelVariance L 0/N) ≤ sqrt (30*C)*a/sqrt N := by have hvar : 40*kernelVariance L 0/N ≤ (30*C)*a^2/N := by rw [kernelVariance_zero] apply div_le_div_of_nonneg_right _ hN.le have hpow := pow_le_pow_left₀ (by positivity : (0 : ℝ) ≤ L) hLa 2 have hm := mul_le_mul_of_nonneg_left hpow hC nlinarith only [hsq, hm] apply (Real.sqrt_le_sqrt hvar).trans_eq rw [Real.sqrt_div (by positivity), Real.sqrt_mul (by positivity), Real.sqrt_sq ha]
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_degree_variance_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:91
theorem certificate_zero_rate_bound Lemma certificate_zero_rate_bound in the paper ↗

Public minimization inherits the direct-RD noiseless order from the rounded balanced degree, using the positive endpoint kernel bounds. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ C : ℝ,
0 < C
conclusion 1
n :
ℕ
2 ≤ n
certificate β n 0 ≤ C*(n : ℝ)^(-β/(2*β+1))
Proof (Lean source)
lemma certificate_zero_rate_bound (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ C : ℝ, 0 < C ∧ ∀ n : ℕ, 2 ≤ n → certificate β n 0 ≤ C*(n : ℝ)^(-β/(2*β+1)) := by obtain ⟨K, hK, hk⟩ := positive_endpoint β hβ refine ⟨48*K + 28*sqrt (30*K), by positivity, ?_⟩ intro n hn have hN : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by omega) have hβpos := hβ.1 let a : ℝ := (n : ℝ)^(1/(4*β+2)) have ha : 1 ≤ a := Real.one_le_rpow (by exact_mod_cast (show 1 ≤ n by omega)) (by positivity) obtain ⟨hL, hlo, hhi, hcap⟩ := direct_degree_floor_bounds a ha have hb := direct_degree_bias_bound β a K ⌊a⌋₊ hβ ha hK.le hlo (hk _ hL).2.2.1 have hv := direct_degree_variance_bound a K n ⌊a⌋₊ (by linarith) hK.le hN hhi (hk _ hL).2.2.2 have hid := direct_degree_rate_identities β n hβ.1 hN change a^(-2*β) = _ ∧ a/sqrt (n : ℝ) = _ at hid rw [hid.1] at hb rw [show sqrt (30*K)*a/sqrt (n : ℝ) = sqrt (30*K)*(a/sqrt (n : ℝ)) by ring, hid.2] at hv apply (selectedDegree_radius_le β n 0 ⌊a⌋₊ hcap).trans rw [radius, if_neg (by omega : ⌊a⌋₊ ≠ 0)] nlinarith only [hb, hv]
CausalSmith.Stat.RdTruesideNoiseFrontier.certificate_zero_rate_bound · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:106
theorem risk_le_of_attainerRisk_le Lemma risk_le_of_attainerRisk_le in the paper ↗

A finite extended worst-risk bound for the selected estimator also bounds the real minimax risk, since the estimator belongs to the decision class. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ B :
ℝ
n :
ℕ
hB :
0 ≤ B
h :
attainerRisk β n σ ≤ ofReal B
risk β n σ ≤ B
Proof (Lean source)
lemma risk_le_of_attainerRisk_le (β σ B : ℝ) (n : ℕ) (hB : 0 ≤ B) (h : attainerRisk β n σ ≤ ofReal B) : risk β n σ ≤ B := by have hm := minimaxValueENNReal_le_worstCaseRisk (risk := fun (T : Estimator n) (P : {P // Model β σ P}) => absRisk P.val σ n T.val) (attainer β n σ) have hb := hm.trans h exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hb).trans_eq (ENNReal.toReal_ofReal hB)
CausalSmith.Stat.RdTruesideNoiseFrontier.risk_le_of_attainerRisk_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:131
theorem lengthRisk_le_of_attainerLength_le Lemma lengthRisk_le_of_attainerLength_le in the paper ↗

An honest selected interval is an admissible minimax competitor; its finite worst expected length controls the real minimax length. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ B :
ℝ
n :
ℕ
hB :
0 ≤ B
hh :
honestAttainer β n σ ∈ honestIntervals β n σ
h :
attainerLength β n σ ≤ ofReal B
lengthRisk β n σ ≤ B
Proof (Lean source)
lemma lengthRisk_le_of_attainerLength_le (β σ B : ℝ) (n : ℕ) (hB : 0 ≤ B) (hh : honestAttainer β n σ ∈ honestIntervals β n σ) (h : attainerLength β n σ ≤ ofReal B) : lengthRisk β n σ ≤ B := by have hm := minimaxValueENNReal_le_worstCaseRisk (risk := fun (I : {I // I ∈ honestIntervals β n σ}) (P : {P // Model β σ P}) => expectedLength P.val σ n I.val) ⟨honestAttainer β n σ, hh⟩ have hb : minimaxValueENNReal (fun (I : {I // I ∈ honestIntervals β n σ}) (P : {P // Model β σ P}) => expectedLength P.val σ n I.val) ≤ ofReal B := hm.trans h exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hb).trans_eq (ENNReal.toReal_ofReal hB)
CausalSmith.Stat.RdTruesideNoiseFrontier.lengthRisk_le_of_attainerLength_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:141
theorem direct_reduction

The direct converse is uniform in all noise, and the selected procedures attain the noiseless order. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
∃ c C : ℝ,
0 < c
0 < C
conclusion 1
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
c * (n : ℝ)^(-β/(2*β+1)) ≤ risk β n σ
c * (n : ℝ)^(-β/(2*β+1)) ≤ lengthRisk β n σ
risk β n 0 ≤ C * (n : ℝ)^(-β/(2*β+1))
lengthRisk β n 0 ≤ C * (n : ℝ)^(-β/(2*β+1))
attainerRisk β n 0 ≤ ofReal (C * (n : ℝ)^(-β/(2*β+1)))
attainerLength β n 0 ≤ ofReal (C * (n : ℝ)^(-β/(2*β+1)))
Proof (Lean source)
-- @node: thm:direct-reduction theorem direct_reduction (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ n : ℕ, 2 ≤ n → -- @realizes c(beta-only positive lower constant) (∀ σ ∈ Icc (0 : ℝ) 1, c * (n : ℝ)^(-β/(2*β+1)) ≤ risk β n σ ∧ c * (n : ℝ)^(-β/(2*β+1)) ≤ lengthRisk β n σ) ∧ risk β n 0 ≤ C * (n : ℝ)^(-β/(2*β+1)) ∧ lengthRisk β n 0 ≤ C * (n : ℝ)^(-β/(2*β+1)) ∧ attainerRisk β n 0 ≤ ofReal (C * (n : ℝ)^(-β/(2*β+1))) ∧ attainerLength β n 0 ≤ ofReal (C * (n : ℝ)^(-β/(2*β+1))) ∧ honestAttainer β n 0 ∈ honestIntervals β n 0 := by obtain ⟨K, hK, hrate⟩ := certificate_zero_rate_bound β hβ have hlower : ∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, c * (n : ℝ)^(-β/(2*β+1)) ≤ risk β n σ ∧ c * (n : ℝ)^(-β/(2*β+1)) ≤ lengthRisk β n σ := by refine ⟨(4 / 5 : ℝ) * kappa, ?_⟩ exact direct_uniform_lower β hβ obtain ⟨c, hc, hlower⟩ := hlower refine ⟨c, 2*K, hc, by positivity, ?_⟩ intro n hn let P := directAltLaw β 1 true hβ (by norm_num) have hP : Model β 0 P := directAltLaw_model β 1 0 true hβ (by norm_num) have hcert := finite_certificate β 0 n 1 P hβ (by norm_num) hn (by omega) hP have hh := hcert.2.2.2.1 have hr := hcert.2.2.2.2.1 have hl := hcert.2.2.2.2.2 let r := (n : ℝ)^(-β/(2*β+1)) have hKr : 0 ≤ K*r := mul_nonneg hK.le (Real.rpow_nonneg (by positivity) _) have hb : certificate β n 0 ≤ K*r := hrate n hn have hr' : attainerRisk β n 0 ≤ ofReal ((2*K)*r) := by apply hr.trans (ENNReal.ofReal_le_ofReal _) nlinarith only [hb, hKr] have hl' : attainerLength β n 0 ≤ ofReal ((2*K)*r) := by apply hl.trans (ENNReal.ofReal_le_ofReal _) linarith only [hb] exact ⟨hlower n hn, risk_le_of_attainerRisk_le β 0 _ n (by positivity) hr', lengthRisk_le_of_attainerLength_le β 0 _ n (by positivity) hh hl', hr', hl', hh⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.direct_reduction · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TDirectReduction.lean:155
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.TFiniteCertificate 26 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

theorem denominator_floor_error_le Lemma denominator_floor_error_le in the paper ↗

The denominator floor cannot increase error from a population denominator at least one quarter. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
b B :
ℝ
hB :
1/4 ≤ B
|max b (1/8) - B| ≤ |b - B|
Proof (Lean source)
lemma denominator_floor_error_le (b B : ℝ) (hB : 1/4 ≤ B) : |max b (1/8) - B| ≤ |b - B| := by by_cases hb : 1/8 ≤ b · rw [max_eq_left hb] · have hb' : b ≤ 1/8 := le_of_not_ge hb rw [max_eq_right hb', abs_of_nonpos (by linarith), abs_of_nonpos (by linarith)] linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.denominator_floor_error_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:28
theorem mean_projection_error_le Lemma mean_projection_error_le in the paper ↗

Projection onto the potential-mean range decreases error from any mean in that range. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
r a :
ℝ
ha :
a ∈ Icc (1/4 : ℝ) (3/4)
|max (1/4) (min (3/4) r) - a| ≤ |r - a|
Proof (Lean source)
lemma mean_projection_error_le (r a : ℝ) (ha : a ∈ Icc (1/4 : ℝ) (3/4)) : |max (1/4) (min (3/4) r) - a| ≤ |r - a| := by have h := (Set.abs_projIcc_sub_projIcc (a := (1/4 : ℝ)) (b := 3/4) (c := r) (d := a) (by norm_num)) change |max (1/4) (min (3/4) r) - max (1/4) (min (3/4) a)| ≤ |r-a| at h simpa only [min_eq_right ha.2, max_eq_right ha.1] using h
CausalSmith.Stat.RdTruesideNoiseFrontier.mean_projection_error_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:38

The floored, clipped ratio obeys the certificate's samplewise eight/six error bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ahat Bhat A B a :
ℝ
hB :
1/4 ≤ B
ha :
a ∈ Icc (1/4 : ℝ) (3/4)
hA :
A = a*B
|max (1/4) (min (3/4) (Ahat / max Bhat (1/8))) - a| ≤ 8*|Ahat-A| + 6*|Bhat-B|
Proof (Lean source)
lemma clipped_ratio_error_le (Ahat Bhat A B a : ℝ) (hB : 1/4 ≤ B) (ha : a ∈ Icc (1/4 : ℝ) (3/4)) (hA : A = a*B) : |max (1/4) (min (3/4) (Ahat / max Bhat (1/8))) - a| ≤ 8*|Ahat-A| + 6*|Bhat-B| := by let H : ℝ := max Bhat (1/8) have hH : 1/8 ≤ H := le_max_right _ _ have hHp : 0 < H := by linarith have haabs : |a| ≤ 3/4 := by rw [abs_of_nonneg (by linarith [ha.1])]; exact ha.2 have hfloor : |H-B| ≤ |Bhat-B| := denominator_floor_error_le Bhat B hB apply (mean_projection_error_le _ a ha).trans have hid : Ahat/H-a = ((Ahat-A)+a*(B-H))/H := by rw [hA]; field_simp; ring rw [hid, abs_div, abs_of_pos hHp] apply (div_le_iff₀ hHp).mpr have hnum : |(Ahat-A)+a*(B-H)| ≤ |Ahat-A| + (3/4)*|Bhat-B| := by calc _ ≤ |Ahat-A| + |a*(B-H)| := abs_add_le _ _ _ = |Ahat-A| + |a| * |H-B| := by rw [abs_mul, abs_sub_comm B H] _ ≤ _ := by gcongr have hscale : |Ahat-A| + (3/4)*|Bhat-B| ≤ (8*|Ahat-A| + 6*|Bhat-B|)*H := by have hh := mul_le_mul_of_nonneg_left hH (show 0 ≤ 8*|Ahat-A| + 6*|Bhat-B| by positivity) nlinarith exact hnum.trans hscale
CausalSmith.Stat.RdTruesideNoiseFrontier.clipped_ratio_error_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:46

The abstract ratio inequality applies to the actual arm averages on every sample. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
L :
ℕ
σ :
ℝ
n :
ℕ
s :
Sample n
A B a :
ℝ
hB :
1/4 ≤ B
ha :
a ∈ Icc (1/4 : ℝ) (3/4)
hA :
A = a*B
|armRatio d L σ s - a| ≤ 8*|markedAvg d L σ s-A| + 6*|unmarkedAvg d L σ s-B|
Proof (Lean source)
lemma armRatio_error_le (d : Bool) (L : ℕ) (σ : ℝ) {n : ℕ} (s : Sample n) (A B a : ℝ) (hB : 1/4 ≤ B) (ha : a ∈ Icc (1/4 : ℝ) (3/4)) (hA : A = a*B) : |armRatio d L σ s - a| ≤ 8*|markedAvg d L σ s-A| + 6*|unmarkedAvg d L σ s-B| := by exact clipped_ratio_error_le _ _ A B a hB ha hA
CausalSmith.Stat.RdTruesideNoiseFrontier.armRatio_error_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:72
theorem thetaHat_error_le_of_average_errors Lemma thetaHat_error_le_of_average_errors in the paper ↗

Simultaneous average errors and the two population bias bounds give the public error radius. This is the deterministic assembly of (FC.3)--(FC.4), before any probability bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
n :
ℕ
z :
P :
A B a :
Bool → ℝ
M t :
ℝ
hB :
∀ d, 1/4 ≤ B d
ha :
∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)
hA :
∀ d, A d = a d * B d
hbias :
∀ d, |a d - P.mu d 0| ≤ 6*M
hmarked :
∀ d, |markedAvg d L σ z.1 - A d| ≤ t
hunmarked :
∀ d, |unmarkedAvg d L σ z.1 - B d| ≤ t
|thetaHat L σ z - theta P| ≤ 12*M + 28*t
Proof (Lean source)
lemma thetaHat_error_le_of_average_errors (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) {n : ℕ} (z : Input n) (P : LatentLaw) (A B a : Bool → ℝ) (M t : ℝ) (hB : ∀ d, 1/4 ≤ B d) (ha : ∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)) (hA : ∀ d, A d = a d * B d) (hbias : ∀ d, |a d - P.mu d 0| ≤ 6*M) (hmarked : ∀ d, |markedAvg d L σ z.1 - A d| ≤ t) (hunmarked : ∀ d, |unmarkedAvg d L σ z.1 - B d| ≤ t) : |thetaHat L σ z - theta P| ≤ 12*M + 28*t := by have harm (d : Bool) : |armRatio d L σ z.1 - a d| ≤ 14*t := by have h := armRatio_error_le d L σ z.1 (A d) (B d) (a d) (hB d) (ha d) (hA d) linarith [hmarked d, hunmarked d] have hsample : |(armRatio true L σ z.1 - armRatio false L σ z.1) - (a true - a false)| ≤ 28*t := by calc _ = |(armRatio true L σ z.1 - a true) - (armRatio false L σ z.1 - a false)| := by congr 1; ring _ ≤ |armRatio true L σ z.1 - a true| + |armRatio false L σ z.1 - a false| := by simpa only [sub_zero, zero_sub, abs_neg] using abs_sub_le (armRatio true L σ z.1 - a true) 0 (armRatio false L σ z.1 - a false) _ ≤ _ := by linarith [harm true, harm false] have hpopulation : |(a true - a false) - theta P| ≤ 12*M := by calc _ = |(a true - P.mu true 0) - (a false - P.mu false 0)| := by unfold theta congr 1 ring _ ≤ |a true - P.mu true 0| + |a false - P.mu false 0| := by simpa only [sub_zero, zero_sub, abs_neg] using abs_sub_le (a true - P.mu true 0) 0 (a false - P.mu false 0) _ ≤ _ := by linarith [hbias true, hbias false] rw [thetaHat, if_neg (by omega : L ≠ 0)] exact (abs_sub_le _ (a true - a false) _).trans (by linarith [hsample, hpopulation])
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_error_le_of_average_errors · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:80
theorem thetaHat_error_le_weighted_errors Lemma thetaHat_error_le_weighted_errors in the paper ↗

The two ratio errors and population biases bound the effect error with each empirical error retained separately, so expectation can be taken before applying moment bounds. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
n :
ℕ
z :
P :
A B a :
Bool → ℝ
M :
ℝ
hB :
∀ d, 1/4 ≤ B d
ha :
∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)
hA :
∀ d, A d = a d * B d
hbias :
∀ d, |a d - P.mu d 0| ≤ 6*M
|thetaHat L σ z - theta P|
≤ 12*M
+ 8*(|markedAvg true L σ z.1 - A true| + |markedAvg false L σ z.1 - A false|)
+ 6*(|unmarkedAvg true L σ z.1 - B true| + |unmarkedAvg false L σ z.1 - B false|)
Proof (Lean source)
lemma thetaHat_error_le_weighted_errors (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) {n : ℕ} (z : Input n) (P : LatentLaw) (A B a : Bool → ℝ) (M : ℝ) (hB : ∀ d, 1/4 ≤ B d) (ha : ∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)) (hA : ∀ d, A d = a d * B d) (hbias : ∀ d, |a d - P.mu d 0| ≤ 6*M) : |thetaHat L σ z - theta P| ≤ 12*M + 8*(|markedAvg true L σ z.1 - A true| + |markedAvg false L σ z.1 - A false|) + 6*(|unmarkedAvg true L σ z.1 - B true| + |unmarkedAvg false L σ z.1 - B false|) := by have harm (d : Bool) := armRatio_error_le d L σ z.1 (A d) (B d) (a d) (hB d) (ha d) (hA d) have hb (d : Bool) := (abs_sub_le (armRatio d L σ z.1) (a d) (P.mu d 0)).trans (add_le_add (harm d) (hbias d)) rw [thetaHat, if_neg (by omega : L ≠ 0), theta] calc _ = |(armRatio true L σ z.1 - P.mu true 0) - (armRatio false L σ z.1 - P.mu false 0)| := by congr 1; ring _ ≤ |armRatio true L σ z.1 - P.mu true 0| + |armRatio false L σ z.1 - P.mu false 0| := abs_sub _ _ _ ≤ _ := by linarith [hb true, hb false]
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_error_le_weighted_errors · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:116
theorem endpointKernel_sq_integral_pos Lemma endpointKernel_sq_integral_pos in the paper ↗

Normalization prevents the endpoint kernel's squared integral from vanishing. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
0 < ∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2
Proof (Lean source)
lemma endpointKernel_sq_integral_pos (L : ℕ) (hL : 1 ≤ L) : 0 < ∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2 := by have hc : Continuous (fun x : ℝ => (endpointKernel L).eval x) := by fun_prop have hn : 0 ≤ ∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2 := intervalIntegral.integral_nonneg (by norm_num) (fun x hx => sq_nonneg _) by_contra h have hz : (∫ x in (0 : ℝ)..1, ((endpointKernel L).eval x)^2) = 0 := by linarith have hae := (intervalIntegral.integral_eq_zero_iff_of_le_of_nonneg_ae (by norm_num : (0 : ℝ) ≤ 1) (ae_of_all _ (fun x => sq_nonneg ((endpointKernel L).eval x))) ((hc.pow 2).intervalIntegrable 0 1)).mp hz have hzero : (fun x : ℝ => (endpointKernel L).eval x) =ᵐ[volume.restrict (Ioc (0 : ℝ) 1)] 0 := by filter_upwards [hae] with x hx exact sq_eq_zero_iff.mp hx have hnorm := endpointKernel_integral_one L hL rw [intervalIntegral.integral_of_le (by norm_num : (0 : ℝ) ≤ 1), integral_congr_ae hzero] at hnorm simpa using hnorm
CausalSmith.Stat.RdTruesideNoiseFrontier.endpointKernel_sq_integral_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:137

The derivative-order-zero term makes the public variance strictly positive at every noise scale, including zero; all remaining derivative terms are nonnegative. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
Proof (Lean source)
lemma kernelVariance_pos (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) : 0 < kernelVariance L σ := by have hnonneg (j : ℕ) : 0 ≤ σ^(2*j) / (Nat.factorial j : ℝ) * ∫ x in (0 : ℝ)..1, ((polyDeriv j (endpointKernel L)).eval x)^2 := by apply mul_nonneg · apply div_nonneg _ (by positivity) rw [Nat.mul_comm 2 j, pow_mul] exact sq_nonneg _ · exact intervalIntegral.integral_nonneg (by norm_num) (fun x hx => sq_nonneg _) have hterm := Finset.single_le_sum (fun j (_ : j ∈ range (kernelDegree L + 1)) => hnonneg j) (show 0 ∈ range (kernelDegree L + 1) from Finset.mem_range.mpr (by omega)) simp only [Nat.mul_zero, pow_zero, Nat.factorial_zero, Nat.cast_one, div_one, one_mul, polyDeriv, Function.iterate_zero, id_eq] at hterm unfold kernelVariance exact mul_pos (by norm_num) ((endpointKernel_sq_integral_pos L hL).trans_le hterm)
CausalSmith.Stat.RdTruesideNoiseFrontier.kernelVariance_pos · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:156
theorem empirical_error_integral_abs_le Lemma empirical_error_integral_abs_le in the paper ↗

Cauchy–Schwarz converts an empirical centered second-moment bound into an absolute first-moment bound on the normalized experiment (the probabilistic step of FC.6). Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
Z :
Ω → ℝ
hZ :
MemLp Z 2 μ
v :
ℝ
hsecond :
(∫ z, (Z z)^2 ∂μ) ≤ v
(∫ z, |Z z| ∂μ) ≤ sqrt v
Proof (Lean source)
lemma empirical_error_integral_abs_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Ω → ℝ) (hZ : MemLp Z 2 μ) (v : ℝ) (hsecond : (∫ z, (Z z)^2 ∂μ) ≤ v) : (∫ z, |Z z| ∂μ) ≤ sqrt v := by have hcs := integral_abs_le_sqrt_integral_sq μ Z hZ simp only [Real.norm_eq_abs, sq_abs] at hcs exact hcs.trans (Real.sqrt_le_sqrt hsecond)
CausalSmith.Stat.RdTruesideNoiseFrontier.empirical_error_integral_abs_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:173
theorem thetaHat_absRisk_le_of_second_moments Lemma thetaHat_absRisk_le_of_second_moments in the paper ↗

Integrating the floored-ratio inequality and using all four empirical second moments proves FC.6, including samples with an empty treatment arm. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
ℕ
hL :
1 ≤ L
σ :
ℝ
n :
ℕ
P :
A B a :
Bool → ℝ
M v :
ℝ
hB :
∀ d, 1/4 ≤ B d
ha :
∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)
hA :
∀ d, A d = a d * B d
hbias :
∀ d, |a d - P.mu d 0| ≤ 6*M
hm :
∀ d, MemLp (fun z : Input n => markedAvg d L σ z.1 - A d) 2 (experiment P σ n)
hu :
∀ d, MemLp (fun z : Input n => unmarkedAvg d L σ z.1 - B d) 2 (experiment P σ n)
hms :
∀ d, (∫ z : Input n, (markedAvg d L σ z.1 - A d)^2 ∂experiment P σ n) ≤ v
hus :
∀ d, (∫ z : Input n, (unmarkedAvg d L σ z.1 - B d)^2 ∂experiment P σ n) ≤ v
absRisk P σ n (thetaHat L σ) ≤ ofReal (12*M + 28*sqrt v)
Proof (Lean source)
lemma thetaHat_absRisk_le_of_second_moments (L : ℕ) (hL : 1 ≤ L) (σ : ℝ) (n : ℕ) (P : LatentLaw) (A B a : Bool → ℝ) (M v : ℝ) (hB : ∀ d, 1/4 ≤ B d) (ha : ∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)) (hA : ∀ d, A d = a d * B d) (hbias : ∀ d, |a d - P.mu d 0| ≤ 6*M) (hm : ∀ d, MemLp (fun z : Input n => markedAvg d L σ z.1 - A d) 2 (experiment P σ n)) (hu : ∀ d, MemLp (fun z : Input n => unmarkedAvg d L σ z.1 - B d) 2 (experiment P σ n)) (hms : ∀ d, (∫ z : Input n, (markedAvg d L σ z.1 - A d)^2 ∂experiment P σ n) ≤ v) (hus : ∀ d, (∫ z : Input n, (unmarkedAvg d L σ z.1 - B d)^2 ∂experiment P σ n) ≤ v) : absRisk P σ n (thetaHat L σ) ≤ ofReal (12*M + 28*sqrt v) := by letI := experiment_probability P σ n let em : Bool → Input n → ℝ := fun d z => |markedAvg d L σ z.1 - A d| let eu : Bool → Input n → ℝ := fun d z => |unmarkedAvg d L σ z.1 - B d| have him (d : Bool) : Integrable (em d) (experiment P σ n) := ((hm d).integrable (by norm_num)).abs have hiu (d : Bool) : Integrable (eu d) (experiment P σ n) := ((hu d).integrable (by norm_num)).abs have hbm (d : Bool) : (∫ z, em d z ∂experiment P σ n) ≤ sqrt v := empirical_error_integral_abs_le _ _ (hm d) v (hms d) have hbu (d : Bool) : (∫ z, eu d z ∂experiment P σ n) ≤ sqrt v := empirical_error_integral_abs_le _ _ (hu d) v (hus d) let G : Input n → ℝ := fun z => 12*M + 8*(em true z + em false z) + 6*(eu true z + eu false z) have hiG : Integrable G (experiment P σ n) := by exact ((integrable_const (12*M)).add ((him true).add (him false) |>.const_mul 8)).add ((hiu true).add (hiu false) |>.const_mul 6) have he (z : Input n) : |thetaHat L σ z - theta P| ≤ G z := thetaHat_error_le_weighted_errors L hL σ z P A B a M hB ha hA hbias have hGn : ∀ᵐ z ∂experiment P σ n, 0 ≤ G z := ae_of_all _ (fun z => (abs_nonneg _).trans (he z)) unfold absRisk calc _ ≤ ∫⁻ z, ofReal (G z) ∂experiment P σ n := lintegral_mono (fun z => ENNReal.ofReal_le_ofReal (he z)) _ = ofReal (∫ z, G z ∂experiment P σ n) := (ofReal_integral_eq_lintegral_ofReal hiG hGn).symm _ ≤ _ := by apply ENNReal.ofReal_le_ofReal dsimp only [G] integral_linearity simp only [integral_const, probReal_univ, one_smul] linarith [hbm true, hbm false, hbu true, hbu false]
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_absRisk_le_of_second_moments · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:184
theorem polyInterval_covers_of_error_le Lemma polyInterval_covers_of_error_le in the paper ↗

A target in the parameter range remains covered after intersecting a centered interval with that range. This is the deterministic coverage step of the finite certificate. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
z :
θ :
ℝ
hθ :
θ ∈ Icc (-1 : ℝ) 1
herr :
|thetaHat L σ z - θ| ≤ radius β n σ L
z ∈ coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi θ
Proof (Lean source)
lemma polyInterval_covers_of_error_le (β : ℝ) (n : ℕ) (σ : ℝ) (L : ℕ) (z : Input n) (θ : ℝ) (hθ : θ ∈ Icc (-1 : ℝ) 1) (herr : |thetaHat L σ z - θ| ≤ radius β n σ L) : z ∈ coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi θ := by have he := abs_le.mp herr change max (-1) (thetaHat L σ z - radius β n σ L) ≤ θ ∧ θ ≤ min 1 (thetaHat L σ z + radius β n σ L) exact ⟨max_le hθ.1 (by linarith [he.2]), le_min hθ.2 (by linarith [he.1])⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_covers_of_error_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:228
theorem centered_error_failure_le_one_fortieth Lemma centered_error_failure_le_one_fortieth in the paper ↗

Chebyshev at the public forty-times-variance threshold bounds one failure by 1/40. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
Z :
Ω → ℝ
hZ :
MemLp Z 2 μ
hmean :
(∫ z, Z z ∂μ) = 0
v :
ℝ
hv :
0 < v
hvar :
variance Z μ ≤ v
μ.real {z | sqrt (40*v) < |Z z|} ≤ 1/40
Proof (Lean source)
lemma centered_error_failure_le_one_fortieth {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Ω → ℝ) (hZ : MemLp Z 2 μ) (hmean : (∫ z, Z z ∂μ) = 0) (v : ℝ) (hv : 0 < v) (hvar : variance Z μ ≤ v) : μ.real {z | sqrt (40*v) < |Z z|} ≤ 1/40 := by have ht : 0 < sqrt (40*v) := Real.sqrt_pos.mpr (by positivity) have hcheb := meas_ge_le_variance_div_sq hZ ht simp only [hmean, sub_zero, Real.sq_sqrt (by positivity : 0 ≤ 40*v)] at hcheb have hbound : variance Z μ / (40*v) ≤ 1/40 := by apply (div_le_iff₀ (by positivity : 0 < 40*v)).mpr nlinarith [hvar] have hsub : {z | sqrt (40*v) < |Z z|} ⊆ {z | sqrt (40*v) ≤ |Z z|} := by intro z hz change sqrt (40*v) < |Z z| at hz change sqrt (40*v) ≤ |Z z| exact hz.le have hm : μ {z | sqrt (40*v) < |Z z|} ≤ ofReal (1/40) := (measure_mono hsub).trans (hcheb.trans (ENNReal.ofReal_le_ofReal hbound)) exact (ENNReal.toReal_mono (by finiteness) hm).trans (by norm_num)
CausalSmith.Stat.RdTruesideNoiseFrontier.centered_error_failure_le_one_fortieth · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:240
theorem four_errors_probability_ge_nine_tenths Lemma four_errors_probability_ge_nine_tenths in the paper ↗

The union bound for four measurable errors gives simultaneous control with probability 0.9. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
Ω :
Z :
Bool × Bool → Ω → ℝ
hZ :
∀ i, Measurable (Z i)
t :
ℝ
hfail :
∀ i, μ.real {z | t < |Z i z|} ≤ 1/40
(9/10 : ℝ) ≤ μ.real {z | ∀ i, |Z i z| ≤ t}
Proof (Lean source)
lemma four_errors_probability_ge_nine_tenths {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (Z : Bool × Bool → Ω → ℝ) (hZ : ∀ i, Measurable (Z i)) (t : ℝ) (hfail : ∀ i, μ.real {z | t < |Z i z|} ≤ 1/40) : (9/10 : ℝ) ≤ μ.real {z | ∀ i, |Z i z| ≤ t} := by let F : Set Ω := ⋃ i, {z | t < |Z i z|} have hF : MeasurableSet F := MeasurableSet.iUnion (fun i => measurableSet_lt measurable_const (hZ i).abs) have hsum : μ.real F ≤ 1/10 := by have hu := measureReal_iUnion_fintype_le (μ := μ) (fun i => {z | t < |Z i z|}) have hs := Finset.sum_le_sum (fun i (_ : i ∈ univ) => hfail i) have hc : (∑ i : Bool × Bool, (1/40 : ℝ)) = 1/10 := by norm_num exact hu.trans (hc ▸ hs) have hgood : {z | ∀ i, |Z i z| ≤ t} = Fᶜ := by ext z simp [F, not_lt] rw [hgood, measureReal_compl hF, probReal_univ] linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.four_errors_probability_ge_nine_tenths · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:263
theorem markedAvg_input_measurable Lemma markedAvg_input_measurable in the paper ↗

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
n L :
ℕ
σ :
ℝ
Measurable (fun z : Input n => markedAvg d L σ z.1)
Proof (Lean source)
@[fun_prop] lemma markedAvg_input_measurable (d : Bool) (n L : ℕ) (σ : ℝ) : Measurable (fun z : Input n => markedAvg d L σ z.1) := by have hbit : Measurable bit := measurable_of_countable bit have hcell (i : Fin n) : Measurable (fun z : Input n => if (z.1 i).2.1 = d then (1 : ℝ) else 0) := by exact (measurable_of_countable (fun y : Bool => if y = d then (1 : ℝ) else 0)).comp ((measurable_pi_apply i).comp measurable_fst |>.snd.fst) unfold markedAvg fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.markedAvg_input_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:283
theorem unmarkedAvg_input_measurable Lemma unmarkedAvg_input_measurable in the paper ↗

Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
d :
n L :
ℕ
σ :
ℝ
Measurable (fun z : Input n => unmarkedAvg d L σ z.1)
Proof (Lean source)
@[fun_prop] lemma unmarkedAvg_input_measurable (d : Bool) (n L : ℕ) (σ : ℝ) : Measurable (fun z : Input n => unmarkedAvg d L σ z.1) := by have hcell (i : Fin n) : Measurable (fun z : Input n => if (z.1 i).2.1 = d then (1 : ℝ) else 0) := by exact (measurable_of_countable (fun y : Bool => if y = d then (1 : ℝ) else 0)).comp ((measurable_pi_apply i).comp measurable_fst |>.snd.fst) unfold unmarkedAvg fun_prop
CausalSmith.Stat.RdTruesideNoiseFrontier.unmarkedAvg_input_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:295
theorem polyInterval_coverage_of_average_failure_bounds Lemma polyInterval_coverage_of_average_failure_bounds in the paper ↗

The four empirical-average failure bounds and population bias imply finite-sample coverage. This assembles the probability and deterministic steps after FC.1 and FC.5 are established. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n L :
ℕ
hL :
1 ≤ L
P :
A B a :
Bool → ℝ
hB :
∀ d, 1/4 ≤ B d
ha :
∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)
hA :
∀ d, A d = a d * B d
hbias :
∀ d, |a d - P.mu d 0| ≤ 6 * kernelMoment L β
hθ :
theta P ∈ Icc (-1 : ℝ) 1
hfm :
∀ d,
(experiment P σ n).real {z : Input n | sqrt (40 * kernelVariance L σ / n) < |markedAvg d L σ z.1 - A d|}
≤ 1/40
hfu :
∀ d,
(experiment P σ n).real {z : Input n | sqrt (40 * kernelVariance L σ / n) < |unmarkedAvg d L σ z.1 - B d|}
≤ 1/40
(9/10 : ℝ)
≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P))
Proof (Lean source)
lemma polyInterval_coverage_of_average_failure_bounds (β σ : ℝ) (n L : ℕ) (hL : 1 ≤ L) (P : LatentLaw) (A B a : Bool → ℝ) (hB : ∀ d, 1/4 ≤ B d) (ha : ∀ d, a d ∈ Icc (1/4 : ℝ) (3/4)) (hA : ∀ d, A d = a d * B d) (hbias : ∀ d, |a d - P.mu d 0| ≤ 6 * kernelMoment L β) (hθ : theta P ∈ Icc (-1 : ℝ) 1) (hfm : ∀ d, (experiment P σ n).real {z : Input n | sqrt (40 * kernelVariance L σ / n) < |markedAvg d L σ z.1 - A d|} ≤ 1/40) (hfu : ∀ d, (experiment P σ n).real {z : Input n | sqrt (40 * kernelVariance L σ / n) < |unmarkedAvg d L σ z.1 - B d|} ≤ 1/40) : (9/10 : ℝ) ≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P)) := by letI := experiment_probability P σ n let Z : Bool × Bool → Input n → ℝ := fun i z => if i.1 then markedAvg i.2 L σ z.1 - A i.2 else unmarkedAvg i.2 L σ z.1 - B i.2 have hZ (i : Bool × Bool) : Measurable (Z i) := by rcases i with ⟨k, d⟩ cases k · exact (unmarkedAvg_input_measurable d n L σ).sub measurable_const · exact (markedAvg_input_measurable d n L σ).sub measurable_const have hfail (i : Bool × Bool) : (experiment P σ n).real {z | sqrt (40 * kernelVariance L σ / n) < |Z i z|} ≤ 1/40 := by rcases i with ⟨k, d⟩ cases k · exact hfu d · exact hfm d apply (four_errors_probability_ge_nine_tenths (experiment P σ n) Z hZ _ hfail).trans apply measureReal_mono (h₂ := by finiteness) intro z hz apply polyInterval_covers_of_error_le β n σ L z (theta P) hθ have he := thetaHat_error_le_of_average_errors L hL σ z P A B a (kernelMoment L β) (sqrt (40 * kernelVariance L σ / n)) hB ha hA hbias (fun d => hz (true, d)) (fun d => hz (false, d)) simpa only [radius, if_neg (by omega : L ≠ 0)] using he
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_coverage_of_average_failure_bounds · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:306

Intersecting the centered public interval with the target range can only shorten it. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
z :
intervalLength ((polyInterval β n σ L).lo z) ((polyInterval β n σ L).hi z)
≤ 2 * radius β n σ L
Proof (Lean source)
lemma polyInterval_length_le (β : ℝ) (n : ℕ) (σ : ℝ) (L : ℕ) (z : Input n) : intervalLength ((polyInterval β n σ L).lo z) ((polyInterval β n σ L).hi z) ≤ 2 * radius β n σ L := by have hr := radius_nonneg β n σ L change max 0 (min 1 (thetaHat L σ z + radius β n σ L) - max (-1) (thetaHat L σ z - radius β n σ L)) ≤ 2 * radius β n σ L apply max_le · linarith · have hu := min_le_right (1 : ℝ) (thetaHat L σ z + radius β n σ L) have hl := le_max_right (-1 : ℝ) (thetaHat L σ z - radius β n σ L) linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_length_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:345
theorem polyInterval_expectedLength_le Lemma polyInterval_expectedLength_le in the paper ↗

The sample experiment is normalized, so a pointwise radius bound also bounds expected length. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
L :
ℕ
P :
expectedLength P σ n (polyInterval β n σ L) ≤ ofReal (2 * radius β n σ L)
Proof (Lean source)
lemma polyInterval_expectedLength_le (β : ℝ) (n : ℕ) (σ : ℝ) (L : ℕ) (P : LatentLaw) : expectedLength P σ n (polyInterval β n σ L) ≤ ofReal (2 * radius β n σ L) := by letI := experiment_probability P σ n unfold expectedLength calc _ ≤ ∫⁻ _z, ofReal (2 * radius β n σ L) ∂experiment P σ n := by apply lintegral_mono intro z exact ENNReal.ofReal_le_ofReal (polyInterval_length_le β n σ L z) _ = _ := by simp
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_expectedLength_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:358
theorem attainerLength_le_certificate Lemma attainerLength_le_certificate in the paper ↗

Deterministic public selection preserves the uniform twice-radius length bound, including index zero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
attainerLength β n σ ≤ ofReal (2 * certificate β n σ)
Proof (Lean source)
lemma attainerLength_le_certificate (β : ℝ) (n : ℕ) (σ : ℝ) : attainerLength β n σ ≤ ofReal (2 * certificate β n σ) := by unfold attainerLength apply worstCaseRiskENNReal_le intro P exact polyInterval_expectedLength_le β n σ (selectedDegree β n σ) P.val
CausalSmith.Stat.RdTruesideNoiseFrontier.attainerLength_le_certificate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:371
theorem selectedDegree_radius_le Lemma selectedDegree_radius_le in the paper ↗

The selected index minimizes the radius over the finite public candidate set. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
J :
ℕ
hJ :
J ≤ Lmax β n
radius β n σ (selectedDegree β n σ) ≤ radius β n σ J
Proof (Lean source)
lemma selectedDegree_radius_le (β : ℝ) (n : ℕ) (σ : ℝ) (J : ℕ) (hJ : J ≤ Lmax β n) : radius β n σ (selectedDegree β n σ) ≤ radius β n σ J := by classical have hm := Finset.min'_mem (minimizingDegrees β n σ) (minimizingDegrees_nonempty β n σ) simp only [minimizingDegrees, mem_filter] at hm exact hm.2 J (Finset.mem_range.mpr (by omega))
CausalSmith.Stat.RdTruesideNoiseFrontier.selectedDegree_radius_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:379

The fallback candidate caps the selected certificate at one half. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
n :
ℕ
σ :
ℝ
certificate β n σ ≤ 1/2
Proof (Lean source)
lemma certificate_le_half (β : ℝ) (n : ℕ) (σ : ℝ) : certificate β n σ ≤ 1/2 := by simpa only [certificate, radius, ite_true] using selectedDegree_radius_le β n σ 0 (zero_le _)
CausalSmith.Stat.RdTruesideNoiseFrontier.certificate_le_half · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:387
theorem polyInterval_zero_coverage Lemma polyInterval_zero_coverage in the paper ↗

The constant fallback interval covers every model target on every sample. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
P :
hP :
Model β σ P
(experiment P σ n).real (coverageEvent (polyInterval β n σ 0).lo (polyInterval β n σ 0).hi (theta P))
= 1
Proof (Lean source)
lemma polyInterval_zero_coverage (β σ : ℝ) (n : ℕ) (P : LatentLaw) (hP : Model β σ P) : (experiment P σ n).real (coverageEvent (polyInterval β n σ 0).lo (polyInterval β n σ 0).hi (theta P)) = 1 := by letI := experiment_probability P σ n have ht := abs_le.mp (theta_model_bounds β σ P hP) have he : coverageEvent (polyInterval β n σ 0).lo (polyInterval β n σ 0).hi (theta P) = univ := by ext z simp only [coverageEvent, mem_setOf_eq, mem_Icc, mem_univ, iff_true] change max (-1) (thetaHat 0 σ z - radius β n σ 0) ≤ theta P ∧ theta P ≤ min 1 (thetaHat 0 σ z + radius β n σ 0) simp only [thetaHat, radius, ite_true] exact ⟨max_le (by linarith [ht.1]) (by linarith [ht.1]), le_min (by linarith [ht.2]) (by linarith [ht.2])⟩ rw [he, probReal_univ]
CausalSmith.Stat.RdTruesideNoiseFrontier.polyInterval_zero_coverage · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:392
theorem thetaHat_zero_absRisk_le Lemma thetaHat_zero_absRisk_le in the paper ↗

The zero estimator has risk at most the fallback radius, including an empty sample. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
P :
hP :
Model β σ P
absRisk P σ n (thetaHat 0 σ) ≤ ofReal (1/2 : ℝ)
Proof (Lean source)
lemma thetaHat_zero_absRisk_le (β σ : ℝ) (n : ℕ) (P : LatentLaw) (hP : Model β σ P) : absRisk P σ n (thetaHat 0 σ) ≤ ofReal (1/2 : ℝ) := by letI := experiment_probability P σ n unfold absRisk calc _ ≤ ∫⁻ _z, ofReal (1/2 : ℝ) ∂experiment P σ n := by apply lintegral_mono intro z apply ENNReal.ofReal_le_ofReal simpa only [thetaHat, ite_true, zero_sub, abs_neg] using theta_model_bounds β σ P hP _ = _ := by simp
CausalSmith.Stat.RdTruesideNoiseFrontier.thetaHat_zero_absRisk_le · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:410
theorem honestAttainer_of_positive_coverage Lemma honestAttainer_of_positive_coverage in the paper ↗

Public deterministic selection preserves positive-degree honesty and fallback coverage. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
hpositive :
∀ L,
1
≤ L → ∀ P, Model β σ P → (9/10 : ℝ) ≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P))
honestAttainer β n σ ∈ honestIntervals β n σ
Proof (Lean source)
lemma honestAttainer_of_positive_coverage (β σ : ℝ) (n : ℕ) (hpositive : ∀ L, 1 ≤ L → ∀ P, Model β σ P → (9/10 : ℝ) ≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P))) : honestAttainer β n σ ∈ honestIntervals β n σ := by intro P hP change (9/10 : ℝ) ≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ (selectedDegree β n σ)).lo (polyInterval β n σ (selectedDegree β n σ)).hi (theta P)) by_cases hz : selectedDegree β n σ = 0 · rw [hz, polyInterval_zero_coverage β σ n P hP] norm_num · exact hpositive _ (by omega) P hP
CausalSmith.Stat.RdTruesideNoiseFrontier.honestAttainer_of_positive_coverage · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:423
theorem attainerRisk_of_positive_risk Lemma attainerRisk_of_positive_risk in the paper ↗

Uniform fixed-degree risk bounds imply the selected certificate's worst-case risk bound. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
hpositive :
∀ L,
1
≤ L → ∀ P, Model β σ P → absRisk P σ n (thetaHat L σ) ≤ ofReal (12 * kernelMoment L β + 28 * sqrt (kernelVariance L σ / n))
attainerRisk β n σ ≤ ofReal (certificate β n σ)
Proof (Lean source)
lemma attainerRisk_of_positive_risk (β σ : ℝ) (n : ℕ) (hpositive : ∀ L, 1 ≤ L → ∀ P, Model β σ P → absRisk P σ n (thetaHat L σ) ≤ ofReal (12 * kernelMoment L β + 28 * sqrt (kernelVariance L σ / n))) : attainerRisk β n σ ≤ ofReal (certificate β n σ) := by unfold attainerRisk apply worstCaseRiskENNReal_le intro P change absRisk P.val σ n (thetaHat (selectedDegree β n σ) σ) ≤ ofReal (radius β n σ (selectedDegree β n σ)) by_cases hz : selectedDegree β n σ = 0 · rw [hz] simpa only [radius, ite_true] using thetaHat_zero_absRisk_le β σ n P.val P.property · apply (hpositive _ (by omega) P.val P.property).trans apply ENNReal.ofReal_le_ofReal rw [radius, if_neg hz] have hv : 0 ≤ kernelVariance (selectedDegree β n σ) σ / (n : ℝ) := by apply div_nonneg _ (by positivity) unfold kernelVariance apply mul_nonneg (by norm_num) apply Finset.sum_nonneg intro j hj apply mul_nonneg · apply div_nonneg _ (by positivity) rw [Nat.mul_comm 2 j, pow_mul] exact sq_nonneg _ exact intervalIntegral.integral_nonneg (by norm_num) (fun x hx => sq_nonneg _) have hs : sqrt (kernelVariance (selectedDegree β n σ) σ / n) ≤ sqrt (40 * kernelVariance (selectedDegree β n σ) σ / n) := by apply Real.sqrt_le_sqrt calc _ ≤ 40 * (kernelVariance (selectedDegree β n σ) σ / n) := by linarith [hv] _ = _ := by ring linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.attainerRisk_of_positive_risk · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:438
theorem finite_certificate

Finite-sample mean, risk and honesty certificates, followed by the uniform guarantees of selection. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n L :
ℕ
P :
hβ :
β ∈ Ioc (0 : ℝ) 1
@realizes beta(public real smoothness with 0 < beta and beta ≤ 1)
hσ :
σ ∈ Icc (0 : ℝ) 1
hn :
2 ≤ n
hL :
1 ≤ L
hP :
Model β σ P
conclusion 1
d :
1/4 ≤ unmarkedMean d L σ P n
conclusion 2
absRisk P σ n (thetaHat L σ)
≤ ofReal (12 * kernelMoment L β + 28 * sqrt (kernelVariance L σ / n))
conclusion 3
(9/10 : ℝ)
≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P))
conclusion 4
honestAttainer β n σ ∈ honestIntervals β n σ
conclusion 5
attainerRisk β n σ ≤ ofReal (certificate β n σ)
conclusion 6
attainerLength β n σ ≤ ofReal (2 * certificate β n σ)
Proof (Lean source)
-- @node: thm:finite-certificate theorem finite_certificate (β σ : ℝ) (n L : ℕ) (P : LatentLaw) (hβ : β ∈ Ioc (0 : ℝ) 1) -- @realizes beta(public real smoothness with 0 < beta and beta ≤ 1) (hσ : σ ∈ Icc (0 : ℝ) 1) (hn : 2 ≤ n) (hL : 1 ≤ L) (hP : Model β σ P) : -- @realizes sigma([0,1]) @realizes n(integer at least two) (∀ d : Bool, 1/4 ≤ unmarkedMean d L σ P n) ∧ -- @realizes d(binary treatment index) absRisk P σ n (thetaHat L σ) ≤ ofReal (12 * kernelMoment L β + 28 * sqrt (kernelVariance L σ / n)) ∧ (9/10 : ℝ) ≤ (experiment P σ n).real (coverageEvent (polyInterval β n σ L).lo (polyInterval β n σ L).hi (theta P)) ∧ honestAttainer β n σ ∈ honestIntervals β n σ ∧ attainerRisk β n σ ≤ ofReal (certificate β n σ) ∧ attainerLength β n σ ≤ ofReal (2 * certificate β n σ) := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts let hermite_of_gate : ClassicalHermiteFacts := classicalHermiteFacts have hfixed : ∀ J : ℕ, 1 ≤ J → ∀ Q : LatentLaw, Model β σ Q → (∀ d : Bool, 1/4 ≤ unmarkedMean d J σ Q n) ∧ absRisk Q σ n (thetaHat J σ) ≤ ofReal (12 * kernelMoment J β + 28 * sqrt (kernelVariance J σ / n)) ∧ (9/10 : ℝ) ≤ (experiment Q σ n).real (coverageEvent (polyInterval β n σ J).lo (polyInterval β n σ J).hi (theta Q)) := by intro J hJ Q hQ letI := experiment_probability Q σ n let A : Bool → ℝ := fun d => ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x) * Q.mu d (sgn d * x) let B : Bool → ℝ := fun d => ∫ x in (0 : ℝ)..1, (endpointKernel J).eval x * Q.f (sgn d * x) let a : Bool → ℝ := fun d => A d / B d let v := kernelVariance J σ / (n : ℝ) have hdata : (∀ d, unmarkedMean d J σ Q n = B d) ∧ (∀ d, MemLp (fun z : Input n => markedAvg d J σ z.1 - A d) 2 (experiment Q σ n) ∧ (∫ z : Input n, markedAvg d J σ z.1 - A d ∂experiment Q σ n) = 0 ∧ (∫ z : Input n, (markedAvg d J σ z.1 - A d)^2 ∂experiment Q σ n) ≤ v) ∧ (∀ d, MemLp (fun z : Input n => unmarkedAvg d J σ z.1 - B d) 2 (experiment Q σ n) ∧ (∫ z : Input n, unmarkedAvg d J σ z.1 - B d ∂experiment Q σ n) = 0 ∧ (∫ z : Input n, (unmarkedAvg d J σ z.1 - B d)^2 ∂experiment Q σ n) ≤ v) := by letI := empirical_Pobs_probability Q σ let F : Bool → Obs → ℝ := fun d o => (if o.2.1 = d then 1 else 0) * bit o.2.2 * (inverseHeat J σ).eval (sgn d * o.1) let G : Bool → Obs → ℝ := fun d o => (if o.2.1 = d then 1 else 0) * (inverseHeat J σ).eval (sgn d * o.1) have hsingle : (∀ d, (∫ o, F d o ∂Pobs Q σ) = A d ∧ MemLp (F d) 2 (Pobs Q σ) ∧ (∫ o, (F d o)^2 ∂Pobs Q σ) ≤ kernelVariance J σ) ∧ (∀ d, (∫ o, G d o ∂Pobs Q σ) = B d ∧ MemLp (G d) 2 (Pobs Q σ) ∧ (∫ o, (G d o)^2 ∂Pobs Q σ) ≤ kernelVariance J σ) := by have hm (d : Bool) := observed_arm_summands_memLp_two hermite_of_gate β σ Q hQ d J constructor · intro d refine ⟨?_, (hm d).1, ?_⟩ · simpa only [F, A] using marked_observed_integral_eq_endpoint legendre_of_gate hermite_of_gate β σ Q hQ hσ J hJ d · simpa only [F] using marked_observed_sq_le_kernelVariance legendre_of_gate hermite_of_gate β σ Q hQ hσ J hJ d · intro d refine ⟨?_, (hm d).2, ?_⟩ · simpa only [G, B] using unmarked_observed_integral_eq_endpoint legendre_of_gate hermite_of_gate β σ Q hQ hσ J hJ d · simpa only [G] using unmarked_observed_sq_le_kernelVariance legendre_of_gate hermite_of_gate β σ Q hQ hσ J hJ d refine ⟨?_, ?_, ?_⟩ · intro d exact (unmarkedMean_eq_single_observation Q σ n J d (by omega) ((hsingle.2 d).2.1.integrable (by norm_num))).trans (hsingle.2 d).1 · intro d have hm := markedAvg_centered_moments_of_single_observation Q σ n J d (by omega) (hsingle.1 d).2.1 (hsingle.1 d).2.2 change MemLp (fun z : Input n => markedAvg d J σ z.1 - ∫ o, F d o ∂Pobs Q σ) 2 (experiment Q σ n) ∧ (∫ z : Input n, markedAvg d J σ z.1 - ∫ o, F d o ∂Pobs Q σ ∂experiment Q σ n) = 0 ∧ (∫ z : Input n, (markedAvg d J σ z.1 - ∫ o, F d o ∂Pobs Q σ)^2 ∂experiment Q σ n) ≤ v at hm simpa only [(hsingle.1 d).1] using hm · intro d have hm := unmarkedAvg_centered_moments_of_single_observation Q σ n J d (by omega) (hsingle.2 d).2.1 (hsingle.2 d).2.2 change MemLp (fun z : Input n => unmarkedAvg d J σ z.1 - ∫ o, G d o ∂Pobs Q σ) 2 (experiment Q σ n) ∧ (∫ z : Input n, unmarkedAvg d J σ z.1 - ∫ o, G d o ∂Pobs Q σ ∂experiment Q σ n) = 0 ∧ (∫ z : Input n, (unmarkedAvg d J σ z.1 - ∫ o, G d o ∂Pobs Q σ)^2 ∂experiment Q σ n) ≤ v at hm simpa only [(hsingle.2 d).1] using hm have hB (d : Bool) : 1/4 ≤ B d := (endpointKernel_weighted_integral_bounds J hJ _ (continuousOn_arm_reflection d Q.f Q.f_cont) _ _ (fun x hx => hQ.density _ (arm_reflection_mem d hx))).1 have ha (d : Bool) := arm_kernel_mean_bounds_and_bias Q β σ hQ hβ.1.le d J hJ have hA (d : Bool) : A d = a d * B d := by dsimp only [a] exact (div_mul_cancel₀ (A d) (by linarith [hB d] : B d ≠ 0)).symm refine ⟨fun d => hdata.1 d ▸ hB d, ?_, ?_⟩ · exact thetaHat_absRisk_le_of_second_moments J hJ σ n Q A B a (kernelMoment J β) v hB (fun d => (ha d).1) hA (fun d => (ha d).2) (fun d => (hdata.2.1 d).1) (fun d => (hdata.2.2 d).1) (fun d => (hdata.2.1 d).2.2) (fun d => (hdata.2.2 d).2.2) · apply polyInterval_coverage_of_average_failure_bounds β σ n J hJ Q A B a hB (fun d => (ha d).1) hA (fun d => (ha d).2) (by have ht := abs_le.mp (theta_model_bounds β σ Q hQ); constructor <;> linarith [ht.1, ht.2]) · intro d have hd := hdata.2.1 d have hv : variance (fun z : Input n => markedAvg d J σ z.1 - A d) (experiment Q σ n) ≤ v := by rw [variance_eq_integral hd.1.aemeasurable, hd.2.1] simpa only [sub_zero] using hd.2.2 simpa only [v, mul_div_assoc] using centered_error_failure_le_one_fortieth (experiment Q σ n) _ hd.1 hd.2.1 v (div_pos (kernelVariance_pos J hJ σ) (by positivity)) hv · intro d have hd := hdata.2.2 d have hv : variance (fun z : Input n => unmarkedAvg d J σ z.1 - B d) (experiment Q σ n) ≤ v := by rw [variance_eq_integral hd.1.aemeasurable, hd.2.1] simpa only [sub_zero] using hd.2.2 simpa only [v, mul_div_assoc] using centered_error_failure_le_one_fortieth (experiment Q σ n) _ hd.1 hd.2.1 v (div_pos (kernelVariance_pos J hJ σ) (by positivity)) hv have hcurrent := hfixed L hL P hP exact ⟨hcurrent.1, hcurrent.2.1, hcurrent.2.2, honestAttainer_of_positive_coverage β σ n (fun J hJ Q hQ => (hfixed J hJ Q hQ).2.2), attainerRisk_of_positive_risk β σ n (fun J hJ Q hQ => (hfixed J hJ Q hQ).2.1), attainerLength_le_certificate β n σ⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.finite_certificate · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TFiniteCertificate.lean:475
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.TPublishedClassConverseTransfer 17 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

theorem benchmark_mean_neighborhood Lemma benchmark_mean_neighborhood in the paper ↗

A benchmark law has locally continuous potential-mean versions on an open neighborhood of zero. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
∃ r > 0, ∀ d, ContinuousOn (L.mu d) (Ioo (-r) r)
Proof (Lean source)
lemma benchmark_mean_neighborhood (L : LatentLaw) : ∃ r > 0, ∀ d, ContinuousOn (L.mu d) (Ioo (-r) r) := by refine ⟨1 / 2, by norm_num, fun d => (L.mu_cont d).mono ?_⟩ intro x hx constructor <;> linarith [hx.1, hx.2]
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmark_mean_neighborhood · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:23
theorem benchmark_version_on_real Lemma benchmark_version_on_real in the paper ↗

Zero density outside the latent interval extends the set-integral version identity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
L :
d B :
(∫ ω in {ω | score ω ∈ B}, pot d ω ∂(L.P)) = ∫ x in B, L.mu d x * L.f x
Proof (Lean source)
lemma benchmark_version_on_real (L : LatentLaw) : ∀ d B, MeasurableSet B → (∫ ω in {ω | score ω ∈ B}, pot d ω ∂(L.P)) = ∫ x in B, L.mu d x * L.f x := by intro d B hB rw [L.mu_version d B hB] symm apply setIntegral_eq_of_subset_of_forall_sdiff_eq_zero hB inter_subset_left intro x hx have hout : x ∉ Icc (-1 : ℝ) 1 := by intro hin exact hx.2 ⟨hx.1, hin⟩ rw [L.f_zero x hout, mul_zero]
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmark_version_on_real · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:29

The same law, density and versions on the unrestricted score carrier. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
L :
benchmarkEmbedding L :
clause 1
Q := L.P
clause 2
prob := L.prob
clause 3
a := L.f
clause 4
density := L.density
clause 5
density_nonneg := L.f_nonneg
clause 6
v := L.mu
clause 7
clause 8

The embedding inherits local density positivity and the observed-outcome error independence by applying the observation function to the latent schedule. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
L :
hL :
Model β σ L
Proof (Lean source)
lemma benchmarkEmbedding_mem (β σ : ℝ) (L : LatentLaw) (hL : Model β σ L) : GaussianIdClass σ (benchmarkEmbedding L) := by refine ⟨?_, hL.gaussian, ?_, ?_⟩ · refine ⟨1 / 2, by norm_num, L.f_cont.mono ?_, ?_⟩ · intro x hx constructor <;> linarith [hx.1, hx.2] · intro x hx have hin : x ∈ Icc (-1 : ℝ) 1 := by constructor <;> linarith [hx.1, hx.2] have hlow := (hL.density x hin).1 change 0 < L.f x linarith · let marked : ℝ × Bool × Bool → ℝ × ℝ := fun z => (z.1, bit (if 0 ≤ z.1 then z.2.2 else z.2.1)) have hm : Measurable marked := by have hb : Measurable bit := measurable_of_countable bit have hs : MeasurableSet {z : ℝ × Bool × Bool | 0 ≤ z.1} := measurableSet_le measurable_const measurable_fst exact measurable_fst.prodMk (hb.comp ((measurable_snd.snd).ite hs (measurable_snd.fst))) have hi := hL.independent.comp measurable_id hm have heq : (fun ω : Latent => (score ω, bit (outcome ω))) = marked ∘ (fun ω : Latent => (score ω, ω.2.1, ω.2.2.1)) := by funext ω by_cases h : 0 ≤ score ω <;> simp [marked, outcome, side, h] change IndepFun errorCoord (fun ω : Latent => (score ω, bit (outcome ω))) L.P rw [heq] exact hi · intro d have hmean := hL.means d 0 (by norm_num) change 0 ≤ L.mu d 0 ∧ L.mu d 0 ≤ 1 constructor <;> linarith
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmarkEmbedding_mem · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:52
theorem benchmarkEmbedding_preserves Lemma benchmarkEmbedding_preserves in the paper ↗

Inclusion preserves the target, observed law, and the whole seeded experiment. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
L :
hL :
Model β σ L
conclusion 2
conclusion 3
conclusion 4
n :
ℕ
Proof (Lean source)
lemma benchmarkEmbedding_preserves (β σ : ℝ) (L : LatentLaw) (hL : Model β σ L) : GaussianIdClass σ (benchmarkEmbedding L) ∧ gaussianTarget (benchmarkEmbedding L) = theta L ∧ gaussianPobs (benchmarkEmbedding L) σ = Pobs L σ ∧ ∀ n : ℕ, gaussianExperiment (benchmarkEmbedding L) σ n = experiment L σ n := by exact ⟨benchmarkEmbedding_mem β σ L hL, rfl, rfl, fun _ => rfl⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmarkEmbedding_preserves · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:88
theorem observed_map_measurable Lemma observed_map_measurable in the paper ↗

The observation map is measurable, including its cutoff treatment coordinate. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
Proof (Lean source)
lemma observed_map_measurable (σ : ℝ) : Measurable (obs σ) := by have hs : Measurable score := by unfold score; fun_prop have he : Measurable errorCoord := by unfold errorCoord; fun_prop have hd : Measurable side := by unfold side have hset := measurableSet_le (measurable_const : Measurable (fun _ : Latent => (0 : ℝ))) hs have heq : (fun ω : Latent => decide (0 ≤ score ω)) = (fun ω => if 0 ≤ score ω then true else false) := by funext ω by_cases h : 0 ≤ score ω <;> simp [h] rw [heq] exact measurable_const.ite hset measurable_const have hy : Measurable outcome := by unfold outcome exact (measurable_snd.snd.fst).ite (by simpa [side] using (measurableSet_le measurable_const hs)) (measurable_snd.fst) exact (hs.add (measurable_const.mul he)).prodMk (hd.prodMk hy)
CausalSmith.Stat.RdTruesideNoiseFrontier.observed_map_measurable · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:96
theorem gaussianExperiment_probability Lemma gaussianExperiment_probability in the paper ↗

Every larger-class observation experiment, including the seed, has unit mass. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
n :
ℕ
Proof (Lean source)
lemma gaussianExperiment_probability (Q : GaussianLawData) (σ : ℝ) (n : ℕ) : IsProbabilityMeasure (gaussianExperiment Q σ n) := by letI : IsProbabilityMeasure Q.Q := Q.prob letI : IsProbabilityMeasure (gaussianPobs Q σ) := Measure.isProbabilityMeasure_map (observed_map_measurable σ).aemeasurable unfold gaussianExperiment seedLaw infer_instance
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussianExperiment_probability · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:116

Binary cutoff means put the causal contrast in the declared target interval. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hQ :
gaussianTarget Q ∈ Icc (-1 : ℝ) 1
Proof (Lean source)
lemma gaussianTarget_mem (Q : GaussianLawData) (σ : ℝ) (hQ : GaussianIdClass σ Q) : gaussianTarget Q ∈ Icc (-1 : ℝ) 1 := by have h₁ := hQ.2.2.2 true have h₀ := hQ.2.2.2 false unfold gaussianTarget constructor <;> linarith

The constant full interval is an admissible connected closed interval procedure. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
n :
ℕ
fullIntervalProc n :
clause 1
lo := fun _ => -1
clause 2
hi := fun _ => 1
clause 3
lo_meas := measurable_const
clause 4
hi_meas := measurable_const
clause 5
endpoints := fun _ => by norm_num
theorem fullIntervalProc_gaussian_honest Lemma fullIntervalProc_gaussian_honest in the paper ↗

The full target interval covers every law of the larger class with probability one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n :
ℕ
σ :
ℝ
Proof (Lean source)
lemma fullIntervalProc_gaussian_honest (n : ℕ) (σ : ℝ) : fullIntervalProc n ∈ gaussianHonestIntervals n σ := by intro Q hQ letI := gaussianExperiment_probability Q σ n have ht := gaussianTarget_mem Q σ hQ have hevent : coverageEvent (fullIntervalProc n).lo (fullIntervalProc n).hi (gaussianTarget Q) = univ := by ext z simp [coverageEvent, fullIntervalProc, ht.1, ht.2] rw [hevent] norm_num [Measure.real]
CausalSmith.Stat.RdTruesideNoiseFrontier.fullIntervalProc_gaussian_honest · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:141
theorem gaussian_minimax_risk_le_one Lemma gaussian_minimax_risk_le_one in the paper ↗

The zero estimator bounds the extended minimax risk by one. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n :
ℕ
σ :
ℝ
minimaxValueENNReal (fun (T : Estimator n) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal |T.val z - gaussianTarget Q.val| ∂gaussianExperiment Q.val σ n)
≤ 1
Proof (Lean source)
lemma gaussian_minimax_risk_le_one (n : ℕ) (σ : ℝ) : minimaxValueENNReal (fun (T : Estimator n) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal |T.val z - gaussianTarget Q.val| ∂gaussianExperiment Q.val σ n) ≤ 1 := by refine (minimaxValueENNReal_le_worstCaseRisk (⟨fun _ => 0, measurable_const⟩ : Estimator n)).trans ?_ apply worstCaseRiskENNReal_le intro Q letI := gaussianExperiment_probability Q.val σ n have ht := gaussianTarget_mem Q.val σ Q.property have hb : |0 - gaussianTarget Q.val| ≤ 1 := by rw [abs_le] constructor <;> linarith [ht.1, ht.2] calc _ ≤ ∫⁻ _ : Input n, (1 : ℝ≥0∞) ∂gaussianExperiment Q.val σ n := lintegral_mono fun _ => (ENNReal.ofReal_le_ofReal hb).trans_eq (by norm_num) _ = 1 := by simp
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussian_minimax_risk_le_one · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:154
theorem gaussian_minimax_length_le_two Lemma gaussian_minimax_length_le_two in the paper ↗

The full interval bounds the extended honest minimax length by two. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
n :
ℕ
σ :
ℝ
minimaxValueENNReal (fun (I : {I // I ∈ gaussianHonestIntervals n σ}) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal (intervalLength (I.val.lo z) (I.val.hi z)) ∂gaussianExperiment Q.val σ n)
≤ 2
Proof (Lean source)
lemma gaussian_minimax_length_le_two (n : ℕ) (σ : ℝ) : minimaxValueENNReal (fun (I : {I // I ∈ gaussianHonestIntervals n σ}) (Q : {Q // GaussianIdClass σ Q}) => ∫⁻ z, ofReal (intervalLength (I.val.lo z) (I.val.hi z)) ∂gaussianExperiment Q.val σ n) ≤ 2 := by refine (minimaxValueENNReal_le_worstCaseRisk ⟨fullIntervalProc n, fullIntervalProc_gaussian_honest n σ⟩).trans ?_ apply worstCaseRiskENNReal_le intro Q letI := gaussianExperiment_probability Q.val σ n norm_num [fullIntervalProc, intervalLength]
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussian_minimax_length_le_two · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:174

Honesty on the larger class implies honesty on the benchmark via the exact embedding. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
Proof (Lean source)
lemma gaussian_honest_subset (β σ : ℝ) (n : ℕ) : gaussianHonestIntervals n σ ⊆ honestIntervals β n σ := by intro I hI L hL exact hI (benchmarkEmbedding L) (benchmarkEmbedding_mem β σ L hL)
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussian_honest_subset · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:187
theorem benchmark_risk_le_gaussian Lemma benchmark_risk_le_gaussian in the paper ↗

Minimax absolute risk increases under target-preserving experiment inclusion. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
risk β n σ ≤ gaussianRisk n σ
Proof (Lean source)
lemma benchmark_risk_le_gaussian (β σ : ℝ) (n : ℕ) : risk β n σ ≤ gaussianRisk n σ := by apply ENNReal.toReal_mono (ne_top_of_le_ne_top (by norm_num) (gaussian_minimax_risk_le_one n σ)) exact minimaxValueENNReal_mono_class (fun L => ⟨benchmarkEmbedding L.val, benchmarkEmbedding_mem β σ L.val L.property⟩) (fun _ _ => le_rfl)
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmark_risk_le_gaussian · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:193
theorem benchmark_length_le_gaussian Lemma benchmark_length_le_gaussian in the paper ↗

Restricting honest procedures and enlarging the law class increases minimax length. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ :
ℝ
n :
ℕ
lengthRisk β n σ ≤ gaussianLength n σ
Proof (Lean source)
lemma benchmark_length_le_gaussian (β σ : ℝ) (n : ℕ) : lengthRisk β n σ ≤ gaussianLength n σ := by apply ENNReal.toReal_mono (ne_top_of_le_ne_top (by norm_num) (gaussian_minimax_length_le_two n σ)) apply minimaxValueENNReal_le_minimaxValue intro I refine ⟨⟨I.val, gaussian_honest_subset β σ n I.property⟩, ?_⟩ change (⨆ L : {L // Model β σ L}, expectedLength L.val σ n I.val) ≤ ⨆ Q : {Q // GaussianIdClass σ Q}, ∫⁻ z, ofReal (intervalLength (I.val.lo z) (I.val.hi z)) ∂gaussianExperiment Q.val σ n apply iSup_le intro L exact le_iSup_of_le ⟨benchmarkEmbedding L.val, benchmarkEmbedding_mem β σ L.val L.property⟩ le_rfl
CausalSmith.Stat.RdTruesideNoiseFrontier.benchmark_length_le_gaussian · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:202
theorem gaussian_published_hypotheses Lemma gaussian_published_hypotheses in the paper ↗

Scaling the independent standard error gives the three published error/density hypotheses. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
σ :
ℝ
hQ :
conclusion 1
conclusion 2
conclusion 3
Proof (Lean source)
lemma gaussian_published_hypotheses (σ : ℝ) (Q : GaussianLawData) (hQ : GaussianIdClass σ Q) : PeiShen1Y σ Q ∧ PeiShen2C Q ∧ PeiShen7 σ Q := by refine ⟨?_, ?_, ?_⟩ · exact hQ.2.2.1.comp (by fun_prop) measurable_id · obtain ⟨r, hr, _, ha⟩ := hQ.1 exact ⟨r, hr, ha⟩ · unfold PeiShen7 have he : Measurable errorCoord := by unfold errorCoord; fun_prop rw [show (fun ω => σ * errorCoord ω) = (σ * ·) ∘ errorCoord from rfl, ← Measure.map_map (by fun_prop) he, hQ.2.1, gaussianReal_map_const_mul] congr 1 · exact mul_zero σ · apply NNReal.coe_injective change σ ^ 2 * 1 = σ ^ 2 ring
CausalSmith.Stat.RdTruesideNoiseFrontier.gaussian_published_hypotheses · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:219
theorem published_class_converse_transfer

Benchmark laws embed preserving the observed experiment and target; minimax values increase on the larger class, which receives only lower bounds. The Pei--Shen comparison is source provenance and has no role in constructing the embedding or proving minimax class monotonicity. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
conclusion 1
σ ∈ Icc (0 : ℝ) 1 :
L :
Model β σ L
conclusion 2
∃ c : ℝ,
0 < c
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
risk β n σ ≤ gaussianRisk n σ
c * frontierRate β n σ ≤ risk β n σ
lengthRisk β n σ ≤ gaussianLength n σ
c * frontierRate β n σ ≤ lengthRisk β n σ
conclusion 3
σ ∈ Ioc (0 : ℝ) 1 :
Proof (Lean source)
-- @node: prop:published-class-converse-transfer theorem published_class_converse_transfer (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : (∀ σ ∈ Icc (0 : ℝ) 1, ∀ L : LatentLaw, Model β σ L → GaussianIdClass σ (benchmarkEmbedding L) ∧ gaussianTarget (benchmarkEmbedding L) = theta L ∧ gaussianPobs (benchmarkEmbedding L) σ = Pobs L σ ∧ ∀ n : ℕ, gaussianExperiment (benchmarkEmbedding L) σ n = experiment L σ n) ∧ (∃ c : ℝ, 0 < c ∧ ∀ n : ℕ, 2 ≤ n → ∀ σ ∈ Icc (0 : ℝ) 1, risk β n σ ≤ gaussianRisk n σ ∧ c * frontierRate β n σ ≤ risk β n σ ∧ lengthRisk β n σ ≤ gaussianLength n σ ∧ c * frontierRate β n σ ≤ lengthRisk β n σ) ∧ (∀ σ ∈ Ioc (0 : ℝ) 1, ∀ Q : GaussianLawData, GaussianIdClass σ Q → PeiShen1Y σ Q ∧ PeiShen2C Q ∧ PeiShen7 σ Q) := by obtain ⟨⟨c, C, hc, hC, hfrontier⟩, _⟩ := uniform_frontier β hβ refine ⟨?_, ⟨c, hc, ?_⟩, ?_⟩ · intro σ hσ L hL exact benchmarkEmbedding_preserves β σ L hL · intro n hn σ hσ have hmatched := (hfrontier n hn σ hσ).2.1 exact ⟨benchmark_risk_le_gaussian β σ n, hmatched.1, benchmark_length_le_gaussian β σ n, hmatched.2.2.2.2.1⟩ · intro σ hσ Q hQ exact gaussian_published_hypotheses σ Q hQ
CausalSmith.Stat.RdTruesideNoiseFrontier.published_class_converse_transfer · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TPublishedClassConverseTransfer.lean:236
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.TUniformFrontier 5 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

Complete theorem conclusion: constants are outside the sample-size and noise binders. Given the displayed inputs and assumptions, this definition specifies the stated object.

Definition (Lean source)
β :
ℝ
UniformFrontierConclusion β :
Prop
clause 1
∃ c C : ℝ,
0 < c
0 < C
n :
ℕ
2 ≤ n
σ ∈ Icc (0 : ℝ) 1 :
MatchedFrontier β n σ c C
FrontierBranches β n σ c C
CausalSmith.Stat.RdTruesideNoiseFrontier.UniformFrontierConclusion · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontier.lean:23
theorem frontier_comparison_weaken Lemma frontier_comparison_weaken in the paper ↗

A comparison with a nonnegative target survives decreasing its lower constant and increasing its positive upper constant. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
x y c C c' C' :
ℝ
h :
c * x ≤ y ∧ y ≤ C * x
hy :
0 ≤ y
hC :
0 < C
hc :
c' ≤ c
hC' :
C ≤ C'
conclusion 1
c' * x ≤ y
conclusion 2
y ≤ C' * x
Proof (Lean source)
lemma frontier_comparison_weaken {x y c C c' C' : ℝ} (h : c * x ≤ y ∧ y ≤ C * x) (hy : 0 ≤ y) (hC : 0 < C) (hc : c' ≤ c) (hC' : C ≤ C') : c' * x ≤ y ∧ y ≤ C' * x := by have hx : 0 ≤ x := by by_contra! hx have := mul_neg_of_pos_of_neg hC hx linarith [h.2] exact ⟨(mul_le_mul_of_nonneg_right hc hx).trans h.1, h.2.trans (mul_le_mul_of_nonneg_right hC' hx)⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.frontier_comparison_weaken · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontier.lean:28
theorem matched_frontier_weaken Lemma matched_frontier_weaken in the paper ↗

The minimax chains permit a common smaller lower and larger upper constant. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ c C c' C' :
ℝ
n :
ℕ
h :
MatchedFrontier β n σ c C
hr :
0 ≤ frontierRate β n σ
hc :
c' ≤ c
hC :
C ≤ C'
MatchedFrontier β n σ c' C'
Proof (Lean source)
lemma matched_frontier_weaken {β σ c C c' C' : ℝ} {n : ℕ} (h : MatchedFrontier β n σ c C) (hr : 0 ≤ frontierRate β n σ) (hc : c' ≤ c) (hC : C ≤ C') : MatchedFrontier β n σ c' C' := by rcases h with ⟨h1, h2, h3, h4, h5, h6, h7, h8, h9⟩ exact ⟨(mul_le_mul_of_nonneg_right hc hr).trans h1, h2, h3, h4.trans (mul_le_mul_of_nonneg_right hC hr), (mul_le_mul_of_nonneg_right hc hr).trans h5, h6, h7, h8.trans (mul_le_mul_of_nonneg_right hC hr), h9⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.matched_frontier_weaken · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontier.lean:40
theorem frontier_branches_weaken Lemma frontier_branches_weaken in the paper ↗

Exact branches and interfaces survive a common widening of their comparison constants. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β σ c C c' C' :
ℝ
n :
ℕ
h :
FrontierBranches β n σ c C
hh :
0 ≤ rateResolution β n σ
hσ :
0 ≤ σ
hC :
0 < C
hc :
c' ≤ c
hC' :
C ≤ C'
FrontierBranches β n σ c' C'
Proof (Lean source)
lemma frontier_branches_weaken {β σ c C c' C' : ℝ} {n : ℕ} (h : FrontierBranches β n σ c C) (hh : 0 ≤ rateResolution β n σ) (hσ : 0 ≤ σ) (hC : 0 < C) (hc : c' ≤ c) (hC' : C ≤ C') : FrontierBranches β n σ c' C' := by rcases h with ⟨hd, hn, hi, he⟩ refine ⟨hd, ?_, hi, he⟩ intro hnoisy rcases hn hnoisy with ⟨h0, hs, hiff, hm, hk⟩ refine ⟨h0, hs, hiff, ?_, ?_⟩ · intro hmid rcases hm hmid with ⟨z, hz, hzσ, heq, hres, huniq, hlo, hhi⟩ obtain ⟨hlo', hhi'⟩ := frontier_comparison_weaken ⟨hlo, hhi⟩ hh hC hc hC' exact ⟨z, hz, hzσ, heq, hres, huniq, hlo', hhi'⟩ · intro hcompact rcases hk hcompact with ⟨τ, hτ, heq, hres, huniq, hlo, hhi, hrlo, hrhi⟩ have hτ0 : 0 ≤ τ := (Real.rpow_nonneg hσ _).trans hτ.le have hr0 : 0 ≤ frontierRate β n σ := Real.rpow_nonneg hh _ obtain ⟨hlo', hhi'⟩ := frontier_comparison_weaken ⟨hlo, hhi⟩ hτ0 hC hc hC' obtain ⟨hrlo', hrhi'⟩ := frontier_comparison_weaken ⟨hrlo, hrhi⟩ hr0 hC hc hC' exact ⟨τ, hτ, heq, hres, huniq, hlo', hhi', hrlo', hrhi'⟩
CausalSmith.Stat.RdTruesideNoiseFrontier.frontier_branches_weaken · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontier.lean:50
theorem uniform_frontier

All-sample, all-noise endpoint frontier, with exhaustive branches, interfaces and sequence comparisons. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
-- @node: thm:uniform-frontier theorem uniform_frontier (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : UniformFrontierConclusion β := by let legendre_of_gate : ClassicalLegendreFacts := classicalLegendreFacts let hermite_of_gate : ClassicalHermiteFacts := classicalHermiteFacts obtain ⟨c₁, C₁, hc₁, hC₁, hmatched⟩ := matched_frontier legendre_of_gate hermite_of_gate β hβ obtain ⟨c₂, C₂, hc₂, hC₂, hbranches⟩ := frontier_branches β hβ refine ⟨⟨min c₁ c₂, max C₁ C₂, lt_min hc₁ hc₂, lt_max_of_lt_left hC₁, ?_⟩, frontier_sequences β hβ, beta_one_frontier⟩ intro n hn σ hσ have hroot := unique_rate_root β n σ hβ hn hσ have hn0 : 0 < (n : ℝ) := by exact_mod_cast (show 0 < n by omega) have hh : 0 ≤ rateResolution β n σ := (le_of_lt (Real.rpow_pos_of_pos hn0 _)).trans hroot.1.1 refine ⟨hroot, matched_frontier_weaken (hmatched n hn σ hσ) (Real.rpow_nonneg hh _) (min_le_left _ _) (le_max_left _ _), ?_⟩ exact frontier_branches_weaken (hbranches n hn σ hσ) hh hσ.1 hC₂ (min_le_right _ _) (le_max_right _ _)
CausalSmith.Stat.RdTruesideNoiseFrontier.uniform_frontier · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontier.lean:72
CausalSmith.Stat.STAT_RdTruesideNoiseFrontier_Research.TUniformFrontierResolution 1 declarations Law-level constructions and the obligations specified by the typed core.

True-side Gaussian measurement-error endpoint frontier

Law-level constructions and the obligations specified by the typed core. Cited logical facts are explicit inputs; bibliographic records have no logical consumers.

theorem uniform_frontier_resolution

The uniform precision question is resolved by the same root, public minimization, and observable procedures. Given the displayed inputs and assumptions, the stated mathematical conclusion holds.

Formal statement
β :
ℝ
hβ :
β ∈ Ioc (0 : ℝ) 1
Proof (Lean source)
-- @node: thm:uniform-frontier-resolution theorem uniform_frontier_resolution (β : ℝ) (hβ : β ∈ Ioc (0 : ℝ) 1) : UniformFrontierConclusion β := by exact uniform_frontier β hβ
CausalSmith.Stat.RdTruesideNoiseFrontier.uniform_frontier_resolution · CausalSmith/Stat/STAT_RdTruesideNoiseFrontier_Research/TUniformFrontierResolution.lean:23