Formalization: Contour Instruments for Partially Linear Models with Cumulant-separated Treatment Noise

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.

Basic 61 declarations This file gives the observed-data law, residuals, exact assumptions, model classes, and decision-theoretic losses shared by the paper's statements.

Spectral annihilation for partially linear models: common setup

This file gives the observed-data law, residuals, exact assumptions, model classes, and decision-theoretic losses shared by the paper's statements. The PO substrate is deliberately bypassed: this paper ranges over triangular classes of observed-data laws rather than one fixed potential-outcome system.

The observation space: a single observed unit is a triple made of a covariate value drawn from the covariate space, a real-valued treatment, and a real-valued outcome. Every law considered in the paper is a probability distribution on this space.

Definition (Lean source)
abbrev Obs (Xspace : Type*) := Xspace × ℝ × ℝ
CausalSmith.Stat.SaPlmCumulantConverse.Obs · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:25

Primitive constants and deterministic code-radius sequences.

Definition (Lean source)
n :
n_pos :
1 ≤ n
r :
k :
k_eq :
k = r + 1
r_ge_two :
2 ≤ r
s :
ℝ≥0∞
r_le_s :
(r : ℝ≥0∞) ≤ s
gamma :
gamma_mem :
gamma ∈ Ioo (1 / 2 : ℝ) 1
Ctheta :
Cg :
Cq :
psieta :
psixi :
delta :
sigma :
constants_pos :
0 < Ctheta ∧ 0 < Cg ∧ 0 < Cq ∧ 0 < psieta ∧ 0 < psixi ∧ 0 < delta ∧ 0 < sigma
eps1n :
ℕ → ℝ
eps2n :
ℕ → ℝ
eps1_nonneg :
∀ n
if
1 ≤ n
then
0 ≤ eps1n n
eps2_nonneg :
∀ n
if
1 ≤ n
then
0 ≤ eps2n n
eps1_antitone :
∀ ⦃a b⦄
if
1 ≤ a
and
a ≤ b
then
eps1n b ≤ eps1n a
@realizes eps1n(nonincreasing on positive indices)
eps2_antitone :
∀ ⦃a b⦄
if
1 ≤ a
and
a ≤ b
then
eps2n b ≤ eps2n a
CausalSmith.Stat.SaPlmCumulantConverse.Parameters · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:31

A law and its deterministic supplied regression codes.

Definition (Lean source)
P :
Measure (Obs Xspace)
probability :
theta0 :
g0 :
Xspace → ℝ
q0 :
Xspace → ℝ
gcode :
ℕ → Xspace → ℝ
qcode :
ℕ → Xspace → ℝ
g0_measurable :
q0_measurable :
gcode_measurable :
∀ n, Measurable (gcode n)
qcode_measurable :
∀ n, Measurable (qcode n)
treatment_integrable :
Integrable (fun o : Obs Xspace ↦ o.2.1) P
@realizes T(integrable domain of the conditional mean)
outcome_integrable :
Integrable (fun o : Obs Xspace ↦ o.2.2) P
@realizes Y(integrable domain of the conditional mean)
g0_condMean :
@condExp (Obs Xspace) ℝ (comap (fun o : Obs Xspace ↦ o.1) inferInstance) inferInstance _ _ P (fun o ↦ o.2.1)
=ᵐ[P] fun o ↦ g0 o.1
@realizes g0(g0(X) = E[T|X])
q0_condMean :
@condExp (Obs Xspace) ℝ (comap (fun o : Obs Xspace ↦ o.1) inferInstance) inferInstance _ _ P (fun o ↦ o.2.2)
=ᵐ[P] fun o ↦ q0 o.1
CausalSmith.Stat.SaPlmCumulantConverse.Model · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:71
instance instIsProbabilityMeasureObsP

The observed-data law carried by a model is a probability measure, i.e. it assigns total mass one to the observation space. This is exactly the normalization recorded among the model's defining conditions, made available automatically wherever a probability law is required.

Definition (Lean source)
instance (p : Parameters) (m : Model (Xspace := Xspace) p) : IsProbabilityMeasure m.P := m.probability
CausalSmith.Stat.SaPlmCumulantConverse.instIsProbabilityMeasureObsP · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:99

Covariate coordinate.

Definition (Lean source)
def covariate (o : Obs Xspace) : Xspace := o.1 -- @realizes X(random element in Xspace)
CausalSmith.Stat.SaPlmCumulantConverse.covariate · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:106
def treatment

Treatment coordinate.

Definition (Lean source)
def treatment (o : Obs Xspace) : ℝ := o.2.1 -- @realizes T(real treatment)
CausalSmith.Stat.SaPlmCumulantConverse.treatment · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:109

Outcome coordinate.

Definition (Lean source)
def outcome (o : Obs Xspace) : ℝ := o.2.2 -- @realizes Y(real outcome)
CausalSmith.Stat.SaPlmCumulantConverse.outcome · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:112
def observedUnit

An observed unit is the coordinate triple (X,T,Y).

Definition (Lean source)
def observedUnit (o : Obs Xspace) : Obs Xspace := o -- @realizes O(observed triple X,T,Y)
CausalSmith.Stat.SaPlmCumulantConverse.observedUnit · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:115
def covariateLaw

Covariate marginal of the observed law.

Definition (Lean source)
def covariateLaw (p : Parameters) (m : Model (Xspace := Xspace) p) : Measure Xspace := m.P.map covariate -- @realizes PX(covariate marginal of P)
CausalSmith.Stat.SaPlmCumulantConverse.covariateLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:118

Current-index clipping of an externally supplied treatment-code sequence.

Definition (Lean source)
def clippedTreatmentCode (p : Parameters) (gcode : ℕ → Xspace → ℝ) (n : ℕ) (x : Xspace) : ℝ := min (max (gcode n x) (-p.Cg)) p.Cg
CausalSmith.Stat.SaPlmCumulantConverse.clippedTreatmentCode · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:122

Clipped treatment code.

Definition (Lean source)
def barG (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (x : Xspace) : ℝ := min (max (m.gcode n x) (-p.Cg)) p.Cg
CausalSmith.Stat.SaPlmCumulantConverse.barG · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:127

Current-index clipping of an externally supplied outcome-code sequence.

Definition (Lean source)
def clippedOutcomeCode (p : Parameters) (qcode : ℕ → Xspace → ℝ) (n : ℕ) (x : Xspace) : ℝ := min (max (qcode n x) (-p.Cq)) p.Cq
CausalSmith.Stat.SaPlmCumulantConverse.clippedOutcomeCode · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:132

Clipped outcome code.

Definition (Lean source)
def barQ (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (x : Xspace) : ℝ := min (max (m.qcode n x) (-p.Cq)) p.Cq
CausalSmith.Stat.SaPlmCumulantConverse.barQ · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:137

Treatment noise T-g0(X).

Definition (Lean source)
def eta (p : Parameters) (m : Model (Xspace := Xspace) p) (o : Obs Xspace) : ℝ := treatment o - m.g0 (covariate o) -- @realizes eta(T - g0(X))
CausalSmith.Stat.SaPlmCumulantConverse.eta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:142
def xi

Outcome noise Y-q0(X)-theta0*eta.

Definition (Lean source)
def xi (p : Parameters) (m : Model (Xspace := Xspace) p) (o : Obs Xspace) : ℝ := outcome o - m.q0 (covariate o) - m.theta0 * eta p m o
def treatmentError

Treatment-code residual contamination.

Definition (Lean source)
def treatmentError (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (o : Obs Xspace) : ℝ := m.g0 (covariate o) - barG p m n (covariate o) -- @realizes D(g0(X) - bargn(X))
CausalSmith.Stat.SaPlmCumulantConverse.treatmentError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:151

Observable learned treatment residual.

Definition (Lean source)
def learnedResidual (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (o : Obs Xspace) : ℝ := treatment o - barG p m n (covariate o) -- @realizes Z(T - bargn(X) = eta + D)
CausalSmith.Stat.SaPlmCumulantConverse.learnedResidual · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:156
def outcomeContamination

Outcome-side contamination.

Definition (Lean source)
def outcomeContamination (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (x : Xspace) : ℝ := m.q0 x - m.theta0 * (m.g0 x - barG p m n x)
CausalSmith.Stat.SaPlmCumulantConverse.outcomeContamination · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:161
def kappaEta

The cumulant is the real part of the kth derivative at zero of the analytic logarithm of the treatment-noise complex MGF.

Definition (Lean source)
def kappaEta (p : Parameters) (m : Model (Xspace := Xspace) p) : ℝ := (iteratedDeriv p.k (fun z : ℂ ↦ log (complexMGF (eta p m) m.P z)) 0).re
CausalSmith.Stat.SaPlmCumulantConverse.kappaEta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:167
def fourthCumulant

The fourth cumulant, independent of the parameter field k.

Definition (Lean source)
def fourthCumulant (p : Parameters) (m : Model (Xspace := Xspace) p) : ℝ := (iteratedDeriv 4 (fun z : ℂ ↦ log (complexMGF (eta p m) m.P z)) 0).re
CausalSmith.Stat.SaPlmCumulantConverse.fourthCumulant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:173
def Ak

Exact order-dependent constant in the localization radius.

Definition (Lean source)
def Ak (k : ℕ) : ℝ := (2 ^ (k + 4) * k.factorial : ℝ) ^ ((k - 2 : ℝ)⁻¹)
def zeroRadius

Explicit transform-zero localization radius.

Definition (Lean source)
def zeroRadius (p : Parameters) : ℝ := Ak p.k * (p.psieta ^ 2 / p.delta) ^ ((p.k - 2 : ℝ)⁻¹)
CausalSmith.Stat.SaPlmCumulantConverse.zeroRadius · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:182

The radius of the window over which the procedure searches for a zero of the treatment-noise transform: one unit larger than the explicit localization radius. The extra unit guarantees that the window strictly contains the zero whose existence the localization radius certifies, so the search cannot fail by landing on the boundary.

Definition (Lean source)
def searchRadius (p : Parameters) : ℝ := zeroRadius p + 1 -- @realizes R1(R0+1)
CausalSmith.Stat.SaPlmCumulantConverse.searchRadius · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:187
def fold0

The deterministic lower and upper inference folds.

Definition (Lean source)
def fold0 (n : ℕ) : Finset (Fin n) := Finset.univ.filter fun i ↦ i.1 < n / 2 -- @realizes I0(indices below floor n/2)
CausalSmith.Stat.SaPlmCumulantConverse.fold0 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:195
def fold1

The upper inference fold at sample size n: the collection of unit indices lying at or beyond the halfway point of the sample, the halfway point being the integer part of half the sample size. Together with the lower fold it splits the sample deterministically into two halves for cross-fitting.

Definition (Lean source)
def fold1 (n : ℕ) : Finset (Fin n) := Finset.univ.filter fun i ↦ n / 2 ≤ i.1 -- @realizes I1(indices from floor n/2 onward)
CausalSmith.Stat.SaPlmCumulantConverse.fold1 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:199
def IidSampling

Independent and identically distributed sampling: the joint law of the n observed units is the n-fold product of the single-unit observed-data law, so the units are drawn independently, each from that same law.

Definition (Lean source)
-- @node: ass:iid-sampling def IidSampling (n : ℕ) (P : Measure (Obs Xspace)) (mu : Measure (Fin n → Obs Xspace)) : Prop := mu = Measure.pi (fun _ : Fin n ↦ P)
CausalSmith.Stat.SaPlmCumulantConverse.IidSampling · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:207
def IndependentTreatmentNoise

The treatment noise, that is the treatment minus its conditional mean given the covariates, is statistically independent of the covariates under the observed-data law.

Definition (Lean source)
-- @node: ass:independent-treatment-noise def IndependentTreatmentNoise (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := IndepFun (eta p m) covariate m.P
CausalSmith.Stat.SaPlmCumulantConverse.IndependentTreatmentNoise · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:216
def xTSigma

The sigma-algebra generated by (X,T).

Definition (Lean source)
def xTSigma : MeasurableSpace (Obs Xspace) := comap (fun o : Obs Xspace ↦ (covariate o, treatment o)) inferInstance
CausalSmith.Stat.SaPlmCumulantConverse.xTSigma · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:229
def OutcomeMeanIndependence

The outcome noise — the outcome minus its conditional mean given the covariates minus the target coefficient times the treatment noise — is integrable and has conditional mean zero given the covariates and the treatment jointly.

Definition (Lean source)
-- @node: ass:outcome-mean-independence def OutcomeMeanIndependence (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := Integrable (xi p m) m.P ∧ @condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (xi p m) =ᵐ[m.P] 0
CausalSmith.Stat.SaPlmCumulantConverse.OutcomeMeanIndependence · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:233
def ThetaRange

The target coefficient of the partially linear model is bounded in absolute value by the target range constant Ctheta, i.e. it lies in the symmetric interval of that half-width.

Definition (Lean source)
-- @node: ass:theta-range def ThetaRange (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := |m.theta0| ≤ p.Ctheta -- @realizes theta0(range [-Ctheta,Ctheta])
CausalSmith.Stat.SaPlmCumulantConverse.ThetaRange · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:246
def GRange

The treatment regression function — the conditional mean of the treatment given the covariates — is bounded in absolute value by the treatment-regression range constant Cg at almost every covariate value under the covariate marginal.

Definition (Lean source)
-- @node: ass:g-range def GRange (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ᵐ x ∂covariateLaw p m, |m.g0 x| ≤ p.Cg -- @realizes g0(essential range bounded by Cg)
CausalSmith.Stat.SaPlmCumulantConverse.GRange · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:253
def QRange

The outcome regression function — the conditional mean of the outcome given the covariates — is bounded in absolute value by the outcome range constant Cq at almost every covariate value under the covariate marginal.

Definition (Lean source)
-- @node: ass:q-range def QRange (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ᵐ x ∂covariateLaw p m, |m.q0 x| ≤ p.Cq -- @realizes q0(essential range bounded by Cq)
CausalSmith.Stat.SaPlmCumulantConverse.QRange · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:261
def BoundedGaussianOutcome

The outcome variable itself is bounded in absolute value by the outcome range constant Cq almost surely under the observed-data law.

Definition (Lean source)
-- @node: ass:bounded-gaussian-outcome def BoundedGaussianOutcome (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ᵐ o ∂m.P, |outcome o| ≤ p.Cq
CausalSmith.Stat.SaPlmCumulantConverse.BoundedGaussianOutcome · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:268
def EtaSubGaussian

The treatment noise is sub-Gaussian at the treatment-noise scale psieta: the exponential of its squared value divided by the squared scale is integrable and has expectation at most two.

Definition (Lean source)
-- @node: ass:eta-subgaussian def EtaSubGaussian (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := Integrable (fun o ↦ exp ((eta p m o) ^ 2 / p.psieta ^ 2)) m.P ∧ ∫ o, exp ((eta p m o) ^ 2 / p.psieta ^ 2) ∂m.P ≤ 2
CausalSmith.Stat.SaPlmCumulantConverse.EtaSubGaussian · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:278
def XiSubGaussian

The outcome noise is conditionally sub-Gaussian given the covariates at the outcome-noise scale psixi: the exponential of its squared value divided by the squared scale is integrable, and its conditional expectation given the covariates is at most two at almost every covariate value.

Definition (Lean source)
-- @node: ass:xi-subgaussian def XiSubGaussian (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := Integrable (fun w ↦ exp ((xi p m w) ^ 2 / p.psixi ^ 2)) m.P ∧ ∀ᵐ o ∂m.P, (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun w ↦ exp ((xi p m w) ^ 2 / p.psixi ^ 2))) o ≤ 2
CausalSmith.Stat.SaPlmCumulantConverse.XiSubGaussian · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:292
def CumulantSeparation

The cumulant of the treatment noise at the order used throughout the paper is bounded away from zero: its absolute value is at least the separation constant delta.

Definition (Lean source)
-- @node: ass:cumulant-separation def CumulantSeparation (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := |kappaEta p m| ≥ p.delta -- @realizes delta(lower cumulant separation)
CausalSmith.Stat.SaPlmCumulantConverse.CumulantSeparation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:309
def TreatmentCodeRadiusLs

At every sample size of one or more, the clipped treatment code approximates the true treatment regression function to within the first accuracy sequence, the error being measured in the norm of exponent s under the covariate marginal.

Definition (Lean source)
-- @node: ass:treatment-code-radius def TreatmentCodeRadiusLs (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ n : ℕ, 1 ≤ n → eLpNorm (fun x ↦ barG p m n x - m.g0 x) p.s (covariateLaw p m) ≤ ofReal (p.eps1n n)
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusLs · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:321

The treatment-side accuracy budget imposed at a single sample size: the clipped treatment code approximates the true treatment regression function to within the first accuracy sequence evaluated at that sample size, measured in the norm of exponent s under the covariate marginal.

Definition (Lean source)
def TreatmentCodeRadiusLsAt (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) : Prop := eLpNorm (fun x ↦ barG p m n x - m.g0 x) p.s (covariateLaw p m) ≤ ofReal (p.eps1n n)
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusLsAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:334
def OutcomeCodeRadiusLs

At every sample size of one or more, the clipped outcome code approximates the true outcome regression function to within the second accuracy sequence, the error being measured in the norm of exponent s under the covariate marginal.

Definition (Lean source)
-- @node: ass:outcome-code-radius def OutcomeCodeRadiusLs (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ n : ℕ, 1 ≤ n → eLpNorm (fun x ↦ barQ p m n x - m.q0 x) p.s (covariateLaw p m) ≤ ofReal (p.eps2n n)
CausalSmith.Stat.SaPlmCumulantConverse.OutcomeCodeRadiusLs · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:346

The outcome-side accuracy budget imposed at a single sample size: the clipped outcome code approximates the true outcome regression function to within the second accuracy sequence evaluated at that sample size, measured in the norm of exponent s under the covariate marginal.

Definition (Lean source)
def OutcomeCodeRadiusLsAt (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) : Prop := eLpNorm (fun x ↦ barQ p m n x - m.q0 x) p.s (covariateLaw p m) ≤ ofReal (p.eps2n n)
CausalSmith.Stat.SaPlmCumulantConverse.OutcomeCodeRadiusLsAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:357
def TreatmentCodeRadiusLr

At every sample size of one or more, the clipped treatment code approximates the true treatment regression function to within the first accuracy sequence, with the error measured in the norm of exponent r — the fixed order of the cumulant analysis — under the covariate marginal.

Definition (Lean source)
-- @node: ass:jms-treatment-code-radius def TreatmentCodeRadiusLr (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ n : ℕ, 1 ≤ n → eLpNorm (fun x ↦ barG p m n x - m.g0 x) (p.r : ℝ≥0∞) (covariateLaw p m) ≤ ofReal (p.eps1n n)
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusLr · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:368

The comparator's treatment-side accuracy budget imposed at a single sample size: the clipped treatment code approximates the true treatment regression function to within the first accuracy sequence evaluated at that sample size, measured in the norm of exponent r under the covariate marginal.

Definition (Lean source)
def TreatmentCodeRadiusLrAt (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) : Prop := eLpNorm (fun x ↦ barG p m n x - m.g0 x) (p.r : ℝ≥0∞) (covariateLaw p m) ≤ ofReal (p.eps1n n)
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusLrAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:382
def OutcomeCodeRadiusLr

At every sample size of one or more, the clipped outcome code approximates the true outcome regression function to within the second accuracy sequence, with the error measured in the norm of exponent r under the covariate marginal.

Definition (Lean source)
-- @node: ass:jms-outcome-code-radius def OutcomeCodeRadiusLr (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ n : ℕ, 1 ≤ n → eLpNorm (fun x ↦ barQ p m n x - m.q0 x) (p.r : ℝ≥0∞) (covariateLaw p m) ≤ ofReal (p.eps2n n)
CausalSmith.Stat.SaPlmCumulantConverse.OutcomeCodeRadiusLr · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:391

The comparator's outcome-side accuracy budget imposed at a single sample size: the clipped outcome code approximates the true outcome regression function to within the second accuracy sequence evaluated at that sample size, measured in the norm of exponent r under the covariate marginal.

Definition (Lean source)
def OutcomeCodeRadiusLrAt (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) : Prop := eLpNorm (fun x ↦ barQ p m n x - m.q0 x) (p.r : ℝ≥0∞) (covariateLaw p m) ≤ ofReal (p.eps2n n)
CausalSmith.Stat.SaPlmCumulantConverse.OutcomeCodeRadiusLrAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:403
def GaussianTreatmentNoise

The treatment noise is exactly centered Gaussian with standard deviation sigma, i.e. its distribution under the observed-data law is the normal law with mean zero and variance the square of sigma.

Definition (Lean source)
-- @node: ass:gaussian-treatment-noise def GaussianTreatmentNoise (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := m.P.map (eta p m) = gaussianReal 0 ⟨p.sigma ^ 2, sq_nonneg p.sigma⟩
CausalSmith.Stat.SaPlmCumulantConverse.GaussianTreatmentNoise · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:412
def TreatmentCodeRadiusL1

At every sample size of one or more, the absolute deviation between the clipped treatment code and the true treatment regression function is integrable under the covariate marginal, and its mean is at most the first accuracy sequence evaluated at that sample size.

Definition (Lean source)
-- @node: ass:l1-treatment-code-radius def TreatmentCodeRadiusL1 (p : Parameters) (m : Model (Xspace := Xspace) p) : Prop := ∀ n : ℕ, 1 ≤ n → Integrable (fun x ↦ |barG p m n x - m.g0 x|) (covariateLaw p m) ∧ ∫ x, |barG p m n x - m.g0 x| ∂covariateLaw p m ≤ p.eps1n n
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusL1 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:424

The mean-absolute-error accuracy budget imposed at a single sample size: the deviation between the clipped treatment code and the true treatment regression function is integrable under the covariate marginal, with mean at most the first accuracy sequence evaluated at that sample size.

Definition (Lean source)
def TreatmentCodeRadiusL1At (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) : Prop := Integrable (fun x ↦ |barG p m n x - m.g0 x|) (covariateLaw p m) ∧ ∫ x, |barG p m n x - m.g0 x| ∂covariateLaw p m ≤ p.eps1n n
CausalSmith.Stat.SaPlmCumulantConverse.TreatmentCodeRadiusL1At · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:439
structure NonGaussianClass

The broad non-Gaussian model class at a given sample size: partially linear laws whose treatment noise is independent of the covariates, whose outcome noise is mean-independent of the covariate-treatment pair, whose target coefficient and whose two regression functions all obey their range bounds, whose treatment noise is sub-Gaussian and whose outcome noise is conditionally sub-Gaussian at the stated scales, whose treatment-noise cumulant is separated from zero, and whose treatment code attains the first accuracy sequence in mean absolute error at that sample size.

Definition (Lean source)
n :
m :
Model (Xspace := Xspace) p
n_pos :
1 ≤ n
independentTreatmentNoise :
outcomeMeanIndependence :
thetaRange :
gRange :
GRange p m
qRange :
QRange p m
etaSubGaussian :
xiSubGaussian :
cumulantSeparation :
treatmentCodeRadiusL1 :
CausalSmith.Stat.SaPlmCumulantConverse.NonGaussianClass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:448
structure GaussianClass

The Gaussian model class at a given sample size: partially linear laws whose treatment noise is independent of the covariates and exactly centered Gaussian with standard deviation sigma, whose outcome noise is mean-independent of the covariate-treatment pair, whose target coefficient and treatment regression function obey their range bounds, whose outcome is bounded almost surely, and whose treatment and outcome codes both attain their accuracy sequences in the norm of exponent s at that sample size.

Definition (Lean source)
n :
m :
Model (Xspace := Xspace) p
n_pos :
1 ≤ n
independentTreatmentNoise :
outcomeMeanIndependence :
thetaRange :
gRange :
GRange p m
boundedGaussianOutcome :
gaussianTreatmentNoise :
treatmentCodeRadius :
outcomeCodeRadius :
CausalSmith.Stat.SaPlmCumulantConverse.GaussianClass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:476
structure JmsAceClass

The published comparator's model class at a given sample size: partially linear laws with treatment noise independent of the covariates, outcome noise mean-independent of the covariate-treatment pair, target coefficient and both regression functions inside their range bounds, sub-Gaussian treatment noise and conditionally sub-Gaussian outcome noise, a treatment-noise cumulant separated from zero, and both the treatment and the outcome code attaining their accuracy sequences in the norm of exponent r at that sample size.

Definition (Lean source)
n :
m :
Model (Xspace := Xspace) p
n_pos :
1 ≤ n
independentTreatmentNoise :
outcomeMeanIndependence :
thetaRange :
gRange :
GRange p m
qRange :
QRange p m
etaSubGaussian :
xiSubGaussian :
cumulantSeparation :
treatmentCodeRadiusLr :
outcomeCodeRadiusLr :
CausalSmith.Stat.SaPlmCumulantConverse.JmsAceClass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:502
structure AceComparisonSubclass

The comparison subclass at a given sample size: every law in the broad non-Gaussian class that additionally has both its treatment code and its outcome code attaining their accuracy sequences in the norm of exponent s.

Definition (Lean source)
n :
m :
Model (Xspace := Xspace) p
treatmentCodeRadius :
outcomeCodeRadius :
CausalSmith.Stat.SaPlmCumulantConverse.AceComparisonSubclass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:530

An estimator at sample size n is a real-valued function of the entire sample, that is of the n observed covariate-treatment-outcome triples. No measurability is imposed here; the risk definitions restrict to measurable estimators where that is needed.

Definition (Lean source)
abbrev Estimator (n : ℕ) := (Fin n → Obs Xspace) → ℝ
CausalSmith.Stat.SaPlmCumulantConverse.Estimator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:545

I.i.d. product law used by all risks.

Definition (Lean source)
def iidLaw (m : Model (Xspace := Xspace) p) (n : ℕ) : Measure (Fin n → Obs Xspace) := Measure.pi fun _ ↦ m.P
CausalSmith.Stat.SaPlmCumulantConverse.iidLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:551

Extended nonnegative mean squared error of an estimator at one law.

Definition (Lean source)
def mseRisk (m : Model (Xspace := Xspace) p) (n : ℕ) (est : Estimator (Xspace := Xspace) n) : ℝ≥0∞ := ∫⁻ data, ofReal ((est data - m.theta0) ^ 2) ∂iidLaw m n
CausalSmith.Stat.SaPlmCumulantConverse.mseRisk · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:555

Minimax mean squared error on a supplied set of laws.

Definition (Lean source)
def minimaxRiskOn (p : Parameters) (n : ℕ) (laws : Set (Model (Xspace := Xspace) p)) : ℝ≥0∞ := ⨅ est : {e : Estimator (Xspace := Xspace) n // Measurable e}, ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m n est.1
CausalSmith.Stat.SaPlmCumulantConverse.minimaxRiskOn · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:560
def generalizedQuantile

The lower quantile at level one minus the confidence parameter gamma of a real-valued statistic of the sample, the quantile being taken of the distribution the statistic induces when the n units are drawn independently from the given law.

Definition (Lean source)
def generalizedQuantile (p : Parameters) (n : ℕ) (m : Model (Xspace := Xspace) p) (W : (Fin n → Obs Xspace) → ℝ) : ℝ := quantile (Measure.map W (iidLaw m n)) (1 - p.gamma)
CausalSmith.Stat.SaPlmCumulantConverse.generalizedQuantile · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:566
def minimaxQuantileRiskGOn

Gaussian generalized-quantile minimax loss with fixed supplied codes.

Definition (Lean source)
def minimaxQuantileRiskGOn (p : Parameters) (n : ℕ) (gcode qcode : ℕ → Xspace → ℝ) : ℝ≥0∞ := ⨅ est : {e : Estimator (Xspace := Xspace) n // Measurable e}, ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : GaussianClass p n m ∧ barG p m n = clippedTreatmentCode p gcode n ∧ barQ p m n = clippedOutcomeCode p qcode n), ofReal (generalizedQuantile p n m (fun data ↦ |est.1 data - m.theta0|))
CausalSmith.Stat.SaPlmCumulantConverse.minimaxQuantileRiskGOn · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:583
def minimaxRisks

The three losses defined together in the paper: non-Gaussian MSE, Gaussian-intersection MSE, and Gaussian generalized-quantile risk.

Definition (Lean source)
-- @node: def:minimax-risks def minimaxRisks (p : Parameters) (n : ℕ) (gcode qcode : ℕ → Xspace → ℝ) : ℝ≥0∞ × ℝ≥0∞ × ℝ≥0∞ := (minimaxRiskOn p n {m | NonGaussianClass p n m ∧ barG p m n = clippedTreatmentCode p gcode n ∧ barQ p m n = clippedOutcomeCode p qcode n}, minimaxRiskOn p n {m | GaussianClass p n m ∧ barG p m n = clippedTreatmentCode p gcode n ∧ barQ p m n = clippedOutcomeCode p qcode n}, minimaxQuantileRiskGOn p n gcode qcode)
CausalSmith.Stat.SaPlmCumulantConverse.minimaxRisks · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:593

First projection of the jointly anchored minimax-loss triple.

Definition (Lean source)
def minimaxRisk (p : Parameters) (n : ℕ) (gcode qcode : ℕ → Xspace → ℝ) : ℝ≥0∞ := (minimaxRisks p n gcode qcode).1
CausalSmith.Stat.SaPlmCumulantConverse.minimaxRisk · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:611

Second projection of the jointly anchored minimax-loss triple.

Definition (Lean source)
def minimaxRiskG (p : Parameters) (n : ℕ) (gcode qcode : ℕ → Xspace → ℝ) : ℝ≥0∞ := (minimaxRisks p n gcode qcode).2.1
CausalSmith.Stat.SaPlmCumulantConverse.minimaxRiskG · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:616

Third projection of the jointly anchored minimax-loss triple.

Definition (Lean source)
def minimaxQuantileRiskG (p : Parameters) (n : ℕ) (gcode qcode : ℕ → Xspace → ℝ) : ℝ≥0∞ := (minimaxRisks p n gcode qcode).2.2
CausalSmith.Stat.SaPlmCumulantConverse.minimaxQuantileRiskG · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Basic.lean:621
Helpers.AdaptiveSelectorPacket 19 declarations This module packages the deterministic split-fold facts, measurable empirical transform errors, and selected-contour certificate used by the root-risk proof.

Good-event assembly for the adaptive contour selector

This module packages the deterministic split-fold facts, measurable empirical transform errors, and selected-contour certificate used by the root-risk proof.

theorem measurable_residual_transformSupError

The split-fold empirical residual-transform supremum error is Borel measurable as a function of the finite sample.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hclass :
Measurable (transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) (searchRadius p))
Proof (Lean source)
lemma measurable_residual_transformSupError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hclass : NonGaussianClass p p.n m) : Measurable (transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) (searchRadius p)) := by let A := 2 * exp (8 * searchRadius p * p.Cg + 4 * searchRadius p ^ 2 * p.psieta ^ 2) let C := Real.sqrt A have hR : 0 < searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith have hA : 0 ≤ A := by dsimp [A]; positivity have henv : ∫⁻ o, ofReal ((|(1 : ℝ)| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (C ^ 2) := by have h := learnedResidual_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le rw [show C ^ 2 = A by exact Real.sq_sqrt hA] simpa [A, ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] using h have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) have hcont := weightedTransform_continuousOn_of_factorial_envelope (P := m.P) (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) measurable_const hZmeas (searchRadius p) hR C (Real.sqrt_nonneg A) henv have hcontF : ContinuousOn (residualMGF p m p.n) {z : ℂ | ‖z‖ ≤ searchRadius p} := by rw [show residualMGF p m p.n = weightedTransform m.P (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) by funext z simp [residualMGF, weightedTransform, complexMGF]] exact hcont rw [transformSupError_eq_diskSupNorm] apply measurable_diskSupNorm_of_continuous _ (searchRadius p) hR.le · intro z _hz have hg := m.gcode_measurable p.n unfold empiricalF learnedResidual treatment barG covariate fun_prop · intro data have hemp : Continuous (empiricalF p m p.n data (inferenceFold p.n a)) := by unfold empiricalF fun_prop exact hemp.continuousOn.sub hcontF
CausalSmith.Stat.SaPlmCumulantConverse.measurable_residual_transformSupError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:156
theorem measurable_outcome_transformSupError

The split-fold empirical outcome-transform supremum error is Borel measurable as a function of the finite sample.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hclass :
Measurable (transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) (searchRadius p))
Proof (Lean source)
lemma measurable_outcome_transformSupError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hclass : NonGaussianClass p p.n m) : Measurable (transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) (searchRadius p)) := by let A := 64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * searchRadius p * p.Cg + 16 * searchRadius p ^ 2 * p.psieta ^ 2) let C := Real.sqrt A have hR : 0 < searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith have hA : 0 ≤ A := by dsimp [A]; positivity have henv : ∫⁻ o, ofReal ((|outcome o| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (C ^ 2) := by have h := outcome_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le rw [show C ^ 2 = A by exact Real.sq_sqrt hA] exact h have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) have hcont := weightedTransform_continuousOn_of_factorial_envelope (P := m.P) outcome (learnedResidual p m p.n) measurable_snd.snd hZmeas (searchRadius p) hR C (Real.sqrt_nonneg A) henv have hcontG : ContinuousOn (outcomeResidualTransform p m p.n) {z : ℂ | ‖z‖ ≤ searchRadius p} := by exact hcont rw [transformSupError_eq_diskSupNorm] apply measurable_diskSupNorm_of_continuous _ (searchRadius p) hR.le · intro z _hz have hg := m.gcode_measurable p.n unfold empiricalG learnedResidual treatment barG covariate outcome fun_prop · intro data have hemp : Continuous (empiricalG p m p.n data (inferenceFold p.n a)) := by unfold empiricalG fun_prop exact hemp.continuousOn.sub hcontG
CausalSmith.Stat.SaPlmCumulantConverse.measurable_outcome_transformSupError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:213
def residualTransformMajorant

Absolute centered-factorial coefficient majorant for the residual transform on one inference fold.

Definition (Lean source)
def residualTransformMajorant {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (data : Fin p.n → Obs Xspace) : ℝ := let I := inferenceFold p.n a ∑' k : ℕ, |(I.card : ℝ)⁻¹ * ∑ i ∈ I, (learnedResidual p m p.n (data i) ^ k / k.factorial - ∫ o, learnedResidual p m p.n o ^ k / k.factorial ∂m.P)| * searchRadius p ^ k
CausalSmith.Stat.SaPlmCumulantConverse.residualTransformMajorant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:387
def outcomeTransformMajorant

Absolute centered-factorial coefficient majorant for the outcome-weighted transform on one inference fold.

Definition (Lean source)
def outcomeTransformMajorant {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (data : Fin p.n → Obs Xspace) : ℝ := let I := inferenceFold p.n a ∑' k : ℕ, |(I.card : ℝ)⁻¹ * ∑ i ∈ I, (outcome (data i) * learnedResidual p m p.n (data i) ^ k / k.factorial - ∫ o, outcome o * learnedResidual p m p.n o ^ k / k.factorial ∂m.P)| * searchRadius p ^ k
CausalSmith.Stat.SaPlmCumulantConverse.outcomeTransformMajorant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:399
theorem residual_transformSupError_le_majorant

The residual-transform disk error is pointwise dominated by its centered factorial-series majorant.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hn :
2 ≤ p.n
hclass :
data :
Fin p.n → Obs Xspace
transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) (searchRadius p) data
Proof (Lean source)
lemma residual_transformSupError_le_majorant {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hn : 2 ≤ p.n) (hclass : NonGaussianClass p p.n m) (data : Fin p.n → Obs Xspace) : transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) (searchRadius p) data ≤ residualTransformMajorant p m a data := by let A := 2 * exp (8 * searchRadius p * p.Cg + 4 * searchRadius p ^ 2 * p.psieta ^ 2) let C := Real.sqrt A have hR : 0 < searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith have hA : 0 ≤ A := by dsimp [A]; positivity have henv : ∫⁻ o, ofReal ((|(1 : ℝ)| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (C ^ 2) := by have h := learnedResidual_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le rw [show C ^ 2 = A by exact Real.sq_sqrt hA] simpa [A, ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] using h have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) rw [show residualMGF p m p.n = weightedTransform m.P (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) by funext z simp [residualMGF, weightedTransform, complexMGF]] have h := weighted_transformSupError_le_centered_factorial_majorant (P := m.P) (inferenceFold p.n a) (inferenceFold_nonempty p.n hn a) (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) measurable_const hZmeas (searchRadius p) hR C (Real.sqrt_nonneg A) henv data simp [residualTransformMajorant, empiricalF, residualMGF, weightedTransform, complexMGF] at h ⊢ exact h
CausalSmith.Stat.SaPlmCumulantConverse.residual_transformSupError_le_majorant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:411
theorem outcome_transformSupError_le_majorant

The outcome-transform disk error is pointwise dominated by its centered factorial-series majorant.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hn :
2 ≤ p.n
hclass :
data :
Fin p.n → Obs Xspace
transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) (searchRadius p) data
Proof (Lean source)
lemma outcome_transformSupError_le_majorant {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hn : 2 ≤ p.n) (hclass : NonGaussianClass p p.n m) (data : Fin p.n → Obs Xspace) : transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) (searchRadius p) data ≤ outcomeTransformMajorant p m a data := by let A := 64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * searchRadius p * p.Cg + 16 * searchRadius p ^ 2 * p.psieta ^ 2) let C := Real.sqrt A have hR : 0 < searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith have hA : 0 ≤ A := by dsimp [A]; positivity have henv : ∫⁻ o, ofReal ((|outcome o| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (C ^ 2) := by have h := outcome_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le rw [show C ^ 2 = A by exact Real.sq_sqrt hA] exact h have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) have h := weighted_transformSupError_le_centered_factorial_majorant (P := m.P) (inferenceFold p.n a) (inferenceFold_nonempty p.n hn a) outcome (learnedResidual p m p.n) measurable_snd.snd hZmeas (searchRadius p) hR C (Real.sqrt_nonneg A) henv data simp [outcomeTransformMajorant, empiricalG, outcomeResidualTransform] at h ⊢ exact h
CausalSmith.Stat.SaPlmCumulantConverse.outcome_transformSupError_le_majorant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:459
def residualFoldError

Residual-transform disk error on one inference fold.

Definition (Lean source)
def residualFoldError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (data : Fin p.n → Obs Xspace) : ℝ := transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) (searchRadius p) data
def outcomeFoldError

Outcome-transform disk error on one inference fold.

Definition (Lean source)
def outcomeFoldError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (data : Fin p.n → Obs Xspace) : ℝ := transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) (searchRadius p) data
theorem measurable_residualFoldError

For a model in the non-Gaussian spectral class, the residual-transform error on either inference fold — the largest discrepancy, over all points of the search disk, between the fold's empirical residual transform and its population counterpart — is a measurable function of the sample.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hclass :
Proof (Lean source)
lemma measurable_residualFoldError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hclass : NonGaussianClass p p.n m) : Measurable (residualFoldError p m a) := by exact measurable_residual_transformSupError p m a hclass
CausalSmith.Stat.SaPlmCumulantConverse.measurable_residualFoldError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1512
theorem measurable_outcomeFoldError

For a model in the non-Gaussian spectral class, the outcome-transform error on either inference fold — the largest discrepancy, over all points of the search disk, between the fold's empirical outcome transform and its population counterpart — is a measurable function of the sample.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
a :
Fin 2
hclass :
Proof (Lean source)
lemma measurable_outcomeFoldError {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (m : Model (Xspace := Xspace) p) (a : Fin 2) (hclass : NonGaussianClass p p.n m) : Measurable (outcomeFoldError p m a) := by exact measurable_outcome_transformSupError p m a hclass
CausalSmith.Stat.SaPlmCumulantConverse.measurable_outcomeFoldError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1523
def adaptiveSelectorRatioConstant

Deterministic perturbation scale of the selected population contour.

Definition (Lean source)
def adaptiveSelectorRatioConstant (p : Parameters) (pStar : CertifiedBankInputs p) : ℝ := let aStar := ((contourBank p pStar).aStarRat : ℝ) ordinaryContourPerturbationConstant p (populationNumeratorEnvelope p) (31 * aStar / 64) (23 * aStar / 64)
CausalSmith.Stat.SaPlmCumulantConverse.adaptiveSelectorRatioConstant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1575
def adaptiveSelectorRiskConstant

The explicit constant in the adaptive selector's inverse-sample-size MSE bound.

Definition (Lean source)
def adaptiveSelectorRiskConstant (p : Parameters) (pStar : CertifiedBankInputs p) (K : ℝ) : ℝ := let aStar := ((contourBank p pStar).aStarRat : ℝ) let Lrat := adaptiveSelectorRatioConstant p pStar 12 * Lrat ^ 2 * K + 1536 * p.Ctheta ^ 2 * K / aStar ^ 2 + 2
CausalSmith.Stat.SaPlmCumulantConverse.adaptiveSelectorRiskConstant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1581
theorem adaptiveSelectorRiskConstant_pos

Whenever the transform-accuracy input is strictly positive, the explicit constant appearing in the adaptive selector's inverse-sample-size mean squared error bound is strictly positive, so that bound is never vacuous.

Formal statement
K :
hK :
0 < K
Proof (Lean source)
lemma adaptiveSelectorRiskConstant_pos (p : Parameters) (pStar : CertifiedBankInputs p) (K : ℝ) (hK : 0 < K) : 0 < adaptiveSelectorRiskConstant p pStar K := by dsimp [adaptiveSelectorRiskConstant] have ha : (0 : ℝ) < ((contourBank p pStar).aStarRat : ℝ) := by exact_mod_cast (contourBank p pStar).aStarRat_pos positivity
CausalSmith.Stat.SaPlmCumulantConverse.adaptiveSelectorRiskConstant_pos · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1588
theorem thetaHatSpec_sq_error_le_on_good

On the two-fold small-error event, the selected estimator has the deterministic squared perturbation bound used by the risk proof.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
hn :
2 ≤ p.n
hclass :
heps :
p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹
data :
Fin p.n → Obs Xspace
hd0 :
residualFoldError p m 0 data ≤ ((contourBank p pStar).aStarRat : ℝ) / 8
hd1 :
residualFoldError p m 1 data ≤ ((contourBank p pStar).aStarRat : ℝ) / 8
(thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2
≤ 4 * (adaptiveSelectorRatioConstant p pStar) ^ 2 * ((residualFoldError p m 1 data) ^ 2 + (outcomeFoldError p m 1 data) ^ 2)
+ 2 / (p.n : ℝ) ^ 2
Proof (Lean source)
lemma thetaHatSpec_sq_error_le_on_good {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p) (hn : 2 ≤ p.n) (hclass : NonGaussianClass p p.n m) (heps : p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹) (data : Fin p.n → Obs Xspace) (hd0 : residualFoldError p m 0 data ≤ ((contourBank p pStar).aStarRat : ℝ) / 8) (hd1 : residualFoldError p m 1 data ≤ ((contourBank p pStar).aStarRat : ℝ) / 8) : (thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2 ≤ 4 * (adaptiveSelectorRatioConstant p pStar) ^ 2 * ((residualFoldError p m 1 data) ^ 2 + (outcomeFoldError p m 1 data) ^ 2) + 2 / (p.n : ℝ) ^ 2 := by let d1 := residualFoldError p m 1 data let e1 := outcomeFoldError p m 1 data let aStar := ((contourBank p pStar).aStarRat : ℝ) let mu := 31 * aStar / 64 let nu := 23 * aStar / 64 let Lrat := adaptiveSelectorRatioConstant p pStar have hpacket := canonicalSelectorPacket_of_small_errors p pStar cStar m hn hclass heps data hd0 hd1 dsimp only at hpacket rcases hpacket with ⟨hgood, hratio, hidentify⟩ have hpert := thetaHatSpec_good_event_exact_contour_perturbation p pStar cStar m.gcode data (residualMGF p m p.n) (outcomeResidualTransform p m p.n) d1 e1 (populationNumeratorEnvelope p) mu nu m.theta0 hclass.thetaRange hgood hratio hidentify have hnmax : max (p.n : ℝ) 1 = (p.n : ℝ) := max_eq_left (by exact_mod_cast (show 1 ≤ p.n by omega)) rw [hnmax] at hpert have hL : 0 ≤ Lrat := by change 0 ≤ searchRadius p * max nu⁻¹ (populationNumeratorEnvelope p * (mu * nu)⁻¹) apply mul_nonneg · unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith · apply le_max_of_le_left exact inv_nonneg.mpr hgood.2.2.2.2.1.le have hd : 0 ≤ d1 := hgood.1 have he : 0 ≤ e1 := hgood.2.1 have hnpos : (0 : ℝ) < p.n := by positivity have hrhs : 0 ≤ Lrat * (d1 + e1) + 1 / (p.n : ℝ) := by positivity change |thetaHatSpec p pStar cStar m.gcode data - m.theta0| ≤ Lrat * (d1 + e1) + 1 / (p.n : ℝ) at hpert have hsquare : (thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2 ≤ (Lrat * (d1 + e1) + 1 / (p.n : ℝ)) ^ 2 := by rw [← sq_abs (thetaHatSpec p pStar cStar m.gcode data - m.theta0)] exact sq_le_sq₀ (abs_nonneg _) hrhs |>.2 hpert change (thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2 ≤ 4 * Lrat ^ 2 * (d1 ^ 2 + e1 ^ 2) + 2 / (p.n : ℝ) ^ 2 calc _ ≤ (Lrat * (d1 + e1) + 1 / (p.n : ℝ)) ^ 2 := hsquare _ ≤ 2 * (Lrat * (d1 + e1)) ^ 2 + 2 * (1 / (p.n : ℝ)) ^ 2 := by nlinarith [sq_nonneg (Lrat * (d1 + e1) - 1 / (p.n : ℝ))] _ ≤ 4 * Lrat ^ 2 * (d1 ^ 2 + e1 ^ 2) + 2 / (p.n : ℝ) ^ 2 := by have hde : (d1 + e1) ^ 2 ≤ 2 * (d1 ^ 2 + e1 ^ 2) := by nlinarith [sq_nonneg (d1 - e1)] have hmain : 2 * (Lrat * (d1 + e1)) ^ 2 ≤ 4 * Lrat ^ 2 * (d1 ^ 2 + e1 ^ 2) := by calc _ = (2 * Lrat ^ 2) * (d1 + e1) ^ 2 := by ring _ ≤ (2 * Lrat ^ 2) * (2 * (d1 ^ 2 + e1 ^ 2)) := mul_le_mul_of_nonneg_left hde (mul_nonneg (by norm_num) (sq_nonneg Lrat)) _ = _ := by ring have hrec : 2 * (1 / (p.n : ℝ)) ^ 2 = 2 / (p.n : ℝ) ^ 2 := by field_simp rw [hrec] linarith
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_sq_error_le_on_good · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1599
theorem thetaHatSpec_sq_error_le_clip

Projection onto the certified parameter range globally bounds squared loss.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
hclass :
data :
Fin p.n → Obs Xspace
(thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2 ≤ 4 * p.Ctheta ^ 2
Proof (Lean source)
lemma thetaHatSpec_sq_error_le_clip {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p) (hclass : NonGaussianClass p p.n m) (data : Fin p.n → Obs Xspace) : (thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2 ≤ 4 * p.Ctheta ^ 2 := by rcases thetaHatSpec_mem_Icc p pStar cStar m.gcode data with ⟨hestlo, hesthi⟩ rcases abs_le.mp hclass.thetaRange with ⟨hthetalo, hthetahi⟩ have habs : |thetaHatSpec p pStar cStar m.gcode data - m.theta0| ≤ 2 * p.Ctheta := by rw [abs_le] constructor <;> linarith [p.constants_pos.1] rw [← sq_abs (thetaHatSpec p pStar cStar m.gcode data - m.theta0)] have hC : 0 ≤ 2 * p.Ctheta := by linarith [p.constants_pos.1] convert (sq_le_sq₀ (abs_nonneg _) hC).2 habs using 1 <;> first | rfl | ring
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_sq_error_le_clip · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1682
theorem thetaHatSpec_mseRisk_le_of_l2

Risk bridge from the foldwise transform L² estimate to the adaptive selector's explicit MSE constant.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
hn :
2 ≤ p.n
hclass :
heps :
p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹
K :
hK :
0 ≤ K
hL2 :
∀ a : Fin 2,
(∫⁻ data, ofReal ((residualFoldError p m a data) ^ 2) ∂iidLaw m p.n)
+ (∫⁻ data, ofReal ((outcomeFoldError p m a data) ^ 2) ∂iidLaw m p.n)
ofReal (K / (inferenceFold p.n a).card)
mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode)
ofReal (adaptiveSelectorRiskConstant p pStar K / p.n)
Proof (Lean source)
theorem thetaHatSpec_mseRisk_le_of_l2 {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p) (hn : 2 ≤ p.n) (hclass : NonGaussianClass p p.n m) (heps : p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹) (K : ℝ) (hK : 0 ≤ K) (hL2 : ∀ a : Fin 2, (∫⁻ data, ofReal ((residualFoldError p m a data) ^ 2) ∂iidLaw m p.n) + (∫⁻ data, ofReal ((outcomeFoldError p m a data) ^ 2) ∂iidLaw m p.n) ≤ ofReal (K / (inferenceFold p.n a).card)) : mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (adaptiveSelectorRiskConstant p pStar K / p.n) := by let Q := iidLaw m p.n let aStar := ((contourBank p pStar).aStarRat : ℝ) let Lrat := adaptiveSelectorRatioConstant p pStar let d0 := residualFoldError p m 0 let d1 := residualFoldError p m 1 let e1 := outcomeFoldError p m 1 let good : Set (Fin p.n → Obs Xspace) := {data | d0 data ≤ aStar / 8 ∧ d1 data ≤ aStar / 8} have ha : 0 < aStar := by dsimp [aStar] exact_mod_cast (contourBank p pStar).aStarRat_pos have hnreal : (0 : ℝ) < p.n := by positivity have hd0meas : Measurable d0 := measurable_residualFoldError p m 0 hclass have hd1meas : Measurable d1 := measurable_residualFoldError p m 1 hclass have he1meas : Measurable e1 := measurable_outcomeFoldError p m 1 hclass have hgoodMeas : MeasurableSet good := (measurableSet_le hd0meas measurable_const).inter (measurableSet_le hd1meas measurable_const) have hd0nonneg : ∀ data, 0 ≤ d0 data := by intro data exact transformSupError_nonneg _ _ _ _ have hd1nonneg : ∀ data, 0 ≤ d1 data := by intro data exact transformSupError_nonneg _ _ _ _ have he1nonneg : ∀ data, 0 ≤ e1 data := by intro data exact transformSupError_nonneg _ _ _ _ have hfold0 := fold_errors_l2_le p m hn 0 K hK (hL2 0) have hfold1 := fold_errors_l2_le p m hn 1 K hK (hL2 1) have hd0L2 : (∫⁻ data, ofReal ((d0 data) ^ 2) ∂Q) ≤ ofReal (3 * K / p.n) := by exact (le_add_right le_rfl).trans hfold0 have hd1L2 : (∫⁻ data, ofReal ((d1 data) ^ 2) ∂Q) ≤ ofReal (3 * K / p.n) := by exact (le_add_right le_rfl).trans hfold1 have hd0bad : Q {data | aStar / 8 < d0 data} ≤ ofReal (192 * K / (aStar ^ 2 * p.n)) := by have h := measure_gt_of_sq_lintegral_le Q d0 hd0meas hd0nonneg (aStar / 8) (3 * K / p.n) (by positivity) hd0L2 convert h using 1 congr 1 field_simp <;> ring have hd1bad : Q {data | aStar / 8 < d1 data} ≤ ofReal (192 * K / (aStar ^ 2 * p.n)) := by have h := measure_gt_of_sq_lintegral_le Q d1 hd1meas hd1nonneg (aStar / 8) (3 * K / p.n) (by positivity) hd1L2 convert h using 1 congr 1 field_simp <;> ring have hgoodCompl : goodᶜ = {data | aStar / 8 < d0 data} ∪ {data | aStar / 8 < d1 data} := by ext data change ¬(d0 data ≤ aStar / 8 ∧ d1 data ≤ aStar / 8) ↔ aStar / 8 < d0 data ∨ aStar / 8 < d1 data constructor · intro h by_cases h0 : d0 data ≤ aStar / 8 · exact inr (lt_of_not_ge (fun h1 ↦ h ⟨h0, h1⟩)) · exact inl (lt_of_not_ge h0) · rintro (h0 | h1) h · exact (not_lt_of_ge h.1) h0 · exact (not_lt_of_ge h.2) h1 have hbad : Q goodᶜ ≤ ofReal (384 * K / (aStar ^ 2 * p.n)) := by rw [hgoodCompl] calc _ ≤ Q {data | aStar / 8 < d0 data} + Q {data | aStar / 8 < d1 data} := measure_union_le _ _ _ ≤ ofReal (192 * K / (aStar ^ 2 * p.n)) + ofReal (192 * K / (aStar ^ 2 * p.n)) := add_le_add hd0bad hd1bad _ = ofReal (384 * K / (aStar ^ 2 * p.n)) := by rw [← ENNReal.ofReal_add] · congr 1 ring · positivity · positivity have hL : 0 ≤ Lrat := by dsimp [Lrat, adaptiveSelectorRatioConstant, ordinaryContourPerturbationConstant] have hR : 0 ≤ searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith exact mul_nonneg hR (le_max_of_le_left (by positivity)) let loss : (Fin p.n → Obs Xspace) → ENNReal := fun data ↦ ofReal ((thetaHatSpec p pStar cStar m.gcode data - m.theta0) ^ 2) let goodBound : (Fin p.n → Obs Xspace) → ℝ := fun data ↦ 4 * Lrat ^ 2 * (d1 data ^ 2 + e1 data ^ 2) + 2 / (p.n : ℝ) ^ 2 have hlossMeas : Measurable loss := (((thetaHatSpec_measurable p pStar cStar m.gcode (m.gcode_measurable p.n)).sub measurable_const).pow_const 2) |>.ennreal_ofReal have hgoodBoundMeas : Measurable (fun data ↦ ofReal (goodBound data)) := ((measurable_const.mul ((hd1meas.pow_const 2).add (he1meas.pow_const 2))).add measurable_const).ennreal_ofReal have hgoodBoundENN (data : Fin p.n → Obs Xspace) : ofReal (goodBound data) = ofReal (4 * Lrat ^ 2) * (ofReal (d1 data ^ 2) + ofReal (e1 data ^ 2)) + ofReal (2 / (p.n : ℝ) ^ 2) := by dsimp [goodBound] rw [ENNReal.ofReal_add (mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg Lrat)) (add_nonneg (sq_nonneg _) (sq_nonneg _))) (by positivity)] rw [ENNReal.ofReal_mul (mul_nonneg (by norm_num) (sq_nonneg Lrat))] rw [ENNReal.ofReal_add (sq_nonneg _) (sq_nonneg _)] have hd1ENN : Measurable (fun data ↦ ofReal (d1 data ^ 2)) := (hd1meas.pow_const 2).ennreal_ofReal have he1ENN : Measurable (fun data ↦ ofReal (e1 data ^ 2)) := (he1meas.pow_const 2).ennreal_ofReal have hgoodInt : (∫⁻ data in good, loss data ∂Q) ≤ ofReal ((12 * Lrat ^ 2 * K + 2) / p.n) := by calc _ ≤ ∫⁻ data in good, ofReal (goodBound data) ∂Q := by apply setLIntegral_mono hgoodBoundMeas intro data hdata apply ENNReal.ofReal_le_ofReal exact thetaHatSpec_sq_error_le_on_good p pStar cStar m hn hclass heps data hdata.1 hdata.2 _ ≤ ∫⁻ data, ofReal (goodBound data) ∂Q := setLIntegral_le_lintegral _ _ _ = ofReal (4 * Lrat ^ 2) * ((∫⁻ data, ofReal (d1 data ^ 2) ∂Q) + (∫⁻ data, ofReal (e1 data ^ 2) ∂Q)) + ofReal (2 / (p.n : ℝ) ^ 2) := by simp_rw [hgoodBoundENN] rw [lintegral_add_left (measurable_const.fun_mul (hd1ENN.fun_add he1ENN)), lintegral_const_mul _ (hd1ENN.fun_add he1ENN), lintegral_add_left hd1ENN, lintegral_const] simp [Q, iidLaw, mul_add] _ ≤ ofReal (4 * Lrat ^ 2) * ofReal (3 * K / p.n) + ofReal (2 / (p.n : ℝ) ^ 2) := by have hmul := mul_le_mul_right hfold1 (ofReal (4 * Lrat ^ 2)) exact add_le_add (by simpa [d1, e1, Q] using hmul) le_rfl _ = ofReal (12 * Lrat ^ 2 * K / p.n + 2 / (p.n : ℝ) ^ 2) := by rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_add] · congr 1 ring · positivity · positivity _ ≤ ofReal ((12 * Lrat ^ 2 * K + 2) / p.n) := by apply ENNReal.ofReal_le_ofReal have hnOne : (1 : ℝ) ≤ p.n := by exact_mod_cast (show 1 ≤ p.n by omega) have hsmall : 2 / (p.n : ℝ) ^ 2 ≤ 2 / (p.n : ℝ) := by rw [div_le_div_iff₀ (sq_pos_of_pos hnreal) hnreal] nlinarith calc _ ≤ 12 * Lrat ^ 2 * K / p.n + 2 / p.n := by linarith _ = _ := by ring have hbadInt : (∫⁻ data in goodᶜ, loss data ∂Q) ≤ ofReal (1536 * p.Ctheta ^ 2 * K / (aStar ^ 2 * p.n)) := by calc _ ≤ ∫⁻ _data in goodᶜ, ofReal (4 * p.Ctheta ^ 2) ∂Q := by apply setLIntegral_mono measurable_const intro data _ exact ENNReal.ofReal_le_ofReal (thetaHatSpec_sq_error_le_clip p pStar cStar m hclass data) _ = ofReal (4 * p.Ctheta ^ 2) * Q goodᶜ := setLIntegral_const _ _ _ ≤ ofReal (4 * p.Ctheta ^ 2) * ofReal (384 * K / (aStar ^ 2 * p.n)) := mul_le_mul_right hbad _ _ = ofReal (1536 * p.Ctheta ^ 2 * K / (aStar ^ 2 * p.n)) := by rw [← ENNReal.ofReal_mul (by positivity)] congr 1 ring change ∫⁻ data, loss data ∂Q ≤ _ rw [← lintegral_add_compl loss hgoodMeas] calc _ ≤ ofReal ((12 * Lrat ^ 2 * K + 2) / p.n) + ofReal (1536 * p.Ctheta ^ 2 * K / (aStar ^ 2 * p.n)) := add_le_add hgoodInt hbadInt _ = ofReal (adaptiveSelectorRiskConstant p pStar K / p.n) := by rw [← ENNReal.ofReal_add] · congr 1 dsimp [adaptiveSelectorRiskConstant, Lrat, aStar] field_simp <;> ring · positivity · positivity
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_mseRisk_le_of_l2 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1700
theorem thetaHatSpec_mseRisk_le

Uniform adaptive-selector MSE bound obtained from the empirical-transform L² theorem. The witness K depends only on the six displayed fixed class constants.

Formal statement
Xspace :
Type*
Ctheta Cg Cq psieta psixi R1 :
∃ K : ℝ,
0 < K ∧
∀ (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → ∀ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p), 2 ≤ p.n → NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (adaptiveSelectorRiskConstant p pStar K / p.n)
Proof (Lean source)
theorem thetaHatSpec_mseRisk_le {Xspace : Type*} [MeasurableSpace Xspace] (Ctheta Cg Cq psieta psixi R1 : ℝ) : ∃ K : ℝ, 0 < K ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → ∀ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p), 2 ≤ p.n → NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (adaptiveSelectorRiskConstant p pStar K / p.n) := by rcases empirical_transform_uniform_l2 (Xspace := Xspace) Ctheta Cg Cq psieta psixi R1 with ⟨K, hK, hUniform⟩ refine ⟨K, hK, ?_⟩ intro p hpθ hpg hpq hpη hpξ hpR pStar cStar m hn hclass hiid heps apply thetaHatSpec_mseRisk_le_of_l2 p pStar cStar m hn hclass heps K hK.le intro a simpa [residualFoldError, outcomeFoldError, hpR] using hUniform p hpθ hpg hpq hpη hpξ hpR hn m hclass hiid a (inferenceFold_nonempty p.n hn a)
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_mseRisk_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1905
theorem thetaHatSpec_mseRisk_le_explicit

The preceding risk theorem with its proof's explicit transform constant, quantified before the covariate space.

Formal statement
Ctheta Cg Cq psieta psixi R1 :
∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → ∀ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p), 2 ≤ p.n → NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (adaptiveSelectorRiskConstant p pStar (empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1) / p.n)
Proof (Lean source)
theorem thetaHatSpec_mseRisk_le_explicit (Ctheta Cg Cq psieta psixi R1 : ℝ) : ∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → ∀ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p), 2 ≤ p.n → NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (adaptiveSelectorRiskConstant p pStar (empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1) / p.n) := by intro Xspace inst p hpθ hpg hpq hpη hpξ hpR pStar cStar m hn hclass hiid heps apply thetaHatSpec_mseRisk_le_of_l2 p pStar cStar m hn hclass heps (empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1) (empiricalTransformL2Constant_pos _ _ _ _ _ _).le intro a simpa [residualFoldError, outcomeFoldError, hpR] using empirical_transform_uniform_l2_explicit Ctheta Cg Cq psieta psixi R1 p hpθ hpg hpq hpη hpξ hpR hn m hclass hiid a (inferenceFold_nonempty p.n hn a)
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_mseRisk_le_explicit · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1933
theorem thetaHatSpec_generalizedQuantile_le_of_mseRisk_le

The generalized-quantile consequence of any positive adaptive-selector MSE constant, at the paper's probability level 1 - gamma.

Formal statement
Xspace :
Type*
m :
Model (Xspace := Xspace) p
hn :
1 ≤ p.n
C :
hC :
0 < C
hrisk :
mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (C / p.n)
generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStar cStar m.gcode data - m.theta0|)
sqrt (C / (p.gamma * p.n))
Proof (Lean source)
theorem thetaHatSpec_generalizedQuantile_le_of_mseRisk_le {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (m : Model (Xspace := Xspace) p) (hn : 1 ≤ p.n) (C : ℝ) (hC : 0 < C) (hrisk : mseRisk m p.n (thetaHatSpec p pStar cStar m.gcode) ≤ ofReal (C / p.n)) : generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStar cStar m.gcode data - m.theta0|) ≤ sqrt (C / (p.gamma * p.n)) := by let Q := iidLaw m p.n let W : (Fin p.n → Obs Xspace) → ℝ := fun data ↦ |thetaHatSpec p pStar cStar m.gcode data - m.theta0| let t := sqrt (C / (p.gamma * p.n)) letI : IsProbabilityMeasure Q := by dsimp [Q, iidLaw] infer_instance have hgamma : 0 < p.gamma := lt_trans (by norm_num) p.gamma_mem.1 have hnreal : (0 : ℝ) < p.n := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn) have htarg : 0 < C / (p.gamma * p.n) := by positivity have ht : 0 < t := Real.sqrt_pos.2 htarg have hWmeas : Measurable W := ((thetaHatSpec_measurable p pStar cStar m.gcode (m.gcode_measurable p.n)).sub measurable_const).abs letI : IsProbabilityMeasure (Measure.map W Q) := Measure.isProbabilityMeasure_map hWmeas.aemeasurable have hWL2 : (∫⁻ data, ofReal ((W data) ^ 2) ∂Q) ≤ ofReal (C / p.n) := by simpa [mseRisk, Q, W, sq_abs] using hrisk have hbad : Q {data | t < W data} ≤ ofReal p.gamma := by have h := measure_gt_of_sq_lintegral_le Q W hWmeas (fun data ↦ abs_nonneg _) t (C / p.n) ht hWL2 convert h using 1 congr 1 dsimp [t] rw [Real.sq_sqrt htarg.le] field_simp have hbadMeas : MeasurableSet {data | t < W data} := measurableSet_lt measurable_const hWmeas have hbadReal : Q.real {data | t < W data} ≤ p.gamma := by rw [measureReal_def] calc (Q {data | t < W data}).toReal ≤ (ofReal p.gamma).toReal := ENNReal.toReal_mono ENNReal.ofReal_ne_top hbad _ = p.gamma := ENNReal.toReal_ofReal hgamma.le have hgoodSet : {data | W data ≤ t} = {data | t < W data}ᶜ := by ext data simp have hgoodReal : 1 - p.gamma ≤ Q.real {data | W data ≤ t} := by rw [hgoodSet, measureReal_compl hbadMeas] have hQ : Q.real univ = 1 := by simp [Q, iidLaw] rw [hQ] linarith have htau0 : 0 < 1 - p.gamma := sub_pos.mpr p.gamma_mem.2 have htau1 : 1 - p.gamma < 1 := sub_lt_self 1 hgamma apply (quantile_le_iff htau0 htau1).2 rw [ProbabilityTheory.cdf_eq_real] change 1 - p.gamma ≤ (Measure.map W Q).real (Iic t) rw [measureReal_def] rw [Measure.map_apply hWmeas measurableSet_Iic] change 1 - p.gamma ≤ Q.real {data | W data ≤ t} exact hgoodReal
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_generalizedQuantile_le_of_mseRisk_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AdaptiveSelectorPacket.lean:1959
Helpers.AffineGaussianKL 15 declarations Kernel and bind representations of the affine outcome channel, used to reduce its KL divergence to the equal-variance Gaussian location formula.

KL control for affine Gaussian outcome paths

Kernel and bind representations of the affine outcome channel, used to reduce its KL divergence to the equal-variance Gaussian location formula.

def shiftedInnovationKernel

The scalar innovation channel obtained after expressing an affine outcome law in the coordinates of a fixed reference parameter.

Definition (Lean source)
-- @node: shiftedInnovationKernel def shiftedInnovationKernel {p : Parameters} (base : Model (Xspace := Xspace) p) (theta thetaRef tau : ℝ) : Kernel (XT' Xspace) ℝ := mechanismKernel (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) (fun w ↦ (theta - thetaRef) * (w.1.2 - base.g0 w.1.1) + w.2)
CausalSmith.Stat.SaPlmCumulantConverse.shiftedInnovationKernel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:22
instance shiftedInnovationKernel_isMarkov

The scalar innovation channel — which, given the covariates and the treatment, draws a normal variable centred at the parameter displacement times the treatment innovation, with variance the square of the innovation scale — is a probability kernel: every one of its conditional slices is a probability measure.

Definition (Lean source)
instance shiftedInnovationKernel_isMarkov {p : Parameters} (base : Model (Xspace := Xspace) p) (theta thetaRef tau : ℝ) : IsMarkovKernel (shiftedInnovationKernel base theta thetaRef tau) := by unfold shiftedInnovationKernel apply instIsMarkovKernelMechanismKernel exact (measurable_const.mul ((measurable_snd.comp measurable_fst).sub (base.g0_measurable.comp (measurable_fst.comp measurable_fst)))).add measurable_snd
CausalSmith.Stat.SaPlmCumulantConverse.shiftedInnovationKernel_isMarkov · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:31
theorem shiftedInnovationKernel_apply

Each scalar slice is the equal-variance Gaussian whose mean is the parameter displacement times the retained treatment innovation.

Formal statement
base :
Model (Xspace := Xspace) p
theta thetaRef tau :
xt :
XT' Xspace
shiftedInnovationKernel base theta thetaRef tau xt
= gaussianReal ((theta - thetaRef) * (xt.2 - base.g0 xt.1)) ⟨tau ^ 2, sq_nonneg tau⟩
Proof (Lean source)
-- @node: shiftedInnovationKernel_apply lemma shiftedInnovationKernel_apply {p : Parameters} (base : Model (Xspace := Xspace) p) (theta thetaRef tau : ℝ) (xt : XT' Xspace) : shiftedInnovationKernel base theta thetaRef tau xt = gaussianReal ((theta - thetaRef) * (xt.2 - base.g0 xt.1)) ⟨tau ^ 2, sq_nonneg tau⟩ := by rw [shiftedInnovationKernel, mechanismKernel_apply] · -- The variance is an anonymous-constructor term, which blocks rewriting -- inside the goal; state the shift identity for a general variance instead. have hmap : ∀ (v : NNReal) (c : ℝ), (gaussianReal 0 v).map (fun l ↦ c + l) = gaussianReal c v := by intro v c rw [gaussianReal_map_const_add, zero_add] change (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩).map (fun l ↦ (theta - thetaRef) * (xt.2 - base.g0 xt.1) + l) = _ exact hmap _ _ · exact (measurable_const.mul ((measurable_snd.comp measurable_fst).sub (base.g0_measurable.comp (measurable_fst.comp measurable_fst)))).add measurable_snd
CausalSmith.Stat.SaPlmCumulantConverse.shiftedInnovationKernel_apply · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:44
theorem affineGaussianLaw_eq_map_shiftedInnovation

In reference affine coordinates, the observed affine Gaussian law is the pushforward of the retained (X,T) law and the scalar shifted innovation.

Formal statement
base :
Model (Xspace := Xspace) p
theta thetaRef tau :
affineGaussianLaw base theta tau
= ((xtLaw base) ⊗ₘ (shiftedInnovationKernel base theta thetaRef tau)).map (affineOutcomeEquiv base.g0 base.q0 thetaRef base.g0_measurable base.q0_measurable)
Proof (Lean source)
-- @node: affineGaussianLaw_eq_map_shiftedInnovation lemma affineGaussianLaw_eq_map_shiftedInnovation {p : Parameters} (base : Model (Xspace := Xspace) p) (theta thetaRef tau : ℝ) : affineGaussianLaw base theta tau = ((xtLaw base) ⊗ₘ (shiftedInnovationKernel base theta thetaRef tau)).map (affineOutcomeEquiv base.g0 base.q0 thetaRef base.g0_measurable base.q0_measurable) := by have hmech : Measurable (fun w : XT' Xspace × ℝ ↦ (theta - thetaRef) * (w.1.2 - base.g0 w.1.1) + w.2) := (measurable_const.mul ((measurable_snd.comp measurable_fst).sub (base.g0_measurable.comp (measurable_fst.comp measurable_fst)))).add measurable_snd have hgraph := map_graph_prod_eq_compProd (xtLaw base) (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) hmech change affineGaussianLaw base theta tau = ((xtLaw base) ⊗ₘ (mechanismKernel (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) (fun w ↦ (theta - thetaRef) * (w.1.2 - base.g0 w.1.1) + w.2))).map _ rw [← hgraph, Measure.map_map (affineOutcomeEquiv base.g0 base.q0 thetaRef base.g0_measurable base.q0_measurable).measurable (measurable_fst.prodMk hmech)] · unfold affineGaussianLaw apply Measure.map_congr filter_upwards with w ext <;> simp [affineOutcomeEquiv] ring
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_eq_map_shiftedInnovation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:68
def affineOutcomeMechanism

The affine outcome mechanism applied to (X,T) and a scalar innovation.

Definition (Lean source)
def affineOutcomeMechanism {p : Parameters} (base : Model (Xspace := Xspace) p) (theta : ℝ) : XT' Xspace × ℝ → Obs Xspace := fun w ↦ (w.1.1, w.1.2, base.q0 w.1.1 + theta * (w.1.2 - base.g0 w.1.1) + w.2)
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeMechanism · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:99
theorem affineOutcomeMechanism_measurable

The affine outcome mechanism — which maps covariates, treatment, and a scalar innovation to the observed triple whose outcome coordinate is the baseline outcome regression plus the treatment coefficient times the treatment innovation plus that scalar innovation — is jointly measurable.

Formal statement
base :
Model (Xspace := Xspace) p
theta :
Proof (Lean source)
lemma affineOutcomeMechanism_measurable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta : ℝ) : Measurable (affineOutcomeMechanism base theta) := by exact (measurable_fst.comp measurable_fst).prodMk <| (measurable_snd.comp measurable_fst).prodMk <| ((base.q0_measurable.comp (measurable_fst.comp measurable_fst)).add (measurable_const.mul ((measurable_snd.comp measurable_fst).sub (base.g0_measurable.comp (measurable_fst.comp measurable_fst))))).add measurable_snd
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeMechanism_measurable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:104
def affineOutcomeKernel

Conditional affine Gaussian outcome channel given (X,T).

Definition (Lean source)
def affineOutcomeKernel {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Kernel (XT' Xspace) (Obs Xspace) := mechanismKernel (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) (affineOutcomeMechanism base theta)
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeKernel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:118
instance affineOutcomeKernel_isMarkov

The conditional affine Gaussian outcome channel — which, given the covariates and the treatment, returns the observed triple whose outcome is the baseline outcome regression plus the treatment coefficient times the treatment innovation plus centred Gaussian noise of the stated scale — is a probability kernel.

Definition (Lean source)
instance affineOutcomeKernel_isMarkov {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : IsMarkovKernel (affineOutcomeKernel base theta tau) := by unfold affineOutcomeKernel exact instIsMarkovKernelMechanismKernel _ (affineOutcomeMechanism_measurable base theta)
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeKernel_isMarkov · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:124
theorem affineGaussianLaw_eq_bind

The affine Gaussian law is the base (X,T) law bound to its affine Gaussian outcome channel.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
affineGaussianLaw base theta tau = (xtLaw base).bind (affineOutcomeKernel base theta tau)
Proof (Lean source)
lemma affineGaussianLaw_eq_bind {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : affineGaussianLaw base theta tau = (xtLaw base).bind (affineOutcomeKernel base theta tau) := by have hgraph := map_graph_prod_eq_compProd (xtLaw base) (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) (affineOutcomeMechanism_measurable base theta) have hsnd := congrArg (Measure.map snd) hgraph rw [Measure.map_map measurable_snd ((measurable_fst.prodMk (affineOutcomeMechanism_measurable base theta)))] at hsnd change _ = (xtLaw base ⊗ₘ affineOutcomeKernel base theta tau).snd at hsnd rw [Measure.snd_compProd] at hsnd simpa [affineGaussianLaw, affineOutcomeKernel, affineOutcomeMechanism, affineOutcomeEquiv, Function.comp_def] using hsnd
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_eq_bind · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:135
theorem affineOutcomeKernel_apply

A channel slice is a pushforward of its centered Gaussian innovation.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
xt :
XT' Xspace
affineOutcomeKernel base theta tau xt
= (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta (xt, z))
Proof (Lean source)
lemma affineOutcomeKernel_apply {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) (xt : XT' Xspace) : affineOutcomeKernel base theta tau xt = (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta (xt, z)) := by unfold affineOutcomeKernel exact mechanismKernel_apply _ (affineOutcomeMechanism_measurable base theta) xt
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeKernel_apply · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:152
theorem affineOutcomeKernel_apply_eq_shifted

A second parameter value can be represented through the first affine map by shifting only the Gaussian innovation mean.

Formal statement
base :
Model (Xspace := Xspace) p
theta0 theta1 tau :
xt :
XT' Xspace
affineOutcomeKernel base theta1 tau xt
= (gaussianReal ((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta0 (xt, z))
Proof (Lean source)
lemma affineOutcomeKernel_apply_eq_shifted {p : Parameters} (base : Model (Xspace := Xspace) p) (theta0 theta1 tau : ℝ) (xt : XT' Xspace) : affineOutcomeKernel base theta1 tau xt = (gaussianReal ((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta0 (xt, z)) := by rw [affineOutcomeKernel_apply] let d := (theta1 - theta0) * (xt.2 - base.g0 xt.1) have hshift := gaussianReal_map_add_const (μ := 0) (v := ⟨tau ^ 2, sq_nonneg tau⟩) d rw [zero_add] at hshift have hslice : Measurable (fun z ↦ affineOutcomeMechanism base theta0 (xt, z)) := (affineOutcomeMechanism_measurable base theta0).comp (measurable_const.prodMk measurable_id) rw [← hshift, Measure.map_map hslice (by fun_prop)] apply Measure.map_congr exact Filter.Eventually.of_forall fun z ↦ by simp [affineOutcomeMechanism, d] ring
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeKernel_apply_eq_shifted · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:162
theorem affineOutcomeKernel_kl_le

Pointwise channel KL is bounded by the corresponding Gaussian-location KL, with shift proportional to the treatment residual.

Formal statement
base :
Model (Xspace := Xspace) p
theta0 theta1 tau :
htau :
0 < tau
xt :
XT' Xspace
klDiv (affineOutcomeKernel base theta0 tau xt) (affineOutcomeKernel base theta1 tau xt)
ofReal ((((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2))
Proof (Lean source)
lemma affineOutcomeKernel_kl_le {p : Parameters} (base : Model (Xspace := Xspace) p) (theta0 theta1 tau : ℝ) (htau : 0 < tau) (xt : XT' Xspace) : klDiv (affineOutcomeKernel base theta0 tau xt) (affineOutcomeKernel base theta1 tau xt) ≤ ofReal ((((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2)) := by rw [affineOutcomeKernel_apply, affineOutcomeKernel_apply_eq_shifted] let d := (theta1 - theta0) * (xt.2 - base.g0 xt.1) calc klDiv ((gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta0 (xt, z))) ((gaussianReal d ⟨tau ^ 2, sq_nonneg tau⟩).map (fun z ↦ affineOutcomeMechanism base theta0 (xt, z))) ≤ klDiv (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) (gaussianReal d ⟨tau ^ 2, sq_nonneg tau⟩) := klDiv_map_le ((affineOutcomeMechanism_measurable base theta0).comp (measurable_const.prodMk measurable_id)) _ = ofReal ((0 - d) ^ 2 / (2 * (⟨tau ^ 2, sq_nonneg tau⟩ : NNReal) : ℝ)) := by apply gaussianKL_eq exact_mod_cast sq_pos_of_pos htau _ = ofReal ((((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2)) := by congr 1 simp [d]
CausalSmith.Stat.SaPlmCumulantConverse.affineOutcomeKernel_kl_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:185
theorem eta_sq_integrable

The treatment innovation has an integrable square under the exact Luxemburg assumption.

Formal statement
base :
Model (Xspace := Xspace) p
heta :
Integrable (fun o ↦ (eta p base o) ^ 2) base.P
Proof (Lean source)
-- @node: eta_sq_integrable lemma eta_sq_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (heta : EtaSubGaussian p base) : Integrable (fun o ↦ (eta p base o) ^ 2) base.P := by have hpsi : 0 < p.psieta := p.constants_pos.2.2.2.1 have hmeas : AEStronglyMeasurable (fun o ↦ (eta p base o) ^ 2) base.P := by apply Measurable.aestronglyMeasurable unfold eta treatment covariate exact (measurable_snd.fst.sub (base.g0_measurable.comp measurable_fst)).pow_const 2 let c := max 1 (p.psieta ^ 2) have hg : Integrable (fun o ↦ c * exp ((eta p base o) ^ 2 / p.psieta ^ 2)) base.P := heta.1.const_mul c refine hg.mono' hmeas ?_ filter_upwards with o rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hx : 0 ≤ eta p base o ^ 2 / p.psieta ^ 2 := div_nonneg (sq_nonneg _) (sq_nonneg _) have hseries := Real.add_one_le_exp (eta p base o ^ 2 / p.psieta ^ 2) have hpsi2 : 0 < p.psieta ^ 2 := sq_pos_of_pos hpsi calc eta p base o ^ 2 = p.psieta ^ 2 * (eta p base o ^ 2 / p.psieta ^ 2) := by field_simp _ ≤ p.psieta ^ 2 * exp (eta p base o ^ 2 / p.psieta ^ 2) := by gcongr linarith _ ≤ c * exp (eta p base o ^ 2 / p.psieta ^ 2) := by exact mul_le_mul_of_nonneg_right (le_max_right _ _) (Real.exp_pos _).le
CausalSmith.Stat.SaPlmCumulantConverse.eta_sq_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:218
theorem affineGaussianLaw_kl_le

One observation on the affine Gaussian path has KL bounded by the parameter displacement squared times the treatment-innovation second moment.

Formal statement
base :
Model (Xspace := Xspace) p
heta :
theta0 theta1 tau :
htau :
0 < tau
klDiv (affineGaussianLaw base theta0 tau) (affineGaussianLaw base theta1 tau)
ofReal (((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2))
Proof (Lean source)
-- @node: affineGaussianLaw_kl_le lemma affineGaussianLaw_kl_le {p : Parameters} (base : Model (Xspace := Xspace) p) (heta : EtaSubGaussian p base) (theta0 theta1 tau : ℝ) (htau : 0 < tau) : klDiv (affineGaussianLaw base theta0 tau) (affineGaussianLaw base theta1 tau) ≤ ofReal (((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2)) := by let v : NNReal := ⟨tau ^ 2, sq_nonneg tau⟩ let k0 := shiftedInnovationKernel base theta0 theta0 tau let k1 := shiftedInnovationKernel base theta1 theta0 tau have hv : v ≠ 0 := by rw [← NNReal.coe_ne_zero] exact (sq_pos_of_pos htau).ne' have hac : ∀ᵐ xt ∂xtLaw base, k0 xt ≪ k1 xt := by filter_upwards with xt rw [show k0 xt = gaussianReal 0 v by simp [k0, v, shiftedInnovationKernel_apply], show k1 xt = gaussianReal ((theta1 - theta0) * (xt.2 - base.g0 xt.1)) v by simp [k1, v, shiftedInnovationKernel_apply]] exact gaussianReal_ac_gaussianReal _ _ hv hv rw [affineGaussianLaw_eq_map_shiftedInnovation base theta0 theta0 tau, affineGaussianLaw_eq_map_shiftedInnovation base theta1 theta0 tau, klDiv_map_measurableEmbedding (affineOutcomeEquiv base.g0 base.q0 theta0 base.g0_measurable base.q0_measurable).measurableEmbedding, klDiv_compProd_right_of_forall_ac hac] have hsquareXT : Integrable (fun xt : XT' Xspace ↦ (xt.2 - base.g0 xt.1) ^ 2) (xtLaw base) := by have hxt : AEMeasurable (fun o : Obs Xspace ↦ (covariate o, treatment o)) base.P := by unfold covariate treatment exact (measurable_fst.prodMk measurable_snd.fst).aemeasurable have hsq : AEStronglyMeasurable (fun xt : XT' Xspace ↦ (xt.2 - base.g0 xt.1) ^ 2) (xtLaw base) := ((measurable_snd.sub (base.g0_measurable.comp measurable_fst)).pow_const 2).aestronglyMeasurable rw [xtLaw] apply (integrable_map_measure (μ := base.P) (g := fun xt : XT' Xspace ↦ (xt.2 - base.g0 xt.1) ^ 2) hsq hxt).2 simpa [Function.comp_def, eta, treatment, covariate] using eta_sq_integrable base heta have hfint : Integrable (fun xt : XT' Xspace ↦ (((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2)) (xtLaw base) := by convert (hsquareXT.const_mul ((theta1 - theta0) ^ 2 / (2 * tau ^ 2))) using 1 funext xt ring have hfiber : ∀ xt : XT' Xspace, klDiv (k0 xt) (k1 xt) = ofReal ((((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2)) := by intro xt rw [show k0 xt = gaussianReal 0 v by simp [k0, v, shiftedInnovationKernel_apply], show k1 xt = gaussianReal ((theta1 - theta0) * (xt.2 - base.g0 xt.1)) v by simp [k1, v, shiftedInnovationKernel_apply], gaussianKL_eq] · congr 1 have hv' : ((v : NNReal) : ℝ) = tau ^ 2 := rfl rw [hv'] ring · exact_mod_cast sq_pos_of_pos htau simp_rw [hfiber] rw [← ofReal_integral_eq_lintegral_ofReal hfint (Filter.Eventually.of_forall fun _ ↦ by positivity)] apply ENNReal.ofReal_le_ofReal calc (∫ xt, (((theta1 - theta0) * (xt.2 - base.g0 xt.1)) ^ 2) / (2 * tau ^ 2) ∂xtLaw base) = ((theta1 - theta0) ^ 2 / (2 * tau ^ 2)) * ∫ xt, (xt.2 - base.g0 xt.1) ^ 2 ∂xtLaw base := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards with xt ring _ = ((theta1 - theta0) ^ 2 / (2 * tau ^ 2)) * ∫ o, |eta p base o| ^ (2 * 1) ∂base.P := by congr 1 rw [xtLaw, integral_map (show AEMeasurable (fun o : Obs Xspace ↦ (covariate o, treatment o)) base.P by unfold covariate treatment exact (measurable_fst.prodMk measurable_snd.fst).aemeasurable) (show AEStronglyMeasurable (fun xt : XT' Xspace ↦ (xt.2 - base.g0 xt.1) ^ 2) (base.P.map fun o ↦ (covariate o, treatment o)) by exact ((measurable_snd.sub (base.g0_measurable.comp measurable_fst)).pow_const 2).aestronglyMeasurable)] apply integral_congr_ae filter_upwards with o simp [eta, treatment, covariate, sq_abs] _ ≤ ((theta1 - theta0) ^ 2 / (2 * tau ^ 2)) * (2 * p.psieta ^ (2 * 1) * (1 : ℕ).factorial) := by gcongr exact luxemburg_even_moment_integral_le (eta p base) (by unfold eta treatment covariate exact measurable_snd.fst.sub (base.g0_measurable.comp measurable_fst)) p.constants_pos.2.2.2.1 heta.1 heta.2 1 _ = ((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2) := by norm_num; ring
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_kl_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:250
theorem affineGaussianModel_iid_kl_le

Tensorization turns the one-observation affine-path bound into the corresponding finite i.i.d. KL budget.

Formal statement
base :
Model (Xspace := Xspace) p
sampleN :
heta :
theta0 theta1 tau :
htau :
0 < tau
klDiv (iidLaw (affineGaussianModel base theta0 tau) sampleN) (iidLaw (affineGaussianModel base theta1 tau) sampleN)
ofReal ((sampleN : ℝ) * (((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2)))
Proof (Lean source)
-- @node: affineGaussianModel_iid_kl_le lemma affineGaussianModel_iid_kl_le {p : Parameters} (base : Model (Xspace := Xspace) p) (sampleN : ℕ) (heta : EtaSubGaussian p base) (theta0 theta1 tau : ℝ) (htau : 0 < tau) : klDiv (iidLaw (affineGaussianModel base theta0 tau) sampleN) (iidLaw (affineGaussianModel base theta1 tau) sampleN) ≤ ofReal ((sampleN : ℝ) * (((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2))) := by let μ := affineGaussianLaw base theta0 tau let ν := affineGaussianLaw base theta1 tau let B := ((theta1 - theta0) ^ 2 * (2 * p.psieta ^ 2)) / (2 * tau ^ 2) have hsingle : klDiv μ ν ≤ ofReal B := by dsimp [μ, ν, B] exact affineGaussianLaw_kl_le base heta theta0 theta1 tau htau have hfinite : klDiv μ ν ≠ ⊤ := ne_top_of_le_ne_top ENNReal.ofReal_ne_top hsingle have hac : μ ≪ ν := (InformationTheory.klDiv_ne_top_iff.mp hfinite).1 have hint : Integrable (llr μ ν) μ := (InformationTheory.klDiv_ne_top_iff.mp hfinite).2 have htensor := (productKL_tensorization sampleN μ ν hac hint).apply have hB : 0 ≤ B := by dsimp [B] positivity have hsingleReal : (klDiv μ ν).toReal ≤ B := by have h := ENNReal.toReal_mono ENNReal.ofReal_ne_top hsingle simpa [ENNReal.toReal_ofReal hB] using h have hprodFinite := (productKL_tensorization sampleN μ ν hac hint).product_ne_top change klDiv (Measure.pi fun _ : Fin sampleN ↦ μ) (Measure.pi fun _ : Fin sampleN ↦ ν) ≤ ofReal ((sampleN : ℝ) * B) rw [← ENNReal.toReal_le_toReal hprodFinite ENNReal.ofReal_ne_top] rw [ENNReal.toReal_ofReal (mul_nonneg (Nat.cast_nonneg _) hB)] calc (klDiv (Measure.pi fun _ : Fin sampleN ↦ μ) (Measure.pi fun _ : Fin sampleN ↦ ν)).toReal ≤ (sampleN : ℝ) * (klDiv μ ν).toReal := htensor _ ≤ (sampleN : ℝ) * B := mul_le_mul_of_nonneg_left hsingleReal (Nat.cast_nonneg _)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_iid_kl_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianKL.lean:358
Helpers.AffineGaussianOutcomePath 40 declarations Measure-theoretic infrastructure for replacing the outcome coordinate by an affine partially-linear signal plus independent Gaussian noise while retaining the joint covariate-treatment law.

Affine Gaussian outcome paths

Measure-theoretic infrastructure for replacing the outcome coordinate by an affine partially-linear signal plus independent Gaussian noise while retaining the joint covariate-treatment law.

theorem condExp_comp_eq_of_map_prod_eq

A conditional-mean identity is determined by the joint law of the conditioning variable and the integrand.

Formal statement
Omega :
Type*
S :
X :
Omega → S
Y :
Omega → ℝ
g :
S → ℝ
hX :
hY :
hg :
hYmu :
hYnu :
hgnu :
Integrable (fun omega ↦ g (X omega)) nu
hlaw :
mu.map (fun omega ↦ (X omega, Y omega)) = nu.map (fun omega ↦ (X omega, Y omega))
hcond :
@condExp Omega ℝ (comap X inferInstance) inferInstance _ _ mu Y
=ᵐ[mu] fun omega ↦ g (X omega)
@condExp Omega ℝ (comap X inferInstance) inferInstance _ _ nu Y
=ᵐ[nu] fun omega ↦ g (X omega)
Proof (Lean source)
lemma condExp_comp_eq_of_map_prod_eq {Omega : Type*} [MeasurableSpace Omega] {S : Type*} [MeasurableSpace S] (mu nu : Measure Omega) [IsFiniteMeasure mu] [IsFiniteMeasure nu] (X : Omega → S) (Y : Omega → ℝ) (g : S → ℝ) (hX : Measurable X) (hY : Measurable Y) (hg : Measurable g) (hYmu : Integrable Y mu) (hYnu : Integrable Y nu) (hgnu : Integrable (fun omega ↦ g (X omega)) nu) (hlaw : mu.map (fun omega ↦ (X omega, Y omega)) = nu.map (fun omega ↦ (X omega, Y omega))) (hcond : @condExp Omega ℝ (comap X inferInstance) inferInstance _ _ mu Y =ᵐ[mu] fun omega ↦ g (X omega)) : @condExp Omega ℝ (comap X inferInstance) inferInstance _ _ nu Y =ᵐ[nu] fun omega ↦ g (X omega) := by have hpair : Measurable (fun omega ↦ (X omega, Y omega)) := hX.prodMk hY symm apply MeasureTheory.ae_eq_condExp_of_forall_setIntegral_eq hX.comap_le hYnu · intro s _ _ exact hgnu.integrableOn · rintro s ⟨t, ht, rfl⟩ _ have hprod : MeasurableSet (t ×ˢ (Set.univ : Set ℝ)) := ht.prod MeasurableSet.univ calc ∫ omega in X ⁻¹' t, g (X omega) ∂nu = ∫ z in t ×ˢ (Set.univ : Set ℝ), g z.1 ∂(nu.map fun omega ↦ (X omega, Y omega)) := by simpa [Function.comp_def, Set.mk_preimage_prod] using (MeasureTheory.setIntegral_map hprod (hg.comp measurable_fst).aestronglyMeasurable hpair.aemeasurable).symm _ = ∫ z in t ×ˢ (Set.univ : Set ℝ), g z.1 ∂(mu.map fun omega ↦ (X omega, Y omega)) := by rw [hlaw] _ = ∫ omega in X ⁻¹' t, g (X omega) ∂mu := by simpa [Function.comp_def, Set.mk_preimage_prod] using MeasureTheory.setIntegral_map hprod (hg.comp measurable_fst).aestronglyMeasurable hpair.aemeasurable _ = ∫ omega in X ⁻¹' t, (@condExp Omega ℝ (comap X inferInstance) inferInstance _ _ mu Y) omega ∂mu := by exact MeasureTheory.integral_congr_ae hcond.symm.restrict _ = ∫ omega in X ⁻¹' t, Y omega ∂mu := by rw [MeasureTheory.setIntegral_condExp hX.comap_le hYmu (show MeasurableSet[comap X inferInstance] (X ⁻¹' t) from ⟨t, ht, rfl⟩)] _ = ∫ z in t ×ˢ (Set.univ : Set ℝ), z.2 ∂(mu.map fun omega ↦ (X omega, Y omega)) := by simpa [Function.comp_def, Set.mk_preimage_prod] using (MeasureTheory.setIntegral_map hprod measurable_snd.aestronglyMeasurable hpair.aemeasurable).symm _ = ∫ z in t ×ˢ (Set.univ : Set ℝ), z.2 ∂(nu.map fun omega ↦ (X omega, Y omega)) := by rw [← hlaw] _ = ∫ omega in X ⁻¹' t, Y omega ∂nu := by simpa [Function.comp_def, Set.mk_preimage_prod] using MeasureTheory.setIntegral_map hprod measurable_snd.aestronglyMeasurable hpair.aemeasurable · have hX' : Measurable[comap X inferInstance] X := measurable_iff_comap_le.mpr le_rfl exact (hg.comp hX').aestronglyMeasurable
CausalSmith.Stat.SaPlmCumulantConverse.condExp_comp_eq_of_map_prod_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:24
def affineOutcomeEquiv

The measurable coordinate change from (X,T,Z) to (X,T,Y) for an affine Gaussian outcome path.

Definition (Lean source)
def affineOutcomeEquiv (g q : Xspace → ℝ) (theta : ℝ) (hg : Measurable g) (hq : Measurable q) : (XT Xspace × ℝ) ≃ᵐ Obs Xspace where toEquiv := { toFun := fun w ↦ (w.1.1, w.1.2, q w.1.1 + theta * (w.1.2 - g w.1.1) + w.2) invFun := fun o ↦ ((covariate o, treatment o), outcome o - q (covariate o) - theta * (treatment o - g (covariate o))) left_inv := by intro w ext <;> simp [covariate, treatment, outcome] ring right_inv := by intro o rcases o with ⟨x, t, y⟩ ext <;> simp [covariate, treatment, outcome] } measurable_toFun := by have hx : Measurable (fun w : XT Xspace × ℝ ↦ w.1.1) := measurable_fst.comp measurable_fst have ht : Measurable (fun w : XT Xspace × ℝ ↦ w.1.2) := measurable_snd.comp measurable_fst have hy : Measurable (fun w : XT Xspace × ℝ ↦ q w.1.1 + theta * (w.1.2 - g w.1.1) + w.2) := ((hq.comp hx).add (measurable_const.mul (ht.sub (hg.comp hx)))).add measurable_snd exact hx.prodMk (ht.prodMk hy) measurable_invFun := by exact measurable_xt.prodMk <| (measurable_outcome.sub (hq.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (hg.comp measurable_covariate)))
def xtLaw

The fixed covariate-treatment marginal used by an affine outcome path.

Definition (Lean source)
def xtLaw {p : Parameters} (base : Model (Xspace := Xspace) p) : Measure (XT Xspace) := base.P.map (fun o ↦ (covariate o, treatment o))
instance xtLaw_isProbabilityMeasure

The covariate–treatment marginal of a base model is again a probability distribution: discarding the outcome coordinate from an observed-data law leaves a law of total mass one on covariate–treatment pairs.

Definition (Lean source)
instance xtLaw_isProbabilityMeasure {p : Parameters} (base : Model (Xspace := Xspace) p) : IsProbabilityMeasure (xtLaw base) := by exact Measure.isProbabilityMeasure_map measurable_xt.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.xtLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:137
instance gaussianReal_sq_isProbabilityMeasure

The Gaussian law with mean mu and variance tau ^ 2 is a probability measure.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.gaussianReal_sq_isProbabilityMeasure · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:144
def affineGaussianLaw

The observed-data law obtained by adjoining centered Gaussian noise and applying the affine outcome coordinate change.

Definition (Lean source)
def affineGaussianLaw {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Measure (Obs Xspace) := ((xtLaw base).prod (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩)).map (affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable)
instance affineGaussianLaw_isProbabilityMeasure

The observed-data law of an affine Gaussian outcome path is a probability distribution: it couples the base covariate–treatment marginal with an independent centered Gaussian noise draw of standard deviation tau and then relabels coordinates by a measurable bijection, and neither step changes total mass.

Definition (Lean source)
instance affineGaussianLaw_isProbabilityMeasure {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : IsProbabilityMeasure (affineGaussianLaw base theta tau) := by unfold affineGaussianLaw xtLaw haveI : IsProbabilityMeasure (base.P.map (fun o ↦ (covariate o, treatment o))) := Measure.isProbabilityMeasure_map measurable_xt.aemeasurable exact Measure.isProbabilityMeasure_map (affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable).measurable.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_isProbabilityMeasure · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:164
theorem affineGaussianLaw_map_xt

An affine Gaussian outcome law retains the base joint (X,T) marginal.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianLaw base theta tau).map (fun o ↦ (covariate o, treatment o)) = xtLaw base
Proof (Lean source)
lemma affineGaussianLaw_map_xt {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianLaw base theta tau).map (fun o ↦ (covariate o, treatment o)) = xtLaw base := by rw [affineGaussianLaw, Measure.map_map] · have hf : (fun o ↦ (covariate o, treatment o)) ∘ affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable = fst := by funext w rfl rw [hf, Measure.map_fst_prod, measure_univ, one_smul] · exact measurable_xt · exact (affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable).measurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_map_xt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:180
theorem affineGaussianLaw_treatment_integrable

Treatment remains integrable along the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Proof (Lean source)
lemma affineGaussianLaw_treatment_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Integrable treatment (affineGaussianLaw base theta tau) := by have hbase : Integrable (fun z : XT Xspace ↦ z.2) (xtLaw base) := by rw [xtLaw] exact (integrable_map_measure measurable_snd.aestronglyMeasurable measurable_xt.aemeasurable).mpr (by simpa [Function.comp_def, treatment] using base.treatment_integrable) have hpath : Integrable (fun z : XT Xspace ↦ z.2) ((affineGaussianLaw base theta tau).map (fun o ↦ (covariate o, treatment o))) := by rwa [affineGaussianLaw_map_xt] simpa [Function.comp_def] using hpath.comp_aemeasurable measurable_xt.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_treatment_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:196
theorem affineGaussianLaw_g0_integrable

The supplied treatment regression remains integrable along the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Integrable (fun o ↦ base.g0 (covariate o)) (affineGaussianLaw base theta tau)
Proof (Lean source)
lemma affineGaussianLaw_g0_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Integrable (fun o ↦ base.g0 (covariate o)) (affineGaussianLaw base theta tau) := by have hbase : Integrable (fun o ↦ base.g0 (covariate o)) base.P := MeasureTheory.integrable_condExp.congr base.g0_condMean have hxt : Integrable (fun z : XT Xspace ↦ base.g0 z.1) (xtLaw base) := by rw [xtLaw] exact (integrable_map_measure (base.g0_measurable.comp measurable_fst).aestronglyMeasurable measurable_xt.aemeasurable).mpr (by simpa [Function.comp_def] using hbase) have hpath : Integrable (fun z : XT Xspace ↦ base.g0 z.1) ((affineGaussianLaw base theta tau).map (fun o ↦ (covariate o, treatment o))) := by rwa [affineGaussianLaw_map_xt] simpa [Function.comp_def] using hpath.comp_aemeasurable measurable_xt.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_g0_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:211
theorem affineGaussianLaw_q0_integrable

The supplied outcome regression remains integrable along the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Integrable (fun o ↦ base.q0 (covariate o)) (affineGaussianLaw base theta tau)
Proof (Lean source)
lemma affineGaussianLaw_q0_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Integrable (fun o ↦ base.q0 (covariate o)) (affineGaussianLaw base theta tau) := by have hbase : Integrable (fun o ↦ base.q0 (covariate o)) base.P := MeasureTheory.integrable_condExp.congr base.q0_condMean have hxt : Integrable (fun z : XT Xspace ↦ base.q0 z.1) (xtLaw base) := by rw [xtLaw] exact (integrable_map_measure (base.q0_measurable.comp measurable_fst).aestronglyMeasurable measurable_xt.aemeasurable).mpr (by simpa [Function.comp_def] using hbase) have hpath : Integrable (fun z : XT Xspace ↦ base.q0 z.1) ((affineGaussianLaw base theta tau).map (fun o ↦ (covariate o, treatment o))) := by rwa [affineGaussianLaw_map_xt] simpa [Function.comp_def] using hpath.comp_aemeasurable measurable_xt.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_q0_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:231
theorem affineGaussianLaw_g0_condMean

The treatment conditional mean is unchanged by replacing only the outcome channel with the affine Gaussian channel.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
=ᵐ[affineGaussianLaw base theta tau] fun o ↦ base.g0 (covariate o)
Proof (Lean source)
lemma affineGaussianLaw_g0_condMean {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) treatment =ᵐ[affineGaussianLaw base theta tau] fun o ↦ base.g0 (covariate o) := by apply condExp_comp_eq_of_map_prod_eq base.P (affineGaussianLaw base theta tau) covariate treatment base.g0 measurable_covariate measurable_treatment base.g0_measurable base.treatment_integrable (affineGaussianLaw_treatment_integrable base theta tau) (affineGaussianLaw_g0_integrable base theta tau) · simpa [xtLaw] using (affineGaussianLaw_map_xt base theta tau).symm · exact base.g0_condMean
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_g0_condMean · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:251
theorem affineGaussianLaw_map_residual

Under the affine law, algebraically extracting the residual returns the fresh Gaussian coordinate.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianLaw base theta tau).map (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o)))
= gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩
Proof (Lean source)
lemma affineGaussianLaw_map_residual {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianLaw base theta tau).map (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ := by rw [affineGaussianLaw, Measure.map_map] · have hf : (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) ∘ affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable = snd := by funext w change (base.q0 w.1.1 + theta * (w.1.2 - base.g0 w.1.1) + w.2) - base.q0 w.1.1 - theta * (w.1.2 - base.g0 w.1.1) = w.2 ring rw [hf, Measure.map_snd_prod, measure_univ, one_smul] · exact (measurable_outcome.sub (base.q0_measurable.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (base.g0_measurable.comp measurable_covariate))) · exact (affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable).measurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_map_residual · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:268
theorem affineGaussianLaw_residual_integrable

The extracted Gaussian residual is integrable.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Integrable (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) (affineGaussianLaw base theta tau)
Proof (Lean source)
lemma affineGaussianLaw_residual_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Integrable (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) (affineGaussianLaw base theta tau) := by have hgauss : Integrable (fun z : ℝ ↦ z) (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩) := by exact (memLp_id_gaussianReal (μ := 0) (v := ⟨tau ^ 2, sq_nonneg tau⟩) 1).integrable (by norm_num) rw [← affineGaussianLaw_map_residual base theta tau] at hgauss simpa [Function.comp_def] using hgauss.comp_aemeasurable ((measurable_outcome.sub (base.q0_measurable.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (base.g0_measurable.comp measurable_covariate)))).aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_residual_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:292
theorem affineGaussianLaw_outcome_integrable

Outcomes are integrable under the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Proof (Lean source)
lemma affineGaussianLaw_outcome_integrable {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Integrable outcome (affineGaussianLaw base theta tau) := by have heta : Integrable (fun o ↦ treatment o - base.g0 (covariate o)) (affineGaussianLaw base theta tau) := (affineGaussianLaw_treatment_integrable base theta tau).sub (affineGaussianLaw_g0_integrable base theta tau) have hsum := ((affineGaussianLaw_q0_integrable base theta tau).add (heta.const_mul theta)).add (affineGaussianLaw_residual_integrable base theta tau) exact hsum.congr (Filter.Eventually.of_forall fun o ↦ by simp only [Pi.add_apply] ring)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_outcome_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:310
theorem affineGaussianLaw_indep_residual_xt

The extracted Gaussian residual is independent of (X,T).

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
IndepFun (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) (fun o ↦ (covariate o, treatment o)) (affineGaussianLaw base theta tau)
Proof (Lean source)
lemma affineGaussianLaw_indep_residual_xt {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : IndepFun (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) (fun o ↦ (covariate o, treatment o)) (affineGaussianLaw base theta tau) := by have hres : Measurable (fun o : Obs Xspace ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) := (measurable_outcome.sub (base.q0_measurable.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (base.g0_measurable.comp measurable_covariate))) rw [indepFun_iff_map_prod_eq_prod_map_map hres.aemeasurable measurable_xt.aemeasurable] unfold affineGaussianLaw rw [Measure.map_map, Measure.map_map, Measure.map_map] · have hprod : IndepFun (Prod.snd : XT Xspace × ℝ → ℝ) fst ((xtLaw base).prod (gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩)) := by exact (indepFun_prod measurable_id measurable_id).symm have hf : (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) ∘ affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable = Prod.snd := by funext w change (base.q0 w.1.1 + theta * (w.1.2 - base.g0 w.1.1) + w.2) - base.q0 w.1.1 - theta * (w.1.2 - base.g0 w.1.1) = w.2 ring have hg : (fun o ↦ (covariate o, treatment o)) ∘ affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable = fst := by funext w rfl rw [hf, hg] have hpair : (fun ω ↦ (outcome ω - base.q0 (covariate ω) - theta * (treatment ω - base.g0 (covariate ω)), covariate ω, treatment ω)) ∘ affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable = fun w : XT Xspace × ℝ ↦ (w.2, w.1) := by funext w apply Prod.ext · change (base.q0 w.1.1 + theta * (w.1.2 - base.g0 w.1.1) + w.2) - base.q0 w.1.1 - theta * (w.1.2 - base.g0 w.1.1) = w.2 ring · rfl rw [hpair] exact (indepFun_iff_map_prod_eq_prod_map_map measurable_snd.aemeasurable measurable_fst.aemeasurable).mp hprod all_goals first | exact hres.prodMk measurable_xt | exact hres | exact measurable_xt | exact (affineOutcomeEquiv base.g0 base.q0 theta base.g0_measurable base.q0_measurable).measurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_indep_residual_xt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:325
theorem affineGaussianLaw_residual_condMean_zero

The extracted residual has conditional mean zero given the covariate.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o)))
=ᵐ[affineGaussianLaw base theta tau] 0
Proof (Lean source)
lemma affineGaussianLaw_residual_condMean_zero {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) (fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o))) =ᵐ[affineGaussianLaw base theta tau] 0 := by let res : Obs Xspace → ℝ := fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o)) have hres : Measurable res := (measurable_outcome.sub (base.q0_measurable.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (base.g0_measurable.comp measurable_covariate))) have hind : IndepFun res covariate (affineGaussianLaw base theta tau) := by have h := (affineGaussianLaw_indep_residual_xt base theta tau).comp measurable_id measurable_fst simpa [Function.comp_def, res] using h have hmean : ∫ o, res o ∂(affineGaussianLaw base theta tau) = 0 := by have hmap := integral_map (μ := affineGaussianLaw base theta tau) (φ := res) (f := fun z : ℝ ↦ z) hres.aemeasurable stronglyMeasurable_id.aestronglyMeasurable rw [affineGaussianLaw_map_residual base theta tau] at hmap exact ((integral_id_gaussianReal (μ := 0) (v := ⟨tau ^ 2, sq_nonneg tau⟩)).symm.trans hmap).symm have hstrong : StronglyMeasurable[comap res inferInstance] res := by exact (measurable_iff_comap_le.mpr le_rfl).stronglyMeasurable change Indep (comap res inferInstance) (comap covariate inferInstance) (affineGaussianLaw base theta tau) at hind have hce := MeasureTheory.condExp_indep_eq (μ := affineGaussianLaw base theta tau) (m₁ := comap res inferInstance) (m₂ := comap covariate inferInstance) (f := res) (by exact hres.comap_le) (by exact measurable_covariate.comap_le) hstrong hind simpa [res, hmean, Pi.zero_def] using hce
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_residual_condMean_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:382
theorem affineGaussianLaw_eta_condMean_zero

Treatment residuals have conditional mean zero given the covariate along the affine Gaussian path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) (fun o ↦ treatment o - base.g0 (covariate o))
=ᵐ[affineGaussianLaw base theta tau] 0
Proof (Lean source)
lemma affineGaussianLaw_eta_condMean_zero {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) (fun o ↦ treatment o - base.g0 (covariate o)) =ᵐ[affineGaussianLaw base theta tau] 0 := by let mu := affineGaussianLaw base theta tau have hgint := affineGaussianLaw_g0_integrable base theta tau have hgm : StronglyMeasurable[comap covariate inferInstance] (fun o ↦ base.g0 (covariate o)) := by have hcov : @Measurable (Obs Xspace) Xspace (comap covariate inferInstance) inferInstance covariate := measurable_iff_comap_le.mpr le_rfl exact (base.g0_measurable.comp hcov).stronglyMeasurable have hgce : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ mu (fun o ↦ base.g0 (covariate o)) = fun o ↦ base.g0 (covariate o) := MeasureTheory.condExp_of_stronglyMeasurable measurable_covariate.comap_le hgm hgint have hsub := MeasureTheory.condExp_sub (μ := affineGaussianLaw base theta tau) (f := treatment) (g := fun o ↦ base.g0 (covariate o)) (affineGaussianLaw_treatment_integrable base theta tau) hgint (comap covariate inferInstance) exact (by filter_upwards [hsub, affineGaussianLaw_g0_condMean base theta tau] with o hs ht calc (affineGaussianLaw base theta tau)[fun o ↦ treatment o - base.g0 (covariate o) | comap covariate inferInstance] o = (affineGaussianLaw base theta tau)[treatment | comap covariate inferInstance] o - (affineGaussianLaw base theta tau)[fun o ↦ base.g0 (covariate o) | comap covariate inferInstance] o := by exact hs _ = 0 := by rw [ht, hgce]; simp)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_eta_condMean_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:422
theorem affineGaussianLaw_q0_condMean

The affine Gaussian outcome has conditional mean q0(X).

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
=ᵐ[affineGaussianLaw base theta tau] fun o ↦ base.q0 (covariate o)
Proof (Lean source)
lemma affineGaussianLaw_q0_condMean {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ (affineGaussianLaw base theta tau) outcome =ᵐ[affineGaussianLaw base theta tau] fun o ↦ base.q0 (covariate o) := by let mu := affineGaussianLaw base theta tau let eta0 : Obs Xspace → ℝ := fun o ↦ treatment o - base.g0 (covariate o) let res : Obs Xspace → ℝ := fun o ↦ outcome o - base.q0 (covariate o) - theta * eta0 o have hqint := affineGaussianLaw_q0_integrable base theta tau have heta : Integrable eta0 mu := (affineGaussianLaw_treatment_integrable base theta tau).sub (affineGaussianLaw_g0_integrable base theta tau) have hres : Integrable res mu := affineGaussianLaw_residual_integrable base theta tau have hqmeas : StronglyMeasurable[comap covariate inferInstance] (fun o ↦ base.q0 (covariate o)) := by have hcov : @Measurable (Obs Xspace) Xspace (comap covariate inferInstance) inferInstance covariate := measurable_iff_comap_le.mpr le_rfl exact (base.q0_measurable.comp hcov).stronglyMeasurable have hqce : @condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ mu (fun o ↦ base.q0 (covariate o)) = fun o ↦ base.q0 (covariate o) := MeasureTheory.condExp_of_stronglyMeasurable measurable_covariate.comap_le hqmeas hqint have hdecomp : outcome = fun o ↦ base.q0 (covariate o) + theta * eta0 o + res o := by funext o simp [res] rw [hdecomp] have hsmul := MeasureTheory.condExp_smul (μ := mu) theta eta0 (comap covariate inferInstance) have hmul : mu[fun x ↦ theta * eta0 x | comap covariate inferInstance] =ᵐ[mu] fun x ↦ theta * mu[eta0 | comap covariate inferInstance] x := by exact hsmul filter_upwards [MeasureTheory.condExp_add (hqint.add (heta.const_mul theta)) hres (comap covariate inferInstance), MeasureTheory.condExp_add hqint (heta.const_mul theta) (comap covariate inferInstance), hmul, affineGaussianLaw_eta_condMean_zero base theta tau, affineGaussianLaw_residual_condMean_zero base theta tau] with o ha hb hc he hr have he' : mu[eta0 | comap covariate inferInstance] o = 0 := by simpa [eta0] using he have hr' : mu[res | comap covariate inferInstance] o = 0 := by simpa [res, eta0] using hr calc mu[fun o ↦ base.q0 (covariate o) + theta * eta0 o + res o | comap covariate inferInstance] o = (mu[(fun o ↦ base.q0 (covariate o)) + (fun x ↦ theta * eta0 x) | comap covariate inferInstance] + mu[res | comap covariate inferInstance]) o := by exact ha _ = ((mu[fun o ↦ base.q0 (covariate o) | comap covariate inferInstance]) + mu[fun x ↦ theta * eta0 x | comap covariate inferInstance] + mu[res | comap covariate inferInstance]) o := by simpa only [Pi.add_apply] using congrArg (fun z ↦ z + mu[res | comap covariate inferInstance] o) hb _ = base.q0 (covariate o) := by simp only [Pi.add_apply] rw [hc, hqce, he', hr'] ring
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianLaw_q0_condMean · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:461
def affineGaussianModel

The model obtained by keeping every supplied nuisance component fixed and replacing the outcome channel by affine Gaussian noise.

Definition (Lean source)
def affineGaussianModel {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : Model (Xspace := Xspace) p where P := affineGaussianLaw base theta tau probability := affineGaussianLaw_isProbabilityMeasure base theta tau theta0 := theta g0 := base.g0 q0 := base.q0 gcode := base.gcode qcode := base.qcode g0_measurable := base.g0_measurable q0_measurable := base.q0_measurable gcode_measurable := base.gcode_measurable qcode_measurable := base.qcode_measurable treatment_integrable := affineGaussianLaw_treatment_integrable base theta tau outcome_integrable := affineGaussianLaw_outcome_integrable base theta tau g0_condMean := affineGaussianLaw_g0_condMean base theta tau q0_condMean := affineGaussianLaw_q0_condMean base theta tau
theorem affineGaussianModel_theta0

Rebuilding a model along the affine Gaussian outcome path at slope theta and noise scale tau makes theta the treatment-effect parameter of the new model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).theta0 = theta
Proof (Lean source)
@[simp] lemma affineGaussianModel_theta0 {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).theta0 = theta := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_theta0 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:548
theorem affineGaussianModel_g0

Rebuilding a model along the affine Gaussian outcome path leaves the treatment regression — the conditional mean of treatment given the covariate — exactly the one carried by the base model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).g0 = base.g0
Proof (Lean source)
@[simp] lemma affineGaussianModel_g0 {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).g0 = base.g0 := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_g0 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:555
theorem affineGaussianModel_q0

Rebuilding a model along the affine Gaussian outcome path leaves the outcome regression — the conditional mean of the outcome given the covariate — exactly the one carried by the base model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).q0 = base.q0
Proof (Lean source)
@[simp] lemma affineGaussianModel_q0 {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).q0 = base.q0 := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_q0 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:562
theorem affineGaussianModel_gcode

Rebuilding a model along the affine Gaussian outcome path carries over the supplied sequence of treatment-regression estimates unchanged.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).gcode = base.gcode
Proof (Lean source)
@[simp] lemma affineGaussianModel_gcode {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).gcode = base.gcode := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_gcode · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:569
theorem affineGaussianModel_qcode

Rebuilding a model along the affine Gaussian outcome path carries over the supplied sequence of outcome-regression estimates unchanged.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).qcode = base.qcode
Proof (Lean source)
@[simp] lemma affineGaussianModel_qcode {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).qcode = base.qcode := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_qcode · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:575
theorem affineGaussianModel_xi

The model-level outcome residual is exactly the extracted fresh Gaussian coordinate.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
xi p (affineGaussianModel base theta tau)
= fun o ↦ outcome o
- base.q0 (covariate o)
- theta * (treatment o - base.g0 (covariate o))
Proof (Lean source)
lemma affineGaussianModel_xi {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : xi p (affineGaussianModel base theta tau) = fun o ↦ outcome o - base.q0 (covariate o) - theta * (treatment o - base.g0 (covariate o)) := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_xi · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:581
theorem affineGaussianModel_eta

The model-level treatment residual is unchanged.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
eta p (affineGaussianModel base theta tau) = eta p base
Proof (Lean source)
lemma affineGaussianModel_eta {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : eta p (affineGaussianModel base theta tau) = eta p base := rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_eta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:589
theorem affineGaussianModel_map_xi

The affine model residual has the prescribed centered Gaussian law.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).P.map (xi p (affineGaussianModel base theta tau))
= gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩
Proof (Lean source)
lemma affineGaussianModel_map_xi {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).P.map (xi p (affineGaussianModel base theta tau)) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ := by exact affineGaussianLaw_map_residual base theta tau
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_map_xi · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:594
theorem affineGaussianModel_indep_xi_xt

The affine model residual is independent of the retained (X,T) pair.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
IndepFun (xi p (affineGaussianModel base theta tau)) (fun o ↦ (covariate o, treatment o)) (affineGaussianModel base theta tau).P
Proof (Lean source)
lemma affineGaussianModel_indep_xi_xt {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : IndepFun (xi p (affineGaussianModel base theta tau)) (fun o ↦ (covariate o, treatment o)) (affineGaussianModel base theta tau).P := by exact affineGaussianLaw_indep_residual_xt base theta tau
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_indep_xi_xt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:602
theorem affineGaussianModel_outcomeMeanIndependence

The affine model satisfies the paper's conditional mean-independence condition for its outcome residual.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
Proof (Lean source)
lemma affineGaussianModel_outcomeMeanIndependence {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : OutcomeMeanIndependence p (affineGaussianModel base theta tau) := by let m := affineGaussianModel base theta tau have hxi : Integrable (xi p m) m.P := by exact affineGaussianLaw_residual_integrable base theta tau refine ⟨hxi, ?_⟩ have hmeas : Measurable (xi p m) := (measurable_outcome.sub (base.q0_measurable.comp measurable_covariate)).sub (measurable_const.mul (measurable_treatment.sub (base.g0_measurable.comp measurable_covariate))) have hind : IndepFun (xi p m) (fun o ↦ (covariate o, treatment o)) m.P := by simpa [m] using affineGaussianModel_indep_xi_xt base theta tau change Indep (comap (xi p m) inferInstance) (xTSigma (Xspace := Xspace)) m.P at hind have hmean : ∫ o, xi p m o ∂m.P = 0 := by have hmap := integral_map (μ := m.P) (φ := xi p m) (f := fun z : ℝ ↦ z) hmeas.aemeasurable stronglyMeasurable_id.aestronglyMeasurable rw [affineGaussianModel_map_xi base theta tau] at hmap exact ((integral_id_gaussianReal (μ := 0) (v := ⟨tau ^ 2, sq_nonneg tau⟩)).symm.trans hmap).symm have hstrong : StronglyMeasurable[comap (xi p m) inferInstance] (xi p m) := (measurable_iff_comap_le.mpr le_rfl).stronglyMeasurable haveI : SigmaFinite (m.P.trim (measurable_xt (Xspace := Xspace)).comap_le) := inferInstance have hce := MeasureTheory.condExp_indep_eq (μ := m.P) (m₁ := comap (xi p m) inferInstance) (m₂ := xTSigma (Xspace := Xspace)) (f := xi p m) (by exact hmeas.comap_le) (by exact measurable_xt.comap_le) hstrong hind simpa [hmean, Pi.zero_def] using hce
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_outcomeMeanIndependence · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:610
theorem affineGaussianModel_map_xt

The covariate-treatment marginal of the packaged affine model is the base model's covariate-treatment marginal.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).P.map (fun o ↦ (covariate o, treatment o))
= base.P.map (fun o ↦ (covariate o, treatment o))
Proof (Lean source)
lemma affineGaussianModel_map_xt {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).P.map (fun o ↦ (covariate o, treatment o)) = base.P.map (fun o ↦ (covariate o, treatment o)) := by exact affineGaussianLaw_map_xt base theta tau
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_map_xt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:643
theorem affineGaussianModel_covariateLaw

The covariate marginal is retained by the affine Gaussian model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
covariateLaw p (affineGaussianModel base theta tau) = covariateLaw p base
Proof (Lean source)
lemma affineGaussianModel_covariateLaw {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : covariateLaw p (affineGaussianModel base theta tau) = covariateLaw p base := by unfold covariateLaw have hf : covariate = fst ∘ (fun o : Obs Xspace ↦ (covariate o, treatment o)) := rfl rw [hf, ← Measure.map_map measurable_fst measurable_xt, affineGaussianModel_map_xt, Measure.map_map measurable_fst measurable_xt]
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_covariateLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:652
theorem affineGaussianModel_map_eta

Any property depending only on the treatment residual's pushforward law is unchanged along the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
(affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau))
= base.P.map (eta p base)
Proof (Lean source)
lemma affineGaussianModel_map_eta {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : (affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau)) = base.P.map (eta p base) := by have hmeas : Measurable (fun z : Xspace × ℝ ↦ z.2 - base.g0 z.1) := measurable_snd.sub (base.g0_measurable.comp measurable_fst) calc (affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau)) = ((affineGaussianModel base theta tau).P.map (fun o ↦ (covariate o, treatment o))).map (fun z ↦ z.2 - base.g0 z.1) := by rw [Measure.map_map hmeas measurable_xt] rfl _ = (base.P.map (fun o ↦ (covariate o, treatment o))).map (fun z ↦ z.2 - base.g0 z.1) := by rw [affineGaussianModel_map_xt] _ = base.P.map (eta p base) := by rw [Measure.map_map hmeas measurable_xt] rfl
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_map_eta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:662
theorem affineGaussianModel_complexMGF_eta

The treatment-residual complex MGF is retained by the affine model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
complexMGF (eta p (affineGaussianModel base theta tau)) (affineGaussianModel base theta tau).P
= complexMGF (eta p base) base.P
Proof (Lean source)
lemma affineGaussianModel_complexMGF_eta {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : complexMGF (eta p (affineGaussianModel base theta tau)) (affineGaussianModel base theta tau).P = complexMGF (eta p base) base.P := by have heta : Measurable (eta p base) := measurable_treatment.sub (base.g0_measurable.comp measurable_covariate) have hnew : AEMeasurable (eta p (affineGaussianModel base theta tau)) (affineGaussianModel base theta tau).P := by exact heta.aemeasurable rw [← complexMGF_id_map hnew, ← complexMGF_id_map heta.aemeasurable] exact congrArg (complexMGF id) (affineGaussianModel_map_eta base theta tau)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_complexMGF_eta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:684
theorem affineGaussianModel_kappaEta

The cumulant separation functional is retained by the affine model.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
kappaEta p (affineGaussianModel base theta tau) = kappaEta p base
Proof (Lean source)
lemma affineGaussianModel_kappaEta {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) : kappaEta p (affineGaussianModel base theta tau) = kappaEta p base := by unfold kappaEta rw [affineGaussianModel_complexMGF_eta]
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_kappaEta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:698
theorem affineGaussianModel_integrable_comp_eta_iff

Integrability of any measurable function of the treatment residual is retained along the affine path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
f :
ℝ → ℝ
hf :
Integrable (fun o ↦ f (eta p (affineGaussianModel base theta tau) o)) (affineGaussianModel base theta tau).P
Integrable (fun o ↦ f (eta p base o)) base.P
Proof (Lean source)
lemma affineGaussianModel_integrable_comp_eta_iff {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) (f : ℝ → ℝ) (hf : Measurable f) : Integrable (fun o ↦ f (eta p (affineGaussianModel base theta tau) o)) (affineGaussianModel base theta tau).P ↔ Integrable (fun o ↦ f (eta p base o)) base.P := by have heta : Measurable (eta p base) := measurable_treatment.sub (base.g0_measurable.comp measurable_covariate) have hnew : AEMeasurable (eta p (affineGaussianModel base theta tau)) (affineGaussianModel base theta tau).P := heta.aemeasurable calc Integrable (fun o ↦ f (eta p (affineGaussianModel base theta tau) o)) (affineGaussianModel base theta tau).P ↔ Integrable f ((affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau))) := (integrable_map_measure hf.aestronglyMeasurable hnew).symm _ ↔ Integrable f (base.P.map (eta p base)) := by rw [affineGaussianModel_map_eta] _ ↔ Integrable (fun o ↦ f (eta p base o)) base.P := integrable_map_measure hf.aestronglyMeasurable heta.aemeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_integrable_comp_eta_iff · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:705
theorem affineGaussianModel_integral_comp_eta

Integrals of measurable functions of the treatment residual are retained along the affine path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
f :
ℝ → ℝ
hf :
∫ o, f (eta p (affineGaussianModel base theta tau) o) ∂(affineGaussianModel base theta tau).P
= ∫ o, f (eta p base o) ∂base.P
Proof (Lean source)
lemma affineGaussianModel_integral_comp_eta {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) (f : ℝ → ℝ) (hf : Measurable f) : ∫ o, f (eta p (affineGaussianModel base theta tau) o) ∂(affineGaussianModel base theta tau).P = ∫ o, f (eta p base o) ∂base.P := by have heta : Measurable (eta p base) := measurable_treatment.sub (base.g0_measurable.comp measurable_covariate) calc ∫ o, f (eta p (affineGaussianModel base theta tau) o) ∂(affineGaussianModel base theta tau).P = ∫ z, f z ∂((affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau))) := by exact (integral_map heta.aemeasurable hf.aestronglyMeasurable).symm _ = ∫ z, f z ∂(base.P.map (eta p base)) := by rw [affineGaussianModel_map_eta] _ = ∫ o, f (eta p base o) ∂base.P := by exact integral_map heta.aemeasurable hf.aestronglyMeasurable
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_integral_comp_eta · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:728
theorem affineGaussianModel_indep_eta_covariate

Independence of the treatment residual and covariate is preserved along the affine Gaussian outcome path.

Formal statement
base :
Model (Xspace := Xspace) p
theta tau :
hbase :
Proof (Lean source)
lemma affineGaussianModel_indep_eta_covariate {p : Parameters} (base : Model (Xspace := Xspace) p) (theta tau : ℝ) (hbase : IndependentTreatmentNoise p base) : IndependentTreatmentNoise p (affineGaussianModel base theta tau) := by have heta : Measurable (eta p base) := measurable_treatment.sub (base.g0_measurable.comp measurable_covariate) have hjoint : (affineGaussianModel base theta tau).P.map (fun o ↦ (eta p (affineGaussianModel base theta tau) o, covariate o)) = base.P.map (fun o ↦ (eta p base o, covariate o)) := by have hf : Measurable (fun z : Xspace × ℝ ↦ (z.2 - base.g0 z.1, z.1)) := (measurable_snd.sub (base.g0_measurable.comp measurable_fst)).prodMk measurable_fst calc (affineGaussianModel base theta tau).P.map (fun o ↦ (eta p (affineGaussianModel base theta tau) o, covariate o)) = ((affineGaussianModel base theta tau).P.map (fun o ↦ (covariate o, treatment o))).map (fun z ↦ (z.2 - base.g0 z.1, z.1)) := by rw [Measure.map_map hf measurable_xt] rfl _ = (base.P.map (fun o ↦ (covariate o, treatment o))).map (fun z ↦ (z.2 - base.g0 z.1, z.1)) := by rw [affineGaussianModel_map_xt] _ = base.P.map (fun o ↦ (eta p base o, covariate o)) := by rw [Measure.map_map hf measurable_xt] rfl have hcov : (affineGaussianModel base theta tau).P.map covariate = base.P.map covariate := by have hf : covariate = fst ∘ (fun o : Obs Xspace ↦ (covariate o, treatment o)) := rfl rw [hf, ← Measure.map_map measurable_fst measurable_xt, affineGaussianModel_map_xt, Measure.map_map measurable_fst measurable_xt] have hmapeta : (affineGaussianModel base theta tau).P.map (eta p base) = base.P.map (eta p base) := by change (affineGaussianModel base theta tau).P.map (eta p (affineGaussianModel base theta tau)) = _ exact affineGaussianModel_map_eta base theta tau apply (indepFun_iff_map_prod_eq_prod_map_map heta.aemeasurable measurable_covariate.aemeasurable).mpr change (affineGaussianModel base theta tau).P.map (fun o ↦ (eta p (affineGaussianModel base theta tau) o, covariate o)) = _ rw [hjoint, hmapeta, hcov] exact (indepFun_iff_map_prod_eq_prod_map_map heta.aemeasurable measurable_covariate.aemeasurable).mp hbase
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_indep_eta_covariate · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:749
theorem affineGaussianModel_nonGaussianClass

All non-Gaussian-class fields except the explicitly supplied Gaussian residual Luxemburg bound transport automatically along the affine path.

Formal statement
base :
Model (Xspace := Xspace) p
n :
hbase :
theta tau :
htheta :
|theta| ≤ p.Ctheta
hxi :
NonGaussianClass p n (affineGaussianModel base theta tau) where n_pos
Proof (Lean source)
lemma affineGaussianModel_nonGaussianClass {p : Parameters} (base : Model (Xspace := Xspace) p) (n : ℕ) (hbase : NonGaussianClass p n base) (theta tau : ℝ) (htheta : |theta| ≤ p.Ctheta) (hxi : XiSubGaussian p (affineGaussianModel base theta tau)) : NonGaussianClass p n (affineGaussianModel base theta tau) where n_pos := hbase.n_pos independentTreatmentNoise := affineGaussianModel_indep_eta_covariate base theta tau hbase.independentTreatmentNoise outcomeMeanIndependence := affineGaussianModel_outcomeMeanIndependence base theta tau thetaRange := htheta gRange := by rw [GRange, affineGaussianModel_covariateLaw] exact hbase.gRange qRange := by rw [QRange, affineGaussianModel_covariateLaw] exact hbase.qRange etaSubGaussian := by refine ⟨?_, ?_⟩ · exact (affineGaussianModel_integrable_comp_eta_iff base theta tau (fun z ↦ exp (z ^ 2 / p.psieta ^ 2)) (by fun_prop)).mpr hbase.etaSubGaussian.1 · rw [affineGaussianModel_integral_comp_eta base theta tau (fun z ↦ exp (z ^ 2 / p.psieta ^ 2)) (by fun_prop)] exact hbase.etaSubGaussian.2 xiSubGaussian := hxi cumulantSeparation := by rw [CumulantSeparation, affineGaussianModel_kappaEta] exact hbase.cumulantSeparation treatmentCodeRadiusL1 := by unfold TreatmentCodeRadiusL1At at ⊢ rw [affineGaussianModel_covariateLaw] exact hbase.treatmentCodeRadiusL1
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_nonGaussianClass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:794
theorem affineGaussianModel_jmsAceClass

The published ACE comparator class is likewise retained, apart from the explicitly supplied Gaussian residual Luxemburg bound.

Formal statement
base :
Model (Xspace := Xspace) p
n :
hbase :
JmsAceClass p n base
theta tau :
htheta :
|theta| ≤ p.Ctheta
hxi :
JmsAceClass p n (affineGaussianModel base theta tau) where n_pos
Proof (Lean source)
lemma affineGaussianModel_jmsAceClass {p : Parameters} (base : Model (Xspace := Xspace) p) (n : ℕ) (hbase : JmsAceClass p n base) (theta tau : ℝ) (htheta : |theta| ≤ p.Ctheta) (hxi : XiSubGaussian p (affineGaussianModel base theta tau)) : JmsAceClass p n (affineGaussianModel base theta tau) where n_pos := hbase.n_pos independentTreatmentNoise := affineGaussianModel_indep_eta_covariate base theta tau hbase.independentTreatmentNoise outcomeMeanIndependence := affineGaussianModel_outcomeMeanIndependence base theta tau thetaRange := htheta gRange := by rw [GRange, affineGaussianModel_covariateLaw] exact hbase.gRange qRange := by rw [QRange, affineGaussianModel_covariateLaw] exact hbase.qRange etaSubGaussian := by refine ⟨?_, ?_⟩ · exact (affineGaussianModel_integrable_comp_eta_iff base theta tau (fun z ↦ exp (z ^ 2 / p.psieta ^ 2)) (by fun_prop)).mpr hbase.etaSubGaussian.1 · rw [affineGaussianModel_integral_comp_eta base theta tau (fun z ↦ exp (z ^ 2 / p.psieta ^ 2)) (by fun_prop)] exact hbase.etaSubGaussian.2 xiSubGaussian := hxi cumulantSeparation := by rw [CumulantSeparation, affineGaussianModel_kappaEta] exact hbase.cumulantSeparation treatmentCodeRadiusLr := by unfold TreatmentCodeRadiusLrAt at ⊢ rw [affineGaussianModel_covariateLaw] exact hbase.treatmentCodeRadiusLr outcomeCodeRadiusLr := by unfold OutcomeCodeRadiusLrAt at ⊢ rw [affineGaussianModel_covariateLaw] exact hbase.outcomeCodeRadiusLr
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_jmsAceClass · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianOutcomePath.lean:831
Helpers.AffineGaussianSubGaussian 4 declarations This file supplies the explicit exponential-square calculation needed to put the fresh Gaussian outcome residual in the paper's conditional sub-Gaussian class.

Luxemburg control for the affine Gaussian outcome path

This file supplies the explicit exponential-square calculation needed to put the fresh Gaussian outcome residual in the paper's conditional sub-Gaussian class.

theorem gaussian_exp_sq_integrable_and_integral_le_two Lemma 11 in the paper ↗

At standard deviation psi / 4, a centered Gaussian's exponential-square moment at Luxemburg scale psi is finite and at most two.

Formal statement
psi :
hpsi :
0 < psi
Integrable (fun z : ℝ ↦ exp (z ^ 2 / psi ^ 2)) (gaussianReal 0 ⟨(psi / 4) ^ 2, sq_nonneg (psi / 4)⟩) ∧
∫ z, exp (z ^ 2 / psi ^ 2) ∂(gaussianReal 0 ⟨(psi / 4) ^ 2, sq_nonneg (psi / 4)⟩) ≤ 2
Proof (Lean source)
lemma gaussian_exp_sq_integrable_and_integral_le_two (psi : ℝ) (hpsi : 0 < psi) : Integrable (fun z : ℝ ↦ exp (z ^ 2 / psi ^ 2)) (gaussianReal 0 ⟨(psi / 4) ^ 2, sq_nonneg (psi / 4)⟩) ∧ ∫ z, exp (z ^ 2 / psi ^ 2) ∂(gaussianReal 0 ⟨(psi / 4) ^ 2, sq_nonneg (psi / 4)⟩) ≤ 2 := by let v : NNReal := ⟨(psi / 4) ^ 2, sq_nonneg (psi / 4)⟩ have hvval : (v : ℝ) = (psi / 4) ^ 2 := rfl have hv : v ≠ 0 := by intro hv0 have hval : ((psi / 4) ^ 2 : ℝ) = 0 := congrArg (fun x : NNReal ↦ (x : ℝ)) hv0 nlinarith [mul_pos hpsi hpsi] have hb : 0 < (7 / psi ^ 2 : ℝ) := by positivity have hdom : Integrable (fun z : ℝ ↦ exp (-(7 / psi ^ 2) * z ^ 2)) := integrable_exp_neg_mul_sq hb have hdensity : ∀ z : ℝ, gaussianPDFReal 0 v z * exp (z ^ 2 / psi ^ 2) = (sqrt (2 * pi * (v : ℝ)))⁻¹ * exp (-(7 / psi ^ 2) * z ^ 2) := by intro z rw [gaussianPDFReal] rw [mul_assoc, ← Real.exp_add] congr 1 rw [hvval] field_simp [ne_of_gt hpsi] ring have hintDensity : Integrable (fun z : ℝ ↦ gaussianPDFReal 0 v z * exp (z ^ 2 / psi ^ 2)) := by apply (hdom.const_mul (sqrt (2 * pi * (v : ℝ)))⁻¹).congr exact Filter.Eventually.of_forall fun z ↦ (hdensity z).symm have hint : Integrable (fun z : ℝ ↦ exp (z ^ 2 / psi ^ 2)) (gaussianReal 0 v) := by rw [gaussianReal_of_var_ne_zero _ hv, integrable_withDensity_iff (measurable_gaussianPDF 0 v) (Filter.Eventually.of_forall fun x ↦ by simp [gaussianPDF])] simpa [toReal_gaussianPDF, mul_comm] using hintDensity refine ⟨hint, ?_⟩ rw [integral_gaussianReal_eq_integral_smul hv] simp only [smul_eq_mul] rw [integral_congr_ae (Filter.Eventually.of_forall hdensity), integral_const_mul, integral_gaussian (7 / psi ^ 2)] have hsqrt_nonneg : 0 ≤ sqrt (2 * pi * (v : ℝ)) := Real.sqrt_nonneg _ have hsqrt_pos : 0 < sqrt (2 * pi * (v : ℝ)) := by positivity have hroot : sqrt (pi / (7 / psi ^ 2)) ≤ 2 * sqrt (2 * pi * (v : ℝ)) := by rw [Real.sqrt_le_iff] constructor · positivity · have hsquare : (2 * sqrt (2 * pi * (v : ℝ))) ^ 2 = 4 * (2 * pi * (v : ℝ)) := by rw [mul_pow, Real.sq_sqrt (by positivity)] norm_num rw [hsquare, hvval] field_simp [ne_of_gt hpsi] nlinarith [Real.pi_pos, sq_pos_of_pos hpsi] calc (sqrt (2 * pi * (v : ℝ)))⁻¹ * sqrt (pi / (7 / psi ^ 2)) ≤ (sqrt (2 * pi * (v : ℝ)))⁻¹ * (2 * sqrt (2 * pi * (v : ℝ))) := by gcongr _ = 2 := by field_simp
CausalSmith.Stat.SaPlmCumulantConverse.gaussian_exp_sq_integrable_and_integral_le_two · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianSubGaussian.lean:21
theorem affineGaussianModel_xiSubGaussian_quarter

The affine Gaussian model at scale psi / 4 satisfies the exact conditional Luxemburg requirement at scale psi.

Formal statement
base :
Model (Xspace := Xspace) p
theta :
hpsi :
0 < p.psixi
XiSubGaussian p (affineGaussianModel base theta (p.psixi / 4))
Proof (Lean source)
lemma affineGaussianModel_xiSubGaussian_quarter {p : Parameters} (base : Model (Xspace := Xspace) p) (theta : ℝ) (hpsi : 0 < p.psixi) : XiSubGaussian p (affineGaussianModel base theta (p.psixi / 4)) := by let m := affineGaussianModel base theta (p.psixi / 4) let f : ℝ → ℝ := fun z ↦ exp (z ^ 2 / p.psixi ^ 2) have hf : Measurable f := by fun_prop have hgauss := gaussian_exp_sq_integrable_and_integral_le_two p.psixi hpsi have hximeas : Measurable (xi p m) := by exact (((measurable_snd.comp measurable_snd).sub (base.q0_measurable.comp measurable_fst)).sub (measurable_const.mul ((measurable_fst.comp measurable_snd).sub (base.g0_measurable.comp measurable_fst)))) have hint : Integrable (fun o ↦ f (xi p m o)) m.P := by have hmap : Integrable f (m.P.map (xi p m)) := by rw [show m.P.map (xi p m) = gaussianReal 0 ⟨(p.psixi / 4) ^ 2, sq_nonneg (p.psixi / 4)⟩ by simpa [m] using affineGaussianModel_map_xi base theta (p.psixi / 4)] exact hgauss.1 exact hmap.comp_aemeasurable hximeas.aemeasurable refine ⟨hint, ?_⟩ have hind : IndepFun (f ∘ xi p m) covariate m.P := by have h := (affineGaussianModel_indep_xi_xt base theta (p.psixi / 4)).comp hf measurable_fst simpa [Function.comp_def, m] using h change Indep (comap (f ∘ xi p m) inferInstance) (comap covariate inferInstance) m.P at hind have hstrong : StronglyMeasurable[comap (f ∘ xi p m) inferInstance] (f ∘ xi p m) := (measurable_iff_comap_le.mpr le_rfl).stronglyMeasurable have hcovle : comap (covariate : Obs Xspace → Xspace) inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := measurable_fst.comap_le haveI : SigmaFinite (m.P.trim hcovle) := inferInstance have hce := MeasureTheory.condExp_indep_eq (μ := m.P) (m₁ := comap (f ∘ xi p m) inferInstance) (m₂ := comap covariate inferInstance) (f := f ∘ xi p m) (hf.comp hximeas).comap_le hcovle hstrong hind have hmean : ∫ o, f (xi p m o) ∂m.P ≤ 2 := by have hmap := integral_map (μ := m.P) (φ := xi p m) (f := f) hximeas.aemeasurable hf.aestronglyMeasurable rw [affineGaussianModel_map_xi base theta (p.psixi / 4)] at hmap rw [← hmap] exact hgauss.2 filter_upwards [hce] with o ho change m.P[f ∘ xi p m | comap covariate inferInstance] o ≤ 2 rw [ho] simpa [Function.comp_def] using hmean
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_xiSubGaussian_quarter · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianSubGaussian.lean:86
theorem affineGaussianModel_nonGaussianClass_quarter

The quarter-scale affine family remains in the broad non-Gaussian class throughout the original target range.

Formal statement
base :
Model (Xspace := Xspace) p
n :
hbase :
theta :
htheta :
|theta| ≤ p.Ctheta
NonGaussianClass p n (affineGaussianModel base theta (p.psixi / 4))
Proof (Lean source)
lemma affineGaussianModel_nonGaussianClass_quarter {p : Parameters} (base : Model (Xspace := Xspace) p) (n : ℕ) (hbase : NonGaussianClass p n base) (theta : ℝ) (htheta : |theta| ≤ p.Ctheta) : NonGaussianClass p n (affineGaussianModel base theta (p.psixi / 4)) := affineGaussianModel_nonGaussianClass base n hbase theta (p.psixi / 4) htheta (affineGaussianModel_xiSubGaussian_quarter base theta p.constants_pos.2.2.2.2.1)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_nonGaussianClass_quarter · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianSubGaussian.lean:135
theorem affineGaussianModel_jmsAceClass_quarter

The quarter-scale affine family remains in the published ACE comparator class throughout the original target range.

Formal statement
base :
Model (Xspace := Xspace) p
n :
hbase :
JmsAceClass p n base
theta :
htheta :
|theta| ≤ p.Ctheta
JmsAceClass p n (affineGaussianModel base theta (p.psixi / 4))
Proof (Lean source)
lemma affineGaussianModel_jmsAceClass_quarter {p : Parameters} (base : Model (Xspace := Xspace) p) (n : ℕ) (hbase : JmsAceClass p n base) (theta : ℝ) (htheta : |theta| ≤ p.Ctheta) : JmsAceClass p n (affineGaussianModel base theta (p.psixi / 4)) := affineGaussianModel_jmsAceClass base n hbase theta (p.psixi / 4) htheta (affineGaussianModel_xiSubGaussian_quarter base theta p.constants_pos.2.2.2.2.1)
CausalSmith.Stat.SaPlmCumulantConverse.affineGaussianModel_jmsAceClass_quarter · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/AffineGaussianSubGaussian.lean:145
Helpers.BoundedCertifiedComplex 92 declarations The generic contour API deliberately does not package multiplication of two certified values, because its global map interface is too strong for empirical exponential sums.

Paper-local bounded certified-complex combinators

The generic contour API deliberately does not package multiplication of two certified values, because its global map interface is too strong for empirical exponential sums. This file supplies the bounded name-level operations needed by the finite spectral evaluator. Every executable approximation remains a rational rectangle; semantic values occur only in the external certificate.

theorem complexExpName_value

The certified name built for the complex exponential of a certified complex number denotes exactly the complex exponential of that number's exact value.

Formal statement
(Transcendental.complexExpName z).value = exp z.value
Proof (Lean source)
@[simp] lemma complexExpName_value (z : CertifiedComplex) : (Transcendental.complexExpName z).value = exp z.value := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.complexExpName_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:22
theorem piName_value

The certified name for the circle constant denotes exactly the real number pi.

Formal statement
Transcendental.piName.value = pi
Proof (Lean source)
@[simp] lemma piName_value : Transcendental.piName.value = pi := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.piName_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:27
theorem certifiedAdd_value

The exact value of the certified sum of two certified complex numbers is the sum of their exact values.

Formal statement
(z.add w).value = z.value + w.value
Proof (Lean source)
@[simp] lemma certifiedAdd_value (z w : CertifiedComplex) : (z.add w).value = z.value + w.value := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.certifiedAdd_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:30

A certified real regarded as a certified complex number with zero imaginary part.

Definition (Lean source)
def ofReal (x : CertifiedReal) : CertifiedComplex where value := x.value approx := fun n ↦ ⟨x.approx n, RatInterval.point 0⟩ nested := fun n ↦ ⟨x.nested n, RatInterval.subinterval_refl _⟩ contains := fun n ↦ ⟨by simpa using x.contains n, by simpa using RatInterval.point_sound 0⟩ modulus := x.modulus width_modulus := by intro ε simp only [ComplexRatInterval.width, RatInterval.width, RatInterval.point, sub_self] apply max_le · exact x.width_modulus ε · exact ε.2.le
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.ofReal · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:52
theorem ofReal_value

Viewing a certified real number as a certified complex number with zero imaginary part leaves its exact value unchanged.

Formal statement
(ofReal x).value = x.value
Proof (Lean source)
@[simp] lemma ofReal_value (x : CertifiedReal) : (ofReal x).value = x.value := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.ofReal_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:67
def mulApprox

Recursive intersections of raw rectangle products.

Definition (Lean source)
def mulApprox (z w : CertifiedComplex) : ℕ → ComplexRatInterval | 0 => (z.approx 0).mul (w.approx 0) | n + 1 => (mulApprox z w n).tighten ((z.approx (n + 1)).mul (w.approx (n + 1)))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mulApprox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:71
theorem mulApprox_spec

Every stage of the recursively intersected rectangle products encloses the product of the two exact values, the stages are nested one inside the previous one, and each stage refines the raw rectangle product of the two inputs at that same stage.

Formal statement
n :
(mulApprox z w n).Contains (z.value * w.value) ∧
(mulApprox z w (n + 1)).Subinterval (mulApprox z w n) ∧
(mulApprox z w n).Subinterval ((z.approx n).mul (w.approx n))
Proof (Lean source)
lemma mulApprox_spec (z w : CertifiedComplex) (n : ℕ) : (mulApprox z w n).Contains (z.value * w.value) ∧ (mulApprox z w (n + 1)).Subinterval (mulApprox z w n) ∧ (mulApprox z w n).Subinterval ((z.approx n).mul (w.approx n)) := by induction n with | zero => have h := ComplexRatInterval.mul_sound (z.contains 0) (w.contains 0) exact ⟨h, (ComplexRatInterval.tighten_sound_left h (ComplexRatInterval.mul_sound (z.contains 1) (w.contains 1))).2, ⟨RatInterval.subinterval_refl _, RatInterval.subinterval_refl _⟩⟩ | succ n ih => have hnew := ComplexRatInterval.mul_sound (z.contains (n + 1)) (w.contains (n + 1)) have hcur : (mulApprox z w (n + 1)).Contains (z.value * w.value) := by rw [mulApprox] exact (ComplexRatInterval.tighten_sound_left ih.1 hnew).1 have hnext := ComplexRatInterval.mul_sound (z.contains (n + 2)) (w.contains (n + 2)) exact ⟨hcur, by rw [show n + 1 + 1 = n + 2 by omega, mulApprox] exact (ComplexRatInterval.tighten_sound_left hcur hnext).2, by rw [mulApprox] exact ⟨ Transcendental.tighten_subinterval_right ih.1.1 hnew.1, Transcendental.tighten_subinterval_right ih.1.2 hnew.2⟩⟩
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mulApprox_spec · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:76
def mulPrecision

The stage index at which the certified product of two complex numbers is guaranteed to be accurate to a requested rational tolerance: the larger of the two stage indices at which each factor's own modulus of convergence delivers an internally derived, magnitude-adjusted tolerance.

Definition (Lean source)
def mulPrecision (z w : CertifiedComplex) (ε : PosRat) : ℕ := max (z.modulus (mulTolerance z w ε)) (w.modulus (mulTolerance z w ε))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mulPrecision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:117
theorem mul_width_at_precision

At the stage index selected by the product precision schedule, the rectangle enclosing the product of two certified complex numbers has width at most the requested tolerance.

Formal statement
(mulApprox z w (mulPrecision z w ε)).width ≤ ε.1
Proof (Lean source)
lemma mul_width_at_precision (z w : CertifiedComplex) (ε : PosRat) : (mulApprox z w (mulPrecision z w ε)).width ≤ ε.1 := by let δ := mulTolerance z w ε let k := mulPrecision z w ε let A := (z.approx 0).maxAbs let B := (w.approx 0).maxAbs have hzmono : (z.approx k).Subinterval (z.approx 0) := approx_mono z (zero_le k) have hwmono : (w.approx k).Subinterval (w.approx 0) := approx_mono w (zero_le k) have hzwidth : (z.approx k).width ≤ δ.1 := (width_mono (approx_mono z (le_max_left _ _))).trans (z.width_modulus δ) have hwwidth : (w.approx k).width ≤ δ.1 := (width_mono (approx_mono w (le_max_right _ _))).trans (w.width_modulus δ) have hzA : (z.approx k).maxAbs ≤ A := maxAbs_mono hzmono have hwB : (w.approx k).maxAbs ≤ B := maxAbs_mono hwmono have hA : 0 ≤ A := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hB : 0 ≤ B := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_right _ _)) have hzA0 : 0 ≤ (z.approx k).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hwB0 : 0 ≤ (w.approx k).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hraw := ComplexRatInterval.mul_width (z.approx k) (w.approx k) have htight := width_mono (mulApprox_spec z w k).2.2 calc (mulApprox z w k).width ≤ ((z.approx k).mul (w.approx k)).width := htight _ ≤ 2 * ((z.approx k).maxAbs * (w.approx k).width + (w.approx k).maxAbs * (z.approx k).width) := hraw _ ≤ 2 * (A * δ.1 + B * δ.1) := by have hzw0 : 0 ≤ (z.approx k).width := (RatInterval.width_nonneg _).trans (le_max_left _ _) have hww0 : 0 ≤ (w.approx k).width := (RatInterval.width_nonneg _).trans (le_max_left _ _) nlinarith [mul_le_mul hzA hwwidth hww0 hA, mul_le_mul hwB hzwidth hzw0 hB] _ ≤ ε.1 := by dsimp [δ, mulTolerance, A, B] have hden : 0 < 4 * ((z.approx 0).maxAbs + (w.approx 0).maxAbs + 1) := by positivity calc 2 * ((z.approx 0).maxAbs * (ε.1 / (4 * ((z.approx 0).maxAbs + (w.approx 0).maxAbs + 1))) + (w.approx 0).maxAbs * (ε.1 / (4 * ((z.approx 0).maxAbs + (w.approx 0).maxAbs + 1)))) = (2 * ε.1 * ((z.approx 0).maxAbs + (w.approx 0).maxAbs)) / (4 * ((z.approx 0).maxAbs + (w.approx 0).maxAbs + 1)) := by ring _ ≤ ε.1 := by rw [div_le_iff₀ hden] nlinarith [ε.2]
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mul_width_at_precision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:124
def mul

Multiplication of bounded certified complex names.

Definition (Lean source)
def mul (z w : CertifiedComplex) : CertifiedComplex where value := z.value * w.value approx := mulApprox z w nested := fun n ↦ (mulApprox_spec z w n).2.1 contains := fun n ↦ (mulApprox_spec z w n).1 modulus := mulPrecision z w width_modulus := mul_width_at_precision z w
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mul · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:178
theorem mul_value

The exact value of the certified product of two certified complex numbers is the product of their exact values.

Formal statement
(mul z w).value = z.value * w.value
Proof (Lean source)
@[simp] lemma mul_value (z w : CertifiedComplex) : (mul z w).value = z.value * w.value := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.mul_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:187
def smulRat

Scaling a certified complex number by a rational number, realized as the certified product with the exact constant name for that rational.

Definition (Lean source)
def smulRat (q : ℚ) (z : CertifiedComplex) : CertifiedComplex := mul (CertifiedComplex.ofRatPair q 0) z
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.smulRat · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:191
theorem smulRat_value

Scaling a certified complex number by a rational number multiplies its exact value by that rational.

Formal statement
q :
(smulRat q z).value = (q : ℂ) * z.value
Proof (Lean source)
@[simp] lemma smulRat_value (q : ℚ) (z : CertifiedComplex) : (smulRat q z).value = (q : ℂ) * z.value := by simp [smulRat, CertifiedComplex.ofRatPair]
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.smulRat_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:196
def npow

Repeated certified multiplication: the zero-th power is the certified constant one, and each further power multiplies the previous one by the base. Every intermediate product is itself a certified value, so the recursion carries its enclosure along.

Definition (Lean source)
def npow : CertifiedComplex → ℕ → CertifiedComplex | _, 0 => CertifiedComplex.ofRatPair 1 0 | z, n + 1 => mul (npow z n) z
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.npow · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:202
theorem npow_value

The exact value of the n-fold certified power of a certified complex number is the n-th power of its exact value.

Formal statement
n :
(npow z n).value = z.value ^ n
Proof (Lean source)
@[simp] lemma npow_value (z : CertifiedComplex) (n : ℕ) : (npow z n).value = z.value ^ n := by induction n with | zero => simp [npow, CertifiedComplex.ofRatPair] | succ n ih => simp [npow, ih, pow_succ]
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.npow_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:209
def sum

The certified sum of a finite list of certified complex numbers, obtained by folding certified addition along the list with the exact constant zero as the empty case.

Definition (Lean source)
def sum : List CertifiedComplexCertifiedComplex | [] => CertifiedComplex.ofRatPair 0 0 | z :: zs => CertifiedComplex.add z (sum zs)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.sum · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:217
theorem sum_value

The exact value of the certified sum of a list of certified complex numbers is the ordinary sum of their exact values.

Formal statement
(sum xs).value = (xs.map CertifiedComplex.value).sum
Proof (Lean source)
@[simp] lemma sum_value (xs : List CertifiedComplex) : (sum xs).value = (xs.map CertifiedComplex.value).sum := by induction xs with | nil => simp [sum, CertifiedComplex.ofRatPair] | cons z zs ih => rw [sum] change z.value + (sum zs).value = z.value + (zs.map CertifiedComplex.value).sum rw [ih]
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.sum_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:223
def rectangleMidpoint

Rational midpoint of a complex rectangle, coordinate by coordinate.

Definition (Lean source)
def rectangleMidpoint (I : ComplexRatInterval) : ℚ × ℚ := (Transcendental.intervalMid I.re, Transcendental.intervalMid I.im)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.rectangleMidpoint · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:243
def centeredExpCenterName

The midpoint represented as a constant certified complex name.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpCenterName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:247
def centeredExpEnvelope

A rational envelope for the real exponential on the argument rectangle. The base three dominates Euler's number, and negative real parts are covered by the exponent zero branch.

Definition (Lean source)
def centeredExpEnvelope (I : ComplexRatInterval) : ℚ := (3 : ℚ) ^ toNat ⌈max 0 I.re.hi⌉
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpEnvelope · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:251
theorem centeredExpEnvelope_nonneg

The rational exponential envelope attached to a complex rectangle is nonnegative.

Formal statement
Proof (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpEnvelope_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:257
def centeredExpStageFuel

Deterministic Taylor fuel used by the certified exponential stage at the rational midpoint. This name is included in traces and schedule accounting.

Definition (Lean source)
def centeredExpStageFuel (I : ComplexRatInterval) (stage : ℕ) : ℕ := Transcendental.complexExpStageFuel (centeredExpCenterName I) stage
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpStageFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:263
def centeredExpCenterCore

Nested certified exponential enclosure at the rational midpoint.

Definition (Lean source)
def centeredExpCenterCore (I : ComplexRatInterval) (stage : ℕ) : ComplexRatInterval := Transcendental.complexExpNameApprox (centeredExpCenterName I) stage
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpCenterCore · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:268
theorem centeredExpStageFuel_eq

The Taylor fuel recorded for the midpoint-centered exponential stage on a rectangle is, by definition, the certified-exponential stage fuel of the constant name for that rectangle's rational midpoint.

Formal statement
stage :
= Transcendental.complexExpStageFuel (centeredExpCenterName I) stage
Proof (Lean source)
@[simp] lemma centeredExpStageFuel_eq (I : ComplexRatInterval) (stage : ℕ) : centeredExpStageFuel I stage = Transcendental.complexExpStageFuel (centeredExpCenterName I) stage := rfl
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpStageFuel_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:273
def centeredComplexExp

Midpoint-centered exponential interval. Its only dependence on the argument rectangle width is the displayed coordinatewise expansion.

Definition (Lean source)
def centeredComplexExp (I : ComplexRatInterval) (stage : ℕ) : ComplexRatInterval := let allowance := centeredExpEnvelope I * I.width (centeredExpCenterCore I stage).expand allowance (mul_nonneg (centeredExpEnvelope_nonneg I) ((RatInterval.width_nonneg I.re).trans (le_max_left _ _)))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredComplexExp · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:280
theorem centeredExpEnvelope_sound

The rational envelope bounds the real exponential at every real coordinate represented by the argument rectangle.

Formal statement
x :
hx :
I.re.Contains x
Proof (Lean source)
lemma centeredExpEnvelope_sound (I : ComplexRatInterval) {x : ℝ} (hx : I.re.Contains x) : exp x ≤ centeredExpEnvelope I := by let q : ℚ := max 0 I.re.hi let k : ℤ := ⌈q⌉ let n : ℕ := k.toNat have hq0 : 0 ≤ q := by simp [q] have hqk : q ≤ (k : ℚ) := Int.le_ceil q have hk0 : 0 ≤ k := by have : (0 : ℚ) ≤ (k : ℚ) := hq0.trans hqk exact_mod_cast this have hqn : q ≤ (n : ℚ) := by have hkn : (n : ℤ) = k := by exact Int.toNat_of_nonneg hk0 rw [← hkn] at hqk exact_mod_cast hqk have hxn : x ≤ (n : ℕ) := by have hxhi : x ≤ (I.re.hi : ℝ) := hx.2 have hhiq : I.re.hi ≤ q := by simp [q] have hhiqR : (I.re.hi : ℝ) ≤ (q : ℝ) := by exact_mod_cast hhiq have hqnR : (q : ℝ) ≤ (n : ℝ) := by exact_mod_cast hqn exact hxhi.trans (hhiqR.trans hqnR) have hexp : exp x ≤ exp (n : ℝ) := Real.exp_le_exp.mpr hxn have hbase : exp 1 ≤ (3 : ℝ) := (Real.exp_one_lt_three).le have hpow : exp (n : ℝ) ≤ (3 : ℝ) ^ n := by rw [← Real.exp_one_pow] exact pow_le_pow_left₀ (Real.exp_pos 1).le hbase n exact hexp.trans (by simpa [centeredExpEnvelope, q, k, n] using hpow)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredExpEnvelope_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:289
theorem centeredComplexExp_sound

Midpoint Lipschitz control makes the widened midpoint enclosure sound for every complex point in the argument rectangle.

Formal statement
stage :
z :
hz :
I.Contains z
(centeredComplexExp I stage).Contains (exp z)
Proof (Lean source)
lemma centeredComplexExp_sound (I : ComplexRatInterval) (stage : ℕ) {z : ℂ} (hz : I.Contains z) : (centeredComplexExp I stage).Contains (exp z) := by let c : ℚ := Transcendental.intervalMid I.re let d : ℚ := Transcendental.intervalMid I.im let E : ℝ := centeredExpEnvelope I have hcI : I.re.Contains (c : ℝ) := by constructor <;> exact_mod_cast (by dsimp [c, Transcendental.intervalMid] linarith [I.re.lo_le_hi]) have hdI : I.im.Contains (d : ℝ) := by constructor <;> exact_mod_cast (by dsimp [d, Transcendental.intervalMid] linarith [I.im.lo_le_hi]) have hE0 : 0 ≤ E := by dsimp [E] exact_mod_cast centeredExpEnvelope_nonneg I have hLip : |exp z.re - exp (c : ℝ)| ≤ E * |z.re - (c : ℝ)| := by simpa [Real.norm_eq_abs] using (Convex.norm_image_sub_le_of_norm_deriv_le (f := exp) (s := Icc (I.re.lo : ℝ) (I.re.hi : ℝ)) (x := (c : ℝ)) (y := z.re) (C := E) (fun y _ => (Real.hasDerivAt_exp y).differentiableAt) (fun y hy => by rw [Real.deriv_exp, Real.norm_eq_abs, Real.abs_exp] exact centeredExpEnvelope_sound I hy) (convex_Icc _ _) hcI hz.1) have hcos := Real.abs_cos_sub_cos_le z.im (d : ℝ) have hsin := Real.abs_sin_sub_sin_le z.im (d : ℝ) have hxc := Transcendental.abs_sub_intervalMid_le_radius hz.1 have hyd := Transcendental.abs_sub_intervalMid_le_radius hz.2 have hreWidth : (I.re.width : ℝ) ≤ (I.width : ℝ) := by exact_mod_cast le_max_left I.re.width I.im.width have himWidth : (I.im.width : ℝ) ≤ (I.width : ℝ) := by exact_mod_cast le_max_right I.re.width I.im.width have hdist : |z.re - (c : ℝ)| + |z.im - (d : ℝ)| ≤ (I.width : ℝ) := by dsimp [c, d] simp only [Transcendental.intervalRadius, Rat.cast_div, Rat.cast_ofNat] at hxc hyd linarith have hEc : exp (c : ℝ) ≤ E := centeredExpEnvelope_sound I hcI have hmidRe : (((c : ℝ) : ℂ) + ((d : ℝ) : ℂ) * I).re = (c : ℝ) := by simp have hmidIm : (((c : ℝ) : ℂ) + ((d : ℝ) : ℂ) * I).im = (d : ℝ) := by simp have hreDiff : |(exp z).re - (exp ((c : ℝ) + (d : ℝ) * I)).re| ≤ E * (I.width : ℝ) := by rw [Complex.exp_re, Complex.exp_re, hmidRe, hmidIm] calc _ = |(exp z.re - exp (c : ℝ)) * cos z.im + exp (c : ℝ) * (cos z.im - cos (d : ℝ))| := by congr 1 ring _ ≤ |exp z.re - exp (c : ℝ)| * |cos z.im| + |exp (c : ℝ)| * |cos z.im - cos (d : ℝ)| := by simpa [abs_mul, Real.abs_exp] using (abs_add_le ((exp z.re - exp (c : ℝ)) * cos z.im) (exp (c : ℝ) * (cos z.im - cos (d : ℝ)))) _ ≤ E * |z.re - (c : ℝ)| + E * |z.im - (d : ℝ)| := by have hcosOne : |cos z.im| ≤ 1 := Real.abs_cos_le_one z.im have hEcAbs : |exp (c : ℝ)| ≤ E := by rw [Real.abs_exp] exact hEc apply add_le_add · calc _ ≤ (E * |z.re - (c : ℝ)|) * |cos z.im| := mul_le_mul_of_nonneg_right hLip (abs_nonneg _) _ ≤ (E * |z.re - (c : ℝ)|) * 1 := mul_le_mul_of_nonneg_left hcosOne (mul_nonneg hE0 (abs_nonneg _)) _ = E * |z.re - (c : ℝ)| := mul_one _ · calc _ ≤ E * |cos z.im - cos (d : ℝ)| := mul_le_mul_of_nonneg_right hEcAbs (abs_nonneg _) _ ≤ E * |z.im - (d : ℝ)| := mul_le_mul_of_nonneg_left hcos hE0 _ = E * (|z.re - (c : ℝ)| + |z.im - (d : ℝ)|) := by ring _ ≤ E * (I.width : ℝ) := mul_le_mul_of_nonneg_left hdist hE0 have himDiff : |(exp z).im - (exp ((c : ℝ) + (d : ℝ) * I)).im| ≤ E * (I.width : ℝ) := by rw [Complex.exp_im, Complex.exp_im, hmidRe, hmidIm] calc _ = |(exp z.re - exp (c : ℝ)) * sin z.im + exp (c : ℝ) * (sin z.im - sin (d : ℝ))| := by congr 1 ring _ ≤ |exp z.re - exp (c : ℝ)| * |sin z.im| + |exp (c : ℝ)| * |sin z.im - sin (d : ℝ)| := by simpa [abs_mul, Real.abs_exp] using (abs_add_le ((exp z.re - exp (c : ℝ)) * sin z.im) (exp (c : ℝ) * (sin z.im - sin (d : ℝ)))) _ ≤ E * |z.re - (c : ℝ)| + E * |z.im - (d : ℝ)| := by have hsinOne : |sin z.im| ≤ 1 := Real.abs_sin_le_one z.im have hEcAbs : |exp (c : ℝ)| ≤ E := by rw [Real.abs_exp] exact hEc apply add_le_add · calc _ ≤ (E * |z.re - (c : ℝ)|) * |sin z.im| := mul_le_mul_of_nonneg_right hLip (abs_nonneg _) _ ≤ (E * |z.re - (c : ℝ)|) * 1 := mul_le_mul_of_nonneg_left hsinOne (mul_nonneg hE0 (abs_nonneg _)) _ = E * |z.re - (c : ℝ)| := mul_one _ · calc _ ≤ E * |sin z.im - sin (d : ℝ)| := mul_le_mul_of_nonneg_right hEcAbs (abs_nonneg _) _ ≤ E * |z.im - (d : ℝ)| := mul_le_mul_of_nonneg_left hsin hE0 _ = E * (|z.re - (c : ℝ)| + |z.im - (d : ℝ)|) := by ring _ ≤ E * (I.width : ℝ) := mul_le_mul_of_nonneg_left hdist hE0 have hcenter := (Transcendental.complexExpNameApprox_spec (centeredExpCenterName I) stage).1 have hcenter' : (centeredExpCenterCore I stage).Contains (exp ((c : ℝ) + (d : ℝ) * I)) := by simpa [centeredExpCenterCore, centeredExpCenterName, rectangleMidpoint, c, d, CertifiedComplex.ofRatPair] using hcenter rw [abs_le] at hreDiff himDiff rw [centeredComplexExp] unfold ComplexRatInterval.Contains ComplexRatInterval.expand simp only [RatInterval.Contains, RatInterval.expand, Rat.cast_sub, Rat.cast_add, Rat.cast_mul] constructor <;> constructor <;> linarith [hcenter'.1.1, hcenter'.1.2, hcenter'.2.1, hcenter'.2.2, hreDiff.1, hreDiff.2, himDiff.1, himDiff.2]
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredComplexExp_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:322
theorem centeredComplexExp_width_at_precision

At the promoted complex-exponential precision, centered evaluation costs the algorithmic remainder plus exactly twice the explicit input-width allowance.

Formal statement
(centeredComplexExp I (Transcendental.complexExpPrecision (centeredExpCenterName I) e)).width
≤ 2 * centeredExpEnvelope I * I.width + e.1
Proof (Lean source)
lemma centeredComplexExp_width_at_precision (I : ComplexRatInterval) (e : PosRat) : (centeredComplexExp I (Transcendental.complexExpPrecision (centeredExpCenterName I) e)).width ≤ 2 * centeredExpEnvelope I * I.width + e.1 := by let allowance := centeredExpEnvelope I * I.width have hallowance : 0 ≤ allowance := by exact mul_nonneg (centeredExpEnvelope_nonneg I) ((RatInterval.width_nonneg I.re).trans (le_max_left _ _)) have hcore : (centeredExpCenterCore I (Transcendental.complexExpPrecision (centeredExpCenterName I) e)).width ≤ e.1 := by exact Transcendental.complexExp_width_at_precision (centeredExpCenterName I) e rw [centeredComplexExp, ComplexRatInterval.width, ComplexRatInterval.expand, RatInterval.width_expand, RatInterval.width_expand] rw [max_add_add_right] simpa [ComplexRatInterval.width, allowance, mul_assoc, add_comm] using (add_le_add_right hcore (2 * centeredExpEnvelope I * I.width))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCertifiedComplex.centeredComplexExp_width_at_precision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:453
def realRect

Promote a real rational interval to the real axis.

Definition (Lean source)
def realRect (I : RatInterval) : ComplexRatInterval := ⟨I, RatInterval.point 0⟩
theorem realRect_sound

Whenever a rational interval encloses a real number, the rectangle obtained by placing that interval on the real axis encloses the same number viewed as a complex number.

Formal statement
r :
hr :
I.Contains r
(realRect I).Contains ((r : ℝ) : ℂ)
Proof (Lean source)
lemma realRect_sound {I : RatInterval} {r : ℝ} (hr : I.Contains r) : (realRect I).Contains ((r : ℝ) : ℂ) := by exact ⟨by simpa [realRect] using hr, by simpa [realRect] using RatInterval.point_sound 0⟩
theorem realRect_width

Placing a rational interval on the real axis yields a rectangle of exactly the same width as the interval.

Formal statement
(realRect I).width = I.width
Proof (Lean source)
@[simp] lemma realRect_width (I : RatInterval) : (realRect I).width = I.width := by rw [realRect, ComplexRatInterval.width] simp only [RatInterval.point, RatInterval.width, sub_self] exact max_eq_left (RatInterval.width_nonneg I)
def bankRadiusRect

The certified-real bank radius is refined before it is multiplied by a unit-circle node. This is the only place where the bank radius enters a circle node.

Definition (Lean source)
def bankRadiusRect (radius : CertifiedReal) (precision : PosRat) : ComplexRatInterval := realRect (CertifiedReal.refine radius precision)
theorem bankRadiusRect_sound

Refining a certified real radius to a requested rational precision and placing the resulting interval on the real axis yields a rectangle that encloses the exact value of the radius.

Formal statement
radius :
precision :
(bankRadiusRect radius precision).Contains ((radius.value : ℝ) : ℂ)
Proof (Lean source)
lemma bankRadiusRect_sound (radius : CertifiedReal) (precision : PosRat) : (bankRadiusRect radius precision).Contains ((radius.value : ℝ) : ℂ) := by exact realRect_sound (CertifiedReal.refine_contains radius precision)
theorem bankRadiusRect_width

The refined radius rectangle has width at most the requested rational precision.

Formal statement
radius :
precision :
(bankRadiusRect radius precision).width ≤ precision.1
Proof (Lean source)
lemma bankRadiusRect_width (radius : CertifiedReal) (precision : PosRat) : (bankRadiusRect radius precision).width ≤ precision.1 := by simpa [bankRadiusRect, realRect_width] using CertifiedReal.refine_width radius precision
def certifiedRadiusNode

A certified-real radius times the reused rational-radius-one circle node.

Definition (Lean source)
def certifiedRadiusNode (radius : CertifiedReal) (precision : PosRat) (schedule : Schedule) (k : ℕ) : ComplexRatInterval := (bankRadiusRect radius precision).mul (circleNode 1 schedule k)
def twoPiIRect

A Machin-π rectangle for 2 π i.

Definition (Lean source)
def twoPiIRect (precision : ℕ) : ComplexRatInterval := ⟨RatInterval.point 0, (RatInterval.point 2).mul (Transcendental.piInterval precision)⟩
theorem twoPiIRect_sound

The Machin-series rectangle built at any precision encloses the complex number two pi times the imaginary unit.

Formal statement
precision :
(twoPiIRect precision).Contains (((2 : ℝ) * Real.pi : ℂ) * I)
Proof (Lean source)
lemma twoPiIRect_sound (precision : ℕ) : (twoPiIRect precision).Contains (((2 : ℝ) * Real.pi : ℂ) * I) := by constructor · simpa [twoPiIRect] using RatInterval.point_sound (0 : ℚ) · simpa [twoPiIRect] using RatInterval.mul_sound (RatInterval.point_sound (2 : ℚ)) (Transcendental.piInterval_sound precision)
def tangentNode

The tangent rectangle is 2 π i times the certified-radius node.

Definition (Lean source)
def tangentNode (radius : CertifiedReal) (radiusPrecision : PosRat) (piPrecision : ℕ) (schedule : Schedule) (k : ℕ) : ComplexRatInterval := (twoPiIRect piPrecision).mul (certifiedRadiusNode radius radiusPrecision schedule k)
def spectralNodeTarget

The map-level target is quadratically smaller than the requested branch tolerance. The second factor of the requested tolerance pays for the box-local derivative term in BoundedComplexMap.Valid; the rational factor sixteen leaves room for quotient, tangent, quadrature, and normalization amplification.

Definition (Lean source)
def spectralNodeTarget (tolerance : PosRat) : PosRat := ⟨tolerance.1 ^ 2 / 16, div_pos (sq_pos_of_pos tolerance.2) (by norm_num)⟩
def spectralEmpiricalMapFuel

Closed-form finite empirical-map fuel.

Definition (Lean source)
def spectralEmpiricalMapFuel (tolerance : PosRat) (operations : ℕ) (L : ℚ) : ℕ := 64 * (operations + 1) * (tolerance.1.den + 1) * (L.num.natAbs + 2) ^ 2
CausalSmith.Stat.SaPlmCumulantConverse.spectralEmpiricalMapFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:589
def spectralNormFuel

Closed-form modulus fuel used at a scheduled node.

Definition (Lean source)
def spectralNormFuel (tolerance : PosRat) : ℕ := tolerance.1.den + 1
def spectralSqrtFuel

Closed-form rational-bisection fuel used by the modulus square root.

Definition (Lean source)
def spectralSqrtFuel (tolerance : PosRat) : ℕ := 2 * (tolerance.1.den + 1)
def spectralRawNormFuel

Magnitude-aware Newton fuel for applying normInterval directly to a raw map rectangle.

Definition (Lean source)
def spectralRawNormFuel (tolerance : PosRat) (L : ℚ) : ℕ := 64 * (tolerance.1.den + 1) * (L.num.natAbs + 3) ^ 2
def spectralEndpointFuel

Closed fuel for the finite rational endpoint operations at one node.

Definition (Lean source)
def spectralEndpointFuel (operations : ℕ) : ℕ := operations + 1
def spectralDerivedFuel

One bound dominating every non-circle finite-map fuel used by a node.

Definition (Lean source)
def spectralDerivedFuel (tolerance : PosRat) (operations : ℕ) (L : ℚ) : ℕ := max (spectralEmpiricalMapFuel tolerance operations L) (max (spectralNormFuel tolerance) (max (spectralSqrtFuel tolerance) (spectralEndpointFuel operations)))
def spectralMeshBudget

One third of the requested tolerance, packaged for the exact mesh constructor.

Definition (Lean source)
def spectralMeshBudget (tolerance : PosRat) : PosRat := ⟨tolerance.1 / 3, div_pos tolerance.2 (by norm_num)⟩
def spectralMesh

Exact endpoint-complete mesh from the local certified-transcendental schedule.

Definition (Lean source)
def spectralMesh (tolerance : PosRat) (L : ℚ) : ℕ := explicitMeshFuel L (spectralMeshBudget tolerance)
theorem spectralMesh_error_le

For a nonnegative Lipschitz magnitude, dividing that magnitude by the mesh count chosen by the spectral schedule leaves a discretization error of at most one third of the requested tolerance.

Formal statement
tolerance :
L :
hL :
0 ≤ L
L / spectralMesh tolerance L ≤ tolerance.1 / 3
Proof (Lean source)
lemma spectralMesh_error_le (tolerance : PosRat) (L : ℚ) (hL : 0 ≤ L) : L / spectralMesh tolerance L ≤ tolerance.1 / 3 := by let e := spectralMeshBudget tolerance have he : 0 < e.1 := e.2 have hx0 : 0 ≤ L / e.1 := div_nonneg hL he.le have hceil0 : 0 ≤ ⌈L / e.1⌉ := Int.ceil_nonneg hx0 have hceil : L / e.1 ≤ (⌈L / e.1⌉ : ℚ) := Int.le_ceil _ have hcast : ((toNat ⌈L / e.1⌉ : ℕ) : ℚ) = (⌈L / e.1⌉ : ℚ) := by exact_mod_cast Int.toNat_of_nonneg hceil0 have hratio : L / e.1 ≤ ((toNat ⌈L / e.1⌉ + 1 : ℕ) : ℚ) := by rw [Nat.cast_add, cast_one, hcast] exact hceil.trans (le_add_of_nonneg_right zero_le_one) have hmeshPos : (0 : ℚ) < (toNat ⌈L / e.1⌉ + 1 : ℕ) := by positivity unfold spectralMesh explicitMeshFuel change L / ((toNat ⌈L / e.1⌉ + 1 : ℕ) : ℚ) ≤ e.1 apply (div_le_iff₀ hmeshPos).2 simpa [mul_comm] using (div_le_iff₀ he).1 hratio
CausalSmith.Stat.SaPlmCumulantConverse.spectralMesh_error_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:623
def spectralSchedule

Paper-local explicit schedule with exact circle precision and dominating circle, empirical-map, norm, and square-root fuel.

Definition (Lean source)
def spectralSchedule (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (_hAmp : 0 ≤ amplification) : Schedule where tolerance := tolerance operationCount := operations inputPrecision := circleInputPrecision 1 (spectralNodeTarget tolerance) mesh := spectralMesh tolerance lipschitz mesh_pos := by unfold spectralMesh explicitMeshFuel; positivity fuel := max (circleExpFuel 1 (spectralMesh tolerance lipschitz) (spectralNodeTarget tolerance)) (max (spectralDerivedFuel (spectralNodeTarget tolerance) operations amplification) (spectralRawNormFuel tolerance amplification)) magnitude := lipschitz magnitude_nonneg := hL nodeBudget := tolerance.1 / 3 meshBudget := tolerance.1 / 3 quadratureBudget := tolerance.1 / 3 nodeBudget_nonneg := div_nonneg tolerance.2.le (by norm_num) meshBudget_nonneg := div_nonneg tolerance.2.le (by norm_num) quadratureBudget_nonneg := div_nonneg tolerance.2.le (by norm_num) budget_sum_le := by linarith mesh_error_le := spectralMesh_error_le tolerance lipschitz hL
theorem spectralSchedule_inputPrecision

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the input precision recorded by the paper's spectral schedule is exactly the circle input precision at radius one for the quadratically reduced node target.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
(spectralSchedule tolerance operations lipschitz amplification hL hAmp).inputPrecision
Proof (Lean source)
@[simp] lemma spectralSchedule_inputPrecision (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : (spectralSchedule tolerance operations lipschitz amplification hL hAmp).inputPrecision = circleInputPrecision 1 (spectralNodeTarget tolerance) := rfl
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_inputPrecision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:670
theorem spectralSchedule_magnitude

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the magnitude recorded by the paper's spectral schedule is exactly the supplied Lipschitz constant.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
(spectralSchedule tolerance operations lipschitz amplification hL hAmp).magnitude
= lipschitz
Proof (Lean source)
@[simp] lemma spectralSchedule_magnitude (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : (spectralSchedule tolerance operations lipschitz amplification hL hAmp).magnitude = lipschitz := rfl
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_magnitude · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:679
theorem spectralSchedule_circleExpFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the circle exponential fuel at radius one, taken at the schedule's own mesh and at the reduced node target, does not exceed the fuel the schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
circleExpFuel 1 (spectralSchedule tolerance operations lipschitz amplification hL hAmp).mesh (spectralNodeTarget tolerance)
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_circleExpFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : circleExpFuel 1 (spectralSchedule tolerance operations lipschitz amplification hL hAmp).mesh (spectralNodeTarget tolerance) ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact le_max_left _ _
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_circleExpFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:688
theorem spectralSchedule_derivedFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the dominating non-circle fuel bound at the reduced node target does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
spectralDerivedFuel (spectralNodeTarget tolerance) operations amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_derivedFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralDerivedFuel (spectralNodeTarget tolerance) operations amplification ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact (le_max_left _ _).trans (le_max_right _ _)
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_derivedFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:700
theorem spectralSchedule_rawNormFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the magnitude-aware Newton fuel for taking the modulus of a raw map rectangle does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
spectralRawNormFuel tolerance amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_rawNormFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralRawNormFuel tolerance amplification ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact (le_max_right _ _).trans (le_max_right _ _)
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_rawNormFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:710
theorem spectralSchedule_empiricalMapFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the empirical-map fuel at the reduced node target does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
spectralEmpiricalMapFuel (spectralNodeTarget tolerance) operations amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_empiricalMapFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralEmpiricalMapFuel (spectralNodeTarget tolerance) operations amplification ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact (le_max_left _ _).trans (spectralSchedule_derivedFuel_le tolerance operations lipschitz amplification hL hAmp)
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_empiricalMapFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:720
theorem spectralSchedule_normFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the modulus fuel at the reduced node target does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_normFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralNormFuel (spectralNodeTarget tolerance) ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact ((le_max_left _ _).trans (le_max_right _ _)).trans (spectralSchedule_derivedFuel_le tolerance operations lipschitz amplification hL hAmp)
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_normFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:731
theorem spectralSchedule_sqrtFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the rational-bisection fuel used by the modulus square root at the reduced node target does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_sqrtFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralSqrtFuel (spectralNodeTarget tolerance) ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact ((le_max_left _ _).trans (le_max_right _ _)).trans ((le_max_right _ _).trans (spectralSchedule_derivedFuel_le tolerance operations lipschitz amplification hL hAmp))
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_sqrtFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:742
theorem spectralSchedule_endpointFuel_le

For a nonnegative Lipschitz magnitude and a nonnegative amplification factor, the fuel for the finite rational endpoint operations at one node does not exceed the fuel the spectral schedule budgets.

Formal statement
tolerance :
operations :
lipschitz amplification :
hL :
0 ≤ lipschitz
hAmp :
0 ≤ amplification
≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel
Proof (Lean source)
lemma spectralSchedule_endpointFuel_le (tolerance : PosRat) (operations : ℕ) (lipschitz amplification : ℚ) (hL : 0 ≤ lipschitz) (hAmp : 0 ≤ amplification) : spectralEndpointFuel operations ≤ (spectralSchedule tolerance operations lipschitz amplification hL hAmp).fuel := by exact (le_max_right _ _).trans ((le_max_right _ _).trans ((le_max_right _ _).trans (spectralSchedule_derivedFuel_le tolerance operations lipschitz amplification hL hAmp)))
CausalSmith.Stat.SaPlmCumulantConverse.spectralSchedule_endpointFuel_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:754

A complex map whose interval program is certified only on one fixed box. The proof obligations are kept in BoundedComplexMap.Valid, allowing the finite program itself to remain executable data.

Definition (Lean source)
value :
ℂ → ℂ
operationCount :
magnitudeEnvelope :
derivativeEnvelope :
precision :
PosRat → ℕ
def Valid

The correctness conditions carried by a box-local certified complex map: its magnitude and derivative envelopes are nonnegative, and for every rectangle contained in the fixed box and every complex point that rectangle encloses, all of the map's interval evaluations enclose the true value, the evaluations shrink as fuel increases, and at the stage chosen by the map's own precision schedule the output width is at most the derivative envelope times the input width plus the requested tolerance.

Definition (Lean source)
def BoundedComplexMap.Valid {box : ComplexRatInterval} (map : BoundedComplexMap box) : Prop := 0 ≤ map.magnitudeEnvelope ∧ 0 ≤ map.derivativeEnvelope ∧ ∀ {I : ComplexRatInterval} {z : ℂ}, I.Subinterval box → I.Contains z → (∀ fuel, (map.eval I fuel).Contains (map.value z)) ∧ (∀ fuel, (map.eval I (fuel + 1)).Subinterval (map.eval I fuel)) ∧ ∀ e, (map.eval I (map.precision e)).width ≤ map.derivativeEnvelope * I.width + e.1
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.Valid · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:778
def constant

The box-local map that sends every point to one fixed rational complex number. Its interval evaluation is the degenerate rectangle at that number, its magnitude envelope is the sum of the absolute values of the two coordinates, and its derivative envelope is zero.

Definition (Lean source)
def BoundedComplexMap.constant (box : ComplexRatInterval) (x y : ℚ) : BoundedComplexMap box where value := fun _ ↦ (x : ℝ) + (y : ℝ) * I eval := fun _ _ ↦ ComplexRatInterval.point x y operationCount := 1 magnitudeEnvelope := |x| + |y| derivativeEnvelope := 0 precision := fun _ ↦ 0
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.constant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:801
def identity

The box-local identity map. Its interval evaluation returns the input rectangle unchanged, its magnitude envelope is the largest modulus attained on the fixed box, and its derivative envelope is one.

Definition (Lean source)
def BoundedComplexMap.identity (box : ComplexRatInterval) : BoundedComplexMap box where value := id eval := fun I _ ↦ I operationCount := 1 magnitudeEnvelope := box.maxAbs derivativeEnvelope := 1 precision := fun _ ↦ 0
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.identity · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:813
def add

Box-local addition. The two maps are added pointwise and their interval evaluators are added at matching fuel; the operation count, magnitude envelope and derivative envelope of the sum are the sums of those of the summands, and each summand is asked for half the requested tolerance so the combined error meets it.

Definition (Lean source)
def BoundedComplexMap.add {box : ComplexRatInterval} (f g : BoundedComplexMap box) : BoundedComplexMap box where value := fun z ↦ f.value z + g.value z eval := fun I fuel ↦ (f.eval I fuel).add (g.eval I fuel) operationCount := f.operationCount + g.operationCount + 1 magnitudeEnvelope := f.magnitudeEnvelope + g.magnitudeEnvelope derivativeEnvelope := f.derivativeEnvelope + g.derivativeEnvelope precision := fun e ↦ max (f.precision (halfTolerance e)) (g.precision (halfTolerance e))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.add · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:824
def sub

Box-local subtraction. The two maps are subtracted pointwise and their interval evaluators are subtracted at matching fuel; the operation count, magnitude envelope and derivative envelope add rather than cancel, since they bound magnitudes, and each operand is asked for half the requested tolerance.

Definition (Lean source)
def BoundedComplexMap.sub {box : ComplexRatInterval} (f g : BoundedComplexMap box) : BoundedComplexMap box where value := fun z ↦ f.value z - g.value z eval := fun I fuel ↦ (f.eval I fuel).sub (g.eval I fuel) operationCount := f.operationCount + g.operationCount + 1 magnitudeEnvelope := f.magnitudeEnvelope + g.magnitudeEnvelope derivativeEnvelope := f.derivativeEnvelope + g.derivativeEnvelope precision := fun e ↦ max (f.precision (halfTolerance e)) (g.precision (halfTolerance e))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.sub · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:838
def mulOnBox

Box-local multiplication. The displayed envelopes are rational input data used by the local width schedule.

Definition (Lean source)
def BoundedComplexMap.mulOnBox {box : ComplexRatInterval} (f g : BoundedComplexMap box) : BoundedComplexMap box where value := fun z ↦ f.value z * g.value z eval := fun I fuel ↦ (f.eval I fuel).mul (g.eval I fuel) operationCount := f.operationCount + g.operationCount + 1 magnitudeEnvelope := 2 * f.magnitudeEnvelope * g.magnitudeEnvelope derivativeEnvelope := 2 * (f.derivativeEnvelope * g.magnitudeEnvelope + g.derivativeEnvelope * f.magnitudeEnvelope) precision := fun e ↦ let δ := productTolerance f.magnitudeEnvelope g.magnitudeEnvelope e max (f.precision δ) (g.precision δ)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.mulOnBox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:852
def expScaledOnBox

Box-local interval extension of z ↦ exp(c*z).

Definition (Lean source)
def BoundedComplexMap.expScaledOnBox (box : ComplexRatInterval) (c : ℚ × ℚ) : BoundedComplexMap box where value := fun z ↦ exp (((c.1 : ℝ) + (c.2 : ℝ) * I) * z) eval := fun I fuel ↦ Transcendental.complexExp ((ComplexRatInterval.point c.1 c.2).mul I) fuel operationCount := 8 magnitudeEnvelope := 3 ^ toNat ⌈max 0 ((|c.1| + |c.2|) * box.maxAbs)⌉ derivativeEnvelope := (|c.1| + |c.2|) * (3 ^ toNat ⌈max 0 ((|c.1| + |c.2|) * box.maxAbs)⌉) precision := fun e ↦ spectralEmpiricalMapFuel e 8 ((|c.1| + |c.2|) * (3 ^ toNat ⌈max 0 ((|c.1| + |c.2|) * box.maxAbs)⌉))
CausalSmith.Stat.SaPlmCumulantConverse.BoundedComplexMap.expScaledOnBox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:867

A tangent-corrected guarded quotient evaluator on a fixed disk.

Definition (Lean source)
numerator :
denominator :
radius :
radiusPrecision :
piPrecision :
schedule :
mapFuel :
lipschitz :
lipschitz_nonneg :
0 ≤ lipschitz
normalizationCount :
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCircleEvaluator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:881
def Valid

The correctness conditions carried by a tangent-corrected guarded quotient evaluator on a fixed disk: the numerator and denominator maps are both valid on the box; at every mesh index up to the schedule's mesh the certified radius node lies inside the box and the denominator's evaluated rectangle there has squared modulus bounded away from zero; and the circle integrand of the quotient is Lipschitz in the circle parameter with the recorded constant.

Definition (Lean source)
def BoundedCircleEvaluator.Valid {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) : Prop := ev.numerator.Valid ∧ ev.denominator.Valid ∧ (∀ k ≤ ev.schedule.mesh, (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).Subinterval box ∧ (ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).normSq.AwayFromZero) ∧ ∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, ‖CircleMesh.circleIntegrand (fun z ↦ ev.numerator.value z / ev.denominator.value z) 0 ev.radius.value s - CircleMesh.circleIntegrand (fun z ↦ ev.numerator.value z / ev.denominator.value z) 0 ev.radius.value t‖ ≤ (ev.lipschitz : ℝ) * |s - t|
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCircleEvaluator.Valid · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:894
def node

One full contour-integrand node. Its value is the guarded quotient times the tangent; the radius is not multiplied anywhere else.

Definition (Lean source)
noncomputable def BoundedCircleEvaluator.node {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) (k : ℕ) : ComplexRatInterval := let z := certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k let num := ev.numerator.eval z ev.mapFuel let den := ev.denominator.eval z ev.mapFuel let quotient := if h : den.normSq.hi < 0 ∨ 0 < den.normSq.lo then num.div den h else ComplexRatInterval.zero quotient.mul (tangentNode ev.radius ev.radiusPrecision ev.piPrecision ev.schedule k)
CausalSmith.Stat.SaPlmCumulantConverse.BoundedCircleEvaluator.node · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:915
def boundedContourEvaluate

The endpoint-complete finite quadrature uses every index k ≤ mesh, including the terminal trapezoid endpoint.

Definition (Lean source)
def boundedContourEvaluate {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) : ComplexRatInterval := CircleMesh.integralEnclosure ev.node ev.lipschitz ev.lipschitz_nonneg ev.schedule.mesh ev.schedule.mesh_pos
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourEvaluate · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:926
def boundedContourDivisor

Post-quadrature normalization by N * 2 π i; no normalization is hidden in the node family.

Definition (Lean source)
def boundedContourDivisor (count piPrecision : ℕ) : ComplexRatInterval := (twoPiIRect piPrecision).smulRat (max count 1)
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourDivisor · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:933
def boundedContourNormalize

Divides a rectangle by the post-quadrature normalizing constant, the node count times two pi times the imaginary unit, using guarded rectangle division when that divisor is certified away from zero and returning the zero rectangle otherwise.

Definition (Lean source)
noncomputable def boundedContourNormalize (I : ComplexRatInterval) (count piPrecision : ℕ) : ComplexRatInterval := let divisor := boundedContourDivisor count piPrecision if h : divisor.normSq.hi < 0 ∨ 0 < divisor.normSq.lo then I.div divisor h else ComplexRatInterval.zero
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourNormalize · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:938
def boundedContourNormalizationWidthBound

The exact rational width expression supplied by guarded rectangle division. Keeping it named makes the post-quadrature amplification visible to the branch schedule instead of hiding it in a fuel-only argument.

Definition (Lean source)
def boundedContourNormalizationWidthBound (I : ComplexRatInterval) (count piPrecision : ℕ) (δ : ℚ) : ℚ := let divisor := boundedContourDivisor count piPrecision (I.mul divisor.conj).maxAbs * divisor.normSq.width / δ ^ 2 + (I.mul divisor.conj).width / δ
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourNormalizationWidthBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:947
theorem boundedContourNormalize_contains

Whenever a rectangle encloses a complex number, the normalized rectangle encloses that number divided by the node count times two pi times the imaginary unit.

Formal statement
count piPrecision :
z :
hz :
I.Contains z
(boundedContourNormalize I count piPrecision).Contains (z / (((max count 1 : ℚ) : ℂ) * (((2 : ℝ) * Real.pi : ℂ) * I)))
Proof (Lean source)
lemma boundedContourNormalize_contains (I : ComplexRatInterval) (count piPrecision : ℕ) {z : ℂ} (hz : I.Contains z) : (boundedContourNormalize I count piPrecision).Contains (z / (((max count 1 : ℚ) : ℂ) * (((2 : ℝ) * Real.pi : ℂ) * I))) := by have haway := twoPiIRect_away piPrecision count have hdivisor := ComplexRatInterval.smulRat_sound (max count 1 : ℚ) (twoPiIRect_sound piPrecision) unfold boundedContourNormalize dsimp only split · rename_i hbranch exact ComplexRatInterval.div_sound hbranch hz hdivisor · rename_i hbranch exact (hbranch haway).elim
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourNormalize_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:956
theorem boundedContourNormalize_width

For a positive separation constant that bounds from below the squared modulus of the normalizing divisor, the normalized rectangle has width at most the explicit rational amplification bound recorded for guarded division.

Formal statement
count piPrecision :
δ :
:
0 < δ
hsep :
δ ≤ (boundedContourDivisor count piPrecision).normSq.lo
(boundedContourNormalize I count piPrecision).width
boundedContourNormalizationWidthBound I count piPrecision δ
Proof (Lean source)
lemma boundedContourNormalize_width (I : ComplexRatInterval) (count piPrecision : ℕ) (δ : ℚ) (hδ : 0 < δ) (hsep : δ ≤ (boundedContourDivisor count piPrecision).normSq.lo) : (boundedContourNormalize I count piPrecision).width ≤ boundedContourNormalizationWidthBound I count piPrecision δ := by have haway : (boundedContourDivisor count piPrecision).normSq.hi < 0 ∨ 0 < (boundedContourDivisor count piPrecision).normSq.lo := by exact twoPiIRect_away piPrecision count unfold boundedContourNormalize dsimp only split · rename_i hbranch simpa [boundedContourNormalizationWidthBound] using (ComplexRatInterval.div_width hbranch hδ hsep) · rename_i hbranch exact (hbranch haway).elim
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourNormalize_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:974
theorem boundedContourNormalize_width_le

For a positive separation constant that bounds from below the squared modulus of the normalizing divisor, and a target that the explicit amplification bound does not exceed, the normalized rectangle has width at most that target.

Formal statement
count piPrecision :
δ target :
:
0 < δ
hsep :
δ ≤ (boundedContourDivisor count piPrecision).normSq.lo
hbound :
boundedContourNormalizationWidthBound I count piPrecision δ ≤ target
(boundedContourNormalize I count piPrecision).width ≤ target
Proof (Lean source)
lemma boundedContourNormalize_width_le (I : ComplexRatInterval) (count piPrecision : ℕ) (δ target : ℚ) (hδ : 0 < δ) (hsep : δ ≤ (boundedContourDivisor count piPrecision).normSq.lo) (hbound : boundedContourNormalizationWidthBound I count piPrecision δ ≤ target) : (boundedContourNormalize I count piPrecision).width ≤ target := (boundedContourNormalize_width I count piPrecision δ hδ hsep).trans hbound
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourNormalize_width_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:994
theorem certifiedRadiusNode_sound

For any mesh index no larger than the schedule's mesh, the certified radius node encloses the point of the circle of that radius, centered at the origin, at the corresponding mesh parameter.

Formal statement
radius :
precision :
schedule :
k :
hk :
k ≤ schedule.mesh
(certifiedRadiusNode radius precision schedule k).Contains (CircleMesh.circleMap 0 radius.value (CircleMesh.meshPoint schedule.mesh k))
Proof (Lean source)
lemma certifiedRadiusNode_sound (radius : CertifiedReal) (precision : PosRat) (schedule : Schedule) {k : ℕ} (hk : k ≤ schedule.mesh) : (certifiedRadiusNode radius precision schedule k).Contains (CircleMesh.circleMap 0 radius.value (CircleMesh.meshPoint schedule.mesh k)) := by have hr := bankRadiusRect_sound radius precision have hu := circleNode_sound 1 schedule hk have hmul := ComplexRatInterval.mul_sound hr hu simpa [certifiedRadiusNode, exactCircleNode, CircleMesh.circleMap, CircleMesh.meshPoint] using hmul
CausalSmith.Stat.SaPlmCumulantConverse.certifiedRadiusNode_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1004
theorem certifiedRadiusNode_width

For a mesh index no larger than the schedule's mesh, given a bound on the largest modulus attained by the refined radius rectangle, a bound on the width of the unit-radius circle node, and the matching bound of one plus that width on the node's largest modulus, the certified radius node has width at most twice the sum of the modulus bound times the width bound and the shifted modulus bound times the radius precision.

Formal statement
radius :
precision :
schedule :
U w :
k :
hk :
k ≤ schedule.mesh
hU :
(bankRadiusRect radius precision).maxAbs ≤ U
hw :
(circleNode 1 schedule k).width ≤ w
hunit :
(circleNode 1 schedule k).maxAbs ≤ 1 + w
(certifiedRadiusNode radius precision schedule k).width
≤ 2 * (U * w + (1 + w) * precision.1)
Proof (Lean source)
lemma certifiedRadiusNode_width (radius : CertifiedReal) (precision : PosRat) (schedule : Schedule) (U w : ℚ) {k : ℕ} (hk : k ≤ schedule.mesh) (hU : (bankRadiusRect radius precision).maxAbs ≤ U) (hw : (circleNode 1 schedule k).width ≤ w) (hunit : (circleNode 1 schedule k).maxAbs ≤ 1 + w) : (certifiedRadiusNode radius precision schedule k).width ≤ 2 * (U * w + (1 + w) * precision.1) := by have hraw := ComplexRatInterval.mul_width (bankRadiusRect radius precision) (circleNode 1 schedule k) have hrw := bankRadiusRect_width radius precision have hr0 : 0 ≤ (bankRadiusRect radius precision).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hu0 : 0 ≤ (circleNode 1 schedule k).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hrWidth0 : 0 ≤ (bankRadiusRect radius precision).width := (RatInterval.width_nonneg _).trans (le_max_left _ _) have huWidth0 : 0 ≤ (circleNode 1 schedule k).width := (RatInterval.width_nonneg _).trans (le_max_left _ _) unfold certifiedRadiusNode calc ((bankRadiusRect radius precision).mul (circleNode 1 schedule k)).width ≤ 2 * ((bankRadiusRect radius precision).maxAbs * (circleNode 1 schedule k).width + (circleNode 1 schedule k).maxAbs * (bankRadiusRect radius precision).width) := hraw _ ≤ 2 * (U * w + (1 + w) * precision.1) := by nlinarith [mul_le_mul hU hw huWidth0 (by linarith), mul_le_mul hunit hrw hrWidth0 (by linarith)]
CausalSmith.Stat.SaPlmCumulantConverse.certifiedRadiusNode_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1017
theorem tangentNode_sound

For any mesh index no larger than the schedule's mesh, the tangent rectangle encloses the tangent vector of the circle of that radius at the corresponding mesh parameter.

Formal statement
radius :
radiusPrecision :
piPrecision :
schedule :
k :
hk :
k ≤ schedule.mesh
(tangentNode radius radiusPrecision piPrecision schedule k).Contains (CircleMesh.circleTangent radius.value (CircleMesh.meshPoint schedule.mesh k))
Proof (Lean source)
lemma tangentNode_sound (radius : CertifiedReal) (radiusPrecision : PosRat) (piPrecision : ℕ) (schedule : Schedule) {k : ℕ} (hk : k ≤ schedule.mesh) : (tangentNode radius radiusPrecision piPrecision schedule k).Contains (CircleMesh.circleTangent radius.value (CircleMesh.meshPoint schedule.mesh k)) := by have htwoPi : (twoPiIRect piPrecision).Contains (((2 : ℝ) * Real.pi : ℂ) * I) := by constructor · simpa [twoPiIRect] using RatInterval.point_sound (0 : ℚ) · simpa [twoPiIRect] using RatInterval.mul_sound (RatInterval.point_sound (2 : ℚ)) (Transcendental.piInterval_sound piPrecision) have hnode := certifiedRadiusNode_sound radius radiusPrecision schedule hk have hmul := ComplexRatInterval.mul_sound htwoPi hnode unfold tangentNode convert hmul using 1 simp only [CircleMesh.circleTangent, CircleMesh.circleMap, CircleMesh.meshPoint, zero_add] ring_nf norm_num
theorem boundedContourEvaluate_contains

For an evaluator satisfying its validity conditions, the finite endpoint-complete quadrature rectangle encloses the true contour integral of the numerator over denominator quotient around the circle of the evaluator's radius.

Formal statement
hvalid :
ev.Valid
(boundedContourEvaluate ev).Contains (CircleMesh.circleContourIntegral (fun z ↦ ev.numerator.value z / ev.denominator.value z) 0 ev.radius.value)
Proof (Lean source)
lemma boundedContourEvaluate_contains {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) (hvalid : ev.Valid) : (boundedContourEvaluate ev).Contains (CircleMesh.circleContourIntegral (fun z ↦ ev.numerator.value z / ev.denominator.value z) 0 ev.radius.value) := by rcases hvalid with ⟨hnumValid, hdenValid, hboundary, hLip⟩ apply CircleMesh.circleContourIntegral_enclosed ev.lipschitz_nonneg ev.schedule.mesh_pos hLip intro k hk have hz := certifiedRadiusNode_sound ev.radius ev.radiusPrecision ev.schedule hk rcases hboundary k hk with ⟨hbox, haway⟩ have hnum := (hnumValid.2.2 hbox hz).1 ev.mapFuel have hden := (hdenValid.2.2 hbox hz).1 ev.mapFuel have hquot := ComplexRatInterval.div_sound haway hnum hden have htangent := tangentNode_sound ev.radius ev.radiusPrecision ev.piPrecision ev.schedule hk dsimp only [BoundedCircleEvaluator.node] split · simpa [CircleMesh.circleIntegrand] using ComplexRatInterval.mul_sound hquot htangent · contradiction
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourEvaluate_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1076
theorem boundedContourEvaluate_width

For an evaluator satisfying its validity conditions and a common width bound met by every node rectangle up to the mesh, the quadrature rectangle has width at most that node width plus the Lipschitz constant divided by the mesh count.

Formal statement
hvalid :
ev.Valid
nodeWidth :
hnode :
∀ k ≤ ev.schedule.mesh, (ev.node k).width ≤ nodeWidth
(boundedContourEvaluate ev).width ≤ nodeWidth + ev.lipschitz / ev.schedule.mesh
Proof (Lean source)
lemma boundedContourEvaluate_width {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) (hvalid : ev.Valid) (nodeWidth : ℚ) (hnode : ∀ k ≤ ev.schedule.mesh, (ev.node k).width ≤ nodeWidth) : (boundedContourEvaluate ev).width ≤ nodeWidth + ev.lipschitz / ev.schedule.mesh := by have hnode0 := hnode 0 (zero_le ev.schedule.mesh) have hw : 0 ≤ nodeWidth := (RatInterval.width_nonneg (ev.node 0).re).trans ((le_max_left _ _).trans hnode0) have hcoords : ∀ k ≤ ev.schedule.mesh, (ev.node k).re.width ≤ nodeWidth ∧ (ev.node k).im.width ≤ nodeWidth := by intro k hk have hk' := hnode k hk exact ⟨(le_max_left _ _).trans hk', (le_max_right _ _).trans hk'⟩ have hwidth := CircleMesh.integralEnclosure_width hw ev.lipschitz_nonneg ev.schedule.mesh_pos hcoords unfold boundedContourEvaluate ComplexRatInterval.width exact max_le hwidth.1 hwidth.2
CausalSmith.Stat.SaPlmCumulantConverse.boundedContourEvaluate_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1101

Executable rational endpoint operations. No semantic real or complex value is stored in this table: represented inputs are the value-opaque local approximant structures and their meanings are supplied externally.

Definition (Lean source)
realRefine :
realAdd :
realSub :
realMul :
realAbs :
sqrtInterval :
complexNormSq :
complexNorm :
guardedDiv :
(I J : ComplexRatInterval) → (m : ℚ) → 0 < m → m ≤ (cxModulusSq J).lo → ComplexRatInterval
piInterval :
ℕ → RatInterval
expInterval :
sinInterval :
cosInterval :
complexExp :
expNameApprox :
sinNameApprox :
cosNameApprox :
complexExpNameApprox :
radiusNode :
tangentNode :
finiteInfimum :
(nodes : ℕ → RatInterval) → (L : ℚ) → 0 ≤ L → (mesh : ℕ) → 0 < mesh → RatInterval
finiteSupremum :
(nodes : ℕ → RatInterval) → (L : ℚ) → 0 ≤ L → (mesh : ℕ) → 0 < mesh → RatInterval
quadrature :
(nodes : ℕ → ComplexRatInterval) → (L : ℚ) → 0
≤ L → (mesh : ℕ) → 0 < mesh → ComplexRatInterval
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1123
def canonicalRealAbsInterval

The square-free endpoint rule used by the concrete bounded build for the absolute value of a real interval.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRealAbsInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1163
def fuelTrace

The complete, lossless resource trace is the schedule itself.

Definition (Lean source)
def CertifiedComplexOperations.fuelTrace (_operations : CertifiedComplexOperations) (name : RationalComplexNodeApproximants) (input : ComplexRatInterval) (L : ℚ) (e : PosRat) (endpointOperations : ℕ) : NodeEvaluationSchedule := nodeEvaluationScheduleProgram name input L e endpointOperations
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.fuelTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1167
def nodeEnumerator

The list of mesh indices a node evaluation schedule visits: every index from zero up to and including the schedule's mesh fuel, so the terminal trapezoid endpoint is enumerated.

Definition (Lean source)
def CertifiedComplexOperations.nodeEnumerator (_operations : CertifiedComplexOperations) (schedule : NodeEvaluationSchedule) : List ℕ := List.range (schedule.meshFuel + 1)
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.nodeEnumerator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1173
def IsCanonical

Exact executable algorithms required by the paper's bounded-build specification. This prevents an arbitrary sound operation table from being mistaken for the specified Machin/Taylor/bisection implementation.

Definition (Lean source)
def CertifiedComplexOperations.IsCanonical (operations : CertifiedComplexOperations) : Prop := (∀ x fuel, operations.realRefine x fuel = x.approx fuel) ∧ (∀ I J, operations.realAdd I J = I.add J) ∧ (∀ I J, operations.realSub I J = I.sub J) ∧ (∀ I J, operations.realMul I J = I.mul J) ∧ (∀ I, operations.realAbs I = canonicalRealAbsInterval I) ∧ (∀ I fuel, operations.sqrtInterval I fuel = sqrtBisectInterval I fuel) ∧ (∀ I J, operations.complexAdd I J = I.add J) ∧ (∀ I J, operations.complexSub I J = I.sub J) ∧ (∀ I, operations.complexConj I = I.conj) ∧ (∀ I J, operations.complexMul I J = I.mul J) ∧ (∀ I, operations.complexNormSq I = cxModulusSq I) ∧ (∀ I fuel, operations.complexNorm I fuel = cxModulus I fuel) ∧ (∀ I J m hm hguard, operations.guardedDiv I J m hm hguard = cxDiv I J m hm hguard) ∧ operations.piInterval = machinPiInterval ∧ (∀ I fuel, operations.expInterval I fuel = expTaylorInterval I fuel) ∧ (∀ I fuel, operations.sinInterval I fuel = sinInterval I fuel) ∧ (∀ I fuel, operations.cosInterval I fuel = cosInterval I fuel) ∧ (∀ I fuel, operations.complexExp I fuel = cexpInterval I fuel) ∧ (∀ x fuel, operations.expNameApprox x fuel = realOutputSequence expTaylorInterval x fuel) ∧ (∀ x fuel, operations.sinNameApprox x fuel = realOutputSequence sinInterval x fuel) ∧ (∀ x fuel, operations.cosNameApprox x fuel = realOutputSequence cosInterval x fuel) ∧ (∀ z fuel, operations.complexExpNameApprox z fuel = complexExpOutputSequence z fuel) ∧ (∀ radius N q schedule, operations.radiusNode radius N q schedule = circleNodeFromPositiveName radius N q schedule) ∧ (∀ radius N q schedule, operations.tangentNode radius N q schedule = circleTangentFromPositiveName radius N q schedule) ∧ (∀ name schedule k, operations.evaluateNode name schedule k = evaluateComplexNode name schedule k) ∧ (∀ nodes L hL mesh hmesh, operations.finiteInfimum nodes L hL mesh hmesh = CircleMesh.infEnclosure nodes L hL mesh hmesh) ∧ (∀ nodes L hL mesh hmesh, operations.finiteSupremum nodes L hL mesh hmesh = CircleMesh.supEnclosure nodes L hL mesh hmesh) ∧ (∀ nodes L hL mesh hmesh, operations.quadrature nodes L hL mesh hmesh = CircleMesh.integralEnclosure nodes L hL mesh hmesh)
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.IsCanonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1179
theorem realAdd_eq

When an operation table is the canonical one specified by the paper's bounded build, its real interval addition is the ordinary endpointwise addition of rational intervals.

Formal statement
h :
operations.IsCanonical
I J :
operations.realAdd I J = I.add J
Proof (Lean source)
lemma CertifiedComplexOperations.IsCanonical.realAdd_eq {operations : CertifiedComplexOperations} (h : operations.IsCanonical) (I J : RatInterval) : operations.realAdd I J = I.add J := h.2.1 I J
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.IsCanonical.realAdd_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1231
theorem complexAdd_eq

When an operation table is the canonical one specified by the paper's bounded build, its complex interval addition is the ordinary coordinatewise addition of rational rectangles.

Formal statement
h :
operations.IsCanonical
operations.complexAdd I J = I.add J
Proof (Lean source)
lemma CertifiedComplexOperations.IsCanonical.complexAdd_eq {operations : CertifiedComplexOperations} (h : operations.IsCanonical) (I J : ComplexRatInterval) : operations.complexAdd I J = I.add J := h.2.2.2.2.2.2.1 I J
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.IsCanonical.complexAdd_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1238
theorem finiteInfimum_eq

When an operation table is the canonical one specified by the paper's bounded build, its finite-infimum routine applied to a family of node intervals with a nonnegative Lipschitz constant and a positive mesh count returns the standard circle-mesh infimum enclosure.

Formal statement
h :
operations.IsCanonical
nodes :
ℕ → RatInterval
L :
hL :
0 ≤ L
mesh :
hmesh :
0 < mesh
operations.finiteInfimum nodes L hL mesh hmesh
= CircleMesh.infEnclosure nodes L hL mesh hmesh
Proof (Lean source)
lemma CertifiedComplexOperations.IsCanonical.finiteInfimum_eq {operations : CertifiedComplexOperations} (h : operations.IsCanonical) (nodes : ℕ → RatInterval) (L : ℚ) (hL : 0 ≤ L) (mesh : ℕ) (hmesh : 0 < mesh) : operations.finiteInfimum nodes L hL mesh hmesh = CircleMesh.infEnclosure nodes L hL mesh hmesh := by unfold CertifiedComplexOperations.IsCanonical at h aesop
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.IsCanonical.finiteInfimum_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1246
theorem quadrature_eq

When an operation table is the canonical one specified by the paper's bounded build, its quadrature routine applied to a family of node rectangles with a nonnegative Lipschitz constant and a positive mesh count returns the standard circle-mesh integral enclosure.

Formal statement
h :
operations.IsCanonical
nodes :
L :
hL :
0 ≤ L
mesh :
hmesh :
0 < mesh
operations.quadrature nodes L hL mesh hmesh
= CircleMesh.integralEnclosure nodes L hL mesh hmesh
Proof (Lean source)
lemma CertifiedComplexOperations.IsCanonical.quadrature_eq {operations : CertifiedComplexOperations} (h : operations.IsCanonical) (nodes : ℕ → ComplexRatInterval) (L : ℚ) (hL : 0 ≤ L) (mesh : ℕ) (hmesh : 0 < mesh) : operations.quadrature nodes L hL mesh hmesh = CircleMesh.integralEnclosure nodes L hL mesh hmesh := by unfold CertifiedComplexOperations.IsCanonical at h aesop
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedComplexOperations.IsCanonical.quadrature_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1259

Full conditional build carrier for represented execution. It bundles the executable rational/complex arithmetic, guarded division, constructed transcendentals, circle nodes, finite extrema and quadrature, together with semantic soundness, effective fuel/modulus, endpoint, trace, and compilation certificates. Paper-specific spectral maps and schedules remain local derived facts and are not fields of this generic carrier.

Definition (Lean source)
canonicalAlgorithms :
operations.IsCanonical
realRefine_sound :
∀ (name : RationalRealApproximants) (x : ℝ)
if
name.Represents x
then
∀ fuel, (operations.realRefine name fuel).Contains x
realRefine_width :
∀ (name : RationalRealApproximants) (e : PosRat),
(operations.realRefine name (name.modulus e)).width ≤ e.1
realAdd_sound :
∀ {I J : RatInterval} {x y : ℝ}
if
I.Contains x
and
J.Contains y
then
(operations.realAdd I J).Contains (x + y)
realSub_sound :
∀ {I J : RatInterval} {x y : ℝ}
if
I.Contains x
and
J.Contains y
then
(operations.realSub I J).Contains (x - y)
realMul_sound :
∀ {I J : RatInterval} {x y : ℝ}
if
I.Contains x
and
J.Contains y
then
(operations.realMul I J).Contains (x * y)
realAbs_sound :
∀ {I : RatInterval} {x : ℝ}
if
I.Contains x
then
(operations.realAbs I).Contains |x|
sqrt_sound :
∀ {I : RatInterval} (hI : 0 ≤ I.lo) {x : ℝ}
if
I.Contains x
and
0 ≤ x
then
∀ fuel, (operations.sqrtInterval I fuel).Contains (sqrt x)
sqrt_width :
∀ x fuel,
sqrtHiBisect x fuel - sqrtLoBisect x fuel
≤ ((sqrtInitial x).hi - (sqrtInitial x).lo) * (1 / 2 : ℚ) ^ fuel
complexAdd_sound :
∀ {I J : ComplexRatInterval} {z w : ℂ}
if
I.Contains z
and
J.Contains w
then
(operations.complexAdd I J).Contains (z + w)
complexSub_sound :
∀ {I J : ComplexRatInterval} {z w : ℂ}
if
I.Contains z
and
J.Contains w
then
(operations.complexSub I J).Contains (z - w)
complexConj_sound :
∀ {I : ComplexRatInterval} {z : ℂ}
if
I.Contains z
then
(operations.complexConj I).Contains (star z)
complexMul_sound :
∀ {I J : ComplexRatInterval} {z w : ℂ}
if
I.Contains z
and
J.Contains w
then
(operations.complexMul I J).Contains (z * w)
complexNormSq_sound :
∀ {I : ComplexRatInterval} {z : ℂ}
if
I.Contains z
then
(operations.complexNormSq I).Contains (Complex.normSq z)
complexNorm_sound :
∀ {I : ComplexRatInterval} {z : ℂ}
if
I.Contains z
then
∀ fuel, (operations.complexNorm I fuel).Contains ‖z‖
guardedDiv_sound :
∀ {I J : ComplexRatInterval} {z w : ℂ} (m : ℚ) (hm : 0 < m) (hguard : m ≤ (cxModulusSq J).lo)
if
I.Contains z
and
J.Contains w
then
(operations.guardedDiv I J m hm hguard).Contains (z / w)
pi_sound :
∀ fuel, (operations.piInterval fuel).Contains pi
pi_nested :
∀ fuel, (operations.piInterval (fuel + 1)).Subinterval (operations.piInterval fuel)
pi_effective :
∀ e, (operations.piInterval (machinPiFuel e)).width ≤ e.1
exp_sound :
∀ {I : RatInterval} {x : ℝ}
if
I.Contains x
then
∀ fuel, (operations.expInterval I fuel).Contains (exp x)
sin_sound :
∀ {I : RatInterval} {x : ℝ}
if
I.Contains x
then
∀ fuel, (operations.sinInterval I fuel).Contains (sin x)
cos_sound :
∀ {I : RatInterval} {x : ℝ}
if
I.Contains x
then
∀ fuel, (operations.cosInterval I fuel).Contains (cos x)
complexExp_sound :
∀ {I : ComplexRatInterval} {z : ℂ}
if
I.Contains z
then
∀ fuel, (operations.complexExp I fuel).Contains (exp z)
complexExp_nested :
∀ I fuel, (operations.complexExp I (fuel + 1)).Subinterval (operations.complexExp I fuel)
complexExpNameContract :
finiteInfimum_sound :
∀ {f : ℝ → ℝ} {nodes : ℕ → RatInterval} {L : ℚ} (hL : 0 ≤ L) {mesh : ℕ} (hmesh : 0 < mesh)
if
(∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |f s - f t| ≤ (L : ℝ) * |s - t|)
and
(∀ k ≤ mesh, (nodes k).Contains (f (CircleMesh.meshPoint mesh k)))
then
(operations.finiteInfimum nodes L hL mesh hmesh).Contains (sInf (f '' Icc (0 : ℝ) 1))
finiteSupremum_sound :
∀ {f : ℝ → ℝ} {nodes : ℕ → RatInterval} {L : ℚ} (hL : 0 ≤ L) {mesh : ℕ} (hmesh : 0 < mesh)
if
(∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |f s - f t| ≤ (L : ℝ) * |s - t|)
and
(∀ k ≤ mesh, (nodes k).Contains (f (CircleMesh.meshPoint mesh k)))
then
(operations.finiteSupremum nodes L hL mesh hmesh).Contains (sSup (f '' Icc (0 : ℝ) 1))
quadrature_sound :
∀ {g : ℝ → ℂ} {nodes : ℕ → ComplexRatInterval} {L : ℚ} (hL : 0 ≤ L) {mesh : ℕ} (hmesh : 0 < mesh)
if
(∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, ‖g s - g t‖ ≤ (L : ℝ) * |s - t|)
and
(∀ k ≤ mesh, (nodes k).Contains (g (CircleMesh.meshPoint mesh k)))
then
(operations.quadrature nodes L hL mesh hmesh).Contains (∫ u in (0 : ℝ)..1, g u)
endpointContract :
∀ schedule : NodeEvaluationSchedule,
operations.nodeEnumerator schedule = List.range (schedule.meshFuel + 1) ∧
∀ k ∈ operations.nodeEnumerator schedule, k ≤ schedule.meshFuel
traceFuelContract :
∀ name input L e endpointOperations,
operations.fuelTrace name input L e endpointOperations
= nodeEvaluationScheduleProgram name input L e endpointOperations
CausalSmith.Stat.SaPlmCumulantConverse.ComplexCertifiedIntervalArithmetic · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1272
def complexCertifiedIntervalArithmetic Definition 16 in the paper ↗

Conditional carrier for represented execution.

Definition (Lean source)
-- @node: def:certified-contour-arithmetic-substrate def complexCertifiedIntervalArithmetic : Type := ComplexCertifiedIntervalArithmetic
CausalSmith.Stat.SaPlmCumulantConverse.complexCertifiedIntervalArithmetic · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/BoundedCertifiedComplex.lean:1366
Helpers.CertifiedComplex 35 declarations This file supplies the complex-algebra half missing from the promoted real certified interval API.

Certified complex rectangle arithmetic

This file supplies the complex-algebra half missing from the promoted real certified interval API. Every executable operation uses rational endpoints; exact complex values occur only in the semantic soundness contracts.

def cxSub

Coordinatewise complex rectangle subtraction.

Definition (Lean source)
def cxSub (I J : ComplexRatInterval) : ComplexRatInterval := ⟨I.re.sub J.re, I.im.sub J.im⟩
def cxConj

Complex conjugation negates the imaginary interval.

Definition (Lean source)
def cxConj (I : ComplexRatInterval) : ComplexRatInterval := ⟨I.re, I.im.neg⟩
def cxMul

Outward complex multiplication assembled from the promoted real API.

Definition (Lean source)
def cxMul (I J : ComplexRatInterval) : ComplexRatInterval := ⟨(I.re.mul J.re).sub (I.im.mul J.im), (I.re.mul J.im).add (I.im.mul J.re)⟩
def sqLo

Rational lower bound for the square of every point of an interval.

Definition (Lean source)
def sqLo (I : RatInterval) : ℚ := if I.lo ≤ 0 ∧ 0 ≤ I.hi then 0 else min (I.lo ^ 2) (I.hi ^ 2)
def sqHi

Rational upper bound for the square of every point of an interval.

Definition (Lean source)
def sqHi (I : RatInterval) : ℚ := max (I.lo ^ 2) (I.hi ^ 2)
def cxModulusSq

Squared modulus enclosure obtained by adding coordinate-square bounds.

Definition (Lean source)
def cxModulusSq (I : ComplexRatInterval) : RatInterval := ⟨sqLo I.re + sqLo I.im, sqHi I.re + sqHi I.im, add_le_add (sqLo_le_sqHi I.re) (sqLo_le_sqHi I.im)⟩

One rational bisection state.

Definition (Lean source)
lo :
hi :
def sqrtInitial

Initial nonnegative bracket used by the square-root routines.

Definition (Lean source)
def sqrtInitial (x : ℚ) : SqrtBracket := ⟨0, max 1 x⟩
def sqrtLoStep

Bisection from below, using only a rational square comparison.

Definition (Lean source)
def sqrtLoStep (x : ℚ) (b : SqrtBracket) : SqrtBracket := let mid := (b.lo + b.hi) / 2 if mid ^ 2 ≤ x then ⟨mid, b.hi⟩ else ⟨b.lo, mid⟩
def sqrtHiStep

Bisection from above, using only a rational square comparison.

Definition (Lean source)
def sqrtHiStep (x : ℚ) (b : SqrtBracket) : SqrtBracket := let mid := (b.lo + b.hi) / 2 if x ≤ mid ^ 2 then ⟨b.lo, mid⟩ else ⟨mid, b.hi⟩
def sqrtLoBisect

Fixed-fuel lower square-root bisection.

Definition (Lean source)
def sqrtLoBisect (x : ℚ) (fuel : ℕ) : ℚ := (iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo
def sqrtHiBisect

Fixed-fuel upper square-root bisection.

Definition (Lean source)
def sqrtHiBisect (x : ℚ) (fuel : ℕ) : ℚ := (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi
def sqrtBisectInterval

Rational bisection enclosure for square roots on a nonnegative interval. The two endpoint bisections are deliberately exposed, so the executable algorithm is fixed independently of the promoted interval API.

Definition (Lean source)
def sqrtBisectInterval (I : RatInterval) (fuel : ℕ) : RatInterval := ⟨min (sqrtLoBisect I.lo fuel) (sqrtHiBisect I.hi fuel), max (sqrtLoBisect I.lo fuel) (sqrtHiBisect I.hi fuel), min_le_max⟩
CausalSmith.Stat.SaPlmCumulantConverse.sqrtBisectInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:75
def cxModulus

Fixed-fuel rational enclosure of the modulus of a complex rectangle.

Definition (Lean source)
def cxModulus (I : ComplexRatInterval) (fuel : ℕ) : RatInterval := let S := cxModulusSq I ⟨min (sqrtLoBisect S.lo fuel) (sqrtHiBisect S.hi fuel), max (sqrtLoBisect S.lo fuel) (sqrtHiBisect S.hi fuel), min_le_max⟩
def cxDivGuarded

Guarded complex division via multiplication by the conjugate and an outward reciprocal of the squared modulus interval.

Definition (Lean source)
def cxDivGuarded (I J : ComplexRatInterval) (m : ℚ) (hm : 0 < m) (hguard : m ≤ (cxModulusSq J).lo) : ComplexRatInterval := let S := cxModulusSq J have hS : S.AwayFromZero := inr (hm.trans_le hguard) let numerator := cxMul I (cxConj J) ⟨numerator.re.div S hS, numerator.im.div S hS⟩
def cxDiv

Public exact guarded-division primitive used by the bounded carrier.

Definition (Lean source)
def absInterval

Endpoint rule for the absolute value of a real interval.

Definition (Lean source)
def absInterval (I : RatInterval) : RatInterval := if h : I.lo ≤ 0 ∧ 0 ≤ I.hi then ⟨0, max |I.lo| |I.hi|, (abs_nonneg I.lo).trans (le_max_left _ _)⟩ else ⟨min |I.lo| |I.hi|, max |I.lo| |I.hi|, min_le_max⟩
theorem cxSub_sound

Rectangle subtraction is sound: if a complex number lies in the first rectangle and a second complex number lies in the second rectangle, then their difference lies in the rectangle obtained by subtracting the two rectangles coordinate by coordinate.

Formal statement
z w :
hz :
I.Contains z
hw :
J.Contains w
(cxSub I J).Contains (z - w)
Proof (Lean source)
lemma cxSub_sound {I J : ComplexRatInterval} {z w : ℂ} (hz : I.Contains z) (hw : J.Contains w) : (cxSub I J).Contains (z - w) := by exact ⟨RatInterval.sub_sound hz.1 hw.1, RatInterval.sub_sound hz.2 hw.2⟩
theorem cxConj_sound

Conjugation of rectangles is sound: if a complex number lies in a rectangle, then its complex conjugate lies in the rectangle whose imaginary side has been negated and whose real side is unchanged.

Formal statement
z :
hz :
I.Contains z
(cxConj I).Contains (starRingEnd ℂ z)
Proof (Lean source)
lemma cxConj_sound {I : ComplexRatInterval} {z : ℂ} (hz : I.Contains z) : (cxConj I).Contains (starRingEnd ℂ z) := by exact ⟨hz.1, RatInterval.neg_sound hz.2⟩
theorem cxMul_sound

Rectangle multiplication is sound: if a complex number lies in the first rectangle and a second complex number lies in the second rectangle, then their product lies in the outward product rectangle, whose real side encloses the real part built from the cross-products of the coordinate intervals and whose imaginary side encloses the corresponding imaginary part.

Formal statement
z w :
hz :
I.Contains z
hw :
J.Contains w
(cxMul I J).Contains (z * w)
Proof (Lean source)
lemma cxMul_sound {I J : ComplexRatInterval} {z w : ℂ} (hz : I.Contains z) (hw : J.Contains w) : (cxMul I J).Contains (z * w) := by constructor · exact RatInterval.sub_sound (RatInterval.mul_sound hz.1 hw.1) (RatInterval.mul_sound hz.2 hw.2) · exact RatInterval.add_sound (RatInterval.mul_sound hz.1 hw.2) (RatInterval.mul_sound hz.2 hw.1)
theorem sq_bounds_sound

The rational square bounds are sound: if a real number lies in a rational interval, then its square is at least the interval's rational lower square bound and at most its rational upper square bound.

Formal statement
x :
hx :
I.Contains x
(sqLo I : ℝ) ≤ x ^ 2 ∧ x ^ 2 ≤ (sqHi I : ℝ)
Proof (Lean source)
lemma sq_bounds_sound {I : RatInterval} {x : ℝ} (hx : I.Contains x) : (sqLo I : ℝ) ≤ x ^ 2 ∧ x ^ 2 ≤ (sqHi I : ℝ) := by have hlohi : (I.lo : ℝ) ≤ I.hi := by exact_mod_cast I.lo_le_hi have hupper : x ^ 2 ≤ max ((I.lo : ℝ) ^ 2) ((I.hi : ℝ) ^ 2) := by by_cases hx0 : 0 ≤ x · apply le_max_of_le_right nlinarith [hx.2] · have hx0' : x ≤ 0 := le_of_not_ge hx0 apply le_max_of_le_left nlinarith [hx.1] unfold sqLo sqHi split_ifs with h · simp only [Rat.cast_zero, Rat.cast_max, Rat.cast_pow] exact ⟨sq_nonneg x, hupper⟩ · rcases not_and_or.mp h with hlo | hhi · have hloposQ : (0 : ℚ) < I.lo := lt_of_not_ge hlo have hlopos : (0 : ℝ) < I.lo := by exact_mod_cast hloposQ have hxpos : 0 < x := hlopos.trans_le hx.1 simp only [Rat.cast_min, Rat.cast_max, Rat.cast_pow] constructor · apply min_le_of_left_le nlinarith [hx.1] · exact hupper · have hhinegQ : I.hi < (0 : ℚ) := lt_of_not_ge hhi have hhineg : (I.hi : ℝ) < 0 := by exact_mod_cast hhinegQ have hxneg : x < 0 := hx.2.trans_lt hhineg simp only [Rat.cast_min, Rat.cast_max, Rat.cast_pow] constructor · apply min_le_of_right_le nlinarith [hx.2] · exact hupper

The starting bracket of the square-root bisection is valid: for a nonnegative rational number, the initial bracket has a nonnegative lower endpoint, its lower endpoint does not exceed its upper endpoint, the square of its lower endpoint is at most the number, and the number is at most the square of its upper endpoint.

Formal statement
x :
hx :
0 ≤ x
0 ≤ (sqrtInitial x).lo ∧
(sqrtInitial x).lo ≤ (sqrtInitial x).hi ∧
(sqrtInitial x).lo ^ 2 ≤ x ∧
x ≤ (sqrtInitial x).hi ^ 2
Proof (Lean source)
lemma sqrtInitial_brackets {x : ℚ} (hx : 0 ≤ x) : 0 ≤ (sqrtInitial x).lo ∧ (sqrtInitial x).lo ≤ (sqrtInitial x).hi ∧ (sqrtInitial x).lo ^ 2 ≤ x ∧ x ≤ (sqrtInitial x).hi ^ 2 := by simp only [sqrtInitial] constructor · norm_num constructor · simp constructor · simpa using hx · by_cases hx1 : x ≤ 1 · rw [max_eq_left (show (1 : ℚ) ≥ x from hx1)] nlinarith · rw [max_eq_right (le_of_not_ge hx1)] nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.sqrtInitial_brackets · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:178

One bisection step preserves the bracketing invariant: if a bracket has a nonnegative lower endpoint, is correctly ordered, and its endpoint squares straddle the target number, then the bracket produced by one lower bisection step again has a nonnegative lower endpoint, is correctly ordered, and has endpoint squares straddling the same number.

Formal statement
x :
hb :
0 ≤ b.lo ∧ b.lo ≤ b.hi ∧ b.lo ^ 2 ≤ x ∧ x ≤ b.hi ^ 2
0 ≤ (sqrtLoStep x b).lo ∧
(sqrtLoStep x b).lo ≤ (sqrtLoStep x b).hi ∧
(sqrtLoStep x b).lo ^ 2 ≤ x ∧
x ≤ (sqrtLoStep x b).hi ^ 2
Proof (Lean source)
lemma sqrtLoStep_brackets {x : ℚ} {b : SqrtBracket} (hb : 0 ≤ b.lo ∧ b.lo ≤ b.hi ∧ b.lo ^ 2 ≤ x ∧ x ≤ b.hi ^ 2) : 0 ≤ (sqrtLoStep x b).lo ∧ (sqrtLoStep x b).lo ≤ (sqrtLoStep x b).hi ∧ (sqrtLoStep x b).lo ^ 2 ≤ x ∧ x ≤ (sqrtLoStep x b).hi ^ 2 := by simp only [sqrtLoStep] split_ifs with hmid <;> dsimp · refine ⟨by linarith [hb.1, hb.2.1], by linarith [hb.2.1], hmid, hb.2.2.2⟩ · exact ⟨hb.1, by linarith [hb.2.1], hb.2.2.1, le_of_not_ge hmid⟩
CausalSmith.Stat.SaPlmCumulantConverse.sqrtLoStep_brackets · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:204

The bracketing invariant survives any number of bisection steps: for a nonnegative rational number, after iterating the lower bisection step any fixed number of times starting from the initial bracket, the resulting bracket still has a nonnegative lower endpoint, is correctly ordered, and its endpoint squares straddle the number.

Formal statement
x :
hx :
0 ≤ x
fuel :
0 ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo ∧
(iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo
≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi ∧
(iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo ^ 2 ≤ x ∧
x ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi ^ 2
Proof (Lean source)
lemma sqrtLoIterate_brackets {x : ℚ} (hx : 0 ≤ x) (fuel : ℕ) : 0 ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo ∧ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi ∧ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).lo ^ 2 ≤ x ∧ x ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi ^ 2 := by induction fuel with | zero => simpa using sqrtInitial_brackets hx | succ fuel ih => rw [Function.iterate_succ_apply, ← (Function.Commute.refl (sqrtLoStep x)).iterate_right fuel (sqrtInitial x)] exact sqrtLoStep_brackets ih
CausalSmith.Stat.SaPlmCumulantConverse.sqrtLoIterate_brackets · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:222

The lower bisection output never overshoots: for a nonnegative rational number, the rational value returned by the fixed-fuel lower bisection is at most the true real square root of that number.

Formal statement
x :
hx :
0 ≤ x
fuel :
(sqrtLoBisect x fuel : ℝ) ≤ sqrt x
Proof (Lean source)
lemma sqrtLoBisect_le_sqrt {x : ℚ} (hx : 0 ≤ x) (fuel : ℕ) : (sqrtLoBisect x fuel : ℝ) ≤ sqrt x := by have hb := sqrtLoIterate_brackets hx fuel rw [Real.le_sqrt (by exact_mod_cast hb.1) (by exact_mod_cast hx)] exact_mod_cast hb.2.2.1
CausalSmith.Stat.SaPlmCumulantConverse.sqrtLoBisect_le_sqrt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:240

The upper bisection output never undershoots: for a nonnegative rational number, the true real square root of that number is at most the rational value returned by the fixed-fuel upper bisection.

Formal statement
x :
hx :
0 ≤ x
fuel :
sqrt x ≤ (sqrtHiBisect x fuel : ℝ)
Proof (Lean source)
lemma sqrt_le_sqrtHiBisect {x : ℚ} (hx : 0 ≤ x) (fuel : ℕ) : sqrt x ≤ (sqrtHiBisect x fuel : ℝ) := by have hb := sqrtLoIterate_brackets hx fuel have hhi : 0 ≤ (iterate (sqrtLoStep x) fuel (sqrtInitial x)).hi := by linarith [hb.1, hb.2.1] apply Real.sqrt_le_iff.mpr constructor · exact_mod_cast hhi · exact_mod_cast hb.2.2.2
CausalSmith.Stat.SaPlmCumulantConverse.sqrt_le_sqrtHiBisect · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:249

The rational lower square bound of any interval is nonnegative, since it is either zero, when the interval straddles the origin, or the smaller of two squares.

Formal statement
0 ≤ sqLo I
Proof (Lean source)
lemma sqLo_nonneg (I : RatInterval) : 0 ≤ sqLo I := by unfold sqLo split_ifs · norm_num · exact le_min (sq_nonneg _) (sq_nonneg _)

The modulus enclosure is sound: if a complex number lies in a rectangle, then its modulus lies in the rational interval produced by the fixed-fuel modulus routine for that rectangle, for any amount of bisection fuel.

Formal statement
z :
hz :
I.Contains z
fuel :
(cxModulus I fuel).Contains ‖z‖
Proof (Lean source)
lemma cxModulus_sound {I : ComplexRatInterval} {z : ℂ} (hz : I.Contains z) (fuel : ℕ) : (cxModulus I fuel).Contains ‖z‖ := by have hsre := sq_bounds_sound hz.1 have hsim := sq_bounds_sound hz.2 have hSlo : 0 ≤ (cxModulusSq I).lo := by exact add_nonneg (sqLo_nonneg I.re) (sqLo_nonneg I.im) have hShi : 0 ≤ (cxModulusSq I).hi := by dsimp [cxModulusSq, sqHi] positivity have hnormsq : (cxModulusSq I).lo ≤ Complex.normSq z ∧ Complex.normSq z ≤ (cxModulusSq I).hi := by dsimp [cxModulusSq] simp only [Complex.normSq_apply, Rat.cast_add] exact ⟨by simpa [pow_two] using add_le_add hsre.1 hsim.1, by simpa [pow_two] using add_le_add hsre.2 hsim.2⟩ change ((min (sqrtLoBisect (cxModulusSq I).lo fuel) (sqrtHiBisect (cxModulusSq I).hi fuel) : ℚ) : ℝ) ≤ ‖z‖ ∧ ‖z‖ ≤ ((max (sqrtLoBisect (cxModulusSq I).lo fuel) (sqrtHiBisect (cxModulusSq I).hi fuel) : ℚ) : ℝ) simp only [Rat.cast_min, Rat.cast_max] constructor · apply min_le_of_left_le calc (sqrtLoBisect (cxModulusSq I).lo fuel : ℝ) ≤ sqrt (cxModulusSq I).lo := sqrtLoBisect_le_sqrt hSlo fuel _ ≤ sqrt (Complex.normSq z) := Real.sqrt_le_sqrt (by exact_mod_cast hnormsq.1) _ = ‖z‖ := by rfl · apply le_max_of_le_right calc ‖z‖ = sqrt (Complex.normSq z) := by rfl _ ≤ sqrt (cxModulusSq I).hi := Real.sqrt_le_sqrt (by exact_mod_cast hnormsq.2) _ ≤ (sqrtHiBisect (cxModulusSq I).hi fuel : ℝ) := sqrt_le_sqrtHiBisect hShi fuel
theorem sqrtBisectInterval_sound

The square-root enclosure is sound: for an interval whose lower endpoint is nonnegative, if a real number lies in that interval, then its square root lies in the rational interval produced by the fixed-fuel bisection enclosure, for any amount of bisection fuel.

Formal statement
hI :
0 ≤ I.lo
x :
hx :
I.Contains x
fuel :
(sqrtBisectInterval I fuel).Contains (sqrt x)
Proof (Lean source)
lemma sqrtBisectInterval_sound {I : RatInterval} (hI : 0 ≤ I.lo) {x : ℝ} (hx : I.Contains x) (fuel : ℕ) : (sqrtBisectInterval I fuel).Contains (sqrt x) := by change ((min (sqrtLoBisect I.lo fuel) (sqrtHiBisect I.hi fuel) : ℚ) : ℝ) ≤ sqrt x ∧ sqrt x ≤ ((max (sqrtLoBisect I.lo fuel) (sqrtHiBisect I.hi fuel) : ℚ) : ℝ) simp only [Rat.cast_min, Rat.cast_max] constructor · apply min_le_of_left_le exact (sqrtLoBisect_le_sqrt hI fuel).trans (Real.sqrt_le_sqrt (by exact_mod_cast hx.1)) · apply le_max_of_le_right exact (Real.sqrt_le_sqrt (by exact_mod_cast hx.2)).trans (sqrt_le_sqrtHiBisect (hI.trans I.lo_le_hi) fuel)
CausalSmith.Stat.SaPlmCumulantConverse.sqrtBisectInterval_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:312

One step of the lower bisection halves the width of the bracket: the distance between the new endpoints is exactly half the distance between the old ones, whichever branch the midpoint test takes.

Formal statement
x :
(sqrtLoStep x b).hi - (sqrtLoStep x b).lo = (b.hi - b.lo) / 2
Proof (Lean source)
lemma sqrtLoStep_width (x : ℚ) (b : SqrtBracket) : (sqrtLoStep x b).hi - (sqrtLoStep x b).lo = (b.hi - b.lo) / 2 := by simp only [sqrtLoStep] split <;> dsimp <;> ring
CausalSmith.Stat.SaPlmCumulantConverse.sqrtLoStep_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:332

One step of the upper bisection halves the width of the bracket: the distance between the new endpoints is exactly half the distance between the old ones, whichever branch the midpoint test takes.

Formal statement
x :
(sqrtHiStep x b).hi - (sqrtHiStep x b).lo = (b.hi - b.lo) / 2
Proof (Lean source)
lemma sqrtHiStep_width (x : ℚ) (b : SqrtBracket) : (sqrtHiStep x b).hi - (sqrtHiStep x b).lo = (b.hi - b.lo) / 2 := by simp only [sqrtHiStep] split <;> dsimp <;> ring
CausalSmith.Stat.SaPlmCumulantConverse.sqrtHiStep_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:340

Halving compounds geometrically: for a bracket update rule that always halves the width of the bracket it is applied to, iterating that rule a fixed number of times shrinks the width of any starting bracket by a factor of one half raised to the number of iterations.

Formal statement
hstep :
∀ b, (step b).hi - (step b).lo = (b.hi - b.lo) / 2
fuel :
(iterate step fuel b).hi - (iterate step fuel b).lo
= (b.hi - b.lo) * (1 / 2 : ℚ) ^ fuel
Proof (Lean source)
lemma sqrtStep_iterate_width (step : SqrtBracketSqrtBracket) (hstep : ∀ b, (step b).hi - (step b).lo = (b.hi - b.lo) / 2) (b : SqrtBracket) (fuel : ℕ) : (iterate step fuel b).hi - (iterate step fuel b).lo = (b.hi - b.lo) * (1 / 2 : ℚ) ^ fuel := by induction fuel generalizing b with | zero => simp | succ fuel ih => rw [Function.iterate_succ_apply, ← (Function.Commute.refl step).iterate_right fuel b, hstep, ih, pow_succ] ring
CausalSmith.Stat.SaPlmCumulantConverse.sqrtStep_iterate_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:348

The gap between the upper and lower square-root bisection outputs is at most the width of the initial bracket times one half raised to the amount of fuel, so the enclosure tightens geometrically in the number of bisection steps.

Formal statement
x :
fuel :
sqrtHiBisect x fuel - sqrtLoBisect x fuel
≤ ((sqrtInitial x).hi - (sqrtInitial x).lo) * (1 / 2 : ℚ) ^ fuel
Proof (Lean source)
lemma sqrt_bisect_width (x : ℚ) (fuel : ℕ) : sqrtHiBisect x fuel - sqrtLoBisect x fuel ≤ ((sqrtInitial x).hi - (sqrtInitial x).lo) * (1 / 2 : ℚ) ^ fuel := by unfold sqrtHiBisect sqrtLoBisect exact le_of_eq (sqrtStep_iterate_width (sqrtLoStep x) (sqrtLoStep_width x) (sqrtInitial x) fuel)
CausalSmith.Stat.SaPlmCumulantConverse.sqrt_bisect_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:364

Guarded rectangle division is sound: if a complex number lies in the numerator rectangle, a second complex number lies in the denominator rectangle, and a strictly positive rational guard bounds the squared modulus of the denominator rectangle away from zero from below, then the quotient of the two complex numbers lies in the rectangle returned by the guarded division.

Formal statement
z w :
hz :
I.Contains z
hw :
J.Contains w
m :
hm :
0 < m
hguard :
m ≤ (cxModulusSq J).lo
(cxDivGuarded I J m hm hguard).Contains (z / w)
Proof (Lean source)
lemma cxDivGuarded_sound {I J : ComplexRatInterval} {z w : ℂ} (hz : I.Contains z) (hw : J.Contains w) (m : ℚ) (hm : 0 < m) (hguard : m ≤ (cxModulusSq J).lo) : (cxDivGuarded I J m hm hguard).Contains (z / w) := by let S := cxModulusSq J have hS : S.AwayFromZero := inr (hm.trans_le hguard) have hnum : (cxMul I (cxConj J)).Contains (z * starRingEnd ℂ w) := cxMul_sound hz (cxConj_sound hw) have hsqre := sq_bounds_sound hw.1 have hsqim := sq_bounds_sound hw.2 have hden : S.Contains (Complex.normSq w) := by dsimp [S, cxModulusSq] simp only [Complex.normSq_apply, Rat.cast_add] exact ⟨by simpa [pow_two] using add_le_add hsqre.1 hsqim.1, by simpa [pow_two] using add_le_add hsqre.2 hsqim.2⟩ change ((cxMul I (cxConj J)).re.div S hS).Contains (z / w).re ∧ ((cxMul I (cxConj J)).im.div S hS).Contains (z / w).im constructor · convert RatInterval.div_sound hS hnum.1 hden using 1 rw [Complex.div_re, Complex.mul_re] rw [show (starRingEnd ℂ w).re = w.re by simp, show (starRingEnd ℂ w).im = -w.im by simp] ring · convert RatInterval.div_sound hS hnum.2 hden using 1 rw [Complex.div_im, Complex.mul_im] rw [show (starRingEnd ℂ w).re = w.re by simp, show (starRingEnd ℂ w).im = -w.im by simp] ring
CausalSmith.Stat.SaPlmCumulantConverse.cxDivGuarded_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:375
theorem absInterval_sound

The absolute-value endpoint rule is sound: if a real number lies in a rational interval, then its absolute value lies in the interval produced by the absolute-value rule.

Formal statement
x :
hx :
I.Contains x
(absInterval I).Contains |x|
Proof (Lean source)
lemma absInterval_sound {I : RatInterval} {x : ℝ} (hx : I.Contains x) : (absInterval I).Contains |x| := by unfold absInterval split_ifs with h · simp only [RatInterval.Contains, Rat.cast_zero, Rat.cast_max, Rat.cast_abs] exact ⟨abs_nonneg x, abs_le_max_abs_abs hx.1 hx.2⟩ · rcases not_and_or.mp h with hlo | hhi · have hIloposQ : (0 : ℚ) < I.lo := lt_of_not_ge hlo have hIlopos : (0 : ℝ) < I.lo := by exact_mod_cast hIloposQ have hIhipos : (0 : ℝ) < I.hi := hIlopos.trans_le (by exact_mod_cast I.lo_le_hi) have hxpos : 0 < x := hIlopos.trans_le hx.1 simp only [RatInterval.Contains, Rat.cast_min, Rat.cast_max, Rat.cast_abs] rw [abs_of_pos hIlopos, abs_of_pos hIhipos, abs_of_pos hxpos] exact ⟨min_le_of_left_le hx.1, le_max_of_le_right hx.2⟩ · have hIhinegQ : I.hi < (0 : ℚ) := lt_of_not_ge hhi have hIhineg : (I.hi : ℝ) < 0 := by exact_mod_cast hIhinegQ have hIlohi : (I.lo : ℝ) ≤ I.hi := by exact_mod_cast I.lo_le_hi have hIloneg : (I.lo : ℝ) < 0 := hIlohi.trans_lt hIhineg have hxneg : x < 0 := hx.2.trans_lt hIhineg simp only [RatInterval.Contains, Rat.cast_min, Rat.cast_max, Rat.cast_abs] rw [abs_of_neg hIloneg, abs_of_neg hIhineg, abs_of_neg hxneg] exact ⟨min_le_of_right_le (neg_le_neg hx.2), le_max_of_le_left (neg_le_neg hx.1)⟩
CausalSmith.Stat.SaPlmCumulantConverse.absInterval_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedComplex.lean:414
Helpers.CertifiedTranscendental 82 declarations This file defines the genuine rational, finite-fuel algorithms required by the paper.

Conditional certified transcendental substrate

This file defines the genuine rational, finite-fuel algorithms required by the paper. It deliberately does not manufacture a certified implementation. The record at the end is the contract that a future compiled implementation must discharge.

The convergence clauses consume shrinking input approximants. In particular, there is no claim that the image of one fixed nondegenerate interval under exp, sin, cos, or complex exp can have arbitrarily small width.

def atanPartial

Rational alternating arctangent polynomial through index N.

Definition (Lean source)
def atanPartial (x : ℚ) (N : ℕ) : ℚ := ∑ j ∈ range (N + 1), (if Even j then 1 else -1) * x ^ (2 * j + 1) / (2 * j + 1)
def atanRemainder

Alternating-series remainder radius.

Definition (Lean source)
def atanRemainder (x : ℚ) (N : ℕ) : ℚ := |x| ^ (2 * N + 3) / (2 * N + 3)
def atanRaw

Raw rational enclosure of the arctangent at the rational point x: the alternating Taylor partial sum truncated at index N, widened symmetrically by the alternating-series remainder radius attached to that truncation.

Definition (Lean source)
def atanRaw (x : ℚ) (N : ℕ) : RatInterval := ⟨atanPartial x N - atanRemainder x N, atanPartial x N + atanRemainder x N, by have hden : (0 : ℚ) < 2 * N + 3 := by positivity have h : 0 ≤ atanRemainder x N := div_nonneg (pow_nonneg (abs_nonneg x) _) hden.le linarith⟩
def atanInterval

Nested arctangent enclosure obtained by finite intersections.

Definition (Lean source)
def atanInterval (x : ℚ) : ℕ → RatInterval | 0 => atanRaw x 0 | N + 1 => (atanInterval x N).tighten (atanRaw x (N + 1))
def machinPiRaw

Raw Machin enclosure 16 atan(1/5) - 4 atan(1/239).

Definition (Lean source)
def machinPiRaw (N : ℕ) : RatInterval := ((RatInterval.point 16).mul (atanInterval (1 / 5) N)).sub ((RatInterval.point 4).mul (atanInterval (1 / 239) N))
def machinPiInterval

Nested Machin enclosure.

Definition (Lean source)
def machinPiInterval : ℕ → RatInterval | 0 => machinPiRaw 0 | N + 1 => (machinPiInterval N).tighten (machinPiRaw (N + 1))
def machinPiFuel

Displayed finite Machin cutoff for a positive rational tolerance.

Definition (Lean source)
def machinPiFuel (ε : PosRat) : ℕ := 5 * ε.1.den + 5
theorem machinPi_nested

The Machin enclosures of π never widen as the cutoff index grows: the enclosure computed at cutoff N + 1 is contained in the one computed at cutoff N.

Formal statement
N :
(machinPiInterval (N + 1)).Subinterval (machinPiInterval N)
Proof (Lean source)
lemma machinPi_nested (N : ℕ) : (machinPiInterval (N + 1)).Subinterval (machinPiInterval N) := by simp only [machinPiInterval] unfold RatInterval.tighten split · exact ⟨le_max_left _ _, min_le_left _ _⟩ · exact RatInterval.subinterval_refl _
def intervalPolynomial

Interval evaluation of a rational-coefficient polynomial by primitive recursion.

Definition (Lean source)
def intervalPolynomial (coeff : ℕ → ℚ) (I : RatInterval) : ℕ → RatInterval | 0 => RatInterval.point (coeff 0) | N + 1 => (intervalPolynomial coeff I N).add ((RatInterval.point (coeff (N + 1))).mul (I.npow (N + 1)))
def expCoeff

The Taylor coefficient of the exponential function at index j, namely the reciprocal of j factorial.

Definition (Lean source)
def expCoeff (j : ℕ) : ℚ := (j.factorial : ℚ)⁻¹
def sinCoeff

The Taylor coefficient of the sine function at index j: zero at every even index, and at an odd index the alternating sign attached to that term divided by j factorial.

Definition (Lean source)
def sinCoeff (j : ℕ) : ℚ := if Even j then 0 else (if Even ((j - 1) / 2) then 1 else -1) / (j.factorial : ℚ)
def cosCoeff

The Taylor coefficient of the cosine function at index j: zero at every odd index, and at an even index the alternating sign attached to that term divided by j factorial.

Definition (Lean source)
def cosCoeff (j : ℕ) : ℚ := if Odd j then 0 else (if Even (j / 2) then 1 else -1) / (j.factorial : ℚ)
def taylorCutoff

The displayed Taylor cutoff.

Definition (Lean source)
def taylorCutoff (I : RatInterval) (precision : ℕ) : ℕ := toNat ⌈2 * I.maxAbs⌉ + precision + 2 * toNat ⌈I.maxAbs⌉ + 2
def expRemainderBound

A rational bound for the exponential's Taylor remainder past degree N over an interval: the largest endpoint magnitude of the interval raised to the power N + 1, divided by N + 1 factorial, and scaled by three raised to the ceiling of that magnitude.

Definition (Lean source)
def expRemainderBound (I : RatInterval) (N : ℕ) : ℚ := 3 ^ (toNat ⌈I.maxAbs⌉) * I.maxAbs ^ (N + 1) / ((N + 1).factorial : ℚ)
def trigRemainderBound

A rational bound for the sine or cosine Taylor remainder past degree N over an interval: the largest endpoint magnitude of the interval raised to the power N + 1, divided by N + 1 factorial.

Definition (Lean source)
def trigRemainderBound (I : RatInterval) (N : ℕ) : ℚ := I.maxAbs ^ (N + 1) / ((N + 1).factorial : ℚ)
def expTaylorRaw

Raw enclosure of the exponential over a rational interval at a requested precision: evaluate the exponential's Taylor polynomial in interval arithmetic up to the displayed cutoff degree for that interval and precision, then widen the result on both sides by the matching exponential remainder bound.

Definition (Lean source)
def expTaylorRaw (I : RatInterval) (precision : ℕ) : RatInterval := let N := taylorCutoff I precision let e := expRemainderBound I N (intervalPolynomial expCoeff I N).expand e (by have hB : 0 ≤ I.maxAbs := (abs_nonneg I.lo).trans (le_max_left _ _) exact div_nonneg (mul_nonneg (by positivity) (pow_nonneg hB _)) (by positivity))
def sinTaylorRaw

Raw enclosure of the sine over a rational interval at a requested precision: evaluate the sine's Taylor polynomial in interval arithmetic up to the displayed cutoff degree, then widen the result on both sides by the trigonometric remainder bound.

Definition (Lean source)
def sinTaylorRaw (I : RatInterval) (precision : ℕ) : RatInterval := let N := taylorCutoff I precision let e := trigRemainderBound I N (intervalPolynomial sinCoeff I N).expand e (by have hB : 0 ≤ I.maxAbs := (abs_nonneg I.lo).trans (le_max_left _ _) exact div_nonneg (pow_nonneg hB _) (by positivity))
def cosTaylorRaw

Raw enclosure of the cosine over a rational interval at a requested precision: evaluate the cosine's Taylor polynomial in interval arithmetic up to the displayed cutoff degree, then widen the result on both sides by the trigonometric remainder bound.

Definition (Lean source)
def cosTaylorRaw (I : RatInterval) (precision : ℕ) : RatInterval := let N := taylorCutoff I precision let e := trigRemainderBound I N (intervalPolynomial cosCoeff I N).expand e (by have hB : 0 ≤ I.maxAbs := (abs_nonneg I.lo).trans (le_max_left _ _) exact div_nonneg (pow_nonneg hB _) (by positivity))
def expTaylorInterval

Fuel-indexed exponential enclosure over a rational interval: at fuel zero it is the raw Taylor enclosure at precision zero, and each further unit of fuel intersects the enclosure obtained so far with the raw enclosure computed at the next precision, so the family can only shrink.

Definition (Lean source)
def expTaylorInterval (I : RatInterval) : ℕ → RatInterval | 0 => expTaylorRaw I 0 | N + 1 => (expTaylorInterval I N).tighten (expTaylorRaw I (N + 1))
def sinInterval

Fuel-indexed sine enclosure over a rational interval: at fuel zero it is the raw Taylor enclosure at precision zero, and each further unit of fuel intersects the enclosure obtained so far with the raw enclosure computed at the next precision.

Definition (Lean source)
def sinInterval (I : RatInterval) : ℕ → RatInterval | 0 => sinTaylorRaw I 0 | N + 1 => (sinInterval I N).tighten (sinTaylorRaw I (N + 1))
def cosInterval

Fuel-indexed cosine enclosure over a rational interval: at fuel zero it is the raw Taylor enclosure at precision zero, and each further unit of fuel intersects the enclosure obtained so far with the raw enclosure computed at the next precision.

Definition (Lean source)
def cosInterval (I : RatInterval) : ℕ → RatInterval | 0 => cosTaylorRaw I 0 | N + 1 => (cosInterval I N).tighten (cosTaylorRaw I (N + 1))
def transcendentalFuel

The finite Taylor cutoff spent on one real transcendental evaluation over a rational interval at a requested positive tolerance: the displayed cutoff formula applied to that interval, with the precision taken to be the denominator of the tolerance.

Definition (Lean source)
def transcendentalFuel (I : RatInterval) (ε : PosRat) : ℕ := taylorCutoff I ε.1.den
def cexpInterval

Certified rectangle extension of exp(x+iy)=exp(x)(cos y+i sin y).

Definition (Lean source)
def cexpInterval (I : ComplexRatInterval) (precision : ℕ) : ComplexRatInterval := cxMul ⟨expTaylorInterval I.re precision, RatInterval.point 0⟩ ⟨cosInterval I.im precision, sinInterval I.im precision⟩
def cexpFuel

The finite fuel spent on one complex exponential evaluation over a rational rectangle at a requested positive tolerance: the larger of the real transcendental cutoffs computed for the rectangle's real side and for its imaginary side.

Definition (Lean source)
def cexpFuel (I : ComplexRatInterval) (ε : PosRat) : ℕ := max (transcendentalFuel I.re ε) (transcendentalFuel I.im ε)
theorem expTaylor_nested

The fuel-indexed exponential enclosures over a fixed rational interval never widen: the enclosure at fuel N + 1 is contained in the enclosure at fuel N.

Formal statement
N :
(expTaylorInterval I (N + 1)).Subinterval (expTaylorInterval I N)
Proof (Lean source)
lemma expTaylor_nested (I : RatInterval) (N : ℕ) : (expTaylorInterval I (N + 1)).Subinterval (expTaylorInterval I N) := by simp only [expTaylorInterval] unfold RatInterval.tighten split · exact ⟨le_max_left _ _, min_le_left _ _⟩ · exact RatInterval.subinterval_refl _
theorem sinInterval_nested

The fuel-indexed sine enclosures over a fixed rational interval never widen: the enclosure at fuel N + 1 is contained in the enclosure at fuel N.

Formal statement
N :
(sinInterval I (N + 1)).Subinterval (sinInterval I N)
Proof (Lean source)
lemma sinInterval_nested (I : RatInterval) (N : ℕ) : (sinInterval I (N + 1)).Subinterval (sinInterval I N) := by simp only [sinInterval] unfold RatInterval.tighten split · exact ⟨le_max_left _ _, min_le_left _ _⟩ · exact RatInterval.subinterval_refl _
theorem cosInterval_nested

The fuel-indexed cosine enclosures over a fixed rational interval never widen: the enclosure at fuel N + 1 is contained in the enclosure at fuel N.

Formal statement
N :
(cosInterval I (N + 1)).Subinterval (cosInterval I N)
Proof (Lean source)
lemma cosInterval_nested (I : RatInterval) (N : ℕ) : (cosInterval I (N + 1)).Subinterval (cosInterval I N) := by simp only [cosInterval] unfold RatInterval.tighten split · exact ⟨le_max_left _ _, min_le_left _ _⟩ · exact RatInterval.subinterval_refl _

Pure represented-real input. Executable code sees no semantic exact real.

Definition (Lean source)
approx :
ℕ → RatInterval
modulus :
PosRat → ℕ
nested :
∀ fuel, (approx (fuel + 1)).Subinterval (approx fuel)
width_modulus :
∀ ε, (approx (modulus ε)).width ≤ ε.1
CausalSmith.Stat.SaPlmCumulantConverse.RationalRealApproximants · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:238
def Represents

A family of rational approximants represents a given real number when every enclosure it produces, at every fuel level, contains that number.

Definition (Lean source)
def RationalRealApproximants.Represents (name : RationalRealApproximants) (x : ℝ) : Prop := ∀ fuel, (name.approx fuel).Contains x
CausalSmith.Stat.SaPlmCumulantConverse.RationalRealApproximants.Represents · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:245

Pure represented-complex input with a common effective modulus.

Definition (Lean source)
approx :
modulus :
PosRat → ℕ
nested :
∀ fuel, (approx (fuel + 1)).Subinterval (approx fuel)
width_modulus :
∀ ε, (approx (modulus ε)).re.width ≤ ε.1 ∧ (approx (modulus ε)).im.width ≤ ε.1
CausalSmith.Stat.SaPlmCumulantConverse.RationalComplexApproximants · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:254
def Represents

A family of rational rectangle approximants represents a given complex number when every rectangle it produces, at every fuel level, contains that number.

Definition (Lean source)
def RationalComplexApproximants.Represents (name : RationalComplexApproximants) (z : ℂ) : Prop := ∀ fuel, (name.approx fuel).Contains z
CausalSmith.Stat.SaPlmCumulantConverse.RationalComplexApproximants.Represents · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:263

A value-opaque positive real name. Positivity is carried by a rational lower certificate; the represented real remains external to executable data.

Definition (Lean source)
positiveLower :
positiveLower_pos :
0 < positiveLower
CausalSmith.Stat.SaPlmCumulantConverse.ExecutablePositiveRealName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:270
def RepresentsPositive

External semantics of a value-opaque positive name.

Definition (Lean source)
def ExecutablePositiveRealName.RepresentsPositive (name : ExecutablePositiveRealName) (x : ℝ) : Prop := name.toRationalRealApproximants.Represents x ∧ (name.positiveLower : ℝ) ≤ x
CausalSmith.Stat.SaPlmCumulantConverse.ExecutablePositiveRealName.RepresentsPositive · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:276

Finite compositional fuel for one real transcendental call. The input tolerance is selected from the bounded input enclosure and requested output tolerance; it is not a hard-coded fraction of the latter.

Definition (Lean source)
inputTolerance :
inputFuel :
taylorTolerance :
taylorFuel :
CausalSmith.Stat.SaPlmCumulantConverse.RealTranscendentalSchedule · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:281

Finite compositional fuel for one complex exponential call.

Definition (Lean source)
inputTolerance :
inputFuel :
taylorTolerance :
taylorFuel :
CausalSmith.Stat.SaPlmCumulantConverse.ComplexTranscendentalSchedule · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:290
def cxTighten

Coordinatewise finite intersection of complex rectangles.

Definition (Lean source)
def cxTighten (I J : ComplexRatInterval) : ComplexRatInterval := ⟨I.re.tighten J.re, I.im.tighten J.im⟩
theorem cxTighten_subinterval_left

Intersecting a complex rectangle with another one can only shrink it: the coordinatewise intersection of two rectangles is contained in the first rectangle.

Formal statement
(cxTighten I J).Subinterval I
Proof (Lean source)
lemma cxTighten_subinterval_left (I J : ComplexRatInterval) : (cxTighten I J).Subinterval I := by exact ⟨rat_tighten_subinterval_left I.re J.re, rat_tighten_subinterval_left I.im J.im⟩
CausalSmith.Stat.SaPlmCumulantConverse.cxTighten_subinterval_left · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:308
theorem cxTighten_sound

Coordinatewise intersection of complex rectangles is sound: whenever a complex number lies in the first rectangle and lies in the second rectangle, it also lies in their intersection.

Formal statement
z :
hI :
I.Contains z
hJ :
J.Contains z
(cxTighten I J).Contains z
Proof (Lean source)
lemma cxTighten_sound {I J : ComplexRatInterval} {z : ℂ} (hI : I.Contains z) (hJ : J.Contains z) : (cxTighten I J).Contains z := by exact ⟨RatInterval.tighten_sound hI.1 hJ.1, RatInterval.tighten_sound hI.2 hJ.2⟩
def realOutputSequence

For one fixed represented input, evaluate the rational program at fuel m and intersect it with every previous output. Nesting is therefore indexed by fuel, not inferred from an ordering of requested tolerances.

Definition (Lean source)
def realOutputSequence (eval : RatInterval → ℕ → RatInterval) (name : RationalRealApproximants) : ℕ → RatInterval | 0 => eval (name.approx 0) 0 | fuel + 1 => (realOutputSequence eval name fuel).tighten (eval (name.approx (fuel + 1)) (fuel + 1))
def complexExpOutputSequence

Fuel-indexed complex-exponential outputs, recursively intersected with the previous rectangle.

Definition (Lean source)
def complexExpOutputSequence (name : RationalComplexApproximants) : ℕ → ComplexRatInterval | 0 => cexpInterval (name.approx 0) 0 | fuel + 1 => cxTighten (complexExpOutputSequence name fuel) (cexpInterval (name.approx (fuel + 1)) (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.complexExpOutputSequence · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:333
theorem realOutputSequence_nested

The accumulated outputs of a real evaluation program on a fixed represented input never widen as fuel grows: the output enclosure at one more unit of fuel is contained in the output enclosure at the current fuel.

Formal statement
eval :
fuel :
(realOutputSequence eval name (fuel + 1)).Subinterval (realOutputSequence eval name fuel)
Proof (Lean source)
lemma realOutputSequence_nested (eval : RatInterval → ℕ → RatInterval) (name : RationalRealApproximants) (fuel : ℕ) : (realOutputSequence eval name (fuel + 1)).Subinterval (realOutputSequence eval name fuel) := by simp only [realOutputSequence] exact rat_tighten_subinterval_left _ _
CausalSmith.Stat.SaPlmCumulantConverse.realOutputSequence_nested · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:341
theorem complexExpOutputSequence_nested

The accumulated complex-exponential output rectangles on a fixed represented input never widen as fuel grows: the rectangle at one more unit of fuel is contained in the rectangle at the current fuel.

Formal statement
fuel :
(complexExpOutputSequence name (fuel + 1)).Subinterval (complexExpOutputSequence name fuel)
Proof (Lean source)
lemma complexExpOutputSequence_nested (name : RationalComplexApproximants) (fuel : ℕ) : (complexExpOutputSequence name (fuel + 1)).Subinterval (complexExpOutputSequence name fuel) := by simp only [complexExpOutputSequence] exact cxTighten_subinterval_left _ _
CausalSmith.Stat.SaPlmCumulantConverse.complexExpOutputSequence_nested · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:351
theorem realOutputSequence_contains

Accumulating intersections preserves soundness for real programs: if every raw evaluation of the program, at every fuel level, encloses the target real number, then every accumulated output enclosure encloses it as well.

Formal statement
eval :
x :
hraw :
∀ fuel, (eval (name.approx fuel) fuel).Contains x
∀ fuel, (realOutputSequence eval name fuel).Contains x
Proof (Lean source)
lemma realOutputSequence_contains (eval : RatInterval → ℕ → RatInterval) (name : RationalRealApproximants) (x : ℝ) (hraw : ∀ fuel, (eval (name.approx fuel) fuel).Contains x) : ∀ fuel, (realOutputSequence eval name fuel).Contains x := by intro fuel induction fuel with | zero => exact hraw 0 | succ fuel ih => exact RatInterval.tighten_sound ih (hraw (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.realOutputSequence_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:361
theorem complexExpOutputSequence_contains

Accumulating intersections preserves soundness for the complex exponential: if every raw exponential rectangle, at every fuel level, encloses the target complex number, then every accumulated output rectangle encloses it as well.

Formal statement
z :
hraw :
∀ fuel, (cexpInterval (name.approx fuel) fuel).Contains z
∀ fuel, (complexExpOutputSequence name fuel).Contains z
Proof (Lean source)
lemma complexExpOutputSequence_contains (name : RationalComplexApproximants) (z : ℂ) (hraw : ∀ fuel, (cexpInterval (name.approx fuel) fuel).Contains z) : ∀ fuel, (complexExpOutputSequence name fuel).Contains z := by intro fuel induction fuel with | zero => exact hraw 0 | succ fuel ih => exact cxTighten_sound ih (hraw (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.complexExpOutputSequence_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:375
def outputFuel

The fuel at which a real transcendental call is finally read off: the larger of the schedule's input-refinement fuel and its Taylor fuel.

Definition (Lean source)
def RealTranscendentalSchedule.outputFuel (schedule : RealTranscendentalSchedule) : ℕ := max schedule.inputFuel schedule.taylorFuel
CausalSmith.Stat.SaPlmCumulantConverse.RealTranscendentalSchedule.outputFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:387
def outputFuel

The fuel at which a complex exponential call is finally read off: the larger of the schedule's input-refinement fuel and its Taylor fuel.

Definition (Lean source)
def ComplexTranscendentalSchedule.outputFuel (schedule : ComplexTranscendentalSchedule) : ℕ := max schedule.inputFuel schedule.taylorFuel
CausalSmith.Stat.SaPlmCumulantConverse.ComplexTranscendentalSchedule.outputFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:392
def scheduledRealInterval

The rational enclosure a real transcendental program returns under a given schedule: the accumulated output enclosure on the represented input, read at the schedule's output fuel.

Definition (Lean source)
def scheduledRealInterval (eval : RatInterval → ℕ → RatInterval) (name : RationalRealApproximants) (schedule : RealTranscendentalSchedule) : RatInterval := realOutputSequence eval name schedule.outputFuel
CausalSmith.Stat.SaPlmCumulantConverse.scheduledRealInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:398
def scheduledComplexExpInterval

The rational rectangle the complex exponential program returns under a given schedule: the accumulated output rectangle on the represented input, read at the schedule's output fuel.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.scheduledComplexExpInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:406
def dividedTolerance

Split a requested tolerance into a displayed finite number of positive pieces using rational arithmetic only.

Definition (Lean source)
def dividedTolerance (ε : PosRat) (parts : ℕ) : PosRat := ⟨ε.1 / ((max parts 1 : ℕ) : ℚ), div_pos ε.2 (by positivity)⟩
def expScheduleProgram

Fixed compositional schedule for real exponential evaluation. Its input budget includes a rational Lipschitz envelope computed from the first supplied input interval; its Taylor budget is a separate quarter of the requested error.

Definition (Lean source)
def expScheduleProgram (name : RationalRealApproximants) (ε : PosRat) : RealTranscendentalSchedule := let inputParts := 4 * 3 ^ (toNat ⌈(name.approx 0).maxAbs⌉ + 1) let inputTolerance := dividedTolerance ε inputParts let taylorTolerance := dividedTolerance ε 4 let inputFuel := name.modulus inputTolerance { inputTolerance := inputTolerance inputFuel := inputFuel taylorTolerance := taylorTolerance taylorFuel := taylorCutoff (name.approx inputFuel) taylorTolerance.1.den }
def trigScheduleProgram

Fixed compositional schedule for sine and cosine evaluation.

Definition (Lean source)
def trigScheduleProgram (name : RationalRealApproximants) (ε : PosRat) : RealTranscendentalSchedule := let inputTolerance := dividedTolerance ε 4 let taylorTolerance := dividedTolerance ε 4 let inputFuel := name.modulus inputTolerance { inputTolerance := inputTolerance inputFuel := inputFuel taylorTolerance := taylorTolerance taylorFuel := taylorCutoff (name.approx inputFuel) taylorTolerance.1.den }
def cexpScheduleProgram

Fixed compositional schedule for complex exponential evaluation on a shrinking rectangle name.

Definition (Lean source)
def cexpScheduleProgram (name : RationalComplexApproximants) (ε : PosRat) : ComplexTranscendentalSchedule := let inputParts := 16 * 3 ^ (toNat ⌈(name.approx 0).re.maxAbs⌉ + 1) let inputTolerance := dividedTolerance ε inputParts let taylorTolerance := dividedTolerance ε 8 let inputFuel := name.modulus inputTolerance { inputTolerance := inputTolerance inputFuel := inputFuel taylorTolerance := taylorTolerance taylorFuel := max (taylorCutoff (name.approx inputFuel).re taylorTolerance.1.den) (taylorCutoff (name.approx inputFuel).im taylorTolerance.1.den) }

Sound effective convergence of a rational finite-fuel real transcendental program on shrinking certified inputs.

Definition (Lean source)
def RealTranscendentalContract (eval : RatInterval → ℕ → RatInterval) (semantic : ℝ → ℝ) (schedule : RationalRealApproximantsPosRatRealTranscendentalSchedule) : Prop := ∀ (name : RationalRealApproximants) (x : ℝ), name.Represents x → (∀ fuel, (eval (name.approx fuel) fuel).Contains (semantic x)) ∧ ∀ ε : PosRat, let s := schedule name ε s.inputFuel = name.modulus s.inputTolerance ∧ s.taylorFuel = taylorCutoff (name.approx s.inputFuel) s.taylorTolerance.1.den ∧ (scheduledRealInterval eval name s).Contains (semantic x) ∧ (scheduledRealInterval eval name s).width ≤ ε.1
CausalSmith.Stat.SaPlmCumulantConverse.RealTranscendentalContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:459

Sound effective convergence of the rational finite-fuel complex exponential program on shrinking certified rectangles.

Definition (Lean source)
def ComplexExpContract (schedule : RationalComplexApproximantsPosRatComplexTranscendentalSchedule) : Prop := ∀ (name : RationalComplexApproximants) (z : ℂ), name.Represents z → (∀ fuel, (cexpInterval (name.approx fuel) fuel).Contains (exp z)) ∧ ∀ ε : PosRat, let s := schedule name ε s.inputFuel = name.modulus s.inputTolerance ∧ s.taylorFuel = max (taylorCutoff (name.approx s.inputFuel).re s.taylorTolerance.1.den) (taylorCutoff (name.approx s.inputFuel).im s.taylorTolerance.1.den) ∧ (scheduledComplexExpInterval name s).Contains (exp z) ∧ (scheduledComplexExpInterval name s).re.width ≤ ε.1 ∧ (scheduledComplexExpInterval name s).im.width ≤ ε.1

Circle fuel composes the radius-name modulus, Machin cutoff, and Taylor cutoff.

Definition (Lean source)
radiusTolerance :
radiusFuel :
piFuel :
taylorFuel :
def outputFuel

The fuel at which a circle-node or circle-tangent call is finally read off: the largest of the schedule's radius fuel, its Machin fuel for π, and its Taylor fuel.

Definition (Lean source)
def CircleSchedule.outputFuel (schedule : CircleSchedule) : ℕ := max schedule.radiusFuel (max schedule.piFuel schedule.taylorFuel)
CausalSmith.Stat.SaPlmCumulantConverse.CircleSchedule.outputFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:498
def circleNodeFromPositiveName

Certified rectangle for the q-th of N equally spaced points on the circle of radius given by a positive real name: multiply the radius enclosure, read at the schedule's radius fuel, by the complex exponential enclosure of the purely imaginary angle obtained from twice q over N times the Machin enclosure of π.

Definition (Lean source)
def circleNodeFromPositiveName (rName : ExecutablePositiveRealName) (N q : ℕ) (schedule : CircleSchedule) : ComplexRatInterval := let scale : ℚ := 2 * q / max N 1 let angle : ComplexRatInterval := ⟨RatInterval.point 0, (RatInterval.point scale).mul (machinPiInterval schedule.piFuel)⟩ cxMul ⟨rName.approx schedule.radiusFuel, RatInterval.point 0⟩ (cexpInterval angle schedule.taylorFuel)
CausalSmith.Stat.SaPlmCumulantConverse.circleNodeFromPositiveName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:504
def circleTangentFromPositiveName

Certified rectangle for the tangent (parametric velocity) of the same circle at its q-th of N equally spaced points: form the purely imaginary quantity two times π times the radius, using the Machin enclosure of π and the radius enclosure at the schedule's radius fuel, and multiply it by the complex exponential enclosure of the same angle.

Definition (Lean source)
def circleTangentFromPositiveName (rName : ExecutablePositiveRealName) (N q : ℕ) (schedule : CircleSchedule) : ComplexRatInterval := let twoPiR := (RatInterval.point 2).mul ((machinPiInterval schedule.piFuel).mul (rName.approx schedule.radiusFuel)) cxMul ⟨RatInterval.point 0, twoPiR⟩ (cexpInterval ⟨RatInterval.point 0, (RatInterval.point (2 * q / max N 1)).mul (machinPiInterval schedule.piFuel)⟩ schedule.taylorFuel)
CausalSmith.Stat.SaPlmCumulantConverse.circleTangentFromPositiveName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:521
def circleNodeAtFuel

Raw circle node at one common finite fuel.

Definition (Lean source)
def circleNodeAtFuel (rName : ExecutablePositiveRealName) (N q fuel : ℕ) : ComplexRatInterval := circleNodeFromPositiveName rName N q (circleScheduleAtFuel fuel)
def circleTangentAtFuel

Raw circle tangent at one common finite fuel.

Definition (Lean source)
def circleTangentAtFuel (rName : ExecutablePositiveRealName) (N q fuel : ℕ) : ComplexRatInterval := circleTangentFromPositiveName rName N q (circleScheduleAtFuel fuel)
def circleNodeOutputSequence

Circle nodes for fixed radius data and mesh indices, recursively intersected by fuel.

Definition (Lean source)
def circleNodeOutputSequence (rName : ExecutablePositiveRealName) (N q : ℕ) : ℕ → ComplexRatInterval | 0 => circleNodeAtFuel rName N q 0 | fuel + 1 => cxTighten (circleNodeOutputSequence rName N q fuel) (circleNodeAtFuel rName N q (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.circleNodeOutputSequence · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:555
def circleTangentOutputSequence

Circle tangents for fixed radius data and mesh indices, recursively intersected by fuel.

Definition (Lean source)
def circleTangentOutputSequence (rName : ExecutablePositiveRealName) (N q : ℕ) : ℕ → ComplexRatInterval | 0 => circleTangentAtFuel rName N q 0 | fuel + 1 => cxTighten (circleTangentOutputSequence rName N q fuel) (circleTangentAtFuel rName N q (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.circleTangentOutputSequence · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:563
theorem circleNodeOutputSequence_nested

The accumulated circle-node rectangles for fixed radius data and mesh indices never widen as fuel grows: the rectangle at one more unit of fuel is contained in the rectangle at the current fuel.

Formal statement
N q fuel :
(circleNodeOutputSequence rName N q (fuel + 1)).Subinterval (circleNodeOutputSequence rName N q fuel)
Proof (Lean source)
lemma circleNodeOutputSequence_nested (rName : ExecutablePositiveRealName) (N q fuel : ℕ) : (circleNodeOutputSequence rName N q (fuel + 1)).Subinterval (circleNodeOutputSequence rName N q fuel) := by simp only [circleNodeOutputSequence] exact cxTighten_subinterval_left _ _
CausalSmith.Stat.SaPlmCumulantConverse.circleNodeOutputSequence_nested · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:571
theorem circleTangentOutputSequence_nested

The accumulated circle-tangent rectangles for fixed radius data and mesh indices never widen as fuel grows: the rectangle at one more unit of fuel is contained in the rectangle at the current fuel.

Formal statement
N q fuel :
(circleTangentOutputSequence rName N q (fuel + 1)).Subinterval (circleTangentOutputSequence rName N q fuel)
Proof (Lean source)
lemma circleTangentOutputSequence_nested (rName : ExecutablePositiveRealName) (N q fuel : ℕ) : (circleTangentOutputSequence rName N q (fuel + 1)).Subinterval (circleTangentOutputSequence rName N q fuel) := by simp only [circleTangentOutputSequence] exact cxTighten_subinterval_left _ _
CausalSmith.Stat.SaPlmCumulantConverse.circleTangentOutputSequence_nested · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:581
theorem circleNodeOutputSequence_contains

Accumulating intersections preserves soundness for circle nodes: if every raw node rectangle, at every fuel level, contains the target complex value, then every accumulated node rectangle contains it as well.

Formal statement
N q :
z :
hraw :
∀ fuel, (circleNodeAtFuel rName N q fuel).Contains z
∀ fuel, (circleNodeOutputSequence rName N q fuel).Contains z
Proof (Lean source)
lemma circleNodeOutputSequence_contains (rName : ExecutablePositiveRealName) (N q : ℕ) (z : ℂ) (hraw : ∀ fuel, (circleNodeAtFuel rName N q fuel).Contains z) : ∀ fuel, (circleNodeOutputSequence rName N q fuel).Contains z := by intro fuel induction fuel with | zero => exact hraw 0 | succ fuel ih => exact cxTighten_sound ih (hraw (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.circleNodeOutputSequence_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:591
theorem circleTangentOutputSequence_contains

Accumulating intersections preserves soundness for circle tangents: if every raw tangent rectangle, at every fuel level, contains the target complex value, then every accumulated tangent rectangle contains it as well.

Formal statement
N q :
z :
hraw :
∀ fuel, (circleTangentAtFuel rName N q fuel).Contains z
∀ fuel, (circleTangentOutputSequence rName N q fuel).Contains z
Proof (Lean source)
lemma circleTangentOutputSequence_contains (rName : ExecutablePositiveRealName) (N q : ℕ) (z : ℂ) (hraw : ∀ fuel, (circleTangentAtFuel rName N q fuel).Contains z) : ∀ fuel, (circleTangentOutputSequence rName N q fuel).Contains z := by intro fuel induction fuel with | zero => exact hraw 0 | succ fuel ih => exact cxTighten_sound ih (hraw (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.circleTangentOutputSequence_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:604
def scheduledCircleNode

The circle-node rectangle returned under a given schedule: the accumulated node sequence for that radius name and mesh index, read at the schedule's output fuel.

Definition (Lean source)
def scheduledCircleNode (rName : ExecutablePositiveRealName) (N q : ℕ) (schedule : CircleSchedule) : ComplexRatInterval := circleNodeOutputSequence rName N q schedule.outputFuel
def scheduledCircleTangent

The circle-tangent rectangle returned under a given schedule: the accumulated tangent sequence for that radius name and mesh index, read at the schedule's output fuel.

Definition (Lean source)
def scheduledCircleTangent (rName : ExecutablePositiveRealName) (N q : ℕ) (schedule : CircleSchedule) : ComplexRatInterval := circleTangentOutputSequence rName N q schedule.outputFuel
CausalSmith.Stat.SaPlmCumulantConverse.scheduledCircleTangent · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:624
def circleNodeScheduleProgram

Fixed finite schedule for a circle node. Every component is computed from the requested tolerance, the supplied radius modulus, and the displayed Machin/Taylor programs.

Definition (Lean source)
def circleNodeScheduleProgram (rName : ExecutablePositiveRealName) (N q : ℕ) (ε : PosRat) : CircleSchedule := let budget := dividedTolerance ε (16 * (max N 1 + 1)) let radiusFuel := rName.modulus budget let piFuel := machinPiFuel budget let angle : ComplexRatInterval := ⟨RatInterval.point 0, (RatInterval.point (2 * q / max N 1)).mul (machinPiInterval piFuel)⟩ { radiusTolerance := budget radiusFuel := radiusFuel piFuel := piFuel taylorFuel := cexpFuel angle budget }
CausalSmith.Stat.SaPlmCumulantConverse.circleNodeScheduleProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:631
def circleTangentScheduleProgram

Fixed finite schedule for the corresponding circle tangent.

Definition (Lean source)
def circleTangentScheduleProgram (rName : ExecutablePositiveRealName) (N q : ℕ) (ε : PosRat) : CircleSchedule := let budget := dividedTolerance ε (24 * (max N 1 + 1)) let radiusFuel := rName.modulus budget let piFuel := machinPiFuel budget let angle : ComplexRatInterval := ⟨RatInterval.point 0, (RatInterval.point (2 * q / max N 1)).mul (machinPiInterval piFuel)⟩ { radiusTolerance := budget radiusFuel := radiusFuel piFuel := piFuel taylorFuel := cexpFuel angle budget }
CausalSmith.Stat.SaPlmCumulantConverse.circleTangentScheduleProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:647

Complete soundness and effective-modulus contract for positive-radius circle nodes and tangents.

Definition (Lean source)
def CircleProgramContract (nodeSchedule tangentSchedule : ExecutablePositiveRealName → ℕ → ℕ → PosRatCircleSchedule) : Prop := ∀ (rName : ExecutablePositiveRealName) (r : ℝ), rName.RepresentsPositive r → ∀ (N q : ℕ), 1 ≤ N → q < N → let nodeValue := (r : ℂ) * exp (((2 * Real.pi * q / N : ℝ) : ℂ) * I) let tangentValue := (2 * (Real.pi : ℂ) * I) * r * exp (((2 * Real.pi * q / N : ℝ) : ℂ) * I) (∀ fuel, (circleNodeAtFuel rName N q fuel).Contains nodeValue ∧ (circleTangentAtFuel rName N q fuel).Contains tangentValue) ∧ ∀ ε : PosRat, let sn := nodeSchedule rName N q ε let st := tangentSchedule rName N q ε sn.radiusFuel = rName.modulus sn.radiusTolerance ∧ st.radiusFuel = rName.modulus st.radiusTolerance ∧ sn.piFuel = machinPiFuel sn.radiusTolerance ∧ st.piFuel = machinPiFuel st.radiusTolerance ∧ (scheduledCircleNode rName N q sn).Contains nodeValue ∧ (scheduledCircleTangent rName N q st).Contains tangentValue ∧ (scheduledCircleNode rName N q sn).re.width ≤ ε.1 ∧ (scheduledCircleNode rName N q sn).im.width ≤ ε.1 ∧ (scheduledCircleTangent rName N q st).re.width ≤ ε.1 ∧ (scheduledCircleTangent rName N q st).im.width ≤ ε.1
CausalSmith.Stat.SaPlmCumulantConverse.CircleProgramContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:661
def explicitMeshFuel

The explicit number of mesh subdivisions used for a Lipschitz constant L and a requested positive tolerance: the ceiling of the constant divided by the tolerance, plus one.

Definition (Lean source)
def explicitMeshFuel (L : ℚ) (ε : PosRat) : ℕ := toNat ⌈L / ε.1⌉ + 1
def LegacyFiniteExtremaContract

Legacy contract for the retired callable-table finite-extrema interface. The canonical bounded-domain adapter exposes its paper-specific contract in SelectorSoundness.

Definition (Lean source)
def LegacyFiniteExtremaContract : Prop := ∀ (f : ℝ → ℝ) (nodes : ℕ → RatInterval) (L : ℚ) (hL : 0 ≤ L) (n : ℕ) (hn : 0 < n), (∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, |f s - f t| ≤ (L : ℝ) * |s - t|) → (∀ k ≤ n, (nodes k).Contains (f (meshPoint n k))) → (infEnclosure nodes L hL n hn).Contains (sInf (f '' Icc (0 : ℝ) 1)) ∧ (supEnclosure nodes L hL n hn).Contains (sSup (f '' Icc (0 : ℝ) 1)) ∧ ∀ (w : ℚ), 0 ≤ w → (∀ k ≤ n, (nodes k).width ≤ w) → (infEnclosure nodes L hL n hn).width ≤ w + L / n ∧ (supEnclosure nodes L hL n hn).width ≤ w + L / n
CausalSmith.Stat.SaPlmCumulantConverse.LegacyFiniteExtremaContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:698

The promoted primitive-recursive trapezoidal enclosure, with its exact Lipschitz soundness and the irreducible uniform node-width contribution.

Definition (Lean source)
def TrapezoidalEnclosureContract : Prop := ∀ (g : ℝ → ℂ) (nodes : ℕ → ComplexRatInterval) (L : ℚ) (hL : 0 ≤ L) (n : ℕ) (hn : 0 < n), (∀ s ∈ Icc (0 : ℝ) 1, ∀ t ∈ Icc (0 : ℝ) 1, ‖g s - g t‖ ≤ (L : ℝ) * |s - t|) → (∀ k ≤ n, (nodes k).Contains (g (meshPoint n k))) → (integralEnclosure nodes L hL n hn).Contains (∫ u in (0 : ℝ)..1, g u) ∧ ∀ (w : ℚ), 0 ≤ w → (∀ k ≤ n, (nodes k).re.width ≤ w ∧ (nodes k).im.width ≤ w) → (integralEnclosure nodes L hL n hn).re.width ≤ w + L / n ∧ (integralEnclosure nodes L hL n hn).im.width ≤ w + L / n
CausalSmith.Stat.SaPlmCumulantConverse.TrapezoidalEnclosureContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:719

Uniform finite-fuel names for the complex values at every node of every finite mesh. The semantic function is supplied only to the external RepresentsNodeFunction relation and is not executable data.

Definition (Lean source)
approx :
ℕ → ℕ → ℕ → ComplexRatInterval
modulus :
PosRat → ℕ
nested :
∀ mesh k fuel, (approx mesh k (fuel + 1)).Subinterval (approx mesh k fuel)
width_modulus :
∀ ε mesh k,
(approx mesh k (modulus ε)).re.width ≤ ε.1 ∧ (approx mesh k (modulus ε)).im.width ≤ ε.1
CausalSmith.Stat.SaPlmCumulantConverse.RationalComplexNodeApproximants · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:738
def RepresentsNodeFunction

A family of node approximants represents a complex-valued function on the unit parameter interval when, for every mesh size, every node index not exceeding that mesh size, and every fuel level, the rectangle it produces contains the value of the function at the corresponding mesh point.

Definition (Lean source)
def RationalComplexNodeApproximants.RepresentsNodeFunction (name : RationalComplexNodeApproximants) (g : ℝ → ℂ) : Prop := ∀ mesh k, k ≤ mesh → ∀ fuel, (name.approx mesh k fuel).Contains (g (meshPoint mesh k))
CausalSmith.Stat.SaPlmCumulantConverse.RationalComplexNodeApproximants.RepresentsNodeFunction · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:750

The displayed finite resources for node evaluation and mesh aggregation.

Definition (Lean source)
meshFuel :
nodeCalls :
nodeTolerance :
nodeFuel :
taylorFuel :
sqrtFuel :
endpointOperations :
CausalSmith.Stat.SaPlmCumulantConverse.NodeEvaluationSchedule · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:764
def evaluateComplexNode

The actual callable node evaluator: select the requested rational rectangle from a value-opaque node name using only mesh indices and fuel.

Definition (Lean source)
def evaluateComplexNode (name : RationalComplexNodeApproximants) (schedule : NodeEvaluationSchedule) (k : ℕ) : ComplexRatInterval := name.approx schedule.meshFuel k schedule.nodeFuel
def sqrtBisectionFuelProgram

A closed-form finite bisection budget. It depends only on rational endpoint data and the requested positive tolerance; no least witness or unbounded search is used.

Definition (Lean source)
def sqrtBisectionFuelProgram (input : ComplexRatInterval) (ε : PosRat) : ℕ := let width := (sqrtInitial (cxModulusSq input).hi).hi - (sqrtInitial (cxModulusSq input).hi).lo natAbs width.num + width.den + ε.1.den + 2
CausalSmith.Stat.SaPlmCumulantConverse.sqrtBisectionFuelProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:780
def nodeEvaluationScheduleProgram

Fixed node/mesh schedule from the displayed operation count and rational error budget.

Definition (Lean source)
def nodeEvaluationScheduleProgram (name : RationalComplexNodeApproximants) (input : ComplexRatInterval) (L : ℚ) (ε : PosRat) (operations : ℕ) : NodeEvaluationSchedule := let nodeTolerance := dividedTolerance ε (max operations 1 + 1) { meshFuel := explicitMeshFuel L ε nodeCalls := explicitMeshFuel L ε + 1 nodeTolerance := nodeTolerance nodeFuel := name.modulus nodeTolerance taylorFuel := cexpFuel input nodeTolerance sqrtFuel := sqrtBisectionFuelProgram input nodeTolerance endpointOperations := operations }
CausalSmith.Stat.SaPlmCumulantConverse.nodeEvaluationScheduleProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:788

The exact mesh, node-call, Taylor, square-root, and endpoint-operation fuel obligations from the bounded-build specification.

Definition (Lean source)
def NodeEvaluationFuelContract (schedule : RationalComplexNodeApproximantsComplexRatInterval → ℚ → PosRat → ℕ → NodeEvaluationSchedule) : Prop := ∀ (name : RationalComplexNodeApproximants) (input : ComplexRatInterval) (L : ℚ) (ε : PosRat) (operations : ℕ), 0 ≤ L → let s := schedule name input L ε operations s.meshFuel = explicitMeshFuel L ε ∧ 0 < s.meshFuel ∧ s.nodeCalls = s.meshFuel + 1 ∧ s.nodeFuel = name.modulus s.nodeTolerance ∧ s.taylorFuel = cexpFuel input s.nodeTolerance ∧ s.endpointOperations = operations ∧ s.nodeTolerance.1 * ((max operations 1 : ℕ) : ℚ) ≤ ε.1 ∧ ((sqrtInitial (cxModulusSq input).hi).hi - (sqrtInitial (cxModulusSq input).hi).lo) * (1 / 2 : ℚ) ^ s.sqrtFuel ≤ s.nodeTolerance.1
CausalSmith.Stat.SaPlmCumulantConverse.NodeEvaluationFuelContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:802

Sound, nested node evaluation at the displayed finite fuel.

Definition (Lean source)
def NodeEvaluationContract (schedule : RationalComplexNodeApproximantsComplexRatInterval → ℚ → PosRat → ℕ → NodeEvaluationSchedule) : Prop := NodeEvaluationFuelContract schedule ∧ ∀ (name : RationalComplexNodeApproximants) (g : ℝ → ℂ), name.RepresentsNodeFunction g → ∀ (input : ComplexRatInterval) (L : ℚ) (ε : PosRat) (operations : ℕ), 0 ≤ L → let s := schedule name input L ε operations ∀ k ≤ s.meshFuel, (evaluateComplexNode name s k).Contains (g (meshPoint s.meshFuel k)) ∧ (evaluateComplexNode name s k).re.width ≤ s.nodeTolerance.1 ∧ (evaluateComplexNode name s k).im.width ≤ s.nodeTolerance.1 ∧ ∀ fuel, (name.approx s.meshFuel k (fuel + 1)).Subinterval (name.approx s.meshFuel k fuel)
CausalSmith.Stat.SaPlmCumulantConverse.NodeEvaluationContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/CertifiedTranscendental.lean:821
Helpers.ClassRelations 1 declarations Relations among the non-Gaussian and published ACE classes

Relations among the non-Gaussian and published ACE classes

theorem jms_ace_class_relations Lemma 5 in the paper ↗

The published ACE comparator class sits inside the broad non-Gaussian class, the comparison subclass sits inside the comparator class, and when the two code-accuracy exponents coincide the comparator class and the comparison subclass are one and the same set of laws.

Formal statement
n :
(∀ m : Model (Xspace := Xspace) p, JmsAceClass p n m → NonGaussianClass p n m) ∧
(∀ m : Model (Xspace := Xspace) p, AceComparisonSubclass p n m → JmsAceClass p n m) ∧
(p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, JmsAceClass p n m ↔ AceComparisonSubclass p n m)
Proof (Lean source)
-- @node: lem:jms-ace-class-relations theorem jms_ace_class_relations (p : Parameters) (n : ℕ) : (∀ m : Model (Xspace := Xspace) p, JmsAceClass p n m → NonGaussianClass p n m) ∧ (∀ m : Model (Xspace := Xspace) p, AceComparisonSubclass p n m → JmsAceClass p n m) ∧ (p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, JmsAceClass p n m ↔ AceComparisonSubclass p n m) := by have treatment_measurable (m : Model (Xspace := Xspace) p) (j : ℕ) : AEStronglyMeasurable (fun x ↦ barG p m j x - m.g0 x) (covariateLaw p m) := by apply Measurable.aestronglyMeasurable exact (((m.gcode_measurable j).max measurable_const).min measurable_const).sub m.g0_measurable have outcome_measurable (m : Model (Xspace := Xspace) p) (j : ℕ) : AEStronglyMeasurable (fun x ↦ barQ p m j x - m.q0 x) (covariateLaw p m) := by apply Measurable.aestronglyMeasurable exact (((m.qcode_measurable j).max measurable_const).min measurable_const).sub m.q0_measurable have covariate_probability (m : Model (Xspace := Xspace) p) : IsProbabilityMeasure (covariateLaw p m) := by exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable have treatment_l1 (m : Model (Xspace := Xspace) p) (hm : JmsAceClass p n m) : TreatmentCodeRadiusL1At p m n := by letI := covariate_probability m let f := fun x ↦ barG p m n x - m.g0 x have hf : AEStronglyMeasurable f (covariateLaw p m) := treatment_measurable m n have hr : (1 : ℝ≥0∞) ≤ (p.r : ℝ≥0∞) := by exact_mod_cast (show 1 ≤ p.r from le_trans (by omega) p.r_ge_two) have hnorm : eLpNorm f 1 (covariateLaw p m) ≤ eLpNorm f (p.r : ℝ≥0∞) (covariateLaw p m) := eLpNorm_le_eLpNorm_of_exponent_le hr hf have htop : eLpNorm f (p.r : ℝ≥0∞) (covariateLaw p m) < ∞ := lt_of_le_of_lt hm.treatmentCodeRadiusLr (ENNReal.ofReal_lt_top) have hmemr : MemLp f (p.r : ℝ≥0∞) (covariateLaw p m) := ⟨hf, htop⟩ have hmem1 : MemLp f 1 (covariateLaw p m) := hmemr.mono_exponent hr have hfint : Integrable f (covariateLaw p m) := memLp_one_iff_integrable.mp hmem1 refine ⟨?_, ?_⟩ · simpa [f, Real.norm_eq_abs] using hfint.norm · have hofReal : ofReal (∫ x, |f x| ∂covariateLaw p m) ≤ ofReal (p.eps1n n) := by rw [show ofReal (∫ x, |f x| ∂covariateLaw p m) = eLpNorm f 1 (covariateLaw p m) by rw [eLpNorm_one_eq_lintegral_enorm, ← ofReal_integral_norm_eq_lintegral_enorm hfint] simp only [Real.norm_eq_abs]] exact hnorm.trans hm.treatmentCodeRadiusLr have heps : 0 ≤ p.eps1n n := p.eps1_nonneg n hm.n_pos simpa [f] using (ENNReal.ofReal_le_ofReal_iff heps).mp hofReal constructor · intro m hm letI := covariate_probability m exact { n_pos := hm.n_pos independentTreatmentNoise := hm.independentTreatmentNoise outcomeMeanIndependence := hm.outcomeMeanIndependence thetaRange := hm.thetaRange gRange := hm.gRange qRange := hm.qRange etaSubGaussian := hm.etaSubGaussian xiSubGaussian := hm.xiSubGaussian cumulantSeparation := hm.cumulantSeparation treatmentCodeRadiusL1 := treatment_l1 m hm } constructor · intro m hm letI := covariate_probability m exact { n_pos := hm.n_pos independentTreatmentNoise := hm.independentTreatmentNoise outcomeMeanIndependence := hm.outcomeMeanIndependence thetaRange := hm.thetaRange gRange := hm.gRange qRange := hm.qRange etaSubGaussian := hm.etaSubGaussian xiSubGaussian := hm.xiSubGaussian cumulantSeparation := hm.cumulantSeparation treatmentCodeRadiusLr := by exact (eLpNorm_le_eLpNorm_of_exponent_le p.r_le_s (treatment_measurable m n)).trans hm.treatmentCodeRadius outcomeCodeRadiusLr := by exact (eLpNorm_le_eLpNorm_of_exponent_le p.r_le_s (outcome_measurable m n)).trans hm.outcomeCodeRadius } · intro hs m constructor · intro hm have hng : NonGaussianClass p n m := (show ∀ m : Model (Xspace := Xspace) p, JmsAceClass p n m → NonGaussianClass p n m from by intro m' hm' exact { n_pos := hm'.n_pos independentTreatmentNoise := hm'.independentTreatmentNoise outcomeMeanIndependence := hm'.outcomeMeanIndependence thetaRange := hm'.thetaRange gRange := hm'.gRange qRange := hm'.qRange etaSubGaussian := hm'.etaSubGaussian xiSubGaussian := hm'.xiSubGaussian cumulantSeparation := hm'.cumulantSeparation treatmentCodeRadiusL1 := treatment_l1 m' hm' }) m hm refine { toNonGaussianClass := hng, treatmentCodeRadius := ?_, outcomeCodeRadius := ?_ } · simpa only [TreatmentCodeRadiusLsAt, TreatmentCodeRadiusLrAt, hs] using hm.treatmentCodeRadiusLr · simpa only [OutcomeCodeRadiusLsAt, OutcomeCodeRadiusLrAt, hs] using hm.outcomeCodeRadiusLr · intro hm exact { n_pos := hm.n_pos independentTreatmentNoise := hm.independentTreatmentNoise outcomeMeanIndependence := hm.outcomeMeanIndependence thetaRange := hm.thetaRange gRange := hm.gRange qRange := hm.qRange etaSubGaussian := hm.etaSubGaussian xiSubGaussian := hm.xiSubGaussian cumulantSeparation := hm.cumulantSeparation treatmentCodeRadiusLr := by simpa only [TreatmentCodeRadiusLsAt, TreatmentCodeRadiusLrAt, hs] using hm.treatmentCodeRadius outcomeCodeRadiusLr := by simpa only [OutcomeCodeRadiusLsAt, OutcomeCodeRadiusLrAt, hs] using hm.outcomeCodeRadius }
CausalSmith.Stat.SaPlmCumulantConverse.jms_ace_class_relations · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ClassRelations.lean:17
Helpers.ComplexAnalysisLocal 9 declarations These are the two bounded local complex-analysis builds used by the contour bank.

Local finite-product and disk estimates

These are the two bounded local complex-analysis builds used by the contour bank. They are not external interfaces.

def blaschkeFactor

One radius-R Blaschke factor.

Definition (Lean source)
def blaschkeFactor (R : ℝ) (a z : ℂ) : ℂ := (R : ℂ) * (z - a) / ((R : ℂ) ^ 2 - star a * z)
def blaschkeProduct

A finite radius-R Blaschke product.

Definition (Lean source)
def blaschkeProduct {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (z : ℂ) : ℂ := ∏ i, blaschkeFactor R (a i) z
theorem blaschkeFactor_eq_zero_iff Lemma blaschkeFactor_eq_zero_iff in the paper ↗

Inside the defining disk, a Blaschke factor vanishes exactly at its listed zero.

Formal statement
R :
a z :
hR :
0 < R
ha :
‖a‖ < R
hz :
‖z‖ < R
blaschkeFactor R a z = 0 ↔ z = a
Proof (Lean source)
lemma blaschkeFactor_eq_zero_iff (R : ℝ) (a z : ℂ) (hR : 0 < R) (ha : ‖a‖ < R) (hz : ‖z‖ < R) : blaschkeFactor R a z = 0 ↔ z = a := by have hden : (R : ℂ) ^ 2 - star a * z ≠ 0 := by intro hzero have heq : (R : ℂ) ^ 2 = star a * z := sub_eq_zero.mp hzero have hn := congrArg norm heq rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] at hn have hprodlt : ‖a‖ * ‖z‖ < R * R := calc ‖a‖ * ‖z‖ ≤ R * ‖z‖ := mul_le_mul_of_nonneg_right ha.le (norm_nonneg z) _ < R * R := mul_lt_mul_of_pos_left hz hR nlinarith unfold blaschkeFactor rw [div_eq_zero_iff] constructor · rintro (hnum | hden') · have hR' : (R : ℂ) ≠ 0 := by exact_mod_cast hR.ne' exact sub_eq_zero.mp ((mul_eq_zero.mp hnum).resolve_left hR') · exact elim (hden hden') · intro hza left simp [hza]
CausalSmith.Stat.SaPlmCumulantConverse.blaschkeFactor_eq_zero_iff · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:33
theorem norm_blaschkeFactor_ge

On a disk of positive radius whose prescribed zero lies strictly inside it, at any point of the closed disk the modulus of the Blaschke factor is at least the distance from the point to the zero, divided by the radius plus the modulus of the point.

Formal statement
R :
a z :
hR :
0 < R
ha :
‖a‖ < R
hz :
‖z‖ ≤ R
‖blaschkeFactor R a z‖ ≥ ‖z - a‖ / (R + ‖z‖)
Proof (Lean source)
lemma norm_blaschkeFactor_ge (R : ℝ) (a z : ℂ) (hR : 0 < R) (ha : ‖a‖ < R) (hz : ‖z‖ ≤ R) : ‖blaschkeFactor R a z‖ ≥ ‖z - a‖ / (R + ‖z‖) := by unfold blaschkeFactor rw [norm_div, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR] have hden : ‖(R : ℂ) ^ 2 - star a * z‖ ≤ R * (R + ‖z‖) := by calc ‖(R : ℂ) ^ 2 - star a * z‖ ≤ ‖(R : ℂ) ^ 2‖ + ‖star a * z‖ := norm_sub_le _ _ _ = R ^ 2 + ‖a‖ * ‖z‖ := by rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] _ ≤ R ^ 2 + R * ‖z‖ := by gcongr _ = R * (R + ‖z‖) := by ring have hsum : 0 < R + ‖z‖ := add_pos_of_pos_of_nonneg hR (norm_nonneg _) by_cases hza : z = a · simp [hza] have hdenne : (R : ℂ) ^ 2 - star a * z ≠ 0 := by intro hzero have heq : (R : ℂ) ^ 2 = star a * z := sub_eq_zero.mp hzero have hn := congrArg norm heq rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] at hn nlinarith [norm_nonneg a, norm_nonneg z] have hdenpos : 0 < ‖(R : ℂ) ^ 2 - star a * z‖ := norm_pos_iff.mpr hdenne change ‖z - a‖ / (R + ‖z‖) ≤ R * ‖z - a‖ / ‖(R : ℂ) ^ 2 - star a * z‖ rw [div_le_div_iff₀ hsum hdenpos] calc ‖z - a‖ * ‖(R : ℂ) ^ 2 - star a * z‖ ≤ ‖z - a‖ * (R * (R + ‖z‖)) := mul_le_mul_of_nonneg_left hden (norm_nonneg _) _ = R * ‖z - a‖ * (R + ‖z‖) := by ring
CausalSmith.Stat.SaPlmCumulantConverse.norm_blaschkeFactor_ge · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:60
theorem analyticOnNhd_blaschkeProduct

For a disk of positive radius and a finite list of prescribed zeros all lying strictly inside it, the corresponding finite Blaschke product is analytic on a neighbourhood of every point of the open disk: its only possible singularities sit outside the closed disk.

Formal statement
N :
R :
a :
Fin N → ℂ
hR :
0 < R
ha :
∀ i, ‖a i‖ < R
Proof (Lean source)
lemma analyticOnNhd_blaschkeProduct {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (hR : 0 < R) (ha : ∀ i, ‖a i‖ < R) : AnalyticOnNhd ℂ (blaschkeProduct R a) (ball 0 R) := by intro z hz have hfac : ∀ i ∈ univ, AnalyticAt ℂ (fun w ↦ blaschkeFactor R (a i) w) z := by intro i hi apply AnalyticAt.div · fun_prop · fun_prop · intro hzero have heq : (R : ℂ) ^ 2 = star (a i) * z := sub_eq_zero.mp hzero have hn := congrArg norm heq rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] at hn have hzle : ‖z‖ < R := by simpa [mem_ball, dist_zero_right] using hz have hprodlt : ‖a i‖ * ‖z‖ < R * R := calc ‖a i‖ * ‖z‖ ≤ R * ‖z‖ := mul_le_mul_of_nonneg_right (ha i).le (norm_nonneg z) _ < R * R := mul_lt_mul_of_pos_left hzle hR nlinarith change AnalyticAt ℂ (fun w ↦ ∏ i, blaschkeFactor R (a i) w) z have hp := Finset.analyticAt_prod univ hfac rw [show (∏ i ∈ univ, (fun w ↦ blaschkeFactor R (a i) w)) = (fun w ↦ ∏ i, blaschkeFactor R (a i) w) by funext w simp] at hp exact hp
CausalSmith.Stat.SaPlmCumulantConverse.analyticOnNhd_blaschkeProduct · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:98
theorem norm_blaschkeProduct_eq_one_of_mem_sphere

For a disk of positive radius whose prescribed zeros all lie strictly inside it, at any point on the boundary circle the finite Blaschke product has modulus exactly one.

Formal statement
N :
R :
a :
Fin N → ℂ
hR :
0 < R
ha :
∀ i, ‖a i‖ < R
z :
hz :
z ∈ sphere 0 R
‖blaschkeProduct R a z‖ = 1
Proof (Lean source)
lemma norm_blaschkeProduct_eq_one_of_mem_sphere {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (hR : 0 < R) (ha : ∀ i, ‖a i‖ < R) {z : ℂ} (hz : z ∈ sphere 0 R) : ‖blaschkeProduct R a z‖ = 1 := by rw [blaschkeProduct, norm_prod] apply Finset.prod_eq_one intro i hi unfold blaschkeFactor rw [norm_div, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR] have hzR : ‖z‖ = R := by simpa [mem_sphere, dist_zero_right] using hz have hzSq : Complex.normSq z = R ^ 2 := by rw [← Complex.sq_norm, hzR] have hden : ‖(R : ℂ) ^ 2 - star (a i) * z‖ = R * ‖z - a i‖ := by rw [← sq_eq_sq₀ (norm_nonneg _) (mul_nonneg hR.le (norm_nonneg _))] rw [Complex.sq_norm, mul_pow, Complex.sq_norm] rw [Complex.normSq_sub] simp only [map_pow, Complex.normSq_ofReal, Complex.normSq_mul, Complex.normSq_conj, map_mul, starRingEnd_apply, star_star] rw [Complex.normSq_sub] rw [hzSq] simp [Complex.star_def, Complex.normSq_apply, Complex.mul_re] have hRre : ((R : ℂ) ^ 2).re = R ^ 2 := by rw [pow_two] simp [Complex.mul_re] ring have hRim : ((R : ℂ) ^ 2).im = 0 := by rw [pow_two] simp [Complex.mul_im] rw [hRre, hRim] norm_num ring rw [hden] have hne : z ≠ a i := by intro hza rw [hza] at hzR linarith [ha i] rw [mul_div_assoc] field_simp [hR.ne', norm_ne_zero_iff.mpr (sub_ne_zero.mpr hne)]
CausalSmith.Stat.SaPlmCumulantConverse.norm_blaschkeProduct_eq_one_of_mem_sphere · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:131
theorem norm_blaschkeProduct_zero_le_one

For a disk of positive radius whose prescribed zeros all lie strictly inside it, the finite Blaschke product has modulus at most one at the centre of the disk, since each factor there has modulus at most one.

Formal statement
N :
R :
a :
Fin N → ℂ
hR :
0 < R
ha :
∀ i, ‖a i‖ < R
‖blaschkeProduct R a 0‖ ≤ 1
Proof (Lean source)
lemma norm_blaschkeProduct_zero_le_one {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (hR : 0 < R) (ha : ∀ i, ‖a i‖ < R) : ‖blaschkeProduct R a 0‖ ≤ 1 := by rw [blaschkeProduct] rw [show ‖∏ i, blaschkeFactor R (a i) 0‖ = Finset.univ.prod (fun i ↦ ‖blaschkeFactor R (a i) 0‖) by simpa using norm_prod univ (fun i ↦ blaschkeFactor R (a i) 0)] apply Finset.prod_le_one · intro i _ exact norm_nonneg _ · intro i _ unfold blaschkeFactor rw [norm_div, norm_mul] simp only [zero_sub, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, mul_zero, sub_zero, norm_pow] have hR0 : R ≠ 0 := ne_of_gt hR rw [div_le_one (by positivity)] nlinarith [ha i]
CausalSmith.Stat.SaPlmCumulantConverse.norm_blaschkeProduct_zero_le_one · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:173
theorem harnack_re_le_of_nonneg_re

Harnack bound for the real part of a holomorphic function on a disk.

Formal statement
h :
ℂ → ℂ
R R1 :
hR :
0 < R
hR1 :
0 ≤ R1
hsmall :
R1 < R
han :
AnalyticOnNhd ℂ h (ball 0 R)
hnonneg :
∀ z ∈ ball (0 : ℂ) R, 0 ≤ (h z).re
∀ z : ℂ
if
‖z‖ ≤ R1
then
(h z).re ≤ ((R + R1) / (R - R1)) * (h 0).re
Proof (Lean source)
lemma harnack_re_le_of_nonneg_re (h : ℂ → ℂ) (R R1 : ℝ) (hR : 0 < R) (hR1 : 0 ≤ R1) (hsmall : R1 < R) (han : AnalyticOnNhd ℂ h (ball 0 R)) (hnonneg : ∀ z ∈ ball (0 : ℂ) R, 0 ≤ (h z).re) : ∀ z : ℂ, ‖z‖ ≤ R1 → (h z).re ≤ ((R + R1) / (R - R1)) * (h 0).re := by intro z hz have hzR : z ∈ ball (0 : ℂ) R := by rw [mem_ball_zero_iff] exact hz.trans_lt hsmall have hzero : 0 ≤ (h 0).re := hnonneg 0 (by simpa using hR) by_cases hz0 : ‖z‖ = 0 · have : z = 0 := norm_eq_zero.mp hz0 subst z have hden : 0 < R - R1 := sub_pos.mpr hsmall have hfac : 1 ≤ (R + R1) / (R - R1) := by rw [le_div_iff₀ hden] linarith simpa using mul_le_mul_of_nonneg_right hfac hzero have hzpos : 0 < ‖z‖ := lt_of_le_of_ne (norm_nonneg z) (Ne.symm hz0) have hdenz : 0 < R - ‖z‖ := sub_pos.mpr (mem_ball_zero_iff.mp hzR) have hden1 : 0 < R - R1 := sub_pos.mpr hsmall refine le_of_forall_pos_le_add fun eps heps ↦ ?_ let delta : ℝ := eps * (R - ‖z‖) / (2 * ‖z‖) have hdelta : 0 < delta := by dsimp [delta] positivity have hdiff : DifferentiableOn ℂ (fun w ↦ h 0 - h w) (ball 0 R) := by intro w hw exact (differentiableAt_const (c := h 0) |>.sub (han w hw).differentiableAt).differentiableWithinAt have hmaps : MapsTo (fun w ↦ h 0 - h w) (ball 0 R) {w : ℂ | w.re ≤ (h 0).re + delta} := by intro w hw change (h 0).re - (h w).re ≤ (h 0).re + delta have := hnonneg w hw linarith have hbc := Complex.borelCaratheodory_zero (M := (h 0).re + delta) (add_pos_of_nonneg_of_pos hzero hdelta) hdiff hmaps hR hzR (by simp) have hre : (h z).re - (h 0).re ≤ ‖h 0 - h z‖ := by calc (h z).re - (h 0).re = -(h 0 - h z).re := by simp _ ≤ |(h 0 - h z).re| := neg_le_abs _ _ ≤ ‖h 0 - h z‖ := Complex.abs_re_le_norm _ have hraw : (h z).re ≤ (h 0).re + 2 * ((h 0).re + delta) * ‖z‖ / (R - ‖z‖) := by linarith have hR1bound : (h 0).re + 2 * (h 0).re * ‖z‖ / (R - ‖z‖) ≤ ((R + R1) / (R - R1)) * (h 0).re := by have hratio : (R + ‖z‖) / (R - ‖z‖) ≤ (R + R1) / (R - R1) := by rw [div_le_div_iff₀ hdenz hden1] nlinarith have hid : (h 0).re + 2 * (h 0).re * ‖z‖ / (R - ‖z‖) = ((R + ‖z‖) / (R - ‖z‖)) * (h 0).re := by field_simp ring rw [hid] exact mul_le_mul_of_nonneg_right hratio hzero have hdeltaTerm : 2 * delta * ‖z‖ / (R - ‖z‖) = eps := by dsimp [delta] field_simp calc (h z).re ≤ (h 0).re + 2 * ((h 0).re + delta) * ‖z‖ / (R - ‖z‖) := hraw _ = ((h 0).re + 2 * (h 0).re * ‖z‖ / (R - ‖z‖)) + eps := by rw [← hdeltaTerm] ring _ ≤ ((R + R1) / (R - R1)) * (h 0).re + eps := by simpa [add_comm] using add_le_add_right hR1bound eps
CausalSmith.Stat.SaPlmCumulantConverse.harnack_re_le_of_nonneg_re · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:196
theorem log_norm_ge_of_zero_free_ball

Log-modulus lower bound for a bounded zero-free holomorphic function.

Formal statement
f :
ℂ → ℂ
A R R1 :
hR :
0 < R
hR1 :
0 ≤ R1
hsmall :
R1 < R
han :
AnalyticOnNhd ℂ f (ball 0 R)
hzero :
∀ z ∈ ball (0 : ℂ) R, f z ≠ 0
hupper :
∀ z ∈ ball (0 : ℂ) R, ‖f z‖ ≤ exp A
hone :
1 ≤ ‖f 0‖
∀ z : ℂ
if
‖z‖ ≤ R1
then
-(((R + R1) / (R - R1)) - 1) * A ≤ log ‖f z‖
Proof (Lean source)
lemma log_norm_ge_of_zero_free_ball (f : ℂ → ℂ) (A R R1 : ℝ) (hR : 0 < R) (hR1 : 0 ≤ R1) (hsmall : R1 < R) (han : AnalyticOnNhd ℂ f (ball 0 R)) (hzero : ∀ z ∈ ball (0 : ℂ) R, f z ≠ 0) (hupper : ∀ z ∈ ball (0 : ℂ) R, ‖f z‖ ≤ exp A) (hone : 1 ≤ ‖f 0‖) : ∀ z : ℂ, ‖z‖ ≤ R1 → -(((R + R1) / (R - R1)) - 1) * A ≤ Real.log ‖f z‖ := by letI : FiniteDimensional ℝ ℂ := Complex.basisOneI.finiteDimensional_of_finite let u : ℂ → ℝ := fun z ↦ A - Real.log ‖f z‖ have hu : InnerProductSpace.HarmonicOnNhd u (ball (0 : ℂ) R) := by intro z hz exact InnerProductSpace.harmonicAt_const A |>.sub ((han z hz).harmonicAt_log_norm (hzero z hz)) obtain ⟨H, hHan, hHre⟩ := hu.exists_analyticOnNhd_ball_re_eq have hHnonneg : ∀ z ∈ ball (0 : ℂ) R, 0 ≤ (H z).re := by intro z hz rw [show (H z).re = u z from hHre hz] dsimp [u] have hnormpos : 0 < ‖f z‖ := norm_pos_iff.mpr (hzero z hz) exact sub_nonneg.mpr ((Real.log_le_iff_le_exp hnormpos).mpr (hupper z hz)) have hRzero : (0 : ℂ) ∈ ball 0 R := by simpa using hR have hlog0 : 0 ≤ Real.log ‖f 0‖ := Real.log_nonneg hone intro z hz have hHar := harnack_re_le_of_nonneg_re H R R1 hR hR1 hsmall hHan hHnonneg z hz rw [show (H z).re = u z from hHre (by rw [mem_ball_zero_iff] exact hz.trans_lt hsmall), show (H 0).re = u 0 from hHre hRzero] at hHar dsimp [u] at hHar have hfac : 0 ≤ (R + R1) / (R - R1) - 1 := by have hden : 0 < R - R1 := sub_pos.mpr hsmall rw [sub_nonneg, le_div_iff₀ hden] linarith nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.log_norm_ge_of_zero_free_ball · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ComplexAnalysisLocal.lean:267
Helpers.ContourBank 16 declarations The bank reads one experiment-wide record for the primitive constants.

Fixed-fuel translated-dyadic contour bank

The bank reads one experiment-wide record for the primitive constants. Its integers are the displayed closed forms; there is no unbounded or proof-selected search, exact-real inspection, or law query.

A supplied positive certified-real record. Executable consumers inspect only name.approx, name.modulus, and the rational lower witness.

Definition (Lean source)
name :
lower :
lower_pos :
0 < lower
lower_le_value :
(lower : ℝ) ≤ name.value
CausalSmith.Stat.SaPlmCumulantConverse.PositiveCertifiedReal · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:28

The one fixed primitive record shared by the bank and estimator.

Definition (Lean source)
kName :
k_value :
kName = p.k
deltaName :
delta_value :
deltaName.name.value = p.delta
psietaName :
psieta_value :
psietaName.name.value = p.psieta
R0_value :
R0Name.name.value = zeroRadius p
R1_value :
R1Name.name.value = searchRadius p
zeroRadius_contract :
zeroRadius p = Ak p.k * (p.psieta ^ 2 / p.delta) ^ ((p.k - 2 : ℝ)⁻¹)
searchRadius_contract :
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedBankInputs · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:36
def transport

Reuse the identical primitive names for another parameter record carrying the same primitive constants. Only the propositional value contracts are transported; no new name is selected or reconstructed.

Definition (Lean source)
def CertifiedBankInputs.transport {p q : Parameters} (pStar : CertifiedBankInputs p) (hk : p.k = q.k) (hdelta : p.delta = q.delta) (hpsi : p.psieta = q.psieta) : CertifiedBankInputs q where kName := pStar.kName k_value := pStar.k_value.trans hk deltaName := pStar.deltaName delta_value := pStar.delta_value.trans hdelta psietaName := pStar.psietaName psieta_value := pStar.psieta_value.trans hpsi R0Name := pStar.R0Name R0_value := pStar.R0_value.trans (by simp [zeroRadius, hk, hdelta, hpsi]) R1Name := pStar.R1Name R1_value := pStar.R1_value.trans (by simp [searchRadius, zeroRadius, hk, hdelta, hpsi]) zeroRadius_contract := rfl searchRadius_contract := rfl
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedBankInputs.transport · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:52
def errorOne

Error-one rational refinement used exactly twice by the bank.

Definition (Lean source)
def errorOne : PosRat := ⟨1, by norm_num⟩
def positiveCeil

Natural ceiling of a rational upper endpoint, clamped below by one.

Definition (Lean source)
def positiveCeil (q : ℚ) : ℕ := ⌈max 1 q⌉₊
CausalSmith.Stat.SaPlmCumulantConverse.positiveCeil · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:75

The clamped rational ceiling dominates its input.

Formal statement
q :
q ≤ ((positiveCeil q : ℕ) : ℚ)
Proof (Lean source)
lemma rat_le_positiveCeil (q : ℚ) : q ≤ ((positiveCeil q : ℕ) : ℚ) := by unfold positiveCeil exact (le_max_right (1 : ℚ) q).trans (Nat.le_ceil _)
CausalSmith.Stat.SaPlmCumulantConverse.rat_le_positiveCeil · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:78

The clamped rational ceiling is at least one.

Formal statement
q :
1 ≤ positiveCeil q
Proof (Lean source)
lemma one_le_positiveCeil (q : ℚ) : 1 ≤ positiveCeil q := by unfold positiveCeil exact_mod_cast (le_max_left (1 : ℚ) q).trans (Nat.le_ceil _)
CausalSmith.Stat.SaPlmCumulantConverse.one_le_positiveCeil · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:83

All data computed by the displayed fixed-fuel bank program.

Definition (Lean source)
Upsi :
UR :
Ncert :
mStar :
JBase :
rhoName :
Fin (JBase + 1) → CertifiedReal
rho :
Fin (JBase + 1) → ℝ
rho_value :
∀ j, (rhoName j).value = rho j
dStar :
hStar :
eStar :
dStarDen :
uStar :
aStarRat :
aStarRat_pos :
0 < aStarRat
aStar :
aStar_eq :
aStar = (aStarRat : ℝ)
CausalSmith.Stat.SaPlmCumulantConverse.ContourBankData · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:88
def J

Cardinality of the explicit bank.

Definition (Lean source)
def ContourBankData.J (B : ContourBankData) : ℕ := B.JBase + 1
CausalSmith.Stat.SaPlmCumulantConverse.ContourBankData.J · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:108
def bankCircle

The circle belonging to one bank radius.

Definition (Lean source)
def bankCircle (B : ContourBankData) (j : Fin (B.JBase + 1)) : Set ℂ := sphere 0 (B.rho j) -- @realizes Cj(positively oriented circle |z|=rho_j)

A dyadic grid with mesh 2⁻(k+1) and indices through 2^k stays strictly below the unit-length endpoint after translation by one quarter.

Formal statement
k j :
hj :
j ≤ 2 ^ k
(1 / 4 : ℚ) + j * (1 / 2 : ℚ) ^ (k + 1) < 1
Proof (Lean source)
lemma rat_grid_lt_one (k j : ℕ) (hj : j ≤ 2 ^ k) : (1 / 4 : ℚ) + j * (1 / 2 : ℚ) ^ (k + 1) < 1 := by have hp : (0 : ℚ) < (2 : ℚ) ^ k := by positivity rw [pow_succ] simp only [one_div, inv_pow] have hj' : (j : ℚ) ≤ (2 : ℚ) ^ k := by exact_mod_cast hj have h := mul_le_mul_of_nonneg_right hj' (inv_nonneg.mpr hp.le) rw [mul_inv_cancel₀ hp.ne'] at h norm_num at h ⊢ nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.rat_grid_lt_one · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:116
theorem exists_translated_grid_radius_separated Lemma exists_translated_grid_radius_separated in the paper ↗

More grid points than listed complex numbers leave one translated grid radius uniformly separated from every listed modulus.

Formal statement
N J :
a :
Fin N → ℂ
base d h :
hd :
0 < d
hh :
2 * h < d
hcard :
N < J
∃ j : Fin J, ∀ i, h ≤ |‖a i‖ - (base + (j : ℕ) * d)|
Proof (Lean source)
lemma exists_translated_grid_radius_separated {N J : ℕ} (a : Fin N → ℂ) (base d h : ℝ) (hd : 0 < d) (hh : 2 * h < d) (hcard : N < J) : ∃ j : Fin J, ∀ i, h ≤ |‖a i‖ - (base + (j : ℕ) * d)| := by classical by_contra hn push_neg at hn choose f hf using hn have hinj : Injective f := by intro j k heq by_contra hjk have htri := abs_sub_le (base + (j : ℕ) * d) ‖a (f j)‖ (base + (k : ℕ) * d) rw [heq] at htri have hjclose := hf j rw [heq, abs_sub_comm] at hjclose have hkclose := hf k have hdistlt : |(base + (j : ℕ) * d) - (base + (k : ℕ) * d)| < 2 * h := by linarith rcases lt_or_gt_of_ne hjk with hjk' | hkj' · have hcast : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast hjk' have hdist : d ≤ |(base + (j : ℕ) * d) - (base + (k : ℕ) * d)| := by rw [abs_of_nonpos] · nlinarith · nlinarith linarith · have hcast : (k : ℝ) + 1 ≤ (j : ℝ) := by exact_mod_cast hkj' have hdist : d ≤ |(base + (j : ℕ) * d) - (base + (k : ℕ) * d)| := by rw [abs_of_nonneg] · nlinarith · nlinarith linarith have hc := Fintype.card_le_of_injective f hinj simp only [Fintype.card_fin] at hc omega
CausalSmith.Stat.SaPlmCumulantConverse.exists_translated_grid_radius_separated · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:129
theorem dyadic_product_certificate Lemma dyadic_product_certificate in the paper ↗

The closed-form dyadic exponent dominates a product of at most K factors, each bounded below by a dyadic mesh divided by a positive integer.

Formal statement
m D N K :
hD :
0 < D
hNK :
N ≤ K
(1 / 2 : ℝ) ^ (K * (m + D)) ≤ (((1 / 2 : ℝ) ^ m) / D) ^ N
Proof (Lean source)
lemma dyadic_product_certificate (m D N K : ℕ) (hD : 0 < D) (hNK : N ≤ K) : (1 / 2 : ℝ) ^ (K * (m + D)) ≤ (((1 / 2 : ℝ) ^ m) / D) ^ N := by have hDpow : D ≤ 2 ^ D := (D.lt_two_pow_self).le have hInv : (1 / 2 : ℝ) ^ D ≤ 1 / D := by rw [one_div_pow] exact one_div_le_one_div_of_le (by exact_mod_cast hD) (by exact_mod_cast hDpow) let t : ℝ := (1 / 2) ^ (m + D) let b : ℝ := (1 / 2) ^ m / D have htb : t ≤ b := by dsimp [t, b] rw [pow_add] calc (1 / 2 : ℝ) ^ m * (1 / 2 : ℝ) ^ D ≤ (1 / 2 : ℝ) ^ m * (1 / D) := by gcongr _ = (1 / 2 : ℝ) ^ m / D := by ring have ht0 : 0 ≤ t := by positivity have ht1 : t ≤ 1 := by dsimp [t] exact pow_le_one₀ (by norm_num) (by norm_num) have hpow : t ^ K ≤ t ^ N := pow_le_pow_of_le_one ht0 ht1 hNK calc (1 / 2 : ℝ) ^ (K * (m + D)) = t ^ K := by change (1 / 2 : ℝ) ^ (K * (m + D)) = ((1 / 2 : ℝ) ^ (m + D)) ^ K rw [← pow_mul, Nat.mul_comm] _ ≤ t ^ N := hpow _ ≤ b ^ N := pow_le_pow_left₀ ht0 htb N _ = (((1 / 2 : ℝ) ^ m) / D) ^ N := rfl
CausalSmith.Stat.SaPlmCumulantConverse.dyadic_product_certificate · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:168
theorem dyadic_two_mul_le_exp_neg Lemma dyadic_two_mul_le_exp_neg in the paper ↗

Two binary digits per natural exponent are enough to lie below the corresponding negative exponential.

Formal statement
E :
(1 / 2 : ℝ) ^ (2 * E) ≤ exp (-(E : ℝ))
Proof (Lean source)
lemma dyadic_two_mul_le_exp_neg (E : ℕ) : (1 / 2 : ℝ) ^ (2 * E) ≤ exp (-(E : ℝ)) := by have hbase : (1 / 2 : ℝ) ^ 2 ≤ exp (-1) := by rw [Real.exp_neg] norm_num have hi : (4 : ℝ)⁻¹ ≤ (exp 1)⁻¹ := (inv_le_inv₀ (a := (4 : ℝ)) (b := exp 1) (by norm_num) (Real.exp_pos 1)).2 (by nlinarith [Real.exp_one_lt_three]) simpa [one_div] using hi calc (1 / 2 : ℝ) ^ (2 * E) = ((1 / 2 : ℝ) ^ 2) ^ E := by rw [pow_mul] _ ≤ (exp (-1)) ^ E := by gcongr _ = exp (-(E : ℝ)) := by rw [← Real.exp_nat_mul] congr 1 ring
CausalSmith.Stat.SaPlmCumulantConverse.dyadic_two_mul_le_exp_neg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:200
def contourBank

The closed-form law-blind translated-dyadic bank.

Definition (Lean source)
-- @node: def:contour-bank-handle def contourBank (p : Parameters) (pStar : CertifiedBankInputs p) : ContourBankData := let psiI := certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne let R1I := certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne let Upsi := positiveCeil psiI.hi let UR := positiveCeil R1I.hi let Ncert := 4 * Upsi ^ 2 * (UR + 2) ^ 3 let mStar := Ncert + 3 let dStar : ℚ := (1 / 2) ^ mStar let hStar := dStar / 3 let JBase := 2 ^ (mStar - 1) let rhoName : Fin (JBase + 1) → CertifiedReal := fun j ↦ CertifiedReal.add pStar.R0Name.name (CertifiedReal.ofRat (1 / 4 + j.1 * dStar)) let eStar := 8 * UR * Upsi ^ 2 * (UR + 1) ^ 2 let dStarDen := 3 * (2 * UR + 1) let uStar := 2 * eStar + Ncert * (mStar + dStarDen) let aStarRat : ℚ := (1 / 2) ^ uStar { Upsi := Upsi UR := UR Ncert := Ncert mStar := mStar JBase := JBase rhoName := rhoName rho := fun j ↦ (rhoName j).value rho_value := fun _ ↦ rfl dStar := dStar hStar := hStar eStar := eStar dStarDen := dStarDen uStar := uStar aStarRat := aStarRat aStarRat_pos := by dsimp [aStarRat]; positivity aStar := (aStarRat : ℝ) aStar_eq := rfl }
theorem finite_contour_bank Lemma 8 in the paper ↗

The fixed-fuel bank contains a uniformly conditioned positive-count circle for every treatment-noise transform in the broad class.

Formal statement
Xspace :
Type*
n :
hn :
1 ≤ n
m :
Model (Xspace := Xspace) p
hclass :
let B := contourBank p pStar 0 < B.aStar ∧
B.Ncert = 4 * B.Upsi ^ 2 * (B.UR + 2) ^ 3 ∧
B.mStar = B.Ncert + 3 ∧
B.J = 2 ^ (B.mStar - 1) + 1 ∧
B.dStar = (1 / 2 : ℚ) ^ B.mStar ∧
B.hStar = B.dStar / 3 ∧
B.eStar = 8 * B.UR * B.Upsi ^ 2 * (B.UR + 1) ^ 2 ∧
B.dStarDen = 3 * (2 * B.UR + 1) ∧
B.uStar = 2 * B.eStar + B.Ncert * (B.mStar + B.dStarDen) ∧
B.aStarRat = (1 / 2 : ℚ) ^ B.uStar ∧
StrictMono B.rho ∧
(∀ j, zeroRadius p < B.rho j ∧ B.rho j < searchRadius p) ∧
∃ j : Fin (B.JBase + 1),
0 < zeroMultiplicityCount (treatmentMGF p m) 0 (B.rho j) ∧
∀ z ∈ bankCircle B j, B.aStar ≤ ‖treatmentMGF p m z‖
Proof (Lean source)
-- @node: lem:finite-contour-bank lemma finite_contour_bank {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters) (pStar : CertifiedBankInputs p) (n : ℕ) (hn : 1 ≤ n) (m : Model (Xspace := Xspace) p) (hclass : NonGaussianClass p n m) : let B := contourBank p pStar 0 < B.aStar ∧ B.Ncert = 4 * B.Upsi ^ 2 * (B.UR + 2) ^ 3 ∧ B.mStar = B.Ncert + 3 ∧ B.J = 2 ^ (B.mStar - 1) + 1 ∧ B.dStar = (1 / 2 : ℚ) ^ B.mStar ∧ B.hStar = B.dStar / 3 ∧ B.eStar = 8 * B.UR * B.Upsi ^ 2 * (B.UR + 1) ^ 2 ∧ B.dStarDen = 3 * (2 * B.UR + 1) ∧ B.uStar = 2 * B.eStar + B.Ncert * (B.mStar + B.dStarDen) ∧ B.aStarRat = (1 / 2 : ℚ) ^ B.uStar ∧ StrictMono B.rho ∧ (∀ j, zeroRadius p < B.rho j ∧ B.rho j < searchRadius p) ∧ ∃ j : Fin (B.JBase + 1), 0 < zeroMultiplicityCount (treatmentMGF p m) 0 (B.rho j) ∧ ∀ z ∈ bankCircle B j, B.aStar ≤ ‖treatmentMGF p m z‖ := by dsimp [contourBank, ContourBankData.J] refine ⟨by positivity, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, rfl, ?_, ?_, ?_⟩ · intro i j hij simp [CertifiedReal.add, CertifiedReal.ofRat] gcongr · intro j simp only [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value] constructor · norm_num positivity · rw [pStar.searchRadius_contract] have hj : (j : ℕ) ≤ 2 ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 2) := Nat.le_of_lt_succ j.isLt norm_num at hj ⊢ have hq := rat_grid_lt_one (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 2) (j : ℕ) hj norm_num at hq have hq' : (1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 3) < 1 := by simpa [Nat.add_assoc] using hq have hc : ((↑((1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 3)) : ℝ) < (↑(1 : ℚ) : ℝ)) := Rat.cast_lt.mpr hq' simpa using hc · let psiI := certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne let R1I := certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne let Upsi := positiveCeil psiI.hi let UR := positiveCeil R1I.hi let Ncert := 4 * Upsi ^ 2 * (UR + 2) ^ 3 let mStar := Ncert + 3 let JBase := 2 ^ (mStar - 1) let dQ : ℚ := (1 / 2) ^ mStar let d : ℝ := (dQ : ℝ) let h : ℝ := d / 3 let R1 := searchRadius p let Rfac := R1 + 1 let Rout := R1 + 2 let M := treatmentMGF p m have hpsi : p.psieta ≤ (Upsi : ℝ) := by have hc := certifiedIntervalArithmetic.refine_contains pStar.psietaName.name errorOne have hhi : p.psieta ≤ (psiI.hi : ℝ) := by simpa [psiI, RatInterval.Contains, pStar.psieta_value] using hc.2 have hceilQ := rat_le_positiveCeil psiI.hi have hceilR : (psiI.hi : ℝ) ≤ (Upsi : ℝ) := by exact Rat.cast_le.mpr hceilQ exact hhi.trans hceilR have hR1U : R1 ≤ (UR : ℝ) := by have hc := certifiedIntervalArithmetic.refine_contains pStar.R1Name.name errorOne have hhi : R1 ≤ (R1I.hi : ℝ) := by simpa [R1, R1I, RatInterval.Contains, pStar.R1_value] using hc.2 have hceilQ := rat_le_positiveCeil R1I.hi have hceilR : (R1I.hi : ℝ) ≤ (UR : ℝ) := Rat.cast_le.mpr hceilQ exact hhi.trans hceilR have hR1pos : 0 < R1 := by dsimp [R1, searchRadius] have hz : 0 < zeroRadius p := by rw [← pStar.R0_value] have hl : (0 : ℝ) < (pStar.R0Name.lower : ℝ) := by exact_mod_cast pStar.R0Name.lower_pos exact hl.trans_le pStar.R0Name.lower_le_value linarith have hRfac : 0 < Rfac := by dsimp [Rfac]; linarith have hRout : 0 < Rout := by dsimp [Rout]; linarith have hfacout : Rfac < Rout := by dsimp [Rfac, Rout]; linarith obtain ⟨hMan, hMzero, hMbound⟩ := treatmentMGF_entire_normalized_bound p m n hclass have hupper : ∀ z ∈ sphere (0 : ℂ) Rout, ‖M z‖ ≤ exp (4 * p.psieta ^ 2 * Rout ^ 2) := by intro z hz have hnorm : ‖z‖ = Rout := by simpa [mem_sphere, dist_zero_right, abs_of_pos hRout] using hz simpa [M, hnorm] using hMbound z have hjensen := jensen_zeroMultiplicityCount_bound hRfac hfacout (by positivity : 0 ≤ 4 * p.psieta ^ 2 * Rout ^ 2) hMan hMzero hupper have hlog : 1 / Rout ≤ log (Rout / Rfac) := by have hx : 0 ≤ (1 / Rfac : ℝ) := by positivity have hbase := Real.le_log_one_add_of_nonneg hx have hratio : Rout / Rfac = 1 + 1 / Rfac := by dsimp [Rout, Rfac] field_simp ring rw [hratio] apply le_trans _ hbase rw [div_le_div_iff₀ hRout (by positivity : 0 < (1 / Rfac : ℝ) + 2)] field_simp nlinarith have hcountReal : (zeroMultiplicityCount M 0 Rfac : ℝ) ≤ 4 * p.psieta ^ 2 * Rout ^ 3 := by have hcountnonneg : 0 ≤ (zeroMultiplicityCount M 0 Rfac : ℝ) := by positivity have hlogmul := mul_le_mul_of_nonneg_left hlog hcountnonneg have hdiv : (zeroMultiplicityCount M 0 Rfac : ℝ) / Rout ≤ 4 * p.psieta ^ 2 * Rout ^ 2 := by exact (by simpa [div_eq_mul_inv, mul_comm, mul_left_comm] using hlogmul.trans hjensen) calc (zeroMultiplicityCount M 0 Rfac : ℝ) = ((zeroMultiplicityCount M 0 Rfac : ℝ) / Rout) * Rout := by field_simp _ ≤ (4 * p.psieta ^ 2 * Rout ^ 2) * Rout := by gcongr _ = 4 * p.psieta ^ 2 * Rout ^ 3 := by ring have hcountCert : zeroMultiplicityCount M 0 Rfac ≤ Ncert := by have hpsi0 : 0 ≤ p.psieta := p.constants_pos.2.2.2.1.le have hRoutU : Rout ≤ (UR + 2 : ℕ) := by dsimp [Rout] norm_num linarith have hbound : 4 * p.psieta ^ 2 * Rout ^ 3 ≤ (Ncert : ℝ) := by have hRoutU' : Rout ≤ (UR : ℝ) + 2 := by simpa using hRoutU dsimp [Ncert] simp only [Nat.cast_mul, Nat.cast_pow, Nat.cast_add, Nat.cast_ofNat] gcongr exact_mod_cast hcountReal.trans hbound obtain ⟨N, a, g, ha, hgAn, hgDiff, hgzero, hNcount, hfactor⟩ := exists_complete_pointwise_blaschke_factorization hRfac (by simpa [M] using hMan.mono (by simp)) (by simpa [M, hMzero]) have hNle : N ≤ Ncert := by simpa [M, hNcount] using hcountCert have hNcard : N < JBase + 1 := by have hpow : Ncert < 2 ^ (Ncert + 2) + 1 := by have hk := Ncert.lt_two_pow_self have hpmono : 2 ^ Ncert ≤ 2 ^ (Ncert + 2) := Nat.pow_le_pow_right (n := 2) (by omega) (by omega) omega dsimp [JBase, mStar] omega have hd : 0 < d := by dsimp [d, dQ]; positivity have hh : 2 * h < d := by dsimp [h]; linarith obtain ⟨j, hjsep⟩ := exists_translated_grid_radius_separated a (zeroRadius p + 1 / 4) d h hd hh hNcard refine ⟨j, ?_, ?_⟩ · have hzloc := zero_localization p m hclass.etaSubGaussian hclass.cumulantSeparation rcases hzloc with ⟨z0, hz0, hMz0⟩ apply zeroMultiplicityCount_pos_of_exists_zero · have hrhopos : 0 < zeroRadius p + 1 / 4 + (j : ℕ) * d := by have : 0 < zeroRadius p := by rw [← pStar.R0_value] have hl : (0 : ℝ) < (pStar.R0Name.lower : ℝ) := by exact_mod_cast pStar.R0Name.lower_pos exact hl.trans_le pStar.R0Name.lower_le_value positivity simpa [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value, add_assoc, d, dQ, mStar, Ncert, Upsi, UR, psiI, R1I] using hrhopos · exact hMan.mono (by simp) · intro z hz have hnorm : ‖z‖ = zeroRadius p + 1 / 4 + (j : ℕ) * d := by simpa [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value, add_assoc, d, dQ, mStar, Ncert, Upsi, UR, psiI, R1I, mem_sphere, dist_zero_right] using hz intro hzero have hzfac : z ∈ ball (0 : ℂ) Rfac := by rw [mem_ball_zero_iff] have hjR := rat_grid_lt_one (Ncert + 2) (j : ℕ) (Nat.le_of_lt_succ j.isLt) have hjR' : (1 / 4 : ℝ) + (j : ℕ) * d < 1 := by have hq : (1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (Ncert + 3) < 1 := by simpa [Nat.add_assoc] using hjR have hc : ((↑((1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (Ncert + 3)) : ℝ) < (↑(1 : ℚ) : ℝ)) := Rat.cast_lt.mpr hq simpa [d, dQ, mStar] using hc dsimp [Rfac, R1] rw [pStar.searchRadius_contract] linarith have hfactorz := hfactor z (ball_subset_closedBall hzfac) have hprod0 : blaschkeProduct Rfac a z * g z = 0 := hfactorz.symm.trans hzero have hBzero : blaschkeProduct Rfac a z = 0 := (mul_eq_zero.mp hprod0).resolve_right (hgzero z hzfac) rw [blaschkeProduct, Finset.prod_eq_zero_iff] at hBzero obtain ⟨i, hi, hizero⟩ := hBzero have hza : z = a i := (blaschkeFactor_eq_zero_iff Rfac (a i) z hRfac (ha i) (by simpa [mem_ball, dist_zero_right] using hzfac)).mp hizero have hsep := hjsep i rw [← hza, hnorm, sub_self, abs_zero] at hsep exact (not_lt_of_ge hsep) (by dsimp [h, d, dQ]; positivity) · refine ⟨z0, ?_, hMz0⟩ rw [mem_ball_zero_iff] have hrho : zeroRadius p < (pStar.R0Name.name.add (CertifiedReal.ofRat (1 / 4 + (j : ℕ) * (1 / 2 : ℚ) ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 3)))).value := by simp [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value] norm_num positivity exact hz0.trans_lt hrho · intro z hz have hnorm : ‖z‖ = zeroRadius p + 1 / 4 + (j : ℕ) * d := by simpa [bankCircle, CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value, add_assoc, d, dQ, mStar, Ncert, Upsi, UR, psiI, R1I, mem_sphere, dist_zero_right] using hz have hjR := rat_grid_lt_one (Ncert + 2) (j : ℕ) (Nat.le_of_lt_succ j.isLt) have hjR' : (1 / 4 : ℝ) + (j : ℕ) * d < 1 := by have hq : (1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (Ncert + 3) < 1 := by simpa [Nat.add_assoc] using hjR have hc : ((↑((1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (Ncert + 3)) : ℝ) < (↑(1 : ℚ) : ℝ)) := Rat.cast_lt.mpr hq simpa [d, dQ, mStar] using hc have hzR1 : ‖z‖ ≤ R1 := by rw [hnorm] dsimp [R1] rw [pStar.searchRadius_contract] linarith have hfupper : ∀ w ∈ sphere (0 : ℂ) Rfac, ‖M w‖ ≤ exp (4 * p.psieta ^ 2 * Rfac ^ 2) := by -- … truncated; follow the source link for the rest …
CausalSmith.Stat.SaPlmCumulantConverse.finite_contour_bank · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ContourBank.lean:256
Helpers.Cumulant 2 declarations Cumulants and transform-zero localization

Cumulants and transform-zero localization

theorem treatmentMGF_entire_normalized_bound Lemma treatmentMGF_entire_normalized_bound in the paper ↗

The treatment-noise transform is entire, normalized at the origin, and obeys the quadratic exponential envelope supplied by the Luxemburg bound.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hclass :
treatmentMGF p m 0 = 1 ∧
∀ z : ℂ, ‖treatmentMGF p m z‖ ≤ exp (4 * p.psieta ^ 2 * ‖z‖ ^ 2)
Proof (Lean source)
lemma treatmentMGF_entire_normalized_bound (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hclass : NonGaussianClass p n m) : AnalyticOnNhd ℂ (treatmentMGF p m) univtreatmentMGF p m 0 = 1 ∧ ∀ z : ℂ, ‖treatmentMGF p m z‖ ≤ exp (4 * p.psieta ^ 2 * ‖z‖ ^ 2) := by have hψ : 0 < p.psieta := p.constants_pos.2.2.2.1 have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hmx : comap (fun o : Obs Xspace ↦ o.1) inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := Measurable.comap_le measurable_fst have hgint : Integrable (fun o : Obs Xspace ↦ m.g0 (covariate o)) m.P := MeasureTheory.integrable_condExp.congr m.g0_condMean have hetaInt : Integrable (eta p m) m.P := m.treatment_integrable.sub hgint have hcenter : ∫ o, eta p m o ∂m.P = 0 := by have hgIntegral : (∫ o, m.g0 (covariate o) ∂m.P) = ∫ o, treatment o ∂m.P := by calc (∫ o, m.g0 (covariate o) ∂m.P) = ∫ o, (@condExp (Obs Xspace) ℝ (comap (fun o : Obs Xspace ↦ o.1) inferInstance) inferInstance _ _ m.P (fun o ↦ o.2.1)) o ∂m.P := integral_congr_ae m.g0_condMean.symm _ = ∫ o, treatment o ∂m.P := MeasureTheory.integral_condExp hmx change ∫ o, o.2.1 - m.g0 o.1 ∂m.P = 0 rw [integral_sub m.treatment_integrable (by simpa [covariate] using hgint)] change (∫ o, treatment o ∂m.P) - ∫ o, m.g0 (covariate o) ∂m.P = 0 rw [hgIntegral, sub_self] have htilt (t : ℝ) : Integrable (fun o ↦ exp (t * eta p m o)) m.P := integrable_exp_mul_of_luxemburg_sq hψ hetaMeas hclass.etaSubGaussian.1 t have hmgf (t : ℝ) : ∫ o, exp (t * eta p m o) ∂m.P ≤ exp (4 * p.psieta ^ 2 * t ^ 2) := integral_exp_mul_le_exp_four_mul_sq_of_luxemburg hψ hetaMeas hetaInt hclass.etaSubGaussian.1 hclass.etaSubGaussian.2 hcenter t have hetaSet : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, htilt t] refine ⟨?_, ?_, ?_⟩ · intro z hz unfold treatmentMGF apply analyticAt_complexMGF simp [hetaSet] · unfold treatmentMGF simpa using (complexMGF_ofReal (X := eta p m) (μ := m.P) 0) · intro z calc ‖treatmentMGF p m z‖ ≤ mgf (eta p m) m.P z.re := norm_complexMGF_le_mgf _ = ∫ o, exp (z.re * eta p m o) ∂m.P := rfl _ ≤ exp (4 * p.psieta ^ 2 * z.re ^ 2) := hmgf z.re _ ≤ exp (4 * p.psieta ^ 2 * ‖z‖ ^ 2) := by apply Real.exp_le_exp.mpr have hre := Complex.abs_re_le_norm z have hsquares : z.re ^ 2 ≤ ‖z‖ ^ 2 := by rw [← sq_abs] exact (sq_le_sq₀ (abs_nonneg _) (norm_nonneg _)).mpr hre gcongr
CausalSmith.Stat.SaPlmCumulantConverse.treatmentMGF_entire_normalized_bound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Cumulant.lean:21
theorem zero_localization Lemma 3 in the paper ↗

A separated cumulant forces a transform zero in the explicit disk.

Formal statement
m :
Model (Xspace := Xspace) p
hpsi :
hsep :
∃ z : ℂ, ‖z‖ ≤ zeroRadius p ∧ treatmentMGF p m z = 0
Proof (Lean source)
-- @node: lem:zero-localization lemma zero_localization (p : Parameters) (m : Model (Xspace := Xspace) p) (hpsi : EtaSubGaussian p m) (hsep : CumulantSeparation p m) : ∃ z : ℂ, ‖z‖ ≤ zeroRadius p ∧ treatmentMGF p m z = 0 := by have hk : 3 ≤ p.k := by rw [p.k_eq] simpa only [Nat.reduceAdd] using Nat.add_le_add_right p.r_ge_two 1 have hψ : 0 < p.psieta := p.constants_pos.2.2.2.1 have hδ : 0 < p.delta := p.constants_pos.2.2.2.2.2.1 have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hmx : comap (fun o : Obs Xspace ↦ o.1) inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := by exact comap_le (show Measurable (fun o : Obs Xspace ↦ o.1) from measurable_fst) have hgint : Integrable (fun o : Obs Xspace ↦ m.g0 (covariate o)) m.P := by exact MeasureTheory.integrable_condExp.congr m.g0_condMean have hetaInt : Integrable (eta p m) m.P := by exact m.treatment_integrable.sub hgint have hcenter : ∫ o, eta p m o ∂m.P = 0 := by have hgIntegral : (∫ o, m.g0 (covariate o) ∂m.P) = ∫ o, treatment o ∂m.P := by calc (∫ o, m.g0 (covariate o) ∂m.P) = ∫ o, (@condExp (Obs Xspace) ℝ (comap (fun o : Obs Xspace ↦ o.1) inferInstance) inferInstance _ _ m.P (fun o ↦ o.2.1)) o ∂m.P := integral_congr_ae m.g0_condMean.symm _ = ∫ o, treatment o ∂m.P := MeasureTheory.integral_condExp hmx change ∫ o, o.2.1 - m.g0 o.1 ∂m.P = 0 rw [integral_sub m.treatment_integrable (by simpa [covariate] using hgint)] change (∫ o, treatment o ∂m.P) - ∫ o, m.g0 (covariate o) ∂m.P = 0 rw [hgIntegral, sub_self] have htilt (t : ℝ) : Integrable (fun o ↦ exp (t * eta p m o)) m.P := integrable_exp_mul_of_luxemburg_sq hψ hetaMeas hpsi.1 t have hmgf (t : ℝ) : ∫ o, exp (t * eta p m o) ∂m.P ≤ exp (4 * p.psieta ^ 2 * t ^ 2) := integral_exp_mul_le_exp_four_mul_sq_of_luxemburg hψ hetaMeas hetaInt hpsi.1 hpsi.2 hcenter t have hetaSet : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, htilt t] have hMan : AnalyticOnNhd ℂ (treatmentMGF p m) univ := by intro z hz unfold treatmentMGF apply analyticAt_complexMGF simp [hetaSet] have hMzero : treatmentMGF p m 0 = 1 := by unfold treatmentMGF simpa using (complexMGF_ofReal (X := eta p m) (μ := m.P) 0) have hMbound (z : ℂ) : ‖treatmentMGF p m z‖ ≤ exp (4 * p.psieta ^ 2 * ‖z‖ ^ 2) := by calc ‖treatmentMGF p m z‖ ≤ mgf (eta p m) m.P z.re := norm_complexMGF_le_mgf _ = ∫ o, exp (z.re * eta p m o) ∂m.P := rfl _ ≤ exp (4 * p.psieta ^ 2 * z.re ^ 2) := hmgf z.re _ ≤ exp (4 * p.psieta ^ 2 * ‖z‖ ^ 2) := by apply Real.exp_le_exp.mpr have hre := Complex.abs_re_le_norm z have hsquares : z.re ^ 2 ≤ ‖z‖ ^ 2 := by rw [← sq_abs] exact (sq_le_sq₀ (abs_nonneg _) (norm_nonneg _)).mpr hre gcongr have hR : 0 < zeroRadius p := by unfold zeroRadius Ak positivity by_contra hno push_neg at hno have hzeroFree : ∀ z ∈ ball (0 : ℂ) (zeroRadius p), treatmentMGF p m z ≠ 0 := by intro z hz hMz exact hno z (le_of_lt (by simpa [mem_ball, dist_zero_right] using hz)) hMz letI : FiniteDimensional ℝ ℂ := Complex.basisOneI.finiteDimensional_of_finite let u : ℂ → ℝ := fun z ↦ Real.log ‖treatmentMGF p m z‖ have hu : InnerProductSpace.HarmonicOnNhd u (ball (0 : ℂ) (zeroRadius p)) := by intro z hz exact (hMan z (mem_univ z)).harmonicAt_log_norm (hzeroFree z hz) obtain ⟨F, hFan, hFre⟩ := hu.exists_analyticOnNhd_ball_re_eq let f : ℂ → ℂ := fun z ↦ F z - F 0 have hfAn : AnalyticOnNhd ℂ f (ball (0 : ℂ) (zeroRadius p)) := by exact hFan.sub analyticOnNhd_const have hF0re : (F 0).re = 0 := by have h := hFre (show (0 : ℂ) ∈ ball 0 (zeroRadius p) by simpa using hR) simpa [u, hMzero] using h have hfre : ∀ z ∈ ball (0 : ℂ) (zeroRadius p), (f z).re = Real.log ‖treatmentMGF p m z‖ := by intro z hz simp [f, hFre hz, hF0re, u] have hfzero : f 0 = 0 := by simp [f] have hmaps : MapsTo f (ball (0 : ℂ) (zeroRadius p)) {w : ℂ | w.re ≤ 4 * p.psieta ^ 2 * zeroRadius p ^ 2} := by intro z hz rw [mem_setOf_eq, hfre z hz] have hnpos : 0 < ‖treatmentMGF p m z‖ := norm_pos_iff.mpr (hzeroFree z hz) apply (Real.log_le_iff_le_exp hnpos).mpr exact (hMbound z).trans (Real.exp_le_exp.mpr (by have hzR : ‖z‖ < zeroRadius p := by simpa [mem_ball, dist_zero_right] using hz have hsquares : ‖z‖ ^ 2 ≤ zeroRadius p ^ 2 := (sq_le_sq₀ (norm_nonneg _) hR.le).mpr hzR.le gcongr)) have hinner : 0 < zeroRadius p / 2 := half_pos hR have hfDiffCl : DiffContOnCl ℂ f (ball (0 : ℂ) (zeroRadius p / 2)) := by apply hfAn.differentiableOn.diffContOnCl_ball intro z hz rw [mem_closedBall, dist_zero_right] at hz rw [mem_ball, dist_zero_right] linarith have hfSphere : ∀ z ∈ sphere (0 : ℂ) (zeroRadius p / 2), ‖f z‖ ≤ 8 * p.psieta ^ 2 * zeroRadius p ^ 2 := by intro z hz have hzinner : z ∈ ball (0 : ℂ) (zeroRadius p) := by rw [mem_ball, dist_zero_right] have : ‖z‖ = zeroRadius p / 2 := by simpa [mem_sphere, dist_zero_right] using hz linarith have hbc := Complex.borelCaratheodory_zero (f := f) (M := 4 * p.psieta ^ 2 * zeroRadius p ^ 2) (by positivity) hfAn.differentiableOn hmaps hR hzinner hfzero have hzNorm : ‖z‖ = zeroRadius p / 2 := by simpa [mem_sphere, dist_zero_right] using hz rw [hzNorm] at hbc convert hbc using 1 <;> field_simp <;> ring have hderivBound := Complex.norm_iteratedDeriv_le_of_forall_mem_sphere_norm_le p.k hinner hfDiffCl hfSphere have hlocalSlit : ∀ᶠ z in 𝓝 (0 : ℂ), treatmentMGF p m z ∈ Complex.slitPlane := by have htend : Tendsto (treatmentMGF p m) (𝓝 0) (𝓝 (treatmentMGF p m 0)) := (hMan 0 (mem_univ 0)).continuousAt rw [hMzero] at htend exact htend (Complex.isOpen_slitPlane.mem_nhds Complex.one_mem_slitPlane) obtain ⟨ε, hε, hεslit⟩ : ∃ ε > 0, ball (0 : ℂ) ε ⊆ {z | treatmentMGF p m z ∈ Complex.slitPlane} := by rw [Metric.eventually_nhds_iff] at hlocalSlit exact hlocalSlit let ε' := min ε (zeroRadius p) have hε' : 0 < ε' := lt_min hε hR have hlogAn : AnalyticOnNhd ℂ (fun z ↦ log (treatmentMGF p m z)) (ball (0 : ℂ) ε') := by apply (hMan.mono (subset_univ _)).clog intro z hz exact hεslit (by rw [mem_ball, dist_zero_right] at hz ⊢ exact hz.trans_le (min_le_left _ _)) have hdiffAn : AnalyticOnNhd ℂ (fun z ↦ f z - log (treatmentMGF p m z)) (ball (0 : ℂ) ε') := (hfAn.mono (by intro z hz rw [mem_ball, dist_zero_right] at hz ⊢ exact hz.trans_le (min_le_right _ _))).sub hlogAn have hdiffRe : ∀ z ∈ ball (0 : ℂ) ε', (f z - log (treatmentMGF p m z)).re = 0 := by intro z hz rw [Complex.sub_re, Complex.log_re] rw [hfre z (by rw [mem_ball, dist_zero_right] at hz ⊢ exact hz.trans_le (min_le_right _ _)), sub_self] obtain ⟨c, hc⟩ := hdiffAn.eq_const_of_re_eq_const hdiffRe isOpen_ball (Metric.isConnected_ball hε') have hc0 : c = 0 := by have h := hc 0 (show (0 : ℂ) ∈ ball 0 ε' by simpa using hε') simpa [hfzero, hMzero] using h.symm have heventEq : f =ᶠ[𝓝 (0 : ℂ)] fun z ↦ log (treatmentMGF p m z) := by filter_upwards [Metric.ball_mem_nhds 0 hε'] with z hz have h := hc z hz rw [hc0] at h simpa using sub_eq_zero.mp h have hkderiv : iteratedDeriv p.k f 0 = iteratedDeriv p.k (fun z ↦ log (treatmentMGF p m z)) 0 := heventEq.iteratedDeriv_eq p.k rw [hkderiv] at hderivBound have hkappaBound : |kappaEta p m| ≤ p.k.factorial * (8 * p.psieta ^ 2 * zeroRadius p ^ 2) / (zeroRadius p / 2) ^ p.k := by unfold kappaEta exact (Complex.abs_re_le_norm _).trans hderivBound have hkm2 : p.k - 2 ≠ 0 := by omega have hkadd : p.k - 2 + 2 = p.k := by omega have hcast : ((p.k - 2 : ℕ) : ℝ) = (p.k : ℝ) - 2 := by rw [Nat.cast_sub (by omega : 2 ≤ p.k)] norm_num have hbasePos : 0 < (2 ^ (p.k + 4) * p.k.factorial : ℝ) := by positivity have hratioPos : 0 < p.psieta ^ 2 / p.delta := div_pos (sq_pos_of_pos hψ) hδ have hAkPow : Ak p.k ^ (p.k - 2) = (2 ^ (p.k + 4) * p.k.factorial : ℝ) := by unfold Ak rw [← hcast] exact Real.rpow_inv_natCast_pow hbasePos.le hkm2 have hratioPow : ((p.psieta ^ 2 / p.delta) ^ (((p.k : ℝ) - 2)⁻¹)) ^ (p.k - 2) = p.psieta ^ 2 / p.delta := by rw [← hcast] exact Real.rpow_inv_natCast_pow hratioPos.le hkm2 have hRPow : zeroRadius p ^ (p.k - 2) = (2 ^ (p.k + 4) * p.k.factorial : ℝ) * (p.psieta ^ 2 / p.delta) := by unfold zeroRadius rw [mul_pow, hAkPow, hratioPow] have hRpowk : zeroRadius p ^ p.k = ((2 ^ (p.k + 4) * p.k.factorial : ℝ) * (p.psieta ^ 2 / p.delta)) * zeroRadius p ^ 2 := by conv_lhs => rw [← hkadd, pow_add, hRPow] have hcalc : p.k.factorial * (8 * p.psieta ^ 2 * zeroRadius p ^ 2) / (zeroRadius p / 2) ^ p.k = p.delta / 2 := by rw [div_pow, hRpowk] field_simp [hR.ne', hψ.ne', hδ.ne', Nat.factorial_ne_zero] ring have hkappaHalf : |kappaEta p m| ≤ p.delta / 2 := by simpa [hcalc] using hkappaBound have hkappaLt : |kappaEta p m| < p.delta := hkappaHalf.trans_lt (by linarith) exact (not_lt_of_ge hsep) hkappaLt
CausalSmith.Stat.SaPlmCumulantConverse.zero_localization · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Cumulant.lean:82
Helpers.EmpiricalTransform 14 declarations Uniform L2 control of empirical transforms

Uniform L2 control of empirical transforms

def transformSupError

The uniform error of a random transform against a fixed target on a disk: the supremum, over all complex points of modulus at most the given radius, of the distance between the value of the random transform at that point and the value of the target there.

Definition (Lean source)
def transformSupError (Fhat : Ω → ℂ → ℂ) (F : ℂ → ℂ) (R : ℝ) (w : Ω) : ℝ := sSup {x : ℝ | ∃ z : ℂ, ‖z‖ ≤ R ∧ x = ‖Fhat w z - F z‖}
CausalSmith.Stat.SaPlmCumulantConverse.transformSupError · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:17
theorem transformSupError_eq_diskSupNorm Lemma transformSupError_eq_diskSupNorm in the paper ↗

The transform error is exactly the disk supremum of the centered random analytic function.

Formal statement
Fhat :
Ω → ℂ → ℂ
F :
ℂ → ℂ
R :
transformSupError Fhat F R = diskSupNorm (fun ω z ↦ Fhat ω z - F z) R
Proof (Lean source)
lemma transformSupError_eq_diskSupNorm (Fhat : Ω → ℂ → ℂ) (F : ℂ → ℂ) (R : ℝ) : transformSupError Fhat F R = diskSupNorm (fun ω z ↦ Fhat ω z - F z) R := by rfl
CausalSmith.Stat.SaPlmCumulantConverse.transformSupError_eq_diskSupNorm · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:24
def inferenceFold

The two deterministic folds, indexed by Fin 2.

Definition (Lean source)
def inferenceFold (n : ℕ) (a : Fin 2) : Finset (Fin n) := if a = 0 then fold0 n else fold1 n
theorem luxemburg_even_moment_integral_le Lemma luxemburg_even_moment_integral_le in the paper ↗

A Luxemburg-square envelope controls every even moment with the factorial constant used in the empirical-transform coefficient series.

Formal statement
W :
Ω → ℝ
hW :
σ :
:
0 < σ
hexp :
Integrable (fun ω ↦ exp ((W ω) ^ 2 / σ ^ 2)) μ
hexp_le :
∫ ω, exp ((W ω) ^ 2 / σ ^ 2) ∂μ ≤ 2
k :
∫ ω, |W ω| ^ (2 * k) ∂μ ≤ 2 * σ ^ (2 * k) * k.factorial
Proof (Lean source)
lemma luxemburg_even_moment_integral_le [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] (W : Ω → ℝ) (hW : Measurable W) {σ : ℝ} (hσ : 0 < σ) (hexp : Integrable (fun ω ↦ exp ((W ω) ^ 2 / σ ^ 2)) μ) (hexp_le : ∫ ω, exp ((W ω) ^ 2 / σ ^ 2) ∂μ ≤ 2) (k : ℕ) : ∫ ω, |W ω| ^ (2 * k) ∂μ ≤ 2 * σ ^ (2 * k) * k.factorial := by let c : ℝ := σ ^ (2 * k) * k.factorial have hc : 0 ≤ c := mul_nonneg (pow_nonneg hσ.le _) (Nat.cast_nonneg _) have hpoint : ∀ ω, |W ω| ^ (2 * k) ≤ c * exp ((W ω) ^ 2 / σ ^ 2) := by intro ω have hx : 0 ≤ (W ω) ^ 2 / σ ^ 2 := div_nonneg (sq_nonneg _) (sq_nonneg _) have hseries := Real.pow_div_factorial_le_exp ((W ω) ^ 2 / σ ^ 2) hx k have hσne : σ ≠ 0 := hσ.ne' have hkfac : 0 < (k.factorial : ℝ) := by positivity have hseries' : ((W ω) ^ 2 / σ ^ 2) ^ k ≤ k.factorial * exp ((W ω) ^ 2 / σ ^ 2) := by simpa [mul_comm] using (div_le_iff₀ hkfac).mp hseries calc |W ω| ^ (2 * k) = σ ^ (2 * k) * ((W ω) ^ 2 / σ ^ 2) ^ k := by rw [pow_mul, sq_abs] rw [div_pow] field_simp [hσne] simp [pow_mul] _ ≤ σ ^ (2 * k) * (k.factorial * exp ((W ω) ^ 2 / σ ^ 2)) := mul_le_mul_of_nonneg_left hseries' (pow_nonneg hσ.le _) _ = c * exp ((W ω) ^ 2 / σ ^ 2) := by simp [c] ring have hmoment : Integrable (fun ω ↦ |W ω| ^ (2 * k)) μ := by exact (hexp.const_mul c).mono' ((hW.abs.pow_const (2 * k)).aestronglyMeasurable) (Filter.Eventually.of_forall fun ω ↦ by rw [Real.norm_eq_abs, abs_of_nonneg (pow_nonneg (abs_nonneg (W ω)) (2 * k))] exact hpoint ω) calc ∫ ω, |W ω| ^ (2 * k) ∂μ ≤ ∫ ω, c * exp ((W ω) ^ 2 / σ ^ 2) ∂μ := integral_mono_ae hmoment (hexp.const_mul c) (Filter.Eventually.of_forall hpoint) _ = c * ∫ ω, exp ((W ω) ^ 2 / σ ^ 2) ∂μ := by rw [integral_const_mul] _ ≤ c * 2 := mul_le_mul_of_nonneg_left hexp_le hc _ = 2 * σ ^ (2 * k) * k.factorial := by simp [c]; ring
CausalSmith.Stat.SaPlmCumulantConverse.luxemburg_even_moment_integral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:36
theorem eta_even_moment_integral_le Lemma eta_even_moment_integral_le in the paper ↗

The treatment-noise Luxemburg assumption gives the factorial even-moment majorant used for residual-transform coefficients.

Formal statement
m :
Model (Xspace := Xspace) p
n k :
hclass :
∫ o, |eta p m o| ^ (2 * k) ∂m.P ≤ 2 * p.psieta ^ (2 * k) * k.factorial
Proof (Lean source)
lemma eta_even_moment_integral_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n k : ℕ) (hclass : NonGaussianClass p n m) : ∫ o, |eta p m o| ^ (2 * k) ∂m.P ≤ 2 * p.psieta ^ (2 * k) * k.factorial := by apply luxemburg_even_moment_integral_le · unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) · exact p.constants_pos.2.2.2.1 · exact hclass.etaSubGaussian.1 · exact hclass.etaSubGaussian.2
CausalSmith.Stat.SaPlmCumulantConverse.eta_even_moment_integral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:86
theorem xi_luxemburg_integral_le Lemma xi_luxemburg_integral_le in the paper ↗

The conditional Luxemburg bound for the outcome innovation implies its unconditional square-exponential bound.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hclass :
∫ o, exp ((xi p m o) ^ 2 / p.psixi ^ 2) ∂m.P ≤ 2
Proof (Lean source)
lemma xi_luxemburg_integral_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hclass : NonGaussianClass p n m) : ∫ o, exp ((xi p m o) ^ 2 / p.psixi ^ 2) ∂m.P ≤ 2 := by let f := fun o : Obs Xspace ↦ exp ((xi p m o) ^ 2 / p.psixi ^ 2) have hcond : ∀ᵐ o ∂m.P, (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P f) o ≤ 2 := by simpa [f] using hclass.xiSubGaussian.2 have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst calc ∫ o, f o ∂m.P = ∫ o, (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P f) o ∂m.P := by symm exact integral_condExp (μ := m.P) (f := f) hcov.comap_le _ ≤ ∫ _o, (2 : ℝ) ∂m.P := integral_mono_ae (integrable_condExp (μ := m.P) (f := f)) (integrable_const 2) hcond _ = 2 := by simp
CausalSmith.Stat.SaPlmCumulantConverse.xi_luxemburg_integral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:100
theorem learnedResidual_exp_abs_sq_lintegral_le Lemma learnedResidual_exp_abs_sq_lintegral_le in the paper ↗

A uniform square-integral envelope for the absolute exponential of the learned residual.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hclass :
R :
hR :
0 ≤ R
∫⁻ o, ofReal ((exp (2 * R * |learnedResidual p m n o|)) ^ 2) ∂m.P
ofReal (2 * exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2))
Proof (Lean source)
lemma learnedResidual_exp_abs_sq_lintegral_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hclass : NonGaussianClass p n m) (R : ℝ) (hR : 0 ≤ R) : ∫⁻ o, ofReal ((exp (2 * R * |learnedResidual p m n o|)) ^ 2) ∂m.P ≤ ofReal (2 * exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2)) := by have hpsi := p.constants_pos.2.2.2.1 have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith [p.constants_pos.2.1] have hD : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hg] with o ho exact (abs_sub _ _).trans (by linarith [hbar (covariate o)]) have hpoint : ∀ᵐ o ∂m.P, (exp (2 * R * |learnedResidual p m n o|)) ^ 2 ≤ exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2) * exp ((eta p m o) ^ 2 / p.psieta ^ 2) := by filter_upwards [hD] with o hDo rw [← Real.exp_nat_mul, ← Real.exp_add] apply Real.exp_le_exp.mpr have hZ : |learnedResidual p m n o| ≤ |eta p m o| + 2 * p.Cg := by rw [show learnedResidual p m n o = eta p m o + treatmentError p m n o by simp [learnedResidual, eta, treatmentError]] exact (abs_add_le _ _).trans (add_le_add_right hDo _) have hyoung : 4 * R * |eta p m o| ≤ (eta p m o) ^ 2 / p.psieta ^ 2 + 4 * R ^ 2 * p.psieta ^ 2 := by have hs : 0 ≤ (|eta p m o| / p.psieta - 2 * R * p.psieta) ^ 2 := sq_nonneg _ field_simp [hpsi.ne'] at hs ⊢ nlinarith [sq_abs (eta p m o)] nlinarith calc _ ≤ ∫⁻ o, ofReal (exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2) * exp ((eta p m o) ^ 2 / p.psieta ^ 2)) ∂m.P := lintegral_mono_ae (hpoint.mono fun _ h ↦ ENNReal.ofReal_le_ofReal h) _ = ofReal (exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2)) * ∫⁻ o, ofReal (exp ((eta p m o) ^ 2 / p.psieta ^ 2)) ∂m.P := by simp_rw [ENNReal.ofReal_mul (Real.exp_pos _).le] rw [lintegral_const_mul'] simp _ = ofReal (exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2)) * ofReal (∫ o, exp ((eta p m o) ^ 2 / p.psieta ^ 2) ∂m.P) := by rw [ofReal_integral_eq_lintegral_ofReal] · exact hclass.etaSubGaussian.1 · exact Filter.Eventually.of_forall fun _ ↦ (Real.exp_pos _).le _ ≤ ofReal (exp (8 * R * p.Cg + 4 * R ^ 2 * p.psieta ^ 2)) * ofReal 2 := by gcongr exact hclass.etaSubGaussian.2 _ = _ := by rw [← ENNReal.ofReal_mul (Real.exp_pos _).le] simp [mul_comm]
CausalSmith.Stat.SaPlmCumulantConverse.learnedResidual_exp_abs_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:121
theorem outcome_fourth_moment_le Lemma outcome_fourth_moment_le in the paper ↗

The primitive bounds imply a uniform fourth moment for the observed outcome.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hclass :
Integrable (fun o ↦ |outcome o| ^ 4) m.P ∧
∫ o, |outcome o| ^ 4 ∂m.P
≤ 64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4)
Proof (Lean source)
lemma outcome_fourth_moment_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hclass : NonGaussianClass p n m) : Integrable (fun o ↦ |outcome o| ^ 4) m.P ∧ ∫ o, |outcome o| ^ 4 ∂m.P ≤ 64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) := by have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hq := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.qRange have heta4 := eta_even_moment_integral_le p m n 2 hclass have hxiExp := xi_luxemburg_integral_le p m n hclass have hxiMeas : Measurable (xi p m) := by unfold xi outcome covariate eta treatment exact measurable_snd.snd.sub (m.q0_measurable.comp measurable_fst) |>.sub (measurable_const.mul (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst))) have hxi4 := luxemburg_even_moment_integral_le (xi p m) hxiMeas p.constants_pos.2.2.2.2.1 hclass.xiSubGaussian.1 hxiExp 2 have hetaSet : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] have hxiSet : integrableExpSet (xi p m) m.P = univ := by ext t simp [integrableExpSet, xi_integrable_exp p m n hclass t] have heta4int : Integrable (fun o ↦ |eta p m o| ^ 4) m.P := integrable_pow_abs_of_mem_interior_integrableExpSet (by simp [hetaSet]) 4 have hxi4int : Integrable (fun o ↦ |xi p m o| ^ 4) m.P := integrable_pow_abs_of_mem_interior_integrableExpSet (by simp [hxiSet]) 4 have hpoint : ∀ᵐ o ∂m.P, |outcome o| ^ 4 ≤ 64 * (p.Cq ^ 4 + p.Ctheta ^ 4 * |eta p m o| ^ 4 + |xi p m o| ^ 4) := by filter_upwards [hq] with o hqo have hout : outcome o = m.q0 (covariate o) + m.theta0 * eta p m o + xi p m o := by simp [xi] rw [hout] calc |m.q0 (covariate o) + m.theta0 * eta p m o + xi p m o| ^ 4 ≤ (|m.q0 (covariate o)| + |m.theta0| * |eta p m o| + |xi p m o|) ^ 4 := by gcongr calc |m.q0 (covariate o) + m.theta0 * eta p m o + xi p m o| ≤ |m.q0 (covariate o) + m.theta0 * eta p m o| + |xi p m o| := abs_add_le _ _ _ ≤ |m.q0 (covariate o)| + |m.theta0 * eta p m o| + |xi p m o| := by nlinarith [abs_add_le (m.q0 (covariate o)) (m.theta0 * eta p m o)] _ = _ := by rw [abs_mul] _ ≤ 64 * (|m.q0 (covariate o)| ^ 4 + (|m.theta0| * |eta p m o|) ^ 4 + |xi p m o| ^ 4) := by nlinarith [sq_nonneg (|m.q0 (covariate o)| + |m.theta0| * |eta p m o| - |xi p m o|), sq_nonneg ((|m.q0 (covariate o)| + |m.theta0| * |eta p m o|) ^ 2 - |xi p m o| ^ 2), sq_nonneg (|m.q0 (covariate o)| - |m.theta0| * |eta p m o|), sq_nonneg (|m.q0 (covariate o)| ^ 2 - (|m.theta0| * |eta p m o|) ^ 2)] _ ≤ _ := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply add_le_add · apply add_le_add · exact pow_le_pow_left₀ (abs_nonneg _) hqo 4 · rw [mul_pow] exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (abs_nonneg _) hclass.thetaRange 4) (by positivity) · exact le_rfl have hrhsint : Integrable (fun o ↦ 64 * (p.Cq ^ 4 + p.Ctheta ^ 4 * |eta p m o| ^ 4 + |xi p m o| ^ 4)) m.P := (((integrable_const (p.Cq ^ 4)).add (heta4int.const_mul (p.Ctheta ^ 4))).add hxi4int).const_mul 64 have hlhsint : Integrable (fun o ↦ |outcome o| ^ 4) m.P := hrhsint.mono' ((measurable_snd.snd.abs.pow_const 4).aestronglyMeasurable) (hpoint.mono fun _ h ↦ by rw [Real.norm_eq_abs, abs_of_nonneg (pow_nonneg (abs_nonneg _) 4)] exact h) refine ⟨hlhsint, ?_⟩ calc _ ≤ ∫ o, 64 * (p.Cq ^ 4 + p.Ctheta ^ 4 * |eta p m o| ^ 4 + |xi p m o| ^ 4) ∂m.P := integral_mono_ae hlhsint hrhsint hpoint _ = 64 * (p.Cq ^ 4 + p.Ctheta ^ 4 * ∫ o, |eta p m o| ^ 4 ∂m.P + ∫ o, |xi p m o| ^ 4 ∂m.P) := by rw [integral_const_mul] congr 1 change (∫ o, (p.Cq ^ 4 + p.Ctheta ^ 4 * |eta p m o| ^ 4) + |xi p m o| ^ 4 ∂m.P) = _ calc _ = (∫ o, p.Cq ^ 4 + p.Ctheta ^ 4 * |eta p m o| ^ 4 ∂m.P) + ∫ o, |xi p m o| ^ 4 ∂m.P := integral_add ((integrable_const (p.Cq ^ 4)).add (heta4int.const_mul (p.Ctheta ^ 4))) hxi4int _ = ((∫ _o, p.Cq ^ 4 ∂m.P) + ∫ o, p.Ctheta ^ 4 * |eta p m o| ^ 4 ∂m.P) + ∫ o, |xi p m o| ^ 4 ∂m.P := by rw [integral_add (integrable_const (p.Cq ^ 4)) (heta4int.const_mul (p.Ctheta ^ 4))] _ = _ := by simp [integral_const_mul] _ ≤ _ := by norm_num at heta4 hxi4 have heta4' : ∫ o, |eta p m o| ^ 4 ∂m.P ≤ 4 * p.psieta ^ 4 := by linarith have hxi4' : ∫ o, |xi p m o| ^ 4 ∂m.P ≤ 4 * p.psixi ^ 4 := by linarith apply mul_le_mul_of_nonneg_left _ (by norm_num) calc _ ≤ p.Cq ^ 4 + p.Ctheta ^ 4 * (4 * p.psieta ^ 4) + 4 * p.psixi ^ 4 := by gcongr _ = _ := by ring
CausalSmith.Stat.SaPlmCumulantConverse.outcome_fourth_moment_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:178
theorem outcome_exp_abs_sq_lintegral_le Lemma outcome_exp_abs_sq_lintegral_le in the paper ↗

Multiplying the outcome by an absolute learned-residual exponential still has a uniform envelope.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hclass :
R :
hR :
0 ≤ R
∫⁻ o, ofReal ((|outcome o| * exp (2 * R * |learnedResidual p m n o|)) ^ 2) ∂m.P
ofReal (64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * R * p.Cg + 16 * R ^ 2 * p.psieta ^ 2))
Proof (Lean source)
lemma outcome_exp_abs_sq_lintegral_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hclass : NonGaussianClass p n m) (R : ℝ) (hR : 0 ≤ R) : ∫⁻ o, ofReal ((|outcome o| * exp (2 * R * |learnedResidual p m n o|)) ^ 2) ∂m.P ≤ ofReal (64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * R * p.Cg + 16 * R ^ 2 * p.psieta ^ 2)) := by have hY4 := outcome_fourth_moment_le p m n hclass have hZ8 := learnedResidual_exp_abs_sq_lintegral_le p m n hclass (2 * R) (mul_nonneg (by norm_num) hR) have hpoint (o : Obs Xspace) : (|outcome o| * exp (2 * R * |learnedResidual p m n o|)) ^ 2 ≤ |outcome o| ^ 4 + (exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2 := by let B := exp (4 * R * |learnedResidual p m n o|) calc (|outcome o| * exp (2 * R * |learnedResidual p m n o|)) ^ 2 = |outcome o| ^ 2 * B := by rw [mul_pow, ← Real.exp_nat_mul] congr 2 simp [B] ring _ ≤ |outcome o| ^ 4 + B ^ 2 := by nlinarith [sq_nonneg (|outcome o| ^ 2 - B)] _ = _ := by congr 1 apply congrArg (fun x : ℝ ↦ x ^ 2) dsimp [B] congr 1 ring calc _ ≤ ∫⁻ o, ofReal (|outcome o| ^ 4 + (exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2) ∂m.P := lintegral_mono fun o ↦ ENNReal.ofReal_le_ofReal (hpoint o) _ = (∫⁻ o, ofReal (|outcome o| ^ 4) ∂m.P) + ∫⁻ o, ofReal ((exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2) ∂m.P := by rw [show (fun o ↦ ofReal (|outcome o| ^ 4 + (exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2)) = fun o ↦ ofReal (|outcome o| ^ 4) + ofReal ((exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2) by funext o rw [ENNReal.ofReal_add (by positivity) (by positivity)]] exact lintegral_add_left (measurable_snd.snd.abs.pow_const 4).ennreal_ofReal _ _ = ofReal (∫ o, |outcome o| ^ 4 ∂m.P) + ∫⁻ o, ofReal ((exp (2 * (2 * R) * |learnedResidual p m n o|)) ^ 2) ∂m.P := by rw [ofReal_integral_eq_lintegral_ofReal hY4.1 (Filter.Eventually.of_forall fun _ ↦ by positivity)] _ ≤ ofReal (64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4)) + ofReal (2 * exp (8 * (2 * R) * p.Cg + 4 * (2 * R) ^ 2 * p.psieta ^ 2)) := add_le_add (ENNReal.ofReal_le_ofReal hY4.2) hZ8 _ = _ := by rw [← ENNReal.ofReal_add (by positivity) (mul_nonneg (by norm_num) (Real.exp_pos _).le)] congr 2 ring_nf
CausalSmith.Stat.SaPlmCumulantConverse.outcome_exp_abs_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:282
theorem weighted_exp_integral_eq_moment_tsum Lemma weighted_exp_integral_eq_moment_tsum in the paper ↗

A real-weighted exponential transform is its factorial-weighted moment series whenever the doubled absolute exponential is integrable.

Formal statement
Ω :
μ :
W V :
Ω → ℝ
hW :
hV :
z :
hdom :
Integrable (fun o ↦ |W o| * exp (2 * ‖z‖ * |V o|)) μ
∫ o, (W o : ℂ) * exp (z * V o) ∂μ
= ∑' k : ℕ, ((∫ o, W o * V o ^ k ∂μ : ℝ) / k.factorial : ℂ) * z ^ k
Proof (Lean source)
theorem weighted_exp_integral_eq_moment_tsum {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (W V : Ω → ℝ) (hW : Measurable W) (hV : Measurable V) (z : ℂ) (hdom : Integrable (fun o ↦ |W o| * exp (2 * ‖z‖ * |V o|)) μ) : ∫ o, (W o : ℂ) * exp (z * V o) ∂μ = ∑' k : ℕ, ((∫ o, W o * V o ^ k ∂μ : ℝ) / k.factorial : ℂ) * z ^ k := by let F : ℕ → Ω → ℂ := fun k o ↦ ((W o * V o ^ k / k.factorial : ℝ) : ℂ) * z ^ k let D : Ω → ℝ := fun o ↦ |W o| * exp (2 * ‖z‖ * |V o|) have hpoint (k : ℕ) (o : Ω) : ‖F k o‖ ≤ (1 / 2 : ℝ) ^ k * D o := by have hp := Real.pow_div_factorial_le_exp (2 * ‖z‖ * |V o|) (by positivity) k dsimp [F, D] simp only [norm_mul, Complex.norm_real, norm_pow, Real.norm_eq_abs, abs_div, abs_mul, abs_pow, Nat.cast_nonneg, abs_of_nonneg] have hk : (0 : ℝ) < k.factorial := by positivity calc |W o| * |V o| ^ k / k.factorial * ‖z‖ ^ k = (1 / 2 : ℝ) ^ k * |W o| * ((2 * ‖z‖ * |V o|) ^ k / k.factorial) := by simp only [mul_pow] field_simp have ht : (1 / 2 : ℝ) ^ k * 2 ^ k = 1 := by rw [one_div, inv_pow, inv_mul_cancel₀] positivity let L := |W o| * |V o| ^ k * ‖z‖ ^ k change L = L * (1 / 2 : ℝ) ^ k * 2 ^ k calc L = L * 1 := by ring _ = L * ((1 / 2 : ℝ) ^ k * 2 ^ k) := by rw [ht] _ = _ := by ring _ ≤ (1 / 2 : ℝ) ^ k * |W o| * exp (2 * ‖z‖ * |V o|) := by gcongr _ = _ := by ring have hFint : ∀ k, Integrable (F k) μ := by intro k exact (hdom.const_mul ((1 / 2 : ℝ) ^ k)).mono' (((Complex.measurable_ofReal.comp (hW.mul (hV.pow_const k) |>.div_const k.factorial)).mul_const (z ^ k)).aestronglyMeasurable) (Filter.Eventually.of_forall fun o ↦ by simpa [D] using hpoint k o) have hnormsum : Summable (fun k ↦ ∫ o, ‖F k o‖ ∂μ) := by apply Summable.of_nonneg_of_le (fun k ↦ integral_nonneg fun _ ↦ norm_nonneg _) (fun k ↦ ?_) ((summable_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)).mul_left (∫ o, D o ∂μ)) calc ∫ o, ‖F k o‖ ∂μ ≤ ∫ o, (1 / 2 : ℝ) ^ k * D o ∂μ := integral_mono (hFint k).norm (hdom.const_mul _) (hpoint k) _ = (1 / 2 : ℝ) ^ k * ∫ o, D o ∂μ := integral_const_mul _ _ _ = _ := by ring calc _ = ∫ o, ∑' k, F k o ∂μ := by apply integral_congr_ae filter_upwards [] with o rw [Complex.exp_eq_exp_ℂ, NormedSpace.exp_eq_tsum_div, ← tsum_mul_left] apply tsum_congr intro k simp [F] ring _ = ∑' k, ∫ o, F k o ∂μ := (integral_tsum_of_summable_integral_norm hFint hnormsum).symm _ = _ := by apply tsum_congr intro k rw [show F k = fun o ↦ ((W o * V o ^ k / k.factorial : ℝ) : ℂ) * z ^ k by rfl] rw [show (fun o ↦ ((W o * V o ^ k / k.factorial : ℝ) : ℂ) * z ^ k) = fun o ↦ (((W o * V o ^ k : ℝ) : ℂ) / (k.factorial : ℂ)) * z ^ k by funext o push_cast ring] calc _ = (∫ o, ((W o * V o ^ k : ℝ) : ℂ) / (k.factorial : ℂ) ∂μ) * z ^ k := integral_mul_const _ _ _ = ((k.factorial : ℂ)⁻¹ * ∫ o, ((W o * V o ^ k : ℝ) : ℂ) ∂μ) * z ^ k := by congr 1 rw [show (fun o ↦ ((W o * V o ^ k : ℝ) : ℂ) / (k.factorial : ℂ)) = fun o ↦ (k.factorial : ℂ)⁻¹ * ((W o * V o ^ k : ℝ) : ℂ) by funext o ring] exact integral_const_mul _ _ _ = _ := by have hi : (∫ o, ((W o * V o ^ k : ℝ) : ℂ) ∂μ) = ((∫ o, W o * V o ^ k ∂μ : ℝ) : ℂ) := integral_complex_ofReal rw [hi] ring
CausalSmith.Stat.SaPlmCumulantConverse.weighted_exp_integral_eq_moment_tsum · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:346
theorem factorial_coefficient_memLp_two Lemma factorial_coefficient_memLp_two in the paper ↗

A doubled absolute-exponential envelope gives geometric bounds for factorial-weighted moment coefficients.

Formal statement
Ω :
μ :
W V :
Ω → ℝ
hW :
hV :
R :
hR :
0 < R
C :
hC :
0 ≤ C
henv :
∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂μ ≤ ofReal (C ^ 2)
k :
MemLp (fun o ↦ W o * V o ^ k / k.factorial) 2 μ ∧
eLpNorm (fun o ↦ W o * V o ^ k / k.factorial) 2 μ ≤ ofReal (C / (2 * R) ^ k)
Proof (Lean source)
theorem factorial_coefficient_memLp_two {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (W V : Ω → ℝ) (hW : Measurable W) (hV : Measurable V) (R : ℝ) (hR : 0 < R) (C : ℝ) (hC : 0 ≤ C) (henv : ∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂μ ≤ ofReal (C ^ 2)) (k : ℕ) : MemLp (fun o ↦ W o * V o ^ k / k.factorial) 2 μ ∧ eLpNorm (fun o ↦ W o * V o ^ k / k.factorial) 2 μ ≤ ofReal (C / (2 * R) ^ k) := by let a : ℝ := ((2 * R) ^ k)⁻¹ let E : Ω → ℝ := fun o ↦ |W o| * exp (2 * R * |V o|) have ha : 0 ≤ a := inv_nonneg.mpr (pow_nonneg (mul_nonneg (by norm_num) hR.le) _) have hpoint (o : Ω) : |W o * V o ^ k / k.factorial| ≤ a * E o := by have hp := Real.pow_div_factorial_le_exp (2 * R * |V o|) (by positivity) k dsimp [a, E] rw [abs_div, abs_mul, abs_pow] have hfact : |(k.factorial : ℝ)| = (k.factorial : ℝ) := abs_of_nonneg (Nat.cast_nonneg _) rw [hfact] have hk : (0 : ℝ) < k.factorial := by positivity have hbase : 0 < 2 * R := mul_pos (by norm_num) hR calc |W o| * |V o| ^ k / k.factorial = ((2 * R) ^ k)⁻¹ * |W o| * ((2 * R * |V o|) ^ k / k.factorial) := by field_simp simp only [mul_pow] field_simp _ ≤ ((2 * R) ^ k)⁻¹ * |W o| * exp (2 * R * |V o|) := by gcongr _ = _ := by ring have hfmeas : Measurable (fun o ↦ W o * V o ^ k / k.factorial) := (hW.mul (hV.pow_const k)).div_const _ have hsq : ∫⁻ o, ofReal ((W o * V o ^ k / k.factorial) ^ 2) ∂μ ≤ ofReal ((C / (2 * R) ^ k) ^ 2) := by calc _ = ∫⁻ o, ofReal (|W o * V o ^ k / k.factorial| ^ 2) ∂μ := by apply lintegral_congr intro o rw [sq_abs] _ ≤ ∫⁻ o, ofReal ((a * E o) ^ 2) ∂μ := lintegral_mono fun o ↦ ENNReal.ofReal_le_ofReal ((sq_le_sq₀ (abs_nonneg _) (mul_nonneg ha (by positivity))).2 (hpoint o)) _ = ofReal (a ^ 2) * ∫⁻ o, ofReal ((E o) ^ 2) ∂μ := by rw [← lintegral_const_mul' _ _ (by simp [a, hR.ne'])] apply lintegral_congr intro o rw [mul_pow, ENNReal.ofReal_mul (sq_nonneg a)] _ ≤ ofReal (a ^ 2) * ofReal (C ^ 2) := mul_le_mul_right henv _ _ = ofReal ((C / (2 * R) ^ k) ^ 2) := by rw [← ENNReal.ofReal_mul (sq_nonneg a)] congr 1 dsimp [a] rw [div_eq_mul_inv, mul_pow, inv_pow] ring exact memLp_two_and_eLpNorm_le_of_sq_lintegral_le μ hfmeas (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)) hsq
CausalSmith.Stat.SaPlmCumulantConverse.factorial_coefficient_memLp_two · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:438
theorem empiricalF_sub_eq_centered Lemma empiricalF_sub_eq_centered in the paper ↗

A split-fold residual-transform error is the average of its centered single-observation transform values.

Formal statement
m :
Model (Xspace := Xspace) p
n :
data :
Fin n → Obs Xspace
I :
hI :
I.Nonempty
z :
empiricalF p m n data I z - residualMGF p m n z
= (I.card : ℂ)⁻¹ * ∑ i ∈ I, (exp (z * learnedResidual p m n (data i)) - residualMGF p m n z)
Proof (Lean source)
lemma empiricalF_sub_eq_centered (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (data : Fin n → Obs Xspace) (I : Finset (Fin n)) (hI : I.Nonempty) (z : ℂ) : empiricalF p m n data I z - residualMGF p m n z = (I.card : ℂ)⁻¹ * ∑ i ∈ I, (exp (z * learnedResidual p m n (data i)) - residualMGF p m n z) := by rw [Finset.sum_sub_distrib] simp only [Finset.sum_const, nsmul_eq_mul] unfold empiricalF residualMGF ProbabilityTheory.complexMGF have hc : (I.card : ℂ) ≠ 0 := by exact_mod_cast hI.card_pos.ne' field_simp
CausalSmith.Stat.SaPlmCumulantConverse.empiricalF_sub_eq_centered · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:500
theorem empiricalG_sub_eq_centered Lemma empiricalG_sub_eq_centered in the paper ↗

A split-fold outcome-transform error is the average of its centered single-observation weighted transform values.

Formal statement
m :
Model (Xspace := Xspace) p
n :
data :
Fin n → Obs Xspace
I :
hI :
I.Nonempty
z :
empiricalG p m n data I z - outcomeResidualTransform p m n z
= (I.card : ℂ)⁻¹ * ∑ i ∈ I, ((outcome (data i) : ℂ) * exp (z * learnedResidual p m n (data i)) - outcomeResidualTransform p m n z)
Proof (Lean source)
lemma empiricalG_sub_eq_centered (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (data : Fin n → Obs Xspace) (I : Finset (Fin n)) (hI : I.Nonempty) (z : ℂ) : empiricalG p m n data I z - outcomeResidualTransform p m n z = (I.card : ℂ)⁻¹ * ∑ i ∈ I, ((outcome (data i) : ℂ) * exp (z * learnedResidual p m n (data i)) - outcomeResidualTransform p m n z) := by rw [Finset.sum_sub_distrib] simp only [Finset.sum_const, nsmul_eq_mul] unfold empiricalG outcomeResidualTransform weightedTransform have hc : (I.card : ℂ) ≠ 0 := by exact_mod_cast hI.card_pos.ne' field_simp
CausalSmith.Stat.SaPlmCumulantConverse.empiricalG_sub_eq_centered · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:516
theorem centered_real_series_diskSupNorm_sq_lintegral_le Lemma centered_real_series_diskSupNorm_sq_lintegral_le in the paper ↗

A summable sequence of real centered coefficients with coefficientwise bounds controls the uniform squared norm of its analytic series.

Formal statement
Ω :
μ :
c :
Ω → ℕ → ℝ
R :
hR :
0 ≤ R
hcmeas :
∀ k, Measurable (fun ω ↦ c ω k)
hcsum :
∀ ω, Summable (fun k ↦ |c ω k| * R ^ k)
b :
ℕ → ℝ
hb :
∀ k, 0 ≤ b k
hbsum :
Summable fun k ↦ b k * R ^ k
hcl2 :
∀ k, MemLp (fun ω ↦ c ω k) 2 μ ∧ eLpNorm (fun ω ↦ c ω k) 2 μ ≤ ofReal (b k)
∫⁻ ω, ofReal ((diskSupNorm (fun ω z ↦ ∑' k, (c ω k : ℂ) * z ^ k) R ω) ^ 2) ∂μ
ofReal ((∑' k, b k * R ^ k) ^ 2)
Proof (Lean source)
theorem centered_real_series_diskSupNorm_sq_lintegral_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (c : Ω → ℕ → ℝ) (R : ℝ) (hR : 0 ≤ R) (hcmeas : ∀ k, Measurable (fun ω ↦ c ω k)) (hcsum : ∀ ω, Summable (fun k ↦ |c ω k| * R ^ k)) (b : ℕ → ℝ) (hb : ∀ k, 0 ≤ b k) (hbsum : Summable fun k ↦ b k * R ^ k) (hcl2 : ∀ k, MemLp (fun ω ↦ c ω k) 2 μ ∧ eLpNorm (fun ω ↦ c ω k) 2 μ ≤ ofReal (b k)) : ∫⁻ ω, ofReal ((diskSupNorm (fun ω z ↦ ∑' k, (c ω k : ℂ) * z ^ k) R ω) ^ 2) ∂μ ≤ ofReal ((∑' k, b k * R ^ k) ^ 2) := by let A : ℕ → Ω → ℝ := fun k ω ↦ |c ω k| * R ^ k have hAmeas : ∀ k, Measurable (A k) := by intro k exact (hcmeas k).abs.mul_const _ have hAbound : ∀ k, eLpNorm (A k) 2 μ ≤ ofReal (b k * R ^ k) := by intro k rw [show A k = (R ^ k) • (fun ω ↦ |c ω k|) by funext ω simp [A, mul_comm]] rw [eLpNorm_const_smul] rw [show eLpNorm (fun ω ↦ |c ω k|) 2 μ = eLpNorm (fun ω ↦ c ω k) 2 μ by simpa [Real.norm_eq_abs] using (eLpNorm_norm (f := fun ω ↦ c ω k) (p := 2) (μ := μ))] rw [show ‖R ^ k‖ₑ = ofReal (R ^ k) by rw [← ofReal_norm_eq_enorm, Real.norm_eq_abs, abs_of_nonneg (pow_nonneg hR k)]] rw [ENNReal.ofReal_mul (hb k)] calc ofReal (R ^ k) * eLpNorm (fun ω ↦ c ω k) 2 μ ≤ ofReal (R ^ k) * ofReal (b k) := mul_le_mul_right (hcl2 k).2 _ _ = _ := by ac_rfl apply (lintegral_mono fun ω ↦ ENNReal.ofReal_le_ofReal ?_).trans (tsum_sq_lintegral_le_tsum_lpNorm μ A hAmeas hcsum (fun k ↦ b k * R ^ k) (fun k ↦ mul_nonneg (hb k) (pow_nonneg hR k)) hbsum hAbound) have hs := diskSupNorm_tsum_mul_pow_le (fun ω k ↦ (c ω k : ℂ)) hR ω (by simpa [A] using hcsum ω) have hsup0 : 0 ≤ diskSupNorm (fun ω z ↦ ∑' k, (c ω k : ℂ) * z ^ k) R ω := by exact (norm_nonneg _).trans (by rw [diskSupNorm_eq_sSup_image] apply le_csSup · exact ⟨∑' k, |c ω k| * R ^ k, by rintro x ⟨z, hz, rfl⟩ convert norm_tsum_mul_pow_le_tsum_norm_mul_pow (fun k ↦ (c ω k : ℂ)) (by simpa using hcsum ω) hz using 1 <;> first | rfl | simp⟩ · exact ⟨0, by simpa using hR, rfl⟩) exact (sq_le_sq₀ hsup0 (tsum_nonneg fun k ↦ mul_nonneg (abs_nonneg _) (pow_nonneg hR k))).2 (by simpa using hs)
CausalSmith.Stat.SaPlmCumulantConverse.centered_real_series_diskSupNorm_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransform.lean:534
Helpers.EmpiricalTransformSeries 6 declarations This module converts real exponential-envelope bounds into uniform disk L² bounds for centered empirical analytic transforms and proves the exact coefficient-series identity used to connect those bounds to the paper's em

Factorial-series assembly for empirical transforms

This module converts real exponential-envelope bounds into uniform disk L² bounds for centered empirical analytic transforms and proves the exact coefficient-series identity used to connect those bounds to the paper's empirical transforms.

theorem centered_factorial_empirical_disk_l2 Lemma centered_factorial_empirical_disk_l2 in the paper ↗

Take a nonempty block of sample indices, a measurable weight and a measurable exponent variable, and fix a disk of positive radius. If the envelope given by the absolute weight times the exponential of twice the radius times the absolute exponent variable has second moment no larger than the square of a nonnegative constant, then, for the power series whose k-th coefficient is the block average of the centered factorial statistic — weight times exponent variable to the power k over k factorial, minus its population mean — the expected squared supremum of that series over the disk is at most four times the squared constant divided by the block size.

Formal statement
X :
n :
I :
hI :
I.Nonempty
W V :
X → ℝ
hW :
hV :
R :
hR :
0 < R
C :
hC :
0 ≤ C
henv :
∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂P ≤ ofReal (C ^ 2)
let c : (Fin n → X) → ℕ → ℝ := fun data k ↦ (I.card : ℝ)⁻¹ * ∑ i ∈ I, (W (data i) * V (data i) ^ k / k.factorial - ∫ o, W o * V o ^ k / k.factorial ∂P) ∫⁻ data, ofReal ((diskSupNorm (fun data z ↦ ∑' k, (c data k : ℂ) * z ^ k) R data) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P)
ofReal ((2 * C / sqrt I.card) ^ 2)
Proof (Lean source)
theorem centered_factorial_empirical_disk_l2 {X : Type*} [MeasurableSpace X] {P : Measure X} [IsProbabilityMeasure P] {n : ℕ} (I : Finset (Fin n)) (hI : I.Nonempty) (W V : X → ℝ) (hW : Measurable W) (hV : Measurable V) (R : ℝ) (hR : 0 < R) (C : ℝ) (hC : 0 ≤ C) (henv : ∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂P ≤ ofReal (C ^ 2)) : let c : (Fin n → X) → ℕ → ℝ := fun data k ↦ (I.card : ℝ)⁻¹ * ∑ i ∈ I, (W (data i) * V (data i) ^ k / k.factorial - ∫ o, W o * V o ^ k / k.factorial ∂P) ∫⁻ data, ofReal ((diskSupNorm (fun data z ↦ ∑' k, (c data k : ℂ) * z ^ k) R data) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P) ≤ ofReal ((2 * C / sqrt I.card) ^ 2) := by dsimp only let f : ℕ → X → ℝ := fun k o ↦ W o * V o ^ k / k.factorial let c : (Fin n → X) → ℕ → ℝ := fun data k ↦ (I.card : ℝ)⁻¹ * ∑ i ∈ I, (f k (data i) - ∫ o, f k o ∂P) have hf (k : ℕ) : MemLp (f k) 2 P ∧ eLpNorm (f k) 2 P ≤ ofReal (C / (2 * R) ^ k) := by simpa [f] using factorial_coefficient_memLp_two P W V hW hV R hR C hC henv k have hcmeas (k : ℕ) : Measurable (c · k) := by dsimp [c] fun_prop have hcl2 (k : ℕ) : MemLp (c · k) 2 (Measure.pi (fun _ : Fin n ↦ P)) ∧ eLpNorm (c · k) 2 (Measure.pi (fun _ : Fin n ↦ P)) ≤ ofReal ((C / (2 * R) ^ k) / sqrt I.card) := by have hs := pi_finset_centered_average_sq_lintegral_le I hI (hf k).1 (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)) (hf k).2 have heq : (I.card : ℝ≥0∞)⁻¹ * ofReal ((C / (2 * R) ^ k) ^ 2) = ofReal (((C / (2 * R) ^ k) / sqrt I.card) ^ 2) := by have haux (B : ℝ) : (I.card : ℝ≥0∞)⁻¹ * ofReal (B ^ 2) = ofReal ((B / sqrt I.card) ^ 2) := by have hmR : (0 : ℝ) < I.card := by exact_mod_cast hI.card_pos rw [div_pow, Real.sq_sqrt hmR.le] rw [ENNReal.ofReal_div_of_pos hmR] simp only [ENNReal.ofReal_natCast] ac_rfl exact haux _ apply memLp_two_and_eLpNorm_le_of_sq_lintegral_le _ (hcmeas k) (div_nonneg (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)) (Real.sqrt_nonneg _)) exact hs.trans_eq heq have hcsum : ∀ data, Summable (fun k ↦ |c data k| * R ^ k) := by intro data have hpoint (x : X) : Summable (fun k ↦ |f k x| * R ^ k) := by refine ((Real.summable_pow_div_factorial (|V x| * R)).mul_left |W x|).congr (fun k ↦ ?_) symm simp only [f, abs_div, abs_mul, abs_pow, Nat.cast_nonneg, abs_of_nonneg, mul_pow] ring have hfinite : Summable (fun k ↦ ∑ i ∈ I, |f k (data i)| * R ^ k) := by classical have haux : ∀ s : Finset (Fin n), Summable (fun k ↦ ∑ i ∈ s, |f k (data i)| * R ^ k) := by intro s induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => simp_rw [Finset.sum_insert hi] exact (hpoint (data i)).add ih exact haux I have hmean_bound (k : ℕ) : |∫ o, f k o ∂P| ≤ C / (2 * R) ^ k := by have hle := abs_integral_le_eLpNorm_two (hf k).1 exact hle.trans ((ENNReal.toReal_mono ENNReal.ofReal_ne_top (hf k).2).trans_eq (ENNReal.toReal_ofReal (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)))) have hmean : Summable (fun k ↦ |∫ o, f k o ∂P| * R ^ k) := by apply Summable.of_nonneg_of_le (fun k ↦ mul_nonneg (abs_nonneg _) (pow_nonneg hR.le _)) (fun k ↦ mul_le_mul_of_nonneg_right (hmean_bound k) (pow_nonneg hR.le _)) refine ((summable_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)).mul_left C).congr (fun k ↦ ?_) symm have hR0 : R ≠ 0 := hR.ne' field_simp have ht : (1 / 2 : ℝ) ^ k * 2 ^ k = 1 := by rw [one_div, inv_pow, inv_mul_cancel₀] positivity calc C * R ^ k = C * R ^ k * 1 := by ring _ = C * R ^ k * ((1 / 2 : ℝ) ^ k * 2 ^ k) := by rw [ht] _ = _ := by ring apply Summable.of_nonneg_of_le (fun k ↦ mul_nonneg (abs_nonneg _) (pow_nonneg hR.le _)) (fun k ↦ ?_) ((hfinite.mul_left (I.card : ℝ)⁻¹).add hmean) have hcardR : (I.card : ℝ) ≠ 0 := by exact_mod_cast hI.card_pos.ne' have hinv : 0 ≤ (I.card : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg _) dsimp [c] calc |(I.card : ℝ)⁻¹ * ∑ i ∈ I, (f k (data i) - ∫ o, f k o ∂P)| * R ^ k = (I.card : ℝ)⁻¹ * |∑ i ∈ I, (f k (data i) - ∫ o, f k o ∂P)| * R ^ k := by rw [abs_mul, abs_of_nonneg hinv] _ ≤ (I.card : ℝ)⁻¹ * (∑ i ∈ I, |f k (data i) - ∫ o, f k o ∂P|) * R ^ k := by gcongr exact Finset.abs_sum_le_sum_abs _ _ _ ≤ (I.card : ℝ)⁻¹ * (∑ i ∈ I, (|f k (data i)| + |∫ o, f k o ∂P|)) * R ^ k := by gcongr with i hi exact abs_sub _ _ _ = (I.card : ℝ)⁻¹ * (∑ i ∈ I, |f k (data i)| * R ^ k) + |∫ o, f k o ∂P| * R ^ k := by rw [Finset.sum_add_distrib, Finset.sum_const, nsmul_eq_mul] field_simp rw [add_mul, Finset.sum_mul] congr 1 apply Finset.sum_congr rfl intro i hi ring have hbsum : Summable (fun k ↦ ((C / (2 * R) ^ k) / sqrt I.card) * R ^ k) := by refine ((summable_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)).mul_left (C / sqrt I.card)).congr (fun k ↦ ?_) symm have hR0 : R ≠ 0 := hR.ne' field_simp have ht : (1 / 2 : ℝ) ^ k * 2 ^ k = 1 := by rw [one_div, inv_pow, inv_mul_cancel₀] positivity calc C * R ^ k = C * R ^ k * 1 := by ring _ = C * R ^ k * ((1 / 2 : ℝ) ^ k * 2 ^ k) := by rw [ht] _ = _ := by ring have hmain := centered_real_series_diskSupNorm_sq_lintegral_le (Measure.pi (fun _ : Fin n ↦ P)) c R hR.le hcmeas hcsum (fun k ↦ (C / (2 * R) ^ k) / sqrt I.card) (fun k ↦ div_nonneg (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)) (Real.sqrt_nonneg _)) hbsum hcl2 convert hmain using 1 congr 2 rw [show (fun k ↦ (C / (2 * R) ^ k / sqrt ↑I.card) * R ^ k) = fun k ↦ (C / sqrt I.card) * (1 / 2 : ℝ) ^ k by funext k have hR0 : R ≠ 0 := hR.ne' field_simp have ht : (1 / 2 : ℝ) ^ k * 2 ^ k = 1 := by rw [one_div, inv_pow, inv_mul_cancel₀] positivity calc C * R ^ k = C * R ^ k * 1 := by ring _ = C * R ^ k * ((1 / 2 : ℝ) ^ k * 2 ^ k) := by rw [ht] _ = _ := by ring] rw [tsum_mul_left, tsum_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)] ring
CausalSmith.Stat.SaPlmCumulantConverse.centered_factorial_empirical_disk_l2 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:19
theorem weighted_empirical_sub_eq_centered_factorial_series Lemma weighted_empirical_sub_eq_centered_factorial_series in the paper ↗

Take a nonempty block of sample indices, a measurable weight and a measurable exponent variable, a disk of positive radius, and assume the envelope given by the absolute weight times the exponential of twice the radius times the absolute exponent variable has second moment no larger than the square of a nonnegative constant. Then at every argument of modulus at most the radius the block average of the weight times the exponential of the argument times the exponent variable, minus the population weighted transform, equals the power series whose k-th coefficient is the block average of the centered factorial statistic — weight times exponent variable to the power k over k factorial, minus its population mean.

Formal statement
X :
n :
I :
hI :
I.Nonempty
W V :
X → ℝ
hW :
hV :
R :
hR :
0 < R
C :
hC :
0 ≤ C
henv :
∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂P ≤ ofReal (C ^ 2)
data :
Fin n → X
z :
hz :
‖z‖ ≤ R
(I.card : ℂ)⁻¹ * ∑ i ∈ I, (W (data i) : ℂ) * exp (z * V (data i))
= ∑' k : ℕ, (((I.card : ℝ)⁻¹ * ∑ i ∈ I, (W (data i) * V (data i) ^ k / k.factorial - ∫ o, W o * V o ^ k / k.factorial ∂P) : ℝ) : ℂ) * z ^ k
Proof (Lean source)
theorem weighted_empirical_sub_eq_centered_factorial_series {X : Type*} [MeasurableSpace X] {P : Measure X} [IsProbabilityMeasure P] {n : ℕ} (I : Finset (Fin n)) (hI : I.Nonempty) (W V : X → ℝ) (hW : Measurable W) (hV : Measurable V) (R : ℝ) (hR : 0 < R) (C : ℝ) (hC : 0 ≤ C) (henv : ∫⁻ o, ofReal ((|W o| * exp (2 * R * |V o|)) ^ 2) ∂P ≤ ofReal (C ^ 2)) (data : Fin n → X) (z : ℂ) (hz : ‖z‖ ≤ R) : (I.card : ℂ)⁻¹ * ∑ i ∈ I, (W (data i) : ℂ) * exp (z * V (data i)) - weightedTransform P W V z = ∑' k : ℕ, (((I.card : ℝ)⁻¹ * ∑ i ∈ I, (W (data i) * V (data i) ^ k / k.factorial - ∫ o, W o * V o ^ k / k.factorial ∂P) : ℝ) : ℂ) * z ^ k := by let f : ℕ → X → ℝ := fun k o ↦ W o * V o ^ k / k.factorial have hf (k : ℕ) : MemLp (f k) 2 P ∧ eLpNorm (f k) 2 P ≤ ofReal (C / (2 * R) ^ k) := by simpa [f] using factorial_coefficient_memLp_two P W V hW hV R hR C hC henv k have hdom : Integrable (fun o ↦ |W o| * exp (2 * ‖z‖ * |V o|)) P := by let E : X → ℝ := fun o ↦ |W o| * exp (2 * R * |V o|) have hEmeas : Measurable E := hW.abs.mul (Real.continuous_exp.measurable.comp (measurable_const.mul hV.abs)) have hEmem := memLp_two_and_eLpNorm_le_of_sq_lintegral_le P hEmeas hC henv |>.1 apply (hEmem.integrable (by norm_num)).mono' ((hW.abs.fun_mul (Real.continuous_exp.measurable.comp (measurable_const.fun_mul hV.abs))).aestronglyMeasurable) filter_upwards [] with o simp only [Function.comp_apply, E, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (abs_nonneg _) (Real.exp_pos _).le)] exact mul_le_mul_of_nonneg_left (Real.exp_le_exp.mpr (by gcongr)) (abs_nonneg _) have hpop := weighted_exp_integral_eq_moment_tsum P W V hW hV z hdom have hmean_bound (k : ℕ) : |∫ o, f k o ∂P| ≤ C / (2 * R) ^ k := by have hle := abs_integral_le_eLpNorm_two (hf k).1 exact hle.trans ((ENNReal.toReal_mono ENNReal.ofReal_ne_top (hf k).2).trans_eq (ENNReal.toReal_ofReal (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) _)))) let r : ℕ → ℂ := fun k ↦ ((∫ o, f k o ∂P : ℝ) : ℂ) * z ^ k have hr : Summable r := by apply Summable.of_norm apply Summable.of_nonneg_of_le (fun k ↦ norm_nonneg _) (fun k ↦ ?_) ((summable_geometric_of_norm_lt_one (by norm_num : ‖(1 / 2 : ℝ)‖ < 1)).mul_left C) dsimp [r] rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, norm_pow] calc |∫ o, f k o ∂P| * ‖z‖ ^ k ≤ (C / (2 * R) ^ k) * R ^ k := by exact mul_le_mul (hmean_bound k) (pow_le_pow_left₀ (norm_nonneg z) hz k) (pow_nonneg (norm_nonneg z) k) (div_nonneg hC (pow_nonneg (mul_nonneg (by norm_num) hR.le) k)) _ = C * (1 / 2 : ℝ) ^ k := by have hR0 : R ≠ 0 := hR.ne' field_simp have ht : (1 / 2 : ℝ) ^ k * 2 ^ k = 1 := by rw [one_div, inv_pow, inv_mul_cancel₀] positivity calc C * R ^ k = C * R ^ k * 1 := by ring _ = C * R ^ k * ((1 / 2 : ℝ) ^ k * 2 ^ k) := by rw [ht] _ = _ := by ring let q : Fin n → ℕ → ℂ := fun i k ↦ (f k (data i) : ℂ) * z ^ k have hq (i : Fin n) : Summable (q i) := by have hs := (NormedSpace.expSeries_div_summable (z * (V (data i) : ℂ))).mul_left (W (data i) : ℂ) refine hs.congr (fun k ↦ ?_) symm simp [q, f] push_cast ring have hqsum : ∀ s : Finset (Fin n), Summable (fun k ↦ ∑ i ∈ s, q i k) := by intro s induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => simp_rw [Finset.sum_insert hi] exact (hq i).add ih have hsum_tsum : ∀ s : Finset (Fin n), (∑ i ∈ s, ∑' k, q i k) = ∑' k, ∑ i ∈ s, q i k := by intro s induction s using Finset.induction_on with | empty => simp | @insert i s hi ih => simp_rw [Finset.sum_insert hi] rw [ih] exact ((hq i).tsum_add (hqsum s)).symm let e : ℕ → ℂ := fun k ↦ (I.card : ℂ)⁻¹ * (∑ i ∈ I, q i k) have he : Summable e := (hqsum I).mul_left _ have hemp : (I.card : ℂ)⁻¹ * ∑ i ∈ I, (W (data i) : ℂ) * exp (z * V (data i)) = ∑' k, e k := by dsimp [e] rw [tsum_mul_left, ← hsum_tsum I] congr 1 apply Finset.sum_congr rfl intro i hi dsimp [q] rw [Complex.exp_eq_exp_ℂ, NormedSpace.exp_eq_tsum_div, ← tsum_mul_left] apply tsum_congr intro k simp [f] push_cast ring rw [hemp] rw [show weightedTransform P W V z = ∑' k, r k by rw [weightedTransform, hpop] apply tsum_congr intro k dsimp [r, f] rw [integral_div] push_cast ring] rw [← he.tsum_sub hr] apply tsum_congr intro k dsimp [e, q, r, f] rw [integral_div] push_cast rw [Finset.sum_sub_distrib, Finset.sum_const, nsmul_eq_mul] have hc : (I.card : ℂ) ≠ 0 := by exact_mod_cast hI.card_pos.ne' field_simp rw [mul_sub, Finset.mul_sum] congr 1 · apply Finset.sum_congr rfl intro i hi ring · ring
CausalSmith.Stat.SaPlmCumulantConverse.weighted_empirical_sub_eq_centered_factorial_series · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:182
def empiricalTransformL2Constant

The explicit constant in the uniform disk bound for the empirical transforms: four times the sum of two envelope factors. The first is twice the exponential of eight times the search radius times the treatment-regression bound, plus four times the squared radius times the squared treatment sub-Gaussian scale. The second adds to a fourth-moment term — sixty-four times the sum of the fourth power of the outcome-regression bound, four times the fourth power of the treatment-effect bound times the fourth power of the treatment scale, and four times the fourth power of the outcome sub-Gaussian scale — twice the exponential of sixteen times the radius times the treatment-regression bound plus sixteen times the squared radius times the squared treatment scale.

Definition (Lean source)
def empiricalTransformL2Constant (Ctheta Cg Cq psieta psixi R1 : ℝ) : ℝ := let AF := 2 * exp (8 * R1 * Cg + 4 * R1 ^ 2 * psieta ^ 2) let AG := 64 * (Cq ^ 4 + 4 * Ctheta ^ 4 * psieta ^ 4 + 4 * psixi ^ 4) + 2 * exp (16 * R1 * Cg + 16 * R1 ^ 2 * psieta ^ 2) 4 * ((sqrt AF) ^ 2 + (sqrt AG) ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalTransformL2Constant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:322
theorem empiricalTransformL2Constant_pos

The explicit constant in the uniform disk bound for the empirical transforms is strictly positive for any values of the model constants and the search radius.

Formal statement
Ctheta Cg Cq psieta psixi R1 :
0 < empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1
Proof (Lean source)
lemma empiricalTransformL2Constant_pos (Ctheta Cg Cq psieta psixi R1 : ℝ) : 0 < empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1 := by dsimp [empiricalTransformL2Constant] positivity
CausalSmith.Stat.SaPlmCumulantConverse.empiricalTransformL2Constant_pos · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:340
theorem empirical_transform_uniform_l2_explicit

Explicit-constant form of the uniform split-fold transform bound.

Formal statement
Xspace :
Type*
Ctheta Cg Cq psieta psixi R1 :
∀ (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → 2 ≤ p.n → ∀ (m : Model (Xspace := Xspace) p), NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → ∀ a : Fin 2, (inferenceFold p.n a).Nonempty → (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) R1 data) ^ 2) ∂iidLaw m p.n)
+ (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) R1 data) ^ 2) ∂iidLaw m p.n)
ofReal (empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1 / (inferenceFold p.n a).card)
Proof (Lean source)
lemma empirical_transform_uniform_l2_explicit {Xspace : Type*} [MeasurableSpace Xspace] (Ctheta Cg Cq psieta psixi R1 : ℝ) : ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → 2 ≤ p.n → ∀ (m : Model (Xspace := Xspace) p), NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → ∀ a : Fin 2, (inferenceFold p.n a).Nonempty → (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) + (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) ≤ ofReal (empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1 / (inferenceFold p.n a).card) := by let AF := 2 * exp (8 * R1 * Cg + 4 * R1 ^ 2 * psieta ^ 2) let AG := 64 * (Cq ^ 4 + 4 * Ctheta ^ 4 * psieta ^ 4 + 4 * psixi ^ 4) + 2 * exp (16 * R1 * Cg + 16 * R1 ^ 2 * psieta ^ 2) let CF := sqrt AF let CG := sqrt AG let K := 4 * (CF ^ 2 + CG ^ 2) have hAF : 0 < AF := by dsimp [AF]; positivity have hAG : 0 < AG := by dsimp [AG]; positivity have hCF : 0 < CF := Real.sqrt_pos.2 hAF have hCG : 0 < CG := Real.sqrt_pos.2 hAG change ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → 2 ≤ p.n → ∀ (m : Model (Xspace := Xspace) p), NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → ∀ a : Fin 2, (inferenceFold p.n a).Nonempty → (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) + (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) ≤ ofReal (K / (inferenceFold p.n a).card) intro p hpθ hpg hpq hpη hpξ hpR hn m hclass _hiid a hI subst Ctheta subst Cg subst Cq subst psieta subst psixi subst R1 let I := inferenceFold p.n a have hR : 0 < searchRadius p := by have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak apply mul_nonneg · exact Real.rpow_nonneg (by positivity) _ · exact Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _ unfold searchRadius linarith have hFenv : ∫⁻ o, ofReal ((|(1 : ℝ)| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (CF ^ 2) := by have h := learnedResidual_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le have hCFsq : CF ^ 2 = AF := Real.sq_sqrt hAF.le rw [hCFsq] simpa [AF, ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 2)] using h have hGenv : ∫⁻ o, ofReal ((|outcome o| * exp (2 * searchRadius p * |learnedResidual p m p.n o|)) ^ 2) ∂m.P ≤ ofReal (CG ^ 2) := by have h := outcome_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR.le have hCGsq : CG ^ 2 = AG := Real.sq_sqrt hAG.le rw [hCGsq] exact h let cF : (Fin p.n → Obs Xspace) → ℕ → ℝ := fun data k ↦ (I.card : ℝ)⁻¹ * ∑ i ∈ I, (learnedResidual p m p.n (data i) ^ k / k.factorial - ∫ o, learnedResidual p m p.n o ^ k / k.factorial ∂m.P) let cG : (Fin p.n → Obs Xspace) → ℕ → ℝ := fun data k ↦ (I.card : ℝ)⁻¹ * ∑ i ∈ I, (outcome (data i) * learnedResidual p m p.n (data i) ^ k / k.factorial - ∫ o, outcome o * learnedResidual p m p.n o ^ k / k.factorial ∂m.P) have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) have hFbound := centered_factorial_empirical_disk_l2 I hI (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) measurable_const hZmeas (searchRadius p) hR CF hCF.le hFenv have hGbound := centered_factorial_empirical_disk_l2 I hI outcome (learnedResidual p m p.n) measurable_snd.snd hZmeas (searchRadius p) hR CG hCG.le hGenv have hFerr : ∀ data, transformSupError (fun data z ↦ empiricalF p m p.n data I z) (residualMGF p m p.n) (searchRadius p) data = diskSupNorm (fun data z ↦ ∑' k, (cF data k : ℂ) * z ^ k) (searchRadius p) data := by intro data rw [transformSupError_eq_diskSupNorm, diskSupNorm_eq_sSup_image, diskSupNorm_eq_sSup_image] apply congrArg sSup ext x constructor <;> rintro ⟨z, hz, rfl⟩ <;> refine ⟨z, hz, ?_⟩ · congr 1 symm have hs := weighted_empirical_sub_eq_centered_factorial_series I hI (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) measurable_const hZmeas (searchRadius p) hR CF hCF.le hFenv data z hz exact congrArg norm (by simpa [cF, empiricalF, residualMGF, weightedTransform, complexMGF] using hs) · congr 1 have hs := weighted_empirical_sub_eq_centered_factorial_series I hI (fun _ : Obs Xspace ↦ (1 : ℝ)) (learnedResidual p m p.n) measurable_const hZmeas (searchRadius p) hR CF hCF.le hFenv data z hz exact congrArg norm (by simpa [cF, empiricalF, residualMGF, weightedTransform, complexMGF] using hs) have hGerr : ∀ data, transformSupError (fun data z ↦ empiricalG p m p.n data I z) (outcomeResidualTransform p m p.n) (searchRadius p) data = diskSupNorm (fun data z ↦ ∑' k, (cG data k : ℂ) * z ^ k) (searchRadius p) data := by intro data rw [transformSupError_eq_diskSupNorm, diskSupNorm_eq_sSup_image, diskSupNorm_eq_sSup_image] apply congrArg sSup ext x constructor <;> rintro ⟨z, hz, rfl⟩ <;> refine ⟨z, hz, ?_⟩ · congr 1 symm exact congrArg norm (by simpa [cG, empiricalG, outcomeResidualTransform] using (weighted_empirical_sub_eq_centered_factorial_series I hI outcome (learnedResidual p m p.n) measurable_snd.snd hZmeas (searchRadius p) hR CG hCG.le hGenv data z hz)) · congr 1 exact congrArg norm (by simpa [cG, empiricalG, outcomeResidualTransform] using (weighted_empirical_sub_eq_centered_factorial_series I hI outcome (learnedResidual p m p.n) measurable_snd.snd hZmeas (searchRadius p) hR CG hCG.le hGenv data z hz)) have htotal : (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data I z) (residualMGF p m p.n) (searchRadius p) data) ^ 2) ∂Measure.pi (fun _ : Fin p.n ↦ m.P)) + (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data I z) (outcomeResidualTransform p m p.n) (searchRadius p) data) ^ 2) ∂Measure.pi (fun _ : Fin p.n ↦ m.P)) ≤ ofReal (K / I.card) := by simp_rw [hFerr, hGerr] have hFbound' : (∫⁻ data, ofReal ((diskSupNorm (fun data z ↦ ∑' k, (cF data k : ℂ) * z ^ k) (searchRadius p) data) ^ 2) ∂Measure.pi (fun _ : Fin p.n ↦ m.P)) ≤ ofReal ((2 * CF / sqrt I.card) ^ 2) := by simpa [cF] using hFbound have hGbound' : (∫⁻ data, ofReal ((diskSupNorm (fun data z ↦ ∑' k, (cG data k : ℂ) * z ^ k) (searchRadius p) data) ^ 2) ∂Measure.pi (fun _ : Fin p.n ↦ m.P)) ≤ ofReal ((2 * CG / sqrt I.card) ^ 2) := by simpa [cG] using hGbound calc _ ≤ ofReal ((2 * CF / sqrt I.card) ^ 2) + ofReal ((2 * CG / sqrt I.card) ^ 2) := add_le_add hFbound' hGbound' _ = ofReal (K / I.card) := by rw [← ENNReal.ofReal_add (sq_nonneg _) (sq_nonneg _)] congr 1 have hcard : (0 : ℝ) < I.card := by exact_mod_cast hI.card_pos dsimp [K] rw [div_pow, div_pow, Real.sq_sqrt hcard.le] field_simp ring simpa [I, iidLaw] using htotal
CausalSmith.Stat.SaPlmCumulantConverse.empirical_transform_uniform_l2_explicit · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:349
theorem empirical_transform_uniform_l2 Lemma 9 in the paper ↗

Both split-fold analytic transforms have uniform mean-square error of order inverse fold size.

Formal statement
Xspace :
Type*
Ctheta Cg Cq psieta psixi R1 :
∃ K : ℝ,
0 < K ∧
∀ (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → 2 ≤ p.n → ∀ (m : Model (Xspace := Xspace) p), NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → ∀ a : Fin 2, (inferenceFold p.n a).Nonempty → (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) R1 data) ^ 2) ∂iidLaw m p.n)
+ (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) R1 data) ^ 2) ∂iidLaw m p.n)
ofReal (K / (inferenceFold p.n a).card)
Proof (Lean source)
-- @node: lem:empirical-transform-uniform-l2 lemma empirical_transform_uniform_l2 {Xspace : Type*} [MeasurableSpace Xspace] (Ctheta Cg Cq psieta psixi R1 : ℝ) : ∃ K : ℝ, 0 < K ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → searchRadius p = R1 → 2 ≤ p.n → ∀ (m : Model (Xspace := Xspace) p), NonGaussianClass p p.n m → IidSampling p.n m.P (iidLaw m p.n) → ∀ a : Fin 2, (inferenceFold p.n a).Nonempty → (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalF p m p.n data (inferenceFold p.n a) z) (residualMGF p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) + (∫⁻ data, ofReal ((transformSupError (fun data z ↦ empiricalG p m p.n data (inferenceFold p.n a) z) (outcomeResidualTransform p m p.n) R1 data) ^ 2) ∂iidLaw m p.n) ≤ ofReal (K / (inferenceFold p.n a).card) := by refine ⟨empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1, empiricalTransformL2Constant_pos _ _ _ _ _ _, ?_⟩ exact empirical_transform_uniform_l2_explicit Ctheta Cg Cq psieta psixi R1
CausalSmith.Stat.SaPlmCumulantConverse.empirical_transform_uniform_l2 · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/EmpiricalTransformSeries.lean:525
Helpers.FixedCodeConverse 2 declarations This module packages the affine-Gaussian two-point construction while retaining both supplied nuisance-code functions.

Fixed-code non-Gaussian minimax converse

This module packages the affine-Gaussian two-point construction while retaining both supplied nuisance-code functions.

theorem fixed_code_non_gaussian_minimax_lower

A positive inverse-sample-size minimax lower bound on every nonempty broad non-Gaussian class with both supplied codes fixed.

Formal statement
r :
delta Ctheta Cg Cq psieta psixi :
hpsixi :
0 < psixi
∃ c : ℝ,
0 < c ∧
∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters),
p.r
= r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ (base : Model (Xspace := Xspace) p), IidSampling p.n base.P (iidLaw base p.n) → ({m : Model (Xspace := Xspace) p | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}).Nonempty → 2 ≤ p.n → ofReal (c / p.n) ≤ minimaxRisk p p.n base.gcode base.qcode
Proof (Lean source)
lemma fixed_code_non_gaussian_minimax_lower (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ) (hpsixi : 0 < psixi) : ∃ c : ℝ, 0 < c ∧ ∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters), p.r = r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ (base : Model (Xspace := Xspace) p), IidSampling p.n base.P (iidLaw base p.n) → ({m : Model (Xspace := Xspace) p | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}).Nonempty → 2 ≤ p.n → ofReal (c / p.n) ≤ minimaxRisk p p.n base.gcode base.qcode := by let c0 : ℝ := if 0 < Ctheta then min Ctheta 1 else 1 let C0 : ℝ := max 1 (16 * psieta ^ 2 / psixi ^ 2) let tau : ℝ := psixi / 4 let K : ℝ := C0 * c0 ^ 2 obtain ⟨cK, hcK, hlecam⟩ := le_cam_two_point_mse K refine ⟨cK * c0 ^ 2, ?_, ?_⟩ · apply mul_pos hcK apply sq_pos_of_pos dsimp [c0] split_ifs with h · exact lt_min h zero_lt_one · norm_num intro Xspace inst p hr hdelta hCtheta hCg hCq hpsieta hp base _hiid hlaws hn subst r subst delta subst Ctheta subst Cg subst Cq subst psieta subst psixi have hc0_le : c0 ≤ p.Ctheta := by simp only [c0, if_pos p.constants_pos.1] exact min_le_left _ _ have hc0_pos : 0 < c0 := by simp only [c0, if_pos p.constants_pos.1] exact lt_min p.constants_pos.1 zero_lt_one have htau_pos : 0 < tau := by dsimp [tau] linarith [p.constants_pos.2.2.2.2.1] have hC0_coeff : 16 * p.psieta ^ 2 / p.psixi ^ 2 ≤ C0 := le_max_right _ _ rcases hlaws with ⟨hardBase, hhard, hgcode, hqcode⟩ let thetaMinus : ℝ := -c0 / (2 * sqrt p.n) let thetaPlus : ℝ := c0 / (2 * sqrt p.n) let m0 := affineGaussianModel hardBase thetaMinus tau let m1 := affineGaussianModel hardBase thetaPlus tau have hsqrt_pos : 0 < sqrt p.n := Real.sqrt_pos.2 (by exact_mod_cast (show 0 < p.n by omega)) have hsqrt_ge : 1 ≤ sqrt p.n := Real.one_le_sqrt.mpr (by exact_mod_cast (show 1 ≤ p.n by omega)) have htminus : |thetaMinus| ≤ c0 := by dsimp [thetaMinus] rw [abs_div, abs_neg, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith have htplus : |thetaPlus| ≤ c0 := by dsimp [thetaPlus] rw [abs_div, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith have hm0 : m0 ∈ {m : Model (Xspace := Xspace) p | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} := by refine ⟨affineGaussianModel_nonGaussianClass_quarter hardBase p.n hhard thetaMinus (htminus.trans hc0_le), ?_, ?_⟩ · exact hgcode · exact hqcode have hm1 : m1 ∈ {m : Model (Xspace := Xspace) p | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} := by refine ⟨affineGaussianModel_nonGaussianClass_quarter hardBase p.n hhard thetaPlus (htplus.trans hc0_le), ?_, ?_⟩ · exact hgcode · exact hqcode have hsep : |thetaPlus - thetaMinus| = c0 / sqrt p.n := by have heq : thetaPlus - thetaMinus = c0 / sqrt p.n := by dsimp [thetaPlus, thetaMinus] field_simp [ne_of_gt hsqrt_pos] ring rw [heq, abs_of_pos (div_pos hc0_pos hsqrt_pos)] have hKLraw := affineGaussianModel_iid_kl_le hardBase p.n hhard.etaSubGaussian thetaMinus thetaPlus tau htau_pos have hnreal : 0 < (p.n : ℝ) := by positivity have hsqrt_sq : (sqrt p.n) ^ 2 = (p.n : ℝ) := Real.sq_sqrt hnreal.le have hsep_sq : (thetaPlus - thetaMinus) ^ 2 = c0 ^ 2 / (p.n : ℝ) := by rw [← sq_abs (thetaPlus - thetaMinus), hsep, div_pow, hsqrt_sq] have hKL : klDiv (iidLaw m0 p.n) (iidLaw m1 p.n) ≤ ofReal (C0 * c0 ^ 2) := by refine hKLraw.trans ?_ apply ENNReal.ofReal_le_ofReal dsimp [m0, m1, tau] at hKLraw ⊢ rw [hsep_sq] have hpsi : 0 < p.psixi := p.constants_pos.2.2.2.2.1 calc (p.n : ℝ) * ((c0 ^ 2 / (p.n : ℝ) * (2 * p.psieta ^ 2)) / (2 * (p.psixi / 4) ^ 2)) = (16 * p.psieta ^ 2 / p.psixi ^ 2) * c0 ^ 2 := by field_simp [ne_of_gt hnreal, ne_of_gt hpsi] ring _ ≤ C0 * c0 ^ 2 := mul_le_mul_of_nonneg_right hC0_coeff (sq_nonneg _) letI : IsProbabilityMeasure (iidLaw m0 p.n) := by unfold iidLaw infer_instance letI : IsProbabilityMeasure (iidLaw m1 p.n) := by unfold iidLaw infer_instance have hbody : ∀ T : (Fin p.n → Obs Xspace) → ℝ, Measurable T → Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 p.n) → Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 p.n) → cK * (m1.theta0 - m0.theta0) ^ 2 ≤ max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 p.n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 p.n) := by exact hlecam (iidLaw m0 p.n) (iidLaw m1 p.n) m0.theta0 m1.theta0 hKL have hlow := minimaxRiskOn_two_point_lower p p.n _ m0 m1 hm0 hm1 p.Ctheta cK p.constants_pos.1.le (by exact hm0.1.thetaRange) (by exact hm1.1.thetaRange) hbody have hscaled : ofReal (cK * c0 ^ 2 / p.n) ≤ minimaxRiskOn p p.n {m : Model (Xspace := Xspace) p | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} := by convert hlow using 1 congr 1 dsimp [m0, m1, thetaMinus, thetaPlus] field_simp [ne_of_gt hnreal, ne_of_gt hsqrt_pos] rw [hsqrt_sq] ring exact hscaled
CausalSmith.Stat.SaPlmCumulantConverse.fixed_code_non_gaussian_minimax_lower · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/FixedCodeConverse.lean:16
theorem fixed_code_ace_minimax_lower

A positive inverse-sample-size lower bound for every nonempty fixed-code published ACE class, uniform over the covariate space.

Formal statement
r :
delta Ctheta Cg Cq psieta psixi :
hpsixi :
0 < psixi
∃ c : ℝ,
0 < c ∧
∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters),
p.r
= r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ (base : Model (Xspace := Xspace) p), ({m : Model (Xspace := Xspace) p | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}).Nonempty → 2 ≤ p.n → ofReal (c / p.n) ≤ minimaxRiskOn p p.n {m : Model (Xspace := Xspace) p | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}
Proof (Lean source)
lemma fixed_code_ace_minimax_lower (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ) (hpsixi : 0 < psixi) : ∃ c : ℝ, 0 < c ∧ ∀ {Xspace : Type*} [MeasurableSpace Xspace] (p : Parameters), p.r = r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ (base : Model (Xspace := Xspace) p), ({m : Model (Xspace := Xspace) p | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}).Nonempty → 2 ≤ p.n → ofReal (c / p.n) ≤ minimaxRiskOn p p.n {m : Model (Xspace := Xspace) p | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} := by let c0 : ℝ := if 0 < Ctheta then min Ctheta 1 else 1 let C0 : ℝ := max 1 (16 * psieta ^ 2 / psixi ^ 2) let tau : ℝ := psixi / 4 let K : ℝ := C0 * c0 ^ 2 obtain ⟨cK, hcK, hlecam⟩ := le_cam_two_point_mse K refine ⟨cK * c0 ^ 2, mul_pos hcK ?_, ?_⟩ · exact sq_pos_of_pos (by dsimp [c0] split_ifs with h · exact lt_min h zero_lt_one · norm_num) intro Xspace inst p hr hdelta hCtheta hCg hCq hpsieta hp base hlaws hn subst r; subst delta; subst Ctheta; subst Cg; subst Cq; subst psieta; subst psixi have hc0_le : c0 ≤ p.Ctheta := by simp only [c0, if_pos p.constants_pos.1] exact min_le_left _ _ have hc0_pos : 0 < c0 := by simp only [c0, if_pos p.constants_pos.1] exact lt_min p.constants_pos.1 zero_lt_one have htau_pos : 0 < tau := by dsimp [tau] linarith [p.constants_pos.2.2.2.2.1] have hC0_coeff : 16 * p.psieta ^ 2 / p.psixi ^ 2 ≤ C0 := le_max_right _ _ rcases hlaws with ⟨hardBase, hhard, hgcode, hqcode⟩ let thetaMinus : ℝ := -c0 / (2 * sqrt p.n) let thetaPlus : ℝ := c0 / (2 * sqrt p.n) let m0 := affineGaussianModel hardBase thetaMinus tau let m1 := affineGaussianModel hardBase thetaPlus tau have hsqrt_pos : 0 < sqrt p.n := Real.sqrt_pos.2 (by exact_mod_cast (show 0 < p.n by omega)) have hsqrt_ge : 1 ≤ sqrt p.n := Real.one_le_sqrt.mpr (by exact_mod_cast (show 1 ≤ p.n by omega)) have htminus : |thetaMinus| ≤ c0 := by dsimp [thetaMinus] rw [abs_div, abs_neg, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith have htplus : |thetaPlus| ≤ c0 := by dsimp [thetaPlus] rw [abs_div, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith let laws : Set (Model (Xspace := Xspace) p) := {m | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} have hm0 : m0 ∈ laws := by refine ⟨affineGaussianModel_jmsAceClass_quarter hardBase p.n hhard thetaMinus (htminus.trans hc0_le), ?_, ?_⟩ · exact hgcode · exact hqcode have hm1 : m1 ∈ laws := by refine ⟨affineGaussianModel_jmsAceClass_quarter hardBase p.n hhard thetaPlus (htplus.trans hc0_le), ?_, ?_⟩ · exact hgcode · exact hqcode have hsep : |thetaPlus - thetaMinus| = c0 / sqrt p.n := by have heq : thetaPlus - thetaMinus = c0 / sqrt p.n := by dsimp [thetaPlus, thetaMinus] field_simp [ne_of_gt hsqrt_pos] ring rw [heq, abs_of_pos (div_pos hc0_pos hsqrt_pos)] have hKLraw := affineGaussianModel_iid_kl_le hardBase p.n hhard.etaSubGaussian thetaMinus thetaPlus tau htau_pos have hnreal : 0 < (p.n : ℝ) := by positivity have hsqrt_sq : (sqrt p.n) ^ 2 = (p.n : ℝ) := Real.sq_sqrt hnreal.le have hsep_sq : (thetaPlus - thetaMinus) ^ 2 = c0 ^ 2 / (p.n : ℝ) := by rw [← sq_abs (thetaPlus - thetaMinus), hsep, div_pow, hsqrt_sq] have hKL : klDiv (iidLaw m0 p.n) (iidLaw m1 p.n) ≤ ofReal (C0 * c0 ^ 2) := by refine hKLraw.trans ?_ apply ENNReal.ofReal_le_ofReal dsimp [m0, m1, tau] at hKLraw ⊢ rw [hsep_sq] have hpsi : 0 < p.psixi := p.constants_pos.2.2.2.2.1 calc (p.n : ℝ) * ((c0 ^ 2 / (p.n : ℝ) * (2 * p.psieta ^ 2)) / (2 * (p.psixi / 4) ^ 2)) = (16 * p.psieta ^ 2 / p.psixi ^ 2) * c0 ^ 2 := by field_simp [ne_of_gt hnreal, ne_of_gt hpsi] ring _ ≤ C0 * c0 ^ 2 := mul_le_mul_of_nonneg_right hC0_coeff (sq_nonneg _) letI : IsProbabilityMeasure (iidLaw m0 p.n) := by unfold iidLaw; infer_instance letI : IsProbabilityMeasure (iidLaw m1 p.n) := by unfold iidLaw; infer_instance have hbody : ∀ T : (Fin p.n → Obs Xspace) → ℝ, Measurable T → Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 p.n) → Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 p.n) → cK * (m1.theta0 - m0.theta0) ^ 2 ≤ max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 p.n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 p.n) := by exact hlecam (iidLaw m0 p.n) (iidLaw m1 p.n) m0.theta0 m1.theta0 hKL have hlow := minimaxRiskOn_two_point_lower p p.n laws m0 m1 hm0 hm1 p.Ctheta cK p.constants_pos.1.le (by exact hm0.1.thetaRange) (by exact hm1.1.thetaRange) hbody convert hlow using 1 congr 1 dsimp [m0, m1, thetaMinus, thetaPlus] field_simp [ne_of_gt hnreal, ne_of_gt hsqrt_pos] rw [hsqrt_sq] ring
CausalSmith.Stat.SaPlmCumulantConverse.fixed_code_ace_minimax_lower · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/FixedCodeConverse.lean:155
Helpers.GaussianRademacherBenchmark 6 declarations This module assembles the explicit transform identities and the generic clipped-ratio risk bound for the local-to-Gaussian path.

Gaussian--Rademacher sine-score benchmark

This module assembles the explicit transform identities and the generic clipped-ratio risk bound for the local-to-Gaussian path.

theorem gaussianRademacher_second_lintegral_le

The Gaussian--Rademacher path has a uniform second-moment envelope.

Formal statement
a :
ha0 :
0 < a
ha1 :
a ≤ 1
∫⁻ x : ℝ, ofReal (x ^ 2) ∂gaussianRademacherLaw a ≤ 4
Proof (Lean source)
-- @node: gaussianRademacher_second_lintegral_le lemma gaussianRademacher_second_lintegral_le {a : ℝ} (ha0 : 0 < a) (ha1 : a ≤ 1) : ∫⁻ x : ℝ, ofReal (x ^ 2) ∂gaussianRademacherLaw a ≤ 4 := by -- The variance argument is the anonymous-constructor term `⟨1, zero_le_one⟩`, -- which blocks rewriting inside the goal; generalise it away first. have hgauss : ∫ x : ℝ, x ^ 2 ∂gaussianReal 0 ⟨1, zero_le_one⟩ = 1 := by have key : ∀ v : NNReal, v = 1 → ∫ x : ℝ, x ^ 2 ∂gaussianReal 0 v = 1 := by rintro v rfl have hv := variance_fun_id_gaussianReal (μ := 0) (v := 1) change Var[id; gaussianReal 0 1] = 1 at hv rw [variance_eq_integral measurable_id.aemeasurable] at hv simp only [integral_id_gaussianReal, id_eq, sub_zero] at hv exact hv exact key _ rfl unfold gaussianRademacherLaw rw [lintegral_map (by fun_prop : Measurable (fun x : ℝ ↦ ofReal (x ^ 2))) (by fun_prop)] rw [lintegral_prod (fun z : ℝ × ℝ ↦ ofReal ((sqrt (1 - a ^ 2) * z.1 + a * z.2) ^ 2)) ((by fun_prop : Measurable (fun z : ℝ × ℝ ↦ ofReal ((sqrt (1 - a ^ 2) * z.1 + a * z.2) ^ 2))).aemeasurable)] simp only [rademacherLaw, lintegral_add_measure, lintegral_smul_measure, lintegral_dirac] have hsqrt2 : sqrt (1 - a ^ 2) ^ 2 = 1 - a ^ 2 := by rw [Real.sq_sqrt] nlinarith have hpoint (x : ℝ) : ofReal (1 / 2) • ofReal ((sqrt (1 - a ^ 2) * x + a * -1) ^ 2) + ofReal (1 / 2) • ofReal ((sqrt (1 - a ^ 2) * x + a * 1) ^ 2) ≤ ofReal (2 * x ^ 2 + 2) := by simp only [smul_eq_mul] rw [← ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 1 / 2), ← ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 1 / 2), ← ENNReal.ofReal_add (mul_nonneg (by positivity) (sq_nonneg _)) (mul_nonneg (by positivity) (sq_nonneg _))] apply ENNReal.ofReal_le_ofReal nlinarith [sq_nonneg (sqrt (1 - a ^ 2) * x - a), sq_nonneg (sqrt (1 - a ^ 2) * x + a)] refine (lintegral_mono hpoint).trans_eq ?_ have hsqint : Integrable (fun x : ℝ ↦ x ^ 2) (gaussianReal 0 ⟨1, zero_le_one⟩) := by simpa only [id_eq, Real.norm_eq_abs, sq_abs] using (memLp_id_gaussianReal (μ := 0) (v := ⟨1, zero_le_one⟩) 2).integrable_sq have h2sq : Integrable (fun x : ℝ ↦ 2 * x ^ 2) (gaussianReal 0 ⟨1, zero_le_one⟩) := hsqint.const_mul 2 have h2 : Integrable (fun _x : ℝ ↦ (2 : ℝ)) (gaussianReal 0 ⟨1, zero_le_one⟩) := integrable_const 2 have hsum : Integrable (fun x : ℝ ↦ 2 * x ^ 2 + 2) (gaussianReal 0 ⟨1, zero_le_one⟩) := h2sq.add h2 rw [← ofReal_integral_eq_lintegral_ofReal hsum (Filter.Eventually.of_forall fun x ↦ by change 0 ≤ 2 * x ^ 2 + 2 nlinarith [sq_nonneg x])] rw [integral_add h2sq h2, integral_const_mul, hgauss] norm_num
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacher_second_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:20
theorem sine_remainder_centered_of_mgf_zero

At a characteristic zero, the sine-score regression remainder is centered.

Formal statement
m :
Model (Xspace := Xspace) p
n :
t :
hzero :
treatmentMGF p m (I * t) = 0
htheta :
hg :
GRange p m
hq :
QRange p m
∫ o, (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o) ∂m.P
= 0
Proof (Lean source)
-- @node: sine_remainder_centered_of_mgf_zero lemma sine_remainder_centered_of_mgf_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t : ℝ) (hzero : treatmentMGF p m (I * t) = 0) (hind : IndependentTreatmentNoise p m) (hout : OutcomeMeanIndependence p m) (htheta : ThetaRange p m) (hg : GRange p m) (hq : QRange p m) : ∫ o, (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o) ∂m.P = 0 := by let D0 : Xspace → ℝ := fun x ↦ m.g0 x - barG p m n x let b0 : Xspace → ℝ := fun x ↦ m.q0 x - m.theta0 * D0 x let J : Obs Xspace → ℝ := fun o ↦ sin (t * learnedResidual p m n o) have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hD : Measurable D0 := m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hb : Measurable b0 := m.q0_measurable.sub (measurable_const.mul hD) have hsin : ∫ o, sin (t * eta p m o) ∂m.P = 0 := by simpa using integral_sin_shift_eq_zero p m t 0 hzero have hcos : ∫ o, cos (t * eta p m o) ∂m.P = 0 := by have hE : Integrable (fun o ↦ exp ((I * t) * eta p m o)) m.P := by apply (integrable_const (μ := m.P) (c := (1 : ℝ))).mono' (by fun_prop : Measurable (fun o ↦ exp ((I * t) * eta p m o))).aestronglyMeasurable filter_upwards [] with o simp [Complex.norm_exp, Complex.mul_re] have hre : (∫ o, exp ((I * t) * eta p m o) ∂m.P).re = 0 := by change (treatmentMGF p m (I * t)).re = 0 rw [hzero] rfl calc _ = ∫ o, (exp ((I * t) * eta p m o)).re ∂m.P := by apply integral_congr_ae filter_upwards [] with o rw [Complex.exp_re] norm_num [Complex.mul_re, Complex.mul_im] _ = (∫ o, exp ((I * t) * eta p m o) ∂m.P).re := integral_re hE _ = 0 := hre have hbInt : Integrable (fun o ↦ b0 (covariate o)) m.P := by apply (integrable_const (μ := m.P) (c := p.Cq + p.Ctheta * (2 * p.Cg))).mono' (hb.comp hX).aestronglyMeasurable have hg' := MeasureTheory.ae_of_ae_map hX.aemeasurable hg have hq' := MeasureTheory.ae_of_ae_map hX.aemeasurable hq filter_upwards [hg', hq'] with o hgo hqo have hbar : |barG p m n (covariate o)| ≤ p.Cg := by have hpCg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD0 : |D0 (covariate o)| ≤ 2 * p.Cg := by dsimp [D0] exact (abs_sub _ _).trans (by linarith) rw [Real.norm_eq_abs] dsimp [b0] calc _ ≤ |m.q0 (covariate o)| + |m.theta0| * |D0 (covariate o)| := by simpa [abs_mul] using abs_sub (m.q0 (covariate o)) (m.theta0 * D0 (covariate o)) _ ≤ _ := add_le_add hqo (mul_le_mul htheta hD0 (abs_nonneg _) p.constants_pos.1.le) have hbJ : ∫ o, b0 (covariate o) * J o ∂m.P = 0 := by have hfacSin := hind.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ sin (t * e)) (g := fun x : Xspace ↦ b0 x * cos (t * D0 x)) heta.aemeasurable hX.aemeasurable (by fun_prop) (by fun_prop) have hfacCos := hind.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ cos (t * e)) (g := fun x : Xspace ↦ b0 x * sin (t * D0 x)) heta.aemeasurable hX.aemeasurable (by fun_prop) (by fun_prop) have htermSin : Integrable (fun o ↦ sin (t * eta p m o) * (b0 (covariate o) * cos (t * D0 (covariate o)))) m.P := by refine (hbInt.bdd_mul (f := fun o ↦ sin (t * eta p m o) * cos (t * D0 (covariate o))) (c := 1) (by fun_prop) ?_).congr ?_ · filter_upwards [] with o rw [Real.norm_eq_abs, abs_mul] nlinarith [Real.abs_sin_le_one (t * eta p m o), Real.abs_cos_le_one (t * D0 (covariate o)), abs_nonneg (sin (t * eta p m o)), abs_nonneg (cos (t * D0 (covariate o)))] · filter_upwards [] with o ring have htermCos : Integrable (fun o ↦ cos (t * eta p m o) * (b0 (covariate o) * sin (t * D0 (covariate o)))) m.P := by refine (hbInt.bdd_mul (f := fun o ↦ cos (t * eta p m o) * sin (t * D0 (covariate o))) (c := 1) (by fun_prop) ?_).congr ?_ · filter_upwards [] with o rw [Real.norm_eq_abs, abs_mul] nlinarith [Real.abs_cos_le_one (t * eta p m o), Real.abs_sin_le_one (t * D0 (covariate o)), abs_nonneg (cos (t * eta p m o)), abs_nonneg (sin (t * D0 (covariate o)))] · filter_upwards [] with o ring rw [show (∫ o, b0 (covariate o) * J o ∂m.P) = (∫ o, sin (t * eta p m o) * (b0 (covariate o) * cos (t * D0 (covariate o))) ∂m.P) + ∫ o, cos (t * eta p m o) * (b0 (covariate o) * sin (t * D0 (covariate o))) ∂m.P by rw [← integral_add htermSin htermCos] apply integral_congr_ae filter_upwards [] with o have hZ : learnedResidual p m n o = eta p m o + D0 (covariate o) := by simp [learnedResidual, eta, D0, treatmentError] simp only [J, hZ, mul_add, Real.sin_add] ring_nf] rw [hfacSin, hfacCos, hsin, hcos] ring have hJmeas : StronglyMeasurable[xTSigma (Xspace := Xspace)] J := by apply Measurable.stronglyMeasurable dsimp [J] change Measurable[comap (fun o : Obs Xspace ↦ (covariate o, treatment o)) inferInstance] (fun o ↦ sin (t * learnedResidual p m n o)) have hbarMeas : Measurable (barG p m n) := ((m.gcode_measurable n).max measurable_const).min measurable_const have hbase : Measurable (fun xt : Xspace × ℝ ↦ sin (t * (xt.2 - barG p m n xt.1))) := Real.continuous_sin.measurable.comp (measurable_const.mul (measurable_snd.sub (hbarMeas.comp measurable_fst))) simpa [learnedResidual, treatment, covariate, Function.comp_def] using hbase.comp (comap_measurable (fun o : Obs Xspace ↦ (covariate o, treatment o))) have hJambient : Measurable J := by have hbarMeas : Measurable (barG p m n) := ((m.gcode_measurable n).max measurable_const).min measurable_const dsimp [J] exact Real.continuous_sin.measurable.comp (measurable_const.mul (measurable_snd.fst.sub (hbarMeas.comp measurable_fst))) have hbJint : Integrable (fun o ↦ b0 (covariate o) * J o) m.P := by exact hbInt.mul_bdd hJambient.aestronglyMeasurable (Filter.Eventually.of_forall fun o ↦ by simpa [J, Real.norm_eq_abs] using Real.abs_sin_le_one (t * learnedResidual p m n o)) have hxiJint : Integrable (fun o ↦ xi p m o * J o) m.P := by exact hout.1.mul_bdd hJambient.aestronglyMeasurable (Filter.Eventually.of_forall fun o ↦ by simpa [J, Real.norm_eq_abs] using Real.abs_sin_le_one (t * learnedResidual p m n o) ) have hxiJ : ∫ o, xi p m o * J o ∂m.P = 0 := by have hXTle : xTSigma (Xspace := Xspace) ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := comap_le (measurable_fst.prodMk measurable_snd.fst) haveI : SigmaFinite (m.P.trim hXTle) := inferInstance have hpull := MeasureTheory.condExp_mul_of_stronglyMeasurable_right (μ := m.P) (m := xTSigma (Xspace := Xspace)) hJmeas hxiJint hout.1 calc _ = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun o ↦ xi p m o * J o)) o ∂m.P := by symm exact integral_condExp (comap_le (measurable_fst.prodMk measurable_snd.fst)) _ = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (xi p m)) o * J o ∂m.P := integral_congr_ae hpull _ = 0 := by apply integral_eq_zero_of_ae filter_upwards [hout.2] with o ho simp [ho] rw [show (fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * J o) = fun o ↦ b0 (covariate o) * J o + xi p m o * J o by funext o simp [b0, D0, J, xi, learnedResidual, eta, treatmentError] ring] rw [integral_add hbJint hxiJint] rw [hbJ, hxiJ] simp
CausalSmith.Stat.SaPlmCumulantConverse.sine_remainder_centered_of_mgf_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:79
theorem sine_score_memLp_of_eta_second_lintegral_le

Suppose the treatment noise has second moment at most four, the treatment coefficient lies within its range bound, the treatment regression is uniformly bounded, the outcome regression is uniformly bounded, and the outcome noise is sub-Gaussian with the stated scale. Then the two sine scores — the learned treatment residual times the sine of the frequency times that residual, and the residualized outcome times the same sine — are measurable and square integrable, with squared second moments at most eight plus sixteen times the squared treatment-regression bound, and at most four times the squared combined outcome bound plus four times the squared outcome-noise scale, respectively.

Formal statement
m :
Model (Xspace := Xspace) p
n :
t :
hetaSq :
∫⁻ o, ofReal ((eta p m o) ^ 2) ∂m.P ≤ 4
htheta :
hg :
GRange p m
hq :
QRange p m
hxi :
let W := fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o) let R := fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o) Measurable W ∧
MemLp W 2 m.P ∧
MemLp R 2 m.P ∧
(eLpNorm W 2 m.P).toReal ^ 2 ≤ 8 + 16 * p.Cg ^ 2 ∧
(eLpNorm R 2 m.P).toReal ^ 2 ≤ 4 * (p.Cq + 2 * p.Ctheta * p.Cg) ^ 2 + 4 * p.psixi ^ 2
Proof (Lean source)
-- @node: sine_score_memLp_of_eta_second_lintegral_le lemma sine_score_memLp_of_eta_second_lintegral_le (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t : ℝ) (hetaSq : ∫⁻ o, ofReal ((eta p m o) ^ 2) ∂m.P ≤ 4) (htheta : ThetaRange p m) (hg : GRange p m) (hq : QRange p m) (hxi : XiSubGaussian p m) : let W := fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o) let R := fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o) Measurable W ∧ Measurable R ∧ MemLp W 2 m.P ∧ MemLp R 2 m.P ∧ (eLpNorm W 2 m.P).toReal ^ 2 ≤ 8 + 16 * p.Cg ^ 2 ∧ (eLpNorm R 2 m.P).toReal ^ 2 ≤ 4 * (p.Cq + 2 * p.Ctheta * p.Cg) ^ 2 + 4 * p.psixi ^ 2 := by dsimp only let W : Obs Xspace → ℝ := fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o) let R : Obs Xspace → ℝ := fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o) have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hZ : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub ((((m.gcode_measurable n).comp measurable_fst).max measurable_const).min measurable_const) have hWmeas : Measurable W := by dsimp [W]; fun_prop have hRmeas : Measurable R := by dsimp [R, outcome] fun_prop have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg' := MeasureTheory.ae_of_ae_map hcov.aemeasurable hg filter_upwards [hg'] with o ho exact (abs_sub _ _).trans (by linarith [hbar (covariate o)]) have hWSq : ∫⁻ o, ofReal ((W o) ^ 2) ∂m.P ≤ ofReal ((sqrt (8 + 16 * p.Cg ^ 2)) ^ 2) := by calc _ ≤ ∫⁻ o, ofReal (2 * (eta p m o) ^ 2 + 8 * p.Cg ^ 2) ∂m.P := by apply lintegral_mono_ae filter_upwards [hD] with o hDo apply ENNReal.ofReal_le_ofReal have hZeq : learnedResidual p m n o = eta p m o + treatmentError p m n o := by simp [learnedResidual, eta, treatmentError] dsimp [W] have hs := Real.abs_sin_le_one (t * learnedResidual p m n o) have hCg : 0 ≤ p.Cg := p.constants_pos.2.1.le have hDsq : treatmentError p m n o ^ 2 ≤ (2 * p.Cg) ^ 2 := (by simpa only [sq_abs] using ((sq_le_sq₀ (abs_nonneg (treatmentError p m n o)) (by positivity : 0 ≤ |2 * p.Cg|)).2 (by simpa [abs_of_nonneg (by positivity : 0 ≤ 2 * p.Cg)] using hDo))) rw [hZeq] have hs' := Real.abs_sin_le_one (t * (eta p m o + treatmentError p m n o)) have hsSq : sin (t * (eta p m o + treatmentError p m n o)) ^ 2 ≤ 1 := by simpa only [sq_abs, one_pow] using ((sq_le_sq₀ (abs_nonneg (sin (t * (eta p m o + treatmentError p m n o)))) zero_le_one).2 hs') nlinarith [sq_nonneg (eta p m o - treatmentError p m n o)] _ = 2 * (∫⁻ o, ofReal ((eta p m o) ^ 2) ∂m.P) + ofReal (8 * p.Cg ^ 2) := by rw [show (fun o ↦ ofReal (2 * (eta p m o) ^ 2 + 8 * p.Cg ^ 2)) = fun o ↦ 2 * ofReal ((eta p m o) ^ 2) + ofReal (8 * p.Cg ^ 2) by funext o rw [ENNReal.ofReal_add (by positivity) (by positivity), ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 2)] norm_num] rw [lintegral_add_left (measurable_const.fun_mul ((heta.pow_const 2).ennreal_ofReal)), lintegral_const_mul'' 2 ((heta.pow_const 2).ennreal_ofReal.aemeasurable)] simp _ ≤ ofReal (8 + 16 * p.Cg ^ 2) := by calc _ ≤ 2 * 4 + ofReal (8 * p.Cg ^ 2) := by gcongr _ = ofReal (8 + 8 * p.Cg ^ 2) := by rw [ENNReal.ofReal_add (by positivity) (by positivity), ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 8)] norm_num _ ≤ ofReal (8 + 16 * p.Cg ^ 2) := by apply ENNReal.ofReal_le_ofReal nlinarith [sq_nonneg p.Cg] _ = _ := by rw [Real.sq_sqrt] positivity have hWpack := memLp_two_and_eLpNorm_le_of_sq_lintegral_le m.P hWmeas (Real.sqrt_nonneg _) hWSq have hxiMeas : Measurable (xi p m) := by unfold xi outcome covariate eta treatment exact measurable_snd.snd.sub (m.q0_measurable.comp measurable_fst) |>.sub (measurable_const.mul (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst))) have hxiExp : ∫ o, exp ((xi p m o) ^ 2 / p.psixi ^ 2) ∂m.P ≤ 2 := by let f := fun o : Obs Xspace ↦ exp ((xi p m o) ^ 2 / p.psixi ^ 2) calc ∫ o, f o ∂m.P = ∫ o, (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P f) o ∂m.P := by symm exact integral_condExp hcov.comap_le _ ≤ ∫ _o, (2 : ℝ) ∂m.P := integral_mono_ae (integrable_condExp) (integrable_const 2) (by exact hxi.2) _ = 2 := by simp have hxiSq : ∫⁻ o, ofReal ((xi p m o) ^ 2) ∂m.P ≤ ofReal (2 * p.psixi ^ 2) := by have hxiSqInt : Integrable (fun o ↦ (xi p m o) ^ 2) m.P := by have hpsi : 0 < p.psixi := p.constants_pos.2.2.2.2.1 apply (hxi.1.const_mul (max 1 (p.psixi ^ 2))).mono' (hxiMeas.pow_const 2).aestronglyMeasurable filter_upwards [] with o rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hexp := Real.add_one_le_exp ((xi p m o) ^ 2 / p.psixi ^ 2) have hpsiSq : 0 < p.psixi ^ 2 := sq_pos_of_pos hpsi have hscaled : (xi p m o) ^ 2 / p.psixi ^ 2 ≤ exp ((xi p m o) ^ 2 / p.psixi ^ 2) := by linarith calc (xi p m o) ^ 2 = p.psixi ^ 2 * ((xi p m o) ^ 2 / p.psixi ^ 2) := by field_simp [hpsi.ne'] _ ≤ p.psixi ^ 2 * exp ((xi p m o) ^ 2 / p.psixi ^ 2) := mul_le_mul_of_nonneg_left hscaled hpsiSq.le _ ≤ exp ((xi p m o) ^ 2 / p.psixi ^ 2) * max 1 (p.psixi ^ 2) := by have he : 0 ≤ exp ((xi p m o) ^ 2 / p.psixi ^ 2) := (Real.exp_pos _).le nlinarith [le_max_right (1 : ℝ) (p.psixi ^ 2)] _ = max 1 (p.psixi ^ 2) * exp ((xi p m o) ^ 2 / p.psixi ^ 2) := by ring rw [← ofReal_integral_eq_lintegral_ofReal] · apply ENNReal.ofReal_le_ofReal have hmom := luxemburg_even_moment_integral_le (xi p m) hxiMeas p.constants_pos.2.2.2.2.1 hxi.1 hxiExp 1 simpa [abs_sq] using hmom · exact hxiSqInt · exact Filter.Eventually.of_forall fun _ ↦ sq_nonneg _ let B : ℝ := p.Cq + 2 * p.Ctheta * p.Cg have htheta0 : 0 ≤ p.Ctheta := p.constants_pos.1.le have hCg0 : 0 ≤ p.Cg := p.constants_pos.2.1.le have hq0 : 0 ≤ p.Cq := p.constants_pos.2.2.1.le have hB : 0 ≤ B := by dsimp [B]; positivity have hg' := MeasureTheory.ae_of_ae_map hcov.aemeasurable hg have hq' := MeasureTheory.ae_of_ae_map hcov.aemeasurable hq have hRSq : ∫⁻ o, ofReal ((R o) ^ 2) ∂m.P ≤ ofReal ((sqrt (4 * B ^ 2 + 4 * p.psixi ^ 2)) ^ 2) := by calc _ ≤ ∫⁻ o, ofReal (2 * B ^ 2 + 2 * (xi p m o) ^ 2) ∂m.P := by apply lintegral_mono_ae filter_upwards [hD, hg', hq'] with o hDo hgo hqo apply ENNReal.ofReal_le_ofReal have hb : |m.q0 (covariate o) - m.theta0 * treatmentError p m n o| ≤ B := by calc _ ≤ |m.q0 (covariate o)| + |m.theta0| * |treatmentError p m n o| := by rw [← abs_mul] exact abs_sub _ _ _ ≤ B := by dsimp [B] have hm : |m.theta0| * |treatmentError p m n o| ≤ p.Ctheta * (2 * p.Cg) := mul_le_mul htheta hDo (abs_nonneg _) htheta0 nlinarith have hbSq : (m.q0 (covariate o) - m.theta0 * treatmentError p m n o) ^ 2 ≤ B ^ 2 := (by simpa only [sq_abs] using ((sq_le_sq₀ (abs_nonneg _) hB).2 hb)) have hdecomp : outcome o - m.theta0 * learnedResidual p m n o = (m.q0 (covariate o) - m.theta0 * treatmentError p m n o) + xi p m o := by simp [xi, learnedResidual, treatmentError, eta, outcome] ring dsimp [R] rw [hdecomp] have hs := Real.abs_sin_le_one (t * learnedResidual p m n o) have hsSq : sin (t * learnedResidual p m n o) ^ 2 ≤ 1 := by simpa [sq_abs] using ((sq_le_sq₀ (abs_nonneg (sin (t * learnedResidual p m n o))) (by norm_num : (0 : ℝ) ≤ |1|)).2 (by simpa using hs)) nlinarith [sq_nonneg ((m.q0 (covariate o) - m.theta0 * treatmentError p m n o) - xi p m o)] _ = ofReal (2 * B ^ 2) + 2 * (∫⁻ o, ofReal ((xi p m o) ^ 2) ∂m.P) := by rw [show (fun o ↦ ofReal (2 * B ^ 2 + 2 * (xi p m o) ^ 2)) = fun o ↦ ofReal (2 * B ^ 2) + 2 * ofReal ((xi p m o) ^ 2) by funext o rw [ENNReal.ofReal_add (by positivity) (by positivity), ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 2)] norm_num] rw [lintegral_add_left measurable_const, lintegral_const_mul'' 2 ((hxiMeas.pow_const 2).ennreal_ofReal.aemeasurable)] simp _ ≤ ofReal (4 * B ^ 2 + 4 * p.psixi ^ 2) := by calc _ ≤ ofReal (2 * B ^ 2) + 2 * ofReal (2 * p.psixi ^ 2) := by gcongr _ = ofReal (2 * B ^ 2 + 4 * p.psixi ^ 2) := by rw [ENNReal.ofReal_add (by positivity) (by positivity), ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 2), ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 4)] norm_num ring _ ≤ ofReal (4 * B ^ 2 + 4 * p.psixi ^ 2) := by apply ENNReal.ofReal_le_ofReal nlinarith [sq_nonneg B] _ = _ := by rw [Real.sq_sqrt]; positivity have hRpack := memLp_two_and_eLpNorm_le_of_sq_lintegral_le m.P hRmeas (Real.sqrt_nonneg _) hRSq have hWreal : (eLpNorm W 2 m.P).toReal ≤ sqrt (8 + 16 * p.Cg ^ 2) := by rw [← ENNReal.toReal_ofReal (Real.sqrt_nonneg _)] exact (ENNReal.toReal_le_toReal hWpack.1.eLpNorm_ne_top (by simp)).2 hWpack.2 have hRreal : (eLpNorm R 2 m.P).toReal ≤ sqrt (4 * B ^ 2 + 4 * p.psixi ^ 2) := by rw [← ENNReal.toReal_ofReal (Real.sqrt_nonneg _)] exact (ENNReal.toReal_le_toReal hRpack.1.eLpNorm_ne_top (by simp)).2 hRpack.2 have hWnorm := (sq_le_sq₀ ENNReal.toReal_nonneg (Real.sqrt_nonneg _)).2 hWreal have hRnorm := (sq_le_sq₀ ENNReal.toReal_nonneg (Real.sqrt_nonneg _)).2 hRreal rw [Real.sq_sqrt (by positivity : 0 ≤ 8 + 16 * p.Cg ^ 2)] at hWnorm rw [Real.sq_sqrt (by positivity : 0 ≤ 4 * B ^ 2 + 4 * p.psixi ^ 2)] at hRnorm simpa only [W, R, B] using ⟨hWmeas, hRmeas, hWpack.1, hRpack.1, hWnorm, hRnorm⟩
CausalSmith.Stat.SaPlmCumulantConverse.sine_score_memLp_of_eta_second_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:252
theorem thetaHatAt_eq_clippedRatioFromScores

The sine-score estimator at a given frequency and denominator threshold is exactly the generic clipped ratio rule applied to two sample averages: the average of the learned treatment residual times the sine of the frequency times that residual as denominator, and the average of the residualized outcome times the same sine as numerator correction, which is what lets the generic risk bound for clipped ratios be applied to it.

Formal statement
m :
Model (Xspace := Xspace) p
n :
t threshold :
data :
Fin n → Obs Xspace
thetaHatAt p m n t threshold data
= clippedRatioFromScores p.Ctheta m.theta0 n threshold (fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o)) (fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o)) data
Proof (Lean source)
-- @node: thetaHatAt_eq_clippedRatioFromScores lemma thetaHatAt_eq_clippedRatioFromScores (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t threshold : ℝ) (data : Fin n → Obs Xspace) : thetaHatAt p m n t threshold data = clippedRatioFromScores p.Ctheta m.theta0 n threshold (fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o)) (fun o ↦ (outcome o - m.theta0 * learnedResidual p m n o) * sin (t * learnedResidual p m n o)) data := by unfold thetaHatAt clippedRatioFromScores empiricalMean dsimp only have hnum : (n : ℝ)⁻¹ * ∑ i, outcome (data i) * sin (t * learnedResidual p m n (data i)) = m.theta0 * ((n : ℝ)⁻¹ * ∑ i, learnedResidual p m n (data i) * sin (t * learnedResidual p m n (data i))) + (n : ℝ)⁻¹ * ∑ i, (outcome (data i) - m.theta0 * learnedResidual p m n (data i)) * sin (t * learnedResidual p m n (data i)) := by calc _ = (n : ℝ)⁻¹ * ∑ i, (m.theta0 * learnedResidual p m n (data i) * sin (t * learnedResidual p m n (data i)) + (outcome (data i) - m.theta0 * learnedResidual p m n (data i)) * sin (t * learnedResidual p m n (data i))) := by apply congrArg ((n : ℝ)⁻¹ * ·) apply Finset.sum_congr rfl intro i _hi ring _ = (n : ℝ)⁻¹ * ((∑ i, m.theta0 * (learnedResidual p m n (data i) * sin (t * learnedResidual p m n (data i)))) + ∑ i, (outcome (data i) - m.theta0 * learnedResidual p m n (data i)) * sin (t * learnedResidual p m n (data i))) := by rw [Finset.sum_add_distrib] congr 2 apply Finset.sum_congr rfl intro i _hi ring _ = _ := by rw [← Finset.mul_sum] ring rw [hnum]
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatAt_eq_clippedRatioFromScores · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:491

The complete path conclusion shared by the benchmark lemma and the local-to-Gaussian partial theorem.

Definition (Lean source)
def GaussianRademacherPathConclusion (p : Parameters) (m : Model (Xspace := Xspace) p) (a C : ℝ) : Prop := let t := pi / (2 * a) let A := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) let deltaA := 2 * a ^ 4 treatmentMGF p m = (fun z ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) ∧ kappaEta p m = -2 * a ^ 4 ∧ 0 < t ∧ treatmentMGF p m (I * t) = 0 ∧ (∀ u ∈ Ioo (0 : ℝ) t, treatmentMGF p m (I * u) ≠ 0) ∧ (∀ d : ℝ, ∫ o, sin (t * (eta p m o + d)) ∂m.P = 0) ∧ (t * p.eps1n p.n ≤ 1 / 2 → (∫ o, learnedResidual p m p.n o * sin (t * learnedResidual p m p.n o) ∂m.P = A * ∫ o, cos (t * treatmentError p m p.n o) ∂m.P) ∧ A / 2 ≤ ∫ o, learnedResidual p m p.n o * sin (t * learnedResidual p m p.n o) ∂m.P ∧ mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (C * min 1 ((p.n : ℝ)⁻¹ * (a ^ 2)⁻¹ * exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)))) ∧ p.eps1n p.n ≤ deltaA ^ (1 / 4 : ℝ) / (2 ^ (1 / 4 : ℝ) * pi) ∧ mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (C * min 1 ((p.n : ℝ)⁻¹ * deltaA ^ (-1 / 2 : ℝ) * exp (pi ^ 2 * sqrt 2 / 4 * deltaA ^ (-1 / 2 : ℝ)))))
CausalSmith.Stat.SaPlmCumulantConverse.GaussianRademacherPathConclusion · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:541
theorem gaussian_rademacher_l1_benchmark Lemma 7 in the paper ↗

Path-specific MGF, cumulant, annihilation, denominator, and risk benchmark.

Formal statement
Ctheta Cg Cq psixi :
∃ C : ℝ,
0 < C ∧
∀ (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → p.k = 4 → ∀ (a : ℝ), a ∈ Ioc (0 : ℝ) 1 → ∀ (m : Model (Xspace := Xspace) p), m.P.map (eta p m) = gaussianRademacherLaw a → IidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → GaussianRademacherPathConclusion p m a C
Proof (Lean source)
-- @node: lem:gaussian-rademacher-l1-benchmark lemma gaussian_rademacher_l1_benchmark (Ctheta Cg Cq psixi : ℝ) : ∃ C : ℝ, 0 < C ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → p.k = 4 → ∀ (a : ℝ), a ∈ Ioc (0 : ℝ) 1 → ∀ (m : Model (Xspace := Xspace) p), m.P.map (eta p m) = gaussianRademacherLaw a → IidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → GaussianRademacherPathConclusion p m a C := by let K : ℝ := 4 * (Cq + 2 * Ctheta * Cg) ^ 2 + 4 * psixi ^ 2 + Ctheta ^ 2 * (8 + 16 * Cg ^ 2) let C : ℝ := 1 + 64 * K + 4 * Ctheta ^ 2 have hK : 0 ≤ K := by dsimp [K]; positivity have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro p hpTheta hpG hpQ hpXi hk a ha m hlaw _hiid hind hout htheta hg hq hxi hL1 have ha0 : 0 < a := ha.1 have ha1 : a ≤ 1 := ha.2 let t : ℝ := pi / (2 * a) let A : ℝ := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) let W : Obs Xspace → ℝ := fun o ↦ learnedResidual p m p.n o * sin (t * learnedResidual p m p.n o) let R : Obs Xspace → ℝ := fun o ↦ (outcome o - m.theta0 * learnedResidual p m p.n o) * sin (t * learnedResidual p m p.n o) have ht : 0 < t := div_pos Real.pi_pos (mul_pos zero_lt_two ha0) have hA : 0 < A := mul_pos ha0 (Real.exp_pos _) have hmgf := treatmentMGF_eq_gaussianRademacher p m ha0 ha1 hlaw have hkappa := model_gaussianRademacher_kappa_four p m hk ha0 ha1 hlaw have hzero := gaussianRademacher_first_characteristic_zero ha0 have hshift : ∀ d : ℝ, ∫ o, sin (t * (eta p m o + d)) ∂m.P = 0 := by intro d exact integral_sin_shift_eq_zero p m t d (by rw [hmgf] exact hzero.1) dsimp [GaussianRademacherPathConclusion] refine ⟨hmgf, hkappa, ht, ?_, ?_, hshift, ?_⟩ · rw [hmgf] exact hzero.1 · intro u hu rw [hmgf] exact hzero.2 u hu · intro hsmall have hetaInt : Integrable (eta p m) m.P := by have hp := eta_integrable_exp_gaussianRademacher p m hlaw 1 have hn := eta_integrable_exp_gaussianRademacher p m hlaw (-1) apply (hp.add hn).mono' (by unfold eta treatment covariate exact (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst)).aestronglyMeasurable) filter_upwards [] with o simp only [Pi.add_apply, one_mul, neg_mul, Real.norm_eq_abs] by_cases ho : 0 ≤ eta p m o · rw [abs_of_nonneg ho] linarith [Real.add_one_le_exp (eta p m o), Real.exp_pos (-eta p m o)] · rw [abs_of_neg (lt_of_not_ge ho)] linarith [Real.add_one_le_exp (-eta p m o), Real.exp_pos (eta p m o)] have hmoment : ∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P = I * A := by exact eta_cexp_moment_at_first_zero p m ha0 ha1 hlaw have hdenId := learnedResidual_sine_denominator_identity p m p.n t A (by rw [hmgf]; exact hzero.1) hmoment hetaInt hind hg have hdenLower := learnedResidual_sine_denominator_lower p m p.n t A ht hA hdenId hL1 (by simpa only [t] using hsmall) have hremMean : ∫ o, R o ∂m.P = 0 := by simpa only [R] using sine_remainder_centered_of_mgf_zero p m p.n t (by rw [hmgf]; exact hzero.1) hind hout htheta hg hq have hetaSq : ∫⁻ o, ofReal ((eta p m o) ^ 2) ∂m.P ≤ 4 := by have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) calc _ = ∫⁻ x : ℝ, ofReal (x ^ 2) ∂(m.P.map (eta p m)) := by rw [lintegral_map (by fun_prop) heta] _ = ∫⁻ x : ℝ, ofReal (x ^ 2) ∂gaussianRademacherLaw a := by rw [hlaw] _ ≤ 4 := gaussianRademacher_second_lintegral_le ha0 ha1 have hscore := sine_score_memLp_of_eta_second_lintegral_le p m p.n t hetaSq htheta hg hq hxi have hWmean : ∫ o, W o ∂m.P = ∫ o, learnedResidual p m p.n o * sin (t * learnedResidual p m p.n o) ∂m.P := rfl have hriskRaw := clippedRatioFromScores_lintegral_le m.P p.Ctheta m.theta0 A p.n W R (∫ o, W o ∂m.P) (by exact p.n_pos) htheta hA (by simpa only [W, t] using hdenLower) hscore.1 hscore.2.1 hscore.2.2.1 hscore.2.2.2.1 rfl hremMean have hrisk : mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2)) := by unfold mseRisk iidLaw simpa only [thetaHatAt_eq_clippedRatioFromScores p m p.n t (A / 4)] using hriskRaw have hriskFirst : mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (C * min 1 ((p.n : ℝ)⁻¹ * (a ^ 2)⁻¹ * exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)))) := by let x : ℝ := (p.n : ℝ)⁻¹ * (a ^ 2)⁻¹ * exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) have hscoreBound : ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2) ≤ ofReal K := by calc _ ≤ ofReal (4 * (p.Cq + 2 * p.Ctheta * p.Cg) ^ 2 + 4 * p.psixi ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal (8 + 16 * p.Cg ^ 2) := by gcongr · exact hscore.2.2.2.2.2 · exact hscore.2.2.2.2.1 _ = ofReal K := by rw [← ENNReal.ofReal_mul (sq_nonneg p.Ctheta), ← ENNReal.ofReal_add (by positivity) (by positivity)] congr 1 dsimp [K] rw [hpTheta, hpG, hpQ, hpXi] have hlocal : mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (16 * K * x) := by calc _ ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2)) := hrisk _ ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * ofReal K := by gcongr _ = ofReal (16 * K * x) := by rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_inv_of_pos (by exact_mod_cast p.n_pos : (0 : ℝ) < p.n)] rw [← ENNReal.ofReal_mul (by positivity : 0 ≤ 16 / A ^ 2), ← ENNReal.ofReal_mul (by positivity)] congr 1 dsimp [x, A] let q : ℝ := (1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2) have hneg : exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) = (exp q)⁻¹ := by rw [show -(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2) = -q by dsimp [q]; ring, Real.exp_neg] have htwo : exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) = (exp q) ^ 2 := by rw [← Real.exp_nat_mul] congr 1 dsimp [q] field_simp [ha0.ne'] ring rw [hneg, htwo] field_simp [ha0.ne', Real.exp_ne_zero q] have hglobal : mseRisk m p.n (thetaHatAt p m p.n t (A / 4)) ≤ ofReal (4 * p.Ctheta ^ 2) := by unfold mseRisk iidLaw rw [show thetaHatAt p m p.n t (A / 4) = clippedRatioFromScores p.Ctheta m.theta0 p.n (A / 4) W R by funext data exact thetaHatAt_eq_clippedRatioFromScores p m p.n t (A / 4) data] calc _ ≤ ∫⁻ _data : Fin p.n → Obs Xspace, ofReal (4 * p.Ctheta ^ 2) ∂Measure.pi (fun _ : Fin p.n ↦ m.P) := by apply lintegral_mono intro data exact ENNReal.ofReal_le_ofReal (clippedRatioFromScores_sq_le_global p.Ctheta m.theta0 A p.n W R (∫ o, W o ∂m.P) htheta data) _ = _ := by simp have hx : 0 ≤ x := by dsimp [x]; positivity by_cases hx1 : x ≤ 1 · rw [min_eq_right hx1] exact hlocal.trans (ENNReal.ofReal_le_ofReal (by have hKC : 16 * K ≤ C := by dsimp [C]; nlinarith exact mul_le_mul_of_nonneg_right hKC hx)) · rw [min_eq_left (le_of_not_ge hx1)] exact hglobal.trans (ENNReal.ofReal_le_ofReal (by dsimp [C] rw [hpTheta] nlinarith)) refine ⟨?_, ?_, hriskFirst, ?_, ?_⟩ · simpa only [t, A] using hdenId · simpa only [t, A] using hdenLower · have heps : p.eps1n p.n ≤ a / pi := by have hpos : 0 < pi / (2 * a) := ht have hsmall' : p.eps1n p.n * (pi / (2 * a)) ≤ 1 / 2 := by simpa [mul_comm] using hsmall have := (le_div_iff₀ hpos).2 hsmall' field_simp [ha0.ne', Real.pi_ne_zero] at this ⊢ nlinarith [Real.pi_pos] have hroot : (2 * a ^ 4) ^ (1 / 4 : ℝ) = 2 ^ (1 / 4 : ℝ) * a := by rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≤ 2) (by positivity : 0 ≤ a ^ 4)] congr 1 convert Real.pow_rpow_inv_natCast ha0.le (by norm_num : (4 : ℕ) ≠ 0) using 1 norm_num rw [hroot] have htwoRoot : 0 < (2 : ℝ) ^ (1 / 4 : ℝ) := Real.rpow_pos_of_pos (by norm_num) _ field_simp [htwoRoot.ne', Real.pi_ne_zero] field_simp [Real.pi_ne_zero] at heps exact heps · let y : ℝ := (p.n : ℝ)⁻¹ * (2 * a ^ 4) ^ (-1 / 2 : ℝ) * exp (pi ^ 2 * sqrt 2 / 4 * (2 * a ^ 4) ^ (-1 / 2 : ℝ)) have hsqrt2 : sqrt 2 ^ 2 = 2 := by norm_num have hdeltaHalf : (2 * a ^ 4) ^ (-1 / 2 : ℝ) = (sqrt 2 * a ^ 2)⁻¹ := by rw [show (-1 / 2 : ℝ) = -(1 / 2 : ℝ) by norm_num, Real.rpow_neg (by positivity) (1 / 2 : ℝ)] congr 1 rw [Real.mul_rpow (by norm_num : (0 : ℝ) ≤ 2) (by positivity : 0 ≤ a ^ 4)] have htwoHalf : (2 : ℝ) ^ (1 / 2 : ℝ) = sqrt 2 := by exact (Real.sqrt_eq_rpow 2).symm have haHalf : (a ^ 4) ^ (1 / 2 : ℝ) = a ^ 2 := by rw [show a ^ 4 = (a ^ 2) ^ 2 by ring] convert Real.pow_rpow_inv_natCast (sq_nonneg a) (by norm_num : (2 : ℕ) ≠ 0) using 1 norm_num rw [htwoHalf, haHalf] have hxy : (p.n : ℝ)⁻¹ * (a ^ 2)⁻¹ * exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) ≤ y := by dsimp [y] rw [hdeltaHalf] have hsqrtPos : 0 < sqrt 2 := Real.sqrt_pos.2 (by norm_num) have haSq : 0 < a ^ 2 := sq_pos_of_pos ha0 have hpi : 4 ≤ pi ^ 2 := by nlinarith [Real.two_le_pi, Real.pi_pos] have hexp : sqrt 2 ≤ exp (pi ^ 2 / 4) := by have hsqrtLe : sqrt 2 ≤ 2 := by nlinarith [hsqrt2, Real.sqrt_nonneg 2] exact hsqrtLe.trans (by have := Real.add_one_le_exp (pi ^ 2 / 4) nlinarith) have hn0 : 0 ≤ (p.n : ℝ)⁻¹ := by positivity have hfactor : (a ^ 2)⁻¹ * exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) ≤ (sqrt 2 * a ^ 2)⁻¹ * exp (pi ^ 2 * sqrt 2 / 4 * (sqrt 2 * a ^ 2)⁻¹) := by have hexpEq : exp (pi ^ 2 * sqrt 2 / 4 * (sqrt 2 * a ^ 2)⁻¹) = exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) * exp (pi ^ 2 / 4) := by rw [← Real.exp_add] congr 1 field_simp [hsqrtPos.ne', ha0.ne'] nlinarith [hsqrt2] rw [hexpEq] have he0 : 0 < exp ((1 - a ^ 2) * pi ^ 2 / (4 * a ^ 2)) := -- … truncated; follow the source link for the rest …
CausalSmith.Stat.SaPlmCumulantConverse.gaussian_rademacher_l1_benchmark · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/GaussianRademacherBenchmark.lean:570
Helpers.HardSubmodel 4 declarations Non-Gaussian hard submodel

Non-Gaussian hard submodel

Symmetric clipping used only to reduce arbitrary estimators to bounded ones in the two-point lower bound.

Definition (Lean source)
-- @node: hardSubmodelClip def hardSubmodelClip (R x : ℝ) : ℝ := min (max x (-R)) R
CausalSmith.Stat.SaPlmCumulantConverse.hardSubmodelClip · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/HardSubmodel.lean:22
theorem hardSubmodelClip_sq_sub_le

For a nonnegative clipping level and a target whose absolute value does not exceed it, clipping any real number symmetrically to that level never increases its squared distance to the target. Restricting attention to estimators bounded by the clipping level therefore costs nothing in the two-point lower bound.

Formal statement
R x t :
hR :
0 ≤ R
ht :
|t| ≤ R
(hardSubmodelClip R x - t) ^ 2 ≤ (x - t) ^ 2
Proof (Lean source)
-- @node: hardSubmodelClip_sq_sub_le lemma hardSubmodelClip_sq_sub_le (R x t : ℝ) (hR : 0 ≤ R) (ht : |t| ≤ R) : (hardSubmodelClip R x - t) ^ 2 ≤ (x - t) ^ 2 := by rw [abs_le] at ht unfold hardSubmodelClip by_cases hxlo : x < -R · rw [max_eq_right hxlo.le, min_eq_left (neg_le_self hR)] nlinarith · have hxlo' : -R ≤ x := le_of_not_gt hxlo by_cases hxhi : R < x · rw [max_eq_left hxlo', min_eq_right hxhi.le] nlinarith · rw [max_eq_left hxlo', min_eq_left (le_of_not_gt hxhi)]
CausalSmith.Stat.SaPlmCumulantConverse.hardSubmodelClip_sq_sub_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/HardSubmodel.lean:27
theorem minimaxRiskOn_two_point_lower

A pair of class members with finite KL budget gives an ENNReal lower bound for the local class-indexed minimax risk.

Formal statement
n :
laws :
Set (Model (Xspace := Xspace) p)
m0 m1 :
Model (Xspace := Xspace) p
hm0 :
m0 ∈ laws
hm1 :
m1 ∈ laws
R cK :
hR :
0 ≤ R
ht0 :
|m0.theta0| ≤ R
ht1 :
|m1.theta0| ≤ R
hbody :
∀ T : (Fin n → Obs Xspace) → ℝ
and
Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 n)
and
Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 n)
then
cK * (m1.theta0 - m0.theta0) ^ 2
max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n)
ofReal (cK * (m1.theta0 - m0.theta0) ^ 2) ≤ minimaxRiskOn p n laws
Proof (Lean source)
-- @node: minimaxRiskOn_two_point_lower lemma minimaxRiskOn_two_point_lower (p : Parameters) (n : ℕ) (laws : Set (Model (Xspace := Xspace) p)) (m0 m1 : Model (Xspace := Xspace) p) (hm0 : m0 ∈ laws) (hm1 : m1 ∈ laws) (R cK : ℝ) (hR : 0 ≤ R) (ht0 : |m0.theta0| ≤ R) (ht1 : |m1.theta0| ≤ R) (hbody : ∀ T : (Fin n → Obs Xspace) → ℝ, Measurable T → Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 n) → Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 n) → cK * (m1.theta0 - m0.theta0) ^ 2 ≤ max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n)) : ofReal (cK * (m1.theta0 - m0.theta0) ^ 2) ≤ minimaxRiskOn p n laws := by rw [minimaxRiskOn] refine le_iInf fun est ↦ ?_ let T : (Fin n → Obs Xspace) → ℝ := fun s ↦ hardSubmodelClip R (est.1 s) have hT : Measurable T := by exact (est.2.max measurable_const).min measurable_const have hTbd : ∀ s, T s ∈ Icc (-R) R := by intro s dsimp [T, hardSubmodelClip] exact ⟨le_min (le_max_right _ _) (neg_le_self hR), min_le_right _ _⟩ letI : IsProbabilityMeasure (iidLaw m0 n) := by unfold iidLaw infer_instance letI : IsProbabilityMeasure (iidLaw m1 n) := by unfold iidLaw infer_instance have hInt0 : Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 n) := Causalean.Stat.mse_integrable_of_estimator_bound _ T hT hR hTbd have hInt1 : Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 n) := Causalean.Stat.mse_integrable_of_estimator_bound _ T hT hR hTbd have hlc := hbody T hT hInt0 hInt1 have hrisk0 : ofReal (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n) ≤ mseRisk m0 n est.1 := by rw [ofReal_integral_eq_lintegral_ofReal hInt0 (Filter.Eventually.of_forall fun _ ↦ sq_nonneg _)] apply lintegral_mono intro s exact ENNReal.ofReal_le_ofReal (hardSubmodelClip_sq_sub_le R _ _ hR ht0) have hrisk1 : ofReal (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n) ≤ mseRisk m1 n est.1 := by rw [ofReal_integral_eq_lintegral_ofReal hInt1 (Filter.Eventually.of_forall fun _ ↦ sq_nonneg _)] apply lintegral_mono intro s exact ENNReal.ofReal_le_ofReal (hardSubmodelClip_sq_sub_le R _ _ hR ht1) have hpair : ofReal (cK * (m1.theta0 - m0.theta0) ^ 2) ≤ max (mseRisk m0 n est.1) (mseRisk m1 n est.1) := by calc ofReal (cK * (m1.theta0 - m0.theta0) ^ 2) ≤ ofReal (max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n)) := ENNReal.ofReal_le_ofReal hlc _ = max (ofReal (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n)) (ofReal (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n)) := ENNReal.ofReal_max _ _ _ ≤ max (mseRisk m0 n est.1) (mseRisk m1 n est.1) := max_le_max hrisk0 hrisk1 refine hpair.trans (max_le ?_ ?_) · exact (le_iSup (fun _ : m0 ∈ laws ↦ mseRisk m0 n est.1) hm0).trans (le_iSup (fun m : Model (Xspace := Xspace) p ↦ ⨆ (_ : m ∈ laws), mseRisk m n est.1) m0) · exact (le_iSup (fun _ : m1 ∈ laws ↦ mseRisk m1 n est.1) hm1).trans (le_iSup (fun m : Model (Xspace := Xspace) p ↦ ⨆ (_ : m ∈ laws), mseRisk m n est.1) m1)
CausalSmith.Stat.SaPlmCumulantConverse.minimaxRiskOn_two_point_lower · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/HardSubmodel.lean:45
theorem non_gaussian_hard_submodel Lemma 12 in the paper ↗

Both the broad spectral class and the full published ACE class contain ACE-preserving fixed-innovation paths with quadratic local KL divergence; the second path yields the full-class c / n minimax converse.

Formal statement
r :
delta Ctheta Cg Cq psieta psixi :
hpsixi :
0 < psixi
∃ c0 C0 tau cACE : ℝ,
0 < c0 ∧
0 < C0 ∧
0 < tau ∧
tau ≤ psixi ∧
0 < cACE ∧
∀ (p : Parameters),
p.r
= r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ n : ℕ, 1 ≤ n → ((∃ base : Model (Xspace := Xspace) p, NonGaussianClass p n base) → ∃ (base : Model (Xspace := Xspace) p) (family : ℝ → Model (Xspace := Xspace) p), NonGaussianClass p n base ∧ (∀ theta, |theta| ≤ c0 → NonGaussianClass p n (family theta)) ∧ (∀ theta, |theta| ≤ c0 → (family theta).theta0 = theta) ∧ (∀ theta, |theta| ≤ c0 → (family theta).P.map (fun o ↦ (covariate o, treatment o)) = base.P.map (fun o ↦ (covariate o, treatment o))) ∧ (∀ theta, |theta| ≤ c0 → (family theta).g0 = base.g0 ∧ (family theta).q0 = base.q0 ∧ (∀ x, barG p (family theta) n x = barG p base n x) ∧ (∀ x, barQ p (family theta) n x = barQ p base n x)) ∧ (∀ theta, |theta| ≤ c0 → (family theta).P.map (xi p (family theta)) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ ∧ IndepFun (xi p (family theta)) (fun o ↦ (covariate o, treatment o)) (family theta).P) ∧ (∀ theta, |theta| ≤ c0 → ∀ᵐ o ∂(family theta).P, outcome o = base.q0 (covariate o) + theta * eta p (family theta) o + xi p (family theta) o) ∧ (∀ (theta0 theta1 h : ℝ), |theta0| ≤ c0 → |theta1| ≤ c0 → |theta1 - theta0| = h / sqrt n → klDiv (iidLaw (family theta0) n) (iidLaw (family theta1) n) ≤ ofReal (C0 * h ^ 2)) ) ∧ (∀ aceBase : Model (Xspace := Xspace) p, JmsAceClass p n aceBase → ∃ aceFamily : ℝ → Model (Xspace := Xspace) p, (∀ theta, |theta| ≤ c0 → JmsAceClass p n (aceFamily theta)) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).theta0 = theta) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).P.map (fun o ↦ (covariate o, treatment o)) = aceBase.P.map (fun o ↦ (covariate o, treatment o))) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).g0 = aceBase.g0 ∧ (aceFamily theta).q0 = aceBase.q0 ∧ (∀ x, barG p (aceFamily theta) n x = barG p aceBase n x) ∧ (∀ x, barQ p (aceFamily theta) n x = barQ p aceBase n x) ∧ eta p (aceFamily theta) = eta p aceBase ∧ TreatmentCodeRadiusLrAt p (aceFamily theta) n ∧ OutcomeCodeRadiusLrAt p (aceFamily theta) n) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).P.map (xi p (aceFamily theta)) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ ∧ IndepFun (xi p (aceFamily theta)) (fun o ↦ (covariate o, treatment o)) (aceFamily theta).P) ∧ (∀ theta, |theta| ≤ c0 → ∀ᵐ o ∂(aceFamily theta).P, outcome o = aceBase.q0 (covariate o) + theta * eta p (aceFamily theta) o + xi p (aceFamily theta) o) ∧ ∀ (theta0 theta1 h : ℝ), |theta0| ≤ c0 → |theta1| ≤ c0 → |theta1 - theta0| = h / sqrt n → klDiv (iidLaw (aceFamily theta0) n) (iidLaw (aceFamily theta1) n) ≤ ofReal (C0 * h ^ 2)) ∧ (∀ gbar qbar : Xspace → ℝ, (∃ aceBase : Model (Xspace := Xspace) p, JmsAceClass p n aceBase ∧ barG p aceBase n = gbar ∧ barQ p aceBase n = qbar) → ofReal (cACE / n) ≤ minimaxRiskOn p n {m : Model (Xspace := Xspace) p | JmsAceClass p n m ∧ barG p m n = gbar ∧ barQ p m n = qbar})
Proof (Lean source)
-- @node: lem:non-gaussian-hard-submodel lemma non_gaussian_hard_submodel (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ) (hpsixi : 0 < psixi) : ∃ c0 C0 tau cACE : ℝ, 0 < c0 ∧ 0 < C0 ∧ 0 < tau ∧ tau ≤ psixi ∧ 0 < cACE ∧ ∀ (p : Parameters), p.r = r → p.delta = delta → p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psieta = psieta → p.psixi = psixi → ∀ n : ℕ, 1 ≤ n → ((∃ base : Model (Xspace := Xspace) p, NonGaussianClass p n base) → ∃ (base : Model (Xspace := Xspace) p) (family : ℝ → Model (Xspace := Xspace) p), NonGaussianClass p n base ∧ (∀ theta, |theta| ≤ c0 → NonGaussianClass p n (family theta)) ∧ (∀ theta, |theta| ≤ c0 → (family theta).theta0 = theta) ∧ (∀ theta, |theta| ≤ c0 → (family theta).P.map (fun o ↦ (covariate o, treatment o)) = base.P.map (fun o ↦ (covariate o, treatment o))) ∧ (∀ theta, |theta| ≤ c0 → (family theta).g0 = base.g0 ∧ (family theta).q0 = base.q0 ∧ (∀ x, barG p (family theta) n x = barG p base n x) ∧ (∀ x, barQ p (family theta) n x = barQ p base n x)) ∧ (∀ theta, |theta| ≤ c0 → (family theta).P.map (xi p (family theta)) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ ∧ IndepFun (xi p (family theta)) (fun o ↦ (covariate o, treatment o)) (family theta).P) ∧ (∀ theta, |theta| ≤ c0 → ∀ᵐ o ∂(family theta).P, outcome o = base.q0 (covariate o) + theta * eta p (family theta) o + xi p (family theta) o) ∧ (∀ (theta0 theta1 h : ℝ), |theta0| ≤ c0 → |theta1| ≤ c0 → |theta1 - theta0| = h / sqrt n → klDiv (iidLaw (family theta0) n) (iidLaw (family theta1) n) ≤ ofReal (C0 * h ^ 2)) ) ∧ (∀ aceBase : Model (Xspace := Xspace) p, JmsAceClass p n aceBase → ∃ aceFamily : ℝ → Model (Xspace := Xspace) p, (∀ theta, |theta| ≤ c0 → JmsAceClass p n (aceFamily theta)) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).theta0 = theta) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).P.map (fun o ↦ (covariate o, treatment o)) = aceBase.P.map (fun o ↦ (covariate o, treatment o))) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).g0 = aceBase.g0 ∧ (aceFamily theta).q0 = aceBase.q0 ∧ (∀ x, barG p (aceFamily theta) n x = barG p aceBase n x) ∧ (∀ x, barQ p (aceFamily theta) n x = barQ p aceBase n x) ∧ eta p (aceFamily theta) = eta p aceBase ∧ TreatmentCodeRadiusLrAt p (aceFamily theta) n ∧ OutcomeCodeRadiusLrAt p (aceFamily theta) n) ∧ (∀ theta, |theta| ≤ c0 → (aceFamily theta).P.map (xi p (aceFamily theta)) = gaussianReal 0 ⟨tau ^ 2, sq_nonneg tau⟩ ∧ IndepFun (xi p (aceFamily theta)) (fun o ↦ (covariate o, treatment o)) (aceFamily theta).P) ∧ (∀ theta, |theta| ≤ c0 → ∀ᵐ o ∂(aceFamily theta).P, outcome o = aceBase.q0 (covariate o) + theta * eta p (aceFamily theta) o + xi p (aceFamily theta) o) ∧ ∀ (theta0 theta1 h : ℝ), |theta0| ≤ c0 → |theta1| ≤ c0 → |theta1 - theta0| = h / sqrt n → klDiv (iidLaw (aceFamily theta0) n) (iidLaw (aceFamily theta1) n) ≤ ofReal (C0 * h ^ 2)) ∧ (∀ gbar qbar : Xspace → ℝ, (∃ aceBase : Model (Xspace := Xspace) p, JmsAceClass p n aceBase ∧ barG p aceBase n = gbar ∧ barQ p aceBase n = qbar) → ofReal (cACE / n) ≤ minimaxRiskOn p n {m : Model (Xspace := Xspace) p | JmsAceClass p n m ∧ barG p m n = gbar ∧ barQ p m n = qbar}) := by let c0 : ℝ := if 0 < Ctheta then min Ctheta 1 else 1 let C0 : ℝ := max 1 (16 * psieta ^ 2 / psixi ^ 2) let tau : ℝ := psixi / 4 let K : ℝ := C0 * c0 ^ 2 obtain ⟨cK, hcK, hlecam⟩ := le_cam_two_point_mse K refine ⟨c0, C0, tau, cK * c0 ^ 2, ?_, ?_, ?_, ?_, ?_, ?_⟩ · dsimp [c0] split_ifs with h · exact lt_min h zero_lt_one · norm_num · dsimp [C0] exact lt_of_lt_of_le zero_lt_one (le_max_left _ _) · dsimp [tau] linarith · dsimp [tau] linarith · apply mul_pos hcK apply sq_pos_of_pos dsimp [c0] split_ifs with h · exact lt_min h zero_lt_one · norm_num intro p hr hdelta hCtheta hCg hCq hpsieta hp subst r; subst delta; subst Ctheta; subst Cg; subst Cq; subst psieta; subst psixi intro n hn have hc0_le : c0 ≤ p.Ctheta := by simp only [c0, if_pos p.constants_pos.1] exact min_le_left _ _ have hc0_pos : 0 < c0 := by simp only [c0, if_pos p.constants_pos.1] exact lt_min p.constants_pos.1 zero_lt_one have htau_pos : 0 < tau := by dsimp [tau]; linarith [p.constants_pos.2.2.2.2.1] have hC0_coeff : 16 * p.psieta ^ 2 / p.psixi ^ 2 ≤ C0 := by exact le_max_right _ _ have hKLpath : ∀ (base : Model (Xspace := Xspace) p), EtaSubGaussian p base → ∀ theta0 theta1 h : ℝ, |theta0| ≤ c0 → |theta1| ≤ c0 → |theta1 - theta0| = h / sqrt n → klDiv (iidLaw (affineGaussianModel base theta0 tau) n) (iidLaw (affineGaussianModel base theta1 tau) n) ≤ ofReal (C0 * h ^ 2) := by intro base heta theta0 theta1 h ht0 ht1 hsep refine (affineGaussianModel_iid_kl_le base n heta theta0 theta1 tau htau_pos).trans ?_ apply ENNReal.ofReal_le_ofReal have hnreal : 0 < (n : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn) have hsqrt : (sqrt n) ^ 2 = (n : ℝ) := Real.sq_sqrt hnreal.le have hsep_sq : (theta1 - theta0) ^ 2 = h ^ 2 / (n : ℝ) := by rw [← sq_abs (theta1 - theta0), hsep, div_pow, hsqrt] dsimp [tau] rw [hsep_sq] have hpsi : 0 < p.psixi := p.constants_pos.2.2.2.2.1 have hcoeff0 : 0 ≤ 16 * p.psieta ^ 2 / p.psixi ^ 2 := by positivity calc (n : ℝ) * ((h ^ 2 / (n : ℝ) * (2 * p.psieta ^ 2)) / (2 * (p.psixi / 4) ^ 2)) = (16 * p.psieta ^ 2 / p.psixi ^ 2) * h ^ 2 := by field_simp [ne_of_gt hnreal, ne_of_gt hpsi] ring _ ≤ C0 * h ^ 2 := mul_le_mul_of_nonneg_right hC0_coeff (sq_nonneg _) constructor · rintro ⟨base, hbase⟩ refine ⟨base, fun theta ↦ affineGaussianModel base theta tau, hbase, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro theta htheta exact affineGaussianModel_nonGaussianClass_quarter base n hbase theta (htheta.trans hc0_le) · intro theta _ rfl · intro theta _ exact affineGaussianModel_map_xt base theta tau · intro theta _ exact ⟨rfl, rfl, fun _ ↦ rfl, fun _ ↦ rfl⟩ · intro theta _ exact ⟨affineGaussianModel_map_xi base theta tau, affineGaussianModel_indep_xi_xt base theta tau⟩ · intro theta _ filter_upwards with o simp only [xi, affineGaussianModel_theta0, affineGaussianModel_q0] ring · exact hKLpath base hbase.etaSubGaussian constructor · intro aceBase hace refine ⟨fun theta ↦ affineGaussianModel aceBase theta tau, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ · intro theta htheta exact affineGaussianModel_jmsAceClass_quarter aceBase n hace theta (htheta.trans hc0_le) · intro theta _; rfl · intro theta _; exact affineGaussianModel_map_xt aceBase theta tau · intro theta _ exact ⟨rfl, rfl, fun _ ↦ rfl, fun _ ↦ rfl, affineGaussianModel_eta aceBase theta tau, (affineGaussianModel_jmsAceClass_quarter aceBase n hace theta (by linarith [abs_nonneg theta])).treatmentCodeRadiusLr, (affineGaussianModel_jmsAceClass_quarter aceBase n hace theta (by linarith [abs_nonneg theta])).outcomeCodeRadiusLr⟩ · intro theta _ exact ⟨affineGaussianModel_map_xi aceBase theta tau, affineGaussianModel_indep_xi_xt aceBase theta tau⟩ · intro theta _ filter_upwards with o simp only [xi, affineGaussianModel_theta0, affineGaussianModel_q0] ring · exact hKLpath aceBase hace.etaSubGaussian · intro gbar qbar hex rcases hex with ⟨aceBase, hace, hg, hq⟩ let thetaMinus : ℝ := -c0 / (2 * sqrt n) let thetaPlus : ℝ := c0 / (2 * sqrt n) let m0 := affineGaussianModel aceBase thetaMinus tau let m1 := affineGaussianModel aceBase thetaPlus tau have hsqrt_pos : 0 < sqrt n := Real.sqrt_pos.2 (by exact_mod_cast hn) have htminus : |thetaMinus| ≤ c0 := by dsimp [thetaMinus] rw [abs_div, abs_neg, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] have hsqrt_ge : 1 ≤ sqrt n := Real.one_le_sqrt.mpr (by exact_mod_cast hn) apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith have htplus : |thetaPlus| ≤ c0 := by dsimp [thetaPlus] rw [abs_div, abs_of_pos hc0_pos, abs_of_pos (mul_pos zero_lt_two hsqrt_pos)] have hsqrt_ge : 1 ≤ sqrt n := Real.one_le_sqrt.mpr (by exact_mod_cast hn) apply (div_le_iff₀ (mul_pos zero_lt_two hsqrt_pos)).2 nlinarith have hm0 : m0 ∈ {m : Model (Xspace := Xspace) p | JmsAceClass p n m ∧ barG p m n = gbar ∧ barQ p m n = qbar} := by exact ⟨affineGaussianModel_jmsAceClass_quarter aceBase n hace thetaMinus (htminus.trans hc0_le), hg, hq⟩ have hm1 : m1 ∈ {m : Model (Xspace := Xspace) p | JmsAceClass p n m ∧ barG p m n = gbar ∧ barQ p m n = qbar} := by exact ⟨affineGaussianModel_jmsAceClass_quarter aceBase n hace thetaPlus (htplus.trans hc0_le), hg, hq⟩ have hsep : |thetaPlus - thetaMinus| = c0 / sqrt n := by have heq : thetaPlus - thetaMinus = c0 / sqrt n := by dsimp [thetaPlus, thetaMinus] field_simp [ne_of_gt hsqrt_pos] ring rw [heq, abs_of_pos (div_pos hc0_pos hsqrt_pos)] have hKL := hKLpath aceBase hace.etaSubGaussian thetaMinus thetaPlus c0 htminus htplus hsep letI : IsProbabilityMeasure (iidLaw m0 n) := by unfold iidLaw; infer_instance letI : IsProbabilityMeasure (iidLaw m1 n) := by unfold iidLaw; infer_instance have hbody : ∀ T : (Fin n → Obs Xspace) → ℝ, Measurable T → Integrable (fun s ↦ (T s - m0.theta0) ^ 2) (iidLaw m0 n) → Integrable (fun s ↦ (T s - m1.theta0) ^ 2) (iidLaw m1 n) → cK * (m1.theta0 - m0.theta0) ^ 2 ≤ max (∫ s, (T s - m0.theta0) ^ 2 ∂iidLaw m0 n) (∫ s, (T s - m1.theta0) ^ 2 ∂iidLaw m1 n) := by exact hlecam (iidLaw m0 n) (iidLaw m1 n) m0.theta0 m1.theta0 hKL have hlow := minimaxRiskOn_two_point_lower p n _ m0 m1 hm0 hm1 p.Ctheta cK p.constants_pos.1.le (by exact hm0.1.thetaRange) (by exact hm1.1.thetaRange) hbody have hnreal : 0 < (n : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn) have hsqrt_sq : (sqrt n) ^ 2 = (n : ℝ) := Real.sq_sqrt hnreal.le convert hlow using 1 congr 1 dsimp [m0, m1, thetaMinus, thetaPlus] field_simp [ne_of_gt hnreal, ne_of_gt hsqrt_pos] rw [hsqrt_sq] ring
CausalSmith.Stat.SaPlmCumulantConverse.non_gaussian_hard_submodel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/HardSubmodel.lean:112
Helpers.JensenBlaschke 16 declarations This file connects the open-disk multiplicity count used by the contour library to Mathlib's logarithmic divisor count.

Quantitative Jensen bridges

This file connects the open-disk multiplicity count used by the contour library to Mathlib's logarithmic divisor count. The resulting Jensen bound does not require the outer circle to be zero-free.

def interiorPart

Keep precisely the strict-interior part of a closed-disk divisor.

Definition (Lean source)
noncomputable def interiorPart (R : ℝ) (D : locallyFinsuppWithin (closedBall (0 : ℂ) R) ℤ) : locallyFinsuppWithin (closedBall (0 : ℂ) R) ℤ where toFun z := if z ∈ ball (0 : ℂ) R then D z else 0 supportWithinDomain' := by classical intro z hz change (if z ∈ ball (0 : ℂ) R then D z else 0) ≠ 0 at hz by_cases hzb : z ∈ ball (0 : ℂ) R · exact ball_subset_closedBall hzb · simp [hzb] at hz supportLocallyFiniteWithinDomain' := by classical intro z hz obtain ⟨t, ht, hfin⟩ := D.supportLocallyFiniteWithinDomain z hz refine ⟨t, ht, hfin.subset ?_⟩ intro u hu rcases hu with ⟨hut, hu⟩ exact ⟨hut, by change (if u ∈ ball (0 : ℂ) R then D u else 0) ≠ 0 at hu change D u ≠ 0 by_cases hub : u ∈ ball (0 : ℂ) R · simpa [hub] using hu · simp [hub] at hu⟩
theorem interiorPart_apply

The strict-interior part of a divisor on a closed disk agrees with the divisor at every point lying strictly inside the disk and is zero everywhere else, so it records exactly the multiplicities that the argument principle counts and discards those sitting on the boundary circle.

Formal statement
R :
D :
z :
interiorPart R D z = if z ∈ ball (0 : ℂ) R then D z else 0
Proof (Lean source)
@[simp] lemma interiorPart_apply (R : ℝ) (D : locallyFinsuppWithin (closedBall (0 : ℂ) R) ℤ) (z : ℂ) : interiorPart R D z = if z ∈ ball (0 : ℂ) R then D z else 0 := by classical rfl
CausalSmith.Stat.SaPlmCumulantConverse.interiorPart_apply · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:53

The analytic nonvanishing correction which converts the radius-R Blaschke product back to the corresponding monic zero polynomial.

Definition (Lean source)
def blaschkeCorrection {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (z : ℂ) : ℂ := ∏ i, (((R : ℂ) ^ 2 - star (a i) * z) / (R : ℂ))
CausalSmith.Stat.SaPlmCumulantConverse.blaschkeCorrection · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:63
theorem blaschkeProduct_mul_blaschkeCorrection Lemma lem:blaschke-product-mul-correction in the paper ↗

A Blaschke product times its correction is the monic polynomial with the listed zeros.

Formal statement
N :
R :
a :
Fin N → ℂ
hR :
0 < R
ha :
∀ i, ‖a i‖ < R
z :
hz :
‖z‖ ≤ R
blaschkeProduct R a z * blaschkeCorrection R a z = ∏ i, (z - a i)
Proof (Lean source)
lemma blaschkeProduct_mul_blaschkeCorrection {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (hR : 0 < R) (ha : ∀ i, ‖a i‖ < R) (z : ℂ) (hz : ‖z‖ ≤ R) : blaschkeProduct R a z * blaschkeCorrection R a z = ∏ i, (z - a i) := by rw [blaschkeProduct, blaschkeCorrection, ← Finset.prod_mul_distrib] apply Finset.prod_congr rfl intro i hi unfold blaschkeFactor have hden : (R : ℂ) ^ 2 - star (a i) * z ≠ 0 := by intro hzero have heq : (R : ℂ) ^ 2 = star (a i) * z := sub_eq_zero.mp hzero have hn := congrArg norm heq rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] at hn have hprodlt : ‖a i‖ * ‖z‖ < R * R := calc ‖a i‖ * ‖z‖ ≤ ‖a i‖ * R := mul_le_mul_of_nonneg_left hz (norm_nonneg _) _ < R * R := mul_lt_mul_of_pos_right (ha i) hR nlinarith have hden' : (R : ℂ) ^ 2 - z * star (a i) ≠ 0 := by simpa [mul_comm] using hden field_simp [hR.ne', hden, hden']
CausalSmith.Stat.SaPlmCumulantConverse.blaschkeProduct_mul_blaschkeCorrection · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:68
theorem blaschkeCorrection_analyticOnNhd_and_ne_zero Lemma lem:blaschke-correction-analytic-zero-free in the paper ↗

The Blaschke correction is analytic and nonzero throughout the closed disk when all listed zeros lie strictly inside it.

Formal statement
N :
R :
a :
Fin N → ℂ
hR :
0 < R
ha :
∀ i, ‖a i‖ < R
AnalyticOnNhd ℂ (blaschkeCorrection R a) (closedBall (0 : ℂ) R) ∧
∀ z ∈ closedBall (0 : ℂ) R, blaschkeCorrection R a z ≠ 0
Proof (Lean source)
lemma blaschkeCorrection_analyticOnNhd_and_ne_zero {N : ℕ} (R : ℝ) (a : Fin N → ℂ) (hR : 0 < R) (ha : ∀ i, ‖a i‖ < R) : AnalyticOnNhd ℂ (blaschkeCorrection R a) (closedBall (0 : ℂ) R) ∧ ∀ z ∈ closedBall (0 : ℂ) R, blaschkeCorrection R a z ≠ 0 := by constructor · intro z hz unfold blaschkeCorrection fun_prop · intro z hz rw [blaschkeCorrection, Finset.prod_ne_zero_iff] intro i hi apply div_ne_zero · intro hzero have heq : (R : ℂ) ^ 2 = star (a i) * z := sub_eq_zero.mp hzero have hn := congrArg norm heq rw [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hR, norm_mul, norm_star] at hn have hzR : ‖z‖ ≤ R := by simpa [mem_closedBall, dist_zero_right] using hz have hprodlt : ‖a i‖ * ‖z‖ < R * R := calc ‖a i‖ * ‖z‖ ≤ ‖a i‖ * R := mul_le_mul_of_nonneg_left hzR (norm_nonneg _) _ < R * R := mul_lt_mul_of_pos_right (ha i) hR nlinarith · exact_mod_cast hR.ne'
CausalSmith.Stat.SaPlmCumulantConverse.blaschkeCorrection_analyticOnNhd_and_ne_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:93
theorem exists_analytic_zeroFree_factorizedRational_closedBall Lemma lem:extract-zero-free-quotient-closed-ball in the paper ↗

On a closed disk, Mathlib's divisor extraction constructs the analytic zero-free quotient. The equality is in Mathlib's canonical codiscrete form; this is the raw cancellation bridge from which a concrete finite Blaschke factorization can be obtained after identifying the finite divisor.

Formal statement
f :
ℂ → ℂ
R :
hR :
0 < R
han :
AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)
hzero :
f 0 ≠ 0
∃ g : ℂ → ℂ,
AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧
(∀ z ∈ closedBall (0 : ℂ) R, g z ≠ 0) ∧
EqOn f ((∏ᶠ u, (· - u) ^ (divisor f (closedBall 0 R) u)) * g) (closedBall (0 : ℂ) R)
Proof (Lean source)
lemma exists_analytic_zeroFree_factorizedRational_closedBall {f : ℂ → ℂ} {R : ℝ} (hR : 0 < R) (han : AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)) (hzero : f 0 ≠ 0) : ∃ g : ℂ → ℂ, AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧ (∀ z ∈ closedBall (0 : ℂ) R, g z ≠ 0) ∧ EqOn f ((∏ᶠ u, (· - u) ^ (divisor f (closedBall 0 R) u)) * g) (closedBall (0 : ℂ) R) := by have h0mem : (0 : ℂ) ∈ closedBall 0 R := by simpa using hR.le have hmer := han.meromorphicOn have hbase : meromorphicOrderAt f 0 ≠ ⊤ := by rw [(han 0 h0mem).meromorphicOrderAt_eq, (han 0 h0mem).analyticOrderAt_eq_zero.2 hzero] simp have hfiniteOrder : ∀ u : closedBall (0 : ℂ) R, meromorphicOrderAt f u ≠ ⊤ := by intro u exact hmer.meromorphicOrderAt_ne_top_of_isPreconnected (convex_closedBall (0 : ℂ) R).isPreconnected h0mem u.property hbase have hsupport : (divisor f (closedBall (0 : ℂ) R)).support.Finite := (divisor f (closedBall (0 : ℂ) R)).finiteSupport (isCompact_closedBall (0 : ℂ) R) obtain ⟨g, hgAn, hgzero, hfactor⟩ := hmer.extract_zeros_poles hfiniteOrder hsupport let D := divisor f (closedBall (0 : ℂ) R) let P : ℂ → ℂ := ∏ᶠ u, (· - u) ^ D u have hDnonneg : (0 : ℂ → ℤ) ≤ D := by intro z by_cases hz : z ∈ closedBall (0 : ℂ) R · simp [D, hmer, hz, (han z hz).meromorphicOrderAt_nonneg] · simp [D, hz] have hPAn : AnalyticOnNhd ℂ P (closedBall (0 : ℂ) R) := by rw [← (Function.FactorizedRational.meromorphicNFOn D (closedBall (0 : ℂ) R)).divisor_nonneg_iff_analyticOnNhd] rw [Function.FactorizedRational.divisor hsupport] exact hDnonneg have hprodAn : AnalyticOnNhd ℂ (P * g) (closedBall (0 : ℂ) R) := hPAn.mul hgAn have hacc : AccPt (0 : ℂ) (𝓟 (closedBall (0 : ℂ) R)) := by apply accPt_iff_frequently_nhdsNE.mpr apply Filter.Eventually.frequently apply mem_nhdsWithin.mpr refine ⟨ball 0 R, isOpen_ball, mem_ball_self hR, ?_⟩ intro z hz exact ball_subset_closedBall hz.1 have hpunc : f =ᶠ[𝓝[≠] (0 : ℂ)] P * g := by apply (han 0 h0mem).meromorphicAt.eventuallyEq_nhdsNE_of_eventuallyEq_codiscreteWithin (hprodAn 0 h0mem).meromorphicAt h0mem hacc simpa only [P, D, Pi.smul_apply', smul_eq_mul] using hfactor have heq : EqOn f (P * g) (closedBall (0 : ℂ) R) := han.eqOn_of_preconnected_of_frequently_eq hprodAn (convex_closedBall (0 : ℂ) R).isPreconnected h0mem hpunc.frequently refine ⟨g, hgAn, ?_, ?_⟩ · intro z hz exact hgzero ⟨z, hz⟩ · simpa only [P, D] using heq
CausalSmith.Stat.SaPlmCumulantConverse.exists_analytic_zeroFree_factorizedRational_closedBall · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:120
theorem exists_pointwise_blaschke_factorization_of_divisor_enumeration Lemma lem:exists-pointwise-blaschke-factorization in the paper ↗

A multiplicity-expanded enumeration of the disk divisor yields an actual pointwise finite Blaschke factorization. The zero-free remainder is constructed from Mathlib's extracted quotient and the explicit nonvanishing Blaschke correction; it is not an assumption.

Formal statement
f :
ℂ → ℂ
R :
N :
a :
Fin N → ℂ
hR :
0 < R
han :
AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)
hzero :
f 0 ≠ 0
ha :
∀ i, ‖a i‖ < R
henum :
EqOn (∏ᶠ u, (· - u) ^ (divisor f (closedBall 0 R) u)) (fun z ↦ ∏ i, (z - a i)) (closedBall (0 : ℂ) R)
∃ g : ℂ → ℂ,
AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧
DiffContOnCl ℂ g (ball (0 : ℂ) R) ∧
(∀ z ∈ closedBall (0 : ℂ) R, g z ≠ 0) ∧
∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z
Proof (Lean source)
lemma exists_pointwise_blaschke_factorization_of_divisor_enumeration {f : ℂ → ℂ} {R : ℝ} {N : ℕ} (a : Fin N → ℂ) (hR : 0 < R) (han : AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)) (hzero : f 0 ≠ 0) (ha : ∀ i, ‖a i‖ < R) (henum : EqOn (∏ᶠ u, (· - u) ^ (divisor f (closedBall 0 R) u)) (fun z ↦ ∏ i, (z - a i)) (closedBall (0 : ℂ) R)) : ∃ g : ℂ → ℂ, AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧ DiffContOnCl ℂ g (ball (0 : ℂ) R) ∧ (∀ z ∈ closedBall (0 : ℂ) R, g z ≠ 0) ∧ ∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z := by obtain ⟨g0, hg0An, hg0zero, hfP⟩ := exists_analytic_zeroFree_factorizedRational_closedBall hR han hzero let g : ℂ → ℂ := blaschkeCorrection R a * g0 have hcorr := blaschkeCorrection_analyticOnNhd_and_ne_zero R a hR ha have hgAn : AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) := hcorr.1.mul hg0An refine ⟨g, hgAn, hgAn.differentiableOn.diffContOnCl_ball subset_rfl, ?_, ?_⟩ · intro z hz exact mul_ne_zero (hcorr.2 z hz) (hg0zero z hz) · intro z hz rw [hfP hz] simp only [Pi.mul_apply] rw [henum hz] change (∏ i, (z - a i)) * g0 z = _ have hzR : ‖z‖ ≤ R := by simpa [mem_closedBall, dist_zero_right] using hz rw [← blaschkeProduct_mul_blaschkeCorrection R a hR ha z hzR] simp only [g, Pi.mul_apply] ring
CausalSmith.Stat.SaPlmCumulantConverse.exists_pointwise_blaschke_factorization_of_divisor_enumeration · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:182
theorem exists_multiplicityEnumeration_of_finite_nonneg_divisor Lemma lem:finite-divisor-multiplicity-enumeration in the paper ↗

Every finite nonnegative divisor admits a multiplicity-expanded finite enumeration whose monic product is its factorized rational function.

Formal statement
D :
hfin :
D.support.Finite
hnonneg :
(0 : ℂ → ℤ) ≤ D
hsupportBall :
D.support ⊆ ball (0 : ℂ) R
∃ (N : ℕ) (a : Fin N → ℂ),
(∀ i, a i ∈ ball (0 : ℂ) R) ∧
N = ∑ u ∈ hfin.toFinset, (D u).toNat
∀ z : ℂ, (∏ᶠ u, (z - u) ^ D u) = ∏ i, (z - a i)
Proof (Lean source)
lemma exists_multiplicityEnumeration_of_finite_nonneg_divisor {D : locallyFinsuppWithin (closedBall (0 : ℂ) R) ℤ} (hfin : D.support.Finite) (hnonneg : (0 : ℂ → ℤ) ≤ D) (hsupportBall : D.support ⊆ ball (0 : ℂ) R) : ∃ (N : ℕ) (a : Fin N → ℂ), (∀ i, a i ∈ ball (0 : ℂ) R) ∧ N = ∑ u ∈ hfin.toFinset, (D u).toNat ∧ ∀ z : ℂ, (∏ᶠ u, (z - u) ^ D u) = ∏ i, (z - a i) := by classical let S := hfin.toFinset let I := Σ u : S, Fin (D u.1).toNat let e : I ≃ Fin (card I) := Fintype.equivFin I let a : Fin (card I) → ℂ := fun i ↦ (e.symm i).1.1 refine ⟨Fintype.card I, a, ?_, ?_, ?_⟩ · intro i exact hsupportBall (hfin.mem_toFinset.mp (e.symm i).1.2) · simp [I, S] exact Finset.sum_attach hfin.toFinset (fun u ↦ (D u).toNat) · intro z rw [finprod_eq_prod_of_mulSupport_subset (s := S)] · rw [show (∏ u ∈ S, (z - u) ^ D u) = ∏ u : S, (z - u.1) ^ D u.1 by rw [← Finset.prod_attach] rfl] calc (∏ u : S, (z - u.1) ^ D u.1) = ∏ u : S, (z - u.1) ^ (D u.1).toNat := by apply Fintype.prod_congr intro u rw [← zpow_natCast] congr 1 exact (Int.toNat_of_nonneg (hnonneg u.1)).symm _ = ∏ x : I, (z - x.1.1) := by rw [Fintype.prod_sigma] apply Fintype.prod_congr intro u exact Fin.prod_const _ _ |>.symm _ = ∏ i, (z - a i) := by apply Fintype.prod_equiv e intro x simp [a] · intro u hu rw [Function.mem_mulSupport] at hu have hDu : D u ≠ 0 := by intro h simp [h] at hu exact hfin.mem_toFinset.mpr hDu
CausalSmith.Stat.SaPlmCumulantConverse.exists_multiplicityEnumeration_of_finite_nonneg_divisor · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:217
theorem zeroMultiplicityCount_eq_sum_orders_on_finset Lemma zeroMultiplicityCount_eq_sum_orders_on_finset in the paper ↗

The open-disk zero count can be evaluated on any finite set containing all nonzero analytic orders in the disk.

Formal statement
f :
ℂ → ℂ
R :
S :
Finset
hS :
∀ z ∈ ball (0 : ℂ) R
if
then
z ∈ S
= ∑ z ∈ S, if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0
Proof (Lean source)
lemma zeroMultiplicityCount_eq_sum_orders_on_finset {f : ℂ → ℂ} {R : ℝ} (S : Finset ℂ) (hS : ∀ z ∈ ball (0 : ℂ) R, analyticOrderNatAt f z ≠ 0 → z ∈ S) : zeroMultiplicityCount f 0 R = ∑ z ∈ S, if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0 := by classical unfold zeroMultiplicityCount rw [finsum_eq_sum_of_support_subset (s := S) (fun z ↦ if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0)] intro z hz simp only [Function.mem_support, ne_eq] at hz by_cases hzball : z ∈ ball (0 : ℂ) R · exact hS z hzball (by simpa [hzball] using hz) · simp [hzball] at hz
CausalSmith.Stat.SaPlmCumulantConverse.zeroMultiplicityCount_eq_sum_orders_on_finset · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:268
theorem factorizedRational_add_of_finite_nonneg

Factorized rational functions multiply when two finite exponent functions are nonnegative. Nonnegativity is essential at common zeros: it lets us reduce integer powers to ordinary natural powers before using pow_add.

Formal statement
d e :
ℂ → ℤ
hdFin :
d.support.Finite
heFin :
e.support.Finite
hd :
(0 : ℂ → ℤ) ≤ d
he :
(0 : ℂ → ℤ) ≤ e
(∏ᶠ u, (· - u) ^ (d u + e u)) = (∏ᶠ u, (· - u) ^ d u) * (∏ᶠ u, (· - u) ^ e u)
Proof (Lean source)
lemma factorizedRational_add_of_finite_nonneg {d e : ℂ → ℤ} (hdFin : d.support.Finite) (heFin : e.support.Finite) (hd : (0 : ℂ → ℤ) ≤ d) (he : (0 : ℂ → ℤ) ≤ e) : (∏ᶠ u, (· - u) ^ (d u + e u)) = (∏ᶠ u, (· - u) ^ d u) * (∏ᶠ u, (· - u) ^ e u) := by rw [← finprod_mul_distrib] · apply finprod_congr intro u obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (hd u) obtain ⟨n, hn⟩ := Int.eq_ofNat_of_zero_le (he u) rw [hm, hn, ← Nat.cast_add, zpow_natCast, zpow_natCast, zpow_natCast, pow_add] · rw [Function.HasFiniteMulSupport, Function.FactorizedRational.mulSupport] exact hdFin · rw [Function.HasFiniteMulSupport, Function.FactorizedRational.mulSupport] exact heFin
CausalSmith.Stat.SaPlmCumulantConverse.factorizedRational_add_of_finite_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:285
theorem exists_complete_pointwise_blaschke_factorization Lemma lem:exists-complete-pointwise-blaschke-factorization in the paper ↗

A normalized analytic function admits a complete finite pointwise Blaschke factorization on the disk even when it has zeros on the boundary. Only strict-interior zeros enter the Blaschke product; boundary factors are absorbed into a remainder which is zero-free on the open disk.

Formal statement
f :
ℂ → ℂ
R :
hR :
0 < R
han :
AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)
hzero :
f 0 ≠ 0
∃ (N : ℕ) (a : Fin N → ℂ) (g : ℂ → ℂ),
(∀ i, ‖a i‖ < R) ∧
AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧
DiffContOnCl ℂ g (ball (0 : ℂ) R) ∧
(∀ z ∈ ball (0 : ℂ) R, g z ≠ 0) ∧
N = zeroMultiplicityCount f 0 R ∧
∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z
Proof (Lean source)
lemma exists_complete_pointwise_blaschke_factorization {f : ℂ → ℂ} {R : ℝ} (hR : 0 < R) (han : AnalyticOnNhd ℂ f (closedBall (0 : ℂ) R)) (hzero : f 0 ≠ 0) : ∃ (N : ℕ) (a : Fin N → ℂ) (g : ℂ → ℂ), (∀ i, ‖a i‖ < R) ∧ AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) ∧ DiffContOnCl ℂ g (ball (0 : ℂ) R) ∧ (∀ z ∈ ball (0 : ℂ) R, g z ≠ 0) ∧ N = zeroMultiplicityCount f 0 R ∧ ∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z := by let D := divisor f (closedBall (0 : ℂ) R) let Dint := interiorPart R D let Dbd := D - Dint have hfin : D.support.Finite := D.finiteSupport (isCompact_closedBall (0 : ℂ) R) have hnonneg : (0 : ℂ → ℤ) ≤ D := by intro z by_cases hz : z ∈ closedBall (0 : ℂ) R · simp [D, han.meromorphicOn, hz, (han z hz).meromorphicOrderAt_nonneg] · simp [D, hz] have hintnonneg : (0 : ℂ → ℤ) ≤ Dint := by intro z by_cases hz : z ∈ ball (0 : ℂ) R · simpa [Dint, hz] using hnonneg z · simp [Dint, hz] have hbdnonneg : (0 : ℂ → ℤ) ≤ Dbd := by intro z by_cases hz : z ∈ ball (0 : ℂ) R · simp [Dbd, Dint, hz] · simpa [Dbd, Dint, hz] using hnonneg z have hintSupport : Dint.support ⊆ D.support := by intro z hz by_cases hzb : z ∈ ball (0 : ℂ) R · simpa [Dint, hzb] using hz · simp [Dint, hzb] at hz have hbdSupport : Dbd.support ⊆ D.support := by intro z hz by_contra hDz have hDz0 : D z = 0 := Function.notMem_support.mp hDz have hDi : Dint z = 0 := by by_cases hzb : z ∈ ball (0 : ℂ) R <;> simp [Dint, hzb, hDz0] exact hz (by simp [Dbd, hDz0, hDi]) have hintFin : Dint.support.Finite := hfin.subset hintSupport have hbdFin : Dbd.support.Finite := hfin.subset hbdSupport have hintSupportBall : Dint.support ⊆ ball (0 : ℂ) R := by intro z hz by_contra hzb simp [Dint, hzb] at hz obtain ⟨N, a, haBall, hcard, henumAll⟩ := exists_multiplicityEnumeration_of_finite_nonneg_divisor hintFin hintnonneg hintSupportBall have ha : ∀ i, ‖a i‖ < R := fun i ↦ by simpa [mem_ball, dist_zero_right] using haBall i have horderFinite (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) R) : analyticOrderAt f z ≠ ⊤ := by have hbase : meromorphicOrderAt f 0 ≠ ⊤ := by rw [(han 0 (by simpa using hR.le)).meromorphicOrderAt_eq, (han 0 (by simpa using hR.le)).analyticOrderAt_eq_zero.2 hzero] simp have hm := han.meromorphicOn.meromorphicOrderAt_ne_top_of_isPreconnected (convex_closedBall (0 : ℂ) R).isPreconnected (by simpa using hR.le) hz hbase rw [(han z hz).meromorphicOrderAt_eq] at hm simpa using hm have hDorder (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) R) : D z = (analyticOrderNatAt f z : ℤ) := by dsimp [D] rw [MeromorphicOn.divisor_apply han.meromorphicOn hz, (han z hz).meromorphicOrderAt_eq, ← Nat.cast_analyticOrderNatAt (horderFinite z hz)] simp have hSin (z : ℂ) (hz : z ∈ ball (0 : ℂ) R) (hzord : analyticOrderNatAt f z ≠ 0) : z ∈ hintFin.toFinset := by apply hintFin.mem_toFinset.mpr simp only [Function.mem_support, Dint, interiorPart_apply, hz, if_true] rw [hDorder z (ball_subset_closedBall hz)] exact_mod_cast hzord have hcount := zeroMultiplicityCount_eq_sum_orders_on_finset hintFin.toFinset hSin have hcount' : N = zeroMultiplicityCount f 0 R := by rw [hcard, hcount] apply Finset.sum_congr rfl intro z hz have hzsupport : z ∈ Dint.support := hintFin.mem_toFinset.mp hz have hzball : z ∈ ball (0 : ℂ) R := hintSupportBall hzsupport simp only [hzball, if_true] simp only [Dint, interiorPart_apply, hzball, if_true] at hzsupport ⊢ rw [hDorder z (ball_subset_closedBall hzball)] simp obtain ⟨g0, hg0An, hg0zero, hfD⟩ := exists_analytic_zeroFree_factorizedRational_closedBall hR han hzero let Pbd : ℂ → ℂ := ∏ᶠ u, (· - u) ^ Dbd u have hPbdAn : AnalyticOnNhd ℂ Pbd (closedBall (0 : ℂ) R) := by intro z hz exact Function.FactorizedRational.analyticAt (hbdnonneg z) have hPbdZero : ∀ z ∈ ball (0 : ℂ) R, Pbd z ≠ 0 := by intro z hz apply Function.FactorizedRational.ne_zero simp [Dbd, Dint, hz] let g : ℂ → ℂ := blaschkeCorrection R a * (Pbd * g0) have hcorr := blaschkeCorrection_analyticOnNhd_and_ne_zero R a hR ha have hgAn : AnalyticOnNhd ℂ g (closedBall (0 : ℂ) R) := hcorr.1.mul (hPbdAn.mul hg0An) refine ⟨N, a, g, ha, hgAn, hgAn.differentiableOn.diffContOnCl_ball subset_rfl, ?_, hcount', ?_⟩ · intro z hz exact mul_ne_zero (hcorr.2 z (ball_subset_closedBall hz)) (mul_ne_zero (hPbdZero z hz) (hg0zero z (ball_subset_closedBall hz))) · intro z hz rw [hfD hz] simp only [Pi.mul_apply] have hDsplit : D = Dint + Dbd := by ext u simp [Dbd] have hPsplit : (∏ᶠ u, (· - u) ^ D u) = (∏ᶠ u, (· - u) ^ Dint u) * Pbd := by rw [hDsplit] exact factorizedRational_add_of_finite_nonneg hintFin hbdFin hintnonneg hbdnonneg rw [hPsplit] simp only [Pi.mul_apply] have henumAt : (∏ᶠ u, (· - u) ^ Dint u) z = ∏ i, (z - a i) := by rw [Function.FactorizedRational.finprod_eq_fun hintFin] exact henumAll z rw [henumAt] have hzR : ‖z‖ ≤ R := by simpa [mem_closedBall, dist_zero_right] using hz rw [← blaschkeProduct_mul_blaschkeCorrection R a hR ha z hzR] simp only [g, Pbd, Pi.mul_apply] ring
CausalSmith.Stat.SaPlmCumulantConverse.exists_complete_pointwise_blaschke_factorization · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:304
theorem jensen_logCounting_divisor_le Lemma lem:jensen-log-counting-le in the paper ↗

Jensen's formula bounds the logarithmic divisor count by any uniform log-modulus bound on the outer circle, when the function is normalized at the origin. Zeros on that circle are allowed.

Formal statement
f :
ℂ → ℂ
R A :
hR :
0 < R
hA :
0 ≤ A
han :
hzero :
f 0 = 1
hupper :
∀ z ∈ sphere (0 : ℂ) R, ‖f z‖ ≤ exp A
locallyFinsuppWithin.logCounting (divisor f ⊤) R ≤ A
Proof (Lean source)
lemma jensen_logCounting_divisor_le {f : ℂ → ℂ} {R A : ℝ} (hR : 0 < R) (hA : 0 ≤ A) (han : AnalyticOnNhd ℂ f univ) (hzero : f 0 = 1) (hupper : ∀ z ∈ sphere (0 : ℂ) R, ‖f z‖ ≤ exp A) : locallyFinsuppWithin.logCounting (divisor f ⊤) R ≤ A := by have hmer : Meromorphic f := by simpa [Meromorphic] using han.meromorphicOn show locallyFinsuppWithin.logCounting (divisor f univ) R ≤ A rw [locallyFinsuppWithin.logCounting_divisor_eq_circleAverage_sub_const hmer hR.ne'] have htrail : meromorphicTrailingCoeffAt f 0 = 1 := by rw [(han 0 (mem_univ 0)).meromorphicTrailingCoeffAt_of_ne_zero] · exact hzero · simp [hzero] rw [htrail] simp only [norm_one, Real.log_one, sub_zero] apply Real.circleAverage_mono_on_of_le_circle · exact circleIntegrable_log_norm_meromorphicOn (fun z hz ↦ (han z (mem_univ z)).meromorphicAt) · intro z hz have hz' : z ∈ sphere (0 : ℂ) R := by simpa [abs_of_pos hR] using hz by_cases hfz : f z = 0 · simpa [hfz] using hA · exact (Real.log_le_iff_le_exp (norm_pos_iff.mpr hfz)).2 (hupper z hz')
CausalSmith.Stat.SaPlmCumulantConverse.jensen_logCounting_divisor_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:438
theorem zeroMultiplicityCount_eq_sum_analyticOrderNatAt Lemma lem:zero-count-eq-sum-orders in the paper ↗

The open-disk multiplicity count, after casting to the integers, is the sum of the analytic orders over any finite set containing every zero in the disk.

Formal statement
f :
ℂ → ℂ
R :
S :
Finset
hS :
∀ z ∈ ball (0 : ℂ) R
if
then
z ∈ S
= ∑ z ∈ S, if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0
Proof (Lean source)
lemma zeroMultiplicityCount_eq_sum_analyticOrderNatAt {f : ℂ → ℂ} {R : ℝ} (S : Finset ℂ) (hS : ∀ z ∈ ball (0 : ℂ) R, analyticOrderNatAt f z ≠ 0 → z ∈ S) : zeroMultiplicityCount f 0 R = ∑ z ∈ S, if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0 := by classical unfold zeroMultiplicityCount rw [finsum_eq_sum_of_support_subset (s := S) (fun z ↦ if z ∈ ball (0 : ℂ) R then analyticOrderNatAt f z else 0)] · intro z hz simp only [Function.mem_support, ne_eq] at hz by_cases hzball : z ∈ ball (0 : ℂ) R · exact hS z hzball (by simpa [hzball] using hz) · simp [hzball] at hz
CausalSmith.Stat.SaPlmCumulantConverse.zeroMultiplicityCount_eq_sum_analyticOrderNatAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:465
theorem zeroMultiplicityCount_mul_log_div_le_logCounting Lemma lem:zero-count-mul-log-ratio-le in the paper ↗

Quantitative Jensen zero-counting inequality in the project's zeroMultiplicityCount representation. It has no boundary-zero hypothesis.

Formal statement
f :
ℂ → ℂ
Rin Rout :
hRin :
0 < Rin
hlt :
Rin < Rout
han :
hzero :
f 0 = 1
(zeroMultiplicityCount f 0 Rin : ℝ) * log (Rout / Rin)
≤ locallyFinsuppWithin.logCounting (divisor f ⊤) Rout
Proof (Lean source)
lemma zeroMultiplicityCount_mul_log_div_le_logCounting {f : ℂ → ℂ} {Rin Rout : ℝ} (hRin : 0 < Rin) (hlt : Rin < Rout) (han : AnalyticOnNhd ℂ f univ) (hzero : f 0 = 1) : (zeroMultiplicityCount f 0 Rin : ℝ) * log (Rout / Rin) ≤ locallyFinsuppWithin.logCounting (MeromorphicOn.divisor f ⊤) Rout := by classical let D := MeromorphicOn.divisor f ⊤ let S : Finset ℂ := (D.toClosedBall Rout).finiteSupport (isCompact_closedBall (0 : ℂ) |Rout|) |>.toFinset have hRout : 0 < Rout := hRin.trans hlt have hmer : Meromorphic f := by simpa [Meromorphic] using han.meromorphicOn have horderFinite (z : ℂ) : analyticOrderAt f z ≠ ⊤ := by have hbase : meromorphicOrderAt f 0 ≠ ⊤ := by rw [(han 0 (mem_univ 0)).meromorphicOrderAt_eq, (han 0 (mem_univ 0)).analyticOrderAt_eq_zero.2 (by simp [hzero])] simp have hm := han.meromorphicOn.meromorphicOrderAt_ne_top_of_isPreconnected isPreconnected_univ (mem_univ 0) (mem_univ z) hbase rw [(han z (mem_univ z)).meromorphicOrderAt_eq] at hm simpa using hm have hDorder (z : ℂ) : D z = (analyticOrderNatAt f z : ℤ) := by dsimp [D] rw [MeromorphicOn.divisor_apply han.meromorphicOn (mem_univ z), (han z (mem_univ z)).meromorphicOrderAt_eq, ← Nat.cast_analyticOrderNatAt (horderFinite z)] simp have hSin (z : ℂ) (hz : z ∈ ball (0 : ℂ) Rin) (hzord : analyticOrderNatAt f z ≠ 0) : z ∈ S := by have hzclosed : z ∈ closedBall (0 : ℂ) |Rout| := by rw [mem_closedBall, dist_zero_right, abs_of_pos hRout] exact (mem_ball_zero_iff.mp hz).le.trans hlt.le have hDz : D z ≠ 0 := by rw [hDorder]; exact_mod_cast hzord exact Set.Finite.mem_toFinset ((D.toClosedBall Rout).finiteSupport (isCompact_closedBall (0 : ℂ) |Rout|)) |>.2 (by simpa [S, locallyFinsuppWithin.toClosedBall_eval_within D hzclosed] using hDz) rw [zeroMultiplicityCount_eq_sum_analyticOrderNatAt S hSin] push_cast rw [Finset.sum_mul] have hlogexpand : locallyFinsuppWithin.logCounting D Rout = ∑ z ∈ S, (D.toClosedBall Rout z : ℝ) * log (Rout * ‖z‖⁻¹) + (D 0 : ℝ) * log Rout := by unfold locallyFinsuppWithin.logCounting simp only [AddMonoidHom.coe_mk, ZeroHom.coe_mk] rw [finsum_eq_sum_of_support_subset (s := S)] intro z hz have hfactor : (D.toClosedBall Rout z : ℝ) ≠ 0 := left_ne_zero_of_mul hz exact Set.Finite.mem_toFinset ((D.toClosedBall Rout).finiteSupport (isCompact_closedBall (0 : ℂ) |Rout|)) |>.2 (by simpa [S, Function.mem_support] using hfactor) rw [hlogexpand] have hord0 : analyticOrderNatAt f 0 = 0 := by by_contra hne have hf0 := apply_eq_zero_of_analyticOrderNatAt_ne_zero hne simp [hzero] at hf0 have hDzero : D 0 = 0 := by rw [hDorder, hord0] rfl rw [hDzero] simp only [Int.cast_zero, zero_mul, add_zero] apply Finset.sum_le_sum intro z hzS by_cases hz : z ∈ ball (0 : ℂ) Rin · have hzRout : z ∈ closedBall (0 : ℂ) |Rout| := by rw [mem_closedBall, dist_zero_right, abs_of_pos hRout] exact (mem_ball_zero_iff.mp hz).le.trans hlt.le rw [if_pos hz, locallyFinsuppWithin.toClosedBall_eval_within D hzRout, hDorder] push_cast have hznorm : ‖z‖ < Rin := mem_ball_zero_iff.mp hz by_cases hz0 : z = 0 · subst z simp [hord0] · apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply Real.log_le_log (div_pos hRout hRin) rw [div_eq_mul_inv] apply (div_le_div_iff_of_pos_left hRout hRin (norm_pos_iff.mpr hz0)).2 exact hznorm.le · simp only [hz, if_false, zero_mul] have hDnonneg : 0 ≤ (D.toClosedBall Rout z : ℝ) := by by_cases hzout : z ∈ closedBall (0 : ℂ) |Rout| · rw [locallyFinsuppWithin.toClosedBall_eval_within D hzout, hDorder] exact_mod_cast zero_le (analyticOrderNatAt f z) · simp [locallyFinsuppWithin.toClosedBall, hzout] exact mul_nonneg hDnonneg (Real.log_nonneg (by have hzclosed := locallyFinsuppWithin.toClosedBall_support_subset_closedBall D (Set.Finite.mem_toFinset ((D.toClosedBall Rout).finiteSupport (isCompact_closedBall (0 : ℂ) |Rout|)) |>.1 hzS) rw [mem_closedBall, dist_zero_right, abs_of_pos hRout] at hzclosed by_cases hz0 : z = 0 · exact elim (hz (by simpa [hz0] using hRin)) · exact (le_mul_inv_iff₀ (norm_pos_iff.mpr hz0)).2 (by simpa [mul_comm] using hzclosed)))
CausalSmith.Stat.SaPlmCumulantConverse.zeroMultiplicityCount_mul_log_div_le_logCounting · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:483
theorem jensen_zeroMultiplicityCount_bound Lemma lem:jensen-zero-count-bound in the paper ↗

A normalized entire function whose modulus is at most exp A on the outer circle has at most Jensen growth worth of inner zeros.

Formal statement
f :
ℂ → ℂ
Rin Rout A :
hRin :
0 < Rin
hlt :
Rin < Rout
hA :
0 ≤ A
han :
hzero :
f 0 = 1
hupper :
∀ z ∈ sphere (0 : ℂ) Rout, ‖f z‖ ≤ exp A
(zeroMultiplicityCount f 0 Rin : ℝ) * log (Rout / Rin) ≤ A
Proof (Lean source)
lemma jensen_zeroMultiplicityCount_bound {f : ℂ → ℂ} {Rin Rout A : ℝ} (hRin : 0 < Rin) (hlt : Rin < Rout) (hA : 0 ≤ A) (han : AnalyticOnNhd ℂ f univ) (hzero : f 0 = 1) (hupper : ∀ z ∈ sphere (0 : ℂ) Rout, ‖f z‖ ≤ exp A) : (zeroMultiplicityCount f 0 Rin : ℝ) * log (Rout / Rin) ≤ A := (zeroMultiplicityCount_mul_log_div_le_logCounting hRin hlt han hzero).trans (jensen_logCounting_divisor_le (hRin.trans hlt) hA han hzero hupper)
CausalSmith.Stat.SaPlmCumulantConverse.jensen_zeroMultiplicityCount_bound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:578
theorem norm_lower_of_blaschke_factorization Lemma lem:blaschke-factorization-lower-bound in the paper ↗

A supplied finite Blaschke factorization turns an outer boundary bound into a quantitative interior lower bound. This is the reusable consumer of a complete multiplicity list: the remaining local burden is only to construct the analytic zero-free quotient and the factorization equality.

Formal statement
N :
f g :
ℂ → ℂ
a :
Fin N → ℂ
R R1 A :
hR :
0 < R
hR1 :
0 ≤ R1
hsmall :
R1 < R
ha :
∀ i, ‖a i‖ < R
hgAn :
AnalyticOnNhd ℂ g (ball (0 : ℂ) R)
hgDiff :
DiffContOnCl ℂ g (ball (0 : ℂ) R)
hgzero :
∀ z ∈ ball (0 : ℂ) R, g z ≠ 0
hfactor :
∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z
hfzero :
f 0 = 1
hfupper :
∀ z ∈ sphere (0 : ℂ) R, ‖f z‖ ≤ exp A
∀ z : ℂ
if
‖z‖ ≤ R1
then
exp (-(((R + R1) / (R - R1)) - 1) * A) * ‖blaschkeProduct R a z‖ ≤ ‖f z‖
Proof (Lean source)
lemma norm_lower_of_blaschke_factorization {N : ℕ} (f g : ℂ → ℂ) (a : Fin N → ℂ) (R R1 A : ℝ) (hR : 0 < R) (hR1 : 0 ≤ R1) (hsmall : R1 < R) (ha : ∀ i, ‖a i‖ < R) (hgAn : AnalyticOnNhd ℂ g (ball (0 : ℂ) R)) (hgDiff : DiffContOnCl ℂ g (ball (0 : ℂ) R)) (hgzero : ∀ z ∈ ball (0 : ℂ) R, g z ≠ 0) (hfactor : ∀ z ∈ closedBall (0 : ℂ) R, f z = blaschkeProduct R a z * g z) (hfzero : f 0 = 1) (hfupper : ∀ z ∈ sphere (0 : ℂ) R, ‖f z‖ ≤ exp A) : ∀ z : ℂ, ‖z‖ ≤ R1 → exp (-(((R + R1) / (R - R1)) - 1) * A) * ‖blaschkeProduct R a z‖ ≤ ‖f z‖ := by have hGupper : ∀ z ∈ ball (0 : ℂ) R, ‖g z‖ ≤ exp A := by intro z hz apply Complex.norm_le_of_forall_mem_frontier_norm_le isBounded_ball hgDiff _ (by rw [closure_ball _ hR.ne']; exact ball_subset_closedBall hz) intro w hw have hwS : w ∈ sphere (0 : ℂ) R := frontier_ball_subset_sphere hw have hwC : w ∈ closedBall (0 : ℂ) R := sphere_subset_closedBall hwS have hprod := congrArg norm (hfactor w hwC) rw [norm_mul, norm_blaschkeProduct_eq_one_of_mem_sphere R a hR ha hwS, one_mul] at hprod rw [← hprod] exact hfupper w hwS have hzeroC : (0 : ℂ) ∈ closedBall 0 R := by simpa using hR.le have hfactor0 := congrArg norm (hfactor 0 hzeroC) rw [hfzero, norm_one, norm_mul] at hfactor0 have hBone := norm_blaschkeProduct_zero_le_one R a hR ha have hGone : 1 ≤ ‖g 0‖ := by nlinarith [norm_nonneg (blaschkeProduct R a 0), norm_nonneg (g 0)] have hlog := log_norm_ge_of_zero_free_ball g A R R1 hR hR1 hsmall hgAn hgzero hGupper hGone intro z hz have hzBall : z ∈ closedBall (0 : ℂ) R := by rw [mem_closedBall, dist_zero_right] exact hz.trans hsmall.le rw [hfactor z hzBall, norm_mul] rw [mul_comm (exp _) ‖blaschkeProduct R a z‖] apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) apply (Real.le_log_iff_exp_le (norm_pos_iff.mpr (hgzero z (by rw [mem_ball_zero_iff]; exact hz.trans_lt hsmall)))).1 exact hlog z hz
CausalSmith.Stat.SaPlmCumulantConverse.norm_lower_of_blaschke_factorization · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JensenBlaschke.lean:588
Helpers.JmsComparator 12 declarations Jin--Mackey--Syrgkanis ACE comparator

Jin--Mackey--Syrgkanis ACE comparator

The published estimator is indexed by its order, sample size, and the one fixed supplied treatment/outcome code pair for that experiment.

Definition (Lean source)
abbrev AceEstimator := ∀ (_r n : ℕ), (ℕ → Xspace → ℝ) → (ℕ → Xspace → ℝ) → Estimator (Xspace := Xspace) n

Citation interface for the single published order-r ACE procedure. The handle is supplied once at the cited boundary and then shared unchanged by both cited statements and all of their consumers.

Definition (Lean source)
Xspace :
Type*
estimator :
AceEstimator (Xspace := Xspace)
CausalSmith.Stat.SaPlmCumulantConverse.PublishedAceHandle · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JmsComparator.lean:23
def jmsA1

The first exponential-tilt scale of the published eligibility condition: twice the logarithm of six times the sum of the treatment-regression bound and the treatment sub-Gaussian scale, divided by the treatment-code accuracy budget at sample size n.

Definition (Lean source)
def jmsA1 (p : Parameters) (n : ℕ) : ℝ := 2 * log (6 * (p.Cg + p.psieta) * (p.eps1n n)⁻¹)
def jmsB1

The first budget quantity of the published eligibility condition: the logarithm of the effective sample size — the overlap exponent times n — divided by nine.

Definition (Lean source)
def jmsB1 (p : Parameters) (n : ℕ) : ℝ := log (p.gamma * n / 9) -- @realizes b1n(log(gamma*n/9))
def jmsA2

The second exponential-tilt scale of the published eligibility condition: four times the sum of the treatment-regression bound and the treatment sub-Gaussian scale.

Definition (Lean source)
def jmsA2 (p : Parameters) : ℝ := 4 * (p.Cg + p.psieta) -- @realizes a2(4(Cg+psieta))
def jmsB2

The second budget quantity of the published eligibility condition: two hundred times the smaller of one and the treatment-effect bound, times the cumulant separation, divided by the largest of the treatment-code budget, the outcome-code budget, and the parametric-rate noise level — the effective sample size to the power −1/2 times the sum of the outcome sub-Gaussian scale and the treatment-effect bound times the treatment sub-Gaussian scale.

Definition (Lean source)
def jmsB2 (p : Parameters) (n : ℕ) (delta : ℝ := p.delta) : ℝ := 200 * min 1 p.Ctheta * delta / max (p.eps1n n) (max (p.eps2n n) ((p.gamma * n) ^ (-1 / 2 : ℝ) * (p.psixi + p.Ctheta * p.psieta)))

Condition (21) evaluated at an explicitly supplied separation. This is the generalization used only by the shrinking-separation benchmark.

Definition (Lean source)
def jmsEligibleAt (p : Parameters) (n : ℕ) (delta : ℝ) : Prop := jmsA1 p n ≠ 0 ∧ 0 < jmsB1 p n / jmsA1 p n ∧ 0 < jmsA2 p * jmsB2 p n delta ∧ jmsA2 p * log (jmsA2 p * jmsB2 p n delta) ≠ 0 ∧ (p.r : ℝ) ≤ min (jmsB1 p n / jmsA1 p n - (jmsA1 p n)⁻¹ * log (jmsB1 p n / jmsA1 p n)) (jmsB2 p n delta / (jmsA2 p * log (jmsA2 p * jmsB2 p n delta)))
CausalSmith.Stat.SaPlmCumulantConverse.jmsEligibleAt · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JmsComparator.lean:66
def jmsEligible

Exact paper condition (21), evaluated at the model separation p.delta, with precisely the nonzero denominators and positive logarithm arguments needed for the displayed expression to be defined.

Definition (Lean source)
-- @node: def:jms-eligibility def jmsEligible (p : Parameters) (n : ℕ) : Prop := jmsEligibleAt p n p.delta

The published finite-order ACE error bound of Jin, Mackey and Syrgkanis: an overlap-dependent constant times the factorial of the expansion order, times sixteen to that order, divided by the cumulant separation, multiplied by the sum of three terms — the treatment-code budget raised to the expansion order times the outcome-code budget, the treatment-effect bound times the treatment-code budget raised to one plus the expansion order, and a nuisance-scale factor times the effective sample size to the power −1/2.

Definition (Lean source)
def jmsBound (p : Parameters) (n : ℕ) (Cgamma delta : ℝ) : ℝ := Cgamma * p.r.factorial * 16 ^ p.r * delta⁻¹ * ((p.eps1n n) ^ p.r * p.eps2n n + p.Ctheta * (p.eps1n n) ^ (p.r + 1) + 64 * (p.Cg + p.psieta) ^ p.r * (p.r ^ 2 * (p.Cg + p.psieta) + p.psixi + p.Ctheta * p.psieta) * (p.gamma * n) ^ (-1 / 2 : ℝ))

The published ACE class with its cumulant separation evaluated at an explicit value rather than at p.delta.

Definition (Lean source)
def JmsAceClassAt (p : Parameters) (n : ℕ) (m : Model (Xspace := Xspace) p) (delta : ℝ) : Prop := 1 ≤ n ∧ IndependentTreatmentNoise p m ∧ OutcomeMeanIndependence p m ∧ ThetaRange p m ∧ GRange p m ∧ QRange p m ∧ EtaSubGaussian p m ∧ XiSubGaussian p m ∧ |kappaEta p m| ≥ delta ∧ TreatmentCodeRadiusLrAt p m n ∧ OutcomeCodeRadiusLrAt p m n
def JmsAceQuantileUpper

Jikai Jin, Lester Mackey, and Vasilis Syrgkanis (2025), It is hard to be normal, Theorem 5.4, equations (21)--(22), arXiv:2507.02275v3: fixed-separation generalized-quantile upper bound for the estimator carried by the sealed published-procedure handle.

Definition (Lean source)
-- @node: lem:jms-ace-quantile-upper def JmsAceQuantileUpper (published : PublishedAceHandle Xspace) (gamma Cgamma : ℝ) : Prop := 0 < Cgamma ∧ -- @realizes Cgamma(positive constant depending only on gamma) ∀ (p : Parameters), p.gamma = gamma → 0 < p.eps1n p.n → 0 < p.eps2n p.n → ∀ (gcode qcode : ℕ → Xspace → ℝ) (m : Model (Xspace := Xspace) p), barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClass p p.n m → jmsEligible p p.n → generalizedQuantile p p.n m (fun data ↦ abs (published.estimator p.r p.n gcode qcode data - m.theta0)) ≤ jmsBound p p.n Cgamma p.delta
CausalSmith.Stat.SaPlmCumulantConverse.JmsAceQuantileUpper · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JmsComparator.lean:113

Jikai Jin, Lester Mackey, and Vasilis Syrgkanis (2025), It is hard to be normal, Theorem 5.4, equations (21)--(22), arXiv:2507.02275v3: the same bound for the estimator carried by the same sealed published-procedure handle, universally specialized to a positive separation constant.

Definition (Lean source)
-- @node: lem:jms-ace-theorem-five-four def JmsAceTheoremFiveFour (published : PublishedAceHandle Xspace) (gamma Cgamma : ℝ) : Prop := 0 < Cgamma ∧ ∀ (p : Parameters), p.gamma = gamma → ∀ delta : ℝ, 0 < delta → 0 < p.eps1n p.n → 0 < p.eps2n p.n → ∀ (gcode qcode : ℕ → Xspace → ℝ) (m : Model (Xspace := Xspace) p), barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClassAt p p.n m delta → jmsEligibleAt p p.n delta → generalizedQuantile p p.n m (fun data ↦ abs (published.estimator p.r p.n gcode qcode data - m.theta0)) ≤ jmsBound p p.n Cgamma delta
CausalSmith.Stat.SaPlmCumulantConverse.JmsAceTheoremFiveFour · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/JmsComparator.lean:134
Helpers.KnownZeroConditional 3 declarations Conditional annihilation for known-zero instruments

Conditional annihilation for known-zero instruments

theorem treatmentMGF_iteratedDeriv_eq_zero_of_lt_order Lemma treatmentMGF_iteratedDeriv_eq_zero_of_lt_order in the paper ↗

All transform derivatives below a positive analytic zero order vanish.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hmult :
∀ j < ell, iteratedDeriv j (treatmentMGF p m) z0 = 0
Proof (Lean source)
lemma treatmentMGF_iteratedDeriv_eq_zero_of_lt_order (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : ∀ j < ell, iteratedDeriv j (treatmentMGF p m) z0 = 0 := by have hset : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] have hzmem : z0.re ∈ interior (integrableExpSet (eta p m) m.P) := by simp [hset] have han : AnalyticAt ℂ (treatmentMGF p m) z0 := analyticAt_complexMGF hzmem have hfinite : analyticOrderAt (treatmentMGF p m) z0 ≠ ⊤ := by intro htop have hzero : analyticOrderNatAt (treatmentMGF p m) z0 = 0 := by simp [analyticOrderNatAt, htop] rw [hmult] at hzero omega intro j hj apply (natCast_le_analyticOrderAt_iff_iteratedDeriv_eq_zero han).mp (show (↑ell : ℕ∞) ≤ analyticOrderAt (treatmentMGF p m) z0 by rw [← Nat.cast_analyticOrderNatAt hfinite, hmult]) j hj
CausalSmith.Stat.SaPlmCumulantConverse.treatmentMGF_iteratedDeriv_eq_zero_of_lt_order · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroConditional.lean:15
theorem zeroInstrument_integral_add_eq_zero Lemma zeroInstrument_integral_add_eq_zero in the paper ↗

A transform zero of order ell annihilates its polynomial-exponential instrument after every deterministic real shift.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
d :
∫ o, zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult ((eta p m o + d : ℝ) : ℂ) ∂m.P
= 0
Proof (Lean source)
lemma zeroInstrument_integral_add_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) (d : ℝ) : ∫ o, zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult ((eta p m o + d : ℝ) : ℂ) ∂m.P = 0 := by have hset : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] have hzmem : z0.re ∈ interior (integrableExpSet (eta p m) m.P) := by simp [hset] have hzero := treatmentMGF_iteratedDeriv_eq_zero_of_lt_order p m n ell hclass z0 hell hmult simp only [zeroInstrument] have hfun : ∀ o, (((eta p m o + d : ℝ) : ℂ) ^ (ell - 1) * exp (z0 * ((eta p m o + d : ℝ) : ℂ))) = exp (z0 * d) * ∑ j ∈ range ell, ((ell - 1).choose j : ℂ) * (d : ℂ) ^ (ell - 1 - j) * ((eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ))) := by intro o rw [show ((eta p m o + d : ℝ) : ℂ) = (eta p m o : ℂ) + d by push_cast; rfl, add_pow, Finset.sum_mul] rw [show exp (z0 * ((eta p m o : ℂ) + d)) = exp (z0 * d) * exp (z0 * (eta p m o : ℂ)) by rw [mul_add, Complex.exp_add]; ring] rw [Finset.mul_sum, Nat.sub_add_cancel hell] apply Finset.sum_congr rfl intro j hj rw [Finset.mem_range] at hj ring rw [integral_congr_ae (Filter.Eventually.of_forall hfun)] rw [show (∫ o, exp (z0 * d) * (∑ j ∈ range ell, ((ell - 1).choose j : ℂ) * (d : ℂ) ^ (ell - 1 - j) * ((eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ)))) ∂m.P) = exp (z0 * d) * ∫ o, (∑ j ∈ range ell, ((ell - 1).choose j : ℂ) * (d : ℂ) ^ (ell - 1 - j) * ((eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ)))) ∂m.P by exact integral_const_mul _ _] have hint (j : ℕ) : Integrable (fun o ↦ (eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ))) m.P := integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzmem j rw [integral_finset_sum] · apply mul_eq_zero_of_right apply Finset.sum_eq_zero intro i hi calc _ = (((ell - 1).choose i : ℂ) * (d : ℂ) ^ (ell - 1 - i)) * ∫ a, ((eta p m a : ℂ) ^ i * exp (z0 * (eta p m a : ℂ))) ∂m.P := by exact integral_const_mul _ _ _ = 0 := by apply mul_eq_zero_of_right rw [← iteratedDeriv_complexMGF hzmem] exact hzero i (Finset.mem_range.mp hi) · intro j hj exact (hint j).const_mul _
CausalSmith.Stat.SaPlmCumulantConverse.zeroInstrument_integral_add_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroConditional.lean:39
theorem zeroInstrument_condExp_learnedResidual_eq_zero Lemma zeroInstrument_condExp_learnedResidual_eq_zero in the paper ↗

For a model in the broad non-Gaussian class and a complex point where the treatment-noise moment generating function vanishes to a known order that is at least one, the transform-zero instrument evaluated at the observable learned residual has conditional mean zero given the covariates, almost surely.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
(@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)))
=ᵐ[m.P] 0
Proof (Lean source)
lemma zeroInstrument_condExp_learnedResidual_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : (@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o))) =ᵐ[m.P] 0 := by let J : Obs Xspace → ℂ := fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) have hset : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] have hzmem : z0.re ∈ interior (integrableExpSet (eta p m) m.P) := by simp [hset] have hzero := treatmentMGF_iteratedDeriv_eq_zero_of_lt_order p m n ell hclass z0 hell hmult have hJint : Integrable J m.P := by have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hzZ : z0.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] simpa [J, zeroInstrument] using integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzZ (ell - 1) have hmle : comap covariate inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := Measurable.comap_le measurable_fst have hcond : (0 : Obs Xspace → ℂ) =ᵐ[m.P] @condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P J := by apply MeasureTheory.ae_eq_condExp_of_forall_setIntegral_eq hmle hJint · intro s hs hfin exact integrableOn_zero · intro s hs hfin change (∫ _x in s, (0 : ℂ) ∂m.P) = ∫ x in s, J x ∂m.P rw [integral_zero] symm rcases hs with ⟨t, ht, rfl⟩ rw [show ∫ o in covariate ⁻¹' t, J o ∂m.P = ∫ o, J o * (indicator t (fun _ ↦ (1 : ℂ))) (covariate o) ∂m.P by rw [← integral_indicator (hmle _ (show MeasurableSet[comap covariate inferInstance] (covariate ⁻¹' t) from ⟨t, ht, rfl⟩))] apply integral_congr_ae filter_upwards [] with o by_cases ho : covariate o ∈ t <;> simp [indicator, ho]] have hfun : ∀ o, J o * (indicator t (fun _ ↦ (1 : ℂ))) (covariate o) = ∑ j ∈ range ell, ((eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ))) * (((ell - 1).choose j : ℂ) * (treatmentError p m n o : ℂ) ^ (ell - 1 - j) * exp (z0 * (treatmentError p m n o : ℂ)) * (indicator t (fun _ ↦ (1 : ℂ))) (covariate o)) := by intro o dsimp [J, zeroInstrument] rw [show learnedResidual p m n o = eta p m o + treatmentError p m n o by simp [learnedResidual, eta, treatmentError]] push_cast rw [add_pow] rw [show exp (z0 * ((eta p m o : ℂ) + (treatmentError p m n o : ℂ))) = exp (z0 * (eta p m o : ℂ)) * exp (z0 * (treatmentError p m n o : ℂ)) by rw [mul_add, Complex.exp_add]] rw [Nat.sub_add_cancel hell] simp only [Finset.sum_mul] apply Finset.sum_congr rfl intro j hj ring rw [integral_congr_ae (Filter.Eventually.of_forall hfun), integral_finset_sum] · apply Finset.sum_eq_zero intro j hj have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hD : Measurable (fun x : Xspace ↦ m.g0 x - barG p m n x) := m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hDc : Measurable (fun x : Xspace ↦ ((m.g0 x - barG p m n x : ℝ) : ℂ)) := by change Measurable (Complex.ofReal ∘ fun x : Xspace ↦ m.g0 x - barG p m n x) exact Complex.measurable_ofReal.comp hD have hgmeas : Measurable (fun x : Xspace ↦ ((ell - 1).choose j : ℂ) * ((m.g0 x - barG p m n x : ℝ) : ℂ) ^ (ell - 1 - j) * exp (z0 * ((m.g0 x - barG p m n x : ℝ) : ℂ)) * indicator t (fun _ ↦ (1 : ℂ)) x) := by apply mul · exact ((measurable_const.mul (hDc.pow_const (ell - 1 - j))).mul (Complex.continuous_exp.measurable.comp (measurable_const.mul hDc))) · exact measurable_const.indicator ht have hind := hclass.independentTreatmentNoise.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ (e : ℂ) ^ j * exp (z0 * (e : ℂ))) (g := fun x : Xspace ↦ ((ell - 1).choose j : ℂ) * ((m.g0 x - barG p m n x : ℝ) : ℂ) ^ (ell - 1 - j) * exp (z0 * ((m.g0 x - barG p m n x : ℝ) : ℂ)) * indicator t (fun _ ↦ (1 : ℂ)) x) heta.aemeasurable hX.aemeasurable (by fun_prop) hgmeas.aestronglyMeasurable rw [show (∫ o, ((eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ))) * (((ell - 1).choose j : ℂ) * (treatmentError p m n o : ℂ) ^ (ell - 1 - j) * exp (z0 * (treatmentError p m n o : ℂ)) * indicator t (fun _ ↦ (1 : ℂ)) (covariate o)) ∂m.P) = (∫ o, (eta p m o : ℂ) ^ j * exp (z0 * (eta p m o : ℂ)) ∂m.P) * ∫ o, ((ell - 1).choose j : ℂ) * (treatmentError p m n o : ℂ) ^ (ell - 1 - j) * exp (z0 * (treatmentError p m n o : ℂ)) * indicator t (fun _ ↦ (1 : ℂ)) (covariate o) ∂m.P by simpa [treatmentError] using hind] apply mul_eq_zero_of_left rw [← iteratedDeriv_complexMGF hzmem] exact hzero j (Finset.mem_range.mp hj) · intro j hj have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hDmeas : Measurable (fun x : Xspace ↦ m.g0 x - barG p m n x) := m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hDc : Measurable (fun x : Xspace ↦ ((m.g0 x - barG p m n x : ℝ) : ℂ)) := by change Measurable (Complex.ofReal ∘ fun x : Xspace ↦ m.g0 x - barG p m n x) exact Complex.measurable_ofReal.comp hDmeas let f : ℝ → ℂ := fun e ↦ (e : ℂ) ^ j * exp (z0 * (e : ℂ)) let g : Xspace → ℂ := fun x ↦ ((ell - 1).choose j : ℂ) * ((m.g0 x - barG p m n x : ℝ) : ℂ) ^ (ell - 1 - j) * exp (z0 * ((m.g0 x - barG p m n x : ℝ) : ℂ)) * indicator t (fun _ ↦ (1 : ℂ)) x have hfint : Integrable (fun o ↦ f (eta p m o)) m.P := by simpa [f] using integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzmem j have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hDae : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg0 := MeasureTheory.ae_of_ae_map hX.aemeasurable hclass.gRange filter_upwards [hg0] with o ho dsimp [treatmentError] calc |m.g0 (covariate o) - barG p m n (covariate o)| ≤ |m.g0 (covariate o)| + |barG p m n (covariate o)| := abs_sub _ _ _ ≤ p.Cg + p.Cg := add_le_add ho (hbar _) _ = 2 * p.Cg := by ring have hgmeas : Measurable g := by dsimp [g] apply mul · exact ((measurable_const.mul (hDc.pow_const (ell - 1 - j))).mul (Complex.continuous_exp.measurable.comp (measurable_const.mul hDc))) · exact measurable_const.indicator ht have hgint : Integrable (fun o ↦ g (covariate o)) m.P := by have hbound : ∀ᵐ o ∂m.P, ‖g (covariate o)‖ ≤ ((ell - 1).choose j : ℝ) * (2 * p.Cg) ^ (ell - 1 - j) * exp (‖z0‖ * (2 * p.Cg)) := by filter_upwards [hDae] with o hDo dsimp [g] by_cases hot : covariate o ∈ t · rw [Set.indicator_of_mem hot] simp only [mul_one, norm_mul, Complex.norm_natCast, Complex.norm_pow, Complex.norm_real, Real.norm_eq_abs, Complex.norm_exp] have hCg0 : 0 ≤ 2 * p.Cg := mul_nonneg (by norm_num) p.constants_pos.2.1.le have hpw := pow_le_pow_left₀ (abs_nonneg (treatmentError p m n o)) hDo (ell - 1 - j) have hexp : exp ((z0 * (treatmentError p m n o : ℂ)).re) ≤ exp (‖z0‖ * (2 * p.Cg)) := by apply Real.exp_le_exp.mpr calc (z0 * (treatmentError p m n o : ℂ)).re ≤ |(z0 * (treatmentError p m n o : ℂ)).re| := le_abs_self _ _ ≤ ‖z0 * (treatmentError p m n o : ℂ)‖ := Complex.abs_re_le_norm _ _ = ‖z0‖ * |treatmentError p m n o| := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] _ ≤ ‖z0‖ * (2 * p.Cg) := mul_le_mul_of_nonneg_left hDo (norm_nonneg z0) simpa [treatmentError, mul_assoc] using mul_le_mul_of_nonneg_left (mul_le_mul hpw hexp (Real.exp_pos _).le (pow_nonneg hCg0 _)) (show (0 : ℝ) ≤ ((ell - 1).choose j : ℝ) from Nat.cast_nonneg _) · rw [Set.indicator_of_notMem hot, mul_zero, norm_zero] exact mul_nonneg (mul_nonneg (Nat.cast_nonneg _) (pow_nonneg (mul_nonneg (by norm_num) p.constants_pos.2.1.le) _)) (Real.exp_pos _).le have hg1 := (integrable_const (μ := m.P) (1 : ℂ)).bdd_mul (c := ((ell - 1).choose j : ℝ) * (2 * p.Cg) ^ (ell - 1 - j) * exp (‖z0‖ * (2 * p.Cg))) (hgmeas.comp hX).aestronglyMeasurable hbound simpa only [Pi.mul_apply, mul_one, Function.comp_def] using hg1 have hfg := (hclass.independentTreatmentNoise.comp (by fun_prop : Measurable f) hgmeas).integrable_mul hfint hgint exact hfg · exact aestronglyMeasurable_zero exact hcond.symm
CausalSmith.Stat.SaPlmCumulantConverse.zeroInstrument_condExp_learnedResidual_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroConditional.lean:99
Helpers.KnownZeroOrthogonality 4 declarations Moment and outcome assembly for known-zero instruments

Moment and outcome assembly for known-zero instruments

theorem zeroInstrument_learnedResidual_integral_eq Lemma zeroInstrument_learnedResidual_integral_eq in the paper ↗

For a law in the paper's non-Gaussian class, at a point where the moment generating function of the treatment noise vanishes with multiplicity exactly the given order, that order being at least one, the expected product of the observable learned residual with the zero instrument evaluated at that residual equals the derivative of that order of the treatment-noise transform at the point, times the transform of the treatment-code error at the same point.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P
= iteratedDeriv ell (treatmentMGF p m) z0 * nuisanceMGF p m n z0
Proof (Lean source)
lemma zeroInstrument_learnedResidual_integral_eq (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : ∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = iteratedDeriv ell (treatmentMGF p m) z0 * nuisanceMGF p m n z0 := by have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hzZ : z0.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] have hDset : integrableExpSet (treatmentError p m n) m.P = univ := by have hDmeas : Measurable (treatmentError p m n) := by unfold treatmentError covariate barG exact (m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const)).comp measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD : ∀ᵐ o ∂m.P, treatmentError p m n o ∈ Icc (-2 * p.Cg) (2 * p.Cg) := by have hg := MeasureTheory.ae_of_ae_map measurable_fst.aemeasurable hclass.gRange filter_upwards [hg] with o ho rw [Set.mem_Icc] have hb : |treatmentError p m n o| ≤ 2 * p.Cg := by dsimp [treatmentError] calc |m.g0 (covariate o) - barG p m n (covariate o)| ≤ |m.g0 (covariate o)| + |barG p m n (covariate o)| := abs_sub _ _ _ ≤ p.Cg + p.Cg := add_le_add ho (hbar _) _ = 2 * p.Cg := by ring rw [abs_le] at hb simpa only [neg_mul] using hb ext t simp [integrableExpSet, integrable_exp_mul_of_mem_Icc hDmeas.aemeasurable hD] have hMset : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] have hMan : AnalyticAt ℂ (treatmentMGF p m) z0 := analyticAt_complexMGF (by simp [hMset]) have hHan : AnalyticAt ℂ (nuisanceMGF p m n) z0 := analyticAt_complexMGF (by simp [hDset]) have hzero := treatmentMGF_iteratedDeriv_eq_zero_of_lt_order p m n ell hclass z0 hell hmult rw [show (∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P) = iteratedDeriv ell (residualMGF p m n) z0 by unfold residualMGF rw [iteratedDeriv_complexMGF hzZ] apply integral_congr_ae filter_upwards [] with o simp only [zeroInstrument] rw [← mul_assoc, ← pow_succ'] congr 2 omega] rw [show residualMGF p m n = treatmentMGF p m * nuisanceMGF p m n by funext z exact residualMGF_eq_treatmentMGF_mul_nuisanceMGF p m n hclass z] rw [iteratedDeriv_mul hMan.contDiffAt hHan.contDiffAt] rw [Finset.sum_eq_single ell] · simp · intro j hj hjne have hjlt : j < ell := by have := Finset.mem_range.mp hj omega simp [hzero j hjlt] · simp
CausalSmith.Stat.SaPlmCumulantConverse.zeroInstrument_learnedResidual_integral_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroOrthogonality.lean:15
theorem outcomeNoise_zeroInstrument_integrable_and_integral_eq_zero Lemma outcomeNoise_zeroInstrument_integrable_and_integral_eq_zero in the paper ↗

For a law in the paper's non-Gaussian class, at a point where the moment generating function of the treatment noise vanishes with multiplicity exactly the given order, that order being at least one, the product of the outcome noise with the zero instrument evaluated at the observable learned residual is integrable and has expectation zero.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
Integrable (fun o ↦ (xi p m o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)) m.P ∧
∫ o, (xi p m o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P
= 0
Proof (Lean source)
lemma outcomeNoise_zeroInstrument_integrable_and_integral_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : Integrable (fun o ↦ (xi p m o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)) m.P ∧ ∫ o, (xi p m o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = 0 := by let J : Obs Xspace → ℂ := fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) have hxiSet : integrableExpSet (xi p m) m.P = univ := by ext t simp [integrableExpSet, xi_integrable_exp p m n hclass t] have hxi2 : MemLp (xi p m) 2 m.P := by apply memLp_of_mem_interior_integrableExpSet simp [hxiSet] have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hZmeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) have hJ2 : MemLp J 2 m.P := by rw [memLp_two_iff_integrable_sq_norm (by dsimp [J, zeroInstrument] exact (((Complex.measurable_ofReal.comp hZmeas).pow_const _).mul (Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp hZmeas)))).aestronglyMeasurable)] have hz2 : 2 * z0.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] have hK := integrable_pow_abs_mul_exp_of_mem_interior_integrableExpSet hz2 (2 * (ell - 1)) apply hK.congr filter_upwards [] with o dsimp [J, zeroInstrument] simp only [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs, Complex.norm_exp] rw [sq] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] calc |learnedResidual p m n o| ^ (2 * (ell - 1)) * exp (2 * z0.re * learnedResidual p m n o) = (|learnedResidual p m n o| ^ (ell - 1) * |learnedResidual p m n o| ^ (ell - 1)) * (exp (z0.re * learnedResidual p m n o) * exp (z0.re * learnedResidual p m n o)) := by rw [← pow_add, ← Real.exp_add] congr 2 <;> ring _ = _ := by ring have hprod : Integrable (fun o ↦ (xi p m o : ℂ) * J o) m.P := hxi2.ofReal.integrable_mul hJ2 refine ⟨hprod, ?_⟩ have hZxT : Measurable[xTSigma (Xspace := Xspace)] (learnedResidual p m n) := by change Measurable[comap (fun o : Obs Xspace ↦ (covariate o, treatment o)) inferInstance] (learnedResidual p m n) have h : Measurable (fun xt : Xspace × ℝ ↦ xt.2 - barG p m n xt.1) := measurable_snd.sub ((((m.gcode_measurable n).comp measurable_fst).max measurable_const).min measurable_const) exact h.comp (comap_measurable (fun o : Obs Xspace ↦ (covariate o, treatment o))) have hJre : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o ↦ (J o).re) := by apply Measurable.stronglyMeasurable dsimp [J, zeroInstrument] fun_prop have hJim : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o ↦ (J o).im) := by apply Measurable.stronglyMeasurable dsimp [J, zeroInstrument] fun_prop have hzero (w : Obs Xspace → ℝ) (hw : StronglyMeasurable[xTSigma (Xspace := Xspace)] w) (hprodw : Integrable (fun o ↦ xi p m o * w o) m.P) : ∫ o, xi p m o * w o ∂m.P = 0 := by have hpull := MeasureTheory.condExp_mul_of_stronglyMeasurable_right (μ := m.P) (m := xTSigma (Xspace := Xspace)) hw hprodw hclass.outcomeMeanIndependence.1 calc ∫ o, xi p m o * w o ∂m.P = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun o ↦ xi p m o * w o)) o ∂m.P := by rw [MeasureTheory.integral_condExp (show xTSigma (Xspace := Xspace) ≤ (inferInstance : MeasurableSpace (Obs Xspace)) from comap_le (measurable_fst.prodMk measurable_snd.fst))] _ = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (xi p m)) o * w o ∂m.P := integral_congr_ae hpull _ = 0 := by apply integral_eq_zero_of_ae filter_upwards [hclass.outcomeMeanIndependence.2] with o ho simp [ho] apply Complex.ext · change (∫ o, (xi p m o : ℂ) * J o ∂m.P).re = 0 calc _ = ∫ o, ((xi p m o : ℂ) * J o).re ∂m.P := by simpa only [RCLike.re_eq_complex_re] using (integral_re hprod).symm _ = ∫ o, xi p m o * (J o).re ∂m.P := by simp _ = 0 := hzero (fun o ↦ (J o).re) hJre (by simpa using hprod.re) · change (∫ o, (xi p m o : ℂ) * J o ∂m.P).im = 0 calc _ = ∫ o, ((xi p m o : ℂ) * J o).im ∂m.P := by simpa only [RCLike.im_eq_complex_im] using (integral_im hprod).symm _ = ∫ o, xi p m o * (J o).im ∂m.P := by simp _ = 0 := hzero (fun o ↦ (J o).im) hJim (by simpa using hprod.im)
CausalSmith.Stat.SaPlmCumulantConverse.outcomeNoise_zeroInstrument_integrable_and_integral_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroOrthogonality.lean:99
theorem contamination_zeroInstrument_integrable_and_integral_eq_zero Lemma contamination_zeroInstrument_integrable_and_integral_eq_zero in the paper ↗

For a law in the paper's non-Gaussian class, at a point where the moment generating function of the treatment noise vanishes with multiplicity exactly the given order, that order being at least one, the product of the outcome-side contamination, a function of the covariate alone, with the zero instrument evaluated at the observable learned residual is integrable and has expectation zero.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
Integrable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)) m.P ∧
∫ o, (outcomeContamination p m n (covariate o) : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P
= 0
Proof (Lean source)
lemma contamination_zeroInstrument_integrable_and_integral_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : Integrable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)) m.P ∧ ∫ o, (outcomeContamination p m n (covariate o) : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = 0 := by let J : Obs Xspace → ℂ := fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) let b : Obs Xspace → ℂ := fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hzZ : z0.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] have hJint : Integrable J m.P := by simpa [J, zeroInstrument] using integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzZ (ell - 1) have hDmeas : Measurable (fun x : Xspace ↦ m.g0 x - barG p m n x) := m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hbX : Measurable (fun x : Xspace ↦ (outcomeContamination p m n x : ℂ)) := by exact Complex.measurable_ofReal.comp (m.q0_measurable.sub (measurable_const.mul hDmeas)) have hb : Measurable b := hbX.comp measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hbBound : ∀ᵐ o ∂m.P, ‖b o‖ ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hq := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.qRange have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hq, hg] with o hqo hgo rw [show ‖b o‖ = |m.q0 (covariate o) - m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))| by dsimp [b, outcomeContamination] rw [Complex.norm_real, Real.norm_eq_abs]] calc _ ≤ |m.q0 (covariate o)| + |m.theta0| * |m.g0 (covariate o) - barG p m n (covariate o)| := by simpa [abs_mul] using abs_sub (m.q0 (covariate o)) (m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))) _ ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by apply add_le_add hqo have hmul := mul_le_mul hclass.thetaRange ((abs_sub _ _).trans (add_le_add hgo (hbar (covariate o)))) (abs_nonneg _) p.constants_pos.1.le convert hmul using 1 <;> ring have hbJ : Integrable (fun o ↦ b o * J o) m.P := hJint.bdd_mul hb.aestronglyMeasurable hbBound refine ⟨by simpa [b, J] using hbJ, ?_⟩ have hmle : comap covariate inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := Measurable.comap_le measurable_fst let br : Obs Xspace → ℝ := fun o ↦ outcomeContamination p m n (covariate o) have hbrsub : StronglyMeasurable[comap covariate inferInstance] br := by apply Measurable.stronglyMeasurable exact (m.q0_measurable.sub (measurable_const.mul hDmeas)).comp (comap_measurable covariate) have hcondJ := zeroInstrument_condExp_learnedResidual_eq_zero p m n ell hclass z0 hell hz hmult have hcondRe : (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ (J o).re)) =ᵐ[m.P] 0 := by have hcomm := Complex.reCLM.comp_condExp_comm (m := comap covariate inferInstance) hJint filter_upwards [hcondJ, hcomm] with o hJo hco change Complex.reCLM (@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P J o) = (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ (J o).re)) o at hco rw [hJo] at hco exact hco.symm have hcondIm : (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ (J o).im)) =ᵐ[m.P] 0 := by have hcomm := Complex.imCLM.comp_condExp_comm (m := comap covariate inferInstance) hJint filter_upwards [hcondJ, hcomm] with o hJo hco change Complex.imCLM (@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P J o) = (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ (J o).im)) o at hco rw [hJo] at hco exact hco.symm have hzero (w : Obs Xspace → ℝ) (hw : Integrable w m.P) (hbrw : Integrable (fun o ↦ br o * w o) m.P) (hcw : (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P w) =ᵐ[m.P] 0) : ∫ o, br o * w o ∂m.P = 0 := by have hpull := MeasureTheory.condExp_mul_of_stronglyMeasurable_left (μ := m.P) (m := comap covariate inferInstance) hbrsub hbrw hw calc ∫ o, br o * w o ∂m.P = ∫ o, (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ br o * w o)) o ∂m.P := by rw [MeasureTheory.integral_condExp hmle] _ = ∫ o, br o * (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P w) o ∂m.P := integral_congr_ae hpull _ = 0 := by apply integral_eq_zero_of_ae filter_upwards [hcw] with o ho simp [ho] apply Complex.ext · change (∫ o, b o * J o ∂m.P).re = 0 calc _ = ∫ o, (b o * J o).re ∂m.P := by simpa only [RCLike.re_eq_complex_re] using (integral_re hbJ).symm _ = ∫ o, br o * (J o).re ∂m.P := by apply integral_congr_ae filter_upwards [] with o simp [b, br] _ = 0 := hzero (fun o ↦ (J o).re) hJint.re (by simpa [b, br] using hbJ.re) hcondRe · change (∫ o, b o * J o ∂m.P).im = 0 calc _ = ∫ o, (b o * J o).im ∂m.P := by simpa only [RCLike.im_eq_complex_im] using (integral_im hbJ).symm _ = ∫ o, br o * (J o).im ∂m.P := by apply integral_congr_ae filter_upwards [] with o simp [b, br] _ = 0 := hzero (fun o ↦ (J o).im) hJint.im (by simpa [b, br] using hbJ.im) hcondIm
CausalSmith.Stat.SaPlmCumulantConverse.contamination_zeroInstrument_integrable_and_integral_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroOrthogonality.lean:218
theorem outcome_zeroInstrument_integral_eq_theta_mul Lemma outcome_zeroInstrument_integral_eq_theta_mul in the paper ↗

For a law in the paper's non-Gaussian class, at a point where the moment generating function of the treatment noise vanishes with multiplicity exactly the given order, that order being at least one, the expected product of the outcome with the zero instrument evaluated at the observable learned residual equals the treatment-effect parameter times the expected product of that residual with the same instrument.

Formal statement
m :
Model (Xspace := Xspace) p
n ell :
hclass :
z0 :
hell :
1 ≤ ell
hz :
treatmentMGF p m z0 = 0
hmult :
∫ o, (outcome o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P
= (m.theta0 : ℂ) * ∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P
Proof (Lean source)
lemma outcome_zeroInstrument_integral_eq_theta_mul (p : Parameters) (m : Model (Xspace := Xspace) p) (n ell : ℕ) (hclass : NonGaussianClass p n m) (z0 : ℂ) (hell : 1 ≤ ell) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : ∫ o, (outcome o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = (m.theta0 : ℂ) * ∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P := by let J : Obs Xspace → ℂ := fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hzZ : z0.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] have hZJ : Integrable (fun o ↦ (learnedResidual p m n o : ℂ) * J o) m.P := by have hbase := integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzZ ell apply hbase.congr filter_upwards [] with o dsimp [J, zeroInstrument] rw [← mul_assoc, ← pow_succ'] congr 2 omega have hbJ := contamination_zeroInstrument_integrable_and_integral_eq_zero p m n ell hclass z0 hell hz hmult have hxiJ := outcomeNoise_zeroInstrument_integrable_and_integral_eq_zero p m n ell hclass z0 hell hz hmult have hbJ' : Integrable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) * J o) m.P := by simpa [J] using hbJ.1 have hxiJ' : Integrable (fun o ↦ (xi p m o : ℂ) * J o) m.P := by simpa [J] using hxiJ.1 have hthetaZJ : Integrable (fun o ↦ (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * J o)) m.P := hZJ.const_mul _ calc ∫ o, (outcome o : ℂ) * J o ∂m.P = ∫ o, ((m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * J o) + (outcomeContamination p m n (covariate o) : ℂ) * J o) + (xi p m o : ℂ) * J o ∂m.P := by apply integral_congr_ae filter_upwards [] with o congr 1 simp only [learnedResidual, outcomeContamination, xi, eta, treatment, outcome, covariate] push_cast ring _ = (∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * J o) + (outcomeContamination p m n (covariate o) : ℂ) * J o ∂m.P) + ∫ o, (xi p m o : ℂ) * J o ∂m.P := by convert integral_add (hthetaZJ.add hbJ') hxiJ' using 1 <;> simp [Pi.add_apply] _ = (∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * J o) ∂m.P) + (∫ o, (outcomeContamination p m n (covariate o) : ℂ) * J o ∂m.P) + ∫ o, (xi p m o : ℂ) * J o ∂m.P := by rw [integral_add hthetaZJ hbJ'] _ = (m.theta0 : ℂ) * ∫ o, (learnedResidual p m n o : ℂ) * J o ∂m.P := by rw [show (∫ o, (outcomeContamination p m n (covariate o) : ℂ) * J o ∂m.P) = 0 by simpa [J] using hbJ.2, show (∫ o, (xi p m o : ℂ) * J o ∂m.P) = 0 by simpa [J] using hxiJ.2, add_zero, add_zero] exact integral_const_mul _ _
CausalSmith.Stat.SaPlmCumulantConverse.outcome_zeroInstrument_integral_eq_theta_mul · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/KnownZeroOrthogonality.lean:359
Helpers.LuxemburgMGF 2 declarations This file supplies the real-variable estimate used by transform-zero localization.

A Luxemburg square-exponential bound implies a global MGF bound

This file supplies the real-variable estimate used by transform-zero localization. A centered random variable whose square-exponential moment is at most two has all real exponential moments, with an explicit quadratic MGF envelope.

theorem integrable_exp_mul_of_luxemburg_sq

A square-exponential envelope gives integrability of every real exponential tilt.

Formal statement
:
0 < ψ
hXmeas :
hLuxInt :
Integrable (fun ω ↦ exp (X ω ^ 2 / ψ ^ 2)) μ
t :
Integrable (fun ω ↦ exp (t * X ω)) μ
Proof (Lean source)
lemma integrable_exp_mul_of_luxemburg_sq (hψ : 0 < ψ) (hXmeas : Measurable X) (hLuxInt : Integrable (fun ω ↦ exp (X ω ^ 2 / ψ ^ 2)) μ) (t : ℝ) : Integrable (fun ω ↦ exp (t * X ω)) μ := by apply (hLuxInt.mul_const (exp (t ^ 2 * ψ ^ 2 / 4))).mono' ((Real.continuous_exp.measurable.comp (measurable_const.fun_mul hXmeas)).aestronglyMeasurable) filter_upwards [] with ω simp only [Function.comp_apply] rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), ← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare : 0 ≤ X ω ^ 2 / ψ ^ 2 + t ^ 2 * ψ ^ 2 / 4 - t * X ω := by have h := sq_nonneg (X ω / ψ - t * ψ / 2) field_simp [hψ.ne'] at h ⊢ nlinarith linarith
CausalSmith.Stat.SaPlmCumulantConverse.integrable_exp_mul_of_luxemburg_sq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/LuxemburgMGF.lean:69
theorem integral_exp_mul_le_exp_four_mul_sq_of_luxemburg Lemma 2 in the paper ↗

A centered Luxemburg square-exponential bound implies the global MGF estimate E exp(tX) ≤ exp(4 ψ²t²).

Formal statement
:
0 < ψ
hXmeas :
hXint :
hLuxInt :
Integrable (fun ω ↦ exp (X ω ^ 2 / ψ ^ 2)) μ
hLux :
∫ ω, exp (X ω ^ 2 / ψ ^ 2) ∂μ ≤ 2
hcenter :
∫ ω, X ω ∂μ = 0
t :
∫ ω, exp (t * X ω) ∂μ ≤ exp (4 * ψ ^ 2 * t ^ 2)
Proof (Lean source)
lemma integral_exp_mul_le_exp_four_mul_sq_of_luxemburg [IsProbabilityMeasure μ] (hψ : 0 < ψ) (hXmeas : Measurable X) (hXint : Integrable X μ) (hLuxInt : Integrable (fun ω ↦ exp (X ω ^ 2 / ψ ^ 2)) μ) (hLux : ∫ ω, exp (X ω ^ 2 / ψ ^ 2) ∂μ ≤ 2) (hcenter : ∫ ω, X ω ∂μ = 0) (t : ℝ) : ∫ ω, exp (t * X ω) ∂μ ≤ exp (4 * ψ ^ 2 * t ^ 2) := by let s : ℝ := t * ψ by_cases hsmall : |s| ≤ 1 · have hs_nonneg : 0 ≤ s ^ 2 := sq_nonneg s have hs_le : s ^ 2 ≤ 1 := by have := mul_self_le_mul_self (abs_nonneg s) hsmall nlinarith [sq_abs s] have hremInt : Integrable (fun ω ↦ 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2)) μ := hLuxInt.const_mul (2 * s ^ 2) have hpoint : ∀ ω, exp (t * X ω) ≤ 1 + t * X ω + 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2) := by intro ω let y : ℝ := X ω / ψ have htx : t * X ω = s * y := by dsimp [s, y] field_simp [hψ.ne'] have habs : |s * y| ≤ (1 + y ^ 2) / 2 := by calc |s * y| = |s| * |y| := abs_mul _ _ _ ≤ (s ^ 2 + y ^ 2) / 2 := by rw [← sq_abs s, ← sq_abs y] nlinarith [sq_nonneg (|s| - |y|)] _ ≤ (1 + y ^ 2) / 2 := by linarith have hbase := exp_le_one_add_add_sq_mul_exp_abs (s * y) have hexp : exp |s * y| ≤ exp ((1 + y ^ 2) / 2) := Real.exp_le_exp.mpr habs have hyexp : y ^ 2 * exp ((1 + y ^ 2) / 2) ≤ 2 * exp (y ^ 2) := by rw [show (1 + y ^ 2) / 2 = (1 / 2 : ℝ) + y ^ 2 / 2 by ring, Real.exp_add] have hy := sq_le_exp_half_sq y have hp0 : 0 ≤ exp (1 / 2 : ℝ) := Real.exp_nonneg _ have hp1 : 0 ≤ exp (y ^ 2 / 2) := Real.exp_nonneg _ calc y ^ 2 * (exp (1 / 2 : ℝ) * exp (y ^ 2 / 2)) ≤ exp (y ^ 2 / 2) * (exp (1 / 2 : ℝ) * exp (y ^ 2 / 2)) := by gcongr _ = exp (1 / 2 : ℝ) * (exp (y ^ 2 / 2) * exp (y ^ 2 / 2)) := by ring _ = exp (1 / 2 : ℝ) * exp (y ^ 2) := by rw [← Real.exp_add] congr 2 ring _ ≤ 2 * exp (y ^ 2) := by gcongr; exact exp_half_le_two have hrem : (s * y) ^ 2 * exp |s * y| ≤ 2 * s ^ 2 * exp (y ^ 2) := by calc (s * y) ^ 2 * exp |s * y| ≤ (s * y) ^ 2 * exp ((1 + y ^ 2) / 2) := by gcongr _ = s ^ 2 * (y ^ 2 * exp ((1 + y ^ 2) / 2)) := by ring _ ≤ s ^ 2 * (2 * exp (y ^ 2)) := by gcongr _ = 2 * s ^ 2 * exp (y ^ 2) := by ring calc exp (t * X ω) = exp (s * y) := by rw [htx] _ ≤ 1 + s * y + (s * y) ^ 2 * exp |s * y| := hbase _ ≤ 1 + s * y + 2 * s ^ 2 * exp (y ^ 2) := by linarith _ = 1 + t * X ω + 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2) := by rw [← htx] congr 2 dsimp [y] field_simp [hψ.ne'] have htilt := integrable_exp_mul_of_luxemburg_sq hψ hXmeas hLuxInt t have hrhs : Integrable (fun ω ↦ 1 + t * X ω + 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2)) μ := ((integrable_const (1 : ℝ)).add (hXint.const_mul t)).add hremInt calc ∫ ω, exp (t * X ω) ∂μ ≤ ∫ ω, (1 + t * X ω + 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2)) ∂μ := integral_mono htilt hrhs hpoint _ = 1 + 2 * s ^ 2 * (∫ ω, exp (X ω ^ 2 / ψ ^ 2) ∂μ) := by have hA : Integrable (fun ω ↦ (1 : ℝ) + t * X ω) μ := (integrable_const (1 : ℝ)).add (hXint.const_mul t) have hB : Integrable (fun ω ↦ 2 * s ^ 2 * exp (X ω ^ 2 / ψ ^ 2)) μ := hremInt rw [integral_add hA hB, integral_add (integrable_const (1 : ℝ)) (hXint.const_mul t), integral_const, integral_const_mul, integral_const_mul, hcenter] simp _ ≤ 1 + 4 * s ^ 2 := by nlinarith _ ≤ exp (4 * s ^ 2) := by simpa [add_comm] using Real.add_one_le_exp (4 * s ^ 2) _ = exp (4 * ψ ^ 2 * t ^ 2) := by congr 1 dsimp [s] ring · have hs_gt : 1 < s ^ 2 := by have : 1 < |s| := lt_of_not_ge hsmall nlinarith [sq_abs s] have htilt := integrable_exp_mul_of_luxemburg_sq hψ hXmeas hLuxInt t have hpoint : ∀ ω, exp (t * X ω) ≤ exp (s ^ 2 / 4) * exp (X ω ^ 2 / ψ ^ 2) := by intro ω rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare := sq_nonneg (X ω / ψ - s / 2) have htx : t * X ω = s * (X ω / ψ) := by dsimp [s] field_simp [hψ.ne'] rw [htx] field_simp [hψ.ne'] at hsquare ⊢ nlinarith have henv : Integrable (fun ω ↦ exp (s ^ 2 / 4) * exp (X ω ^ 2 / ψ ^ 2)) μ := hLuxInt.const_mul _ calc ∫ ω, exp (t * X ω) ∂μ ≤ ∫ ω, exp (s ^ 2 / 4) * exp (X ω ^ 2 / ψ ^ 2) ∂μ := integral_mono htilt henv hpoint _ = exp (s ^ 2 / 4) * (∫ ω, exp (X ω ^ 2 / ψ ^ 2) ∂μ) := by rw [integral_const_mul] _ ≤ exp (s ^ 2 / 4) * 2 := by exact mul_le_mul_of_nonneg_left hLux (Real.exp_nonneg _) _ ≤ exp (4 * s ^ 2) := by have htwo : 2 ≤ exp 1 := by nlinarith [Real.add_one_lt_exp (by norm_num : (1 : ℝ) ≠ 0)] have harg : 1 + s ^ 2 / 4 ≤ 4 * s ^ 2 := by nlinarith calc exp (s ^ 2 / 4) * 2 ≤ exp (s ^ 2 / 4) * exp 1 := by gcongr _ = exp (1 + s ^ 2 / 4) := by rw [← Real.exp_add]; ring_nf _ ≤ exp (4 * s ^ 2) := Real.exp_le_exp.mpr harg _ = exp (4 * ψ ^ 2 * t ^ 2) := by congr 1 dsimp [s] ring
CausalSmith.Stat.SaPlmCumulantConverse.integral_exp_mul_le_exp_four_mul_sq_of_luxemburg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/LuxemburgMGF.lean:87
Helpers.PopulationNumeratorBound 2 declarations This file isolates the population G bound used by the adaptive contour risk proof.

Uniform population numerator envelope

This file isolates the population G bound used by the adaptive contour risk proof.

def populationNumeratorEnvelope

The explicit uniform envelope for the population outcome-residual transform.

Definition (Lean source)
-- @node: populationNumeratorEnvelope def populationNumeratorEnvelope (p : Parameters) : ℝ := sqrt (64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * searchRadius p * p.Cg + 16 * (searchRadius p) ^ 2 * p.psieta ^ 2))
CausalSmith.Stat.SaPlmCumulantConverse.populationNumeratorEnvelope · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/PopulationNumeratorBound.lean:16
theorem outcomeResidualTransform_norm_le_populationNumeratorEnvelope Lemma 4 in the paper ↗

On the search disk, the population numerator is bounded only in terms of the displayed class constants.

Formal statement
m :
Model (Xspace := Xspace) p
hclass :
z :
hz :
‖z‖ ≤ searchRadius p
‖outcomeResidualTransform p m p.n z‖ ≤ populationNumeratorEnvelope p
Proof (Lean source)
-- @node: outcomeResidualTransform_norm_le_populationNumeratorEnvelope lemma outcomeResidualTransform_norm_le_populationNumeratorEnvelope (p : Parameters) (m : Model (Xspace := Xspace) p) (hclass : NonGaussianClass p p.n m) {z : ℂ} (hz : ‖z‖ ≤ searchRadius p) : ‖outcomeResidualTransform p m p.n z‖ ≤ populationNumeratorEnvelope p := by let A : ℝ := 64 * (p.Cq ^ 4 + 4 * p.Ctheta ^ 4 * p.psieta ^ 4 + 4 * p.psixi ^ 4) + 2 * exp (16 * searchRadius p * p.Cg + 16 * (searchRadius p) ^ 2 * p.psieta ^ 2) let E : Obs Xspace → ℝ := fun o ↦ |outcome o| * exp (2 * searchRadius p * |learnedResidual p m p.n o|) have hR : 0 ≤ searchRadius p := by unfold searchRadius have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak exact mul_nonneg (Real.rpow_nonneg (by positivity) _) (Real.rpow_nonneg (div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le) _) linarith have hA : 0 ≤ A := by dsimp [A] positivity have hEmeas : Measurable E := by dsimp [E] exact measurable_snd.snd.abs.mul (Real.continuous_exp.measurable.comp (measurable_const.mul (measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const)).abs)) have henv : ∫⁻ o, ofReal ((E o) ^ 2) ∂m.P ≤ ofReal ((sqrt A) ^ 2) := by rw [Real.sq_sqrt hA] simpa [A, E] using outcome_exp_abs_sq_lintegral_le p m p.n hclass (searchRadius p) hR have hEpack := memLp_two_and_eLpNorm_le_of_sq_lintegral_le m.P hEmeas (Real.sqrt_nonneg A) henv have hEint : Integrable E m.P := hEpack.1.integrable (by norm_num) have hZmeas : Measurable (learnedResidual p m p.n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable p.n).comp measurable_fst).max measurable_const |>.min measurable_const) have hintegral : ‖∫ o, (outcome o : ℂ) * exp (z * learnedResidual p m p.n o) ∂m.P‖ ≤ ∫ o, E o ∂m.P := by apply norm_integral_le_of_norm_le hEint filter_upwards [] with o rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_exp] dsimp [E] apply mul_le_mul_of_nonneg_left _ (abs_nonneg _) apply Real.exp_le_exp.mpr calc (z * (learnedResidual p m p.n o : ℂ)).re ≤ ‖z‖ * |learnedResidual p m p.n o| := by rw [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] exact (le_abs_self _).trans (by rw [abs_mul] exact mul_le_mul_of_nonneg_right (Complex.abs_re_le_norm z) (abs_nonneg _)) _ ≤ 2 * searchRadius p * |learnedResidual p m p.n o| := by nlinarith [abs_nonneg (learnedResidual p m p.n o)] have hmean : ∫ o, E o ∂m.P ≤ sqrt A := by have habs := Causalean.Stat.abs_integral_le_eLpNorm_two hEpack.1 have htoReal : (eLpNorm E 2 m.P).toReal ≤ sqrt A := (ENNReal.toReal_mono ENNReal.ofReal_ne_top hEpack.2).trans_eq (ENNReal.toReal_ofReal (Real.sqrt_nonneg A)) rw [abs_of_nonneg (integral_nonneg fun _ ↦ by positivity)] at habs exact habs.trans htoReal unfold outcomeResidualTransform weightedTransform exact hintegral.trans (by simpa [populationNumeratorEnvelope, A] using hmean)
CausalSmith.Stat.SaPlmCumulantConverse.outcomeResidualTransform_norm_le_populationNumeratorEnvelope · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/PopulationNumeratorBound.lean:24
Helpers.ProjectedOutputCertification 1 declarations Certification of the clipped represented output

Certification of the clipped represented output

theorem projectedOutputName_certified

The interval name obtained from the absolute-value clipping formula is nested, has the inherited effective width modulus, and contains its exact real value.

Formal statement
y :
(projectedOutputName cStar y).IsCertified ((|((y : ℚ) : ℝ) + cStar.name.value| - |((y : ℚ) : ℝ) - cStar.name.value|) / 2)
Proof (Lean source)
-- @node: projectedOutputName_certified lemma projectedOutputName_certified (cStar : PositiveCertifiedReal) (y : ℚ) : (projectedOutputName cStar y).IsCertified ((|((y : ℚ) : ℝ) + cStar.name.value| - |((y : ℚ) : ℝ) - cStar.name.value|) / 2) := by have habs_sound : ∀ (I : RatInterval) (x : ℝ), I.Contains x → (rationalAbsInterval I).Contains |x| := by intro I x hx unfold rationalAbsInterval split_ifs with hlo hhi · have hlor : (0 : ℝ) ≤ (I.lo : ℝ) := by exact_mod_cast hlo have hxnonneg : 0 ≤ x := hlor.trans hx.1 simpa [abs_of_nonneg hxnonneg] using hx · have hxnonpos : x ≤ 0 := hx.2.trans (by exact_mod_cast hhi) simpa [abs_of_nonpos hxnonpos] using RatInterval.neg_sound hx · have hlo' : (I.lo : ℝ) < 0 := by exact_mod_cast lt_of_not_ge hlo have hhi' : 0 < (I.hi : ℝ) := by exact_mod_cast lt_of_not_ge hhi simp only [RatInterval.Contains, Rat.cast_zero, Rat.cast_max, Rat.cast_neg] refine ⟨abs_nonneg x, (abs_le).2 ⟨?_, ?_⟩⟩ · have hmax : -(max (-(I.lo : ℝ)) (I.hi : ℝ)) ≤ (I.lo : ℝ) := by linarith [le_max_left (-(I.lo : ℝ)) (I.hi : ℝ)] exact hmax.trans hx.1 · exact hx.2.trans (le_max_right _ _) have habs_mono : ∀ {I J : RatInterval}, I.Subinterval J → (rationalAbsInterval I).Subinterval (rationalAbsInterval J) := by intro I J hIJ rcases hIJ with ⟨hIJlo, hIJhi⟩ have hIJ : I.Subinterval J := ⟨hIJlo, hIJhi⟩ by_cases hIlo : 0 ≤ I.lo · rw [rationalAbsInterval, dif_pos hIlo] by_cases hJlo : 0 ≤ J.lo · rw [rationalAbsInterval, dif_pos hJlo] exact hIJ · rw [rationalAbsInterval, dif_neg hJlo] by_cases hJhi : J.hi ≤ 0 · rw [dif_pos hJhi] change (-J.hi ≤ I.lo ∧ I.hi ≤ -J.lo) constructor <;> linarith [I.lo_le_hi, J.lo_le_hi] · rw [dif_neg hJhi] exact ⟨hIlo, hIJ.2.trans (le_max_right _ _)⟩ · rw [rationalAbsInterval, dif_neg hIlo] by_cases hIhi : I.hi ≤ 0 · rw [dif_pos hIhi] by_cases hJlo : 0 ≤ J.lo · rw [rationalAbsInterval, dif_pos hJlo] change (J.lo ≤ -I.hi ∧ -I.lo ≤ J.hi) constructor <;> linarith [I.lo_le_hi, J.lo_le_hi] · rw [rationalAbsInterval, dif_neg hJlo] by_cases hJhi : J.hi ≤ 0 · rw [dif_pos hJhi] exact RatInterval.neg_mono hIJ · rw [dif_neg hJhi] exact ⟨by change 0 ≤ -I.hi; exact neg_nonneg.mpr hIhi, by simpa [RatInterval.neg] using (neg_le_neg hIJ.1).trans (le_max_left _ _)⟩ · rw [dif_neg hIhi] by_cases hJlo : 0 ≤ J.lo · exfalso linarith [hIJ.1] · rw [rationalAbsInterval, dif_neg hJlo] by_cases hJhi : J.hi ≤ 0 · exfalso linarith [hIJ.2] · rw [dif_neg hJhi] exact ⟨le_rfl, max_le_max (neg_le_neg hIJ.1) hIJ.2⟩ have habs_width : ∀ I : RatInterval, (rationalAbsInterval I).width ≤ I.width := by intro I unfold rationalAbsInterval split_ifs with hlo hhi · exact le_rfl · simpa [RatInterval.width_neg] · simp only [RatInterval.width, RatInterval.neg] simp only [sub_zero] apply max_le · linarith [I.lo_le_hi] · linarith [I.lo_le_hi] constructor · intro fuel dsimp [projectedOutputName, projectedOutputApprox] apply RatInterval.mul_mono (RatInterval.subinterval_refl _) apply RatInterval.sub_mono · apply habs_mono exact RatInterval.add_mono (RatInterval.subinterval_refl _) (cStar.name.nested fuel) · apply habs_mono exact RatInterval.sub_mono (RatInterval.subinterval_refl _) (cStar.name.nested fuel) · constructor · intro e dsimp [projectedOutputName, projectedOutputApprox] have hplus := habs_width ((RatInterval.point y).add (cStar.name.approx (cStar.name.modulus e))) have hminus := habs_width ((RatInterval.point y).sub (cStar.name.approx (cStar.name.modulus e))) rw [RatInterval.width_add] at hplus rw [RatInterval.width_sub] at hminus have hpointWidth : (RatInterval.point y).width = 0 := by simp [RatInterval.width, RatInterval.point] rw [hpointWidth, zero_add] at hplus hminus have hinside : ((rationalAbsInterval ((RatInterval.point y).add (cStar.name.approx (cStar.name.modulus e)))).sub (rationalAbsInterval ((RatInterval.point y).sub (cStar.name.approx (cStar.name.modulus e))))).width ≤ 2 * (cStar.name.approx (cStar.name.modulus e)).width := by rw [RatInterval.width_sub] calc _ ≤ (cStar.name.approx (cStar.name.modulus e)).width + (cStar.name.approx (cStar.name.modulus e)).width := add_le_add hplus hminus _ = _ := by ring have hmul : ∀ I : RatInterval, ((RatInterval.point (1 / 2)).mul I).width = I.width / 2 := by intro I simp only [RatInterval.mul, RatInterval.point, RatInterval.width] norm_num rw [min_eq_left, max_eq_right] <;> linarith [I.lo_le_hi] rw [hmul] calc _ ≤ (2 * (cStar.name.approx (cStar.name.modulus e)).width) / 2 := div_le_div_of_nonneg_right hinside (by norm_num) _ = (cStar.name.approx (cStar.name.modulus e)).width := by ring _ ≤ e.1 := cStar.name.width_modulus e · intro fuel dsimp [projectedOutputName, projectedOutputApprox] convert RatInterval.mul_sound (RatInterval.point_sound (1 / 2)) (RatInterval.sub_sound (habs_sound _ _ (RatInterval.add_sound (RatInterval.point_sound y) (cStar.name.contains fuel))) (habs_sound _ _ (RatInterval.sub_sound (RatInterval.point_sound y) (cStar.name.contains fuel)))) using 1 <;> ring
CausalSmith.Stat.SaPlmCumulantConverse.projectedOutputName_certified · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/ProjectedOutputCertification.lean:11
Helpers.SelectorSoundness 33 declarations Soundness of the one bounded-domain option-A selector

Soundness of the one bounded-domain option-A selector

Every mesh endpoint consumed by trapezoidal quadrature is evaluated by the bounded adapter.

Definition (Lean source)
def EndpointComplete (schedule : Schedule) : Prop := ∀ k, k ∈ List.range (schedule.mesh + 1) ↔ k ≤ schedule.mesh
CausalSmith.Stat.SaPlmCumulantConverse.EndpointComplete · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:36
theorem endpointComplete

Every quadrature schedule enumerates exactly the mesh endpoints it needs: an index appears in the enumerated list of nodes precisely when it does not exceed the schedule's mesh count, so the bounded adapter evaluates the integrand at all of them and at nothing else.

Formal statement
schedule :
Proof (Lean source)
lemma endpointComplete (schedule : Schedule) : EndpointComplete schedule := by intro k simp
CausalSmith.Stat.SaPlmCumulantConverse.endpointComplete · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:42

Exact precision and fuel facts required by every schedule actually used by the bounded program. amplification is the interval-map envelope; it is separate from schedule.magnitude, which remains the contour Lipschitz constant used only by the mesh bound.

Definition (Lean source)
def ExactSpectralSchedule (schedule : Schedule) (amplification : ℚ) : Prop := schedule.inputPrecision = circleInputPrecision 1 (spectralNodeTarget schedule.tolerance) ∧ circleExpFuel 1 schedule.mesh (spectralNodeTarget schedule.tolerance) ≤ schedule.fuel ∧ spectralEmpiricalMapFuel (spectralNodeTarget schedule.tolerance) schedule.operationCount amplification ≤ schedule.fuel ∧ spectralNormFuel (spectralNodeTarget schedule.tolerance) ≤ schedule.fuel ∧ spectralSqrtFuel (spectralNodeTarget schedule.tolerance) ≤ schedule.fuel ∧ spectralEndpointFuel schedule.operationCount ≤ schedule.fuel ∧ spectralDerivedFuel (spectralNodeTarget schedule.tolerance) schedule.operationCount amplification ≤ schedule.fuel
CausalSmith.Stat.SaPlmCumulantConverse.ExactSpectralSchedule · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:52
def CanonicalRepresentedSpectralInput

A represented spectral input is canonical when it is the record actually produced by the estimator's data-encoding step: there exist certified bank inputs, a certified range input, a treatment-regression code sequence, and a sample of observations on the covariate space such that the input is the canonical encoding built from them.

Definition (Lean source)
def CanonicalRepresentedSpectralInput (X : Type*) [MeasurableSpace X] (input : RepresentedSpectralInput p) : Prop := ∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → X → ℝ) (data : Fin p.n → Obs X), input = canonicalRepresentedInput p pStar cStar gcode data
CausalSmith.Stat.SaPlmCumulantConverse.CanonicalRepresentedSpectralInput · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:582
theorem spectralDenominatorMap_valid_of_canonical

Full-box validity of the empirical denominator map on canonical floor-dyadic represented inputs. The exponential and derivative envelopes use spectralFullBoxRadius B, not the smaller selected-circle radius.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
(spectralDenominatorMap input B I derivative).Valid
Proof (Lean source)
lemma spectralDenominatorMap_valid_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : CanonicalRepresentedSpectralInput Xspace input) : (spectralDenominatorMap input B I derivative).Valid := by refine ⟨empiricalFDerivativeBound_nonneg input (spectralFullBoxRadius B) derivative, mul_nonneg (by norm_num) (empiricalFWidthBound_nonneg input (spectralFullBoxRadius B) derivative (spectralFullBoxRadius_nonneg B)), ?_⟩ intro K z hK hz have hraw : ∀ fuel, (spectralDenominatorRawEval input I derivative K fuel).Contains ((spectralDenominatorMap input B I derivative).value z) := fun fuel ↦ spectralDenominatorRawEval_sound_of_canonical input B I derivative hcanonical hK hz fuel refine ⟨fun fuel ↦ (tightenAcrossFuel_spec _ _ hraw fuel).1, fun fuel ↦ (tightenAcrossFuel_spec _ _ hraw fuel).2.1, ?_⟩ intro e exact (complexRectangle_width_mono (tightenAcrossFuel_spec _ _ hraw ((spectralDenominatorMap input B I derivative).precision e)).2.2).trans (spectralDenominatorRawEval_width_of_canonical input B I derivative hcanonical K hK e)
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorMap_valid_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:597
theorem spectralNumeratorMap_valid_of_canonical

Full-box validity of the empirical numerator map on canonical floor-dyadic represented inputs.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
(spectralNumeratorMap input B I derivative).Valid
Proof (Lean source)
lemma spectralNumeratorMap_valid_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : CanonicalRepresentedSpectralInput Xspace input) : (spectralNumeratorMap input B I derivative).Valid := by refine ⟨empiricalGDerivativeBound_nonneg input (spectralFullBoxRadius B) derivative, mul_nonneg (by norm_num) (empiricalGWidthBound_nonneg input (spectralFullBoxRadius B) derivative (spectralFullBoxRadius_nonneg B)), ?_⟩ intro K z hK hz have hraw : ∀ fuel, (spectralNumeratorRawEval input I derivative K fuel).Contains ((spectralNumeratorMap input B I derivative).value z) := fun fuel ↦ spectralNumeratorRawEval_sound_of_canonical input B I derivative hcanonical hK hz fuel refine ⟨fun fuel ↦ (tightenAcrossFuel_spec _ _ hraw fuel).1, fun fuel ↦ (tightenAcrossFuel_spec _ _ hraw fuel).2.1, ?_⟩ intro e exact (complexRectangle_width_mono (tightenAcrossFuel_spec _ _ hraw ((spectralNumeratorMap input B I derivative).precision e)).2.2).trans (spectralNumeratorRawEval_width_of_canonical input B I derivative hcanonical K hK e)
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorMap_valid_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:623

Explicit post-quadrature width contract. It exposes the guarded-division amplification and requires the actual normalized rectangle, not merely its fuel, to meet the branch target.

Definition (Lean source)
def PostNormalizationWidthContract (I : ComplexRatInterval) (count piPrecision : ℕ) (target : ℚ) : Prop := ∃ δ : ℚ, 0 < δ ∧ δ ≤ (boundedContourDivisor count piPrecision).normSq.lo ∧ boundedContourNormalizationWidthBound I count piPrecision δ < target ∧ (boundedContourNormalize I count piPrecision).width < target
CausalSmith.Stat.SaPlmCumulantConverse.PostNormalizationWidthContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:3270

All paper-specific schedule facts are local consequences of the canonical floor-dyadic input and the explicit schedule, never hypotheses or fields of the generic build carrier.

Definition (Lean source)
def SpectralScheduleWitness (input : RepresentedSpectralInput p) (B : ContourBankData) : Prop := (∀ (a : Fin 2) (j : Fin (B.JBase + 1)), let schedule := pilotSchedule input B a j let map := spectralDenominatorMap input B (spectralFold p.n a) 0 let L := pilotCircleLipschitzBound input (radiusUpper B j) let amplification := pilotScheduleMagnitude input B j let unitWidth := (spectralNodeTarget schedule.tolerance).1 let radiusPrecision := bankRadiusPrecision schedule.tolerance unitWidth ExactSpectralSchedule schedule amplification ∧ schedule.magnitude = L ∧ map.Valid ∧ map.precision (spectralNodeTarget schedule.tolerance) ≤ schedule.fuel ∧ radiusPrecision.1 ≤ 1 ∧ ∀ k ≤ schedule.mesh, (spectralRadiusNode B j schedule k).Contains (CircleMesh.circleMap 0 (B.rho j) (CircleMesh.meshPoint schedule.mesh k)) ∧ (spectralRadiusNode B j schedule k).Subinterval (spectralDiskBox B) ∧ (bankRadiusRect (B.rhoName j) radiusPrecision).maxAbs ≤ radiusSlackUpper B j ∧ (spectralRadiusNode B j schedule k).width ≤ 2 * (radiusSlackUpper B j * unitWidth + (1 + unitWidth) * radiusPrecision.1) ∧ (map.eval (spectralRadiusNode B j schedule k) schedule.fuel).width ≤ map.derivativeEnvelope * (spectralRadiusNode B j schedule k).width + (spectralNodeTarget schedule.tolerance).1 ∧ ((map.eval (spectralRadiusNode B j schedule k) schedule.fuel).normInterval schedule.fuel).width ≤ (pilotNodeTolerance B).1) ∧ (∀ (j : Fin (B.JBase + 1)), let pilot := pilotModulus input B 0 j ∀ hpilot : 0 < pilot.lo, let lower : PosRat := ⟨pilot.lo, hpilot⟩ let ev := spectralWindingEvaluator input B j lower let amplification := windingScheduleMagnitude input B j lower ExactSpectralSchedule ev.schedule amplification ∧ ev.schedule.magnitude = windingLipschitzBound input (radiusUpper B j) lower.1 ∧ ev.Valid ∧ ev.numerator.precision (spectralNodeTarget ev.schedule.tolerance) ≤ ev.mapFuel ∧ ev.denominator.precision (spectralNodeTarget ev.schedule.tolerance) ≤ ev.mapFuel ∧ PostNormalizationWidthContract (boundedContourEvaluate ev) 1 ev.piPrecision (1 / 4) ∧ ∀ k ≤ ev.schedule.mesh, pilot.lo / 2 ≤ ((ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).normInterval ev.mapFuel).lo ∧ (ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).normSq.AwayFromZero ∧ (ev.numerator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).width ≤ ev.numerator.derivativeEnvelope * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + (spectralNodeTarget ev.schedule.tolerance).1 ∧ (ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).width ≤ ev.denominator.derivativeEnvelope * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + (spectralNodeTarget ev.schedule.tolerance).1 ∧ (tangentNode ev.radius ev.radiusPrecision ev.piPrecision ev.schedule k).width ≤ 2 * (9 * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + 2 * radiusSlackUpper B j * (1 + (spectralNodeTarget ev.schedule.tolerance).1) * (2 * (Transcendental.piInterval ev.piPrecision).width))) ∧ (∀ (j : Fin (B.JBase + 1)) (N : ℕ), let pilot := pilotModulus input B 1 j ∀ hpilot : 0 < pilot.lo, let lower : PosRat := ⟨pilot.lo, hpilot⟩ let ev := spectralEvaluationEvaluator input B j N lower let amplification := evaluationScheduleMagnitude input B j N lower ExactSpectralSchedule ev.schedule amplification ∧ ev.schedule.magnitude = momentLipschitzBound input (radiusUpper B j) lower.1 N ∧ ev.Valid ∧ ev.numerator.precision (spectralNodeTarget ev.schedule.tolerance) ≤ ev.mapFuel ∧ ev.denominator.precision (spectralNodeTarget ev.schedule.tolerance) ≤ ev.mapFuel ∧ PostNormalizationWidthContract (boundedContourEvaluate ev) (max N 1) ev.piPrecision (2 / (max p.n 1 : ℚ)) ∧ ∀ k ≤ ev.schedule.mesh, pilot.lo / 2 ≤ ((ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).normInterval ev.mapFuel).lo ∧ (ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).normSq.AwayFromZero ∧ (ev.numerator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).width ≤ ev.numerator.derivativeEnvelope * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + (spectralNodeTarget ev.schedule.tolerance).1 ∧ (ev.denominator.eval (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k) ev.mapFuel).width ≤ ev.denominator.derivativeEnvelope * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + (spectralNodeTarget ev.schedule.tolerance).1 ∧ (tangentNode ev.radius ev.radiusPrecision ev.piPrecision ev.schedule k).width ≤ 2 * (9 * (certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k).width + 2 * radiusSlackUpper B j * (1 + (spectralNodeTarget ev.schedule.tolerance).1) * (2 * (Transcendental.piInterval ev.piPrecision).width)))
CausalSmith.Stat.SaPlmCumulantConverse.SpectralScheduleWitness · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5096
theorem spectralScheduleWitness

The paper schedule is certified only for the floor-dyadic observation records used by the ordinary option-A statistic. In particular, this does not assert a raw-fuel width contract for arbitrary supplied real names.

Formal statement
Proof (Lean source)
lemma spectralScheduleWitness (input : RepresentedSpectralInput p) (pStar : CertifiedBankInputs p) (hcanonical : CanonicalRepresentedSpectralInput Xspace input) : SpectralScheduleWitness input (contourBank p pStar) := by let B := contourBank p pStar refine ⟨pilotScheduleWitness input pStar hcanonical, ?_, ?_⟩ · intro j dsimp only intro hpilot let lower : PosRat := ⟨(pilotModulus input B 0 j).lo, hpilot⟩ let ev := spectralWindingEvaluator input B j lower refine ⟨?_, rfl, ?_, winding_numerator_precision_le input B j lower, winding_denominator_precision_le input B j lower, ?_, ?_⟩ · dsimp [ev, spectralWindingEvaluator] exact exactSpectralSchedule_spectralSchedule _ _ _ _ _ _ · exact spectralWindingEvaluator_valid input pStar hcanonical j lower rfl · exact winding_post_normalization_contract input pStar hcanonical j lower rfl · intro k hk simpa [ev, lower] using winding_node_specification input pStar hcanonical j lower rfl k hk · intro j N dsimp only intro hpilot let lower : PosRat := ⟨(pilotModulus input B 1 j).lo, hpilot⟩ let ev := spectralEvaluationEvaluator input B j N lower refine ⟨?_, rfl, ?_, evaluation_numerator_precision_le input B j N lower, evaluation_denominator_precision_le input B j N lower, ?_, ?_⟩ · dsimp [ev, spectralEvaluationEvaluator] exact exactSpectralSchedule_spectralSchedule _ _ _ _ _ _ · exact spectralEvaluationEvaluator_valid input pStar hcanonical j N lower rfl · exact evaluation_post_normalization_contract input pStar hcanonical j N lower rfl · intro k hk simpa [ev, lower] using evaluation_node_specification input pStar hcanonical j N lower rfl k hk
CausalSmith.Stat.SaPlmCumulantConverse.spectralScheduleWitness · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5200

The pilot's finite-extremum error is the sum of a node half and a mesh half, each bounded by aStar/128.

Definition (Lean source)
def FiniteExtremaContract (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : Prop := let schedule := pilotSchedule input B a j let map := spectralDenominatorMap input B (spectralFold p.n a) 0 let L := pilotCircleLipschitzBound input (radiusUpper B j) (∀ k ≤ schedule.mesh, ((map.eval (spectralRadiusNode B j schedule k) schedule.fuel).normInterval schedule.fuel).width ≤ (pilotNodeTolerance B).1) ∧ L / schedule.mesh ≤ (pilotMeshTolerance B).1
CausalSmith.Stat.SaPlmCumulantConverse.FiniteExtremaContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5238

Semantic certificate for one pilot boundary-infimum call.

Definition (Lean source)
def PilotModulusSpecification (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : Prop := let I := pilotModulus input B a j I.Contains (sInf ((fun z ↦ ‖(spectralDenominatorMap input B (spectralFold p.n a) 0).value z‖) '' sphere (0 : ℂ) (B.rho j))) ∧ I.width ≤ B.aStarRat / 64 ∧ FiniteExtremaContract input B a j ∧ EndpointComplete (pilotSchedule input B a j)
CausalSmith.Stat.SaPlmCumulantConverse.PilotModulusSpecification · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5251
def normalizedContourValue

The exact complex number a bounded circle evaluator is meant to approximate: integrate the ratio of the evaluator's numerator map to its denominator map once around the circle of the evaluator's radius centred at the origin, then divide by two pi times the imaginary unit times the evaluator's normalization count, where a normalization count of zero is treated as one.

Definition (Lean source)
def normalizedContourValue {box : ComplexRatInterval} (ev : BoundedCircleEvaluator box) : ℂ := (((max ev.normalizationCount 1 : ℝ) : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * CircleMesh.circleContourIntegral (fun z ↦ ev.numerator.value z / ev.denominator.value z) 0 ev.radius.value
CausalSmith.Stat.SaPlmCumulantConverse.normalizedContourValue · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5260
theorem circleContourIntegral_eq_circleIntegral

The contour integral of a complex function around a circle as defined by the quadrature-mesh library agrees with the standard circle integral, for any centre and any radius.

Formal statement
f :
ℂ → ℂ
c :
rho :
CircleMesh.circleContourIntegral f c rho = circleIntegral f c rho
Proof (Lean source)
lemma circleContourIntegral_eq_circleIntegral (f : ℂ → ℂ) (c : ℂ) (rho : ℝ) : CircleMesh.circleContourIntegral f c rho = circleIntegral f c rho := by rw [CircleMesh.circleContourIntegral, circleIntegral] let g : ℝ → ℂ := fun thetaderiv (circleMap c rho) theta • f (circleMap c rho theta) have hpoint : CircleMesh.circleIntegrand f c rho = fun u ↦ (2 * Real.pi : ℝ) • g (u * (2 * Real.pi)) := by funext u dsimp [g, CircleMesh.circleIntegrand, CircleMesh.circleMap, CircleMesh.circleTangent] rw [deriv_circleMap] simp only [circleMap, Complex.ofReal_mul, Complex.ofReal_ofNat] ring_nf rw [hpoint] change (∫ u in (0 : ℝ)..1, (2 * Real.pi : ℝ) • g (u * (2 * Real.pi))) = ∫ theta in (0 : ℝ)..2 * Real.pi, g theta calc (∫ u in (0 : ℝ)..1, (2 * Real.pi : ℝ) • g (u * (2 * Real.pi))) = (2 * Real.pi : ℝ) • ∫ u in (0 : ℝ)..1, g (u * (2 * Real.pi)) := intervalIntegral.integral_smul (𝕜 := ℝ) (2 * Real.pi) (fun u ↦ g (u * (2 * Real.pi))) _ = _ := by convert intervalIntegral.smul_integral_comp_mul_right (a := (0 : ℝ)) (b := 1) g (2 * Real.pi) using 1 <;> simp
CausalSmith.Stat.SaPlmCumulantConverse.circleContourIntegral_eq_circleIntegral · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5274

The winding rectangle encloses the normalized, tangent-corrected contour integral and is narrow enough for unique integer decoding.

Definition (Lean source)
def WindingEnclosureSpecification (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : Prop := let I := windingEnclosure input B j I.re.width < 1 / 4 ∧ I.im.width < 1 / 4 ∧ WindingDecoderContract I ∧ (∀ h : 0 < (pilotModulus input B 0 j).lo, let ev := spectralWindingEvaluator input B j ⟨(pilotModulus input B 0 j).lo, h⟩ ev.Valid ∧ I.Contains (normalizedContourValue ev) ∧ PostNormalizationWidthContract (boundedContourEvaluate ev) 1 ev.piPrecision (1 / 4)) ∧ EndpointComplete (spectralWindingEvaluator input B j ⟨1, by norm_num⟩).schedule
CausalSmith.Stat.SaPlmCumulantConverse.WindingEnclosureSpecification · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5308

The evaluation rectangle is normalized after quadrature and has the paper's effective 1/max(n,1) midpoint tolerance.

Definition (Lean source)
def EvaluationEnclosureSpecification (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) : Prop := let I := evaluationEnclosure input B j N I.width ≤ 2 / (max p.n 1 : ℚ) ∧ (∀ h : 0 < (pilotModulus input B 1 j).lo, let ev := spectralEvaluationEvaluator input B j N ⟨(pilotModulus input B 1 j).lo, h⟩ ev.Valid ∧ I.Contains (normalizedContourValue ev) ∧ PostNormalizationWidthContract (boundedContourEvaluate ev) (max N 1) ev.piPrecision (2 / (max p.n 1 : ℚ))) ∧ EndpointComplete (spectralEvaluationEvaluator input B j N ⟨1, by norm_num⟩).schedule
CausalSmith.Stat.SaPlmCumulantConverse.EvaluationEnclosureSpecification · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5324
theorem selector_decodes_exact_winding

Selector-side use of the decoder contract: a normalized winding rectangle with the certified strict coordinate widths decodes the exact nonnegative integer it contains.

Formal statement
j :
Fin (B.JBase + 1)
N :
hspec :
hcontains :
(windingEnclosure input B j).Contains (((N : ℝ) : ℂ))
Proof (Lean source)
lemma selector_decodes_exact_winding (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) (hspec : WindingEnclosureSpecification input B j) (hcontains : (windingEnclosure input B j).Contains (((N : ℝ) : ℂ))) : uniqueNonnegativeInteger (windingEnclosure input B j) = some N := by exact (hspec.2.2.1).2.1 N hcontains hspec.1 hspec.2.1
CausalSmith.Stat.SaPlmCumulantConverse.selector_decodes_exact_winding · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5500

The full package of node-level certificates the bounded selector relies on, stated for a given parameter set: for every measurable covariate space and every choice of certified bank inputs, certified range input, treatment-regression code sequence, and sample, the canonically encoded input satisfies, at each candidate contour radius, the two pilot boundary-modulus certificates, the winding-number enclosure certificate, and the evaluation enclosure certificate for every candidate integer; and the projected-output name certifies, at every rational argument, the clipping of that argument to the range constant Ctheta.

Definition (Lean source)
def RepresentedNodeSpecifications (p : Parameters) : Prop := ∀ {Xspace : Type*} [MeasurableSpace Xspace] (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace), let input := canonicalRepresentedInput p pStar cStar gcode data (∀ j : Fin ((contourBank p input.primitive).JBase + 1), PilotModulusSpecification input (contourBank p input.primitive) 0 j ∧ PilotModulusSpecification input (contourBank p input.primitive) 1 j ∧ WindingEnclosureSpecification input (contourBank p input.primitive) j ∧ ∀ N, EvaluationEnclosureSpecification input (contourBank p input.primitive) j N) ∧ ∀ y : ℚ, (projectedOutputName input.range.CthetaName y).IsCertified ((|((y : ℚ) : ℝ) + input.range.CthetaName.name.value| - |((y : ℚ) : ℝ) - input.range.CthetaName.name.value|) / 2)
CausalSmith.Stat.SaPlmCumulantConverse.RepresentedNodeSpecifications · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5511
theorem representedNodeSpecifications

Every parameter set satisfies the full package of node-level certificates: on canonically encoded data the pilot boundary-modulus enclosures, the winding enclosures, the evaluation enclosures, and the certified clipping of the output to the range constant Ctheta all hold, with no further assumptions on the sample or on the treatment-regression code.

Formal statement
Proof (Lean source)
lemma representedNodeSpecifications (p : Parameters) : RepresentedNodeSpecifications p := by intro Xspace _ pStar cStar gcode data let input := canonicalRepresentedInput p pStar cStar gcode data have hcanonical : CanonicalRepresentedSpectralInput Xspace input := ⟨pStar, cStar, gcode, data, rfl⟩ have hschedule : SpectralScheduleWitness input (contourBank p pStar) := spectralScheduleWitness input pStar hcanonical refine ⟨?_, ?_⟩ · intro j refine ⟨pilotModulusSpecification_of_schedule input pStar hcanonical 0 j, pilotModulusSpecification_of_schedule input pStar hcanonical 1 j, windingEnclosureSpecification_of_schedule input (contourBank p pStar) hschedule j, ?_⟩ intro N exact evaluationEnclosureSpecification_of_schedule input (contourBank p pStar) hschedule j N · intro y exact projectedOutputName_certified cStar.CthetaName y
CausalSmith.Stat.SaPlmCumulantConverse.representedNodeSpecifications · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5536

The generic complex operations used by the bounded adapter have their actual executable semantics. This is deliberately a predicate on a supplied build, rather than extra fields on the weak callable carrier.

Definition (Lean source)
def GenericComplexBuildImplemented (build : complexCertifiedIntervalArithmetic) : Prop := build.operations.IsCanonical ∧ RealTranscendentalContract expTaylorInterval exp expScheduleProgramRealTranscendentalContract sinInterval sin trigScheduleProgramRealTranscendentalContract cosInterval cos trigScheduleProgramComplexExpContract cexpScheduleProgramCircleProgramContract circleNodeScheduleProgram circleTangentScheduleProgramNodeEvaluationContract nodeEvaluationScheduleProgram ∧ (∀ (I J : ComplexRatInterval) (z w : ℂ), I.Contains z → J.Contains w → (build.operations.complexMul I J).Contains (z * w)) ∧ (∀ (I J : ComplexRatInterval) (z w : ℂ) (m : ℚ) (hm : 0 < m) (hguard : m ≤ (cxModulusSq J).lo), I.Contains z → J.Contains w → (build.operations.guardedDiv I J m hm hguard).Contains (z / w)) ∧ (∀ (I : ComplexRatInterval) (z : ℂ) (fuel : ℕ), I.Contains z → (build.operations.complexExp I fuel).Contains (exp z)) ∧ (∀ fuel, (build.operations.piInterval fuel).Contains pi) ∧ ∀ name input L e endpointOperations, build.operations.fuelTrace name input L e endpointOperations = nodeEvaluationScheduleProgram name input L e endpointOperations
CausalSmith.Stat.SaPlmCumulantConverse.GenericComplexBuildImplemented · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5564

The supplied compiled entry points are exactly the pilot, winding, and evaluation programs of the single bounded option-A adapter.

Definition (Lean source)
def CanonicalAdapterEntryPointsCompiled (compiled : CompiledBoundedSpectralAdapter) : Prop := (∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)), compiled.pilotBoundary input B a j = builtPilotBoundary compiled.build input B a j) ∧ (∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (j : Fin (B.JBase + 1)), compiled.windingQuadrature input B j = builtWindingQuadrature compiled.build input B j) ∧ ∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ), compiled.evaluationQuadrature input B j N = builtEvaluationQuadrature compiled.build input B j N
CausalSmith.Stat.SaPlmCumulantConverse.CanonicalAdapterEntryPointsCompiled · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5590

Complete antecedent for represented delivery on one fixed experiment. It combines the genuine generic complex build, the compiled callable adapter, the locally derived schedule/map/guard/containment/width/normalization facts, and endpoint completeness. Output certification is a conclusion derived from the projected-output certificate, not a premise of this predicate. None of these paper-specific facts is a field of CompiledBoundedSpectralAdapter.

Definition (Lean source)
def FullCanonicalBuildAndCompilation (compiled : CompiledBoundedSpectralAdapter) (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) : Prop := GenericComplexBuildImplemented compiled.build ∧ CanonicalAdapterEntryPointsCompiled compiled ∧ (∀ data : Fin p.n → Obs Xspace, let input := canonicalRepresentedInput p pStar cStar gcode data let B := contourBank p pStar SpectralScheduleWitness input B ∧ ∀ j : Fin (B.JBase + 1), PilotModulusSpecification input B 0 j ∧ PilotModulusSpecification input B 1 j ∧ WindingEnclosureSpecification input B j ∧ ∀ N, EvaluationEnclosureSpecification input B j N)
CausalSmith.Stat.SaPlmCumulantConverse.FullCanonicalBuildAndCompilation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5605
theorem representedExecution_of_fullCanonicalBuildAndCompilation

If a compiled bounded adapter has canonical generic complex arithmetic, canonically compiled entry points, and node certificates valid on every sample, then running that compiled adapter on canonically encoded data reproduces the estimator's represented-execution contract: it returns exactly the same record as the ordinary finite-rational program, the same execution trace, and an output name certifying the clipped point estimate.

Formal statement
gcode :
ℕ → Xspace → ℝ
hfull :
FullCanonicalBuildAndCompilation compiled p pStar cStar gcode
RepresentedExecution compiled p pStar cStar gcode
Proof (Lean source)
lemma representedExecution_of_fullCanonicalBuildAndCompilation (compiled : CompiledBoundedSpectralAdapter) (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hfull : FullCanonicalBuildAndCompilation compiled p pStar cStar gcode) : RepresentedExecution compiled p pStar cStar gcode := by change representedExecutionContract compiled p pStar cStar gcode intro data dsimp only have hcanonical : compiled.build.operations.IsCanonical := hfull.1.1 have hcompiled := hfull.2.1 have hp : ∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)), compiled.pilotBoundary input B a j = pilotModulus input B a j := by intro q input B a j rw [hcompiled.1 input B a j] exact builtPilotBoundary_eq compiled.build hcanonical input B a j have hw : ∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (j : Fin (B.JBase + 1)), compiled.windingQuadrature input B j = windingEnclosure input B j := by intro q input B j rw [hcompiled.2.1 input B j] exact builtWindingQuadrature_eq compiled.build hcanonical input B j have he : ∀ {q : Parameters} (input : RepresentedSpectralInput q) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ), compiled.evaluationQuadrature input B j N = evaluationEnclosure input B j N := by intro q input B j N rw [hcompiled.2.2 input B j N] exact builtEvaluationQuadrature_eq compiled.build hcanonical input B j N have heq : representedSpectralProgram compiled (canonicalRepresentedInput p pStar cStar gcode data) = instrumentedSpectralProgram (canonicalRepresentedInput p pStar cStar gcode data) := by simp only [representedSpectralProgram, instrumentedSpectralProgram, spectralProgramWith, hp, hw, he] have heq' : representedSpectralProgram compiled (canonicalRepresentedInput p pStar cStar gcode data) = ordinaryFiniteRationalResult p pStar cStar gcode data := by simpa [ordinaryFiniteRationalResult, ordinarySpectralProgram] using heq refine ⟨heq', ?_, ?_⟩ · rw [heq'] · rw [heq'] have hout : (ordinaryFiniteRationalResult p pStar cStar gcode data).output = projectedOutputName cStar.CthetaName (ordinaryFiniteRationalResult p pStar cStar gcode data).raw := by exact instrumentedSpectralProgram_output_eq_projectedOutputName (canonicalRepresentedInput p pStar cStar gcode data) rw [hout] convert projectedOutputName_certified cStar.CthetaName (ordinaryFiniteRationalResult p pStar cStar gcode data).raw using 1 unfold ordinaryThetaHatValue dsimp only have hC : 0 ≤ cStar.CthetaName.name.value := by rw [cStar.Ctheta_value] exact p.constants_pos.1.le exact clip_eq_abs_projection cStar.CthetaName.name.value ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ) hC
CausalSmith.Stat.SaPlmCumulantConverse.representedExecution_of_fullCanonicalBuildAndCompilation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5654
theorem thetaHatSpec_eq_clip_finite_rational

The estimator's reported point estimate is exactly the raw output of the ordinary finite-rational program clipped to the interval between minus the range constant Ctheta and plus Ctheta, for any parameter set, certified records, treatment-regression code, and sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
thetaHatSpec p pStar cStar gcode data
= min (max ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ) (-p.Ctheta)) p.Ctheta
Proof (Lean source)
lemma thetaHatSpec_eq_clip_finite_rational (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) : thetaHatSpec p pStar cStar gcode data = min (max ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ) (-p.Ctheta)) p.Ctheta := by unfold thetaHatSpec ordinaryThetaHatValue dsimp only rw [cStar.Ctheta_value]
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_eq_clip_finite_rational · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5724
theorem instrumentedSpectralProgram_raw_measurable

Finite branch endpoints, floor-dyadic maps, and the least-index search are Borel measurable.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
Measurable (fun data : Fin p.n → Obs Xspace ↦ ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ))
Proof (Lean source)
lemma instrumentedSpectralProgram_raw_measurable (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) : Measurable (fun data : Fin p.n → Obs Xspace ↦ ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ)) := by exact ordinaryFiniteRationalResult_raw_measurable p pStar cStar gcode hgcode
CausalSmith.Stat.SaPlmCumulantConverse.instrumentedSpectralProgram_raw_measurable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5741
theorem thetaHatSpec_measurable

If the treatment-regression code at the current sample size is a measurable function of the covariate, then the estimator is a measurable function of the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
Measurable (thetaHatSpec p pStar cStar gcode)
Proof (Lean source)
lemma thetaHatSpec_measurable (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) : Measurable (thetaHatSpec p pStar cStar gcode) := by rw [show thetaHatSpec p pStar cStar gcode = fun data ↦ min (max ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ) (-p.Ctheta)) p.Ctheta from by funext data exact thetaHatSpec_eq_clip_finite_rational p pStar cStar gcode data] exact ((instrumentedSpectralProgram_raw_measurable p pStar cStar gcode hgcode).max measurable_const).min measurable_const
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_measurable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5750
theorem thetaHatSpec_mem_Icc

The estimator always takes values between minus the range constant Ctheta and plus Ctheta, whatever the sample, because its last step clips the raw value to that range and the range constant is positive.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
thetaHatSpec p pStar cStar gcode data ∈ Icc (-p.Ctheta) p.Ctheta
Proof (Lean source)
lemma thetaHatSpec_mem_Icc (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) : thetaHatSpec p pStar cStar gcode data ∈ Icc (-p.Ctheta) p.Ctheta := by rw [thetaHatSpec_eq_clip_finite_rational] constructor · exact le_min (le_max_right _ _) (by linarith [p.constants_pos.1]) · exact min_le_right _ _
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_mem_Icc · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5769
theorem representedExecution_sound

If a compiled bounded adapter satisfies the represented-execution contract, then on every sample the record it produces on canonically encoded data equals the record produced by the ordinary finite-rational program, its execution trace equals the estimator's full trace, and its output name certifies the estimator's reported value.

Formal statement
gcode :
ℕ → Xspace → ℝ
hexec :
RepresentedExecution compiled p pStar cStar gcode
data :
Fin p.n → Obs Xspace
let input := canonicalRepresentedInput p pStar cStar gcode data let result := representedSpectralProgram compiled input result
= ordinaryFiniteRationalResult p pStar cStar gcode data ∧
result.trace = (thetaHatSpec p pStar cStar gcode).fullTrace data ∧
result.output.IsCertified (thetaHatSpec p pStar cStar gcode data)
Proof (Lean source)
lemma representedExecution_sound (compiled : CompiledBoundedSpectralAdapter) {p : Parameters} (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hexec : RepresentedExecution compiled p pStar cStar gcode) (data : Fin p.n → Obs Xspace) : let input := canonicalRepresentedInput p pStar cStar gcode data let result := representedSpectralProgram compiled input result = ordinaryFiniteRationalResult p pStar cStar gcode data ∧ result.trace = (thetaHatSpec p pStar cStar gcode).fullTrace data ∧ result.output.IsCertified (thetaHatSpec p pStar cStar gcode data) := by simpa [RepresentedExecution, thetaHatSpec, representedExecutionContract] using (hexec data)
CausalSmith.Stat.SaPlmCumulantConverse.representedExecution_sound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5781
def CanonicalSelectorGoodEvent

The source good event supplies both population controls and the two positive denominator margins. The empirical margin is derived from d ≤ mu-nu; it is not a separate assumption.

Definition (Lean source)
def CanonicalSelectorGoodEvent (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (F G : ℂ → ℂ) (d e C_G mu nu : ℝ) : Prop := 0 ≤ d ∧ 0 ≤ e ∧ 0 ≤ C_G ∧ 0 < mu ∧ 0 < nu ∧ mu = 31 * ((contourBank p pStar).aStarRat : ℝ) / 64 ∧ nu = 23 * ((contourBank p pStar).aStarRat : ℝ) / 64 ∧ d ≤ mu - nu ∧ let input := canonicalRepresentedInput p pStar cStar gcode data let B := contourBank p pStar ∃ (j : Fin (B.JBase + 1)) (N : ℕ), selectedContour input B = some j ∧ (pilotOutcome input B j).decoded = some N ∧ 1 ≤ N ∧ B.aStarRat / 4 ≤ (pilotModulus input B 1 j).lo ∧ ∀ z ∈ sphere (0 : ℂ) (B.rho j), mu ≤ ‖F z‖ ∧ ‖G z‖ ≤ C_G ∧ ‖semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z - F z‖ ≤ d ∧ ‖semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z - G z‖ ≤ e
CausalSmith.Stat.SaPlmCumulantConverse.CanonicalSelectorGoodEvent · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5803
def ordinaryContourPerturbationConstant

Exact source perturbation scale.

Definition (Lean source)
def ordinaryContourPerturbationConstant (p : Parameters) (C_G mu nu : ℝ) : ℝ := searchRadius p * max nu⁻¹ (C_G * (mu * nu)⁻¹)
CausalSmith.Stat.SaPlmCumulantConverse.ordinaryContourPerturbationConstant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5825
theorem empirical_denominator_margin_of_population_margin

A population lower bound on a denominator transfers to its empirical counterpart: if the population denominator has modulus at least mu, the empirical denominator differs from it by at most d in modulus, and the estimation error d does not exceed the gap between mu and nu, then the empirical denominator has modulus at least nu.

Formal statement
Fhat F :
d mu nu :
hpopulation :
mu ≤ ‖F‖
herror :
‖Fhat - F‖ ≤ d
hsmall :
d ≤ mu - nu
nu ≤ ‖Fhat‖
Proof (Lean source)
lemma empirical_denominator_margin_of_population_margin {Fhat F : ℂ} {d mu nu : ℝ} (hpopulation : mu ≤ ‖F‖) (herror : ‖Fhat - F‖ ≤ d) (hsmall : d ≤ mu - nu) : nu ≤ ‖Fhat‖ := by have htriangle : ‖F‖ ≤ ‖Fhat - F‖ + ‖Fhat‖ := by calc ‖F‖ = ‖-(Fhat - F) + Fhat‖ := by congr 1; ring _ ≤ ‖-(Fhat - F)‖ + ‖Fhat‖ := norm_add_le _ _ _ = ‖Fhat - F‖ + ‖Fhat‖ := by rw [norm_neg] linarith
CausalSmith.Stat.SaPlmCumulantConverse.empirical_denominator_margin_of_population_margin · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5830
theorem norm_div_sub_div_le

A perturbation bound for a ratio of complex numbers. Suppose the population denominator has modulus at least mu and the empirical denominator has modulus at least nu, with both margins strictly positive; the population numerator has modulus at most C, with C nonnegative; the denominators differ by at most d, with d nonnegative; and the numerators differ by at most e, with e nonnegative. Then the two ratios differ by at most e divided by nu plus C times d divided by the product of mu and nu.

Formal statement
Fhat Ghat F G :
d e C mu nu :
hmu :
mu ≤ ‖F‖
hnu :
nu ≤ ‖Fhat‖
hmu0 :
0 < mu
hnu0 :
0 < nu
hG :
‖G‖ ≤ C
hC :
0 ≤ C
hF :
‖Fhat - F‖ ≤ d
hd :
0 ≤ d
hGh :
‖Ghat - G‖ ≤ e
he :
0 ≤ e
‖Ghat / Fhat - G / F‖ ≤ e / nu + C * d / (mu * nu)
Proof (Lean source)
lemma norm_div_sub_div_le {Fhat Ghat F G : ℂ} {d e C mu nu : ℝ} (hmu : mu ≤ ‖F‖) (hnu : nu ≤ ‖Fhat‖) (hmu0 : 0 < mu) (hnu0 : 0 < nu) (hG : ‖G‖ ≤ C) (hC : 0 ≤ C) (hF : ‖Fhat - F‖ ≤ d) (hd : 0 ≤ d) (hGh : ‖Ghat - G‖ ≤ e) (he : 0 ≤ e) : ‖Ghat / Fhat - G / F‖ ≤ e / nu + C * d / (mu * nu) := by have hF0 : F ≠ 0 := by intro h simp [h] at hmu linarith have hFhat0 : Fhat ≠ 0 := by intro h simp [h] at hnu linarith have hfirst : ‖(Ghat - G) / Fhat‖ ≤ e / nu := by rw [norm_div] apply (div_le_div_iff₀ (norm_pos_iff.mpr hFhat0) hnu0).2 nlinarith have hsecond : ‖G * (F - Fhat) / (Fhat * F)‖ ≤ C * d / (mu * nu) := by rw [norm_div, norm_mul, norm_mul, norm_sub_rev] have hnum : ‖G‖ * ‖Fhat - F‖ ≤ C * d := mul_le_mul hG hF (norm_nonneg _) hC have hden : mu * nu ≤ ‖Fhat‖ * ‖F‖ := by nlinarith [mul_le_mul hnu hmu hmu0.le (norm_nonneg Fhat)] exact div_le_div₀ (mul_nonneg hC hd) hnum (mul_pos hmu0 hnu0) hden calc ‖Ghat / Fhat - G / F‖ = ‖(Ghat - G) / Fhat + G * (F - Fhat) / (Fhat * F)‖ := by congr 1 field_simp ring _ ≤ ‖(Ghat - G) / Fhat‖ + ‖G * (F - Fhat) / (Fhat * F)‖ := norm_add_le _ _ _ ≤ e / nu + C * d / (mu * nu) := add_le_add hfirst hsecond
CausalSmith.Stat.SaPlmCumulantConverse.norm_div_sub_div_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5849
theorem circleIntegral_ratio_difference_bound

The ratio perturbation bound, integrated around a circle. Consider a circle of nonnegative radius rho centred at the origin, along with nonnegative error scales d and e and a nonnegative numerator bound C and strictly positive denominator margins mu and nu satisfying the requirement that the denominator error does not exceed the gap between the two margins. Suppose the empirical ratio is integrable around the circle, the population ratio is integrable around the circle, and at every point of the circle the population denominator has modulus at least mu, the population numerator has modulus at most C, the denominators differ by at most d, and the numerators differ by at most e. Then the two contour integrals differ by at most the circumference of the circle times the sum of e divided by nu and C times d divided by the product of mu and nu.

Formal statement
Fhat Ghat F G :
ℂ → ℂ
rho d e C mu nu :
hrho :
0 ≤ rho
hd :
0 ≤ d
he :
0 ≤ e
hC :
0 ≤ C
hmu0 :
0 < mu
hnu0 :
0 < nu
hsmall :
d ≤ mu - nu
hhat :
CircleIntegrable (fun z ↦ Ghat z / Fhat z) 0 rho
hpop :
CircleIntegrable (fun z ↦ G z / F z) 0 rho
hboundary :
∀ z ∈ sphere (0 : ℂ) rho,
mu ≤ ‖F z‖ ∧ ‖G z‖ ≤ C ∧ ‖Fhat z - F z‖ ≤ d ∧ ‖Ghat z - G z‖ ≤ e
‖circleIntegral (fun z ↦ Ghat z / Fhat z) 0 rho - circleIntegral (fun z ↦ G z / F z) 0 rho‖
≤ 2 * pi * rho * (e / nu + C * d / (mu * nu))
Proof (Lean source)
lemma circleIntegral_ratio_difference_bound {Fhat Ghat F G : ℂ → ℂ} {rho d e C mu nu : ℝ} (hrho : 0 ≤ rho) (hd : 0 ≤ d) (he : 0 ≤ e) (hC : 0 ≤ C) (hmu0 : 0 < mu) (hnu0 : 0 < nu) (hsmall : d ≤ mu - nu) (hhat : CircleIntegrable (fun z ↦ Ghat z / Fhat z) 0 rho) (hpop : CircleIntegrable (fun z ↦ G z / F z) 0 rho) (hboundary : ∀ z ∈ sphere (0 : ℂ) rho, mu ≤ ‖F z‖ ∧ ‖G z‖ ≤ C ∧ ‖Fhat z - F z‖ ≤ d ∧ ‖Ghat z - G z‖ ≤ e) : ‖circleIntegral (fun z ↦ Ghat z / Fhat z) 0 rho - circleIntegral (fun z ↦ G z / F z) 0 rho‖ ≤ 2 * pi * rho * (e / nu + C * d / (mu * nu)) := by rw [← circleIntegral.integral_sub hhat hpop] apply circleIntegral.norm_integral_le_of_norm_le_const hrho intro z hz rcases hboundary z hz with ⟨hmu, hG, hF, hGh⟩ exact norm_div_sub_div_le hmu (empirical_denominator_margin_of_population_margin hmu hF hsmall) hmu0 hnu0 hG hC hF hd hGh he
CausalSmith.Stat.SaPlmCumulantConverse.circleIntegral_ratio_difference_bound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5896
theorem thetaHatSpec_good_event_exact_contour_perturbation Lemma 13 in the paper ↗

The selected-circle ratio bound plus the separate finite rational midpoint error.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
F G :
ℂ → ℂ
d e C_G mu nu target :
htarget :
|target| ≤ p.Ctheta
hgood :
CanonicalSelectorGoodEvent p pStar cStar gcode data F G d e C_G mu nu
hratioIntegrable :
∀ j
if
selectedContour (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar)
= some j
then
CircleIntegrable (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 ((contourBank p pStar).rho j) ∧
CircleIntegrable (fun z ↦ G z / F z) 0 ((contourBank p pStar).rho j)
hidentify :
∀ j N
if
selectedContour (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar)
= some j
and
(pilotOutcome (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j).decoded
= some N
then
target
= ((((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ G z / F z) 0 ((contourBank p pStar).rho j)).re)
|thetaHatSpec p pStar cStar gcode data - target|
ordinaryContourPerturbationConstant p C_G mu nu * (d + e) + 1 / (max p.n 1 : ℝ)
Proof (Lean source)
lemma thetaHatSpec_good_event_exact_contour_perturbation (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (F G : ℂ → ℂ) (d e C_G mu nu target : ℝ) (htarget : |target| ≤ p.Ctheta) (hgood : CanonicalSelectorGoodEvent p pStar cStar gcode data F G d e C_G mu nu) (hratioIntegrable : ∀ j, selectedContour (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) = some j → CircleIntegrable (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 ((contourBank p pStar).rho j) ∧ CircleIntegrable (fun z ↦ G z / F z) 0 ((contourBank p pStar).rho j)) (hidentify : ∀ j N, selectedContour (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) = some j → (pilotOutcome (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j).decoded = some N → target = ((((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ G z / F z) 0 ((contourBank p pStar).rho j)).re)) : |thetaHatSpec p pStar cStar gcode data - target| ≤ ordinaryContourPerturbationConstant p C_G mu nu * (d + e) + 1 / (max p.n 1 : ℝ) := by rcases hgood with ⟨hd, he, hCG, hmu, hnu, hmuEq, hnuEq, hsmall, j, N, hj, hdecoded, hN, hevalMargin, hboundary⟩ let input := canonicalRepresentedInput p pStar cStar gcode data let B := contourBank p pStar let final := evaluationEnclosure input B j N have hmargin : 0 < (pilotModulus input B 1 j).lo := lt_of_lt_of_le (div_pos B.aStarRat_pos (by norm_num)) hevalMargin let ev := spectralEvaluationEvaluator input B j N ⟨(pilotModulus input B 1 j).lo, hmargin⟩ have hprogram : (ordinaryFiniteRationalResult p pStar cStar gcode data).raw = rationalMidpoint final.re := by simp only [selectedContour, pilotOutcome, canonicalRepresentedInput] at hj simp only [pilotOutcome, canonicalRepresentedInput] at hdecoded simp [ordinaryFiniteRationalResult, ordinarySpectralProgram, instrumentedSpectralProgram, spectralProgramWith, canonicalRepresentedInput, input, B, hj, hdecoded, hevalMargin, final] rw [dif_pos (by simpa [input, B, canonicalRepresentedInput] using hevalMargin)] have hNmax : max N 1 = N := max_eq_left hN have hNmaxReal : max (N : ℝ) 1 = N := max_eq_left (by exact_mod_cast hN) have hspec := ((representedNodeSpecifications p) pStar cStar gcode data).1 j have hevalSpec := hspec.2.2.2 N dsimp [EvaluationEnclosureSpecification, final, input, B] at hevalSpec rcases hevalSpec with ⟨hwidth, hcontains, _⟩ -- Restate with the bank in the syntactic form `contourBank p pStar` (the two -- spellings are definitionally equal) so that the `rho_value` rewrite in the -- `simpa` below can fire on it. have hevContains : (evaluationEnclosure input B j N).Contains (normalizedContourValue (spectralEvaluationEvaluator input B j N ⟨(pilotModulus input B 1 j).lo, hmargin⟩)) := (hcontains hmargin).2.1 have hsemantic : final.Contains (((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 (B.rho j)) := by simpa [normalizedContourValue, ev, spectralEvaluationEvaluator, input, B, hNmax, hNmaxReal, (contourBank p pStar).rho_value, spectralNumeratorMap_value_canonical, spectralDenominatorMap_value_canonical, circleContourIntegral_eq_circleIntegral] using hevContains have hmid := midpoint_error_le_half_width hsemantic.1 have hrhoPos : 0 < B.rho j := by have hR0 : 0 < zeroRadius p := by rw [← pStar.R0_value] exact lt_of_lt_of_le (by exact_mod_cast pStar.R0Name.lower_pos) pStar.R0Name.lower_le_value dsimp [B, contourBank] simp only [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value] positivity have hratio := circleIntegral_ratio_difference_bound (rho := B.rho j) (d := d) (e := e) (C := C_G) (mu := mu) (nu := nu) hrhoPos.le hd he hCG hmu hnu hsmall (hratioIntegrable j hj).1 (hratioIntegrable j hj).2 hboundary have hnormN : ‖((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹‖ = (N * (2 * Real.pi))⁻¹ := by simp [hN, Real.pi_pos.le] have hscaled : ‖((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 (B.rho j) - ((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ G z / F z) 0 (B.rho j)‖ ≤ B.rho j * (e / nu + C_G * d / (mu * nu)) / N := by rw [← mul_sub, norm_mul, hnormN] calc (N * (2 * Real.pi))⁻¹ * ‖circleIntegral (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 (B.rho j) - circleIntegral (fun z ↦ G z / F z) 0 (B.rho j)‖ ≤ (N * (2 * Real.pi))⁻¹ * (2 * Real.pi * B.rho j * (e / nu + C_G * d / (mu * nu))) := by gcongr _ = B.rho j * (e / nu + C_G * d / (mu * nu)) / N := by field_simp [show (N : ℝ) ≠ 0 by exact_mod_cast (Nat.ne_of_gt hN), Real.pi_ne_zero] have hclip : |thetaHatSpec p pStar cStar gcode data - target| ≤ |((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ) - target| := by rw [thetaHatSpec_eq_clip_finite_rational] have hC : -p.Ctheta ≤ p.Ctheta := by linarith [p.constants_pos.1] have htmem : target ∈ Icc (-p.Ctheta) p.Ctheta := ⟨neg_le_of_abs_le htarget, le_of_abs_le htarget⟩ have hcontract := Set.abs_projIcc_sub_projIcc (a := -p.Ctheta) (b := p.Ctheta) hC (c := ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ)) (d := target) rw [Set.projIcc_of_mem hC htmem] at hcontract simpa [projIcc, max_min_distrib_left, min_comm, max_comm, hC] using hcontract rw [hprogram] at hclip have hrealScaled : |(((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 (B.rho j)).re - target| ≤ B.rho j * (e / nu + C_G * d / (mu * nu)) / N := by rw [hidentify j N hj hdecoded] exact (Complex.abs_re_le_norm _).trans hscaled let empiricalTarget : ℝ := (((N : ℂ) * (2 * Real.pi : ℂ) * I)⁻¹ * circleIntegral (fun z ↦ semanticEmpiricalG p gcode data (spectralFold p.n 1) 0 z / semanticEmpiricalF p gcode data (spectralFold p.n 1) 0 z) 0 (B.rho j)).re calc |thetaHatSpec p pStar cStar gcode data - target| ≤ |((rationalMidpoint final.re : ℚ) : ℝ) - target| := hclip _ ≤ |((rationalMidpoint final.re : ℚ) : ℝ) - empiricalTarget| + |empiricalTarget - target| := abs_sub_le _ _ _ _ ≤ (final.re.width : ℝ) / 2 + B.rho j * (e / nu + C_G * d / (mu * nu)) / N := add_le_add hmid hrealScaled _ ≤ ordinaryContourPerturbationConstant p C_G mu nu * (d + e) + 1 / (max p.n 1 : ℝ) := by have hrho : B.rho j < searchRadius p := by dsimp [B, contourBank] simp only [CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value] rw [pStar.searchRadius_contract] have hjBound : (j : ℕ) ≤ 2 ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 2) := Nat.le_of_lt_succ j.isLt norm_num at hjBound ⊢ have hq := rat_grid_lt_one (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 2) (j : ℕ) hjBound norm_num at hq have hq' : (1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 3) < 1 := by simpa [Nat.add_assoc] using hq have hc : ((↑((1 / 4 : ℚ) + (j : ℕ) * (1 / 2 : ℚ) ^ (4 * positiveCeil (certifiedIntervalArithmetic.refine pStar.psietaName.name errorOne).hi ^ 2 * (positiveCeil (certifiedIntervalArithmetic.refine pStar.R1Name.name errorOne).hi + 2) ^ 3 + 3)) : ℝ) < (↑(1 : ℚ) : ℝ)) := Rat.cast_lt.mpr hq' simpa using hc have hreWidthQ : final.re.width ≤ 2 / (max p.n 1 : ℚ) := by change max final.re.width final.im.width ≤ 2 / (max p.n 1 : ℚ) at hwidth exact (le_max_left _ _).trans hwidth have hreWidthR : (final.re.width : ℝ) ≤ 2 / (max p.n 1 : ℝ) := by have hcast := (Rat.cast_le (K := ℝ)).mpr hreWidthQ norm_num at hcast ⊢ push_cast at hcast simpa using hcast have hwidthHalf : (final.re.width : ℝ) / 2 ≤ 1 / (max p.n 1 : ℝ) := by rw [div_le_iff₀ (by norm_num : (0 : ℝ) < 2)] simpa [div_eq_mul_inv, mul_comm] using hreWidthR dsimp [ordinaryContourPerturbationConstant] have hNreal : (1 : ℝ) ≤ N := by exact_mod_cast hN have hratio' : B.rho j * (e / nu + C_G * d / (mu * nu)) / N ≤ searchRadius p * max nu⁻¹ (C_G * (mu * nu)⁻¹) * (d + e) := by have hnuInv : 0 ≤ nu⁻¹ := inv_nonneg.mpr hnu.le have hmunuInv : 0 ≤ (mu * nu)⁻¹ := inv_nonneg.mpr (mul_nonneg hmu.le hnu.le) calc B.rho j * (e / nu + C_G * d / (mu * nu)) / N ≤ searchRadius p * (e / nu + C_G * d / (mu * nu)) := by have hsum : 0 ≤ e / nu + C_G * d / (mu * nu) := by positivity calc _ ≤ B.rho j * (e / nu + C_G * d / (mu * nu)) := div_le_self (mul_nonneg hrhoPos.le hsum) hNreal _ ≤ _ := mul_le_mul_of_nonneg_right hrho.le hsum _ ≤ _ := by have heBound : e / nu ≤ max nu⁻¹ (C_G * (mu * nu)⁻¹) * e := by rw [div_eq_mul_inv] simpa [mul_comm] using mul_le_mul_of_nonneg_right (le_max_left nu⁻¹ (C_G * (mu * nu)⁻¹)) he have hdBound : C_G * d / (mu * nu) ≤ max nu⁻¹ (C_G * (mu * nu)⁻¹) * d := by calc C_G * d / (mu * nu) = (C_G * (mu * nu)⁻¹) * d := by ring _ ≤ _ := mul_le_mul_of_nonneg_right (le_max_right nu⁻¹ (C_G * (mu * nu)⁻¹)) hd have hR : 0 ≤ searchRadius p := by linarith [hrhoPos] nlinarith simpa [mul_inv, mul_assoc, mul_comm, mul_left_comm, add_comm] using add_le_add hwidthHalf hratio'
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_good_event_exact_contour_perturbation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SelectorSoundness.lean:5933
Helpers.SineRisk 4 declarations Generic clipped sine-ratio risk reductions

Generic clipped sine-ratio risk reductions

def clippedRatioFromScores

The clipped ratio estimator built from two per-observation scores: average the denominator score and the remainder score over the sample; if the average denominator reaches the threshold, return the ratio of the target value times the average denominator plus the average remainder to the average denominator, truncated to the symmetric interval given by the clipping bound; otherwise return zero.

Definition (Lean source)
def clippedRatioFromScores {Ω : Type*} (Ctheta theta : ℝ) (n : ℕ) (threshold : ℝ) (W R : Ω → ℝ) (data : Fin n → Ω) : ℝ := let den := (n : ℝ)⁻¹ * ∑ i, W (data i) let rem := (n : ℝ)⁻¹ * ∑ i, R (data i) if threshold ≤ den then min (max ((theta * den + rem) / den) (-Ctheta)) Ctheta else 0
CausalSmith.Stat.SaPlmCumulantConverse.clippedRatioFromScores · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineRisk.lean:11
theorem clippedRatioFromScores_sq_le Lemma 6 in the paper ↗

With at least one observation, a target value inside the clipping bound, a strictly positive denominator level and a population denominator mean of at least half that level, the squared error of the clipped ratio estimator run at a threshold of one quarter of the level is at most sixteen over the squared level, times the sum of the squared sample average of the remainder scores and the squared clipping bound times the squared sample average of the centered denominator scores.

Formal statement
Ω :
Type*
Ctheta theta A :
n :
W R :
Ω → ℝ
muW :
hn :
0 < n
htheta :
|theta| ≤ Ctheta
hA :
0 < A
hmu :
A / 2 ≤ muW
data :
Fin n → Ω
(clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2
≤ 16 / A ^ 2 * (((n : ℝ)⁻¹ * ∑ i, R (data i)) ^ 2 + Ctheta ^ 2 * (((n : ℝ)⁻¹ * ∑ i, (W (data i) - muW)) ^ 2))
Proof (Lean source)
lemma clippedRatioFromScores_sq_le {Ω : Type*} (Ctheta theta A : ℝ) (n : ℕ) (W R : Ω → ℝ) (muW : ℝ) (hn : 0 < n) (htheta : |theta| ≤ Ctheta) (hA : 0 < A) (hmu : A / 2 ≤ muW) (data : Fin n → Ω) : (clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2 ≤ 16 / A ^ 2 * (((n : ℝ)⁻¹ * ∑ i, R (data i)) ^ 2 + Ctheta ^ 2 * (((n : ℝ)⁻¹ * ∑ i, (W (data i) - muW)) ^ 2)) := by let den := (n : ℝ)⁻¹ * ∑ i, W (data i) let rem := (n : ℝ)⁻¹ * ∑ i, R (data i) have hcenter : (n : ℝ)⁻¹ * ∑ i, (W (data i) - muW) = den - muW := by simp only [Finset.sum_sub_distrib, Finset.sum_const, Finset.card_fin, nsmul_eq_mul] dsimp [den] have hnR : (n : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hn field_simp rw [hcenter] unfold clippedRatioFromScores dsimp only split_ifs with hgood · have hden : 0 < den := lt_of_lt_of_le (by positivity : 0 < A / 4) hgood have hclip : |min (max ((theta * den + rem) / den) (-Ctheta)) Ctheta - theta| ≤ |((theta * den + rem) / den) - theta| := by have hθclip : min (max theta (-Ctheta)) Ctheta = theta := by rw [max_eq_left] · exact min_eq_left (le_trans (le_abs_self theta) htheta) · linarith [neg_le_of_abs_le htheta] calc _ = |min (max ((theta * den + rem) / den) (-Ctheta)) Ctheta - min (max theta (-Ctheta)) Ctheta| := by rw [hθclip] _ ≤ max |max ((theta * den + rem) / den) (-Ctheta) - max theta (-Ctheta)| |Ctheta - Ctheta| := abs_min_sub_min_le_max _ _ _ _ _ ≤ |((theta * den + rem) / den) - theta| := by simp only [sub_self, abs_zero, max_le_iff] exact ⟨(abs_max_sub_max_le_max _ _ _ _).trans (by simp), abs_nonneg _⟩ have hratio : ((theta * den + rem) / den) - theta = rem / den := by field_simp [hden.ne'] ring have hsquare := sq_le_sq₀ (abs_nonneg _) (abs_nonneg _) |>.2 hclip rw [sq_abs, sq_abs, hratio] at hsquare calc _ ≤ (rem / den) ^ 2 := hsquare _ ≤ 16 / A ^ 2 * rem ^ 2 := by rw [div_pow] have hdenSq : (A / 4) ^ 2 ≤ den ^ 2 := sq_le_sq₀ (by positivity) hden.le |>.2 hgood have hd2 : 0 < den ^ 2 := sq_pos_of_pos hden rw [div_le_iff₀ hd2] field_simp [hA.ne'] nlinarith [sq_nonneg rem] _ ≤ 16 / A ^ 2 * (rem ^ 2 + Ctheta ^ 2 * (den - muW) ^ 2) := by have hc : 0 ≤ 16 / A ^ 2 := by positivity have hp : 0 ≤ Ctheta ^ 2 * (den - muW) ^ 2 := mul_nonneg (sq_nonneg _) (sq_nonneg _) nlinarith · have hbad : den < A / 4 := lt_of_not_ge hgood have hdev : A / 4 ≤ muW - den := by linarith have hC : 0 ≤ Ctheta := (abs_nonneg theta).trans htheta have hthetaSq : theta ^ 2 ≤ Ctheta ^ 2 := by have hu : theta ≤ Ctheta := (le_abs_self theta).trans htheta have hl : -Ctheta ≤ theta := by linarith [neg_le_of_abs_le htheta] nlinarith have hfail : Ctheta ^ 2 ≤ 16 / A ^ 2 * (Ctheta ^ 2 * (den - muW) ^ 2) := by field_simp [hA.ne'] have hsq : A ^ 2 ≤ 16 * (den - muW) ^ 2 := by nlinarith [sq_nonneg (4 * (muW - den) - A)] nlinarith [mul_le_mul_of_nonneg_left hsq (sq_nonneg Ctheta)] calc (0 - theta) ^ 2 = theta ^ 2 := by ring _ ≤ Ctheta ^ 2 := hthetaSq _ ≤ 16 / A ^ 2 * (Ctheta ^ 2 * (den - muW) ^ 2) := hfail _ ≤ 16 / A ^ 2 * (rem ^ 2 + Ctheta ^ 2 * (den - muW) ^ 2) := by have hc : 0 ≤ 16 / A ^ 2 := by positivity nlinarith [sq_nonneg rem]
CausalSmith.Stat.SaPlmCumulantConverse.clippedRatioFromScores_sq_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineRisk.lean:28
theorem clippedRatioFromScores_sq_le_global

Whenever the target value lies inside the clipping bound, the squared error of the clipped ratio estimator never exceeds four times the squared clipping bound, on every sample and whatever the denominator level. This is the crude fallback used where the sharp bound is unavailable.

Formal statement
Ω :
Type*
Ctheta theta A :
n :
W R :
Ω → ℝ
muW :
htheta :
|theta| ≤ Ctheta
data :
Fin n → Ω
(clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2 ≤ 4 * Ctheta ^ 2
Proof (Lean source)
lemma clippedRatioFromScores_sq_le_global {Ω : Type*} (Ctheta theta A : ℝ) (n : ℕ) (W R : Ω → ℝ) (muW : ℝ) (htheta : |theta| ≤ Ctheta) (data : Fin n → Ω) : (clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2 ≤ 4 * Ctheta ^ 2 := by have hC : 0 ≤ Ctheta := (abs_nonneg theta).trans htheta unfold clippedRatioFromScores dsimp only split_ifs · have hlo : -Ctheta ≤ min (max ((theta * ((n : ℝ)⁻¹ * ∑ i, W (data i)) + (n : ℝ)⁻¹ * ∑ i, R (data i)) / ((n : ℝ)⁻¹ * ∑ i, W (data i))) (-Ctheta)) Ctheta := le_min (le_trans (le_max_right _ _) (le_refl _)) (by linarith) have hhi : min (max ((theta * ((n : ℝ)⁻¹ * ∑ i, W (data i)) + (n : ℝ)⁻¹ * ∑ i, R (data i)) / ((n : ℝ)⁻¹ * ∑ i, W (data i))) (-Ctheta)) Ctheta ≤ Ctheta := min_le_right _ _ have htlo : -Ctheta ≤ theta := by linarith [neg_le_of_abs_le htheta] have hthi : theta ≤ Ctheta := (le_abs_self theta).trans htheta nlinarith [sq_nonneg (min (max ((theta * ((n : ℝ)⁻¹ * ∑ i, W (data i)) + (n : ℝ)⁻¹ * ∑ i, R (data i)) / ((n : ℝ)⁻¹ * ∑ i, W (data i))) (-Ctheta)) Ctheta - theta)] · have ht : theta ^ 2 ≤ Ctheta ^ 2 := by have htlo : -Ctheta ≤ theta := by linarith [neg_le_of_abs_le htheta] have hthi : theta ≤ Ctheta := (le_abs_self theta).trans htheta nlinarith nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.clippedRatioFromScores_sq_le_global · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineRisk.lean:114
theorem clippedRatioFromScores_lintegral_le

For an independent sample of size at least one from a probability law, with a target value inside the clipping bound, a strictly positive denominator level and a population denominator mean of at least half that level, and with measurable and square-integrable denominator and remainder scores whose population means are that denominator mean and zero respectively, the expected squared error of the clipped ratio estimator run at a threshold of one quarter of the level is at most sixteen over the squared level, divided by the sample size, times the sum of the second moment of the remainder score and the squared clipping bound times the second moment of the denominator score.

Formal statement
Ω :
Ctheta theta A :
n :
W R :
Ω → ℝ
muW :
hn :
0 < n
htheta :
|theta| ≤ Ctheta
hA :
0 < A
hmu :
A / 2 ≤ muW
hWmeas :
hRmeas :
hW :
MemLp W 2 P
hR :
MemLp R 2 P
hWmean :
∫ o, W o ∂P = muW
hRmean :
∫ o, R o ∂P = 0
∫⁻ data : Fin n → Ω, ofReal ((clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P)
ofReal (16 / A ^ 2) * (n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 P).toReal ^ 2) + ofReal (Ctheta ^ 2) * ofReal ((eLpNorm W 2 P).toReal ^ 2))
Proof (Lean source)
lemma clippedRatioFromScores_lintegral_le {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] (Ctheta theta A : ℝ) (n : ℕ) (W R : Ω → ℝ) (muW : ℝ) (hn : 0 < n) (htheta : |theta| ≤ Ctheta) (hA : 0 < A) (hmu : A / 2 ≤ muW) (hWmeas : Measurable W) (hRmeas : Measurable R) (hW : MemLp W 2 P) (hR : MemLp R 2 P) (hWmean : ∫ o, W o ∂P = muW) (hRmean : ∫ o, R o ∂P = 0) : ∫⁻ data : Fin n → Ω, ofReal ((clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P) ≤ ofReal (16 / A ^ 2) * (n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 P).toReal ^ 2) + ofReal (Ctheta ^ 2) * ofReal ((eLpNorm W 2 P).toReal ^ 2)) := by let rbar : (Fin n → Ω) → ℝ := fun data ↦ (n : ℝ)⁻¹ * ∑ i, (R (data i) - ∫ o, R o ∂P) let wbar : (Fin n → Ω) → ℝ := fun data ↦ (n : ℝ)⁻¹ * ∑ i, (W (data i) - ∫ o, W o ∂P) have hr := pi_centered_average_sq_lintegral_le (ι := Fin n) (P := P) (by simpa using hn) hR have hw := pi_centered_average_sq_lintegral_le (ι := Fin n) (P := P) (by simpa using hn) hW have hrbarMeas : Measurable rbar := by dsimp [rbar] fun_prop have hwbarMeas : Measurable wbar := by dsimp [wbar] fun_prop have hpoint : ∀ data : Fin n → Ω, ofReal ((clippedRatioFromScores Ctheta theta n (A / 4) W R data - theta) ^ 2) ≤ ofReal (16 / A ^ 2) * (ofReal (rbar data ^ 2) + ofReal (Ctheta ^ 2) * ofReal (wbar data ^ 2)) := by intro data apply (ENNReal.ofReal_le_ofReal (clippedRatioFromScores_sq_le Ctheta theta A n W R muW hn htheta hA hmu data)).trans_eq rw [ENNReal.ofReal_mul (by positivity : 0 ≤ 16 / A ^ 2)] rw [ENNReal.ofReal_add (sq_nonneg _) (mul_nonneg (sq_nonneg _) (sq_nonneg _))] rw [ENNReal.ofReal_mul (sq_nonneg Ctheta)] simp only [rbar, wbar, hRmean, hWmean, sub_zero] refine (lintegral_mono hpoint).trans ?_ rw [lintegral_const_mul''] rw [lintegral_add_left (hrbarMeas.pow_const 2).ennreal_ofReal] rw [lintegral_const_mul''] calc ofReal (16 / A ^ 2) * ((∫⁻ data, ofReal (rbar data ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P)) + ofReal (Ctheta ^ 2) * ∫⁻ data, ofReal (wbar data ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P)) ≤ ofReal (16 / A ^ 2) * ((n : ENNReal)⁻¹ * ofReal ((eLpNorm R 2 P).toReal ^ 2) + ofReal (Ctheta ^ 2) * ((n : ENNReal)⁻¹ * ofReal ((eLpNorm W 2 P).toReal ^ 2))) := by apply mul_le_mul_right apply add_le_add · simpa [rbar, Fintype.card_fin] using hr · apply mul_le_mul_right simpa [wbar, Fintype.card_fin] using hw _ = _ := by ring all_goals fun_prop
CausalSmith.Stat.SaPlmCumulantConverse.clippedRatioFromScores_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineRisk.lean:148
Helpers.SineScore 22 declarations Bounded sine-score estimators

Bounded sine-score estimators

def empiricalMean

The sample average of a real-valued function of one observation: the sum of its values over the units in the sample, divided by the sample size.

Definition (Lean source)
def empiricalMean (n : ℕ) (f : Obs Xspace → ℝ) (data : Fin n → Obs Xspace) : ℝ := (n : ℝ)⁻¹ * ∑ i, f (data i)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalMean · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:23

Shared clipped ratio engine for a sine score.

Definition (Lean source)
def thetaHatAt (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t threshold : ℝ) (data : Fin n → Obs Xspace) : ℝ := let den := empiricalMean n (fun o ↦ learnedResidual p m n o * sin (t * learnedResidual p m n o)) data let num := empiricalMean n (fun o ↦ outcome o * sin (t * learnedResidual p m n o)) data if threshold ≤ den then min (max (num / den) (-p.Ctheta)) p.Ctheta else 0
def thetaHatSin

Fixed-mixture sine estimator at frequency pi/2.

Definition (Lean source)
-- @node: def:sine-estimator def thetaHatSin (p : Parameters) (m : Model (Xspace := Xspace) p) (data : Fin p.n → Obs Xspace) : ℝ := thetaHatAt p m p.n (pi / 2) (exp (-pi ^ 2 / 8) / 4) data
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSin · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:37
def rademacherLaw

Symmetric Rademacher probability law.

Definition (Lean source)
def rademacherLaw : Measure ℝ := (ofReal (1 / 2 : ℝ)) • Measure.dirac (-1 : ℝ) + (ofReal (1 / 2 : ℝ)) • Measure.dirac (1 : ℝ)
CausalSmith.Stat.SaPlmCumulantConverse.rademacherLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:44
instance instIsProbabilityMeasureRealRademacherLaw

The symmetric Rademacher law — equal mass one half on minus one and on plus one — is a probability measure, its total mass being one.

Definition (Lean source)
instance : IsProbabilityMeasure rademacherLaw where measure_univ := by simpa [rademacherLaw] using ENNReal.inv_two_add_inv_two
CausalSmith.Stat.SaPlmCumulantConverse.instIsProbabilityMeasureRealRademacherLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:49
theorem complexMGF_rademacherLaw

The symmetric Rademacher law has complex MGF cosh.

Formal statement
z :
Proof (Lean source)
lemma complexMGF_rademacherLaw (z : ℂ) : complexMGF id rademacherLaw z = cosh z := by unfold complexMGF rademacherLaw have hneg : Integrable (fun ω : ℝ ↦ exp (z * (id ω : ℂ))) (ofReal (1 / 2 : ℝ) • Measure.dirac (-1 : ℝ)) := (integrable_dirac (by simp)).smul_measure (by simp) have hpos : Integrable (fun ω : ℝ ↦ exp (z * (id ω : ℂ))) (ofReal (1 / 2 : ℝ) • Measure.dirac (1 : ℝ)) := (integrable_dirac (by simp)).smul_measure (by simp) simp only [id_eq] at hneg hpos ⊢ rw [integral_add_measure hneg hpos, integral_smul_measure, integral_smul_measure] change ((ofReal (1 / 2 : ℝ)).toReal : ℂ) * (∫ x : ℝ, exp (z * (x : ℂ)) ∂Measure.dirac (-1)) + ((ofReal (1 / 2 : ℝ)).toReal : ℂ) * (∫ x : ℝ, exp (z * (x : ℂ)) ∂Measure.dirac 1) = _ simp only [integral_dirac, ENNReal.toReal_ofReal (by norm_num : (0 : ℝ) ≤ 1 / 2)] rw [cosh] norm_num ring
CausalSmith.Stat.SaPlmCumulantConverse.complexMGF_rademacherLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:54
instance gaussianReal_one_isProbabilityMeasure

The standard Gaussian, written with the explicit variance literal ⟨1, zero_le_one⟩, is a probability measure.

Definition (Lean source)
instance gaussianReal_one_isProbabilityMeasure : IsProbabilityMeasure (gaussianReal 0 ⟨1, zero_le_one⟩) := instIsProbabilityMeasureGaussianReal _ _
CausalSmith.Stat.SaPlmCumulantConverse.gaussianReal_one_isProbabilityMeasure · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:76

Gaussian--Rademacher treatment-noise path.

Definition (Lean source)
def gaussianRademacherLaw (a : ℝ) : Measure ℝ := Measure.map (fun x : ℝ × ℝ ↦ sqrt (1 - a ^ 2) * x.1 + a * x.2) ((gaussianReal 0 ⟨1, zero_le_one⟩).prod rademacherLaw)
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacherLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:88
theorem complexMGF_gaussianRademacherLaw

The Gaussian--Rademacher path has the advertised product MGF.

Formal statement
a :
ha0 :
0 < a
ha1 :
a ≤ 1
z :
= exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)
Proof (Lean source)
lemma complexMGF_gaussianRademacherLaw {a : ℝ} (ha0 : 0 < a) (ha1 : a ≤ 1) (z : ℂ) : complexMGF id (gaussianRademacherLaw a) z = exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z) := by unfold gaussianRademacherLaw rw [complexMGF_id_map (by fun_prop)] unfold complexMGF simp only [Complex.ofReal_add, Complex.ofReal_mul] rw [show (fun x : ℝ × ℝ ↦ exp (z * (↑(sqrt (1 - a ^ 2)) * ↑x.1 + ↑a * ↑x.2))) = fun x ↦ exp ((z * ↑(sqrt (1 - a ^ 2))) * ↑x.1) * exp ((z * ↑a) * ↑x.2) by funext x rw [mul_add, Complex.exp_add] congr 2 <;> ring] rw [show (∫ x : ℝ × ℝ, exp ((z * ↑(sqrt (1 - a ^ 2))) * ↑x.1) * exp ((z * ↑a) * ↑x.2) ∂(gaussianReal 0 ⟨1, zero_le_one⟩).prod rademacherLaw) = (∫ x : ℝ, exp ((z * ↑(sqrt (1 - a ^ 2))) * ↑x) ∂gaussianReal 0 ⟨1, zero_le_one⟩) * ∫ y : ℝ, exp ((z * ↑a) * ↑y) ∂rademacherLaw by simpa using (integral_prod_mul (μ := gaussianReal 0 ⟨1, zero_le_one⟩) (ν := rademacherLaw) (L := ℂ) (fun x : ℝ ↦ exp ((z * ↑(sqrt (1 - a ^ 2))) * ↑x)) (fun y : ℝ ↦ exp ((z * ↑a) * ↑y)))] change complexMGF id (gaussianReal 0 ⟨1, zero_le_one⟩) (z * ↑(sqrt (1 - a ^ 2))) * complexMGF id rademacherLaw (z * ↑a) = _ -- The variance argument is the anonymous-constructor term `⟨1, zero_le_one⟩`, -- which blocks rewriting inside the goal; generalise it away first. have hgauss : ∀ v : NNReal, v = 1 → ∀ w : ℂ, complexMGF id (gaussianReal 0 v) w = exp (w ^ 2 / 2) := by rintro v rfl w rw [complexMGF_id_gaussianReal] norm_num refine (congrArg₂ (· * ·) (hgauss _ rfl (z * ↑(sqrt (1 - a ^ 2)))) (complexMGF_rademacherLaw (z * ↑a))).trans ?_ have hsqrt : sqrt (1 - a ^ 2) ^ 2 = 1 - a ^ 2 := by rw [Real.sq_sqrt] nlinarith have hsqrtC : (↑(sqrt (1 - a ^ 2)) : ℂ) ^ 2 = ofReal (1 - a ^ 2) := by calc (↑(sqrt (1 - a ^ 2)) : ℂ) ^ 2 = ofReal (sqrt (1 - a ^ 2) ^ 2) := by norm_cast _ = ofReal (1 - a ^ 2) := congrArg ofReal hsqrt apply congrArg₂ (· * ·) · apply congrArg exp rw [mul_pow, hsqrtC] ring · congr 1 ring
CausalSmith.Stat.SaPlmCumulantConverse.complexMGF_gaussianRademacherLaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:94
theorem gaussianRademacher_integrable_exp

Every real exponential moment exists along the explicit path.

Formal statement
a t :
Integrable (fun x : ℝ ↦ exp (t * x)) (gaussianRademacherLaw a)
Proof (Lean source)
lemma gaussianRademacher_integrable_exp (a t : ℝ) : Integrable (fun x : ℝ ↦ exp (t * x)) (gaussianRademacherLaw a) := by unfold gaussianRademacherLaw apply (integrable_map_measure (by fun_prop) (by fun_prop)).2 have hG : Integrable (fun x : ℝ ↦ exp ((t * sqrt (1 - a ^ 2)) * x)) (gaussianReal 0 ⟨1, zero_le_one⟩) := integrable_exp_mul_gaussianReal _ have hR : Integrable (fun y : ℝ ↦ exp ((t * a) * y)) rademacherLaw := by unfold rademacherLaw rw [integrable_add_measure] constructor · exact (integrable_dirac (by simp)).smul_measure (by simp) · exact (integrable_dirac (by simp)).smul_measure (by simp) have hp := Integrable.mul_prod hG hR apply hp.congr filter_upwards [] with x rw [← Real.exp_add] congr 1 ring
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacher_integrable_exp · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:150
theorem iteratedDeriv_three_scaled_tanh

The third derivative at zero of a tanh(a z) is -2a^4.

Formal statement
a :
iteratedDeriv 3 (fun z : ℂ ↦ (a : ℂ) * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z)) 0
= (-2 * a ^ 4 : ℝ)
Proof (Lean source)
lemma iteratedDeriv_three_scaled_tanh (a : ℝ) : iteratedDeriv 3 (fun z : ℂ ↦ (a : ℂ) * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z)) 0 = (-2 * a ^ 4 : ℝ) := by let q0 : ℂ → ℂ := fun z ↦ (a : ℂ) * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z) let q1 : ℂ → ℂ := fun z ↦ (a : ℂ) ^ 2 / cosh ((a : ℂ) * z) ^ 2 let q2 : ℂ → ℂ := fun z ↦ -2 * (a : ℂ) ^ 3 * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z) ^ 3 have hcosh : ∀ᶠ z : ℂ in 𝓝 0, cosh ((a : ℂ) * z) ≠ 0 := by apply (isOpen_ne.preimage (Complex.continuous_cosh.comp (continuous_const.mul continuous_id))).mem_nhds simp have hd01 : deriv q0 =ᶠ[𝓝 0] q1 := by filter_upwards [hcosh] with z hz have hlin : HasDerivAt (fun w : ℂ ↦ (a : ℂ) * w) (a : ℂ) z := by simpa using (hasDerivAt_id z).const_mul (a : ℂ) have hsinh := (Complex.hasDerivAt_sinh ((a : ℂ) * z)).comp z hlin have hcos := (Complex.hasDerivAt_cosh ((a : ℂ) * z)).comp z hlin have hnum := hsinh.const_mul (a : ℂ) rw [show deriv q0 z = (((a : ℂ) ^ 2 * cosh ((a : ℂ) * z)) * cosh ((a : ℂ) * z) - ((a : ℂ) * sinh ((a : ℂ) * z)) * ((a : ℂ) * sinh ((a : ℂ) * z))) / cosh ((a : ℂ) * z) ^ 2 from ((hnum.fun_div hcos hz).congr_deriv (by simp only [Function.comp_apply]; ring)).deriv] dsimp [q1] field_simp rw [Complex.cosh_sq_sub_sinh_sq] ring have hd12 : deriv q1 =ᶠ[𝓝 0] q2 := by filter_upwards [hcosh] with z hz have hlin : HasDerivAt (fun w : ℂ ↦ (a : ℂ) * w) (a : ℂ) z := by simpa using (hasDerivAt_id z).const_mul (a : ℂ) have hcos := (Complex.hasDerivAt_cosh ((a : ℂ) * z)).comp z hlin have hden := hcos.fun_pow 2 rw [show deriv q1 z = -(a : ℂ) ^ 2 * (2 * cosh ((a : ℂ) * z) * ((a : ℂ) * sinh ((a : ℂ) * z))) / (cosh ((a : ℂ) * z) ^ 2) ^ 2 from (((hasDerivAt_const z ((a : ℂ) ^ 2)).fun_div hden (pow_ne_zero 2 hz)).congr_deriv (by simp only [Function.comp_apply, Pi.pow_apply]; ring)).deriv] dsimp [q2] field_simp have hd2 : deriv q2 0 = (-2 * a ^ 4 : ℝ) := by have hlin : HasDerivAt (fun w : ℂ ↦ (a : ℂ) * w) (a : ℂ) 0 := by simpa using (hasDerivAt_id 0).const_mul (a : ℂ) have hsinh := (Complex.hasDerivAt_sinh ((a : ℂ) * 0)).comp 0 hlin have hcos := (Complex.hasDerivAt_cosh ((a : ℂ) * 0)).comp 0 hlin have hnum := hsinh.const_mul (-2 * (a : ℂ) ^ 3) have hden := hcos.fun_pow 3 dsimp [q2] rw [show deriv (fun z : ℂ ↦ -2 * (a : ℂ) ^ 3 * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z) ^ 3) 0 = -2 * (a : ℂ) ^ 4 from ((hnum.fun_div hden (by simp)).congr_deriv (by simp only [Function.comp_apply]; norm_num; ring)).deriv] norm_num change iteratedDeriv 3 q0 0 = (-2 * a ^ 4 : ℝ) rw [show 3 = 2 + 1 by omega, iteratedDeriv_succ'] rw [hd01.iteratedDeriv_eq 2] rw [show 2 = 1 + 1 by omega, iteratedDeriv_succ'] rw [hd12.iteratedDeriv_eq 1] simpa [iteratedDeriv_succ] using hd2
CausalSmith.Stat.SaPlmCumulantConverse.iteratedDeriv_three_scaled_tanh · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:172
theorem gaussianRademacher_logMGF_fourth

The fourth logarithmic derivative of the Gaussian--Rademacher MGF is the Rademacher fourth cumulant -2a^4.

Formal statement
a c :
(iteratedDeriv 4 (fun z : ℂ ↦ log (exp ((c : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z))) 0).re
= -2 * a ^ 4
Proof (Lean source)
lemma gaussianRademacher_logMGF_fourth (a c : ℝ) : (iteratedDeriv 4 (fun z : ℂ ↦ log (exp ((c : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z))) 0).re = -2 * a ^ 4 := by let F : ℂ → ℂ := fun z ↦ exp ((c : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z) let L : ℂ → ℂ := fun z ↦ log (F z) let q : ℂ → ℂ := fun z ↦ (c : ℂ) * z + (a : ℂ) * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z) have hslit : ∀ᶠ z : ℂ in 𝓝 0, F z ∈ Complex.slitPlane := by have hcont : ContinuousAt F 0 := by dsimp [F]; fun_prop exact hcont.eventually (Complex.isOpen_slitPlane.mem_nhds (by simpa [F])) have hderiv : deriv L =ᶠ[𝓝 0] q := by filter_upwards [hslit] with z hz have hzcosh : cosh ((a : ℂ) * z) ≠ 0 := by intro hzero have : F z = 0 := by simp [F, hzero] rw [this] at hz simpa using hz have hsq := (hasDerivAt_id z).fun_pow 2 have hquad : HasDerivAt (fun w : ℂ ↦ (c : ℂ) * w ^ 2 / 2) ((c : ℂ) * z) z := ((hsq.const_mul (c : ℂ)).div_const 2).congr_deriv (by simp only [id_eq]; ring) have hexp := (Complex.hasDerivAt_exp ((c : ℂ) * z ^ 2 / 2)).comp z hquad have hlin : HasDerivAt (fun w : ℂ ↦ (a : ℂ) * w) (a : ℂ) z := by simpa using (hasDerivAt_id z).const_mul (a : ℂ) have hcos := (Complex.hasDerivAt_cosh ((a : ℂ) * z)).comp z hlin have hF : HasDerivAt F (exp ((c : ℂ) * z ^ 2 / 2) * ((c : ℂ) * z) * cosh ((a : ℂ) * z) + exp ((c : ℂ) * z ^ 2 / 2) * (sinh ((a : ℂ) * z) * (a : ℂ))) z := by exact hexp.fun_mul hcos change deriv (log ∘ F) z = q z rw [Complex.deriv_log_comp_eq_logDeriv hF.differentiableAt hz] simp only [logDeriv, Pi.div_apply, hF.deriv] dsimp [F, q] have hzcosh' : cosh (z * (a : ℂ)) ≠ 0 := by simpa [mul_comm] using hzcosh field_simp [Complex.exp_ne_zero, hzcosh'] change (iteratedDeriv 4 L 0).re = -2 * a ^ 4 rw [show 4 = 3 + 1 by omega, iteratedDeriv_succ'] rw [hderiv.iteratedDeriv_eq 3] have hq : q = (fun z : ℂ ↦ (c : ℂ) * z) + (fun z : ℂ ↦ (a : ℂ) * sinh ((a : ℂ) * z) / cosh ((a : ℂ) * z)) := by funext z rfl rw [hq, iteratedDeriv_add (by fun_prop) (by apply ContDiffAt.div (by fun_prop) (by fun_prop) simp)] rw [show iteratedDeriv 3 (fun z : ℂ ↦ (c : ℂ) * z) 0 = 0 by rw [iteratedDeriv_const_mul_field] norm_num [iteratedDeriv_succ]] rw [iteratedDeriv_three_scaled_tanh] norm_num [Complex.mul_re] calc ((↑a : ℂ) ^ 4).re = (ofReal (a ^ 4)).re := by congr 1 norm_cast _ = a ^ 4 := Complex.ofReal_re _
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacher_logMGF_fourth · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:243
theorem treatmentMGF_eq_gaussianRademacher

Transport the explicit path transform across the model's noise law.

Formal statement
m :
Model (Xspace := Xspace) p
a :
ha0 :
0 < a
ha1 :
a ≤ 1
hlaw :
m.P.map (eta p m) = gaussianRademacherLaw a
= fun z ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)
Proof (Lean source)
lemma treatmentMGF_eq_gaussianRademacher (p : Parameters) (m : Model (Xspace := Xspace) p) {a : ℝ} (ha0 : 0 < a) (ha1 : a ≤ 1) (hlaw : m.P.map (eta p m) = gaussianRademacherLaw a) : treatmentMGF p m = fun z ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z) := by funext z unfold treatmentMGF rw [← complexMGF_id_map (by unfold eta treatment covariate exact (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst)).aemeasurable), hlaw] exact complexMGF_gaussianRademacherLaw ha0 ha1 z
CausalSmith.Stat.SaPlmCumulantConverse.treatmentMGF_eq_gaussianRademacher · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:307
theorem model_gaussianRademacher_fourth_cumulant

The model cumulants inherit the explicit fourth logarithmic derivative.

Formal statement
m :
Model (Xspace := Xspace) p
a :
ha0 :
0 < a
ha1 :
a ≤ 1
hlaw :
m.P.map (eta p m) = gaussianRademacherLaw a
fourthCumulant p m = -2 * a ^ 4
Proof (Lean source)
lemma model_gaussianRademacher_fourth_cumulant (p : Parameters) (m : Model (Xspace := Xspace) p) {a : ℝ} (ha0 : 0 < a) (ha1 : a ≤ 1) (hlaw : m.P.map (eta p m) = gaussianRademacherLaw a) : fourthCumulant p m = -2 * a ^ 4 := by have hmgf := treatmentMGF_eq_gaussianRademacher p m ha0 ha1 hlaw unfold treatmentMGF at hmgf rw [fourthCumulant] simp_rw [congrFun hmgf] exact gaussianRademacher_logMGF_fourth a (1 - a ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.model_gaussianRademacher_fourth_cumulant · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:322
theorem model_gaussianRademacher_kappa_four

Suppose the cumulant order recorded in the parameter block is four and the treatment noise of the model is distributed as the Gaussian--Rademacher path with mixing weight strictly positive and at most one, namely an independent standard normal scaled by the square root of one minus the squared weight plus a symmetric sign variable scaled by the weight. Then the model's treatment-noise cumulant of that order is minus twice the fourth power of the mixing weight, so it is strictly negative and quantifies how far the noise sits from Gaussian.

Formal statement
m :
Model (Xspace := Xspace) p
a :
hk :
p.k = 4
ha0 :
0 < a
ha1 :
a ≤ 1
hlaw :
m.P.map (eta p m) = gaussianRademacherLaw a
kappaEta p m = -2 * a ^ 4
Proof (Lean source)
lemma model_gaussianRademacher_kappa_four (p : Parameters) (m : Model (Xspace := Xspace) p) {a : ℝ} (hk : p.k = 4) (ha0 : 0 < a) (ha1 : a ≤ 1) (hlaw : m.P.map (eta p m) = gaussianRademacherLaw a) : kappaEta p m = -2 * a ^ 4 := by have hmgf := treatmentMGF_eq_gaussianRademacher p m ha0 ha1 hlaw unfold treatmentMGF at hmgf rw [kappaEta, hk] simp_rw [congrFun hmgf] exact gaussianRademacher_logMGF_fourth a (1 - a ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.model_gaussianRademacher_kappa_four · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:333
theorem gaussianRademacher_first_characteristic_zero

The explicit transform has its first positive imaginary-axis zero at pi/(2a).

Formal statement
a :
ha :
0 < a
let t := pi / (2 * a) (exp (((1 - a ^ 2 : ℝ) : ℂ) * (I * t) ^ 2 / 2) * cosh ((a : ℂ) * (I * t)) = 0) ∧
∀ u ∈ Ioo (0 : ℝ) t,
exp (((1 - a ^ 2 : ℝ) : ℂ) * (I * u) ^ 2 / 2) * cosh ((a : ℂ) * (I * u))
≠ 0
Proof (Lean source)
lemma gaussianRademacher_first_characteristic_zero {a : ℝ} (ha : 0 < a) : let t := pi / (2 * a) (exp (((1 - a ^ 2 : ℝ) : ℂ) * (I * t) ^ 2 / 2) * cosh ((a : ℂ) * (I * t)) = 0) ∧ ∀ u ∈ Ioo (0 : ℝ) t, exp (((1 - a ^ 2 : ℝ) : ℂ) * (I * u) ^ 2 / 2) * cosh ((a : ℂ) * (I * u)) ≠ 0 := by dsimp only constructor · have ha0 : (a : ℂ) ≠ 0 := mod_cast ne_of_gt ha rw [show (a : ℂ) * (I * (pi / (2 * a) : ℝ)) = I * (pi / 2 : ℝ) by push_cast field_simp] apply mul_eq_zero_of_right rw [show I * ((pi / 2 : ℝ) : ℂ) = ((pi / 2 : ℝ) : ℂ) * I by ring, Complex.cosh_mul_I] simp · intro u hu apply mul_ne_zero (Complex.exp_ne_zero _) have hau0 : 0 < a * u := mul_pos ha hu.1 have hau1 : a * u < pi / 2 := by have h := mul_lt_mul_of_pos_left hu.2 ha field_simp [ne_of_gt ha] at h linarith rw [show (a : ℂ) * (I * (u : ℂ)) = I * ((a * u : ℝ) : ℂ) by push_cast ring] rw [show I * ((a * u : ℝ) : ℂ) = ((a * u : ℝ) : ℂ) * I by ring, Complex.cosh_mul_I] exact_mod_cast ne_of_gt (Real.cos_pos_of_mem_Ioo ⟨by linarith [Real.pi_pos], hau1⟩)
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacher_first_characteristic_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:351
theorem gaussianRademacher_deriv_at_first_zero

The derivative at the first zero is the purely imaginary signal I*A.

Formal statement
a :
ha :
0 < a
let t := pi / (2 * a) let A := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) deriv (fun z : ℂ ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) (I * t)
= I * A
Proof (Lean source)
lemma gaussianRademacher_deriv_at_first_zero {a : ℝ} (ha : 0 < a) : let t := pi / (2 * a) let A := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) deriv (fun z : ℂ ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) (I * t) = I * A := by dsimp only let z0 : ℂ := I * (pi / (2 * a) : ℝ) have haC : (a : ℂ) ≠ 0 := mod_cast ne_of_gt ha have haz : (a : ℂ) * z0 = I * ((pi / 2 : ℝ) : ℂ) := by dsimp [z0] push_cast field_simp [haC] have hzsq : z0 ^ 2 = -(((pi ^ 2 / (4 * a ^ 2) : ℝ) : ℂ)) := by dsimp [z0] push_cast field_simp rw [Complex.I_sq] ring have hquad : HasDerivAt (fun z : ℂ ↦ (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2)) (((1 - a ^ 2 : ℝ) : ℂ) * z0) z0 := (((((hasDerivAt_id z0).fun_pow 2).const_mul (((1 - a ^ 2 : ℝ) : ℂ))).div_const 2)).congr_deriv (by simp only [id_eq]; ring) have hexp := (Complex.hasDerivAt_exp _).comp z0 hquad have hlin : HasDerivAt (fun z : ℂ ↦ (a : ℂ) * z) a z0 := by simpa using (hasDerivAt_id z0).const_mul (a : ℂ) have hcosh := (Complex.hasDerivAt_cosh ((a : ℂ) * z0)).comp z0 hlin change deriv (fun z : ℂ ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) z0 = _ have hd : HasDerivAt (fun z : ℂ ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) (exp (((1 - a ^ 2 : ℝ) : ℂ) * z0 ^ 2 / 2) * (((1 - a ^ 2 : ℝ) : ℂ) * z0) * cosh ((a : ℂ) * z0) + exp (((1 - a ^ 2 : ℝ) : ℂ) * z0 ^ 2 / 2) * (sinh ((a : ℂ) * z0) * (a : ℂ))) z0 := by exact hexp.fun_mul hcosh rw [hd.deriv, haz] rw [show I * ((pi / 2 : ℝ) : ℂ) = ((pi / 2 : ℝ) : ℂ) * I by ring] rw [Complex.cosh_mul_I, Complex.sinh_mul_I, hzsq] rw [show (((1 - a ^ 2 : ℝ) : ℂ) * -((pi ^ 2 / (4 * a ^ 2) : ℝ) : ℂ) / 2) = ((-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2) : ℝ) : ℂ) by push_cast ring] rw [← Complex.ofReal_cos, Real.cos_pi_div_two, Complex.ofReal_zero, ← Complex.ofReal_sin, Real.sin_pi_div_two, Complex.ofReal_one] rw [← Complex.ofReal_exp] push_cast ring
CausalSmith.Stat.SaPlmCumulantConverse.gaussianRademacher_deriv_at_first_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:387
theorem integral_sin_shift_eq_zero

A zero of the characteristic function annihilates every deterministic translate of the sine score.

Formal statement
m :
Model (Xspace := Xspace) p
t d :
hzero :
treatmentMGF p m (I * t) = 0
∫ o, sin (t * (eta p m o + d)) ∂m.P = 0
Proof (Lean source)
lemma integral_sin_shift_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (t d : ℝ) (hzero : treatmentMGF p m (I * t) = 0) : ∫ o, sin (t * (eta p m o + d)) ∂m.P = 0 := by let E : Obs Xspace → ℂ := fun o ↦ exp ((I * t) * (eta p m o + d)) have hEmeas : Measurable E := by apply Complex.continuous_exp.measurable.comp apply mul measurable_const exact (Complex.measurable_ofReal.comp (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst))).add measurable_const have hEint : Integrable E m.P := by apply (integrable_const (μ := m.P) (c := (1 : ℝ))).mono' hEmeas.aestronglyMeasurable filter_upwards [] with o simp [E, Complex.norm_exp] have hshift : ∫ o, E o ∂m.P = 0 := by calc ∫ o, E o ∂m.P = ∫ o, exp ((I * t) * eta p m o) * exp ((I * t) * d) ∂m.P := by apply integral_congr_ae filter_upwards [] with o dsimp [E] rw [← Complex.exp_add] congr 1 ring _ = (∫ o, exp ((I * t) * eta p m o) ∂m.P) * exp ((I * t) * d) := integral_mul_const _ _ _ = treatmentMGF p m (I * t) * exp ((I * t) * d) := by rfl _ = 0 := by rw [hzero]; simp calc ∫ o, sin (t * (eta p m o + d)) ∂m.P = ∫ o, (E o).im ∂m.P := by apply integral_congr_ae filter_upwards [] with o dsimp [E] rw [Complex.exp_im] norm_num [Complex.mul_re, Complex.mul_im] _ = (∫ o, E o ∂m.P).im := by simpa only [RCLike.im_eq_complex_im] using integral_im hEint _ = 0 := by rw [hshift]; simp
CausalSmith.Stat.SaPlmCumulantConverse.integral_sin_shift_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:443
theorem eta_integrable_exp_gaussianRademacher

Exact-law transport supplies all exponential moments needed to differentiate the characteristic function.

Formal statement
m :
Model (Xspace := Xspace) p
a :
hlaw :
m.P.map (eta p m) = gaussianRademacherLaw a
s :
Integrable (fun o ↦ exp (s * eta p m o)) m.P
Proof (Lean source)
lemma eta_integrable_exp_gaussianRademacher (p : Parameters) (m : Model (Xspace := Xspace) p) {a : ℝ} (hlaw : m.P.map (eta p m) = gaussianRademacherLaw a) (s : ℝ) : Integrable (fun o ↦ exp (s * eta p m o)) m.P := by have heta : AEMeasurable (eta p m) m.P := by unfold eta treatment covariate exact (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst)).aemeasurable have hLaw : Integrable (fun x : ℝ ↦ exp (s * x)) (m.P.map (eta p m)) := by rw [hlaw] exact gaussianRademacher_integrable_exp a s exact hLaw.comp_aemeasurable heta
CausalSmith.Stat.SaPlmCumulantConverse.eta_integrable_exp_gaussianRademacher · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:489
theorem eta_cexp_moment_at_first_zero

The first weighted characteristic moment at the first zero is I*A.

Formal statement
m :
Model (Xspace := Xspace) p
a :
ha0 :
0 < a
ha1 :
a ≤ 1
hlaw :
m.P.map (eta p m) = gaussianRademacherLaw a
let t := pi / (2 * a) let A := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) ∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P
= I * A
Proof (Lean source)
lemma eta_cexp_moment_at_first_zero (p : Parameters) (m : Model (Xspace := Xspace) p) {a : ℝ} (ha0 : 0 < a) (ha1 : a ≤ 1) (hlaw : m.P.map (eta p m) = gaussianRademacherLaw a) : let t := pi / (2 * a) let A := a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) ∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P = I * A := by dsimp only let z0 : ℂ := I * (pi / (2 * a) : ℝ) have hset : integrableExpSet (eta p m) m.P = univ := by ext s simp [integrableExpSet, eta_integrable_exp_gaussianRademacher p m hlaw s] have hz : z0.re ∈ interior (integrableExpSet (eta p m) m.P) := by simp [hset] have hmgf := treatmentMGF_eq_gaussianRademacher p m ha0 ha1 hlaw unfold treatmentMGF at hmgf calc (∫ o, (eta p m o : ℂ) * exp ((I * (pi / (2 * a) : ℝ)) * (eta p m o : ℂ)) ∂m.P) = iteratedDeriv 1 (complexMGF (eta p m) m.P) z0 := by rw [iteratedDeriv_complexMGF hz 1] apply integral_congr_ae filter_upwards [] with o dsimp [z0] simp _ = deriv (complexMGF (eta p m) m.P) z0 := by simp [iteratedDeriv_succ] _ = deriv (fun z : ℂ ↦ exp (((1 - a ^ 2 : ℝ) : ℂ) * z ^ 2 / 2) * cosh ((a : ℂ) * z)) z0 := by exact congrArg (fun F : ℂ → ℂ ↦ deriv F z0) hmgf _ = I * (a : ℂ) * (exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) : ℂ) := by convert gaussianRademacher_deriv_at_first_zero ha0 using 1 <;> simp [z0] <;> push_cast <;> ring _ = I * ((a * exp (-(1 - a ^ 2) * pi ^ 2 / (8 * a ^ 2)) : ℝ) : ℂ) := by push_cast ring
CausalSmith.Stat.SaPlmCumulantConverse.eta_cexp_moment_at_first_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:505
theorem learnedResidual_sine_denominator_identity

Independence transports the derivative signal through the bounded treatment-code error.

Formal statement
m :
Model (Xspace := Xspace) p
n :
t A :
hzero :
treatmentMGF p m (I * t) = 0
hmoment :
∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P
= I * A
hetaInt :
Integrable (eta p m) m.P
hg :
GRange p m
∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P
= A * ∫ o, cos (t * treatmentError p m n o) ∂m.P
Proof (Lean source)
-- @node: learnedResidual_sine_denominator_identity lemma learnedResidual_sine_denominator_identity (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t A : ℝ) (hzero : treatmentMGF p m (I * t) = 0) (hmoment : ∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P = I * A) (hetaInt : Integrable (eta p m) m.P) (hind : IndependentTreatmentNoise p m) (hg : GRange p m) : ∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P = A * ∫ o, cos (t * treatmentError p m n o) ∂m.P := by let D0 : Xspace → ℝ := fun x ↦ m.g0 x - barG p m n x have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hD0 : Measurable D0 := by exact m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hDae : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hcov := MeasureTheory.ae_of_ae_map hX.aemeasurable hg filter_upwards [hcov] with o ho unfold treatmentError exact (abs_sub _ _).trans (by linarith [hbar (covariate o)]) have hDint : Integrable (treatmentError p m n) m.P := by apply (integrable_const (μ := m.P) (c := 2 * p.Cg)).mono' ((hD0.comp hX).aestronglyMeasurable) exact hDae have hfac1 := hind.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ (e : ℂ) * exp ((I * t) * (e : ℂ))) (g := fun x : Xspace ↦ exp ((I * t) * (D0 x : ℂ))) heta.aemeasurable hX.aemeasurable (by fun_prop) (by fun_prop) have hfac2 := hind.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ exp ((I * t) * (e : ℂ))) (g := fun x : Xspace ↦ (D0 x : ℂ) * exp ((I * t) * (D0 x : ℂ))) heta.aemeasurable hX.aemeasurable (by fun_prop) (by fun_prop) have hEeMeas : AEStronglyMeasurable (fun o ↦ exp ((I * t) * (eta p m o : ℂ))) m.P := (Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp heta))).aestronglyMeasurable have hEdMeas : AEStronglyMeasurable (fun o ↦ exp ((I * t) * (D0 (covariate o) : ℂ))) m.P := (Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp (hD0.comp hX)))).aestronglyMeasurable have hEeBound : ∀ᵐ o ∂m.P, ‖Complex.exp ((I * t) * (eta p m o : ℂ))‖ ≤ 1 := by filter_upwards [] with o simp [Complex.norm_exp, Complex.mul_re] have hEdBound : ∀ᵐ o ∂m.P, ‖Complex.exp ((I * t) * (D0 (covariate o) : ℂ))‖ ≤ 1 := by filter_upwards [] with o simp [Complex.norm_exp, Complex.mul_re] have hcomplex : ∫ o, (learnedResidual p m n o : ℂ) * exp ((I * t) * (learnedResidual p m n o : ℂ)) ∂m.P = (I * A) * ∫ o, exp ((I * t) * (treatmentError p m n o : ℂ)) ∂m.P := by rw [show (∫ o, (learnedResidual p m n o : ℂ) * exp ((I * t) * (learnedResidual p m n o : ℂ)) ∂m.P) = (∫ o, ((eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ))) * exp ((I * t) * (D0 (covariate o) : ℂ)) ∂m.P) + ∫ o, exp ((I * t) * (eta p m o : ℂ)) * ((D0 (covariate o) : ℂ) * exp ((I * t) * (D0 (covariate o) : ℂ))) ∂m.P by rw [← integral_add] apply integral_congr_ae filter_upwards [] with o have hZ : learnedResidual p m n o = eta p m o + D0 (covariate o) := by simp [learnedResidual, eta, D0, treatment, covariate] rw [hZ, Complex.ofReal_add, mul_add, Complex.exp_add] ring · exact ((hetaInt.ofReal.bdd_mul hEeMeas hEeBound).bdd_mul hEdMeas hEdBound).congr (by filter_upwards [] with o ac_rfl) · have hDw := hDint.ofReal.bdd_mul hEdMeas hEdBound exact (hDw.bdd_mul hEeMeas hEeBound).congr (by filter_upwards [] with o simp only [D0, treatmentError, covariate] ac_rfl)] change (∫ o, (fun e : ℝ ↦ (e : ℂ) * exp ((I * t) * (e : ℂ))) (eta p m o) * (fun x : Xspace ↦ exp ((I * t) * (D0 x : ℂ))) (covariate o) ∂m.P) + (∫ o, (fun e : ℝ ↦ exp ((I * t) * (e : ℂ))) (eta p m o) * (fun x : Xspace ↦ (D0 x : ℂ) * exp ((I * t) * (D0 x : ℂ))) (covariate o) ∂m.P) = _ rw [show (∫ o, (fun e : ℝ ↦ (e : ℂ) * exp ((I * t) * (e : ℂ))) (eta p m o) * (fun x : Xspace ↦ exp ((I * t) * (D0 x : ℂ))) (covariate o) ∂m.P) = _ from hfac1] rw [show (∫ o, (fun e : ℝ ↦ exp ((I * t) * (e : ℂ))) (eta p m o) * (fun x : Xspace ↦ (D0 x : ℂ) * exp ((I * t) * (D0 x : ℂ))) (covariate o) ∂m.P) = _ from hfac2] change (∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P) * (∫ o, exp ((I * t) * (D0 (covariate o) : ℂ)) ∂m.P) + (∫ o, exp ((I * t) * (eta p m o : ℂ)) ∂m.P) * (∫ o, (D0 (covariate o) : ℂ) * exp ((I * t) * (D0 (covariate o) : ℂ)) ∂m.P) = _ rw [hmoment] change (I * A) * _ + treatmentMGF p m (I * t) * _ = _ rw [hzero, zero_mul, add_zero] congr 1 have hZint : Integrable (fun o ↦ (learnedResidual p m n o : ℂ) * exp ((I * t) * (learnedResidual p m n o : ℂ))) m.P := by have hZreal : Integrable (learnedResidual p m n) m.P := by have heq : learnedResidual p m n = eta p m + treatmentError p m n := by funext o simp [learnedResidual, eta, treatmentError, treatment, covariate] rw [heq] exact hetaInt.add hDint have hEZMeas : AEStronglyMeasurable (fun o ↦ exp ((I * t) * (learnedResidual p m n o : ℂ))) m.P := by have hZmeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment covariate barG exact measurable_snd.fst.sub ((((m.gcode_measurable n).comp measurable_fst).max measurable_const).min measurable_const) apply (Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp _))).aestronglyMeasurable exact hZmeas have hEZBound : ∀ᵐ o ∂m.P, ‖Complex.exp ((I * t) * (learnedResidual p m n o : ℂ))‖ ≤ 1 := by filter_upwards [] with o simp [Complex.norm_exp, Complex.mul_re] exact (hZreal.ofReal.bdd_mul hEZMeas hEZBound).congr (by filter_upwards [] with o ac_rfl) calc ∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P = ∫ o, ((learnedResidual p m n o : ℂ) * exp ((I * t) * (learnedResidual p m n o : ℂ))).im ∂m.P := by apply integral_congr_ae filter_upwards [] with o rw [Complex.mul_im, Complex.exp_re, Complex.exp_im] norm_num [Complex.mul_re, Complex.mul_im] _ = (∫ o, (learnedResidual p m n o : ℂ) * exp ((I * t) * (learnedResidual p m n o : ℂ)) ∂m.P).im := by exact integral_im hZint _ = ((I * A) * ∫ o, exp ((I * t) * (treatmentError p m n o : ℂ)) ∂m.P).im := by rw [hcomplex] _ = A * ∫ o, cos (t * treatmentError p m n o) ∂m.P := by have hEint : Integrable (fun o ↦ exp ((I * t) * (treatmentError p m n o : ℂ))) m.P := by apply (integrable_const (μ := m.P) (c := (1 : ℝ))).mono' ((Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp (hD0.comp hX)))).aestronglyMeasurable) filter_upwards [] with o simp [Complex.norm_exp, Complex.mul_re] have hre : (∫ o, exp ((I * t) * (treatmentError p m n o : ℂ)) ∂m.P).re = ∫ o, cos (t * treatmentError p m n o) ∂m.P := by calc _ = ∫ o, (exp ((I * t) * (treatmentError p m n o : ℂ))).re ∂m.P := (integral_re hEint).symm _ = _ := by apply integral_congr_ae filter_upwards [] with o rw [Complex.exp_re] norm_num [Complex.mul_re, Complex.mul_im] rw [Complex.mul_im, hre] norm_num [Complex.mul_re, Complex.mul_im]
CausalSmith.Stat.SaPlmCumulantConverse.learnedResidual_sine_denominator_identity · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:547
theorem learnedResidual_sine_denominator_lower

The direct radius keeps the population denominator above half of its uncontaminated signal.

Formal statement
m :
Model (Xspace := Xspace) p
n :
t A :
ht :
0 < t
hA :
0 < A
hdenId :
∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P
= A * ∫ o, cos (t * treatmentError p m n o) ∂m.P
hsmall :
t * p.eps1n n ≤ 1 / 2
A / 2 ≤ ∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P
Proof (Lean source)
-- @node: learnedResidual_sine_denominator_lower lemma learnedResidual_sine_denominator_lower (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (t A : ℝ) (ht : 0 < t) (hA : 0 < A) (hdenId : ∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P = A * ∫ o, cos (t * treatmentError p m n o) ∂m.P) (hL1 : TreatmentCodeRadiusL1At p m n) (hsmall : t * p.eps1n n ≤ 1 / 2) : A / 2 ≤ ∫ o, learnedResidual p m n o * sin (t * learnedResidual p m n o) ∂m.P := by have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hDmeas : Measurable (treatmentError p m n) := by unfold treatmentError barG covariate exact (m.g0_measurable.comp measurable_fst).sub ((((m.gcode_measurable n).comp measurable_fst).max measurable_const).min measurable_const) have hDabsInt : Integrable (fun o ↦ |treatmentError p m n o|) m.P := by have hi := hL1.1.comp_aemeasurable hcov.aemeasurable convert hi using 1 ext o simp [treatmentError, abs_sub_comm] have hDmean : ∫ o, |treatmentError p m n o| ∂m.P ≤ p.eps1n n := by rw [show (∫ o, |treatmentError p m n o| ∂m.P) = ∫ x, |barG p m n x - m.g0 x| ∂covariateLaw p m by rw [covariateLaw, integral_map hcov.aemeasurable] · congr 1 funext o simp [treatmentError, abs_sub_comm] · exact hL1.1.aestronglyMeasurable] exact hL1.2 have hcosInt : Integrable (fun o ↦ cos (t * treatmentError p m n o)) m.P := by apply (integrable_const (μ := m.P) (c := (1 : ℝ))).mono' ((Real.continuous_cos.measurable.comp (measurable_const.mul hDmeas)).aestronglyMeasurable) filter_upwards [] with o exact Real.abs_cos_le_one _ have htDInt : Integrable (fun o ↦ |t * treatmentError p m n o|) m.P := by exact (hDabsInt.const_mul t).congr (by filter_upwards [] with o simp [abs_mul, abs_of_pos ht]) have hcosLower : 1 - t * p.eps1n n ≤ ∫ o, cos (t * treatmentError p m n o) ∂m.P := by calc 1 - t * p.eps1n n ≤ 1 - t * ∫ o, |treatmentError p m n o| ∂m.P := by gcongr _ = ∫ o, (1 - |t * treatmentError p m n o|) ∂m.P := by rw [integral_sub (integrable_const 1) htDInt] simp only [integral_const, probReal_univ, one_smul] rw [show (∫ o, |t * treatmentError p m n o| ∂m.P) = t * ∫ o, |treatmentError p m n o| ∂m.P by rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with o simp [abs_mul, abs_of_pos ht]] _ ≤ ∫ o, cos (t * treatmentError p m n o) ∂m.P := by apply integral_mono ((integrable_const 1).sub htDInt) hcosInt intro o have h := Real.abs_cos_sub_cos_le (t * treatmentError p m n o) 0 simp only [Real.cos_zero, sub_zero] at h have hlow : -|t * treatmentError p m n o| ≤ cos (t * treatmentError p m n o) - 1 := neg_le_of_abs_le h simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using add_le_add_right hlow 1 rw [hdenId] have hhalf : 1 / 2 ≤ ∫ o, cos (t * treatmentError p m n o) ∂m.P := by linarith nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.learnedResidual_sine_denominator_lower · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SineScore.lean:724
Helpers.SpectralEstimator 154 declarations The ordinary and represented layers below are distinct wrappers around the same finite bounded-domain adapter.

# One bounded-domain certified spectral evaluator The ordinary and represented layers below are distinct wrappers around the same finite bounded-domain adapter. The adapter refines the certified-real bank radius, multiplies it by a reused radius-one circle node, evaluates the finite empirical transforms, forms the guarded quotient times the full circle tangent, applies endpoint-complete quadrature, and normalizes only afterwards.

A certified record for the experiment-wide range constant Ctheta: a strictly positive real number supplied as a certified name (a nested family of rational enclosures with an explicit accuracy modulus), together with the requirement that the number it names is exactly the parameter block's range constant Ctheta.

Definition (Lean source)
CthetaName :
Ctheta_value :
CthetaName.name.value = p.Ctheta
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedRangeInput · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:25

The sole experiment-wide primitive-record pair.

Definition (Lean source)
p0 :
CausalSmith.Stat.SaPlmCumulantConverse.FixedExperimentRecords · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:33

Two parameter blocks carry the same experiment-wide constants: the fixed order r, the cumulant-separation constant delta, the target range constant Ctheta, the treatment- and outcome-regression bounds Cg and Cq, and the two noise scales psieta and psixi all agree. Sample size and the remaining parameters are unconstrained.

Definition (Lean source)
def SameFixedExperimentConstants (p q : Parameters) : Prop := p.r = q.r ∧ p.delta = q.delta ∧ p.Ctheta = q.Ctheta ∧ p.Cg = q.Cg ∧ p.Cq = q.Cq ∧ p.psieta = q.psieta ∧ p.psixi = q.psixi
CausalSmith.Stat.SaPlmCumulantConverse.SameFixedExperimentConstants · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:38
def transport

Reuse one certified range record for a second parameter block whose range constant Ctheta is the same number. The certified name itself is reused verbatim; only the propositional contract identifying its value with the range constant is transported.

Definition (Lean source)
def CertifiedRangeInput.transport {p q : Parameters} (cStar : CertifiedRangeInput p) (h : p.Ctheta = q.Ctheta) : CertifiedRangeInput q where CthetaName := cStar.CthetaName Ctheta_value := cStar.Ctheta_value.trans h
CausalSmith.Stat.SaPlmCumulantConverse.CertifiedRangeInput.transport · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:46

Reuse one certified primitive-record bundle (cumulant order, separation constant, noise scale, and the two search radii) for a second parameter block that carries the same experiment-wide constants.

Definition (Lean source)
def fixedBankInput {p q : Parameters} (pStar : CertifiedBankInputs p) (h : SameFixedExperimentConstants p q) : CertifiedBankInputs q := pStar.transport (by rw [p.k_eq, q.k_eq, h.1]) h.2.1 h.2.2.2.2.2.1

Reuse one certified range record for a second parameter block that carries the same experiment-wide constants.

Definition (Lean source)
def fixedRangeInput {p q : Parameters} (cStar : CertifiedRangeInput p) (h : SameFixedExperimentConstants p q) : CertifiedRangeInput q := cStar.transport h.2.2.1
def canonicalDyadicInterval

Canonical floor-dyadic observation interval.

Definition (Lean source)
noncomputable def canonicalDyadicInterval (x : ℝ) (precision : ℕ) : RatInterval := let scale : ℚ := (2 : ℚ) ^ (precision + 1) let lower : ℚ := (⌊(2 : ℝ) ^ (precision + 1) * x⌋ : ℤ) / scale ⟨lower, lower + 1 / scale, le_add_of_nonneg_right (by positivity)⟩
CausalSmith.Stat.SaPlmCumulantConverse.canonicalDyadicInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:68

Increasing the precision of the canonical dyadic enclosure of a real number by one binary digit shrinks the interval: the finer enclosure is contained in the coarser one.

Formal statement
x :
precision :
(canonicalDyadicInterval x (precision + 1)).Subinterval (canonicalDyadicInterval x precision)
Proof (Lean source)
lemma canonicalDyadic_nested (x : ℝ) (precision : ℕ) : (canonicalDyadicInterval x (precision + 1)).Subinterval (canonicalDyadicInterval x precision) := by have hf : ⌊(2 : ℝ) ^ (precision + 1) * x⌋ = ⌊(2 : ℝ) ^ (precision + 1 + 1) * x⌋ / 2 := by rw [show (2 : ℝ) ^ (precision + 1) * x = ((2 : ℝ) ^ (precision + 1 + 1) * x) / 2 by rw [pow_succ] ring] exact Int.floor_div_natCast _ 2 let b : ℤ := ⌊(2 : ℝ) ^ (precision + 1 + 1) * x⌋ have hbLower : 2 * (b / 2) ≤ b := by simpa [mul_comm] using Int.ediv_mul_le b (by norm_num : (2 : ℤ) ≠ 0) have hbRem : b % 2 < 2 := by simpa using Int.emod_lt b (by norm_num : (2 : ℤ) ≠ 0) have hbEq : b / 2 * 2 + b % 2 = b := Int.ediv_mul_add_emod b 2 have hbUpper : b + 1 ≤ 2 * (b / 2 + 1) := by omega have hpow : (2 : ℚ) ^ (precision + 1 + 1) = 2 * (2 : ℚ) ^ (precision + 1) := by rw [pow_succ] ring unfold canonicalDyadicInterval simp only [RatInterval.Subinterval] rw [hf] change ((b / 2 : ℤ) : ℚ) / (2 : ℚ) ^ (precision + 1) ≤ (b : ℚ) / (2 : ℚ) ^ (precision + 1 + 1) ∧ (b : ℚ) / (2 : ℚ) ^ (precision + 1 + 1) + 1 / (2 : ℚ) ^ (precision + 1 + 1) ≤ ((b / 2 : ℤ) : ℚ) / (2 : ℚ) ^ (precision + 1) + 1 / (2 : ℚ) ^ (precision + 1) rw [hpow] constructor · rw [div_le_div_iff₀ (by positivity) (by positivity)] have hq : (2 : ℚ) * ((b / 2 : ℤ) : ℚ) ≤ b := by exact_mod_cast hbLower nlinarith [show (0 : ℚ) < 2 ^ (precision + 1) by positivity] · rw [← add_div, ← add_div] rw [div_le_div_iff₀ (by positivity) (by positivity)] have hq : (b : ℚ) + 1 ≤ 2 * (((b / 2 : ℤ) : ℚ) + 1) := by exact_mod_cast hbUpper nlinarith [show (0 : ℚ) < 2 ^ (precision + 1) by positivity]
CausalSmith.Stat.SaPlmCumulantConverse.canonicalDyadic_nested · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:74
theorem canonicalDyadic_contains Lemma canonicalDyadic_contains in the paper ↗

At every precision, the canonical dyadic interval built from a real number actually contains that number.

Formal statement
x :
precision :
(canonicalDyadicInterval x precision).Contains x
Proof (Lean source)
lemma canonicalDyadic_contains (x : ℝ) (precision : ℕ) : (canonicalDyadicInterval x precision).Contains x := by unfold canonicalDyadicInterval simp only [RatInterval.Contains] constructor · norm_num rw [div_le_iff₀ (by positivity : (0 : ℝ) < (2 : ℝ) ^ (precision + 1))] simpa [mul_comm] using Int.floor_le ((2 : ℝ) ^ (precision + 1) * x) · norm_num have hs : (0 : ℝ) < (2 : ℝ) ^ (precision + 1) := by positivity rw [inv_eq_one_div, ← add_div] rw [le_div_iff₀ hs] simpa [mul_comm] using (Int.lt_floor_add_one ((2 : ℝ) ^ (precision + 1) * x)).le
CausalSmith.Stat.SaPlmCumulantConverse.canonicalDyadic_contains · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:118

For a positive rational accuracy target, taking the canonical dyadic enclosure at precision one more than the denominator of that target makes its width at most the target. This supplies the explicit accuracy modulus of the canonical name.

Formal statement
x :
e :
(canonicalDyadicInterval x (e.1.den + 1)).width ≤ e.1
Proof (Lean source)
lemma canonicalDyadic_width (x : ℝ) (e : PosRat) : (canonicalDyadicInterval x (e.1.den + 1)).width ≤ e.1 := by unfold canonicalDyadicInterval RatInterval.width simp only [one_div, add_sub_cancel_left] have hpow : ∀ d : ℕ, d ≤ 2 ^ (d + 1 + 1) := by intro d induction d with | zero => simp | succ d ih => have hp : 1 ≤ 2 ^ (d + 1 + 1) := Nat.one_le_iff_ne_zero.mpr (Nat.two_pow_pos _).ne' calc d + 1 ≤ 2 ^ (d + 1 + 1) + 1 := Nat.add_le_add_right ih 1 _ ≤ 2 * 2 ^ (d + 1 + 1) := by omega _ = 2 ^ (d + 1 + 1 + 1) := by rw [pow_succ]; ring have hdenQ : (e.1.den : ℚ) ≤ 2 ^ (e.1.den + 1 + 1) := by exact_mod_cast hpow e.1.den have hfirst : (2 ^ (e.1.den + 1 + 1) : ℚ)⁻¹ ≤ 1 / e.1.den := by rw [inv_eq_one_div] exact div_le_div_of_nonneg_left zero_le_one (by exact_mod_cast e.1.den_pos) hdenQ refine hfirst.trans ?_ calc (1 : ℚ) / e.1.den ≤ (e.1.num : ℚ) / e.1.den := by apply div_le_div_of_nonneg_right · have hn : (0 : ℤ) < e.1.num := Rat.num_pos.mpr e.2 exact_mod_cast hn · exact_mod_cast e.1.den_pos.le _ = e.1 := Rat.num_div_den e.1
CausalSmith.Stat.SaPlmCumulantConverse.canonicalDyadic_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:135
def canonicalObservationName

The canonical certified name of a real number: the number together with its family of floor-dyadic rational enclosures, the proofs that these are nested and always contain the number, and the explicit rule converting a requested accuracy into a precision level.

Definition (Lean source)
noncomputable def canonicalObservationName (x : ℝ) : CertifiedReal where value := x approx := canonicalDyadicInterval x nested := canonicalDyadic_nested x contains := canonicalDyadic_contains x modulus := fun e ↦ e.1.den + 1 width_modulus := canonicalDyadic_width x
CausalSmith.Stat.SaPlmCumulantConverse.canonicalObservationName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:168

One observation as seen by the certified evaluator: certified names for the treatment value, the outcome value, and the clipped treatment-regression code value at that unit.

Definition (Lean source)
tName :
yName :
gName :
CausalSmith.Stat.SaPlmCumulantConverse.RepresentedObservation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:179

The complete certified input of the spectral estimator: one certified observation record for each of the n sample units, plus the experiment-wide certified primitive records (cumulant order, separation, noise scale, search radii) and the certified range constant.

Definition (Lean source)
observations :
primitive :
CausalSmith.Stat.SaPlmCumulantConverse.RepresentedSpectralInput · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:186
def canonicalRepresentedInput

The certified input built directly from a data set: each unit contributes the canonical certified names of its treatment, its outcome, and its treatment-regression code value clipped to the interval from minus Cg to Cg; the supplied primitive and range records are carried over unchanged.

Definition (Lean source)
noncomputable def canonicalRepresentedInput (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) : RepresentedSpectralInput p where observations := fun i ↦ { tName := canonicalObservationName (treatment (data i)) yName := canonicalObservationName (outcome (data i)) gName := canonicalObservationName (min (max (gcode p.n (covariate (data i))) (-p.Cg)) p.Cg) } primitive := pStar range := cStar
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRepresentedInput · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:195
theorem canonicalRepresentedInput_congr_current

Take a treatment-regression code sequence and a second one. If they agree at every covariate value after clipping to the range from minus Cg to Cg, then they produce the very same certified input record. Only the clipped code matters to the estimator.

Formal statement
gcode hcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
hclip :
∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg
canonicalRepresentedInput p pStar cStar gcode data
= canonicalRepresentedInput p pStar cStar hcode data
Proof (Lean source)
lemma canonicalRepresentedInput_congr_current (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode hcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (hclip : ∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg) : canonicalRepresentedInput p pStar cStar gcode data = canonicalRepresentedInput p pStar cStar hcode data := by unfold canonicalRepresentedInput congr 1 funext i congr 1 exact congrArg canonicalObservationName (hclip (covariate (data i)))
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRepresentedInput_congr_current · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:211
def representedResidual

The certified name of unit i's treatment residual: the certified difference between the treatment value and the clipped treatment-regression code value at that unit.

Definition (Lean source)
def representedResidual (input : RepresentedSpectralInput p) (i : Fin p.n) : CertifiedReal := CertifiedReal.sub (input.observations i).tName (input.observations i).gName
CausalSmith.Stat.SaPlmCumulantConverse.representedResidual · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:229
def spectralFold

Selects one of the two deterministic sample-splitting folds: fold index zero gives the units below the halfway point, fold index one gives the remaining units.

Definition (Lean source)
def spectralFold (n : ℕ) (a : Fin 2) : Finset (Fin n) := if a = 0 then fold0 n else fold1 n
def spectralDiskBox

The fixed disk box used by every empirical-transform map.

Definition (Lean source)
def spectralDiskBox (B : ContourBankData) : ComplexRatInterval := by let U : ℚ := B.UR + 2 have hU : 0 ≤ U := by dsimp [U] positivity exact ⟨⟨-U, U, by linarith⟩, ⟨-U, U, by linarith⟩⟩
def spectralFullBoxRadius

A rational Euclidean-magnitude envelope for every point in spectralDiskBox. The factor two safely converts the coordinate maximum used by ComplexRatInterval.maxAbs into a complex-norm bound.

Definition (Lean source)
def spectralFullBoxRadius (B : ContourBankData) : ℚ := 2 * (spectralDiskBox B).maxAbs
CausalSmith.Stat.SaPlmCumulantConverse.spectralFullBoxRadius · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:248
theorem spectralFullBoxRadius_nonneg

The rational magnitude envelope of the fixed evaluation disk is never negative.

Formal statement
Proof (Lean source)
lemma spectralFullBoxRadius_nonneg (B : ContourBankData) : 0 ≤ spectralFullBoxRadius B := by unfold spectralFullBoxRadius exact mul_nonneg (by norm_num) ((abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)))
CausalSmith.Stat.SaPlmCumulantConverse.spectralFullBoxRadius_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:254
def intervalSum

Adds up a finite list of complex rational rectangles left to right, starting from the degenerate rectangle at the origin.

Definition (Lean source)
def intervalSum (xs : List ComplexRatInterval) : ComplexRatInterval := xs.foldl ComplexRatInterval.add ComplexRatInterval.zero
theorem ratInterval_npow_width_propagation

Powers propagate input width with an explicit rational magnitude bound.

Formal statement
n :
A w :
hA :
0 ≤ A
hw :
I.width ≤ w
hmax :
I.maxAbs ≤ A
(I.npow n).width ≤ (n : ℚ) * (2 * max 1 A) ^ n * w
Proof (Lean source)
lemma ratInterval_npow_width_propagation (I : RatInterval) (n : ℕ) (A w : ℚ) (hA : 0 ≤ A) (hw : I.width ≤ w) (hmax : I.maxAbs ≤ A) : (I.npow n).width ≤ (n : ℚ) * (2 * max 1 A) ^ n * w := by have hw0 : 0 ≤ w := (RatInterval.width_nonneg I).trans hw have hM0 : 0 ≤ max 1 A := (by positivity) have hB0 : 0 ≤ 2 * max 1 A := mul_nonneg (by norm_num) hM0 have hMleB : max 1 A ≤ 2 * max 1 A := by nlinarith [show (1 : ℚ) ≤ max 1 A from le_max_left _ _] have hnpowMax : ∀ k : ℕ, (I.npow k).maxAbs ≤ A ^ k := by intro k induction k with | zero => simp [RatInterval.npow, RatInterval.point, RatInterval.maxAbs] | succ k ih => have hImax0 : 0 ≤ I.maxAbs := (abs_nonneg I.lo).trans (le_max_left _ _) rw [RatInterval.npow, pow_succ] exact (RatInterval.maxAbs_mul _ _).trans (mul_le_mul ih hmax hImax0 (pow_nonneg hA k)) have hmulWidth (K L : RatInterval) : (K.mul L).width ≤ 2 * (K.maxAbs * L.width + L.maxAbs * K.width) := by let KR : ComplexRatInterval := ⟨K, RatInterval.point 0⟩ let LR : ComplexRatInterval := ⟨L, RatInterval.point 0⟩ have h := ComplexRatInterval.mul_width KR LR have hK0 : 0 ≤ K.maxAbs := (abs_nonneg K.lo).trans (le_max_left _ _) have hL0 : 0 ≤ L.maxAbs := (abs_nonneg L.lo).trans (le_max_left _ _) have hKw : 0 ≤ K.hi - K.lo := sub_nonneg.mpr K.lo_le_hi have hLw : 0 ≤ L.hi - L.lo := sub_nonneg.mpr L.lo_le_hi simpa [KR, LR, ComplexRatInterval.mul, ComplexRatInterval.width, ComplexRatInterval.maxAbs, RatInterval.sub, RatInterval.add, RatInterval.neg, RatInterval.mul, RatInterval.point, RatInterval.width, RatInterval.maxAbs, hK0, hL0, hKw, hLw] using h induction n with | zero => simp [RatInterval.npow, RatInterval.point, RatInterval.width] | succ n ih => rw [RatInterval.npow] have hstep := hmulWidth (I.npow n) I have hpowAM : A ^ n ≤ (max 1 A) ^ n := pow_le_pow_left₀ hA (le_max_right 1 A) n have hpowMB : (max 1 A) ^ n ≤ (2 * max 1 A) ^ n := pow_le_pow_left₀ hM0 hMleB n have hpowAB : A ^ n ≤ (2 * max 1 A) ^ n := hpowAM.trans hpowMB have hAw : A ^ n * I.width ≤ (2 * max 1 A) ^ n * w := by exact mul_le_mul hpowAB hw (RatInterval.width_nonneg I) (pow_nonneg hB0 n) have hfirst : (I.npow n).maxAbs * I.width ≤ (2 * max 1 A) ^ n * w := (mul_le_mul (hnpowMax n) le_rfl (RatInterval.width_nonneg I) (pow_nonneg hA n)).trans hAw have hsecond : I.maxAbs * (I.npow n).width ≤ max 1 A * ((n : ℚ) * (2 * max 1 A) ^ n * w) := by exact (mul_le_mul hmax ih (RatInterval.width_nonneg (I.npow n)) hA) |>.trans (mul_le_mul_of_nonneg_right (le_max_right 1 A) (mul_nonneg (mul_nonneg (Nat.cast_nonneg n) (pow_nonneg hB0 n)) hw0)) calc ((I.npow n).mul I).width ≤ 2 * ((I.npow n).maxAbs * I.width + I.maxAbs * (I.npow n).width) := hstep _ ≤ 2 * ((2 * max 1 A) ^ n * w + max 1 A * ((n : ℚ) * (2 * max 1 A) ^ n * w)) := mul_le_mul_of_nonneg_left (add_le_add hfirst hsecond) (by norm_num) _ ≤ ((n + 1 : ℕ) : ℚ) * (2 * max 1 A) ^ (n + 1) * w := by have hPw : 0 ≤ (2 * max 1 A) ^ n * w := mul_nonneg (pow_nonneg hB0 n) hw0 have htwo : (0 : ℚ) ≤ 2 := by norm_num have htwo_le : (2 : ℚ) ≤ 2 * max 1 A := by calc (2 : ℚ) = 2 * 1 := by ring _ ≤ 2 * max 1 A := mul_le_mul_of_nonneg_left (le_max_left 1 A) htwo have hscale : 2 * ((2 * max 1 A) ^ n * w) ≤ (2 * max 1 A) * ((2 * max 1 A) ^ n * w) := by exact mul_le_mul_of_nonneg_right htwo_le hPw rw [pow_succ] push_cast calc 2 * ((2 * max 1 A) ^ n * w + max 1 A * ((n : ℚ) * (2 * max 1 A) ^ n * w)) = 2 * ((2 * max 1 A) ^ n * w) + (n : ℚ) * (2 * max 1 A) * ((2 * max 1 A) ^ n * w) := by ring _ ≤ (2 * max 1 A) * ((2 * max 1 A) ^ n * w) + (n : ℚ) * (2 * max 1 A) * ((2 * max 1 A) ^ n * w) := add_le_add hscale le_rfl _ = ((n : ℚ) + 1) * ((2 * max 1 A) ^ n * (2 * max 1 A)) * w := by ring
CausalSmith.Stat.SaPlmCumulantConverse.ratInterval_npow_width_propagation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:269
theorem complexRectangle_mul_width_propagation

Existing rectangle multiplication exposes both operand widths and magnitudes; this alias records the propagation step used by the spectral finite-sum proof.

Formal statement
(I.mul J).width ≤ 2 * (I.maxAbs * J.width + J.maxAbs * I.width)
Proof (Lean source)
lemma complexRectangle_mul_width_propagation (I J : ComplexRatInterval) : (I.mul J).width ≤ 2 * (I.maxAbs * J.width + J.maxAbs * I.width) := ComplexRatInterval.mul_width I J
CausalSmith.Stat.SaPlmCumulantConverse.complexRectangle_mul_width_propagation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:353
theorem intervalSum_contains_sum

A recursive rectangle sum contains the sum of pairwise enclosed values.

Formal statement
zs :
List
h :
Forall₂ (fun I z ↦ I.Contains z) xs zs
(intervalSum xs).Contains zs.sum
Proof (Lean source)
lemma intervalSum_contains_sum (xs : List ComplexRatInterval) (zs : List ℂ) (h : Forall₂ (fun I z ↦ I.Contains z) xs zs) : (intervalSum xs).Contains zs.sum := by have aux : ∀ {xs : List ComplexRatInterval} {zs : List ℂ}, Forall₂ (fun I z ↦ I.Contains z) xs zs → ∀ {A : ComplexRatInterval} {a : ℂ}, A.Contains a → (xs.foldl ComplexRatInterval.add A).Contains (a + zs.sum) := by intro xs zs h induction h with | nil => intro A a ha simpa using ha | cons hIz hrest ih => intro A a ha simpa [add_assoc] using ih (ComplexRatInterval.add_sound ha hIz) have hzero : ComplexRatInterval.zero.Contains (0 : ℂ) := by simpa [ComplexRatInterval.zero, ComplexRatInterval.point] using ComplexRatInterval.point_sound 0 0 simpa [intervalSum] using aux h hzero
CausalSmith.Stat.SaPlmCumulantConverse.intervalSum_contains_sum · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:376
theorem intervalSum_width_propagation

Recursive rectangle addition accumulates no more than the sum of the individual coordinate widths.

Formal statement
(intervalSum xs).width ≤ (xs.map ComplexRatInterval.width).sum
Proof (Lean source)
lemma intervalSum_width_propagation (xs : List ComplexRatInterval) : (intervalSum xs).width ≤ (xs.map ComplexRatInterval.width).sum := by have hadd (I J : ComplexRatInterval) : (I.add J).width ≤ I.width + J.width := by rw [ComplexRatInterval.width_add] apply max_le · exact add_le_add (le_max_left _ _) (le_max_left _ _) · exact add_le_add (le_max_right _ _) (le_max_right _ _) have aux : ∀ (ys : List ComplexRatInterval) (A : ComplexRatInterval), (ys.foldl ComplexRatInterval.add A).width ≤ A.width + (ys.map ComplexRatInterval.width).sum := by intro ys induction ys with | nil => intro A; simp | cons I ys ih => intro A calc ((I :: ys).foldl ComplexRatInterval.add A).width = (ys.foldl ComplexRatInterval.add (A.add I)).width := rfl _ ≤ (A.add I).width + (ys.map ComplexRatInterval.width).sum := ih _ _ ≤ A.width + I.width + (ys.map ComplexRatInterval.width).sum := by gcongr exact hadd A I _ = A.width + ((I :: ys).map ComplexRatInterval.width).sum := by simp [add_assoc] simpa [intervalSum, ComplexRatInterval.zero, ComplexRatInterval.width, RatInterval.point, RatInterval.width] using aux xs ComplexRatInterval.zero
CausalSmith.Stat.SaPlmCumulantConverse.intervalSum_width_propagation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:398
theorem complexRectangle_smulRat_width_propagation

Rational post-scaling propagates width linearly in the scalar magnitude.

Formal statement
q :
(I.smulRat q).width ≤ |q| * I.width
Proof (Lean source)
lemma complexRectangle_smulRat_width_propagation (q : ℚ) (I : ComplexRatInterval) : (I.smulRat q).width ≤ |q| * I.width := by have pointMulWidth_nonneg (r : ℚ) (hr : 0 ≤ r) (K : RatInterval) : ((RatInterval.point r).mul K).width = r * K.width := by have h := mul_le_mul_of_nonneg_left K.lo_le_hi hr simp [RatInterval.mul, RatInterval.point, RatInterval.width, h] ring have pointMulWidth_nonpos (r : ℚ) (hr : r ≤ 0) (K : RatInterval) : ((RatInterval.point r).mul K).width = (-r) * K.width := by have h := mul_le_mul_of_nonpos_left K.lo_le_hi hr simp [RatInterval.mul, RatInterval.point, RatInterval.width, h] ring rcases le_total 0 q with hq | hq · have hre := pointMulWidth_nonneg q hq I.re have him := pointMulWidth_nonneg q hq I.im change max ((RatInterval.point q).mul I.re).width ((RatInterval.point q).mul I.im).width ≤ |q| * max I.re.width I.im.width rw [hre, him, abs_of_nonneg hq, ← mul_max_of_nonneg I.re.width I.im.width hq] · have hre := pointMulWidth_nonpos q hq I.re have him := pointMulWidth_nonpos q hq I.im have hnq : 0 ≤ -q := neg_nonneg.mpr hq change max ((RatInterval.point q).mul I.re).width ((RatInterval.point q).mul I.im).width ≤ |q| * max I.re.width I.im.width rw [hre, him, abs_of_nonpos hq, ← mul_max_of_nonneg I.re.width I.im.width hnq]
CausalSmith.Stat.SaPlmCumulantConverse.complexRectangle_smulRat_width_propagation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:427
def rationalExpEnvelope

Explicit rational exponential envelope on the fixed disk.

Definition (Lean source)
def rationalExpEnvelope (rho zBound : ℚ) : ℚ := 3 ^ toNat ⌈max 0 (rho * zBound)⌉
CausalSmith.Stat.SaPlmCumulantConverse.rationalExpEnvelope · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:454
def residualUpper

A rational upper bound for the size of unit i's treatment residual: the largest endpoint magnitude of the residual's certified enclosure, refined until its width is at most one.

Definition (Lean source)
def residualUpper (input : RepresentedSpectralInput p) (i : Fin p.n) : ℚ := ((representedResidual input i).approx ((representedResidual input i).modulus errorOne)).maxAbs
def outcomeUpper

A rational upper bound for the size of unit i's outcome: the largest endpoint magnitude of the outcome's certified enclosure, refined until its width is at most one.

Definition (Lean source)
def outcomeUpper (input : RepresentedSpectralInput p) (i : Fin p.n) : ℚ := ((input.observations i).yName.approx ((input.observations i).yName.modulus errorOne)).maxAbs
theorem residualUpper_nonneg

The rational residual magnitude bound of any unit is never negative.

Formal statement
i :
Fin p.n
0 ≤ residualUpper input i
Proof (Lean source)
lemma residualUpper_nonneg (input : RepresentedSpectralInput p) (i : Fin p.n) : 0 ≤ residualUpper input i := (abs_nonneg _).trans (le_max_left _ _)
CausalSmith.Stat.SaPlmCumulantConverse.residualUpper_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:471
theorem outcomeUpper_nonneg

The rational outcome magnitude bound of any unit is never negative.

Formal statement
i :
Fin p.n
0 ≤ outcomeUpper input i
Proof (Lean source)
lemma outcomeUpper_nonneg (input : RepresentedSpectralInput p) (i : Fin p.n) : 0 ≤ outcomeUpper input i := (abs_nonneg _).trans (le_max_left _ _)
CausalSmith.Stat.SaPlmCumulantConverse.outcomeUpper_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:476
def empiricalFDerivativeBound

A rational magnitude envelope for the empirical residual transform and its derivatives of a given order over the disk of radius rho: the sum across sample units of the unit's residual magnitude bound raised to the derivative order, multiplied by a rational exponential envelope for that residual on the disk.

Definition (Lean source)
def empiricalFDerivativeBound (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : ℚ := ∑ i, residualUpper input i ^ derivative * rationalExpEnvelope rho (residualUpper input i)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalFDerivativeBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:481
def empiricalGDerivativeBound

The same magnitude envelope for the outcome-weighted empirical transform: each unit contributes its outcome magnitude bound times its residual magnitude bound raised to the derivative order, times the rational exponential envelope on the disk of radius rho.

Definition (Lean source)
def empiricalGDerivativeBound (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : ℚ := ∑ i, outcomeUpper input i * residualUpper input i ^ derivative * rationalExpEnvelope rho (residualUpper input i)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalGDerivativeBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:489
def empiricalFWidthBound

A conservative propagation envelope for canonical F intervals. The max 1 power is deliberately the same one exposed by the public interval power-width theorem; the extra radius and derivative factors pay for all finite-operation amplification without pretending that it is a semantic derivative bound.

Definition (Lean source)
def empiricalFWidthBound (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : ℚ := ∑ i, ((rho + 1) * (derivative + 1) * (2 * max 1 (residualUpper input i)) ^ (derivative + 1) * rationalExpEnvelope rho (residualUpper input i)) ^ 8
CausalSmith.Stat.SaPlmCumulantConverse.empiricalFWidthBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:497
def empiricalGWidthBound

The analogous canonical G propagation envelope, including the outcome magnitude needed by coefficient multiplication.

Definition (Lean source)
def empiricalGWidthBound (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : ℚ := ∑ i, (max 1 (outcomeUpper input i) * (rho + 1) * (derivative + 1) * (2 * max 1 (residualUpper input i)) ^ (derivative + 1) * rationalExpEnvelope rho (residualUpper input i)) ^ 8
CausalSmith.Stat.SaPlmCumulantConverse.empiricalGWidthBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:508
theorem empiricalFDerivativeBound_nonneg

The magnitude envelope for the empirical residual transform is never negative.

Formal statement
rho :
derivative :
0 ≤ empiricalFDerivativeBound input rho derivative
Proof (Lean source)
lemma empiricalFDerivativeBound_nonneg (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : 0 ≤ empiricalFDerivativeBound input rho derivative := by unfold empiricalFDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (pow_nonneg (residualUpper_nonneg input i) _) (by positivity)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalFDerivativeBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:516
theorem empiricalGDerivativeBound_nonneg

The magnitude envelope for the outcome-weighted empirical transform is never negative.

Formal statement
rho :
derivative :
0 ≤ empiricalGDerivativeBound input rho derivative
Proof (Lean source)
lemma empiricalGDerivativeBound_nonneg (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) : 0 ≤ empiricalGDerivativeBound input rho derivative := by unfold empiricalGDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (mul_nonneg (outcomeUpper_nonneg input i) (pow_nonneg (residualUpper_nonneg input i) _)) (by positivity)
CausalSmith.Stat.SaPlmCumulantConverse.empiricalGDerivativeBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:526
theorem empiricalFWidthBound_nonneg

For a nonnegative disk radius, the interval-propagation envelope of the empirical residual transform is never negative.

Formal statement
rho :
derivative :
hrho :
0 ≤ rho
0 ≤ empiricalFWidthBound input rho derivative
Proof (Lean source)
lemma empiricalFWidthBound_nonneg (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) (hrho : 0 ≤ rho) : 0 ≤ empiricalFWidthBound input rho derivative := by unfold empiricalFWidthBound rationalExpEnvelope positivity
CausalSmith.Stat.SaPlmCumulantConverse.empiricalFWidthBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:538
theorem empiricalGWidthBound_nonneg

For a nonnegative disk radius, the interval-propagation envelope of the outcome-weighted empirical transform is never negative.

Formal statement
rho :
derivative :
hrho :
0 ≤ rho
0 ≤ empiricalGWidthBound input rho derivative
Proof (Lean source)
lemma empiricalGWidthBound_nonneg (input : RepresentedSpectralInput p) (rho : ℚ) (derivative : ℕ) (hrho : 0 ≤ rho) : 0 ≤ empiricalGWidthBound input rho derivative := by unfold empiricalGWidthBound rationalExpEnvelope positivity
CausalSmith.Stat.SaPlmCumulantConverse.empiricalGWidthBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:546
theorem canonicalObservationName_approx_width

The canonical certified enclosure of a real number, taken at a given refinement level, has width at most two raised to the negative of one more than that level.

Formal statement
x :
fuel :
((canonicalObservationName x).approx fuel).width ≤ 1 / (2 : ℚ) ^ (fuel + 1)
Proof (Lean source)
lemma canonicalObservationName_approx_width (x : ℝ) (fuel : ℕ) : ((canonicalObservationName x).approx fuel).width ≤ 1 / (2 : ℚ) ^ (fuel + 1) := by unfold canonicalObservationName canonicalDyadicInterval RatInterval.width simp
CausalSmith.Stat.SaPlmCumulantConverse.canonicalObservationName_approx_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:570
theorem canonicalRepresentedInput_residual_approx_width

For canonically named data, the certified enclosure of any unit's treatment residual at a given refinement level has width at most twice two raised to the negative of one more than that level — twice the single-name bound, because the residual is a difference of two canonical names.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
i :
Fin p.n
fuel :
((representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).approx fuel).width
≤ 2 / (2 : ℚ) ^ (fuel + 1)
Proof (Lean source)
lemma canonicalRepresentedInput_residual_approx_width (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) (fuel : ℕ) : ((representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).approx fuel).width ≤ 2 / (2 : ℚ) ^ (fuel + 1) := by have ht := canonicalObservationName_approx_width (treatment (data i)) fuel have hg := canonicalObservationName_approx_width (min (max (gcode p.n (covariate (data i))) (-p.Cg)) p.Cg) fuel rw [representedResidual, CertifiedReal.sub, CertifiedReal.add, RatInterval.width_add, CertifiedReal.neg, RatInterval.width_neg] change ((canonicalObservationName (treatment (data i))).approx fuel).width + ((canonicalObservationName (min (max (gcode p.n (covariate (data i))) (-p.Cg)) p.Cg)).approx fuel).width ≤ 2 / (2 : ℚ) ^ (fuel + 1) calc _ ≤ 1 / (2 : ℚ) ^ (fuel + 1) + 1 / (2 : ℚ) ^ (fuel + 1) := add_le_add ht hg _ = 2 / (2 : ℚ) ^ (fuel + 1) := by ring
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRepresentedInput_residual_approx_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:578
theorem canonicalRepresentedInput_outcome_approx_width

For canonically named data, the certified enclosure of any unit's outcome at a given refinement level has width at most two raised to the negative of one more than that level.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
i :
Fin p.n
fuel :
(((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx fuel).width
≤ 1 / (2 : ℚ) ^ (fuel + 1)
Proof (Lean source)
lemma canonicalRepresentedInput_outcome_approx_width (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) (fuel : ℕ) : (((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx fuel).width ≤ 1 / (2 : ℚ) ^ (fuel + 1) := by simpa [canonicalRepresentedInput] using canonicalObservationName_approx_width (outcome (data i)) fuel
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRepresentedInput_outcome_approx_width · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:604
theorem canonicalResidual_maxAbs_at_fuel

Once the refinement level is at least the one at which the residual's enclosure has width one, the largest endpoint magnitude of that enclosure is at most the unit's rational residual magnitude bound. Refining further can only shrink the enclosure.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
i :
Fin p.n
fuel :
hfuel :
(representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).modulus errorOne
≤ fuel
((representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).approx fuel).maxAbs
residualUpper (canonicalRepresentedInput p pStar cStar gcode data) i
Proof (Lean source)
lemma canonicalResidual_maxAbs_at_fuel (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) (fuel : ℕ) (hfuel : (representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).modulus errorOne ≤ fuel) : ((representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).approx fuel).maxAbs ≤ residualUpper (canonicalRepresentedInput p pStar cStar gcode data) i := by unfold residualUpper exact ComplexRatInterval.rat_maxAbs_mono (CertifiedReal.approx_mono _ hfuel)
CausalSmith.Stat.SaPlmCumulantConverse.canonicalResidual_maxAbs_at_fuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:616
theorem canonicalOutcome_maxAbs_at_fuel

Once the refinement level is at least the one at which the outcome's enclosure has width one, the largest endpoint magnitude of that enclosure is at most the unit's rational outcome magnitude bound.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
i :
Fin p.n
fuel :
hfuel :
((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.modulus errorOne
≤ fuel
(((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx fuel).maxAbs
outcomeUpper (canonicalRepresentedInput p pStar cStar gcode data) i
Proof (Lean source)
lemma canonicalOutcome_maxAbs_at_fuel (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) (fuel : ℕ) (hfuel : ((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.modulus errorOne ≤ fuel) : (((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx fuel).maxAbs ≤ outcomeUpper (canonicalRepresentedInput p pStar cStar gcode data) i := by unfold outcomeUpper exact ComplexRatInterval.rat_maxAbs_mono (CertifiedReal.approx_mono _ hfuel)
CausalSmith.Stat.SaPlmCumulantConverse.canonicalOutcome_maxAbs_at_fuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:633
def tightenAcrossFuel

Recursive whole-rectangle tightening of a fuel-indexed raw evaluator.

Definition (Lean source)
def tightenAcrossFuel (raw : ℕ → ComplexRatInterval) : ℕ → ComplexRatInterval | 0 => raw 0 | fuel + 1 => (tightenAcrossFuel raw fuel).tighten (raw (fuel + 1))
CausalSmith.Stat.SaPlmCumulantConverse.tightenAcrossFuel · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:649
theorem tightenAcrossFuel_spec

Sound raw enclosures remain sound after recursive tightening; consecutive fuel outputs are nested, and every tightened output lies inside the raw output at the same fuel.

Formal statement
raw :
z :
hraw :
∀ fuel, (raw fuel).Contains z
fuel :
(tightenAcrossFuel raw fuel).Contains z ∧
(tightenAcrossFuel raw (fuel + 1)).Subinterval (tightenAcrossFuel raw fuel) ∧
(tightenAcrossFuel raw fuel).Subinterval (raw fuel)
Proof (Lean source)
lemma tightenAcrossFuel_spec (raw : ℕ → ComplexRatInterval) (z : ℂ) (hraw : ∀ fuel, (raw fuel).Contains z) (fuel : ℕ) : (tightenAcrossFuel raw fuel).Contains z ∧ (tightenAcrossFuel raw (fuel + 1)).Subinterval (tightenAcrossFuel raw fuel) ∧ (tightenAcrossFuel raw fuel).Subinterval (raw fuel) := by induction fuel with | zero => have h0 := hraw 0 exact ⟨h0, (ComplexRatInterval.tighten_sound_left h0 (hraw 1)).2, ⟨RatInterval.subinterval_refl _, RatInterval.subinterval_refl _⟩⟩ | succ fuel ih => have hcurrent : (tightenAcrossFuel raw (fuel + 1)).Contains z := by rw [tightenAcrossFuel] exact (ComplexRatInterval.tighten_sound_left ih.1 (hraw (fuel + 1))).1 have hnext := hraw (fuel + 2) exact ⟨hcurrent, by rw [show fuel + 1 + 1 = fuel + 2 by omega, tightenAcrossFuel] exact (ComplexRatInterval.tighten_sound_left hcurrent hnext).2, by rw [tightenAcrossFuel] exact ⟨ Transcendental.tighten_subinterval_right ih.1.1 (hraw (fuel + 1)).1, Transcendental.tighten_subinterval_right ih.1.2 (hraw (fuel + 1)).2⟩⟩
CausalSmith.Stat.SaPlmCumulantConverse.tightenAcrossFuel_spec · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:654
def spectralDenominatorRawEval

The raw finite-sum interval program for the empirical F derivative.

Definition (Lean source)
def spectralDenominatorRawEval (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ComplexRatInterval) (fuel : ℕ) : ComplexRatInterval := let terms := I.toList.map fun i ↦ let residual := (representedResidual input i).approx fuel let argument := z.mul (realRect residual) let exponential := BoundedCertifiedComplex.centeredComplexExp argument fuel (realRect (residual.npow derivative)).mul exponential (intervalSum terms).smulRat ((max I.card 1 : ℚ)⁻¹)
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorRawEval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:682
def spectralNumeratorRawEval

The raw finite-sum interval program for the empirical G derivative.

Definition (Lean source)
def spectralNumeratorRawEval (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ComplexRatInterval) (fuel : ℕ) : ComplexRatInterval := let terms := I.toList.map fun i ↦ let residual := (representedResidual input i).approx fuel let weight := (input.observations i).yName.approx fuel let argument := z.mul (realRect residual) let exponential := BoundedCertifiedComplex.centeredComplexExp argument fuel (realRect (weight.mul (residual.npow derivative))).mul exponential (intervalSum terms).smulRat ((max I.card 1 : ℚ)⁻¹)
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorRawEval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:693
def spectralDenominatorEval

Cross-fuel-nested empirical F evaluation obtained by tightening the whole raw finite-sum rectangle at every successive fuel.

Definition (Lean source)
def spectralDenominatorEval (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ComplexRatInterval) : ℕ → ComplexRatInterval := tightenAcrossFuel (spectralDenominatorRawEval input I derivative z)
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorEval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:705
def spectralNumeratorEval

Cross-fuel-nested empirical G evaluation obtained by tightening the whole raw finite-sum rectangle at every successive fuel.

Definition (Lean source)
def spectralNumeratorEval (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ComplexRatInterval) : ℕ → ComplexRatInterval := tightenAcrossFuel (spectralNumeratorRawEval input I derivative z)
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorEval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:712
def spectralDenominatorMap

The finite-sum certified empirical F map on the fixed disk.

Definition (Lean source)
def spectralDenominatorMap (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) : BoundedComplexMap (spectralDiskBox B) where value := fun z ↦ ((max I.card 1 : ℝ)⁻¹ : ℂ) * ∑ i ∈ I, (((representedResidual input i).value ^ derivative : ℝ) : ℂ) * exp (z * (representedResidual input i).value) eval := spectralDenominatorEval input I derivative operationCount := 12 * I.card + 8 + derivative magnitudeEnvelope := empiricalFDerivativeBound input (spectralFullBoxRadius B) derivative derivativeEnvelope := 128 * empiricalFWidthBound input (spectralFullBoxRadius B) derivative precision := fun e ↦ spectralEmpiricalMapFuel e (12 * I.card + 8 + derivative) ((128 * max 1 (empiricalFWidthBound input (spectralFullBoxRadius B) derivative)) ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorMap · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:719
def spectralNumeratorMap

The finite-sum certified empirical G map on the same fixed disk.

Definition (Lean source)
def spectralNumeratorMap (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) : BoundedComplexMap (spectralDiskBox B) where value := fun z ↦ ((max I.card 1 : ℝ)⁻¹ : ℂ) * ∑ i ∈ I, (((input.observations i).yName.value * (representedResidual input i).value ^ derivative : ℝ) : ℂ) * exp (z * (representedResidual input i).value) eval := spectralNumeratorEval input I derivative operationCount := 14 * I.card + 8 + derivative magnitudeEnvelope := empiricalGDerivativeBound input (spectralFullBoxRadius B) derivative derivativeEnvelope := 256 * empiricalGWidthBound input (spectralFullBoxRadius B) derivative precision := fun e ↦ spectralEmpiricalMapFuel e (14 * I.card + 8 + derivative) ((256 * max 1 (empiricalGWidthBound input (spectralFullBoxRadius B) derivative)) ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorMap · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:736
theorem complexRectangle_width_mono

If one complex rectangle is contained in another, then its coordinate diameter is no larger.

Formal statement
h :
I.Subinterval J
I.width ≤ J.width
Proof (Lean source)
lemma complexRectangle_width_mono {I J : ComplexRatInterval} (h : I.Subinterval J) : I.width ≤ J.width := max_le_max (RatInterval.width_mono h.1) (RatInterval.width_mono h.2)
CausalSmith.Stat.SaPlmCumulantConverse.complexRectangle_width_mono · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:754
theorem spectralDenominatorRawEval_sound_of_canonical

Canonical centered raw F evaluation is semantically sound on every subrectangle of the full spectral box.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace),
input = canonicalRepresentedInput p pStar cStar gcode data
z :
hK :
K.Subinterval (spectralDiskBox B)
hz :
K.Contains z
fuel :
(spectralDenominatorRawEval input I derivative K fuel).Contains ((spectralDenominatorMap input B I derivative).value z)
Proof (Lean source)
lemma spectralDenominatorRawEval_sound_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : ∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace), input = canonicalRepresentedInput p pStar cStar gcode data) {K : ComplexRatInterval} {z : ℂ} (hK : K.Subinterval (spectralDiskBox B)) (hz : K.Contains z) (fuel : ℕ) : (spectralDenominatorRawEval input I derivative K fuel).Contains ((spectralDenominatorMap input B I derivative).value z) := by rcases hcanonical with ⟨pStar, cStar, gcode, data, rfl⟩ let input := canonicalRepresentedInput p pStar cStar gcode data let termInterval : Fin p.n → ComplexRatInterval := fun i ↦ let residual := (representedResidual input i).approx fuel let argument := K.mul (realRect residual) (realRect (residual.npow derivative)).mul (BoundedCertifiedComplex.centeredComplexExp argument fuel) let termValue : Fin p.n → ℂ := fun i ↦ (((representedResidual input i).value ^ derivative : ℝ) : ℂ) * exp (z * (representedResidual input i).value) have hterm : ∀ i, (termInterval i).Contains (termValue i) := by intro i have hr := (representedResidual input i).contains fuel have hargument : (K.mul (realRect ((representedResidual input i).approx fuel))).Contains (z * (representedResidual input i).value) := ComplexRatInterval.mul_sound hz (realRect_sound hr) have hexponential := BoundedCertifiedComplex.centeredComplexExp_sound (K.mul (realRect ((representedResidual input i).approx fuel))) fuel hargument have hpower := realRect_sound (RatInterval.npow_sound hr derivative) exact ComplexRatInterval.mul_sound hpower hexponential have hterms : Forall₂ (fun J v ↦ J.Contains v) (I.toList.map termInterval) (I.toList.map termValue) := by rw [List.forall₂_map_left_iff, List.forall₂_map_right_iff, List.forall₂_same] exact fun i _ ↦ hterm i have hsum := intervalSum_contains_sum _ _ hterms have hscaled := ComplexRatInterval.smulRat_sound ((max I.card 1 : ℚ)⁻¹) hsum have hscaleCast : (((max (I.card : ℚ) 1)⁻¹ : ℚ) : ℂ) = (((max (I.card : ℝ) 1)⁻¹ : ℝ) : ℂ) := by by_cases hcard : I.card = 0 · simp [hcard] · have hc : 1 ≤ I.card := Nat.one_le_iff_ne_zero.mpr hcard rw [max_eq_left (by exact_mod_cast hc : (1 : ℚ) ≤ I.card), max_eq_left (by exact_mod_cast hc : (1 : ℝ) ≤ I.card)] norm_num have heval : spectralDenominatorRawEval input I derivative K fuel = (intervalSum (I.toList.map termInterval)).smulRat ((max I.card 1 : ℚ)⁻¹) := rfl have hvalue : (spectralDenominatorMap input B I derivative).value z = ((((max I.card 1 : ℚ)⁻¹ : ℚ) : ℂ) * (I.toList.map termValue).sum) := by rw [hscaleCast] simp [spectralDenominatorMap, termValue, Finset.sum_toList] rw [heval, hvalue] exact hscaled
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorRawEval_sound_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:989
theorem spectralNumeratorRawEval_sound_of_canonical

Canonical centered raw G evaluation is semantically sound on every subrectangle of the full spectral box.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace),
input = canonicalRepresentedInput p pStar cStar gcode data
z :
hK :
K.Subinterval (spectralDiskBox B)
hz :
K.Contains z
fuel :
(spectralNumeratorRawEval input I derivative K fuel).Contains ((spectralNumeratorMap input B I derivative).value z)
Proof (Lean source)
lemma spectralNumeratorRawEval_sound_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : ∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace), input = canonicalRepresentedInput p pStar cStar gcode data) {K : ComplexRatInterval} {z : ℂ} (hK : K.Subinterval (spectralDiskBox B)) (hz : K.Contains z) (fuel : ℕ) : (spectralNumeratorRawEval input I derivative K fuel).Contains ((spectralNumeratorMap input B I derivative).value z) := by rcases hcanonical with ⟨pStar, cStar, gcode, data, rfl⟩ let input := canonicalRepresentedInput p pStar cStar gcode data let termInterval : Fin p.n → ComplexRatInterval := fun i ↦ let residual := (representedResidual input i).approx fuel let weight := (input.observations i).yName.approx fuel let argument := K.mul (realRect residual) (realRect (weight.mul (residual.npow derivative))).mul (BoundedCertifiedComplex.centeredComplexExp argument fuel) let termValue : Fin p.n → ℂ := fun i ↦ (((input.observations i).yName.value * (representedResidual input i).value ^ derivative : ℝ) : ℂ) * exp (z * (representedResidual input i).value) have hterm : ∀ i, (termInterval i).Contains (termValue i) := by intro i have hr := (representedResidual input i).contains fuel have hy := (input.observations i).yName.contains fuel have hargument : (K.mul (realRect ((representedResidual input i).approx fuel))).Contains (z * (representedResidual input i).value) := ComplexRatInterval.mul_sound hz (realRect_sound hr) have hexponential := BoundedCertifiedComplex.centeredComplexExp_sound (K.mul (realRect ((representedResidual input i).approx fuel))) fuel hargument have hcoefficient := realRect_sound (RatInterval.mul_sound hy (RatInterval.npow_sound hr derivative)) exact ComplexRatInterval.mul_sound hcoefficient hexponential have hterms : Forall₂ (fun J v ↦ J.Contains v) (I.toList.map termInterval) (I.toList.map termValue) := by rw [List.forall₂_map_left_iff, List.forall₂_map_right_iff, List.forall₂_same] exact fun i _ ↦ hterm i have hsum := intervalSum_contains_sum _ _ hterms have hscaled := ComplexRatInterval.smulRat_sound ((max I.card 1 : ℚ)⁻¹) hsum have hscaleCast : (((max (I.card : ℚ) 1)⁻¹ : ℚ) : ℂ) = (((max (I.card : ℝ) 1)⁻¹ : ℝ) : ℂ) := by by_cases hcard : I.card = 0 · simp [hcard] · have hc : 1 ≤ I.card := Nat.one_le_iff_ne_zero.mpr hcard rw [max_eq_left (by exact_mod_cast hc : (1 : ℚ) ≤ I.card), max_eq_left (by exact_mod_cast hc : (1 : ℝ) ≤ I.card)] norm_num have heval : spectralNumeratorRawEval input I derivative K fuel = (intervalSum (I.toList.map termInterval)).smulRat ((max I.card 1 : ℚ)⁻¹) := rfl have hvalue : (spectralNumeratorMap input B I derivative).value z = ((((max I.card 1 : ℚ)⁻¹ : ℚ) : ℂ) * (I.toList.map termValue).sum) := by rw [hscaleCast] simp [spectralNumeratorMap, termValue, Finset.sum_toList] rw [heval, hvalue] exact hscaled
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorRawEval_sound_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1046
theorem spectralDenominatorRawEval_width_of_canonical

The scheduled raw F rectangle pays for the derivative envelope times the certified input width in addition to the centered algorithmic remainder.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace),
input = canonicalRepresentedInput p pStar cStar gcode data
hK :
K.Subinterval (spectralDiskBox B)
e :
(spectralDenominatorRawEval input I derivative K ((spectralDenominatorMap input B I derivative).precision e)).width
≤ (spectralDenominatorMap input B I derivative).derivativeEnvelope * K.width + e.1
Proof (Lean source)
lemma spectralDenominatorRawEval_width_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : ∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace), input = canonicalRepresentedInput p pStar cStar gcode data) (K : ComplexRatInterval) (hK : K.Subinterval (spectralDiskBox B)) (e : PosRat) : (spectralDenominatorRawEval input I derivative K ((spectralDenominatorMap input B I derivative).precision e)).width ≤ (spectralDenominatorMap input B I derivative).derivativeEnvelope * K.width + e.1 := by rcases hcanonical with ⟨pStar, cStar, gcode, data, rfl⟩ let input := canonicalRepresentedInput p pStar cStar gcode data let ρ := spectralFullBoxRadius B let Q := empiricalFWidthBound input ρ derivative let L := (128 * max 1 Q) ^ 2 let operations := 12 * I.card + 8 + derivative let F := spectralEmpiricalMapFuel e operations L let η : ℚ := 1 / F have hρ0 : 0 ≤ ρ := spectralFullBoxRadius_nonneg B have hQ0 : 0 ≤ Q := empiricalFWidthBound_nonneg input ρ derivative hρ0 have hF0 : 0 < F := by dsimp [F, operations, L] unfold spectralEmpiricalMapFuel positivity have hη0 : 0 ≤ η := by dsimp [η]; positivity have hη1 : η ≤ 1 := by dsimp [η] rw [div_le_one (by exact_mod_cast hF0 : (0 : ℚ) < F)] exact_mod_cast hF0 have hKbox : K.maxAbs ≤ (spectralDiskBox B).maxAbs := max_le_max (ComplexRatInterval.rat_maxAbs_mono hK.1) (ComplexRatInterval.rat_maxAbs_mono hK.2) have hbox0 : 0 ≤ (spectralDiskBox B).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hKmax : K.maxAbs ≤ ρ := hKbox.trans (by dsimp [ρ, spectralFullBoxRadius] nlinarith) have hKwidth : K.width ≤ ρ := (complexRectangle_width_le_two_maxAbs K).trans (by dsimp [ρ, spectralFullBoxRadius] exact mul_le_mul_of_nonneg_left hKbox (by norm_num)) let term : Fin p.n → ComplexRatInterval := fun i ↦ let R := (representedResidual input i).approx F let J := K.mul (realRect R) (realRect (R.npow derivative)).mul (BoundedCertifiedComplex.centeredComplexExp J F) have hterm : ∀ i ∈ I, (term i).width ≤ 128 * (((ρ + 1) * (derivative + 1) * (2 * max 1 (residualUpper input i)) ^ (derivative + 1) * rationalExpEnvelope ρ (residualUpper input i)) ^ 8) * (K.width + η) := by intro i hi let S := residualUpper input i let A := 2 * max 1 S let E := rationalExpEnvelope ρ S let b := (ρ + 1) * (derivative + 1) * A ^ (derivative + 1) * E let R := (representedResidual input i).approx F let J := K.mul (realRect R) let X := BoundedCertifiedComplex.centeredComplexExp J F have hS0 : 0 ≤ S := residualUpper_nonneg input i have hA2 : 2 ≤ A := by dsimp [A]; nlinarith [le_max_left (1 : ℚ) S] have hE1 : 1 ≤ E := by dsimp [E, rationalExpEnvelope] exact one_le_pow₀ (by norm_num) have hb1 : 1 ≤ b := by dsimp [b] have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith : (1 : ℚ) ≤ A) calc 1 = 1 * 1 * 1 * 1 := by norm_num _ ≤ (ρ + 1) * (derivative + 1) * A ^ (derivative + 1) * E := by gcongr have hρb : ρ ≤ b := by have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith) have ht : 1 ≤ (derivative + 1 : ℚ) * A ^ (derivative + 1) * E := by calc 1 = 1 * 1 * 1 := by norm_num _ ≤ (derivative + 1 : ℚ) * A ^ (derivative + 1) * E := by gcongr calc ρ ≤ ρ + 1 := by linarith _ = (ρ + 1) * 1 := by ring _ ≤ b := by simpa [b, mul_assoc] using (mul_le_mul_of_nonneg_left ht (by linarith : (0 : ℚ) ≤ ρ + 1)) have hF64 : 64 ≤ F := by dsimp [F] unfold spectralEmpiricalMapFuel have ho : 1 ≤ operations + 1 := by omega have he : 1 ≤ e.1.den + 1 := by omega have hl : 1 ≤ (L.num.natAbs + 2) ^ 2 := Nat.one_le_pow 2 (L.num.natAbs + 2) (by omega) calc 64 = 64 * 1 * 1 * 1 := by norm_num _ ≤ 64 * (operations + 1) * (e.1.den + 1) * (L.num.natAbs + 2) ^ 2 := by gcongr have hmod : (representedResidual input i).modulus errorOne ≤ F := by dsimp [input] simp [representedResidual, CertifiedReal.sub, CertifiedReal.add, CertifiedReal.neg, canonicalRepresentedInput, canonicalObservationName, errorOne] omega have hRmax : R.maxAbs ≤ S := canonicalResidual_maxAbs_at_fuel p pStar cStar gcode data i F hmod have hRmax0 : 0 ≤ R.maxAbs := (abs_nonneg _).trans (le_max_left _ _) have hdyadic : 1 / (2 : ℚ) ^ (F + 1) ≤ η := by dsimp [η] have hp : (F : ℚ) ≤ (2 : ℚ) ^ (F + 1) := by exact_mod_cast (le_of_lt (Nat.lt_pow_self (by norm_num : 1 < 2))).trans (Nat.pow_le_pow_right (by norm_num) (Nat.le_succ F)) exact div_le_div_of_nonneg_left (by norm_num) (by exact_mod_cast hF0) hp have hRw : R.width ≤ 2 * η := (canonicalRepresentedInput_residual_approx_width p pStar cStar gcode data i F).trans (by simpa [div_eq_mul_inv] using (mul_le_mul_of_nonneg_left hdyadic (by norm_num : (0 : ℚ) ≤ 2))) have hSd : R.maxAbs ^ derivative ≤ b := by have hSA : R.maxAbs ≤ A := hRmax.trans ((le_max_right (1 : ℚ) S).trans (by nlinarith [hA2])) have hp : R.maxAbs ^ derivative ≤ A ^ (derivative + 1) := (pow_le_pow_left₀ hRmax0 hSA derivative).trans (pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (Nat.le_succ _)) have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num exact hp.trans (by calc A ^ (derivative + 1) = 1 * 1 * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr) have hPw : (R.npow derivative).width ≤ 2 * b ^ 2 * η := by have hp := ratInterval_npow_width_propagation R derivative S (2 * η) hS0 hRw hRmax have hcoef : (derivative : ℚ) * A ^ derivative ≤ b := by have hd : (derivative : ℚ) ≤ derivative + 1 := by norm_num have hpow : A ^ derivative ≤ A ^ (derivative + 1) := pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (Nat.le_succ _) calc (derivative : ℚ) * A ^ derivative ≤ (derivative + 1) * A ^ (derivative + 1) := mul_le_mul hd hpow (pow_nonneg (by positivity) _) (by positivity) _ ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith calc (derivative + 1) * A ^ (derivative + 1) = 1 * (derivative + 1) * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr calc (R.npow derivative).width ≤ (derivative : ℚ) * A ^ derivative * (2 * η) := hp _ ≤ b * (2 * η) := mul_le_mul_of_nonneg_right hcoef (mul_nonneg (by norm_num) hη0) _ ≤ 2 * b ^ 2 * η := by have hbb : b ≤ b ^ 2 := by nlinarith [hb1] nlinarith [mul_le_mul_of_nonneg_right hbb hη0] have hJw : J.width ≤ 4 * b * η + 2 * b * K.width := by dsimp [J] have hKb : K.maxAbs ≤ b := hKmax.trans (by exact hρb) have hRb : R.maxAbs ≤ b := hRmax.trans (by calc S ≤ A := by dsimp [A]; nlinarith [le_max_right (1 : ℚ) S] _ ≤ A ^ (derivative + 1) := by simpa using (pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (show 1 ≤ derivative + 1 by omega)) _ ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num calc A ^ (derivative + 1) = 1 * 1 * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr) calc (K.mul (realRect R)).width ≤ 2 * (K.maxAbs * R.width + R.maxAbs * K.width) := by simpa using complexRectangle_mul_width_propagation K (realRect R) _ ≤ 2 * (b * (2 * η) + b * K.width) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) apply add_le_add · exact mul_le_mul hKb hRw (RatInterval.width_nonneg R) (by positivity) · exact mul_le_mul_of_nonneg_right hRb ((RatInterval.width_nonneg K.re).trans (le_max_left _ _)) _ = _ := by ring have hJmax : J.maxAbs ≤ ρ * S := by dsimp [J] calc (K.mul (realRect R)).maxAbs ≤ 2 * K.maxAbs * R.maxAbs := by simpa using ComplexRatInterval.mul_maxAbs K (realRect R) _ ≤ 2 * (spectralDiskBox B).maxAbs * S := by exact mul_le_mul (mul_le_mul_of_nonneg_left hKbox (by norm_num)) hRmax hRmax0 (mul_nonneg (by norm_num) hbox0) _ = ρ * S := by simp [ρ, spectralFullBoxRadius] have hJhi : J.re.hi ≤ ρ * S := by exact (le_abs_self J.re.hi).trans ((le_max_right _ _).trans ((le_max_left _ _).trans hJmax)) have hEnv : BoundedCertifiedComplex.centeredExpEnvelope J ≤ E := centeredExpEnvelope_le_rationalExpEnvelope J ρ S hJhi let εF : PosRat := ⟨1 / (F : ℚ), by positivity⟩ have hstage : Transcendental.complexExpPrecision (BoundedCertifiedComplex.centeredExpCenterName J) εF = F := by simp [Transcendental.complexExpPrecision, εF, hF0.ne'] have hXw0 := BoundedCertifiedComplex.centeredComplexExp_width_at_precision J εF rw [hstage] at hXw0 have hXw : X.width ≤ 9 * b ^ 2 * η + 4 * b ^ 2 * K.width := by dsimp [X, εF] at hXw0 have hEb : E ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith : (1 : ℚ) ≤ A) calc E = 1 * 1 * 1 * E := by ring _ ≤ b := by dsimp [b]; gcongr calc _ ≤ 2 * E * (4 * b * η + 2 * b * K.width) + η := by exact hXw0.trans (add_le_add (mul_le_mul (mul_le_mul_of_nonneg_left hEnv (by norm_num)) hJw ((RatInterval.width_nonneg J.re).trans (le_max_left _ _)) (mul_nonneg (by norm_num) (by linarith [hE1]))) le_rfl) _ ≤ _ := by exact spectralExpWidth_arith E b η K.width hEb hb1 hη0 ((RatInterval.width_nonneg K.re).trans (le_max_left _ _)) have hXmax : X.maxAbs ≤ 14 * b ^ 3 := by have hEb : E ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith : (1 : ℚ) ≤ A) calc E = 1 * 1 * 1 * E := by ring _ ≤ b := by dsimp [b]; gcongr calc X.maxAbs ≤ BoundedCertifiedComplex.centeredExpEnvelope J + X.width := centeredComplexExp_maxAbs_le J F _ ≤ E + (9 * b ^ 2 * η + 4 * b ^ 2 * K.width) := add_le_add hEnv hXw _ ≤ 14 * b ^ 3 := by have hKwb := hKwidth.trans hρb have hb2 : b ^ 2 ≤ b ^ 3 := pow_le_pow_right₀ hb1 (by norm_num) have hbη := mul_le_mul_of_nonneg_left hη1 (pow_nonneg (by positivity) 2) have hbK := mul_le_mul_of_nonneg_left hKwb (pow_nonneg (by positivity) 2) nlinarith simpa [term, R, J, X, b, A, E, S] using spectralDenominatorTerm_width_coarse K R derivative X b η hb1 hη0 hSd hPw hXw hXmax have hlist : ((I.toList.map term).map ComplexRatInterval.width).sum ≤ 128 * Q * (K.width + η) := by calc ((I.toList.map term).map ComplexRatInterval.width).sum = ∑ i ∈ I, (term i).width := by simp _ ≤ ∑ i ∈ I, 128 * (((ρ + 1) * (derivative + 1) * (2 * max 1 (residualUpper input i)) ^ (derivative + 1) * rationalExpEnvelope ρ (residualUpper input i)) ^ 8) * -- … truncated; follow the source link for the rest …
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorRawEval_width_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1109
theorem spectralNumeratorRawEval_width_of_canonical

The scheduled raw G rectangle has the analogous full-box effective-width bound, including the canonical outcome-name refinement.

Formal statement
I :
Finset (Fin p.n)
derivative :
hcanonical :
∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace),
input = canonicalRepresentedInput p pStar cStar gcode data
hK :
K.Subinterval (spectralDiskBox B)
e :
(spectralNumeratorRawEval input I derivative K ((spectralNumeratorMap input B I derivative).precision e)).width
≤ (spectralNumeratorMap input B I derivative).derivativeEnvelope * K.width + e.1
Proof (Lean source)
lemma spectralNumeratorRawEval_width_of_canonical (input : RepresentedSpectralInput p) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (hcanonical : ∃ (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace), input = canonicalRepresentedInput p pStar cStar gcode data) (K : ComplexRatInterval) (hK : K.Subinterval (spectralDiskBox B)) (e : PosRat) : (spectralNumeratorRawEval input I derivative K ((spectralNumeratorMap input B I derivative).precision e)).width ≤ (spectralNumeratorMap input B I derivative).derivativeEnvelope * K.width + e.1 := by rcases hcanonical with ⟨pStar, cStar, gcode, data, rfl⟩ let input := canonicalRepresentedInput p pStar cStar gcode data let ρ := spectralFullBoxRadius B let Q := empiricalGWidthBound input ρ derivative let L := (256 * max 1 Q) ^ 2 let operations := 14 * I.card + 8 + derivative let F := spectralEmpiricalMapFuel e operations L let η : ℚ := 1 / F have hρ0 : 0 ≤ ρ := spectralFullBoxRadius_nonneg B have hQ0 : 0 ≤ Q := empiricalGWidthBound_nonneg input ρ derivative hρ0 have hF0 : 0 < F := by dsimp [F, operations, L] unfold spectralEmpiricalMapFuel positivity have hη0 : 0 ≤ η := by dsimp [η]; positivity have hη1 : η ≤ 1 := by dsimp [η] rw [div_le_one (by exact_mod_cast hF0 : (0 : ℚ) < F)] exact_mod_cast hF0 have hKbox : K.maxAbs ≤ (spectralDiskBox B).maxAbs := max_le_max (ComplexRatInterval.rat_maxAbs_mono hK.1) (ComplexRatInterval.rat_maxAbs_mono hK.2) have hbox0 : 0 ≤ (spectralDiskBox B).maxAbs := (abs_nonneg _).trans ((le_max_left _ _).trans (le_max_left _ _)) have hKmax : K.maxAbs ≤ ρ := hKbox.trans (by dsimp [ρ, spectralFullBoxRadius] nlinarith) have hKwidth : K.width ≤ ρ := (complexRectangle_width_le_two_maxAbs K).trans (by dsimp [ρ, spectralFullBoxRadius] exact mul_le_mul_of_nonneg_left hKbox (by norm_num)) let term : Fin p.n → ComplexRatInterval := fun i ↦ let R := (representedResidual input i).approx F let W := (input.observations i).yName.approx F let J := K.mul (realRect R) (realRect (W.mul (R.npow derivative))).mul (BoundedCertifiedComplex.centeredComplexExp J F) have hterm : ∀ i ∈ I, (term i).width ≤ 256 * ((max 1 (outcomeUpper input i) * (ρ + 1) * (derivative + 1) * (2 * max 1 (residualUpper input i)) ^ (derivative + 1) * rationalExpEnvelope ρ (residualUpper input i)) ^ 8) * (K.width + η) := by intro i hi let S := residualUpper input i let Y := outcomeUpper input i let A := 2 * max 1 S let E := rationalExpEnvelope ρ S let b := max 1 Y * (ρ + 1) * (derivative + 1) * A ^ (derivative + 1) * E let R := (representedResidual input i).approx F let W := (input.observations i).yName.approx F let J := K.mul (realRect R) let X := BoundedCertifiedComplex.centeredComplexExp J F have hS0 : 0 ≤ S := residualUpper_nonneg input i have hY0 : 0 ≤ Y := outcomeUpper_nonneg input i have hY1 : 1 ≤ max 1 Y := le_max_left _ _ have hYρ1 : 1 ≤ max 1 Y * (ρ + 1) := by nlinarith [mul_le_mul hY1 (show (1 : ℚ) ≤ ρ + 1 by linarith) (by norm_num : (0 : ℚ) ≤ 1) (by positivity : (0 : ℚ) ≤ max 1 Y)] have hA2 : 2 ≤ A := by dsimp [A]; nlinarith [le_max_left (1 : ℚ) S] have hE1 : 1 ≤ E := by dsimp [E, rationalExpEnvelope] exact one_le_pow₀ (by norm_num) have hb1 : 1 ≤ b := by dsimp [b] have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith : (1 : ℚ) ≤ A) calc 1 = 1 * 1 * 1 * 1 * 1 := by norm_num _ ≤ max 1 Y * (ρ + 1) * (derivative + 1) * A ^ (derivative + 1) * E := by gcongr have hρb : ρ ≤ b := by have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith) have ht : 1 ≤ max 1 Y * (derivative + 1 : ℚ) * A ^ (derivative + 1) * E := by calc 1 = 1 * 1 * 1 * 1 := by norm_num _ ≤ max 1 Y * (derivative + 1 : ℚ) * A ^ (derivative + 1) * E := by gcongr calc ρ ≤ ρ + 1 := by linarith _ = (ρ + 1) * 1 := by ring _ ≤ b := by dsimp [b] nlinarith [mul_le_mul_of_nonneg_left ht (by linarith : (0 : ℚ) ≤ ρ + 1)] have hmod : (representedResidual input i).modulus errorOne ≤ F := by have hF64 : 64 ≤ F := by dsimp [F] unfold spectralEmpiricalMapFuel have ho : 1 ≤ operations + 1 := by omega have he : 1 ≤ e.1.den + 1 := by omega have hl : 1 ≤ (L.num.natAbs + 2) ^ 2 := Nat.one_le_pow 2 (L.num.natAbs + 2) (by omega) calc 64 = 64 * 1 * 1 * 1 := by norm_num _ ≤ 64 * (operations + 1) * (e.1.den + 1) * (L.num.natAbs + 2) ^ 2 := by gcongr dsimp [input] simp [representedResidual, CertifiedReal.sub, CertifiedReal.add, CertifiedReal.neg, canonicalRepresentedInput, canonicalObservationName, errorOne] omega have hmodY : (input.observations i).yName.modulus errorOne ≤ F := by have hF64 : 64 ≤ F := by dsimp [F] unfold spectralEmpiricalMapFuel have ho : 1 ≤ operations + 1 := by omega have he : 1 ≤ e.1.den + 1 := by omega have hl : 1 ≤ (L.num.natAbs + 2) ^ 2 := Nat.one_le_pow 2 (L.num.natAbs + 2) (by omega) calc 64 = 64 * 1 * 1 * 1 := by norm_num _ ≤ 64 * (operations + 1) * (e.1.den + 1) * (L.num.natAbs + 2) ^ 2 := by gcongr dsimp [input] simp [canonicalRepresentedInput, canonicalObservationName, errorOne] omega have hRmax : R.maxAbs ≤ S := canonicalResidual_maxAbs_at_fuel p pStar cStar gcode data i F hmod have hWmax : W.maxAbs ≤ Y := canonicalOutcome_maxAbs_at_fuel p pStar cStar gcode data i F hmodY have hRmax0 : 0 ≤ R.maxAbs := (abs_nonneg _).trans (le_max_left _ _) have hdyadic : 1 / (2 : ℚ) ^ (F + 1) ≤ η := by dsimp [η] have hp : (F : ℚ) ≤ (2 : ℚ) ^ (F + 1) := by exact_mod_cast (le_of_lt (Nat.lt_pow_self (by norm_num : 1 < 2))).trans (Nat.pow_le_pow_right (by norm_num) (Nat.le_succ F)) exact div_le_div_of_nonneg_left (by norm_num) (by exact_mod_cast hF0) hp have hRw : R.width ≤ 2 * η := (canonicalRepresentedInput_residual_approx_width p pStar cStar gcode data i F).trans (by simpa [div_eq_mul_inv] using (mul_le_mul_of_nonneg_left hdyadic (by norm_num : (0 : ℚ) ≤ 2))) have hWw : W.width ≤ η := (canonicalRepresentedInput_outcome_approx_width p pStar cStar gcode data i F).trans (by simpa [div_eq_mul_inv] using hdyadic) have hSd : R.maxAbs ^ derivative ≤ b := by have hSA : R.maxAbs ≤ A := hRmax.trans ((le_max_right (1 : ℚ) S).trans (by nlinarith [hA2])) have hp : R.maxAbs ^ derivative ≤ A ^ (derivative + 1) := (pow_le_pow_left₀ hRmax0 hSA derivative).trans (pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (Nat.le_succ _)) have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num exact hp.trans (by calc A ^ (derivative + 1) = 1 * 1 * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr) have hPw : (R.npow derivative).width ≤ 2 * b ^ 2 * η := by have hp := ratInterval_npow_width_propagation R derivative S (2 * η) hS0 hRw hRmax have hcoef : (derivative : ℚ) * A ^ derivative ≤ b := by have hd : (derivative : ℚ) ≤ derivative + 1 := by norm_num have hpow : A ^ derivative ≤ A ^ (derivative + 1) := pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (Nat.le_succ _) calc (derivative : ℚ) * A ^ derivative ≤ (derivative + 1) * A ^ (derivative + 1) := mul_le_mul hd hpow (pow_nonneg (by positivity) _) (by positivity) _ ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith calc (derivative + 1) * A ^ (derivative + 1) = 1 * (derivative + 1) * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr calc (R.npow derivative).width ≤ (derivative : ℚ) * A ^ derivative * (2 * η) := hp _ ≤ b * (2 * η) := mul_le_mul_of_nonneg_right hcoef (mul_nonneg (by norm_num) hη0) _ ≤ 2 * b ^ 2 * η := by have hbb : b ≤ b ^ 2 := by nlinarith [hb1] nlinarith [mul_le_mul_of_nonneg_right hbb hη0] have hJw : J.width ≤ 4 * b * η + 2 * b * K.width := by dsimp [J] have hKb : K.maxAbs ≤ b := hKmax.trans (by exact hρb) have hRb : R.maxAbs ≤ b := hRmax.trans (by calc S ≤ A := by dsimp [A]; nlinarith [le_max_right (1 : ℚ) S] _ ≤ A ^ (derivative + 1) := by simpa using (pow_le_pow_right₀ (by linarith : (1 : ℚ) ≤ A) (show 1 ≤ derivative + 1 by omega)) _ ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num calc A ^ (derivative + 1) = 1 * 1 * A ^ (derivative + 1) * 1 := by ring _ ≤ b := by dsimp [b]; gcongr) calc (K.mul (realRect R)).width ≤ 2 * (K.maxAbs * R.width + R.maxAbs * K.width) := by simpa using complexRectangle_mul_width_propagation K (realRect R) _ ≤ 2 * (b * (2 * η) + b * K.width) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) apply add_le_add · exact mul_le_mul hKb hRw (RatInterval.width_nonneg R) (by positivity) · exact mul_le_mul_of_nonneg_right hRb ((RatInterval.width_nonneg K.re).trans (le_max_left _ _)) _ = _ := by ring have hJmax : J.maxAbs ≤ ρ * S := by dsimp [J] calc (K.mul (realRect R)).maxAbs ≤ 2 * K.maxAbs * R.maxAbs := by simpa using ComplexRatInterval.mul_maxAbs K (realRect R) _ ≤ 2 * (spectralDiskBox B).maxAbs * S := by exact mul_le_mul (mul_le_mul_of_nonneg_left hKbox (by norm_num)) hRmax hRmax0 (mul_nonneg (by norm_num) hbox0) _ = ρ * S := by simp [ρ, spectralFullBoxRadius] have hJhi : J.re.hi ≤ ρ * S := by exact (le_abs_self J.re.hi).trans ((le_max_right _ _).trans ((le_max_left _ _).trans hJmax)) have hEnv : BoundedCertifiedComplex.centeredExpEnvelope J ≤ E := centeredExpEnvelope_le_rationalExpEnvelope J ρ S hJhi let εF : PosRat := ⟨1 / (F : ℚ), by positivity⟩ have hstage : Transcendental.complexExpPrecision (BoundedCertifiedComplex.centeredExpCenterName J) εF = F := by simp [Transcendental.complexExpPrecision, εF, hF0.ne'] have hXw0 := BoundedCertifiedComplex.centeredComplexExp_width_at_precision J εF rw [hstage] at hXw0 have hXw : X.width ≤ 9 * b ^ 2 * η + 4 * b ^ 2 * K.width := by dsimp [X, εF] at hXw0 have hEb : E ≤ b := by have hρ1 : (1 : ℚ) ≤ ρ + 1 := by linarith have hd1 : (1 : ℚ) ≤ derivative + 1 := by norm_num have hAp : 1 ≤ A ^ (derivative + 1) := one_le_pow₀ (by linarith : (1 : ℚ) ≤ A) calc E = 1 * 1 * 1 * E := by ring _ ≤ b := by dsimp [b]; gcongr calc _ ≤ 2 * E * (4 * b * η + 2 * b * K.width) + η := by exact hXw0.trans (add_le_add (mul_le_mul (mul_le_mul_of_nonneg_left hEnv (by norm_num)) hJw ((RatInterval.width_nonneg J.re).trans (le_max_left _ _)) (mul_nonneg (by norm_num) (by linarith [hE1]))) le_rfl) _ ≤ _ := by exact spectralExpWidth_arith E b η K.width hEb hb1 hη0 ((RatInterval.width_nonneg K.re).trans (le_max_left _ _)) -- … truncated; follow the source link for the rest …
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorRawEval_width_of_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1451
inductive SpectralNodeKind

The three kinds of certified contour node the estimator evaluates: the pilot boundary scan, the winding-number quadrature, and the final moment evaluation.

Definition (Lean source)
inductive SpectralNodeKind | pilot | winding | evaluation
def spectralNodeOperationCount

The number of certified interval operations charged to one contour node, as an affine function of the fold's sample size: twelve per unit plus eighteen for a pilot node, twenty-four per unit plus thirty-eight for a winding node, and twenty-eight per unit plus forty-two for an evaluation node.

Definition (Lean source)
def spectralNodeOperationCount (kind : SpectralNodeKind) (sampleCard : ℕ) : ℕ := match kind with | .pilot => 12 * sampleCard + 18 | .winding => 24 * sampleCard + 38 | .evaluation => 28 * sampleCard + 42
CausalSmith.Stat.SaPlmCumulantConverse.spectralNodeOperationCount · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1878
def estimatorNodePrecision

The quadratic requested factor pays for applying the raw Newton norm enclosure after certified-radius multiplication. The factor sixty-four leaves the corresponding quotient/tangent propagation margin.

Definition (Lean source)
def estimatorNodePrecision (requested : PosRat) (scale : ℚ) : PosRat := ⟨requested.1 ^ 2 / (64 * (max 1 scale)), div_pos (sq_pos_of_pos requested.2) (mul_pos (by norm_num) (lt_of_lt_of_le zero_lt_one (le_max_left _ _)))⟩
CausalSmith.Stat.SaPlmCumulantConverse.estimatorNodePrecision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1888
def bankRadiusPrecision

How accurately the certified contour radius must be refined before it is multiplied by a unit-circle node: the requested accuracy divided by four times one plus the node's own width, capped at one so the precision request never exceeds a unit.

Definition (Lean source)
def bankRadiusPrecision (requested : PosRat) (unitWidth : ℚ) : PosRat := ⟨min 1 (requested.1 / (4 * (1 + max 0 unitWidth))), by apply lt_min · norm_num · exact div_pos requested.2 (mul_pos (by norm_num) (by linarith [le_max_left (0 : ℚ) unitWidth]))⟩
CausalSmith.Stat.SaPlmCumulantConverse.bankRadiusPrecision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1895
def pilotNodeTolerance

The node and mesh halves of the pilot's aStar/64 error budget.

Definition (Lean source)
def pilotNodeTolerance (B : ContourBankData) : PosRat := ⟨B.aStarRat / 128, div_pos B.aStarRat_pos (by norm_num)⟩
CausalSmith.Stat.SaPlmCumulantConverse.pilotNodeTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1905
def pilotMeshTolerance

The mesh half of the pilot error budget: one hundred twenty-eighth of the bank's boundary-modulus certificate.

Definition (Lean source)
def pilotMeshTolerance (B : ContourBankData) : PosRat := ⟨B.aStarRat / 128, div_pos B.aStarRat_pos (by norm_num)⟩
CausalSmith.Stat.SaPlmCumulantConverse.pilotMeshTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1909
def pilotTolerance

The total pilot error budget: one sixty-fourth of the bank's boundary-modulus certificate, split evenly between the node and mesh halves.

Definition (Lean source)
def pilotTolerance (B : ContourBankData) : PosRat := ⟨B.aStarRat / 64, div_pos B.aStarRat_pos (by norm_num)⟩
def evaluationTolerance

The total error budget of the final moment evaluation: the reciprocal of the sample size (with one as a floor), so that the evaluation error vanishes as the sample grows.

Definition (Lean source)
def evaluationTolerance (p : Parameters) : PosRat := ⟨1 / (max p.n 1 : ℚ), by positivity⟩
CausalSmith.Stat.SaPlmCumulantConverse.evaluationTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1919
def evaluationNodeTolerance

The node half of the evaluation error budget: one over twice the sample size (with one as a floor).

Definition (Lean source)
def evaluationNodeTolerance (p : Parameters) : PosRat := ⟨1 / (2 * (max p.n 1 : ℚ)), by positivity⟩
CausalSmith.Stat.SaPlmCumulantConverse.evaluationNodeTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1924
def evaluationMeshTolerance

The mesh half of the evaluation error budget: one over twice the sample size (with one as a floor).

Definition (Lean source)
def evaluationMeshTolerance (p : Parameters) : PosRat := ⟨1 / (2 * (max p.n 1 : ℚ)), by positivity⟩
CausalSmith.Stat.SaPlmCumulantConverse.evaluationMeshTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1929
def windingNodeTolerance

The node half of the winding-number error budget, fixed at one sixteenth: together with the mesh half this keeps the decoded winding enclosure inside a quarter-width window.

Definition (Lean source)
def windingNodeTolerance : PosRat := ⟨1 / 16, by norm_num⟩
CausalSmith.Stat.SaPlmCumulantConverse.windingNodeTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1934
def windingMeshTolerance

The mesh half of the winding-number error budget, fixed at one sixteenth.

Definition (Lean source)
def windingMeshTolerance : PosRat := ⟨1 / 16, by norm_num⟩
CausalSmith.Stat.SaPlmCumulantConverse.windingMeshTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1938
def guardedNodeTolerance

A positive denominator certificate controls both guarded division and the propagation of input-rectangle error through the quotient.

Definition (Lean source)
def guardedNodeTolerance (requested lower : PosRat) : PosRat := ⟨min (lower.1 / 8) (requested.1 * lower.1 ^ 2 / (1 + lower.1) ^ 2), by apply lt_min · exact div_pos lower.2 (by norm_num) · exact div_pos (mul_pos requested.2 (sq_pos_of_pos lower.2)) (sq_pos_of_pos (by linarith [lower.2]))⟩
CausalSmith.Stat.SaPlmCumulantConverse.guardedNodeTolerance · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1941
def radiusUpper

A rational upper bound for the j-th bank radius: the largest endpoint magnitude of that radius's certified enclosure, refined until its width is at most one.

Definition (Lean source)
def radiusUpper (B : ContourBankData) (j : Fin (B.JBase + 1)) : ℚ := ((B.rhoName j).approx ((B.rhoName j).modulus errorOne)).maxAbs
def radiusSlackUpper

The error-one radius enclosure needs one explicit unit of slack before it is used as a rectangle-magnitude factor.

Definition (Lean source)
def radiusSlackUpper (B : ContourBankData) (j : Fin (B.JBase + 1)) : ℚ := radiusUpper B j + 1
def spectralNormalizationAmplification

A closed rational upper bound for the amplification introduced after quadrature by division through the certified N * 2πi rectangle.

Definition (Lean source)
def spectralNormalizationAmplification (count : ℕ) : ℚ := let divisor := boundedContourDivisor count 0 1 + (max count 1 : ℚ) + divisor.maxAbs + |divisor.normSq.lo|⁻¹ + |divisor.normSq.lo|⁻¹ ^ 2
CausalSmith.Stat.SaPlmCumulantConverse.spectralNormalizationAmplification · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1961
def spectralNodeScale

Branch-wide scale for interval propagation. It includes the certified radius multiplication, full-box empirical-map magnitude/derivative envelope, guarded quotient inverse-margin loss, tangent multiplication, finite quadrature accumulation, and post-quadrature normalization.

Definition (Lean source)
def spectralNodeScale (B : ContourBankData) (j : Fin (B.JBase + 1)) (amplification : ℚ) (lower : PosRat) (count operations : ℕ) : ℚ := max 1 (256 * (operations + 1) * (1 + max 0 (radiusSlackUpper B j)) * (1 + max 0 amplification) ^ 2 * (1 + lower.1⁻¹ + lower.1⁻¹ ^ 2) * spectralNormalizationAmplification count)
CausalSmith.Stat.SaPlmCumulantConverse.spectralNodeScale · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1968
theorem radiusUpper_nonneg

The rational upper bound for a bank radius is never negative.

Formal statement
j :
Fin (B.JBase + 1)
0 ≤ radiusUpper B j
Proof (Lean source)
lemma radiusUpper_nonneg (B : ContourBankData) (j : Fin (B.JBase + 1)) : 0 ≤ radiusUpper B j := (abs_nonneg _).trans (le_max_left _ _)
CausalSmith.Stat.SaPlmCumulantConverse.radiusUpper_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1979
def pilotCircleLipschitzBound

A Lipschitz constant, along a circle of radius rho, for the modulus of the empirical residual transform: eight times the radius times the first-derivative magnitude envelope of that transform. It controls the mesh error of the pilot boundary scan.

Definition (Lean source)
def pilotCircleLipschitzBound (input : RepresentedSpectralInput p) (rho : ℚ) : ℚ := 8 * rho * empiricalFDerivativeBound input rho 1
CausalSmith.Stat.SaPlmCumulantConverse.pilotCircleLipschitzBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1984
def windingLipschitzBound

A Lipschitz constant along the circle of radius rho for the logarithmic-derivative quotient integrated by the winding-number quadrature, given a positive lower bound m on the denominator: it combines the first- and second-derivative magnitude envelopes of the empirical residual transform, divided by m and by m squared respectively, with an overall factor sixty-four.

Definition (Lean source)
def windingLipschitzBound (input : RepresentedSpectralInput p) (rho m : ℚ) : ℚ := 64 * (rho * empiricalFDerivativeBound input rho 1 / m + rho ^ 2 * (empiricalFDerivativeBound input rho 2 / m + empiricalFDerivativeBound input rho 1 ^ 2 / m ^ 2))
CausalSmith.Stat.SaPlmCumulantConverse.windingLipschitzBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:1990
def momentLipschitzBound

A Lipschitz constant along the circle of radius rho for the outcome-weighted quotient integrated by the moment evaluation, given a positive lower bound m on the denominator: it combines the magnitude envelopes of the outcome-weighted transform and of the residual transform, divided by m and by m squared, with an overall factor sixty-four.

Definition (Lean source)
def momentLipschitzBound (input : RepresentedSpectralInput p) (rho m : ℚ) (N : ℕ) : ℚ := 64 * (rho * empiricalGDerivativeBound input rho 0 / m + rho ^ 2 * (empiricalGDerivativeBound input rho 1 / m + empiricalGDerivativeBound input rho 0 * empiricalFDerivativeBound input rho 1 / m ^ 2))
CausalSmith.Stat.SaPlmCumulantConverse.momentLipschitzBound · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2000
theorem pilotCircleLipschitzBound_nonneg

For a nonnegative circle radius, the pilot Lipschitz constant is never negative.

Formal statement
rho :
hrho :
0 ≤ rho
Proof (Lean source)
lemma pilotCircleLipschitzBound_nonneg (input : RepresentedSpectralInput p) {rho : ℚ} (hrho : 0 ≤ rho) : 0 ≤ pilotCircleLipschitzBound input rho := by unfold pilotCircleLipschitzBound have hF : 0 ≤ empiricalFDerivativeBound input rho 1 := by unfold empiricalFDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (pow_nonneg (residualUpper_nonneg input i) _) (by positivity) positivity
CausalSmith.Stat.SaPlmCumulantConverse.pilotCircleLipschitzBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2010
theorem windingLipschitzBound_nonneg

For a nonnegative circle radius and a strictly positive denominator lower bound, the winding-quadrature Lipschitz constant is never negative.

Formal statement
rho m :
hrho :
0 ≤ rho
hm :
0 < m
0 ≤ windingLipschitzBound input rho m
Proof (Lean source)
lemma windingLipschitzBound_nonneg (input : RepresentedSpectralInput p) {rho m : ℚ} (hrho : 0 ≤ rho) (hm : 0 < m) : 0 ≤ windingLipschitzBound input rho m := by unfold windingLipschitzBound have hF0 : 0 ≤ empiricalFDerivativeBound input rho 1 := by unfold empiricalFDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (pow_nonneg (residualUpper_nonneg input i) _) (by positivity) have hF1 : 0 ≤ empiricalFDerivativeBound input rho 2 := by unfold empiricalFDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (pow_nonneg (residualUpper_nonneg input i) _) (by positivity) positivity
CausalSmith.Stat.SaPlmCumulantConverse.windingLipschitzBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2023
theorem momentLipschitzBound_nonneg

For a nonnegative circle radius and a strictly positive denominator lower bound, the moment-evaluation Lipschitz constant is never negative.

Formal statement
rho m :
N :
hrho :
0 ≤ rho
hm :
0 < m
0 ≤ momentLipschitzBound input rho m N
Proof (Lean source)
lemma momentLipschitzBound_nonneg (input : RepresentedSpectralInput p) {rho m : ℚ} (N : ℕ) (hrho : 0 ≤ rho) (hm : 0 < m) : 0 ≤ momentLipschitzBound input rho m N := by unfold momentLipschitzBound have hF : 0 ≤ empiricalFDerivativeBound input rho 1 := by unfold empiricalFDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (pow_nonneg (residualUpper_nonneg input i) _) (by positivity) have hG0 : 0 ≤ empiricalGDerivativeBound input rho 0 := by unfold empiricalGDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (mul_nonneg (outcomeUpper_nonneg input i) (pow_nonneg (residualUpper_nonneg input i) _)) (by positivity) have hG1 : 0 ≤ empiricalGDerivativeBound input rho 1 := by unfold empiricalGDerivativeBound rationalExpEnvelope apply sum_nonneg intro i hi exact mul_nonneg (mul_nonneg (outcomeUpper_nonneg input i) (pow_nonneg (residualUpper_nonneg input i) _)) (by positivity) positivity
CausalSmith.Stat.SaPlmCumulantConverse.momentLipschitzBound_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2043
def pilotScheduleMagnitude

Full-box interval amplification for the pilot empirical denominator map. The contour Lipschitz bound is intentionally absent: it is stored separately in Schedule.magnitude and controls only the mesh error.

Definition (Lean source)
def pilotScheduleMagnitude (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : ℚ := let Q := empiricalFWidthBound input (spectralFullBoxRadius B) 0 (((128 * max 1 Q) ^ 2).num.natAbs : ℚ)
CausalSmith.Stat.SaPlmCumulantConverse.pilotScheduleMagnitude · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2073
theorem pilotScheduleMagnitude_eq

The pilot amplification factor is exactly the whole-number part of the square of one hundred twenty-eight times the (floored-at-one) interval-propagation envelope of the empirical residual transform at derivative order zero; in particular it does not depend on which bank circle is used.

Formal statement
j :
Fin (B.JBase + 1)
= ((((128 * max 1 (empiricalFWidthBound input (spectralFullBoxRadius B) 0)) ^ 2).num.natAbs : ℕ) : ℚ)
Proof (Lean source)
lemma pilotScheduleMagnitude_eq (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : pilotScheduleMagnitude input B j = ((((128 * max 1 (empiricalFWidthBound input (spectralFullBoxRadius B) 0)) ^ 2).num.natAbs : ℕ) : ℚ) := rfl
CausalSmith.Stat.SaPlmCumulantConverse.pilotScheduleMagnitude_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2081
theorem pilotScheduleMagnitude_nonneg

The pilot amplification factor is never negative.

Formal statement
j :
Fin (B.JBase + 1)
0 ≤ pilotScheduleMagnitude input B j
Proof (Lean source)
lemma pilotScheduleMagnitude_nonneg (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : 0 ≤ pilotScheduleMagnitude input B j := by dsimp [pilotScheduleMagnitude] positivity
CausalSmith.Stat.SaPlmCumulantConverse.pilotScheduleMagnitude_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2091
def windingScheduleMagnitude

Full-box magnitude and derivative amplification for the two empirical F maps used by guarded winding division.

Definition (Lean source)
def windingScheduleMagnitude (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (lower : PosRat) : ℚ := let Q0 := empiricalFWidthBound input (spectralFullBoxRadius B) 0 let Q1 := empiricalFWidthBound input (spectralFullBoxRadius B) 1 let A0 := ((128 * max 1 Q0) ^ 2).num.natAbs let A1 := ((128 * max 1 Q1) ^ 2).num.natAbs ((max A0 A1 : ℕ) : ℚ)
CausalSmith.Stat.SaPlmCumulantConverse.windingScheduleMagnitude · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2098
theorem windingScheduleMagnitude_nonneg

The winding-quadrature amplification factor is never negative.

Formal statement
j :
Fin (B.JBase + 1)
lower :
0 ≤ windingScheduleMagnitude input B j lower
Proof (Lean source)
lemma windingScheduleMagnitude_nonneg (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (lower : PosRat) : 0 ≤ windingScheduleMagnitude input B j lower := by dsimp [windingScheduleMagnitude] positivity
CausalSmith.Stat.SaPlmCumulantConverse.windingScheduleMagnitude_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2108
def evaluationScheduleMagnitude

Full-box magnitude and derivative amplification for empirical G/F in the evaluation quotient.

Definition (Lean source)
def evaluationScheduleMagnitude (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) (lower : PosRat) : ℚ := let QF := empiricalFWidthBound input (spectralFullBoxRadius B) 0 let QG := empiricalGWidthBound input (spectralFullBoxRadius B) 0 let AF := ((128 * max 1 QF) ^ 2).num.natAbs let AG := ((256 * max 1 QG) ^ 2).num.natAbs ((max AF AG : ℕ) : ℚ)
CausalSmith.Stat.SaPlmCumulantConverse.evaluationScheduleMagnitude · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2115
theorem evaluationScheduleMagnitude_nonneg

The moment-evaluation amplification factor is never negative.

Formal statement
j :
Fin (B.JBase + 1)
N :
lower :
0 ≤ evaluationScheduleMagnitude input B j N lower
Proof (Lean source)
lemma evaluationScheduleMagnitude_nonneg (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) (lower : PosRat) : 0 ≤ evaluationScheduleMagnitude input B j N lower := by dsimp [evaluationScheduleMagnitude] positivity
CausalSmith.Stat.SaPlmCumulantConverse.evaluationScheduleMagnitude_nonneg · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2126
def pilotSchedule

The complete accuracy schedule for the pilot boundary scan on fold a and bank circle j: it fixes the mesh of the circle, the refinement level of every certified node, and the input precision, from the pilot error budget rescaled by the branch-wide propagation scale and by the circle Lipschitz constant.

Definition (Lean source)
def pilotSchedule (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : Schedule := let L := pilotCircleLipschitzBound input (radiusUpper B j) let hL := pilotCircleLipschitzBound_nonneg input (radiusUpper_nonneg B j) let amplification := pilotScheduleMagnitude input B j let hAmplification := pilotScheduleMagnitude_nonneg input B j let operations := spectralNodeOperationCount .pilot (spectralFold p.n a).card let tolerance := estimatorNodePrecision (pilotNodeTolerance B) (spectralNodeScale B j amplification ⟨1, by norm_num⟩ 1 operations) spectralSchedule tolerance operations L amplification hL hAmplification
def spectralRadiusNode

Common certified-real-radius node used by pilot, winding, and evaluation.

Definition (Lean source)
def spectralRadiusNode (B : ContourBankData) (j : Fin (B.JBase + 1)) (schedule : Schedule) (k : ℕ) : ComplexRatInterval := certifiedRadiusNode (B.rhoName j) (bankRadiusPrecision schedule.tolerance (spectralNodeTarget schedule.tolerance).1) schedule k
CausalSmith.Stat.SaPlmCumulantConverse.spectralRadiusNode · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2150
def pilotModulus

Pilot boundary infimum from the same bounded denominator map.

Definition (Lean source)
def pilotModulus (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : RatInterval := let rho := radiusUpper B j let L := pilotCircleLipschitzBound input rho let hL := pilotCircleLipschitzBound_nonneg input (radiusUpper_nonneg B j) let map := spectralDenominatorMap input B (spectralFold p.n a) 0 let schedule := pilotSchedule input B a j CircleMesh.infEnclosure (fun k ↦ (map.eval (spectralRadiusNode B j schedule k) schedule.fuel).normInterval schedule.fuel) L hL schedule.mesh schedule.mesh_pos
def spectralWindingEvaluator

The certified circle evaluator used to compute the winding number on bank circle j: its numerator is the first derivative of the empirical residual transform on the lower fold, its denominator the transform itself, and its accuracy schedule is derived from the winding error budget guarded by the supplied positive lower bound on the denominator.

Definition (Lean source)
def spectralWindingEvaluator (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (lower : PosRat) : BoundedCircleEvaluator (spectralDiskBox B) := let rho := radiusUpper B j let L := windingLipschitzBound input rho lower.1 let hL := windingLipschitzBound_nonneg input (radiusUpper_nonneg B j) lower.2 let scheduleMagnitude := windingScheduleMagnitude input B j lower let hScheduleMagnitude := windingScheduleMagnitude_nonneg input B j lower let operations := spectralNodeOperationCount .winding (spectralFold p.n 0).card let tolerance := estimatorNodePrecision (guardedNodeTolerance windingNodeTolerance lower) (spectralNodeScale B j scheduleMagnitude lower 1 operations) let schedule := spectralSchedule tolerance operations L scheduleMagnitude hL hScheduleMagnitude { numerator := spectralDenominatorMap input B (spectralFold p.n 0) 1 denominator := spectralDenominatorMap input B (spectralFold p.n 0) 0 radius := B.rhoName j radiusPrecision := bankRadiusPrecision tolerance (spectralNodeTarget tolerance).1 piPrecision := schedule.inputPrecision schedule := schedule mapFuel := schedule.fuel lipschitz := L lipschitz_nonneg := hL normalizationCount := 1 }
CausalSmith.Stat.SaPlmCumulantConverse.spectralWindingEvaluator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2168
def windingEnclosure

A certified rectangular enclosure of the winding number of the empirical residual transform around bank circle j: if the pilot scan certifies a strictly positive lower bound on the transform's modulus along that circle, the argument-principle contour integral is evaluated and normalized; otherwise the degenerate rectangle at the origin is returned.

Definition (Lean source)
def windingEnclosure (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : ComplexRatInterval := let pilot := pilotModulus input B 0 j if h : 0 < pilot.lo then let ev := spectralWindingEvaluator input B j ⟨pilot.lo, h⟩ boundedContourNormalize (boundedContourEvaluate ev) 1 ev.piPrecision else ComplexRatInterval.zero
def uniqueNonnegativeInteger

Decodes a complex rectangle to a nonnegative whole number when it can only contain one: the candidate is the ceiling of the real lower endpoint, and it is returned exactly when that candidate lies inside the real range, the real upper endpoint is less than one above it, and the imaginary range straddles zero. Otherwise nothing is returned.

Definition (Lean source)
def uniqueNonnegativeInteger (I : ComplexRatInterval) : Option ℕ := let N := toNat ⌈I.re.lo⌉ if I.re.lo ≤ (N : ℚ) ∧ (N : ℚ) ≤ I.re.hi ∧ I.re.hi < N + 1 ∧ I.im.lo ≤ 0 ∧ 0 ≤ I.im.hi then some N else none
CausalSmith.Stat.SaPlmCumulantConverse.uniqueNonnegativeInteger · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2209

Soundness, completeness at the paper's strict quarter-width threshold, and uniqueness of the finite winding decoder.

Definition (Lean source)
def WindingDecoderContract (I : ComplexRatInterval) : Prop := (∀ N : ℕ, uniqueNonnegativeInteger I = some N → I.Contains (((N : ℝ) : ℂ))) ∧ (∀ N : ℕ, I.Contains (((N : ℝ) : ℂ)) → I.re.width < 1 / 4 → I.im.width < 1 / 4 → uniqueNonnegativeInteger I = some N) ∧ (∀ N M : ℕ, uniqueNonnegativeInteger I = some N → I.Contains (((M : ℝ) : ℂ)) → I.re.width < 1 → N = M)
CausalSmith.Stat.SaPlmCumulantConverse.WindingDecoderContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2219
theorem uniqueNonnegativeInteger_contract

The finite winding decoder is sound, complete, and unique: whatever it returns is genuinely contained in the rectangle; any nonnegative whole number contained in a rectangle narrower than a quarter in both coordinates is returned; and if it returns a number while the rectangle is narrower than one in the real direction, no other nonnegative whole number lies in the rectangle.

Formal statement
Proof (Lean source)
lemma uniqueNonnegativeInteger_contract (I : ComplexRatInterval) : WindingDecoderContract I := by constructor · intro N hN dsimp [uniqueNonnegativeInteger] at hN split at hN next h => have hEq : toNat ⌈I.re.lo⌉ = N := by simpa using hN rw [← hEq] unfold ComplexRatInterval.Contains RatInterval.Contains norm_num exact ⟨⟨h.1, h.2.1⟩, h.2.2.2.1, h.2.2.2.2⟩ next h => simp at hN constructor · intro N hcontains hre him unfold ComplexRatInterval.Contains RatInterval.Contains at hcontains rcases hcontains with ⟨⟨hlo, hhi⟩, himlo, himhi⟩ have hloQ : I.re.lo ≤ (N : ℚ) := by exact_mod_cast hlo have hhiQ : (N : ℚ) ≤ I.re.hi := by exact_mod_cast hhi have hceil_le : ⌈I.re.lo⌉ ≤ (N : ℤ) := (Int.ceil_le).2 hloQ have hpred_lt : (N : ℤ) - 1 < ⌈I.re.lo⌉ := by rw [Int.lt_ceil] norm_num unfold RatInterval.width at hre linarith have hceil : ⌈I.re.lo⌉ = (N : ℤ) := by omega unfold uniqueNonnegativeInteger simp only [hceil, Int.toNat_natCast] rw [if_pos] exact ⟨hloQ, hhiQ, by unfold RatInterval.width at hre linarith, by exact_mod_cast himlo, by exact_mod_cast himhi⟩ · intro N M hN hM hwidth have hNcontains := (by dsimp [uniqueNonnegativeInteger] at hN split at hN next h => have hEq : toNat ⌈I.re.lo⌉ = N := by simpa using hN rw [← hEq] unfold ComplexRatInterval.Contains RatInterval.Contains norm_num exact ⟨⟨h.1, h.2.1⟩, h.2.2.2.1, h.2.2.2.2⟩ next h => simp at hN : I.Contains (((N : ℝ) : ℂ))) unfold ComplexRatInterval.Contains RatInterval.Contains at hNcontains hM rcases hNcontains with ⟨⟨hNlo, hNhi⟩, -⟩ rcases hM with ⟨⟨hMlo, hMhi⟩, -⟩ unfold RatInterval.width at hwidth have hNhiQ : (N : ℚ) ≤ I.re.hi := by exact_mod_cast hNhi have hMloQ : I.re.lo ≤ (M : ℚ) := by exact_mod_cast hMlo have hMhiQ : (M : ℚ) ≤ I.re.hi := by exact_mod_cast hMhi have hNloQ : I.re.lo ≤ (N : ℚ) := by exact_mod_cast hNlo have hNM : N < M + 1 := by exact_mod_cast (show (N : ℚ) < M + 1 by linarith) have hMN : M < N + 1 := by exact_mod_cast (show (M : ℚ) < N + 1 by linarith) omega
CausalSmith.Stat.SaPlmCumulantConverse.uniqueNonnegativeInteger_contract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2229
theorem uniqueNonnegativeInteger_complete

If a rectangle contains a nonnegative whole number and is narrower than a quarter in the real direction and in the imaginary direction, then the finite decoder returns exactly that number.

Formal statement
N :
hcontains :
I.Contains (((N : ℝ) : ℂ))
hre :
I.re.width < 1 / 4
him :
I.im.width < 1 / 4
Proof (Lean source)
lemma uniqueNonnegativeInteger_complete (I : ComplexRatInterval) (N : ℕ) (hcontains : I.Contains (((N : ℝ) : ℂ))) (hre : I.re.width < 1 / 4) (him : I.im.width < 1 / 4) : uniqueNonnegativeInteger I = some N := (uniqueNonnegativeInteger_contract I).2.1 N hcontains hre him
CausalSmith.Stat.SaPlmCumulantConverse.uniqueNonnegativeInteger_complete · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2291

What the pilot pass records for one bank circle: the certified enclosure of the minimum modulus of the empirical residual transform along the circle, the certified enclosure of the winding number, and the decoded winding number when the enclosure pins one down.

Definition (Lean source)
modulus :
winding :
decoded :
Option
def pilotOutcome

Runs the pilot pass on bank circle j: computes the certified boundary-modulus interval from the lower fold, the certified winding enclosure, and the decoded winding number.

Definition (Lean source)
def pilotOutcome (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : PilotOutcome := let modulus := pilotModulus input B 0 j let winding := windingEnclosure input B j ⟨modulus, winding, uniqueNonnegativeInteger winding⟩
def admissible

A pilot outcome is admissible when its certified boundary modulus is at least half the bank's modulus certificate and its winding number decoded to at least one, so the circle provably encloses a zero and stays away from the boundary.

Definition (Lean source)
def PilotOutcome.admissible (B : ContourBankData) (outcome : PilotOutcome) : Bool := decide (B.aStarRat / 2 ≤ outcome.modulus.lo ∧ ∃ N, outcome.decoded = some N ∧ 1 ≤ N)
CausalSmith.Stat.SaPlmCumulantConverse.PilotOutcome.admissible · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2316
def pilotBestFrom

Tests whether bank circle j is a best admissible circle: it is admissible and its certified boundary modulus is at least as large as that of every other admissible circle.

Definition (Lean source)
def pilotBestFrom (B : ContourBankData) (outcomes : Fin (B.JBase + 1) → PilotOutcome) (j : Fin (B.JBase + 1)) : Bool := (outcomes j).admissible B && decide (∀ k, (outcomes k).admissible B = true → (outcomes k).modulus.lo ≤ (outcomes j).modulus.lo)
def selectedContourFrom

Picks the contour from a family of pilot outcomes: the smallest-indexed circle among those maximizing the certified boundary modulus over admissible circles, or nothing at all if no circle is admissible.

Definition (Lean source)
def selectedContourFrom (B : ContourBankData) (outcomes : Fin (B.JBase + 1) → PilotOutcome) : Option (Fin (B.JBase + 1)) := if ∃ j, pilotBestFrom B outcomes j = true then some (leastTrue (pilotBestFrom B outcomes)) else none
CausalSmith.Stat.SaPlmCumulantConverse.selectedContourFrom · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2332
def selectedContour

The contour actually selected for a given certified input: run the pilot pass on every bank circle, then take the least-indexed circle maximizing the certified boundary modulus among admissible ones.

Definition (Lean source)
def selectedContour (input : RepresentedSpectralInput p) (B : ContourBankData) : Option (Fin (B.JBase + 1)) := selectedContourFrom B (fun j ↦ pilotOutcome input B j)
def spectralEvaluationEvaluator

The certified circle evaluator used for the final moment integral on bank circle j: its numerator is the outcome-weighted empirical transform on the upper fold, its denominator the residual transform on that fold, its normalization count the decoded winding number (floored at one), and its accuracy schedule comes from the evaluation error budget guarded by the supplied positive lower bound on the denominator.

Definition (Lean source)
def spectralEvaluationEvaluator (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) (lower : PosRat) : BoundedCircleEvaluator (spectralDiskBox B) := let rho := radiusUpper B j let L := momentLipschitzBound input rho lower.1 N let hL := momentLipschitzBound_nonneg input N (radiusUpper_nonneg B j) lower.2 let scheduleMagnitude := evaluationScheduleMagnitude input B j N lower let hScheduleMagnitude := evaluationScheduleMagnitude_nonneg input B j N lower let operations := spectralNodeOperationCount .evaluation (spectralFold p.n 1).card let tolerance := estimatorNodePrecision (guardedNodeTolerance (evaluationNodeTolerance p) lower) (spectralNodeScale B j scheduleMagnitude lower (max N 1) operations) let schedule := spectralSchedule tolerance operations L scheduleMagnitude hL hScheduleMagnitude { numerator := spectralNumeratorMap input B (spectralFold p.n 1) 0 denominator := spectralDenominatorMap input B (spectralFold p.n 1) 0 radius := B.rhoName j radiusPrecision := bankRadiusPrecision tolerance (spectralNodeTarget tolerance).1 piPrecision := schedule.inputPrecision schedule := schedule mapFuel := schedule.fuel lipschitz := L lipschitz_nonneg := hL normalizationCount := max N 1 }
CausalSmith.Stat.SaPlmCumulantConverse.spectralEvaluationEvaluator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2349
def evaluationEnclosure

A certified rectangular enclosure of the final contour moment on bank circle j: if the upper fold's pilot scan certifies a strictly positive lower bound on the denominator's modulus, the contour integral is evaluated and divided by the decoded winding count; otherwise the degenerate rectangle at the origin is returned.

Definition (Lean source)
def evaluationEnclosure (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) : ComplexRatInterval := let pilot := pilotModulus input B 1 j if h : 0 < pilot.lo then let ev := spectralEvaluationEvaluator input B j N ⟨pilot.lo, h⟩ boundedContourNormalize (boundedContourEvaluate ev) (max N 1) ev.piPrecision else ComplexRatInterval.zero
CausalSmith.Stat.SaPlmCumulantConverse.evaluationEnclosure · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2379
def builtPilotBoundary

Build-aware pilot execution. The finite extremum is performed by the certified build over the actual denominator-node modulus intervals.

Definition (Lean source)
def builtPilotBoundary (build : complexCertifiedIntervalArithmetic) (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : RatInterval := let rho := radiusUpper B j let L := pilotCircleLipschitzBound input rho let hL := pilotCircleLipschitzBound_nonneg input (radiusUpper_nonneg B j) let map := spectralDenominatorMap input B (spectralFold p.n a) 0 let schedule := pilotSchedule input B a j build.operations.finiteInfimum (fun k ↦ (map.eval (spectralRadiusNode B j schedule k) schedule.fuel).normInterval schedule.fuel) L hL schedule.mesh schedule.mesh_pos
CausalSmith.Stat.SaPlmCumulantConverse.builtPilotBoundary · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2391
def builtWindingQuadrature

Build-aware winding execution. The build performs the trapezoidal quadrature on the evaluator's certified nodes before normalization.

Definition (Lean source)
def builtWindingQuadrature (build : complexCertifiedIntervalArithmetic) (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : ComplexRatInterval := let pilot := builtPilotBoundary build input B 0 j if h : 0 < pilot.lo then let ev := spectralWindingEvaluator input B j ⟨pilot.lo, h⟩ boundedContourNormalize (build.operations.quadrature ev.node ev.lipschitz ev.lipschitz_nonneg ev.schedule.mesh ev.schedule.mesh_pos) 1 ev.piPrecision else ComplexRatInterval.zero
CausalSmith.Stat.SaPlmCumulantConverse.builtWindingQuadrature · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2405
def builtEvaluationQuadrature

Build-aware moment execution, using the build's pilot extremum and its quadrature primitive on the evaluation nodes.

Definition (Lean source)
def builtEvaluationQuadrature (build : complexCertifiedIntervalArithmetic) (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) : ComplexRatInterval := let pilot := builtPilotBoundary build input B 1 j if h : 0 < pilot.lo then let ev := spectralEvaluationEvaluator input B j N ⟨pilot.lo, h⟩ boundedContourNormalize (build.operations.quadrature ev.node ev.lipschitz ev.lipschitz_nonneg ev.schedule.mesh ev.schedule.mesh_pos) (max N 1) ev.piPrecision else ComplexRatInterval.zero
CausalSmith.Stat.SaPlmCumulantConverse.builtEvaluationQuadrature · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2419
theorem builtPilotBoundary_eq

If the compiled interval-arithmetic build computes finite extrema by the canonical rule, then running the pilot boundary scan through the build gives exactly the reference boundary-modulus interval.

Formal statement
hcanonical :
build.operations.IsCanonical
a :
Fin 2
j :
Fin (B.JBase + 1)
builtPilotBoundary build input B a j = pilotModulus input B a j
Proof (Lean source)
lemma builtPilotBoundary_eq (build : complexCertifiedIntervalArithmetic) (hcanonical : build.operations.IsCanonical) (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : builtPilotBoundary build input B a j = pilotModulus input B a j := by simp only [builtPilotBoundary, pilotModulus, hcanonical.finiteInfimum_eq]
CausalSmith.Stat.SaPlmCumulantConverse.builtPilotBoundary_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2433
theorem builtWindingQuadrature_eq

If the compiled interval-arithmetic build computes extrema and quadrature by the canonical rules, then running the winding computation through the build gives exactly the reference winding enclosure.

Formal statement
hcanonical :
build.operations.IsCanonical
j :
Fin (B.JBase + 1)
builtWindingQuadrature build input B j = windingEnclosure input B j
Proof (Lean source)
lemma builtWindingQuadrature_eq (build : complexCertifiedIntervalArithmetic) (hcanonical : build.operations.IsCanonical) (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : builtWindingQuadrature build input B j = windingEnclosure input B j := by simp only [builtWindingQuadrature, windingEnclosure, builtPilotBoundary_eq build hcanonical, hcanonical.quadrature_eq, boundedContourEvaluate]
CausalSmith.Stat.SaPlmCumulantConverse.builtWindingQuadrature_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2444
theorem builtEvaluationQuadrature_eq

If the compiled interval-arithmetic build computes extrema and quadrature by the canonical rules, then running the moment evaluation through the build gives exactly the reference evaluation enclosure.

Formal statement
hcanonical :
build.operations.IsCanonical
j :
Fin (B.JBase + 1)
N :
builtEvaluationQuadrature build input B j N = evaluationEnclosure input B j N
Proof (Lean source)
lemma builtEvaluationQuadrature_eq (build : complexCertifiedIntervalArithmetic) (hcanonical : build.operations.IsCanonical) (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ) : builtEvaluationQuadrature build input B j N = evaluationEnclosure input B j N := by simp only [builtEvaluationQuadrature, evaluationEnclosure, builtPilotBoundary_eq build hcanonical, hcanonical.quadrature_eq, boundedContourEvaluate]
CausalSmith.Stat.SaPlmCumulantConverse.builtEvaluationQuadrature_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2456

A compiled implementation supplies only the three callable entry points of the one bounded adapter, together with their correspondence to the local finite programs. Paper-specific map validity, margins, and schedule bounds are derived locally and are deliberately not fields of this carrier.

Definition (Lean source)
pilotBoundary :
∀ {p : Parameters}
and
Fin 2
and
Fin (B.JBase + 1)
windingQuadrature :
evaluationQuadrature :
∀ {p : Parameters}
and
Fin (B.JBase + 1)
and
pilotBoundary_spec :
∀ {p : Parameters} (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)),
pilotBoundary input B a j = builtPilotBoundary build input B a j
windingQuadrature_spec :
∀ {p : Parameters} (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)),
windingQuadrature input B j = builtWindingQuadrature build input B j
evaluationQuadrature_spec :
∀ {p : Parameters} (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) (N : ℕ),
evaluationQuadrature input B j N = builtEvaluationQuadrature build input B j N
CausalSmith.Stat.SaPlmCumulantConverse.CompiledBoundedSpectralAdapter · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2468
def rationalMidpoint

The midpoint of a rational interval, the average of its two endpoints.

Definition (Lean source)
def rationalMidpoint (I : RatInterval) : ℚ := (I.lo + I.hi) / 2

The bare computational content of a certified real number as returned by the program: a family of rational enclosures indexed by a refinement level, together with a rule turning a requested accuracy into a refinement level. No soundness property is bundled in; those are stated separately.

Definition (Lean source)
approx :
ℕ → RatInterval
modulus :
PosRat → ℕ
CausalSmith.Stat.SaPlmCumulantConverse.ExecutableCertifiedRealName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2494
def Represents

An executable name represents a real number when every one of its rational enclosures, at every refinement level, contains that number.

Definition (Lean source)
def ExecutableCertifiedRealName.Represents (name : ExecutableCertifiedRealName) (x : ℝ) : Prop := ∀ fuel, (name.approx fuel).Contains x
CausalSmith.Stat.SaPlmCumulantConverse.ExecutableCertifiedRealName.Represents · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2502
def IsCertified

An executable name certifies a real number when its enclosures shrink as the refinement level increases, the enclosure returned at the level demanded by any accuracy request is at least that accurate, and every enclosure contains the number.

Definition (Lean source)
def ExecutableCertifiedRealName.IsCertified (name : ExecutableCertifiedRealName) (x : ℝ) : Prop := (∀ fuel, (name.approx (fuel + 1)).Subinterval (name.approx fuel)) ∧ (∀ e, (name.approx (name.modulus e)).width ≤ e.1) ∧ name.Represents x
CausalSmith.Stat.SaPlmCumulantConverse.ExecutableCertifiedRealName.IsCertified · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2507
def rationalAbsInterval

The image of a rational interval under absolute value: the interval itself when it lies in the nonnegative half-line, its reflection when it lies in the nonpositive half-line, and otherwise the interval from zero to the larger of the two endpoint magnitudes.

Definition (Lean source)
def rationalAbsInterval (I : RatInterval) : RatInterval := if _h : 0 ≤ I.lo then I else if h' : I.hi ≤ 0 then I.neg else ⟨0, max (-I.lo) I.hi, (le_of_lt (lt_of_not_ge h')).trans (le_max_right _ _)⟩
CausalSmith.Stat.SaPlmCumulantConverse.rationalAbsInterval · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2515
def projectedOutputApprox

The rational enclosure, at a given refinement level, of the raw output y clipped to the symmetric range determined by the certified constant: it evaluates the identity that half the difference between the absolute values of y plus the constant and y minus the constant equals y truncated to that range.

Definition (Lean source)
def projectedOutputApprox (cStar : PositiveCertifiedReal) (y : ℚ) (fuel : ℕ) : RatInterval := let yI := RatInterval.point y let cI := cStar.name.approx fuel (RatInterval.point (1 / 2)).mul ((rationalAbsInterval (yI.add cI)).sub (rationalAbsInterval (yI.sub cI)))
CausalSmith.Stat.SaPlmCumulantConverse.projectedOutputApprox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2524
def projectedOutputName

The executable certified name of the estimator's reported value: the rational raw output clipped to the symmetric range given by the certified range constant, with the accuracy modulus inherited from that constant's own certified name.

Definition (Lean source)
def projectedOutputName (cStar : PositiveCertifiedReal) (y : ℚ) : ExecutableCertifiedRealName where approx := projectedOutputApprox cStar y modulus := cStar.name.modulus
CausalSmith.Stat.SaPlmCumulantConverse.projectedOutputName · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2535
inductive SpectralFallbackDecision

The three reasons the estimator can fall back to its default output: no bank circle was admissible, the winding enclosure did not pin down a whole number, or the evaluation fold's certified boundary modulus was too small.

Definition (Lean source)
inductive SpectralFallbackDecision | noAdmissibleCircle | windingNotDecoded | lowEvaluationModulus
CausalSmith.Stat.SaPlmCumulantConverse.SpectralFallbackDecision · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2543
inductive SpectralInputComponent

The five certified quantities the evaluator can request approximations of: a treatment value, an outcome value, a clipped treatment-regression code value, a treatment residual, and a bank radius.

Definition (Lean source)
inductive SpectralInputComponent | treatment | outcome | clippedTreatment | residual | radius
CausalSmith.Stat.SaPlmCumulantConverse.SpectralInputComponent · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2549
inductive SpectralRectangleOperation

The certified rectangle operations the evaluator performs: subtraction, exponentiation, multiplication, addition, scalar rescaling, modulus and squared modulus, guarded division, finite infimum, trapezoidal quadrature, and post-quadrature normalization.

Definition (Lean source)
inductive SpectralRectangleOperation | subtraction | exponential | multiplication | addition | scaling | modulus | modulusSquare | guardedQuotient | finiteInfimum | trapezoid | normalization
CausalSmith.Stat.SaPlmCumulantConverse.SpectralRectangleOperation · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2555
inductive SpectralExecutionEvent

One recorded step of the estimator's execution. Events cover which sample fold was used, each accuracy request and each approximation read from a certified name, residual subtractions, radius refinements, unit-circle nodes, complex exponentials with their Taylor and square-root truncation levels, empirical transform node values, individual rectangle operations, guarded divisions and tangent multiplications, the finite extremum and quadrature calls, post-quadrature normalization, returned enclosures, endpoint acceptance tests, fallback decisions, and the tie-break choice of contour.

Definition (Lean source)
inductive SpectralExecutionEvent | foldUsed (fold : Fin 2) | modulusCall (component : SpectralInputComponent) (index : ℕ) (requested : PosRat) (returnedFuel : ℕ) | approximationCall (component : SpectralInputComponent) (index fuel : ℕ) | residualSubtraction (index leftFuel rightFuel outputFuel : ℕ) | radiusRefinement (circle : ℕ) (precision : PosRat) | unitCircleNode (circle mesh node fuel : ℕ) | complexExponential (fold derivative circle node fuel : ℕ) | taylorCutoff (fold derivative circle node cutoff : ℕ) | squareRootCutoff (fold derivative circle node cutoff : ℕ) | empiricalFNode (fold derivative circle node fuel : ℕ) | empiricalGNode (fold derivative circle node fuel : ℕ) | rectangleOperation (operation : SpectralRectangleOperation) (fold derivative circle node ordinal : ℕ) | guardedDivision (circle node : ℕ) (accepted : Bool) | tangentMultiplication (circle node : ℕ) | finiteExtremum (circle mesh : ℕ) | quadrature (circle mesh : ℕ) | postNormalization (circle count : ℕ) | returnedEnclosure (circle : ℕ) (value : ComplexRatInterval) | endpointComparison (accepted : Bool) | fallback (decision : SpectralFallbackDecision) | tieBreak (circle : Option ℕ)
CausalSmith.Stat.SaPlmCumulantConverse.SpectralExecutionEvent · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2562

A full execution trace: the list of recorded steps, in the order the estimator performs them.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.SpectralExecutionTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2594
def residualEnvelopeTrace

The half-error/max-fuel behavior of CertifiedReal.sub is visible in the trace rather than summarized as one residual event.

Definition (Lean source)
def residualEnvelopeTrace (input : RepresentedSpectralInput p) (i : Fin p.n) : SpectralExecutionTrace := let half : PosRat := ⟨errorOne.1 / 2, div_pos errorOne.2 (by norm_num)⟩ let leftFuel := (input.observations i).tName.modulus half let rightFuel := (input.observations i).gName.modulus half let outputFuel := max leftFuel rightFuel [.modulusCall .treatment i half leftFuel, .modulusCall .clippedTreatment i half rightFuel, .approximationCall .treatment i outputFuel, .approximationCall .clippedTreatment i outputFuel, .residualSubtraction i leftFuel rightFuel outputFuel]
CausalSmith.Stat.SaPlmCumulantConverse.residualEnvelopeTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2598
def empiricalFNodeTrace

The execution trace produced by evaluating the empirical residual transform at one contour node: for each unit in the fold it records the residual-subtraction steps, the approximation read of the residual, the complex exponential with its Taylor truncation level, the multiplication by the residual power, and the resulting node value.

Definition (Lean source)
def empiricalFNodeTrace (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (z : ComplexRatInterval) (fold derivative circle node fuel : ℕ) : SpectralExecutionTrace := I.toList.flatMap fun i ↦ residualEnvelopeTrace input i ++ let residual := (representedResidual input i).approx fuel let argument := z.mul (realRect residual) [.approximationCall .residual i fuel, .complexExponential fold derivative circle node fuel, .taylorCutoff fold derivative circle node (BoundedCertifiedComplex.centeredExpStageFuel argument fuel), .rectangleOperation .multiplication fold derivative circle node i, .empiricalFNode fold derivative circle node fuel]
CausalSmith.Stat.SaPlmCumulantConverse.empiricalFNodeTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2612
def empiricalGNodeTrace

The execution trace produced by evaluating the outcome-weighted empirical transform at one contour node: as for the residual transform, with an extra approximation read of the unit's outcome before the exponential and the multiplication.

Definition (Lean source)
def empiricalGNodeTrace (input : RepresentedSpectralInput p) (I : Finset (Fin p.n)) (z : ComplexRatInterval) (fold derivative circle node fuel : ℕ) : SpectralExecutionTrace := I.toList.flatMap fun i ↦ residualEnvelopeTrace input i ++ let residual := (representedResidual input i).approx fuel let argument := z.mul (realRect residual) [.approximationCall .outcome i fuel, .approximationCall .residual i fuel, .complexExponential fold derivative circle node fuel, .taylorCutoff fold derivative circle node (BoundedCertifiedComplex.centeredExpStageFuel argument fuel), .rectangleOperation .multiplication fold derivative circle node i, .empiricalGNode fold derivative circle node fuel]
CausalSmith.Stat.SaPlmCumulantConverse.empiricalGNodeTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2629
def evaluatorNodeTrace

Endpoint-complete node trace: range (mesh+1) is exactly k ≤ mesh. Every repeated empirical rectangle operation is emitted at its execution site.

Definition (Lean source)
def evaluatorNodeTrace {box : ComplexRatInterval} (input : RepresentedSpectralInput p) (circle : ℕ) (fold : Fin 2) (numeratorIsG : Bool) (numeratorDerivative denominatorDerivative : ℕ) (ev : BoundedCircleEvaluator box) : SpectralExecutionTrace := (List.range (ev.schedule.mesh + 1)).flatMap fun k ↦ let z := certifiedRadiusNode ev.radius ev.radiusPrecision ev.schedule k [.radiusRefinement circle ev.radiusPrecision, .unitCircleNode circle ev.schedule.mesh k ev.schedule.fuel, .taylorCutoff fold 0 circle k ev.schedule.fuel] ++ (if numeratorIsG then empiricalGNodeTrace input (spectralFold p.n fold) z fold numeratorDerivative circle k ev.mapFuel else empiricalFNodeTrace input (spectralFold p.n fold) z fold numeratorDerivative circle k ev.mapFuel) ++ empiricalFNodeTrace input (spectralFold p.n fold) z fold denominatorDerivative circle k ev.mapFuel ++ [.rectangleOperation .modulusSquare fold denominatorDerivative circle k 0, .guardedDivision circle k true, .rectangleOperation .guardedQuotient fold numeratorDerivative circle k 0, .tangentMultiplication circle k]
CausalSmith.Stat.SaPlmCumulantConverse.evaluatorNodeTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2646
def pilotContourTrace

The execution trace of the pilot boundary scan on one fold and one bank circle: the fold selection, then for every mesh node the radius refinement, the unit-circle node, the residual-transform evaluation and the modulus with its square-root truncation, and finally the finite-infimum step over all nodes.

Definition (Lean source)
def pilotContourTrace (input : RepresentedSpectralInput p) (B : ContourBankData) (a : Fin 2) (j : Fin (B.JBase + 1)) : SpectralExecutionTrace := let schedule := pilotSchedule input B a j let mapTrace := (List.range (schedule.mesh + 1)).flatMap fun k ↦ let z := spectralRadiusNode B j schedule k [.radiusRefinement j (bankRadiusPrecision schedule.tolerance (spectralNodeTarget schedule.tolerance).1), .unitCircleNode j schedule.mesh k schedule.fuel, .taylorCutoff a 0 j k schedule.fuel] ++ empiricalFNodeTrace input (spectralFold p.n a) z a 0 j k schedule.fuel ++ [.rectangleOperation .modulus a 0 j k 0, .squareRootCutoff a 0 j k schedule.fuel] [.foldUsed a] ++ mapTrace ++ [.finiteExtremum j schedule.mesh, .rectangleOperation .finiteInfimum a 0 j schedule.mesh 0]
CausalSmith.Stat.SaPlmCumulantConverse.pilotContourTrace · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2670
def windingTrace

The execution trace of the winding-number computation on one bank circle: the pilot scan on the lower fold, then — only if the certified boundary modulus is strictly positive — the evaluator's node trace, the quadrature and normalization steps, and the returned enclosure; if the modulus test fails the trace stops at the rejected endpoint comparison.

Definition (Lean source)
def windingTrace (input : RepresentedSpectralInput p) (B : ContourBankData) (j : Fin (B.JBase + 1)) : SpectralExecutionTrace := let pilot := pilotModulus input B 0 j let repeatedPilot := pilotContourTrace input B 0 j if h : 0 < pilot.lo then let ev := spectralWindingEvaluator input B j ⟨pilot.lo, h⟩ repeatedPilot ++ [.endpointComparison true, .foldUsed 0] ++ evaluatorNodeTrace input j 0 false 1 0 ev ++ [.quadrature j ev.schedule.mesh, .rectangleOperation .trapezoid 0 1 j ev.schedule.mesh 0, .postNormalization j 1, .rectangleOperation .normalization 0 1 j ev.schedule.mesh 0, .returnedEnclosure j (windingEnclosure input B j)] else repeatedPilot ++ [.endpointComparison false]
def pilotBankTrace

The execution trace of the whole pilot pass: for every circle in the bank, in index order, the lower-fold boundary scan followed by the winding computation on that circle.

Definition (Lean source)
def pilotBankTrace (input : RepresentedSpectralInput p) (B : ContourBankData) : SpectralExecutionTrace := (Finset.univ.toList : List (Fin (B.JBase + 1))).flatMap fun j ↦ pilotContourTrace input B 0 j ++ windingTrace input B j

Everything one run of the estimator returns: the certified name of the reported value, the raw rational value before clipping, the full execution trace, which bank circle was selected, which winding number was decoded, and the final moment enclosure when one was computed.

Definition (Lean source)
raw :
selected :
Option
decoded :
Option
evaluation :
CausalSmith.Stat.SaPlmCumulantConverse.SpectralProgramResult · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2716
def spectralProgramWith

The one instrumented option-A finite-rational adapter, parameterized only by the three bounded-domain entry points used at runtime.

Definition (Lean source)
def spectralProgramWith (pilotBoundary : RepresentedSpectralInput p → (B : ContourBankData) → Fin 2 → Fin (B.JBase + 1) → RatInterval) (windingQuadrature : RepresentedSpectralInput p → (B : ContourBankData) → Fin (B.JBase + 1) → ComplexRatInterval) (evaluationQuadrature : RepresentedSpectralInput p → (B : ContourBankData) → Fin (B.JBase + 1) → ℕ → ComplexRatInterval) (input : RepresentedSpectralInput p) : SpectralProgramResult := let B := contourBank p input.primitive let outcomes := fun j : Fin (B.JBase + 1) ↦ let modulus := pilotBoundary input B 0 j let winding := windingQuadrature input B j PilotOutcome.mk modulus winding (uniqueNonnegativeInteger winding) let pilotTrace := pilotBankTrace input B match selectedContourFrom B outcomes with | none => { output := projectedOutputName input.range.CthetaName 0, raw := 0 trace := pilotTrace ++ [.tieBreak none, .fallback .noAdmissibleCircle] selected := none, decoded := none, evaluation := none } | some j => match (outcomes j).decoded with | none => { output := projectedOutputName input.range.CthetaName 0, raw := 0 trace := pilotTrace ++ [.tieBreak (some j), .fallback .windingNotDecoded] selected := some j, decoded := none, evaluation := none } | some N => let modulus := pilotBoundary input B 1 j if haccept : B.aStarRat / 4 ≤ modulus.lo then let final := evaluationQuadrature input B j N let y := rationalMidpoint final.re let hmodulus : 0 < modulus.lo := lt_of_lt_of_le (div_pos B.aStarRat_pos (by norm_num)) haccept let ev := spectralEvaluationEvaluator input B j N ⟨modulus.lo, hmodulus⟩ { output := projectedOutputName input.range.CthetaName y, raw := y trace := pilotTrace ++ [.tieBreak (some j), .foldUsed 1] ++ pilotContourTrace input B 1 j ++ pilotContourTrace input B 1 j ++ evaluatorNodeTrace input j 1 true 0 0 ev ++ [.quadrature j ev.schedule.mesh, .rectangleOperation .trapezoid 1 0 j ev.schedule.mesh 0, .postNormalization j (max N 1), .rectangleOperation .normalization 1 0 j ev.schedule.mesh 0, .returnedEnclosure j final, .endpointComparison true] selected := some j, decoded := some N, evaluation := some final } else { output := projectedOutputName input.range.CthetaName 0, raw := 0 trace := pilotTrace ++ [.tieBreak (some j)] ++ pilotContourTrace input B 1 j ++ [.endpointComparison false, .fallback .lowEvaluationModulus] selected := some j, decoded := some N, evaluation := none }
CausalSmith.Stat.SaPlmCumulantConverse.spectralProgramWith · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2728
def instrumentedSpectralProgram

The one instrumented option-A finite-rational adapter used by the ordinary wrapper.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.instrumentedSpectralProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2782
def ordinarySpectralProgram

Unconditional ordinary wrapper.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.ordinarySpectralProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2787
def representedSpectralProgram

The represented wrapper calls the supplied compiled entry points of the same bounded adapter.

Definition (Lean source)
def representedSpectralProgram (compiled : CompiledBoundedSpectralAdapter) (input : RepresentedSpectralInput p) : SpectralProgramResult := spectralProgramWith compiled.pilotBoundary compiled.windingQuadrature compiled.evaluationQuadrature input
CausalSmith.Stat.SaPlmCumulantConverse.representedSpectralProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2791
theorem representedSpectralProgram_eq_instrumented

Running the estimator through any compiled implementation of the bounded adapter gives exactly the same result — value, trace, selected contour, decoded winding number and enclosure — as the reference instrumented program.

Formal statement
Proof (Lean source)
lemma representedSpectralProgram_eq_instrumented (compiled : CompiledBoundedSpectralAdapter) (input : RepresentedSpectralInput p) : representedSpectralProgram compiled input = instrumentedSpectralProgram input := by simp only [representedSpectralProgram, instrumentedSpectralProgram, spectralProgramWith, compiled.pilotBoundary_spec, compiled.windingQuadrature_spec, compiled.evaluationQuadrature_spec, builtPilotBoundary_eq compiled.build compiled.build.canonicalAlgorithms, builtWindingQuadrature_eq compiled.build compiled.build.canonicalAlgorithms, builtEvaluationQuadrature_eq compiled.build compiled.build.canonicalAlgorithms]
CausalSmith.Stat.SaPlmCumulantConverse.representedSpectralProgram_eq_instrumented · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2798
def semanticEmpiricalResidual

Semantic empirical residual used only in soundness statements for the finite rational adapter. It is not an executable evaluator path.

Definition (Lean source)
def semanticEmpiricalResidual (p : Parameters) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) : ℝ := treatment (data i) - min (max (gcode p.n (covariate (data i))) (-p.Cg)) p.Cg
CausalSmith.Stat.SaPlmCumulantConverse.semanticEmpiricalResidual · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2811
def semanticEmpiricalF

Exact value enclosed by spectralDenominatorMap; proof target only.

Definition (Lean source)
def semanticEmpiricalF (p : Parameters) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ℂ) : ℂ := ((max I.card 1 : ℝ)⁻¹ : ℂ) * ∑ i ∈ I, ((semanticEmpiricalResidual p gcode data i ^ derivative : ℝ) : ℂ) * exp (z * semanticEmpiricalResidual p gcode data i)
CausalSmith.Stat.SaPlmCumulantConverse.semanticEmpiricalF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2817
def semanticEmpiricalG

Exact value enclosed by spectralNumeratorMap; proof target only.

Definition (Lean source)
def semanticEmpiricalG (p : Parameters) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ℂ) : ℂ := ((max I.card 1 : ℝ)⁻¹ : ℂ) * ∑ i ∈ I, (((outcome (data i) * semanticEmpiricalResidual p gcode data i ^ derivative : ℝ) : ℂ) * exp (z * semanticEmpiricalResidual p gcode data i))
CausalSmith.Stat.SaPlmCumulantConverse.semanticEmpiricalG · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2825
theorem canonicalRepresentedInput_residual_value

For canonically named data, the real number named by the certified residual of a unit is exactly that unit's treatment minus its clipped treatment-regression code value.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
i :
Fin p.n
(representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).value
= semanticEmpiricalResidual p gcode data i
Proof (Lean source)
lemma canonicalRepresentedInput_residual_value (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (i : Fin p.n) : (representedResidual (canonicalRepresentedInput p pStar cStar gcode data) i).value = semanticEmpiricalResidual p gcode data i := by rfl
CausalSmith.Stat.SaPlmCumulantConverse.canonicalRepresentedInput_residual_value · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2833
theorem spectralDenominatorMap_value_canonical

For canonically named data, the exact value enclosed by the certified residual-transform map coincides with the semantic empirical transform: the fold average of the residual raised to the derivative order times the exponential of the argument against that residual.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
I :
Finset (Fin p.n)
derivative :
z :
(spectralDenominatorMap (canonicalRepresentedInput p pStar cStar gcode data) B I derivative).value z
= semanticEmpiricalF p gcode data I derivative z
Proof (Lean source)
lemma spectralDenominatorMap_value_canonical (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ℂ) : (spectralDenominatorMap (canonicalRepresentedInput p pStar cStar gcode data) B I derivative).value z = semanticEmpiricalF p gcode data I derivative z := by simp only [spectralDenominatorMap, semanticEmpiricalF, canonicalRepresentedInput_residual_value]
CausalSmith.Stat.SaPlmCumulantConverse.spectralDenominatorMap_value_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2843
theorem spectralNumeratorMap_value_canonical

For canonically named data, the exact value enclosed by the certified outcome-weighted map coincides with the semantic outcome-weighted empirical transform.

Formal statement
gcode :
ℕ → Xspace → ℝ
data :
Fin p.n → Obs Xspace
I :
Finset (Fin p.n)
derivative :
z :
(spectralNumeratorMap (canonicalRepresentedInput p pStar cStar gcode data) B I derivative).value z
= semanticEmpiricalG p gcode data I derivative z
Proof (Lean source)
lemma spectralNumeratorMap_value_canonical (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) (B : ContourBankData) (I : Finset (Fin p.n)) (derivative : ℕ) (z : ℂ) : (spectralNumeratorMap (canonicalRepresentedInput p pStar cStar gcode data) B I derivative).value z = semanticEmpiricalG p gcode data I derivative z := by unfold spectralNumeratorMap semanticEmpiricalG apply congrArg ((↑(max I.card 1 : ℝ) : ℂ)⁻¹ * ·) apply Finset.sum_congr rfl intro i hi rw [canonicalRepresentedInput_residual_value] rfl
CausalSmith.Stat.SaPlmCumulantConverse.spectralNumeratorMap_value_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2856
def ordinaryFiniteRationalResult

The estimator's full result on a data set: build the canonical certified input from the data and the fixed primitive and range records, then run the ordinary finite-rational program on it.

Definition (Lean source)
noncomputable def ordinaryFiniteRationalResult (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) : SpectralProgramResult := ordinarySpectralProgram (canonicalRepresentedInput p pStar cStar gcode data)
CausalSmith.Stat.SaPlmCumulantConverse.ordinaryFiniteRationalResult · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2871
def ordinaryThetaHatValue

The real-valued point estimate reported by the estimator: the raw rational output of the program, truncated to the symmetric range determined by the certified range constant.

Definition (Lean source)
noncomputable def ordinaryThetaHatValue (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (data : Fin p.n → Obs Xspace) : ℝ := let y : ℝ := (ordinaryFiniteRationalResult p pStar cStar gcode data).raw min (max y (-cStar.CthetaName.name.value)) cStar.CthetaName.name.value
CausalSmith.Stat.SaPlmCumulantConverse.ordinaryThetaHatValue · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2880
theorem ordinaryThetaHatValue_congr_current

Take a treatment-regression code sequence and a second one. If they agree at every covariate value after clipping to the range from minus Cg to Cg, then they yield the same point estimate on every data set.

Formal statement
gcode hcode :
ℕ → Xspace → ℝ
hclip :
∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg
ordinaryThetaHatValue p pStar cStar gcode = ordinaryThetaHatValue p pStar cStar hcode
Proof (Lean source)
lemma ordinaryThetaHatValue_congr_current (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode hcode : ℕ → Xspace → ℝ) (hclip : ∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg) : ordinaryThetaHatValue p pStar cStar gcode = ordinaryThetaHatValue p pStar cStar hcode := by funext data unfold ordinaryThetaHatValue ordinaryFiniteRationalResult ordinarySpectralProgram rw [canonicalRepresentedInput_congr_current p pStar cStar gcode hcode data hclip]
CausalSmith.Stat.SaPlmCumulantConverse.ordinaryThetaHatValue_congr_current · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2888

Supplied certified observation records for the represented transducer. The type indices fix the experiment-wide primitive records; callers supply only the observation records.

Definition (Lean source)
observations :
CausalSmith.Stat.SaPlmCumulantConverse.SuppliedRepresentedSpectralInput · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2903
def withFixedRecords

Completes a caller-supplied family of certified observation records into a full certified input by attaching the experiment-wide primitive and range records.

Definition (Lean source)
def SuppliedRepresentedSpectralInput.withFixedRecords (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (input : SuppliedRepresentedSpectralInput p pStar cStar) : RepresentedSpectralInput p where observations := input.observations primitive := pStar range := cStar
CausalSmith.Stat.SaPlmCumulantConverse.SuppliedRepresentedSpectralInput.withFixedRecords · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2910

The estimator packaged as one object: the domain condition it requires of the supplied regression code, the program it runs on a data set, the real point estimate it reports, the execution trace it emits, the version of the program driven by a compiled implementation, and the correspondence property tying that version to the reference one.

Definition (Lean source)
Xspace :
Type*
publicDomain :
Prop
ordinaryProgram :
(Fin p.n → Obs Xspace) → SpectralProgramResult
ordinaryValue :
(Fin p.n → Obs Xspace) → ℝ
fullTrace :
(Fin p.n → Obs Xspace) → SpectralExecutionTrace
representedOutputCorrespondence :
CausalSmith.Stat.SaPlmCumulantConverse.AdaptiveContourEstimator · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2920
instance instCoeFunAdaptiveContourEstimatorForallForallFinNObsReal

Lets a packaged estimator be applied directly to a data set, returning its real point estimate.

Definition (Lean source)
instance (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) : CoeFun (AdaptiveContourEstimator Xspace p pStar cStar) (fun _ ↦ (Fin p.n → Obs Xspace) → ℝ) := ⟨AdaptiveContourEstimator.ordinaryValue⟩
CausalSmith.Stat.SaPlmCumulantConverse.instCoeFunAdaptiveContourEstimatorForallForallFinNObsReal · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2934

The correctness contract demanded of a compiled implementation: on every data set it returns the same result and the same execution trace as the reference program, and the certified name it outputs genuinely certifies the estimator's real point estimate.

Definition (Lean source)
def representedExecutionContract (compiled : CompiledBoundedSpectralAdapter) (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) : Prop := ∀ data : Fin p.n → Obs Xspace, let input := canonicalRepresentedInput p pStar cStar gcode data let represented := representedSpectralProgram compiled input let ordinary := ordinaryFiniteRationalResult p pStar cStar gcode data represented = ordinary ∧ represented.trace = ordinary.trace ∧ represented.output.IsCertified (ordinaryThetaHatValue p pStar cStar gcode data)
CausalSmith.Stat.SaPlmCumulantConverse.representedExecutionContract · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2941
def thetaHatSpec

The estimator itself, assembled for a given parameter block, fixed certified records, and supplied treatment-regression code sequence: it requires the code at the current sample size to be measurable, runs the canonical finite-rational program, reports the clipped point estimate, exposes the full execution trace, and demands of any compiled implementation the represented-execution contract.

Definition (Lean source)
noncomputable def thetaHatSpec (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) : AdaptiveContourEstimator Xspace p pStar cStar := { publicDomain := Measurable (gcode p.n) ordinaryProgram := ordinaryFiniteRationalResult p pStar cStar gcode ordinaryValue := ordinaryThetaHatValue p pStar cStar gcode fullTrace := fun data ↦ (ordinaryFiniteRationalResult p pStar cStar gcode data).trace representedProgram := fun compiled input ↦ representedSpectralProgram compiled (SuppliedRepresentedSpectralInput.withFixedRecords pStar cStar input) representedOutputCorrespondence := fun compiled ↦ representedExecutionContract compiled p pStar cStar gcode }
theorem thetaHatSpec_congr_current

Take a treatment-regression code sequence and a second one. If they agree at every covariate value after clipping to the range from minus Cg to Cg, then the two assembled estimators are the same function of the data.

Formal statement
gcode hcode :
ℕ → Xspace → ℝ
hclip :
∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg
(thetaHatSpec p pStar cStar gcode : (Fin p.n → Obs Xspace) → ℝ)
= thetaHatSpec p pStar cStar hcode
Proof (Lean source)
lemma thetaHatSpec_congr_current (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode hcode : ℕ → Xspace → ℝ) (hclip : ∀ x, min (max (gcode p.n x) (-p.Cg)) p.Cg = min (max (hcode p.n x) (-p.Cg)) p.Cg) : (thetaHatSpec p pStar cStar gcode : (Fin p.n → Obs Xspace) → ℝ) = thetaHatSpec p pStar cStar hcode := ordinaryThetaHatValue_congr_current p pStar cStar gcode hcode hclip
CausalSmith.Stat.SaPlmCumulantConverse.thetaHatSpec_congr_current · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2974

A compiled implementation is a faithful execution of the estimator when it satisfies the estimator's own represented-output correspondence requirement.

Definition (Lean source)
def RepresentedExecution (compiled : CompiledBoundedSpectralAdapter) (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) : Prop := (thetaHatSpec p pStar cStar gcode).representedOutputCorrespondence compiled
CausalSmith.Stat.SaPlmCumulantConverse.RepresentedExecution · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralEstimator.lean:2987
Helpers.SpectralMeasurability 13 declarations Measurability of the finite rational spectral program

Measurability of the finite rational spectral program

theorem mcanon

A fixed-precision canonical dyadic interval is a Borel function of its real input.

Formal statement
precision :
Measurable (fun x : ℝ ↦ canonicalDyadicInterval x precision)
Proof (Lean source)
lemma mcanon (precision : ℕ) : Measurable (fun x : ℝ ↦ canonicalDyadicInterval x precision) := by let floorMap : ℝ → ℤ := fun x ↦ ⌊(2 : ℝ) ^ (precision + 1) * x⌋ have hfloor : Measurable floorMap := by dsimp [floorMap] exact (measurable_const.mul measurable_id).floor let assemble : ℤ → RatInterval := fun z ↦ let scale : ℚ := (2 : ℚ) ^ (precision + 1) let lower : ℚ := z / scale ⟨lower, lower + 1 / scale, le_add_of_nonneg_right (by positivity)⟩ have hassemble : Measurable assemble := measurable_of_countable assemble exact hassemble.comp hfloor
theorem mcanon_joint

Canonical dyadic approximation is jointly measurable in the real input and precision.

Formal statement
Measurable (fun xn : ℝ × ℕ ↦ canonicalDyadicInterval xn.1 xn.2)
Proof (Lean source)
lemma mcanon_joint : Measurable (fun xn : ℝ × ℕ ↦ canonicalDyadicInterval xn.1 xn.2) := by apply measurable_from_prod_countable_left intro precision simpa using mcanon precision
theorem mcanon_dyn

Canonical dyadic approximation remains measurable at a measurable data-dependent precision.

Formal statement
Ω :
x :
Ω → ℝ
fuel :
Ω → ℕ
hx :
hf :
Measurable (fun ω ↦ canonicalDyadicInterval (x ω) (fuel ω))
Proof (Lean source)
lemma mcanon_dyn {Ω : Type*} [MeasurableSpace Ω] (x : Ω → ℝ) (fuel : Ω → ℕ) (hx : Measurable x) (hf : Measurable fuel) : Measurable (fun ω ↦ canonicalDyadicInterval (x ω) (fuel ω)) := by exact mcanon_joint.comp (hx.prodMk hf)
theorem measurable_treatmentApprox

The treatment-name interval queried at measurable fuel is measurable in the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
i :
Fin p.n
fuel :
(Fin p.n → Obs Xspace) → ℕ
hf :
Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).tName.approx (fuel data))
Proof (Lean source)
lemma measurable_treatmentApprox (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (i : Fin p.n) (fuel : (Fin p.n → Obs Xspace) → ℕ) (hf : Measurable fuel) : Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).tName.approx (fuel data)) := by change Measurable (fun data ↦ canonicalDyadicInterval (treatment (data i)) (fuel data)) apply mcanon_dyn _ _ _ hf exact (measurable_pi_apply i).snd.fst
CausalSmith.Stat.SaPlmCumulantConverse.measurable_treatmentApprox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:50
theorem measurable_outcomeApprox

The outcome-name interval queried at measurable fuel is measurable in the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
i :
Fin p.n
fuel :
(Fin p.n → Obs Xspace) → ℕ
hf :
Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx (fuel data))
Proof (Lean source)
lemma measurable_outcomeApprox (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (i : Fin p.n) (fuel : (Fin p.n → Obs Xspace) → ℕ) (hf : Measurable fuel) : Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).yName.approx (fuel data)) := by change Measurable (fun data ↦ canonicalDyadicInterval (outcome (data i)) (fuel data)) apply mcanon_dyn _ _ _ hf exact (measurable_pi_apply i).snd.snd
CausalSmith.Stat.SaPlmCumulantConverse.measurable_outcomeApprox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:61
theorem measurable_codeApprox

The clipped code-name interval queried at measurable fuel is measurable in the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
i :
Fin p.n
fuel :
(Fin p.n → Obs Xspace) → ℕ
hf :
Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).gName.approx (fuel data))
Proof (Lean source)
lemma measurable_codeApprox (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) (i : Fin p.n) (fuel : (Fin p.n → Obs Xspace) → ℕ) (hf : Measurable fuel) : Measurable (fun data ↦ ((canonicalRepresentedInput p pStar cStar gcode data).observations i).gName.approx (fuel data)) := by change Measurable (fun data ↦ canonicalDyadicInterval (min (max (gcode p.n (covariate (data i))) (-p.Cg)) p.Cg) (fuel data)) apply mcanon_dyn _ _ _ hf exact (((hgcode.comp ((measurable_pi_apply i).fst)).max measurable_const).min measurable_const)
CausalSmith.Stat.SaPlmCumulantConverse.measurable_codeApprox · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:72
theorem measurable_pilotModulus_canonical

Provided the treatment-regression code used at the current sample size is a measurable function of the covariates, the pilot enclosure of the smallest modulus the empirical denominator transform attains along a given bank circle, computed on either fold from the certified input built canonically from the data, is a measurable function of the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
a :
Fin 2
j :
Fin ((contourBank p pStar).JBase + 1)
Measurable (fun data : Fin p.n → Obs Xspace ↦ pilotModulus (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) a j)
Proof (Lean source)
lemma measurable_pilotModulus_canonical (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) (a : Fin 2) (j : Fin ((contourBank p pStar).JBase + 1)) : Measurable (fun data : Fin p.n → Obs Xspace ↦ pilotModulus (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) a j) := by let B := contourBank p pStar let input := fun data : Fin p.n → Obs Xspace ↦ canonicalRepresentedInput p pStar cStar gcode data let key := fun data ↦ (pilotCircleLipschitzBound (input data) (radiusUpper B j), pilotScheduleMagnitude (input data) B j) have hkey : Measurable key := by exact (measurable_pilotCircleLipschitzBound_canonical p pStar cStar gcode hgcode _).prodMk (measurable_pilotScheduleMagnitude_canonical p pStar cStar gcode hgcode j) rw [show (fun data ↦ pilotModulus (input data) B a j) = (fun data ↦ pilotModulusAtL (input data) B a j (key data).1 (key data).2) by funext data exact pilotModulus_eq_atL (input data) B a j] let joint := fun state : (Fin p.n → Obs Xspace) × (ℚ × ℚ) ↦ pilotModulusAtL (input state.1) B a j state.2.1 state.2.2 apply (show Measurable joint from ?_).comp (measurable_id.prodMk hkey) apply measurable_from_prod_countable_left intro fixedKey let L := fixedKey.1 let scheduleMagnitude := fixedKey.2 dsimp [joint] unfold pilotModulusAtL split · split · let operations := spectralNodeOperationCount .pilot (spectralFold p.n a).card let tolerance := estimatorNodePrecision (pilotNodeTolerance B) (spectralNodeScale B j scheduleMagnitude pilotUnitMargin 1 operations) let schedule := spectralSchedule tolerance operations L scheduleMagnitude ‹0 ≤ L› ‹0 ≤ scheduleMagnitude› let intervals := fun data : Fin p.n → Obs Xspace ↦ fun fuel : Fin (schedule.fuel + 1) ↦ fun i : Fin p.n ↦ (((input data).observations i).tName.approx fuel, ((input data).observations i).gName.approx fuel) have hintervals : Measurable intervals := by apply measurable_pi_lambda intro fuel apply measurable_pi_lambda intro i exact (measurable_treatmentApprox p pStar cStar gcode i (fun _ ↦ (fuel : ℕ)) measurable_const).prodMk (measurable_codeApprox p pStar cStar gcode hgcode i (fun _ ↦ (fuel : ℕ)) measurable_const) let finish := fun samples : Fin (schedule.fuel + 1) → Fin p.n → RatInterval × RatInterval ↦ CircleMesh.infEnclosure (fun k : ℕ ↦ let z := spectralRadiusNode B j schedule k (denominatorEvalFromHistory (spectralFold p.n a) 0 z schedule.fuel samples).normInterval schedule.fuel) L ‹0 ≤ L› schedule.mesh schedule.mesh_pos have hfinish : Measurable finish := measurable_of_countable finish have hcomposed := hfinish.comp hintervals convert hcomposed using 1 funext data dsimp only [Function.comp_apply, finish, intervals] congr 1 funext k rw [denominatorEvalFromHistory_of_input] rfl · exact measurable_const · exact measurable_const
CausalSmith.Stat.SaPlmCumulantConverse.measurable_pilotModulus_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:283
theorem measurable_windingEnclosure_canonical

Provided the treatment-regression code used at the current sample size is a measurable function of the covariates, the certified rectangular enclosure of the winding number of the empirical residual transform around a given bank circle, computed from the certified input built canonically from the data, is a measurable function of the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
j :
Fin ((contourBank p pStar).JBase + 1)
Measurable (fun data : Fin p.n → Obs Xspace ↦ windingEnclosure (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j)
Proof (Lean source)
lemma measurable_windingEnclosure_canonical (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) (j : Fin ((contourBank p pStar).JBase + 1)) : Measurable (fun data : Fin p.n → Obs Xspace ↦ windingEnclosure (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j) := by let B := contourBank p pStar let input := fun data : Fin p.n → Obs Xspace ↦ canonicalRepresentedInput p pStar cStar gcode data let pilot := fun data ↦ pilotModulus (input data) B 0 j have hpilot : Measurable pilot := measurable_pilotModulus_canonical p pStar cStar gcode hgcode 0 j rw [show (fun data ↦ windingEnclosure (input data) B j) = (fun data ↦ windingEnclosureAt (input data) B j (pilot data) (windingLipschitzBound (input data) (radiusUpper B j) (pilot data).lo) (windingScheduleMagnitudeAt (input data) B j (pilot data).lo)) by funext data exact windingEnclosure_eq_at (input data) B j] let pilotJoint := fun state : (Fin p.n → Obs Xspace) × RatInterval ↦ windingEnclosureAt (input state.1) B j state.2 (windingLipschitzBound (input state.1) (radiusUpper B j) state.2.lo) (windingScheduleMagnitudeAt (input state.1) B j state.2.lo) apply (show Measurable pilotJoint from ?_).comp (measurable_id.prodMk hpilot) apply measurable_from_prod_countable_left intro fixedPilot let lipschitz := fun data ↦ windingLipschitzBound (input data) (radiusUpper B j) fixedPilot.lo have hlipschitz : Measurable lipschitz := by have hresiduals : Measurable (fun data : Fin p.n → Obs Xspace ↦ fun i ↦ residualUpper (input data) i) := by exact measurable_pi_lambda _ fun i ↦ measurable_residualUpper_canonical p pStar cStar gcode hgcode i let finish : (Fin p.n → ℚ) → ℚ := fun residuals ↦ 64 * (radiusUpper B j * (∑ i, residuals i ^ 1 * rationalExpEnvelope (radiusUpper B j) (residuals i)) / fixedPilot.lo + radiusUpper B j ^ 2 * ((∑ i, residuals i ^ 2 * rationalExpEnvelope (radiusUpper B j) (residuals i)) / fixedPilot.lo + (∑ i, residuals i ^ 1 * rationalExpEnvelope (radiusUpper B j) (residuals i)) ^ 2 / fixedPilot.lo ^ 2)) exact (measurable_of_countable finish).comp hresiduals let magnitude := fun data ↦ windingScheduleMagnitudeAt (input data) B j fixedPilot.lo have hmagnitude : Measurable magnitude := by have hQ0 := measurable_empiricalFWidthBound_canonical p pStar cStar gcode hgcode (spectralFullBoxRadius B) 0 have hQ1 := measurable_empiricalFWidthBound_canonical p pStar cStar gcode hgcode (spectralFullBoxRadius B) 1 let finish : ℚ × ℚ → ℚ := fun q ↦ ((max ((128 * max 1 q.1) ^ 2).num.natAbs ((128 * max 1 q.2) ^ 2).num.natAbs : ℕ) : ℚ) simpa [magnitude, windingScheduleMagnitudeAt, finish, Function.comp_def] using (measurable_of_countable finish).comp (hQ0.prodMk hQ1) let scheduleKey := fun data ↦ (lipschitz data, magnitude data) have hscheduleKey : Measurable scheduleKey := hlipschitz.prodMk hmagnitude let lipschitzJoint := fun state : (Fin p.n → Obs Xspace) × (ℚ × ℚ) ↦ windingEnclosureAt (input state.1) B j fixedPilot state.2.1 state.2.2 apply (show Measurable lipschitzJoint from ?_).comp (measurable_id.prodMk hscheduleKey) apply measurable_from_prod_countable_left intro fixedKey let fixedL := fixedKey.1 let fixedMagnitude := fixedKey.2 dsimp [lipschitzJoint] unfold windingEnclosureAt split · split · split · let tolerance := estimatorNodePrecision (guardedNodeTolerance windingNodeTolerance ⟨fixedPilot.lo, ‹0 < fixedPilot.lo›⟩) (spectralNodeScale B j fixedMagnitude ⟨fixedPilot.lo, ‹0 < fixedPilot.lo›⟩ 1 (spectralNodeOperationCount .winding (spectralFold p.n 0).card)) let schedule := spectralSchedule tolerance (spectralNodeOperationCount .winding (spectralFold p.n 0).card) fixedL fixedMagnitude ‹0 ≤ fixedL› ‹0 ≤ fixedMagnitude› let samples := fun data : Fin p.n → Obs Xspace ↦ fun fuel : Fin (schedule.fuel + 1) ↦ fun i : Fin p.n ↦ (((input data).observations i).tName.approx fuel, ((input data).observations i).gName.approx fuel) have hsamples : Measurable samples := by apply measurable_pi_lambda intro fuel apply measurable_pi_lambda intro i exact (measurable_treatmentApprox p pStar cStar gcode i (fun _ ↦ (fuel : ℕ)) measurable_const).prodMk (measurable_codeApprox p pStar cStar gcode hgcode i (fun _ ↦ (fuel : ℕ)) measurable_const) exact (measurable_of_countable (windingFinish B j schedule fixedL ‹0 ≤ fixedL›)).comp hsamples · exact measurable_const · exact measurable_const · exact measurable_const
CausalSmith.Stat.SaPlmCumulantConverse.measurable_windingEnclosure_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:429
theorem measurable_evaluationEnclosure_canonical

Provided the treatment-regression code used at the current sample size is a measurable function of the covariates, the certified rectangular enclosure of the contour moment on a given bank circle at a given quadrature order, computed from the certified input built canonically from the data, is a measurable function of the sample.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
j :
Fin ((contourBank p pStar).JBase + 1)
N :
Measurable (fun data : Fin p.n → Obs Xspace ↦ evaluationEnclosure (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j N)
Proof (Lean source)
lemma measurable_evaluationEnclosure_canonical (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) (j : Fin ((contourBank p pStar).JBase + 1)) (N : ℕ) : Measurable (fun data : Fin p.n → Obs Xspace ↦ evaluationEnclosure (canonicalRepresentedInput p pStar cStar gcode data) (contourBank p pStar) j N) := by let B := contourBank p pStar let input := fun data : Fin p.n → Obs Xspace ↦ canonicalRepresentedInput p pStar cStar gcode data let pilot := fun data ↦ pilotModulus (input data) B 1 j have hpilot : Measurable pilot := measurable_pilotModulus_canonical p pStar cStar gcode hgcode 1 j rw [show (fun data ↦ evaluationEnclosure (input data) B j N) = (fun data ↦ evaluationEnclosureAt (input data) B j N (pilot data) (momentLipschitzBound (input data) (radiusUpper B j) (pilot data).lo N) (evaluationScheduleMagnitudeAt (input data) B j N (pilot data).lo)) by funext data exact evaluationEnclosure_eq_at (input data) B j N] let pilotJoint := fun state : (Fin p.n → Obs Xspace) × RatInterval ↦ evaluationEnclosureAt (input state.1) B j N state.2 (momentLipschitzBound (input state.1) (radiusUpper B j) state.2.lo N) (evaluationScheduleMagnitudeAt (input state.1) B j N state.2.lo) apply (show Measurable pilotJoint from ?_).comp (measurable_id.prodMk hpilot) apply measurable_from_prod_countable_left intro fixedPilot let lipschitz := fun data ↦ momentLipschitzBound (input data) (radiusUpper B j) fixedPilot.lo N have hlipschitz : Measurable lipschitz := by have hG0 := measurable_empiricalGDerivativeBound_canonical p pStar cStar gcode hgcode (radiusUpper B j) 0 have hG1 := measurable_empiricalGDerivativeBound_canonical p pStar cStar gcode hgcode (radiusUpper B j) 1 have hF1 := measurable_empiricalFDerivativeBound_canonical p pStar cStar gcode hgcode (radiusUpper B j) 1 dsimp [lipschitz, input, B] unfold momentLipschitzBound fun_prop let magnitude := fun data ↦ evaluationScheduleMagnitudeAt (input data) B j N fixedPilot.lo have hmagnitude : Measurable magnitude := by have hQG := measurable_empiricalGWidthBound_canonical p pStar cStar gcode hgcode (spectralFullBoxRadius B) 0 have hQF := measurable_empiricalFWidthBound_canonical p pStar cStar gcode hgcode (spectralFullBoxRadius B) 0 let finish : ℚ × ℚ → ℚ := fun q ↦ ((max ((128 * max 1 q.1) ^ 2).num.natAbs ((256 * max 1 q.2) ^ 2).num.natAbs : ℕ) : ℚ) simpa [magnitude, evaluationScheduleMagnitudeAt, finish, Function.comp_def] using (measurable_of_countable finish).comp (hQF.prodMk hQG) let scheduleKey := fun data ↦ (lipschitz data, magnitude data) have hscheduleKey : Measurable scheduleKey := hlipschitz.prodMk hmagnitude let lipschitzJoint := fun state : (Fin p.n → Obs Xspace) × (ℚ × ℚ) ↦ evaluationEnclosureAt (input state.1) B j N fixedPilot state.2.1 state.2.2 apply (show Measurable lipschitzJoint from ?_).comp (measurable_id.prodMk hscheduleKey) apply measurable_from_prod_countable_left intro fixedKey let fixedL := fixedKey.1 let fixedMagnitude := fixedKey.2 dsimp [lipschitzJoint] unfold evaluationEnclosureAt split · split · split · let tolerance := estimatorNodePrecision (guardedNodeTolerance (evaluationNodeTolerance p) ⟨fixedPilot.lo, ‹0 < fixedPilot.lo›⟩) (spectralNodeScale B j fixedMagnitude ⟨fixedPilot.lo, ‹0 < fixedPilot.lo›⟩ (max N 1) (spectralNodeOperationCount .evaluation (spectralFold p.n 1).card)) let schedule := spectralSchedule tolerance (spectralNodeOperationCount .evaluation (spectralFold p.n 1).card) fixedL fixedMagnitude ‹0 ≤ fixedL› ‹0 ≤ fixedMagnitude› let samples := fun data : Fin p.n → Obs Xspace ↦ fun fuel : Fin (schedule.fuel + 1) ↦ fun i : Fin p.n ↦ ((((input data).observations i).tName.approx fuel, ((input data).observations i).gName.approx fuel), ((input data).observations i).yName.approx fuel) have hsamples : Measurable samples := by apply measurable_pi_lambda intro fuel apply measurable_pi_lambda intro i exact ((measurable_treatmentApprox p pStar cStar gcode i (fun _ ↦ (fuel : ℕ)) measurable_const).prodMk (measurable_codeApprox p pStar cStar gcode hgcode i (fun _ ↦ (fuel : ℕ)) measurable_const)).prodMk (measurable_outcomeApprox p pStar cStar gcode i (fun _ ↦ (fuel : ℕ)) measurable_const) exact (measurable_of_countable (evaluationFinish B j N schedule fixedL ‹0 ≤ fixedL›)).comp hsamples · exact measurable_const · exact measurable_const · exact measurable_const
CausalSmith.Stat.SaPlmCumulantConverse.measurable_evaluationEnclosure_canonical · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:704
def ordinarySpectralRaw

The raw rational projection of the option-A program, separated from its certified output name and diagnostic trace.

Definition (Lean source)
def ordinarySpectralRaw (input : RepresentedSpectralInput p) : ℚ := let B := contourBank p input.primitive let outcomes := fun j : Fin (B.JBase + 1) ↦ let modulus := pilotModulus input B 0 j let winding := windingEnclosure input B j PilotOutcome.mk modulus winding (uniqueNonnegativeInteger winding) match selectedContourFrom B outcomes with | none => 0 | some j => match (outcomes j).decoded with | none => 0 | some N => let modulus := pilotModulus input B 1 j if B.aStarRat / 4 ≤ modulus.lo then rationalMidpoint (evaluationEnclosure input B j N).re else 0
CausalSmith.Stat.SaPlmCumulantConverse.ordinarySpectralRaw · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:803
theorem instrumentedSpectralProgram_raw_eq

Erasing the certified name and trace from the option-A program preserves its raw rational result.

Formal statement
Proof (Lean source)
lemma instrumentedSpectralProgram_raw_eq (input : RepresentedSpectralInput p) : (instrumentedSpectralProgram input).raw = ordinarySpectralRaw input := by unfold instrumentedSpectralProgram spectralProgramWith ordinarySpectralRaw dsimp only generalize hselection : selectedContourFrom _ _ = selection cases selection with | none => simp only [hselection] | some j => simp only [hselection] generalize hdecoded : uniqueNonnegativeInteger _ = decoded cases decoded with | none => simp only [hdecoded] | some N => simp only [hdecoded] split <;> rfl
CausalSmith.Stat.SaPlmCumulantConverse.instrumentedSpectralProgram_raw_eq · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:822
theorem measurable_countable_dispatch

A measurable countable-valued control state may select among measurable branches.

Formal statement
key :
Ω → κ
hkey :
branch :
κ → Ω → β
hbranch :
∀ k, Measurable (branch k)
Measurable (fun ω ↦ branch (key ω) ω)
Proof (Lean source)
lemma measurable_countable_dispatch {Ω κ β : Type*} [MeasurableSpace Ω] [MeasurableSpace κ] [Countable κ] [MeasurableSingletonClass κ] [MeasurableSpace β] (key : Ω → κ) (hkey : Measurable key) (branch : κ → Ω → β) (hbranch : ∀ k, Measurable (branch k)) : Measurable (fun ω ↦ branch (key ω) ω) := by let joint : Ω × κ → β := fun state ↦ branch state.2 state.1 have hjoint : Measurable joint := by apply measurable_from_prod_countable_left exact hbranch exact hjoint.comp (measurable_id.prodMk hkey)
CausalSmith.Stat.SaPlmCumulantConverse.measurable_countable_dispatch · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:840
theorem ordinaryFiniteRationalResult_raw_measurable

The rational output of the canonical option-A program is Borel measurable.

Formal statement
gcode :
ℕ → Xspace → ℝ
hgcode :
Measurable (gcode p.n)
Measurable (fun data : Fin p.n → Obs Xspace ↦ ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ))
Proof (Lean source)
lemma ordinaryFiniteRationalResult_raw_measurable (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) (hgcode : Measurable (gcode p.n)) : Measurable (fun data : Fin p.n → Obs Xspace ↦ ((ordinaryFiniteRationalResult p pStar cStar gcode data).raw : ℝ)) := by apply (show Measurable (fun q : ℚ ↦ (q : ℝ)) from measurable_of_countable _).comp simp only [ordinaryFiniteRationalResult, ordinarySpectralProgram, instrumentedSpectralProgram_raw_eq] let B := contourBank p pStar let input := fun data : Fin p.n → Obs Xspace ↦ canonicalRepresentedInput p pStar cStar gcode data let outcomes := fun data (j : Fin (B.JBase + 1)) ↦ let modulus := pilotModulus (input data) B 0 j let winding := windingEnclosure (input data) B j PilotOutcome.mk modulus winding (uniqueNonnegativeInteger winding) let accept := fun j data ↦ pilotBestFrom B (outcomes data) j let selection := fun data ↦ selectedContourFrom B (outcomes data) letI : MeasurableSpace (Fin (B.JBase + 1)) := ⊤ letI : MeasurableSpace (Option (Fin (B.JBase + 1))) := ⊤ letI : MeasurableSpace (Option ℕ) := ⊤ change Measurable (fun data ↦ match selection data with | none => (0 : ℚ) | some j => match (outcomes data j).decoded with | none => (0 : ℚ) | some N => let modulus := pilotModulus (input data) B 1 j if B.aStarRat / 4 ≤ modulus.lo then rationalMidpoint (evaluationEnclosure (input data) B j N).re else (0 : ℚ)) have hselection : Measurable selection := by let summary := fun data : Fin p.n → Obs Xspace ↦ fun j : Fin (B.JBase + 1) ↦ (pilotModulus (input data) B 0 j, windingEnclosure (input data) B j) have hsummary : Measurable summary := by apply measurable_pi_lambda intro j exact (measurable_pilotModulus_canonical p pStar cStar gcode hgcode 0 j).prodMk (measurable_windingEnclosure_canonical p pStar cStar gcode hgcode j) let choose := fun state : Fin (B.JBase + 1) → RatInterval × ComplexRatIntervalselectedContourFrom B (fun j ↦ ⟨(state j).1, (state j).2, uniqueNonnegativeInteger (state j).2⟩) have hchoose : Measurable choose := measurable_of_countable choose convert hchoose.comp hsummary using 1 rfl refine measurable_countable_dispatch selection hselection (fun selected data ↦ match selected with | none => (0 : ℚ) | some j => match (outcomes data j).decoded with | none => (0 : ℚ) | some N => let modulus := pilotModulus (input data) B 1 j if B.aStarRat / 4 ≤ modulus.lo then rationalMidpoint (evaluationEnclosure (input data) B j N).re else (0 : ℚ)) ?_ intro selected cases selected with | none => exact measurable_const | some j => let decoded := fun data ↦ (outcomes data j).decoded have hdecoded : Measurable decoded := by have hwinding := measurable_windingEnclosure_canonical p pStar cStar gcode hgcode j exact (measurable_of_countable uniqueNonnegativeInteger).comp hwinding refine measurable_countable_dispatch decoded hdecoded (fun decodedValue data ↦ match decodedValue with | none => (0 : ℚ) | some N => let modulus := pilotModulus (input data) B 1 j if B.aStarRat / 4 ≤ modulus.lo then rationalMidpoint (evaluationEnclosure (input data) B j N).re else (0 : ℚ)) ?_ intro decodedValue cases decodedValue with | none => exact measurable_const | some N => have hpilot : Measurable (fun data : Fin p.n → Obs Xspace ↦ pilotModulus (input data) B 1 j) := measurable_pilotModulus_canonical p pStar cStar gcode hgcode 1 j have hevaluation : Measurable (fun data : Fin p.n → Obs Xspace ↦ evaluationEnclosure (input data) B j N) := measurable_evaluationEnclosure_canonical p pStar cStar gcode hgcode j N let finish : RatInterval × ComplexRatInterval → ℚ := fun state ↦ if B.aStarRat / 4 ≤ state.1.lo then rationalMidpoint state.2.re else 0 exact (measurable_of_countable finish).comp (hpilot.prodMk hevaluation)
CausalSmith.Stat.SaPlmCumulantConverse.ordinaryFiniteRationalResult_raw_measurable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/SpectralMeasurability.lean:853
Helpers.Transforms 23 declarations The unweighted transforms use Mathlib's complex MGF.

Population and empirical analytic transforms

The unweighted transforms use Mathlib's complex MGF. The two genuinely weighted transforms are Bochner integrals with a separate weight.

def weightedTransform

Weighted bilateral exponential transform.

Definition (Lean source)
def weightedTransform [MeasurableSpace Ω] (P : Measure Ω) (W V : Ω → ℝ) (z : ℂ) : ℂ := ∫ w, (W w : ℂ) * exp (z * V w) ∂P
CausalSmith.Stat.SaPlmCumulantConverse.weightedTransform · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:26

The moment generating function of the treatment noise — the deviation of the treatment from its conditional mean given the covariate — evaluated at a complex argument: the expectation of the exponential of that argument times the treatment noise.

Definition (Lean source)
def treatmentMGF (z : ℂ) : ℂ := complexMGF (eta p m) m.P z -- @realizes M(E exp(z eta))
CausalSmith.Stat.SaPlmCumulantConverse.treatmentMGF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:33

The moment generating function of the treatment-code error at sample size n — the gap between the true treatment regression and the supplied clipped code — evaluated at a complex argument.

Definition (Lean source)
def nuisanceMGF (z : ℂ) : ℂ := complexMGF (treatmentError p m n) m.P z -- @realizes H(E exp(z D_n))
CausalSmith.Stat.SaPlmCumulantConverse.nuisanceMGF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:40
def contaminationTransform

The exponential transform of the treatment-code error weighted by the outcome-side contamination: the expectation of the contamination evaluated at the covariate times the exponential of the complex argument multiplied by the treatment-code error.

Definition (Lean source)
def contaminationTransform (z : ℂ) : ℂ := weightedTransform m.P (fun o ↦ outcomeContamination p m n (covariate o)) (treatmentError p m n) z -- @realizes B(E[b_n(X) exp(z D_n)])
CausalSmith.Stat.SaPlmCumulantConverse.contaminationTransform · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:46

The moment generating function of the observable learned residual at sample size n — the treatment minus the supplied clipped treatment code evaluated at the covariate — at a complex argument.

Definition (Lean source)
def residualMGF (z : ℂ) : ℂ := complexMGF (learnedResidual p m n) m.P z -- @realizes F(E exp(z Z_n))
CausalSmith.Stat.SaPlmCumulantConverse.residualMGF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:54

The exponential transform of the observable learned residual weighted by the outcome: the expectation of the outcome times the exponential of the complex argument multiplied by the learned residual.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.outcomeResidualTransform · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:60

The exact Luxemburg envelope gives every real exponential moment of the treatment noise.

Formal statement
hclass :
t :
Integrable (fun o ↦ exp (t * eta p m o)) m.P
Proof (Lean source)
lemma eta_integrable_exp (hclass : NonGaussianClass p n m) (t : ℝ) : Integrable (fun o ↦ exp (t * eta p m o)) m.P := by have hpsi : 0 < p.psieta := p.constants_pos.2.2.2.1 have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) apply (hclass.etaSubGaussian.1.mul_const (exp (t ^ 2 * p.psieta ^ 2 / 4))).mono' ((Real.continuous_exp.measurable.comp (measurable_const.fun_mul hetaMeas)).aestronglyMeasurable) filter_upwards [] with o simp only [Function.comp_apply, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare : 0 ≤ (eta p m o / p.psieta - t * p.psieta / 2) ^ 2 := sq_nonneg _ field_simp [hpsi.ne'] at hsquare ⊢ nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.eta_integrable_exp · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:67
theorem treatmentMGF_entire

The treatment-noise MGF is entire; this is derived from the class's Luxemburg envelope rather than assumed as model data.

Formal statement
hclass :
Proof (Lean source)
lemma treatmentMGF_entire (hclass : NonGaussianClass p n m) : AnalyticOnNhd ℂ (treatmentMGF p m) univ := by have hset : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, eta_integrable_exp p m n hclass t] intro z _hz exact analyticAt_complexMGF (by simp [hset])
CausalSmith.Stat.SaPlmCumulantConverse.treatmentMGF_entire · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:87
theorem learnedResidual_integrable_exp Lemma learnedResidual_integrable_exp in the paper ↗

The learned residual has every real exponential moment.

Formal statement
hclass :
t :
Integrable (fun o ↦ exp (t * learnedResidual p m n o)) m.P
Proof (Lean source)
lemma learnedResidual_integrable_exp (hclass : NonGaussianClass p n m) (t : ℝ) : Integrable (fun o ↦ exp (t * learnedResidual p m n o)) m.P := by have hCg : 0 < p.Cg := p.constants_pos.2.1 have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hg] with o ho dsimp [treatmentError] calc |m.g0 (covariate o) - barG p m n (covariate o)| ≤ |m.g0 (covariate o)| + |barG p m n (covariate o)| := abs_sub _ _ _ ≤ p.Cg + p.Cg := add_le_add ho (hbar _) _ = 2 * p.Cg := by ring have hZMeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) apply ((eta_integrable_exp p m n hclass t).const_mul (exp (|t| * (2 * p.Cg)))).mono' ((Real.continuous_exp.measurable.comp (measurable_const.fun_mul hZMeas)).aestronglyMeasurable) filter_upwards [hD] with o ho simp only [Function.comp_apply, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hres : learnedResidual p m n o = eta p m o + treatmentError p m n o := by simp [learnedResidual, eta, treatmentError] rw [hres, mul_add] have htd : t * treatmentError p m n o ≤ |t| * (2 * p.Cg) := by calc t * treatmentError p m n o ≤ |t * treatmentError p m n o| := le_abs_self _ _ = |t| * |treatmentError p m n o| := abs_mul _ _ _ ≤ |t| * (2 * p.Cg) := mul_le_mul_of_nonneg_left ho (abs_nonneg t) linarith
CausalSmith.Stat.SaPlmCumulantConverse.learnedResidual_integrable_exp · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:97

The outcome innovation has every real exponential moment.

Formal statement
hclass :
t :
Integrable (fun o ↦ exp (t * xi p m o)) m.P
Proof (Lean source)
lemma xi_integrable_exp (hclass : NonGaussianClass p n m) (t : ℝ) : Integrable (fun o ↦ exp (t * xi p m o)) m.P := by have hpsi : 0 < p.psixi := p.constants_pos.2.2.2.2.1 apply (hclass.xiSubGaussian.1.mul_const (exp (t ^ 2 * p.psixi ^ 2 / 4))).mono' ((Real.continuous_exp.measurable.comp_aemeasurable (hclass.outcomeMeanIndependence.1.aemeasurable.const_mul t)).aestronglyMeasurable) filter_upwards [] with o simp only [Function.comp_apply, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare : 0 ≤ (xi p m o / p.psixi - t * p.psixi / 2) ^ 2 := sq_nonneg _ field_simp [hpsi.ne'] at hsquare ⊢ nlinarith
CausalSmith.Stat.SaPlmCumulantConverse.xi_integrable_exp · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:138
theorem outcomeNoise_weighted_exp_integrable Lemma outcomeNoise_weighted_exp_integrable in the paper ↗

The outcome innovation times a learned-residual exponential is integrable.

Formal statement
hclass :
z :
Integrable (fun o ↦ (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) m.P
Proof (Lean source)
lemma outcomeNoise_weighted_exp_integrable (hclass : NonGaussianClass p n m) (z : ℂ) : Integrable (fun o ↦ (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) m.P := by let e : Obs Xspace → ℂ := fun o ↦ exp (z * (learnedResidual p m n o : ℂ)) have hxiSet : integrableExpSet (xi p m) m.P = univ := by ext t simp [integrableExpSet, xi_integrable_exp p m n hclass t] have hxi2 : MemLp (xi p m) 2 m.P := by apply memLp_of_mem_interior_integrableExpSet simp [hxiSet] have hZMeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) have he2 : MemLp e 2 m.P := by rw [memLp_two_iff_integrable_sq_norm (by fun_prop)] convert learnedResidual_integrable_exp p m n hclass (2 * z.re) using 1 ext o dsimp [e] rw [Complex.norm_exp, sq, ← Real.exp_add] congr 1 simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] ring exact hxi2.ofReal.integrable_mul he2
CausalSmith.Stat.SaPlmCumulantConverse.outcomeNoise_weighted_exp_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:154
theorem outcomeNoise_weighted_exp_eq_zero Lemma outcomeNoise_weighted_exp_eq_zero in the paper ↗

Conditional mean independence annihilates the outcome innovation against the learned-residual exponential weight.

Formal statement
hclass :
z :
∫ o, (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P = 0
Proof (Lean source)
lemma outcomeNoise_weighted_exp_eq_zero (hclass : NonGaussianClass p n m) (z : ℂ) : ∫ o, (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P = 0 := by let e : Obs Xspace → ℂ := fun o ↦ exp (z * (learnedResidual p m n o : ℂ)) have hprod : Integrable (fun o ↦ (xi p m o : ℂ) * e o) m.P := by simpa [e] using outcomeNoise_weighted_exp_integrable p m n hclass z have hZxT : Measurable[xTSigma (Xspace := Xspace)] (learnedResidual p m n) := by change Measurable[comap (fun o : Obs Xspace ↦ (covariate o, treatment o)) inferInstance] (learnedResidual p m n) have h : Measurable (fun xt : Xspace × ℝ ↦ xt.2 - barG p m n xt.1) := measurable_snd.sub ((((m.gcode_measurable n).comp measurable_fst).max measurable_const).min measurable_const) exact h.comp (comap_measurable (fun o : Obs Xspace ↦ (covariate o, treatment o))) have heRe : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o ↦ (e o).re) := by apply Measurable.stronglyMeasurable dsimp [e] fun_prop have heIm : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o ↦ (e o).im) := by apply Measurable.stronglyMeasurable dsimp [e] fun_prop have hprodRe : Integrable (fun o ↦ xi p m o * (e o).re) m.P := by simpa using hprod.re have hprodIm : Integrable (fun o ↦ xi p m o * (e o).im) m.P := by simpa using hprod.im have hzero (w : Obs Xspace → ℝ) (hw : StronglyMeasurable[xTSigma (Xspace := Xspace)] w) (hprodw : Integrable (fun o ↦ xi p m o * w o) m.P) : ∫ o, xi p m o * w o ∂m.P = 0 := by have hpull := MeasureTheory.condExp_mul_of_stronglyMeasurable_right (μ := m.P) (m := xTSigma (Xspace := Xspace)) hw hprodw hclass.outcomeMeanIndependence.1 calc ∫ o, xi p m o * w o ∂m.P = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun o ↦ xi p m o * w o)) o ∂m.P := by rw [MeasureTheory.integral_condExp (show xTSigma (Xspace := Xspace) ≤ (inferInstance : MeasurableSpace (Obs Xspace)) from comap_le (measurable_fst.prodMk measurable_snd.fst))] _ = ∫ o, (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (xi p m)) o * w o ∂m.P := integral_congr_ae hpull _ = 0 := by apply integral_eq_zero_of_ae filter_upwards [hclass.outcomeMeanIndependence.2] with o ho simp [ho] apply Complex.ext · change (∫ o, (xi p m o : ℂ) * e o ∂m.P).re = 0 calc _ = ∫ o, ((xi p m o : ℂ) * e o).re ∂m.P := by simpa only [RCLike.re_eq_complex_re] using (integral_re hprod).symm _ = ∫ o, xi p m o * (e o).re ∂m.P := by simp _ = 0 := hzero (fun o ↦ (e o).re) heRe hprodRe · change (∫ o, (xi p m o : ℂ) * e o ∂m.P).im = 0 calc _ = ∫ o, ((xi p m o : ℂ) * e o).im ∂m.P := by simpa only [RCLike.im_eq_complex_im] using (integral_im hprod).symm _ = ∫ o, xi p m o * (e o).im ∂m.P := by simp _ = 0 := hzero (fun o ↦ (e o).im) heIm hprodIm
CausalSmith.Stat.SaPlmCumulantConverse.outcomeNoise_weighted_exp_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:183
theorem residualMGF_analyticOn_closedBall Lemma residualMGF_analyticOn_closedBall in the paper ↗

The residual complex MGF is entire under the paper's exponential-moment envelope; this is derived from its construction rather than assumed.

Formal statement
hclass :
rho :
AnalyticOnNhd ℂ (residualMGF p m n) (closedBall (0 : ℂ) rho)
Proof (Lean source)
lemma residualMGF_analyticOn_closedBall (hclass : NonGaussianClass p n m) (rho : ℝ) : AnalyticOnNhd ℂ (residualMGF p m n) (closedBall (0 : ℂ) rho) := by have hpsi : 0 < p.psieta := p.constants_pos.2.2.2.1 have hCg : 0 < p.Cg := p.constants_pos.2.1 have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hetaAll (t : ℝ) : Integrable (fun o ↦ exp (t * eta p m o)) m.P := by apply (hclass.etaSubGaussian.1.mul_const (exp (t ^ 2 * p.psieta ^ 2 / 4))).mono' ((Real.continuous_exp.measurable.comp (measurable_const.fun_mul hetaMeas)).aestronglyMeasurable) filter_upwards [] with o simp only [Function.comp_apply, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare : 0 ≤ (eta p m o / p.psieta - t * p.psieta / 2) ^ 2 := sq_nonneg _ field_simp [hpsi.ne'] at hsquare ⊢ nlinarith have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hg] with o ho dsimp [treatmentError] calc |m.g0 (covariate o) - barG p m n (covariate o)| ≤ |m.g0 (covariate o)| + |barG p m n (covariate o)| := abs_sub _ _ _ ≤ p.Cg + p.Cg := add_le_add ho (hbar _) _ = 2 * p.Cg := by ring have hZAll (t : ℝ) : Integrable (fun o ↦ exp (t * learnedResidual p m n o)) m.P := by have hZMeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) apply ((hetaAll t).const_mul (exp (|t| * (2 * p.Cg)))).mono' ((Real.continuous_exp.measurable.comp (measurable_const.fun_mul hZMeas)).aestronglyMeasurable) filter_upwards [hD] with o ho simp only [Function.comp_apply, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hres : learnedResidual p m n o = eta p m o + treatmentError p m n o := by simp [learnedResidual, eta, treatmentError] rw [hres, mul_add] have htd : t * treatmentError p m n o ≤ |t| * (2 * p.Cg) := by calc t * treatmentError p m n o ≤ |t * treatmentError p m n o| := le_abs_self _ _ = |t| * |treatmentError p m n o| := abs_mul _ _ _ ≤ |t| * (2 * p.Cg) := mul_le_mul_of_nonneg_left ho (abs_nonneg t) linarith have hset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, hZAll t] unfold residualMGF have han := analyticOnNhd_complexMGF (X := learnedResidual p m n) (μ := m.P) rw [hset, interior_univ] at han apply han.mono intro z hz trivial
CausalSmith.Stat.SaPlmCumulantConverse.residualMGF_analyticOn_closedBall · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:249
def empiricalF

Split empirical unweighted transform.

Definition (Lean source)
def empiricalF (data : Fin n → Obs Xspace) (I : Finset (Fin n)) (z : ℂ) : ℂ := (I.card : ℂ)⁻¹ * ∑ i ∈ I, exp (z * learnedResidual p m n (data i))
def empiricalG

Split empirical outcome-weighted transform.

Definition (Lean source)
def empiricalG (data : Fin n → Obs Xspace) (I : Finset (Fin n)) (z : ℂ) : ℂ := (I.card : ℂ)⁻¹ * ∑ i ∈ I, (outcome (data i) : ℂ) * exp (z * learnedResidual p m n (data i))

Multiplicity-adjusted transform-zero instrument.

Definition (Lean source)
-- @node: def:zero-instrument def zeroInstrument (M : ℂ → ℂ) (z0 : ℂ) (ell : ℕ) (_hell : 1 ≤ ell) (_hz : M z0 = 0) (_hmult : analyticOrderNatAt M z0 = ell) (w : ℂ) : ℂ := w ^ (ell - 1) * exp (z0 * w)
CausalSmith.Stat.SaPlmCumulantConverse.zeroInstrument · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:330
theorem residualMGF_eq_treatmentMGF_mul_nuisanceMGF Lemma residualMGF_eq_treatmentMGF_mul_nuisanceMGF in the paper ↗

Independence of the treatment noise and covariates factors the learned-residual MGF.

Formal statement
hclass :
z :
residualMGF p m n z = treatmentMGF p m z * nuisanceMGF p m n z
Proof (Lean source)
lemma residualMGF_eq_treatmentMGF_mul_nuisanceMGF (hclass : NonGaussianClass p n m) (z : ℂ) : residualMGF p m n z = treatmentMGF p m z * nuisanceMGF p m n z := by have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hD : Measurable (fun x : Xspace ↦ m.g0 x - barG p m n x) := by exact m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hind := hclass.independentTreatmentNoise.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ exp (z * (e : ℂ))) (g := fun x : Xspace ↦ exp (z * (m.g0 x - barG p m n x : ℝ))) heta.aemeasurable hX.aemeasurable (by fun_prop) ((Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp hD))).aestronglyMeasurable) rw [residualMGF, treatmentMGF, nuisanceMGF, complexMGF] calc (∫ o, exp (z * (learnedResidual p m n o : ℂ)) ∂m.P) = ∫ o, exp (z * (eta p m o : ℂ)) * exp (z * (m.g0 (covariate o) - barG p m n (covariate o) : ℝ)) ∂m.P := by apply integral_congr_ae filter_upwards [] with o rw [← Complex.exp_add] congr 2 simp only [learnedResidual, eta] rw [← mul_add] congr 1 push_cast ring _ = _ := hind
CausalSmith.Stat.SaPlmCumulantConverse.residualMGF_eq_treatmentMGF_mul_nuisanceMGF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:340
theorem contamination_weighted_exp_integrable Lemma contamination_weighted_exp_integrable in the paper ↗

The bounded covariate contamination times a learned-residual exponential is integrable.

Formal statement
hclass :
z :
Integrable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) m.P
Proof (Lean source)
lemma contamination_weighted_exp_integrable (hclass : NonGaussianClass p n m) (z : ℂ) : Integrable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) m.P := by have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hq := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.qRange have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange have hb : ∀ᵐ o ∂m.P, ‖(outcomeContamination p m n (covariate o) : ℂ)‖ ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by filter_upwards [hq, hg] with o hqo hgo rw [Complex.norm_real] dsimp [outcomeContamination] calc |m.q0 (covariate o) - m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))| ≤ |m.q0 (covariate o)| + |m.theta0| * |m.g0 (covariate o) - barG p m n (covariate o)| := by simpa [abs_mul] using abs_sub (m.q0 (covariate o)) (m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))) _ ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by apply add_le_add hqo have hmul := mul_le_mul hclass.thetaRange ((abs_sub _ _).trans (add_le_add hgo (hbar (covariate o)))) (abs_nonneg _) p.constants_pos.1.le convert hmul using 1 <;> ring have hbMeas : Measurable (fun o ↦ (outcomeContamination p m n (covariate o) : ℂ)) := by apply Complex.measurable_ofReal.comp exact (m.q0_measurable.sub (measurable_const.mul (m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const)))).comp hcov have hexp : Integrable (fun o ↦ exp (z * (learnedResidual p m n o : ℂ))) m.P := by have hZMeas : Measurable (learnedResidual p m n) := by unfold learnedResidual treatment barG covariate exact measurable_snd.fst.sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) apply (learnedResidual_integrable_exp p m n hclass z.re).mono' ((Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp hZMeas))).aestronglyMeasurable) filter_upwards [] with o simp [Complex.norm_exp] exact hexp.bdd_mul hbMeas.aestronglyMeasurable hb
CausalSmith.Stat.SaPlmCumulantConverse.contamination_weighted_exp_integrable · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:374
theorem contamination_weighted_factorization Lemma contamination_weighted_factorization in the paper ↗

The covariate contamination term factors from the treatment-noise exponential.

Formal statement
hclass :
z :
Proof (Lean source)
lemma contamination_weighted_factorization (hclass : NonGaussianClass p n m) (z : ℂ) : weightedTransform m.P (fun o ↦ outcomeContamination p m n (covariate o)) (learnedResidual p m n) z = treatmentMGF p m z * contaminationTransform p m n z := by have heta : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hX : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hD : Measurable (fun x : Xspace ↦ m.g0 x - barG p m n x) := by exact m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const) have hb : Measurable (fun x : Xspace ↦ outcomeContamination p m n x) := by exact m.q0_measurable.sub (measurable_const.mul hD) have hind := hclass.independentTreatmentNoise.integral_fun_comp_mul_comp (f := fun e : ℝ ↦ exp (z * (e : ℂ))) (g := fun x : Xspace ↦ (outcomeContamination p m n x : ℂ) * exp (z * (m.g0 x - barG p m n x : ℝ))) heta.aemeasurable hX.aemeasurable (by fun_prop) ((Complex.measurable_ofReal.comp hb).mul (Complex.continuous_exp.measurable.comp (measurable_const.mul (Complex.measurable_ofReal.comp hD))) |>.aestronglyMeasurable) rw [weightedTransform, treatmentMGF, contaminationTransform, complexMGF] calc (∫ o, (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P) = ∫ o, exp (z * (eta p m o : ℂ)) * ((outcomeContamination p m n (covariate o) : ℂ) * exp (z * (m.g0 (covariate o) - barG p m n (covariate o) : ℝ))) ∂m.P := by apply integral_congr_ae filter_upwards [] with o have he : exp (z * (learnedResidual p m n o : ℂ)) = exp (z * (eta p m o : ℂ)) * exp (z * (m.g0 (covariate o) - barG p m n (covariate o) : ℝ)) := by rw [← Complex.exp_add] congr 2 rw [← mul_add] congr 1 simp only [learnedResidual, eta] push_cast ring rw [he] ring _ = _ := hind
CausalSmith.Stat.SaPlmCumulantConverse.contamination_weighted_factorization · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:428

The normalized logarithmic-derivative integral used as the contour count.

Definition (Lean source)
def contourCount (F : ℂ → ℂ) (rho : ℝ) : ℂ := normalizedLogDerivCircleIntegral F 0 rho
CausalSmith.Stat.SaPlmCumulantConverse.contourCount · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:476
def contourFunctional Definition 13 in the paper ↗

Observable normalized contour ratio.

Definition (Lean source)
-- @node: def:contour-functional def contourFunctional (F G : ℂ → ℂ) (rho : ℝ) (_hrho : 0 < rho) (_hEntire : AnalyticOnNhd ℂ F (closedBall (0 : ℂ) rho)) (_hzero : ∀ z ∈ sphere (0 : ℂ) rho, F z ≠ 0) (_hcount : 1 ≤ zeroMultiplicityCount F 0 rho) : ℂ := (contourCount F rho * (2 * (Real.pi : ℂ) * I))⁻¹ * circleIntegral (fun z ↦ G z / F z) 0 rho
CausalSmith.Stat.SaPlmCumulantConverse.contourFunctional · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:481
theorem observable_factorization Lemma 1 in the paper ↗

Observable factorization of the learned-residual transforms.

Formal statement
hclass :
∀ z : ℂ,
residualMGF p m n z = treatmentMGF p m z * nuisanceMGF p m n z ∧
= (m.theta0 : ℂ) * deriv (residualMGF p m n) z
Proof (Lean source)
-- @node: lem:observable-factorization lemma observable_factorization (hclass : NonGaussianClass p n m) : ∀ z : ℂ, residualMGF p m n z = treatmentMGF p m z * nuisanceMGF p m n z ∧ outcomeResidualTransform p m n z = (m.theta0 : ℂ) * deriv (residualMGF p m n) z + treatmentMGF p m z * contaminationTransform p m n z := by intro z constructor · exact residualMGF_eq_treatmentMGF_mul_nuisanceMGF p m n hclass z have hZset : integrableExpSet (learnedResidual p m n) m.P = univ := by ext t simp [integrableExpSet, learnedResidual_integrable_exp p m n hclass t] have hzmem : z.re ∈ interior (integrableExpSet (learnedResidual p m n) m.P) := by simp [hZset] have hZexp : Integrable (fun o ↦ (learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) m.P := by simpa using integrable_pow_mul_cexp_of_re_mem_interior_integrableExpSet hzmem 1 have hderiv : deriv (residualMGF p m n) z = ∫ o, (learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := by exact (hasDerivAt_complexMGF hzmem).deriv have hbexp := contamination_weighted_exp_integrable p m n hclass z have hxiexp := outcomeNoise_weighted_exp_integrable p m n hclass z have hthetaZ : Integrable (fun o ↦ (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)))) m.P := hZexp.const_mul _ have hthetaInt : (∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) ∂m.P) = (m.theta0 : ℂ) * deriv (residualMGF p m n) z := by calc _ = (m.theta0 : ℂ) * ∫ o, (learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := integral_const_mul _ _ _ = _ := by rw [← hderiv] rw [outcomeResidualTransform, weightedTransform] calc (∫ o, (outcome o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P) = ∫ o, ((m.theta0 : ℂ) * (learnedResidual p m n o : ℂ) + (outcomeContamination p m n (covariate o) : ℂ) + (xi p m o : ℂ)) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := by apply integral_congr_ae filter_upwards [] with o congr 1 simp only [learnedResidual, outcomeContamination, xi, eta, treatment, outcome, covariate] push_cast ring _ = ∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) + (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) + (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := by apply integral_congr_ae filter_upwards [] with o ring _ = ∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) ∂m.P + ∫ o, (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P + ∫ o, (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := by calc _ = (∫ o, (m.theta0 : ℂ) * ((learnedResidual p m n o : ℂ) * exp (z * (learnedResidual p m n o : ℂ))) + (outcomeContamination p m n (covariate o) : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P) + ∫ o, (xi p m o : ℂ) * exp (z * (learnedResidual p m n o : ℂ)) ∂m.P := by convert integral_add (hthetaZ.add hbexp) hxiexp using 1 <;> simp [Pi.add_apply] _ = _ := by rw [integral_add hthetaZ hbexp] _ = (m.theta0 : ℂ) * deriv (residualMGF p m n) z + treatmentMGF p m z * contaminationTransform p m n z := by rw [hthetaInt, outcomeNoise_weighted_exp_eq_zero p m n hclass z, add_zero] congr 1 simpa [weightedTransform] using contamination_weighted_factorization p m n hclass z
CausalSmith.Stat.SaPlmCumulantConverse.observable_factorization · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:494
theorem l1_nuisance_zero_free Lemma 10 in the paper ↗

Direct L1 control keeps the nuisance transform uniformly away from zero and preserves analytic zero multiplicities.

Formal statement
hclass :
let R1 := searchRadius p let eps0 := (4 * R1 * exp (2 * p.Cg * R1))⁻¹ (∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg) ∧
(∫ o, |treatmentError p m n o| ∂m.P ≤ p.eps1n n) ∧
(∀ z : ℂ, ‖z‖ ≤ R1 → ‖nuisanceMGF p m n z - 1‖ ≤ R1 * exp (2 * p.Cg * R1) * p.eps1n n) ∧
(p.eps1n n ≤ eps0 → (∀ z : ℂ, ‖z‖ ≤ R1 → 3 / 4 ≤ ‖nuisanceMGF p m n z‖) ∧ (∀ z : ℂ, ‖z‖ ≤ R1 → analyticOrderAt (residualMGF p m n) z = analyticOrderAt (treatmentMGF p m) z))
Proof (Lean source)
-- @node: lem:l1-nuisance-zero-free lemma l1_nuisance_zero_free (hclass : NonGaussianClass p n m) : let R1 := searchRadius p let eps0 := (4 * R1 * exp (2 * p.Cg * R1))⁻¹ -- @realizes eps0(exact fixed stability radius) (∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg) ∧ (∫ o, |treatmentError p m n o| ∂m.P ≤ p.eps1n n) ∧ (∀ z : ℂ, ‖z‖ ≤ R1 → ‖nuisanceMGF p m n z - 1‖ ≤ R1 * exp (2 * p.Cg * R1) * p.eps1n n) ∧ (p.eps1n n ≤ eps0 → (∀ z : ℂ, ‖z‖ ≤ R1 → 3 / 4 ≤ ‖nuisanceMGF p m n z‖) ∧ (∀ z : ℂ, ‖z‖ ≤ R1 → analyticOrderAt (residualMGF p m n) z = analyticOrderAt (treatmentMGF p m) z)) := by dsimp have hCg : 0 < p.Cg := p.constants_pos.2.1 have hR1 : 0 < searchRadius p := by have hR0 : 0 ≤ zeroRadius p := by unfold zeroRadius Ak apply mul_nonneg · apply Real.rpow_nonneg positivity · apply Real.rpow_nonneg exact div_nonneg (sq_nonneg _) p.constants_pos.2.2.2.2.2.1.le unfold searchRadius linarith have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hD : ∀ᵐ o ∂m.P, |treatmentError p m n o| ≤ 2 * p.Cg := by have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hg] with o ho dsimp [treatmentError] calc |m.g0 (covariate o) - barG p m n (covariate o)| ≤ |m.g0 (covariate o)| + |barG p m n (covariate o)| := abs_sub _ _ _ ≤ p.Cg + p.Cg := add_le_add ho (hbar _) _ = 2 * p.Cg := by ring have hL1 : ∫ o, |treatmentError p m n o| ∂m.P ≤ p.eps1n n := by rw [show (∫ o, |treatmentError p m n o| ∂m.P) = ∫ x, |barG p m n x - m.g0 x| ∂covariateLaw p m by rw [covariateLaw, integral_map hcov.aemeasurable] · congr 1 funext o simp [treatmentError, abs_sub_comm] · exact hclass.treatmentCodeRadiusL1.1.aestronglyMeasurable] exact hclass.treatmentCodeRadiusL1.2 have hDmeas : Measurable (treatmentError p m n) := by unfold treatmentError barG covariate exact (m.g0_measurable.comp measurable_fst).sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) have hDint : Integrable (fun o ↦ |treatmentError p m n o|) m.P := by have hi := hclass.treatmentCodeRadiusL1.1.comp_aemeasurable hcov.aemeasurable convert hi using 1 ext o simp [treatmentError, abs_sub_comm] have hMGFBound : ∀ z : ℂ, ‖z‖ ≤ searchRadius p → ‖nuisanceMGF p m n z - 1‖ ≤ searchRadius p * exp (2 * p.Cg * searchRadius p) * p.eps1n n := by intro z hz have hexp : Integrable (fun o ↦ exp (z * (treatmentError p m n o : ℂ))) m.P := by apply Integrable.of_bound (by fun_prop) (exp (‖z‖ * (2 * p.Cg))) filter_upwards [hD] with o ho rw [Complex.norm_exp] apply Real.exp_le_exp.mpr simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] calc z.re * treatmentError p m n o ≤ |z.re * treatmentError p m n o| := le_abs_self _ _ = |z.re| * |treatmentError p m n o| := abs_mul _ _ _ ≤ ‖z‖ * (2 * p.Cg) := mul_le_mul (Complex.abs_re_le_norm z) ho (abs_nonneg _) (norm_nonneg _) rw [nuisanceMGF, complexMGF, show (1 : ℂ) = ∫ _ : Obs Xspace, (1 : ℂ) ∂m.P by simp, ← integral_sub hexp (integrable_const 1)] calc ‖∫ o, exp (z * (treatmentError p m n o : ℂ)) - 1 ∂m.P‖ ≤ ∫ o, (searchRadius p * exp (2 * p.Cg * searchRadius p)) * |treatmentError p m n o| ∂m.P := by apply norm_integral_le_of_norm_le · simpa only [mul_assoc] using hDint.const_mul (searchRadius p * exp (2 * p.Cg * searchRadius p)) filter_upwards [hD] with o ho calc ‖Complex.exp (z * (treatmentError p m n o : ℂ)) - 1‖ ≤ ‖z * (treatmentError p m n o : ℂ)‖ * exp ‖z * (treatmentError p m n o : ℂ)‖ := by simpa using Complex.norm_exp_sub_sum_le_norm_mul_exp (z * (treatmentError p m n o : ℂ)) 1 _ ≤ (searchRadius p * exp (2 * p.Cg * searchRadius p)) * |treatmentError p m n o| := by simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs] have hprod : ‖z‖ * |treatmentError p m n o| ≤ 2 * p.Cg * searchRadius p := by nlinarith [norm_nonneg z, abs_nonneg (treatmentError p m n o)] have hcoef : ‖z‖ * exp (‖z‖ * |treatmentError p m n o|) ≤ searchRadius p * exp (2 * p.Cg * searchRadius p) := mul_le_mul hz (Real.exp_le_exp.mpr hprod) (Real.exp_pos _).le hR1.le calc ‖z‖ * |treatmentError p m n o| * exp (‖z‖ * |treatmentError p m n o|) = (‖z‖ * exp (‖z‖ * |treatmentError p m n o|)) * |treatmentError p m n o| := by ring _ ≤ _ := mul_le_mul_of_nonneg_right hcoef (abs_nonneg _) _ = (searchRadius p * exp (2 * p.Cg * searchRadius p)) * ∫ o, |treatmentError p m n o| ∂m.P := by rw [integral_const_mul] _ ≤ searchRadius p * exp (2 * p.Cg * searchRadius p) * p.eps1n n := by gcongr refine ⟨hD, hL1, hMGFBound, ?_⟩ intro heps have hAway : ∀ z : ℂ, ‖z‖ ≤ searchRadius p → 3 / 4 ≤ ‖nuisanceMGF p m n z‖ := by intro z hz have hA : 0 < searchRadius p * exp (2 * p.Cg * searchRadius p) := mul_pos hR1 (Real.exp_pos _) have hquarter : searchRadius p * exp (2 * p.Cg * searchRadius p) * p.eps1n n ≤ 1 / 4 := by calc searchRadius p * exp (2 * p.Cg * searchRadius p) * p.eps1n n ≤ searchRadius p * exp (2 * p.Cg * searchRadius p) * (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ := mul_le_mul_of_nonneg_left heps hA.le _ = 1 / 4 := by field_simp have hb := (hMGFBound z hz).trans hquarter have hrev := norm_sub_norm_le (1 : ℂ) (nuisanceMGF p m n z) rw [norm_sub_rev] at hrev norm_num at hrev ⊢ linarith refine ⟨hAway, ?_⟩ intro z hz have hDbdd : ∀ᵐ o ∂m.P, treatmentError p m n o ∈ Icc (-2 * p.Cg) (2 * p.Cg) := by filter_upwards [hD] with o ho rw [abs_le] at ho constructor <;> linarith have hDall (t : ℝ) : Integrable (fun o ↦ exp (t * treatmentError p m n o)) m.P := integrable_exp_mul_of_mem_Icc hDmeas.aemeasurable hDbdd have hDset : integrableExpSet (treatmentError p m n) m.P = univ := by ext t simp [integrableExpSet, hDall t] have hHan : AnalyticAt ℂ (nuisanceMGF p m n) z := by apply analyticAt_complexMGF simp [hDset] have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hpsi : 0 < p.psieta := p.constants_pos.2.2.2.1 have hetaAll (t : ℝ) : Integrable (fun o ↦ exp (t * eta p m o)) m.P := by apply (hclass.etaSubGaussian.1.mul_const (exp (t ^ 2 * p.psieta ^ 2 / 4))).mono' (by fun_prop) filter_upwards [] with o simp only [Real.norm_eq_abs, Real.abs_exp] rw [← Real.exp_add] apply Real.exp_le_exp.mpr have hsquare : 0 ≤ (eta p m o / p.psieta - t * p.psieta / 2) ^ 2 := sq_nonneg _ field_simp [hpsi.ne'] at hsquare ⊢ nlinarith have hetaSet : integrableExpSet (eta p m) m.P = univ := by ext t simp [integrableExpSet, hetaAll t] have hMan : AnalyticAt ℂ (treatmentMGF p m) z := by apply analyticAt_complexMGF simp [hetaSet] have hHne : nuisanceMGF p m n z ≠ 0 := by intro hzero have := hAway z hz rw [hzero, norm_zero] at this norm_num at this have hfac : residualMGF p m n = treatmentMGF p m * nuisanceMGF p m n := by funext w exact residualMGF_eq_treatmentMGF_mul_nuisanceMGF p m n hclass w rw [hfac, analyticOrderAt_mul hMan hHan, hHan.analyticOrderAt_eq_zero.mpr hHne, add_zero]
CausalSmith.Stat.SaPlmCumulantConverse.l1_nuisance_zero_free · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/Transforms.lean:580
Helpers.UniformDiskSeries 10 declarations This file isolates the two generic steps used by empirical analytic-transform arguments: a power-series coefficient majorant controls the supremum norm on a closed disk, and a countable dense skeleton makes that supremum

Measurable uniform bounds for analytic series on a disk

This file isolates the two generic steps used by empirical analytic-transform arguments: a power-series coefficient majorant controls the supremum norm on a closed disk, and a countable dense skeleton makes that supremum measurable and transfers an envelope bound to it.

def diskSupNorm

The uniform norm of a complex-valued random function on the closed disk of radius R.

Definition (Lean source)
def diskSupNorm {Ω : Type*} (H : Ω → ℂ → ℂ) (R : ℝ) (ω : Ω) : ℝ := sSup {x : ℝ | ∃ z : ℂ, ‖z‖ ≤ R ∧ x = ‖H ω z‖}
theorem diskSupNorm_eq_sSup_image

The set-builder presentation of the disk supremum agrees with its image presentation.

Formal statement
Ω :
Type*
H :
Ω → ℂ → ℂ
R :
ω :
Ω
diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' {z : ℂ | ‖z‖ ≤ R})
Proof (Lean source)
theorem diskSupNorm_eq_sSup_image {Ω : Type*} (H : Ω → ℂ → ℂ) (R : ℝ) (ω : Ω) : diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' {z : ℂ | ‖z‖ ≤ R}) := by apply congrArg sSup ext x constructor · rintro ⟨z, hz, rfl⟩ exact ⟨z, hz, rfl⟩ · rintro ⟨z, hz, rfl⟩ exact ⟨z, hz, rfl⟩
CausalSmith.Stat.SaPlmCumulantConverse.diskSupNorm_eq_sSup_image · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:27
theorem norm_tsum_mul_pow_le_tsum_norm_mul_pow

An absolutely summable coefficient majorant bounds an analytic series uniformly on the closed disk of radius R.

Formal statement
c :
ℕ → ℂ
R :
hsum :
Summable (fun k ↦ ‖c k‖ * R ^ k)
z :
hz :
‖z‖ ≤ R
‖∑' k : ℕ, c k * z ^ k‖ ≤ ∑' k : ℕ, ‖c k‖ * R ^ k
Proof (Lean source)
theorem norm_tsum_mul_pow_le_tsum_norm_mul_pow (c : ℕ → ℂ) {R : ℝ} (hsum : Summable (fun k ↦ ‖c k‖ * R ^ k)) {z : ℂ} (hz : ‖z‖ ≤ R) : ‖∑' k : ℕ, c k * z ^ k‖ ≤ ∑' k : ℕ, ‖c k‖ * R ^ k := by apply tsum_of_norm_bounded hsum.hasSum intro k rw [norm_mul, norm_pow] gcongr
CausalSmith.Stat.SaPlmCumulantConverse.norm_tsum_mul_pow_le_tsum_norm_mul_pow · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:39
theorem diskSupNorm_tsum_mul_pow_le

The coefficient majorant of an analytic series bounds its uniform norm on the closed disk.

Formal statement
Ω :
Type*
c :
Ω → ℕ → ℂ
R :
hR :
0 ≤ R
ω :
Ω
hsum :
Summable (fun k ↦ ‖c ω k‖ * R ^ k)
diskSupNorm (fun ω z ↦ ∑' k : ℕ, c ω k * z ^ k) R ω ≤ ∑' k : ℕ, ‖c ω k‖ * R ^ k
Proof (Lean source)
theorem diskSupNorm_tsum_mul_pow_le {Ω : Type*} (c : Ω → ℕ → ℂ) {R : ℝ} (hR : 0 ≤ R) (ω : Ω) (hsum : Summable (fun k ↦ ‖c ω k‖ * R ^ k)) : diskSupNorm (fun ω z ↦ ∑' k : ℕ, c ω k * z ^ k) R ω ≤ ∑' k : ℕ, ‖c ω k‖ * R ^ k := by apply csSup_le · exact ⟨‖∑' k : ℕ, c ω k * (0 : ℂ) ^ k‖, 0, by simpa using hR, rfl⟩ · rintro x ⟨z, hz, rfl⟩ exact norm_tsum_mul_pow_le_tsum_norm_mul_pow (c ω) hsum hz
CausalSmith.Stat.SaPlmCumulantConverse.diskSupNorm_tsum_mul_pow_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:51
theorem measurable_diskSupNorm_of_countable_dense

A countable dense skeleton makes a pointwise disk supremum measurable once the supremum over the skeleton is known to equal the full supremum.

Formal statement
Ω :
H :
Ω → ℂ → ℂ
R :
D :
Set
hD :
D.Countable
hH :
∀ z ∈ D, Measurable (fun ω ↦ ‖H ω z‖)
heq :
∀ ω, diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' D)
Proof (Lean source)
theorem measurable_diskSupNorm_of_countable_dense {Ω : Type*} [MeasurableSpace Ω] (H : Ω → ℂ → ℂ) (R : ℝ) (D : Set ℂ) (hD : D.Countable) (hH : ∀ z ∈ D, Measurable (fun ω ↦ ‖H ω z‖)) (heq : ∀ ω, diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' D)) : Measurable (diskSupNorm H R) := by have hm := measurable_sSup_image_of_countable_dense {z : ℂ | ‖z‖ ≤ R} D (fun ω z ↦ ‖H ω z‖) hD hH (fun ω ↦ by rw [← diskSupNorm_eq_sSup_image] exact heq ω) convert hm using 1 ext ω exact diskSupNorm_eq_sSup_image H R ω
CausalSmith.Stat.SaPlmCumulantConverse.measurable_diskSupNorm_of_countable_dense · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:63
theorem diskSupNorm_sq_lintegral_le_of_countable_dense

A measurable pointwise envelope transfers its squared lintegral bound to the uniform norm on a nonempty closed disk.

Formal statement
Ω :
μ :
H :
Ω → ℂ → ℂ
R :
hR :
0 ≤ R
D :
Set
hD :
D.Countable
hH :
∀ z ∈ D, Measurable (fun ω ↦ ‖H ω z‖)
heq :
∀ ω, diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' D)
A :
Ω → ℝ
hA :
∀ ω, 0 ≤ A ω
hbound :
∀ ω z
if
‖z‖ ≤ R
then
‖H ω z‖ ≤ A ω
B :
ℝ≥0∞
hA2 :
∫⁻ ω, ofReal ((A ω) ^ 2) ∂μ ≤ B
Measurable (diskSupNorm H R) ∧ ∫⁻ ω, ofReal ((diskSupNorm H R ω) ^ 2) ∂μ ≤ B
Proof (Lean source)
theorem diskSupNorm_sq_lintegral_le_of_countable_dense {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (H : Ω → ℂ → ℂ) {R : ℝ} (hR : 0 ≤ R) (D : Set ℂ) (hD : D.Countable) (hH : ∀ z ∈ D, Measurable (fun ω ↦ ‖H ω z‖)) (heq : ∀ ω, diskSupNorm H R ω = sSup ((fun z ↦ ‖H ω z‖) '' D)) (A : Ω → ℝ) (hA : ∀ ω, 0 ≤ A ω) (hbound : ∀ ω z, ‖z‖ ≤ R → ‖H ω z‖ ≤ A ω) {B : ℝ≥0∞} (hA2 : ∫⁻ ω, ofReal ((A ω) ^ 2) ∂μ ≤ B) : Measurable (diskSupNorm H R) ∧ ∫⁻ ω, ofReal ((diskSupNorm H R ω) ^ 2) ∂μ ≤ B := by constructor · exact measurable_diskSupNorm_of_countable_dense H R D hD hH heq · refine (lintegral_mono fun ω ↦ ENNReal.ofReal_le_ofReal ?_).trans hA2 have hbdd : BddAbove ((fun z ↦ ‖H ω z‖) '' {z : ℂ | ‖z‖ ≤ R}) := ⟨A ω, by rintro x ⟨z, hz, rfl⟩ exact hbound ω z hz⟩ have hzero_mem : ‖(0 : ℂ)‖ ≤ R := by simpa using hR have hsup_nonneg : 0 ≤ diskSupNorm H R ω := by exact (norm_nonneg (H ω 0)).trans (by rw [diskSupNorm_eq_sSup_image] exact le_csSup hbdd ⟨0, hzero_mem, rfl⟩) have hsup_le : diskSupNorm H R ω ≤ A ω := by rw [diskSupNorm_eq_sSup_image] apply csSup_le · exact ⟨‖H ω 0‖, 0, hzero_mem, rfl⟩ · rintro x ⟨z, hz, rfl⟩ exact hbound ω z hz exact (sq_le_sq₀ hsup_nonneg (hA ω)).2 hsup_le
CausalSmith.Stat.SaPlmCumulantConverse.diskSupNorm_sq_lintegral_le_of_countable_dense · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:80
theorem pi_centered_average_sq_lintegral_le

Under a finite product probability law, the centered empirical average of a real square-integrable coefficient has second moment at most its population energy divided by the sample size.

Formal statement
ι X :
hcard :
0 < Fintype.card ι
f :
X → ℝ
hf :
MemLp f 2 P
∫⁻ v : ι → X, ofReal ((((Fintype.card ι : ℝ)⁻¹) * ∑ i, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : ι ↦ P)
≤ (Fintype.card ι : ℝ≥0∞)⁻¹ * ofReal ((eLpNorm f 2 P).toReal ^ 2)
Proof (Lean source)
theorem pi_centered_average_sq_lintegral_le {ι X : Type*} [Fintype ι] [MeasurableSpace X] {P : Measure X} [IsProbabilityMeasure P] (hcard : 0 < Fintype.card ι) {f : X → ℝ} (hf : MemLp f 2 P) : ∫⁻ v : ι → X, ofReal ((((Fintype.card ι : ℝ)⁻¹) * ∑ i, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : ι ↦ P) ≤ (Fintype.card ι : ℝ≥0∞)⁻¹ * ofReal ((eLpNorm f 2 P).toReal ^ 2) := by let nE : ENNReal := Fintype.card ι let B : ENNReal := ofReal ((eLpNorm f 2 P).toReal ^ 2) have hnE_ne_zero : nE ≠ 0 := by simp [nE, Nat.ne_of_gt hcard] have hnE_ne_top : nE ≠ ∞ := by simp [nE] have hraw : ∫⁻ v : ι → X, ofReal ((∑ i, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : ι ↦ P) ≤ nE * B := by simpa [nE, B] using (pi_centered_sum_sq_lintegral_le (ι := ι) (X := fun _ : ι ↦ X) (P := fun _ : ι ↦ P) (f := fun _ : ι ↦ f) (fun _ ↦ hf)) have hnR_pos : 0 < (Fintype.card ι : ℝ) := Nat.cast_pos.mpr hcard have hscale : ofReal ((Fintype.card ι : ℝ)⁻¹ ^ 2) = nE⁻¹ ^ 2 := by rw [ENNReal.ofReal_pow (by positivity), ENNReal.ofReal_inv_of_pos hnR_pos] simp [nE] calc ∫⁻ v : ι → X, ofReal ((((Fintype.card ι : ℝ)⁻¹) * ∑ i, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : ι ↦ P) = nE⁻¹ ^ 2 * ∫⁻ v : ι → X, ofReal ((∑ i, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : ι ↦ P) := by rw [← lintegral_const_mul' _ _ (by simp [hnE_ne_zero])] apply lintegral_congr intro v rw [mul_pow, ENNReal.ofReal_mul (sq_nonneg _), hscale] _ ≤ nE⁻¹ ^ 2 * (nE * B) := mul_le_mul_right hraw _ _ = nE⁻¹ * B := by rw [pow_two] calc nE⁻¹ * nE⁻¹ * (nE * B) = nE⁻¹ * ((nE⁻¹ * nE) * B) := by ac_rfl _ = nE⁻¹ * B := by rw [ENNReal.inv_mul_cancel hnE_ne_zero hnE_ne_top, one_mul] _ = (Fintype.card ι : ℝ≥0∞)⁻¹ * ofReal ((eLpNorm f 2 P).toReal ^ 2) := rfl
CausalSmith.Stat.SaPlmCumulantConverse.pi_centered_average_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:116
theorem pi_finset_centered_average_sq_lintegral_le Lemma pi_finset_centered_average_sq_lintegral_le in the paper ↗

Restricting a product sample to a nonempty deterministic finset preserves the inverse-cardinality second-moment bound for a centered average.

Formal statement
X :
n :
I :
hI :
I.Nonempty
f :
X → ℝ
hf :
MemLp f 2 P
C :
hC :
0 ≤ C
hnorm :
eLpNorm f 2 P ≤ ofReal C
∫⁻ v : Fin n → X, ofReal ((((I.card : ℝ)⁻¹) * ∑ i ∈ I, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P)
≤ (I.card : ℝ≥0∞)⁻¹ * ofReal (C ^ 2)
Proof (Lean source)
theorem pi_finset_centered_average_sq_lintegral_le {X : Type*} [MeasurableSpace X] {P : Measure X} [IsProbabilityMeasure P] {n : ℕ} (I : Finset (Fin n)) (hI : I.Nonempty) {f : X → ℝ} (hf : MemLp f 2 P) {C : ℝ} (hC : 0 ≤ C) (hnorm : eLpNorm f 2 P ≤ ofReal C) : ∫⁻ v : Fin n → X, ofReal ((((I.card : ℝ)⁻¹) * ∑ i ∈ I, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P) ≤ (I.card : ℝ≥0∞)⁻¹ * ofReal (C ^ 2) := by let fi : Fin n → X → ℝ := fun i x ↦ if i ∈ I then f x else 0 have hfi : ∀ i, MemLp (fi i) 2 P := by intro i by_cases hi : i ∈ I <;> simp [fi, hi, hf] have hraw := pi_centered_sum_sq_lintegral_le (P := fun _ : Fin n ↦ P) (f := fi) hfi have hsum (v : Fin n → X) : ∑ i, (fi i (v i) - ∫ x, fi i x ∂P) = ∑ i ∈ I, (f (v i) - ∫ x, f x ∂P) := by classical rw [Finset.sum_sub_distrib, Finset.sum_sub_distrib] congr 1 · simpa [fi] using Finset.sum_ite_mem_eq I (fun i ↦ f (v i)) · calc ∑ i, ∫ x, fi i x ∂P = ∑ i, if i ∈ I then ∫ x, f x ∂P else 0 := by apply Finset.sum_congr rfl intro i _ by_cases hmem : i ∈ I <;> simp [fi, hmem] _ = _ := by simpa using Finset.sum_ite_mem_eq I (fun _ : Fin n ↦ ∫ x, f x ∂P) have hrhs : ∑ i : Fin n, ofReal ((eLpNorm (fi i) 2 P).toReal ^ 2) ≤ (I.card : ℝ≥0∞) * ofReal (C ^ 2) := by rw [show ∑ i : Fin n, ofReal ((eLpNorm (fi i) 2 P).toReal ^ 2) = ∑ i ∈ I, ofReal ((eLpNorm f 2 P).toReal ^ 2) by classical calc ∑ i, ofReal ((eLpNorm (fi i) 2 P).toReal ^ 2) = ∑ i, if i ∈ I then ofReal ((eLpNorm f 2 P).toReal ^ 2) else 0 := by apply Finset.sum_congr rfl intro i _ by_cases hmem : i ∈ I <;> simp [fi, hmem] _ = _ := Finset.sum_ite_mem_eq I _] rw [Finset.sum_const, nsmul_eq_mul] gcongr exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hnorm).trans_eq (ENNReal.toReal_ofReal hC) have hraw' : ∫⁻ v : Fin n → X, ofReal ((∑ i ∈ I, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P) ≤ (I.card : ℝ≥0∞) * ofReal (C ^ 2) := by simpa only [hsum] using hraw.trans hrhs let cE : ℝ≥0∞ := I.card have hc0 : cE ≠ 0 := by simp [cE, hI.card_pos.ne'] have hctop : cE ≠ ∞ := by simp [cE] have hcR : 0 < (I.card : ℝ) := Nat.cast_pos.mpr hI.card_pos calc _ = cE⁻¹ ^ 2 * ∫⁻ v : Fin n → X, ofReal ((∑ i ∈ I, (f (v i) - ∫ x, f x ∂P)) ^ 2) ∂Measure.pi (fun _ : Fin n ↦ P) := by rw [← lintegral_const_mul' _ _ (by simp [hc0])] apply lintegral_congr intro v rw [mul_pow, ENNReal.ofReal_mul (sq_nonneg _), ENNReal.ofReal_pow (by positivity), ENNReal.ofReal_inv_of_pos hcR] simp [cE] _ ≤ cE⁻¹ ^ 2 * (cE * ofReal (C ^ 2)) := mul_le_mul_right hraw' _ _ = cE⁻¹ * ofReal (C ^ 2) := by rw [pow_two] calc cE⁻¹ * cE⁻¹ * (cE * ofReal (C ^ 2)) = cE⁻¹ * ((cE⁻¹ * cE) * ofReal (C ^ 2)) := by ac_rfl _ = _ := by rw [ENNReal.inv_mul_cancel hc0 hctop, one_mul] _ = _ := rfl
CausalSmith.Stat.SaPlmCumulantConverse.pi_finset_centered_average_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:164
theorem memLp_two_and_eLpNorm_le_of_sq_lintegral_le

A measurable real function whose squared nonnegative integral is bounded by belongs to and has norm at most C.

Formal statement
Ω :
μ :
f :
Ω → ℝ
hf :
C :
hC :
0 ≤ C
hsq :
∫⁻ ω, ofReal ((f ω) ^ 2) ∂μ ≤ ofReal (C ^ 2)
MemLp f 2 μ ∧ eLpNorm f 2 μ ≤ ofReal C
Proof (Lean source)
theorem memLp_two_and_eLpNorm_le_of_sq_lintegral_le {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) {f : Ω → ℝ} (hf : Measurable f) {C : ℝ} (hC : 0 ≤ C) (hsq : ∫⁻ ω, ofReal ((f ω) ^ 2) ∂μ ≤ ofReal (C ^ 2)) : MemLp f 2 μ ∧ eLpNorm f 2 μ ≤ ofReal C := by have hsq_integrable : Integrable (fun ω ↦ (f ω) ^ 2) μ := by refine ⟨(hf.pow_const 2).aestronglyMeasurable, ?_⟩ rw [hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall fun _ ↦ sq_nonneg _)] exact hsq.trans_lt ENNReal.ofReal_lt_top have hf_mem : MemLp f 2 μ := (memLp_two_iff_integrable_sq hf.aestronglyMeasurable).2 hsq_integrable refine ⟨hf_mem, ?_⟩ have hsq' : ofReal ((eLpNorm f 2 μ).toReal ^ 2) ≤ ofReal (C ^ 2) := by rw [eLpNorm_two_sq_toReal_eq_integral_sq hf_mem] calc ofReal (∫ x, ‖f x‖ ^ 2 ∂μ) = ∫⁻ x, ofReal (‖f x‖ ^ 2) ∂μ := by rw [MeasureTheory.ofReal_integral_eq_lintegral_ofReal] · simpa [Real.norm_eq_abs, sq_abs] using hsq_integrable · exact Filter.Eventually.of_forall fun _ ↦ sq_nonneg _ _ = ∫⁻ x, ofReal ((f x) ^ 2) ∂μ := by apply lintegral_congr intro x rw [Real.norm_eq_abs, sq_abs] _ ≤ ofReal (C ^ 2) := hsq have hreal_sq : (eLpNorm f 2 μ).toReal ^ 2 ≤ C ^ 2 := (ENNReal.ofReal_le_ofReal_iff (sq_nonneg C)).1 hsq' have hreal : (eLpNorm f 2 μ).toReal ≤ C := (sq_le_sq₀ ENNReal.toReal_nonneg hC).1 hreal_sq rw [← ENNReal.ofReal_toReal hf_mem.eLpNorm_ne_top] exact ENNReal.ofReal_le_ofReal hreal
CausalSmith.Stat.SaPlmCumulantConverse.memLp_two_and_eLpNorm_le_of_sq_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:244
theorem tsum_sq_lintegral_le_tsum_lpNorm

Countably many measurable nonnegative coefficient envelopes obey the Minkowski bound when their individual norms have a summable real majorant. This packages the finite-truncation and limit step needed after applying pi_centered_average_sq_lintegral_le coefficient by coefficient.

Formal statement
Ω :
μ :
A :
ℕ → Ω → ℝ
hAmeas :
∀ k, Measurable (A k)
hAsum :
∀ ω, Summable (fun k ↦ A k ω)
b :
ℕ → ℝ
hbnonneg :
∀ k, 0 ≤ b k
hbsum :
hAbound :
∀ k, eLpNorm (A k) 2 μ ≤ ofReal (b k)
∫⁻ ω, ofReal ((∑' k, A k ω) ^ 2) ∂μ ≤ ofReal ((∑' k, b k) ^ 2)
Proof (Lean source)
theorem tsum_sq_lintegral_le_tsum_lpNorm {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) (A : ℕ → Ω → ℝ) (hAmeas : ∀ k, Measurable (A k)) (hAsum : ∀ ω, Summable (fun k ↦ A k ω)) (b : ℕ → ℝ) (hbnonneg : ∀ k, 0 ≤ b k) (hbsum : Summable b) (hAbound : ∀ k, eLpNorm (A k) 2 μ ≤ ofReal (b k)) : ∫⁻ ω, ofReal ((∑' k, A k ω) ^ 2) ∂μ ≤ ofReal ((∑' k, b k) ^ 2) := by let S : ℕ → Ω → ℝ := fun n ↦ ∑ k ∈ range n, A k have hSmeas : ∀ n, Measurable (S n) := by intro n rw [show S n = (fun ω ↦ ∑ k ∈ range n, A k ω) by funext ω simp [S]] exact measurable_sum (range n) fun k _ ↦ hAmeas k have hStendsto : ∀ ω, Tendsto (fun n ↦ S n ω) atTop (𝓝 (∑' k, A k ω)) := by intro ω simpa [S, Finset.sum_apply] using (hAsum ω).hasSum.tendsto_sum_nat have hpartial : ∀ n, eLpNorm (S n) 2 μ ≤ ofReal (∑' k, b k) := by intro n calc eLpNorm (S n) 2 μ = eLpNorm (∑ k ∈ range n, A k) 2 μ := rfl _ ≤ ∑ k ∈ range n, eLpNorm (A k) 2 μ := by exact eLpNorm_sum_le (fun k _ ↦ (hAmeas k).aestronglyMeasurable) (by norm_num) _ ≤ ∑ k ∈ range n, ofReal (b k) := by exact Finset.sum_le_sum fun k _ ↦ hAbound k _ = ofReal (∑ k ∈ range n, b k) := by rw [ENNReal.ofReal_sum_of_nonneg] exact fun k _ ↦ hbnonneg k _ ≤ ofReal (∑' k, b k) := by apply ENNReal.ofReal_le_ofReal exact hbsum.sum_le_tsum (range n) fun k _ ↦ hbnonneg k have hlimnorm : eLpNorm (fun ω ↦ ∑' k, A k ω) 2 μ ≤ ofReal (∑' k, b k) := by refine (MeasureTheory.Lp.eLpNorm_lim_le_liminf_eLpNorm (p := 2) (fun n ↦ (hSmeas n).aestronglyMeasurable) (fun ω ↦ ∑' k, A k ω) ?_).trans ?_ · exact Filter.Eventually.of_forall hStendsto · refine liminf_le_of_le (by isBoundedDefault) fun c hc ↦ ?_ obtain ⟨n, hn⟩ := (hc.and (Filter.Eventually.of_forall hpartial)).exists exact hn.1.trans hn.2 have hsum_b_nonneg : 0 ≤ ∑' k, b k := tsum_nonneg hbnonneg have hlimit_meas : AEStronglyMeasurable (fun ω ↦ ∑' k, A k ω) μ := by exact aestronglyMeasurable_of_tendsto_ae atTop (fun n ↦ (hSmeas n).aestronglyMeasurable) (Filter.Eventually.of_forall hStendsto) have hlimit_mem : MemLp (fun ω ↦ ∑' k, A k ω) 2 μ := ⟨hlimit_meas, hlimnorm.trans_lt ENNReal.ofReal_lt_top⟩ have hlintegral_eq : ∫⁻ ω, ofReal ((∑' k, A k ω) ^ 2) ∂μ = ofReal ((eLpNorm (fun ω ↦ ∑' k, A k ω) 2 μ).toReal ^ 2) := by calc ∫⁻ ω, ofReal ((∑' k, A k ω) ^ 2) ∂μ = ofReal (∫ ω, (∑' k, A k ω) ^ 2 ∂μ) := by rw [MeasureTheory.ofReal_integral_eq_lintegral_ofReal] · exact hlimit_mem.integrable_sq · exact Filter.Eventually.of_forall fun _ ↦ sq_nonneg _ _ = ofReal (∫ ω, ‖∑' k, A k ω‖ ^ 2 ∂μ) := by congr 2 funext ω rw [Real.norm_eq_abs, sq_abs] _ = ofReal ((eLpNorm (fun ω ↦ ∑' k, A k ω) 2 μ).toReal ^ 2) := (eLpNorm_two_sq_toReal_eq_integral_sq hlimit_mem).symm rw [hlintegral_eq] apply ENNReal.ofReal_le_ofReal apply (sq_le_sq₀ ENNReal.toReal_nonneg hsum_b_nonneg).2 exact ENNReal.toReal_mono ENNReal.ofReal_ne_top hlimnorm |>.trans_eq (ENNReal.toReal_ofReal hsum_b_nonneg)
CausalSmith.Stat.SaPlmCumulantConverse.tsum_sq_lintegral_le_tsum_lpNorm · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/Helpers/UniformDiskSeries.lean:282
OpenQuestions 11 declarations Nothing in this file asserts a solution of the open problem.

Recorded local-to-Gaussian open problem

Nothing in this file asserts a solution of the open problem.

def RationalCircle

A rational candidate circle is represented only by its positive radius.

Definition (Lean source)
abbrev RationalCircle := {rho : ℚ // 0 < rho}
CausalSmith.Stat.SaPlmCumulantConverse.RationalCircle · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:21
def libraryOfCircles

The finite deterministic rational-circle library at depth m.

Definition (Lean source)
def libraryOfCircles (m : ℕ) : Finset RationalCircle := (range m).image fun j : ℕ ↦ ⟨((j : ℚ) + 1), by positivity⟩
CausalSmith.Stat.SaPlmCumulantConverse.libraryOfCircles · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:24
def candidateCirclePoint

The point of a candidate circle at a given angle: the circle's rational radius times the complex exponential of that angle, so that letting the angle run from zero to two pi traverses the circle once counterclockwise.

Definition (Lean source)
def candidateCirclePoint (C : RationalCircle) (t : ℝ) : ℂ := (C.1 : ℂ) * exp (t * I)
CausalSmith.Stat.SaPlmCumulantConverse.candidateCirclePoint · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:28
def candidateBoundaryModulus

The boundary modulus of a transform on a candidate circle: the smallest absolute value the transform attains anywhere on the circle of that radius centred at the origin. It is the quantity that must be certified strictly positive before the transform may be used as the denominator of a contour integrand.

Definition (Lean source)
def candidateBoundaryModulus (C : RationalCircle) (Fhat : ℂ → ℂ) : ℝ := sInf ((fun z ↦ ‖Fhat z‖) '' sphere (0 : ℂ) (C.1 : ℝ))
CausalSmith.Stat.SaPlmCumulantConverse.candidateBoundaryModulus · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:34
def candidateEmpiricalF

The denominator in every candidate record is definitionally the actual empirical transform on its stated inference fold.

Definition (Lean source)
def candidateEmpiricalF (p : Parameters) (m : Model (Xspace := Xspace) p) (data : Fin p.n → Obs Xspace) (a : Fin 2) : ℂ → ℂ := empiricalF p m p.n data (inferenceFold p.n a)
CausalSmith.Stat.SaPlmCumulantConverse.candidateEmpiricalF · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:41
def candidateEmpiricalG

The numerator in every candidate record is definitionally the actual outcome-weighted empirical transform on its stated inference fold.

Definition (Lean source)
def candidateEmpiricalG (p : Parameters) (m : Model (Xspace := Xspace) p) (data : Fin p.n → Obs Xspace) (a : Fin 2) : ℂ → ℂ := empiricalG p m p.n data (inferenceFold p.n a)
CausalSmith.Stat.SaPlmCumulantConverse.candidateEmpiricalG · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:47
def candidateWindingIntegrand

The two empirical contour integrands are formed only after a positive boundary-modulus certificate has been supplied.

Definition (Lean source)
def candidateWindingIntegrand (C : RationalCircle) (Fhat : ℂ → ℂ) (_hden : 0 < candidateBoundaryModulus C Fhat) (t : ℝ) : ℂ := candidateCirclePoint C t * deriv Fhat (candidateCirclePoint C t) / Fhat (candidateCirclePoint C t)
CausalSmith.Stat.SaPlmCumulantConverse.candidateWindingIntegrand · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:53
def candidateMomentIntegrand

The contour-moment integrand on a candidate circle: at each angle, the circle point times the value of the numerator transform there, divided by the value of the denominator transform there. It is formed only after the denominator's boundary modulus on that circle has been certified strictly positive, so the ratio is well defined all along the contour.

Definition (Lean source)
def candidateMomentIntegrand (C : RationalCircle) (Fhat Ghat : ℂ → ℂ) (_hden : 0 < candidateBoundaryModulus C Fhat) (t : ℝ) : ℂ := candidateCirclePoint C t * Ghat (candidateCirclePoint C t) / Fhat (candidateCirclePoint C t)
CausalSmith.Stat.SaPlmCumulantConverse.candidateMomentIntegrand · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:60
structure CandidateRecord

Certified candidate data for one actual sample, inference fold, and rational circle. Its values are enclosures, and every soundness field is tied definitionally to empiricalF and empiricalG on inferenceFold; arbitrary transform arguments cannot be supplied. It contains no selector, estimator, risk, coverage, critical-scale, or lower-bound field.

Definition (Lean source)
m :
Model (Xspace := Xspace) p
data :
Fin p.n → Obs Xspace
depth :
hC :
C ∈ libraryOfCircles depth
a :
Fin 2
denominatorPositive :
boundaryModulusEnclosure :
boundaryModulus_sound :
boundaryModulusEnclosure.Contains (candidateBoundaryModulus C (candidateEmpiricalF p m data a))
windingEnclosure :
winding_sound :
windingEnclosure.Contains ((2 * Real.pi : ℂ)⁻¹ * ∫ t in (0 : ℝ)..2 * Real.pi, candidateWindingIntegrand C (candidateEmpiricalF p m data a) denominatorPositive t)
contourMomentEnclosure :
contourMoment_sound :
contourMomentEnclosure.Contains ((2 * Real.pi : ℂ)⁻¹ * ∫ t in (0 : ℝ)..2 * Real.pi, candidateMomentIntegrand C (candidateEmpiricalF p m data a) (candidateEmpiricalG p m data a) denominatorPositive t)
angularVarianceEnclosure :
angularVariance_sound :
angularVarianceEnclosure.Contains (let V := candidateMomentIntegrand C (candidateEmpiricalF p m data a) (candidateEmpiricalG p m data a) denominatorPositive let vbar := (2 * Real.pi : ℂ)⁻¹ * ∫ t in (0 : ℝ)..2 * Real.pi, V t (2 * Real.pi)⁻¹ * ∫ t in (0 : ℝ)..2 * Real.pi, ‖V t - vbar‖ ^ 2)
CausalSmith.Stat.SaPlmCumulantConverse.CandidateRecord · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:70
def candidateRecord

The dependent candidate-data schema computed from the actual empirical contour integrands on a prespecified fold and rational circle.

Definition (Lean source)
-- @node: def:local-gaussian-handle def candidateRecord (p : Parameters) (m : Model (Xspace := Xspace) p) (data : Fin p.n → Obs Xspace) (depth : ℕ) (C : RationalCircle) (hC : C ∈ libraryOfCircles depth) (a : Fin 2) : Type := CandidateRecord p m data depth C hC a
CausalSmith.Stat.SaPlmCumulantConverse.candidateRecord · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:102
def LocalToGaussianFrontier Remark 1 in the paper ↗

The unresolved local-to-Gaussian frontier, recorded as complete descriptive payload rather than an asserted proposition. The paper leaves the sharp-rate functional, uniform-inference criterion, selector, confidence procedure, and matching lower-bound witness undefined.

Definition (Lean source)
-- @node: oeq:local-to-gaussian-frontier def LocalToGaussianFrontier : String := "Open question: for triangular treatment-noise laws with absolute k-th cumulant at least delta_n decreasing to zero under the same supplied code sequences, ask whether there exists a data-driven selector among ordinary DML, finite-order ACE, and global-contour procedures that attains the sharp minimax mean-squared-error rate as a function of n, epsilon_1_n, epsilon_2_n, and delta_n; yields uniformly valid inference across these regimes; and admits a matching local minimax lower bound. Nonassertion: this is a research agenda, not a theorem; the paper defines no unique sharp-rate functional or uniform-inference/coverage criterion and asserts no existential selector, confidence procedure, or matching lower-bound witness. This String is descriptive payload only, contains no witness fields, and is absent from every delivered theorem dependency."
CausalSmith.Stat.SaPlmCumulantConverse.LocalToGaussianFrontier · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/OpenQuestions.lean:110
T1_KnownZeroInstrument 1 declarations Known transform-zero instrument

Known transform-zero instrument

theorem known_zero_instrument Theorem 1 in the paper ↗

Take at least one observation, a model in the broad non-Gaussian class, and a complex point at which the treatment-noise moment generating function vanishes to a known finite order that is at least one. Build the instrument that raises its argument to the power one below that order and multiplies by the exponential of the zero times the argument. Then the instrument is exactly orthogonal to the treatment noise — its mean is zero however the noise is shifted, and its conditional mean given the covariates vanishes almost surely; its covariance with the observable learned residual equals the derivative of that order of the treatment transform at the zero times the treatment-code-error transform there; and whenever that covariance is nonzero the treatment coefficient equals the ratio of the outcome-weighted instrument mean to it.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hn :
1 ≤ n
hclass :
ell :
hell :
1 ≤ ell
z0 :
hz :
treatmentMGF p m z0 = 0
hmult :
(∀ d : ℝ, ∫ o, zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult ((eta p m o + d : ℝ) : ℂ) ∂m.P = 0) ∧
(@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o)))
=ᵐ[m.P] 0 ∧
(∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = iteratedDeriv ell (treatmentMGF p m) z0 * nuisanceMGF p m n z0) ∧
((∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P) ≠ 0 → (m.theta0 : ℂ) = (∫ o, (outcome o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P) / (∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P))
Proof (Lean source)
-- @node: thm:known-zero-instrument theorem known_zero_instrument (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hn : 1 ≤ n) (hclass : NonGaussianClass p n m) (ell : ℕ) (hell : 1 ≤ ell) (z0 : ℂ) (hz : treatmentMGF p m z0 = 0) (hmult : analyticOrderNatAt (treatmentMGF p m) z0 = ell) : (∀ d : ℝ, ∫ o, zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult ((eta p m o + d : ℝ) : ℂ) ∂m.P = 0) ∧ (@condExp (Obs Xspace) ℂ (comap covariate inferInstance) inferInstance _ _ m.P (fun o ↦ zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o))) =ᵐ[m.P] 0 ∧ (∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P = iteratedDeriv ell (treatmentMGF p m) z0 * nuisanceMGF p m n z0) ∧ ((∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P) ≠ 0 → (m.theta0 : ℂ) = (∫ o, (outcome o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P) / (∫ o, (learnedResidual p m n o : ℂ) * zeroInstrument (treatmentMGF p m) z0 ell hell hz hmult (learnedResidual p m n o) ∂m.P)) := by refine ⟨fun d ↦ zeroInstrument_integral_add_eq_zero p m n ell hclass z0 hell hz hmult d, zeroInstrument_condExp_learnedResidual_eq_zero p m n ell hclass z0 hell hz hmult, zeroInstrument_learnedResidual_integral_eq p m n ell hclass z0 hell hz hmult, ?_⟩ intro hne rw [outcome_zeroInstrument_integral_eq_theta_mul p m n ell hclass z0 hell hz hmult] exact (eq_div_iff hne).2 (by ring)
CausalSmith.Stat.SaPlmCumulantConverse.known_zero_instrument · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T1_KnownZeroInstrument.lean:15
T2_ExactContourIdentification 3 declarations Exact contour identification

Exact contour identification

theorem contourBank_rho_pos

Every radius in the fixed translated-dyadic bank is positive.

Formal statement
j :
Fin ((contourBank p pStar).JBase + 1)
0 < (contourBank p pStar).rho j
Proof (Lean source)
lemma contourBank_rho_pos (p : Parameters) (pStar : CertifiedBankInputs p) (j : Fin ((contourBank p pStar).JBase + 1)) : 0 < (contourBank p pStar).rho j := by have hR0 : 0 < zeroRadius p := by rw [← pStar.R0_value] exact lt_of_lt_of_le (by exact_mod_cast pStar.R0Name.lower_pos) pStar.R0Name.lower_le_value simp only [contourBank, CertifiedReal.add, CertifiedReal.ofRat, pStar.R0_value] positivity
CausalSmith.Stat.SaPlmCumulantConverse.contourBank_rho_pos · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T2_ExactContourIdentification.lean:20
theorem weightedTransform_differentiableAt_of_ae_bounded Lemma weightedTransform_differentiableAt_of_ae_bounded in the paper ↗

A weighted exponential transform with bounded measurable weight and argument is complex differentiable everywhere.

Formal statement
Omega :
Type*
W V :
Omega → ℝ
z :
hW :
hV :
CW CV :
hCW :
0 ≤ CW
hCV :
0 ≤ CV
hWbdd :
∀ᵐ o ∂P, |W o| ≤ CW
hVbdd :
∀ᵐ o ∂P, |V o| ≤ CV
Proof (Lean source)
lemma weightedTransform_differentiableAt_of_ae_bounded {Omega : Type*} [MeasurableSpace Omega] (P : Measure Omega) [IsFiniteMeasure P] (W V : Omega → ℝ) (z : ℂ) (hW : Measurable W) (hV : Measurable V) (CW CV : ℝ) (hCW : 0 ≤ CW) (hCV : 0 ≤ CV) (hWbdd : ∀ᵐ o ∂P, |W o| ≤ CW) (hVbdd : ∀ᵐ o ∂P, |V o| ≤ CV) : DifferentiableAt ℂ (weightedTransform P W V) z := by let bound : Omega → ℝ := fun _ ↦ CW * CV * exp ((‖z‖ + 1) * CV) have hbound : Integrable bound P := integrable_const _ have hFint : Integrable (fun o ↦ (W o : ℂ) * exp (z * (V o : ℂ))) P := by apply Integrable.of_bound (by fun_prop) (CW * exp (‖z‖ * CV)) filter_upwards [hWbdd, hVbdd] with o hwo hvo rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_exp] apply mul_le_mul hwo (Real.exp_le_exp.mpr ?_) (Real.exp_pos _).le hCW simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] calc z.re * V o ≤ |z.re * V o| := le_abs_self _ _ = |z.re| * |V o| := abs_mul _ _ _ ≤ ‖z‖ * CV := mul_le_mul (Complex.abs_re_le_norm z) hvo (abs_nonneg _) (norm_nonneg _) refine (hasDerivAt_integral_of_dominated_loc_of_deriv_le (bound := bound) (F := fun w o ↦ (W o : ℂ) * exp (w * (V o : ℂ))) (F' := fun w o ↦ (W o : ℂ) * ((V o : ℂ) * exp (w * (V o : ℂ)))) (Metric.ball_mem_nhds z zero_lt_one) (by filter_upwards; intro w; fun_prop) hFint (by fun_prop) ?_ hbound ?_).2.differentiableAt · filter_upwards [hWbdd, hVbdd] with o hwo hvo intro w hw dsimp [bound] rw [norm_mul, norm_mul, Complex.norm_real, Complex.norm_real, Real.norm_eq_abs, Real.norm_eq_abs, Complex.norm_exp] have hwz : ‖w‖ ≤ ‖z‖ + 1 := by have hdist : ‖w - z‖ < 1 := by simpa [Metric.mem_ball, dist_eq_norm] using hw calc ‖w‖ ≤ ‖w - z‖ + ‖z‖ := by simpa only [sub_add_cancel] using norm_add_le (w - z) z _ ≤ ‖z‖ + 1 := by linarith have hexp : (w * (V o : ℂ)).re ≤ (‖z‖ + 1) * CV := by simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] calc w.re * V o ≤ |w.re * V o| := le_abs_self _ _ = |w.re| * |V o| := abs_mul _ _ _ ≤ ‖w‖ * CV := mul_le_mul (Complex.abs_re_le_norm w) hvo (abs_nonneg _) (norm_nonneg _) _ ≤ (‖z‖ + 1) * CV := mul_le_mul_of_nonneg_right hwz hCV calc |W o| * (|V o| * exp (w * (V o : ℂ)).re) = (|W o| * |V o|) * exp (w * (V o : ℂ)).re := by ring _ ≤ (CW * CV) * exp ((‖z‖ + 1) * CV) := mul_le_mul (mul_le_mul hwo hvo (abs_nonneg _) hCW) (Real.exp_le_exp.mpr hexp) (Real.exp_pos _).le (mul_nonneg hCW hCV) _ = CW * CV * exp ((‖z‖ + 1) * CV) := rfl · filter_upwards [] with o w hw refine ((hasDerivAt_const w (W o : ℂ)).fun_mul ((Complex.hasDerivAt_exp (w * (V o : ℂ))).comp w ((hasDerivAt_id w).mul_const (V o : ℂ)))).congr_deriv ?_ simp only [Function.comp_apply, id_eq, zero_mul, zero_add, one_mul] ring
CausalSmith.Stat.SaPlmCumulantConverse.weightedTransform_differentiableAt_of_ae_bounded · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T2_ExactContourIdentification.lean:32
theorem exact_contour_identification Theorem 2 in the paper ↗

Take at least one observation and a model in the non-Gaussian spectral class. Fix one circle of the certified radius bank and suppose the transform of the observable learned residual has no zero on that circle, the transform of the treatment-code error has no zero anywhere in the closed disk it bounds, and the residual transform does have at least one zero, counted with multiplicity, strictly inside. Then the treatment coefficient is exactly identified by the contour functional built from the residual transform and the outcome-weighted residual transform on that circle, and that functional is the contour integral of the ratio of the two transforms around the circle, divided by the number of enclosed residual zeros times two pi i.

Formal statement
m :
Model (Xspace := Xspace) p
n :
hn :
1 ≤ n
hclass :
j :
Fin ((contourBank p pStar).JBase + 1)
hF :
∀ z ∈ sphere (0 : ℂ) ((contourBank p pStar).rho j), residualMGF p m n z ≠ 0
hH :
∀ z ∈ closedBall (0 : ℂ) ((contourBank p pStar).rho j), nuisanceMGF p m n z ≠ 0
hcount :
1 ≤ zeroMultiplicityCount (residualMGF p m n) 0 ((contourBank p pStar).rho j)
(m.theta0 : ℂ)
= contourFunctional (residualMGF p m n) (outcomeResidualTransform p m n) ((contourBank p pStar).rho j) (contourBank_rho_pos p pStar j) (residualMGF_analyticOn_closedBall p m n hclass ((contourBank p pStar).rho j)) hF hcount ∧
contourFunctional (residualMGF p m n) (outcomeResidualTransform p m n) ((contourBank p pStar).rho j) (contourBank_rho_pos p pStar j) (residualMGF_analyticOn_closedBall p m n hclass ((contourBank p pStar).rho j)) hF hcount
= (contourCount (residualMGF p m n) ((contourBank p pStar).rho j) * (2 * (Real.pi : ℂ) * I))⁻¹ * circleIntegral (fun z ↦ outcomeResidualTransform p m n z / residualMGF p m n z) 0 ((contourBank p pStar).rho j)
Proof (Lean source)
-- @node: thm:exact-contour-identification theorem exact_contour_identification (p : Parameters) (m : Model (Xspace := Xspace) p) (n : ℕ) (hn : 1 ≤ n) (hclass : NonGaussianClass p n m) (pStar : CertifiedBankInputs p) (j : Fin ((contourBank p pStar).JBase + 1)) (hF : ∀ z ∈ sphere (0 : ℂ) ((contourBank p pStar).rho j), residualMGF p m n z ≠ 0) (hH : ∀ z ∈ closedBall (0 : ℂ) ((contourBank p pStar).rho j), nuisanceMGF p m n z ≠ 0) (hcount : 1 ≤ zeroMultiplicityCount (residualMGF p m n) 0 ((contourBank p pStar).rho j)) : (m.theta0 : ℂ) = contourFunctional (residualMGF p m n) (outcomeResidualTransform p m n) ((contourBank p pStar).rho j) (contourBank_rho_pos p pStar j) (residualMGF_analyticOn_closedBall p m n hclass ((contourBank p pStar).rho j)) hF hcount ∧ contourFunctional (residualMGF p m n) (outcomeResidualTransform p m n) ((contourBank p pStar).rho j) (contourBank_rho_pos p pStar j) (residualMGF_analyticOn_closedBall p m n hclass ((contourBank p pStar).rho j)) hF hcount = (contourCount (residualMGF p m n) ((contourBank p pStar).rho j) * (2 * (Real.pi : ℂ) * I))⁻¹ * circleIntegral (fun z ↦ outcomeResidualTransform p m n z / residualMGF p m n z) 0 ((contourBank p pStar).rho j) := by let rho := (contourBank p pStar).rho j have hrho : 0 < rho := contourBank_rho_pos p pStar j let F := residualMGF p m n let G := outcomeResidualTransform p m n let H := nuisanceMGF p m n let B := contaminationTransform p m n let D := treatmentError p m n let b : Obs Xspace → ℝ := fun o ↦ outcomeContamination p m n (covariate o) have hDmeas : Measurable D := by dsimp [D, treatmentError, barG, covariate] exact (m.g0_measurable.comp measurable_fst).sub (((m.gcode_measurable n).comp measurable_fst).max measurable_const |>.min measurable_const) have hbmeas : Measurable b := by dsimp [b] exact (m.q0_measurable.sub (measurable_const.mul (m.g0_measurable.sub (((m.gcode_measurable n).max measurable_const).min measurable_const)))).comp measurable_fst have hDbdd : ∀ᵐ o ∂m.P, |D o| ≤ 2 * p.Cg := by simpa [D] using (l1_nuisance_zero_free p m n hclass).1 have hbar (x : Xspace) : |barG p m n x| ≤ p.Cg := by have hCg : 0 < p.Cg := p.constants_pos.2.1 rw [abs_le] dsimp [barG] constructor <;> simp_all <;> linarith have hbbdd : ∀ᵐ o ∂m.P, |b o| ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by have hcov : Measurable (covariate (Xspace := Xspace)) := measurable_fst have hq := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.qRange have hg := MeasureTheory.ae_of_ae_map hcov.aemeasurable hclass.gRange filter_upwards [hq, hg] with o hqo hgo dsimp [b, outcomeContamination] calc |m.q0 (covariate o) - m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))| ≤ |m.q0 (covariate o)| + |m.theta0| * |m.g0 (covariate o) - barG p m n (covariate o)| := by simpa [abs_mul] using abs_sub (m.q0 (covariate o)) (m.theta0 * (m.g0 (covariate o) - barG p m n (covariate o))) _ ≤ p.Cq + p.Ctheta * (2 * p.Cg) := by apply add_le_add hqo have hmul := mul_le_mul hclass.thetaRange ((abs_sub _ _).trans (add_le_add hgo (hbar (covariate o)))) (abs_nonneg _) p.constants_pos.1.le convert hmul using 1 <;> ring have hDnonneg : 0 ≤ 2 * p.Cg := mul_nonneg (by norm_num) p.constants_pos.2.1.le have hbnonneg : 0 ≤ p.Cq + p.Ctheta * (2 * p.Cg) := add_nonneg p.constants_pos.2.2.1.le (mul_nonneg p.constants_pos.1.le hDnonneg) have hHdiff (z : ℂ) : DifferentiableAt ℂ H z := by have heq : H = weightedTransform m.P (fun _ ↦ 1) D := by funext w simp [H, nuisanceMGF, weightedTransform, complexMGF, D] rw [heq] exact weightedTransform_differentiableAt_of_ae_bounded m.P (fun _ ↦ 1) D z measurable_const hDmeas 1 (2 * p.Cg) zero_le_one hDnonneg (by simp) hDbdd have hBdiff (z : ℂ) : DifferentiableAt ℂ B z := by exact weightedTransform_differentiableAt_of_ae_bounded m.P b D z hbmeas hDmeas (p.Cq + p.Ctheta * (2 * p.Cg)) (2 * p.Cg) hbnonneg hDnonneg hbbdd hDbdd let Q : ℂ → ℂ := fun z ↦ B z / H z have hQdiff (z : ℂ) (hz : z ∈ closedBall (0 : ℂ) rho) : DifferentiableAt ℂ Q z := (hBdiff z).div (hHdiff z) (hH z hz) have hQdc : DiffContOnCl ℂ Q (ball (0 : ℂ) rho) := by constructor · intro z hz exact (hQdiff z (ball_subset_closedBall hz)).differentiableWithinAt · intro z hz exact (hQdiff z (closure_ball_subset_closedBall hz)).continuousAt.continuousWithinAt have hQzero : circleIntegral Q 0 rho = 0 := hQdc.circleIntegral_eq_zero hrho.le have hEntire := residualMGF_analyticOn_closedBall p m n hclass rho have hlogcont : ContinuousOn (logDeriv F) (sphere (0 : ℂ) rho) := by rw [show logDeriv F = fun z ↦ deriv F z / F z by ext z; simp [logDeriv_apply]] exact (hEntire.deriv.continuousOn.mono sphere_subset_closedBall).div (hEntire.continuousOn.mono sphere_subset_closedBall) hF have hlogCI : CircleIntegrable (logDeriv F) 0 rho := hlogcont.circleIntegrable hrho.le have hQCI : CircleIntegrable Q 0 rho := (hQdc.continuousOn_ball.mono sphere_subset_closedBall).circleIntegrable hrho.le have hpoint : EqOn (fun z ↦ G z / F z) (fun z ↦ (m.theta0 : ℂ) * logDeriv F z + Q z) (sphere 0 rho) := by intro z hz have hfac := observable_factorization p m n hclass z have hM : treatmentMGF p m z ≠ 0 := by intro hMz have := hF z hz rw [hfac.1, hMz, zero_mul] at this exact this rfl dsimp [F, G, H, B, Q] rw [logDeriv_apply, hfac.2, hfac.1] field_simp [hF z hz, hH z (sphere_subset_closedBall hz), hM] have hIntegral : circleIntegral (fun z ↦ G z / F z) 0 rho = (m.theta0 : ℂ) * circleIntegral (logDeriv F) 0 rho := by have hthetaCI : CircleIntegrable (fun z ↦ (m.theta0 : ℂ) * logDeriv F z) 0 rho := (continuousOn_const.mul hlogcont).circleIntegrable hrho.le rw [circleIntegral.integral_congr hrho.le hpoint, circleIntegral.integral_add hthetaCI hQCI, circleIntegral.integral_const_mul, hQzero, add_zero] have hap : contourCount F rho = (zeroMultiplicityCount F 0 rho : ℂ) := by exact argumentPrinciple_circle hrho hEntire hF have hN : contourCount F rho ≠ 0 := by rw [hap] exact_mod_cast (Nat.ne_of_gt hcount) have hK : (2 * (Real.pi : ℂ) * I) ≠ 0 := by exact mul_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) Complex.I_ne_zero have hlog : circleIntegral (logDeriv F) 0 rho = contourCount F rho * (2 * (Real.pi : ℂ) * I) := by unfold contourCount normalizedLogDerivCircleIntegral field_simp [hK] constructor · change (m.theta0 : ℂ) = contourFunctional F G rho hrho hEntire hF hcount unfold contourFunctional dsimp [F, G] at hIntegral hlog hN ⊢ rw [hIntegral, hlog] field_simp [hN, hK] · rfl
CausalSmith.Stat.SaPlmCumulantConverse.exact_contour_identification · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T2_ExactContourIdentification.lean:95
T3_AdaptiveRootNMinimax 1 declarations The ordinary statistic and all statistical bounds below are unconditional.

Certified adaptive contour estimator and matched fixed-separation rate

The ordinary statistic and all statistical bounds below are unconditional. Only the final represented-data execution clause is parameterized by a compiled implementation of the bounded certified complex arithmetic record.

theorem adaptive_rootn_minimax Theorem 3 in the paper ↗

Fixed-separation matched minimax MSE and generalized-quantile bounds. The same supplied primitive records are used by the bank, the ordinary Borel statistic, and (conditionally) the represented-data transducer.

Formal statement
r :
delta Ctheta Cg Cq psieta psixi :
hr :
2 ≤ r
hdelta :
0 < delta
hCtheta :
0 < Ctheta
hCg :
0 < Cg
hCq :
0 < Cq
hpsieta :
0 < psieta
hpsixi :
0 < psixi
∃ c C : ℝ,
0 < c ∧
0 < C ∧
∀ {Xspace : Type*} [MeasurableSpace Xspace] (p0 : Parameters),
p0.r
= r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → (fixed : FixedExperimentRecords p0) → ∀ (p : Parameters), (hfixed : SameFixedExperimentConstants p0 p) → ∀ base : Model (Xspace := Xspace) p, let pStarP := fixedBankInput fixed.bank hfixed let cStarP := fixedRangeInput fixed.range hfixed let laws : Set (Model (Xspace := Xspace) p) := {m | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} Measurable (thetaHatSpec (Xspace := Xspace) p pStarP cStarP base.gcode) ∧ (∀ compiled : CompiledBoundedSpectralAdapter, FullCanonicalBuildAndCompilation compiled p pStarP cStarP base.gcode → RepresentedExecution compiled p pStarP cStarP base.gcode) ∧ (∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m → NonGaussianClass p p.n m) ∧ (p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m ↔ AceComparisonSubclass p p.n m) ∧ (IidSampling p.n base.P (iidLaw base p.n) → laws.Nonempty → 2 ≤ p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → ofReal (c / p.n) ≤ minimaxRisk p p.n base.gcode base.qcode ∧ minimaxRisk p p.n base.gcode base.qcode ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n)))) ∧ (let aceLaws : Set (Model (Xspace := Xspace) p) := {m | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}; aceLaws.Nonempty → 2 ≤ p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → ofReal (c / p.n) ≤ minimaxRiskOn p p.n aceLaws ∧ minimaxRiskOn p p.n aceLaws ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n))))
Proof (Lean source)
-- @node: thm:adaptive-rootn-minimax theorem adaptive_rootn_minimax (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ) (hr : 2 ≤ r) (hdelta : 0 < delta) (hCtheta : 0 < Ctheta) (hCg : 0 < Cg) (hCq : 0 < Cq) (hpsieta : 0 < psieta) (hpsixi : 0 < psixi) : ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ ∀ {Xspace : Type*} [MeasurableSpace Xspace] (p0 : Parameters), p0.r = r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → (fixed : FixedExperimentRecords p0) → ∀ (p : Parameters), (hfixed : SameFixedExperimentConstants p0 p) → ∀ base : Model (Xspace := Xspace) p, let pStarP := fixedBankInput fixed.bank hfixed let cStarP := fixedRangeInput fixed.range hfixed let laws : Set (Model (Xspace := Xspace) p) := {m | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} Measurable (thetaHatSpec (Xspace := Xspace) p pStarP cStarP base.gcode) ∧ (∀ compiled : CompiledBoundedSpectralAdapter, FullCanonicalBuildAndCompilation compiled p pStarP cStarP base.gcode → RepresentedExecution compiled p pStarP cStarP base.gcode) ∧ (∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m → NonGaussianClass p p.n m) ∧ (p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m ↔ AceComparisonSubclass p p.n m) ∧ (IidSampling p.n base.P (iidLaw base p.n) → laws.Nonempty → 2 ≤ p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → ofReal (c / p.n) ≤ minimaxRisk p p.n base.gcode base.qcode ∧ minimaxRisk p p.n base.gcode base.qcode ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n)))) ∧ (let aceLaws : Set (Model (Xspace := Xspace) p) := {m | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n}; aceLaws.Nonempty → 2 ≤ p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → ofReal (c / p.n) ≤ minimaxRiskOn p p.n aceLaws ∧ minimaxRiskOn p p.n aceLaws ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) ∧ (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n)))) := by let R1 := Ak (r + 1) * (psieta ^ 2 / delta) ^ (((r + 1 : ℕ) : ℝ) - 2)⁻¹ + 1 let K := empiricalTransformL2Constant Ctheta Cg Cq psieta psixi R1 let C := uniformSelectorRiskConstant Ctheta Cg Cq psieta psixi R1 K obtain ⟨cNG, hcNG, hNG⟩ := fixed_code_non_gaussian_minimax_lower r delta Ctheta Cg Cq psieta psixi hpsixi obtain ⟨cACE, hcACE, hACE⟩ := fixed_code_ace_minimax_lower r delta Ctheta Cg Cq psieta psixi hpsixi refine ⟨min cNG cACE, C, lt_min hcNG hcACE, ?_, ?_⟩ · dsimp [C, uniformSelectorRiskConstant, K] have hR1 : 0 < R1 := by dsimp [R1] have hbase : 0 ≤ psieta ^ 2 / delta := div_nonneg (sq_nonneg _) hdelta.le have hAk : 0 ≤ Ak (r + 1) := by unfold Ak positivity have hrpow : 0 ≤ (psieta ^ 2 / delta) ^ (((r + 1 : ℕ) : ℝ) - 2)⁻¹ := Real.rpow_nonneg hbase _ nlinarith have hK : 0 < K := empiricalTransformL2Constant_pos _ _ _ _ _ _ have ha : 0 < uniformBankA psieta R1 := by dsimp [uniformBankA] positivity positivity intro Xspace inst p0 hp0r hp0delta hp0θ hp0g hp0q hp0η hp0ξ fixed intro p hfixed base dsimp have hpθ : p.Ctheta = Ctheta := hfixed.2.2.1.symm.trans hp0θ have hpg : p.Cg = Cg := hfixed.2.2.2.1.symm.trans hp0g have hpq : p.Cq = Cq := hfixed.2.2.2.2.1.symm.trans hp0q have hpη : p.psieta = psieta := hfixed.2.2.2.2.2.1.symm.trans hp0η have hpξ : p.psixi = psixi := hfixed.2.2.2.2.2.2.symm.trans hp0ξ have hpR : searchRadius p = R1 := by dsimp [R1, searchRadius, zeroRadius] rw [p.k_eq, ← hfixed.1, hp0r, hpη, ← hfixed.2.1, hp0delta] let pStarP := fixedBankInput fixed.bank hfixed let cStarP := fixedRangeInput fixed.range hfixed let laws : Set (Model (Xspace := Xspace) p) := {m | NonGaussianClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} have hmeas : Measurable (thetaHatSpec (Xspace := Xspace) p pStarP cStarP base.gcode) := thetaHatSpec_measurable p pStarP cStarP base.gcode (base.gcode_measurable p.n) have theta_eq_of_barG (m : Model (Xspace := Xspace) p) (hbar : barG p m p.n = barG p base p.n) : (thetaHatSpec p pStarP cStarP base.gcode : (Fin p.n → Obs Xspace) → ℝ) = thetaHatSpec p pStarP cStarP m.gcode := by apply thetaHatSpec_congr_current intro x exact congrFun hbar.symm x have hrels := jms_ace_class_relations (Xspace := Xspace) p p.n have hKpos : 0 < K := empiricalTransformL2Constant_pos _ _ _ _ _ _ have hCpos : 0 < C := by dsimp [C, uniformSelectorRiskConstant] positivity have risk_of_ng (m : Model (Xspace := Xspace) p) (hn : 2 ≤ p.n) (hm : NonGaussianClass p p.n m) (heps : p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹) : mseRisk m p.n (thetaHatSpec p pStarP cStarP m.gcode) ≤ ofReal (C / p.n) := by have hraw := thetaHatSpec_mseRisk_le_explicit Ctheta Cg Cq psieta psixi R1 p hpθ hpg hpq hpη hpξ hpR pStarP cStarP m hn hm (by simp [IidSampling, iidLaw]) heps apply hraw.trans apply ENNReal.ofReal_le_ofReal apply div_le_div_of_nonneg_right _ (by positivity) simpa [C, K, hpθ, hpg, hpq, hpη, hpξ, hpR] using adaptiveSelectorRiskConstant_le_uniform p pStarP K hKpos.le have quantile_of_ng (m : Model (Xspace := Xspace) p) (hn : 2 ≤ p.n) (hm : NonGaussianClass p p.n m) (heps : p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹) : generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP m.gcode data - m.theta0|) ≤ sqrt (C / (p.gamma * p.n)) := by exact thetaHatSpec_generalizedQuantile_le_of_mseRisk_le p pStarP cStarP m (Nat.one_le_iff_ne_zero.mpr (by omega)) C hCpos (risk_of_ng m hn hm heps) refine ⟨hmeas, ?_, hrels.1, hrels.2.2, ?_⟩ · intro compiled hfull exact representedExecution_of_fullCanonicalBuildAndCompilation compiled p pStarP cStarP base.gcode hfull refine ⟨?_, ?_⟩ · intro hiid hlaws hn heps have hlowerNG : ofReal (min cNG cACE / p.n) ≤ minimaxRisk p p.n base.gcode base.qcode := by apply (ENNReal.ofReal_le_ofReal (div_le_div_of_nonneg_right (min_le_left _ _) (by positivity : (0 : ℝ) ≤ p.n))).trans exact hNG p (hfixed.1.symm.trans hp0r) (hfixed.2.1.symm.trans hp0delta) hpθ hpg hpq hpη hpξ base hiid hlaws hn have hrisk (m : Model (Xspace := Xspace) p) (hm : m ∈ laws) : mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ≤ ofReal (C / p.n) := by rw [theta_eq_of_barG m hm.2.1] exact risk_of_ng m hn hm.1 heps have hsupRisk : (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) := by refine iSup_le fun m ↦ iSup_le fun hm ↦ ?_ exact hrisk m hm have hminimax : minimaxRisk p p.n base.gcode base.qcode ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) := by unfold minimaxRisk minimaxRisks minimaxRiskOn exact iInf_le_of_le ⟨_, hmeas⟩ (le_refl _) have hquant (m : Model (Xspace := Xspace) p) (hm : m ∈ laws) : ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|)) ≤ ofReal (sqrt (C / (p.gamma * p.n))) := by have htheta := theta_eq_of_barG m hm.2.1 have hfun : (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|) = (fun data ↦ |thetaHatSpec p pStarP cStarP m.gcode data - m.theta0|) := by funext data exact congrArg (fun f : (Fin p.n → Obs Xspace) → ℝ ↦ |f data - m.theta0|) htheta rw [hfun] exact ENNReal.ofReal_le_ofReal (quantile_of_ng m hn hm.1 heps) have hsupQuant : (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ laws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n))) := by exact iSup_le fun m ↦ iSup_le fun hm ↦ hquant m hm refine ⟨hlowerNG, hminimax, hsupRisk, ?_⟩ exact hsupQuant · intro haceLaws hnAce hepsAce let aceLaws : Set (Model (Xspace := Xspace) p) := {m | JmsAceClass p p.n m ∧ barG p m p.n = barG p base p.n ∧ barQ p m p.n = barQ p base p.n} have hlowerACE : ofReal (min cNG cACE / p.n) ≤ minimaxRiskOn p p.n aceLaws := by apply (ENNReal.ofReal_le_ofReal (div_le_div_of_nonneg_right (min_le_right _ _) (by positivity : (0 : ℝ) ≤ p.n))).trans exact hACE p (hfixed.1.symm.trans hp0r) (hfixed.2.1.symm.trans hp0delta) hpθ hpg hpq hpη hpξ base haceLaws hnAce have haceRisk (m : Model (Xspace := Xspace) p) (hm : m ∈ aceLaws) : mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) ≤ ofReal (C / p.n) := by rw [theta_eq_of_barG m hm.2.1] exact risk_of_ng m hnAce (hrels.1 m hm.1) hepsAce have haceSup : (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode)) ≤ ofReal (C / p.n) := iSup_le fun m ↦ iSup_le fun hm ↦ haceRisk m hm have haceMinimax : minimaxRiskOn p p.n aceLaws ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), mseRisk m p.n (thetaHatSpec p pStarP cStarP base.gcode) := by unfold minimaxRiskOn exact iInf_le_of_le ⟨_, hmeas⟩ (le_refl _) have haceQuant : (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : m ∈ aceLaws), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|))) ≤ ofReal (sqrt (C / (p.gamma * p.n))) := by refine iSup_le fun m ↦ iSup_le fun hm ↦ ?_ have htheta := theta_eq_of_barG m hm.2.1 have hfun : (fun data ↦ |thetaHatSpec p pStarP cStarP base.gcode data - m.theta0|) = (fun data ↦ |thetaHatSpec p pStarP cStarP m.gcode data - m.theta0|) := by funext data exact congrArg (fun f : (Fin p.n → Obs Xspace) → ℝ ↦ |f data - m.theta0|) htheta rw [hfun] exact ENNReal.ofReal_le_ofReal (quantile_of_ng m hnAce (hrels.1 m hm.1) hepsAce) refine ⟨hlowerACE, haceMinimax, haceSup, ?_⟩ exact haceQuant
CausalSmith.Stat.SaPlmCumulantConverse.adaptive_rootn_minimax · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T3_AdaptiveRootNMinimax.lean:151
T4_JmsAceAlignment 5 declarations Alignment with the published finite-order ACE class

Alignment with the published finite-order ACE class

def withEps2Floor

The same parameter block with the second nuisance-accuracy sequence raised to a floor: each of its terms is replaced by the larger of the original term and the fixed level t, leaving every other constant untouched.

Definition (Lean source)
def Parameters.withEps2Floor (p : Parameters) (t : ℝ) : Parameters where __ := p eps2n := fun n ↦ max (p.eps2n n) t eps2_nonneg := fun n hn ↦ le_max_of_le_left (p.eps2_nonneg n hn) eps2_antitone := fun _ _ ha hab ↦ max_le_max_right t (p.eps2_antitone ha hab)
CausalSmith.Stat.SaPlmCumulantConverse.Parameters.withEps2Floor · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T4_JmsAceAlignment.lean:17
def reparam

The same data-generating law, the same treatment and outcome regressions and the same supplied code sequences, read as a model indexed by a different parameter block. Nothing about the distribution changes; only the block of constants attached to it is relabelled.

Definition (Lean source)
def Model.reparam {Xspace : Type*} [MeasurableSpace Xspace] {p : Parameters} (q : Parameters) (m : Model (Xspace := Xspace) p) : Model (Xspace := Xspace) q where __ := m
CausalSmith.Stat.SaPlmCumulantConverse.Model.reparam · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T4_JmsAceAlignment.lean:30

For a nonnegative constant, a strictly positive scale and a sample size of at least one, the square root of the constant divided by the scale times the sample size equals the square root of the constant over the scale, multiplied by the sample size raised to the power −1/2 — the parametric-rate factor is split off from the constant.

Formal statement
C gamma :
n :
hC :
0 ≤ C
hgamma :
0 < gamma
hn :
1 ≤ n
sqrt (C / (gamma * n)) = sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ)
Proof (Lean source)
lemma sqrt_div_nat_eq_scale (C gamma : ℝ) (n : ℕ) (hC : 0 ≤ C) (hgamma : 0 < gamma) (hn : 1 ≤ n) : sqrt (C / (gamma * n)) = sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) := by rw [show C / (gamma * n) = (C / gamma) * (n : ℝ)⁻¹ by field_simp] rw [Real.sqrt_mul (div_nonneg hC hgamma.le)] rw [Real.sqrt_inv, Real.sqrt_eq_rpow, Real.sqrt_eq_rpow] rw [← Real.rpow_neg (by positivity)] congr 2 norm_num
CausalSmith.Stat.SaPlmCumulantConverse.sqrt_div_nat_eq_scale · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T4_JmsAceAlignment.lean:39
theorem tendsto_sqrt_div_over_of_dominates Lemma tendsto_sqrt_div_over_of_dominates in the paper ↗

With a nonnegative constant, a strictly positive scale and a strictly positive multiplier, if one sequence grows strictly faster than the parametric rate, in the sense that its ratio to the sample size raised to the power −1/2 diverges, and a second sequence eventually dominates the multiplier times the first, then the ratio of the parametric-rate quantity, the square root of the constant over the scale times the sample size, to the second sequence tends to zero.

Formal statement
C gamma K :
S B :
ℕ → ℝ
hC :
0 ≤ C
hgamma :
0 < gamma
hK :
0 < K
hS :
Tendsto (fun n : ℕ ↦ S n / (n : ℝ) ^ (-1 / 2 : ℝ)) atTop atTop
hB :
∀ᶠ n in atTop, K * S n ≤ B n
Tendsto (fun n : ℕ ↦ sqrt (C / (gamma * n)) / B n) atTop (nhds 0)
Proof (Lean source)
lemma tendsto_sqrt_div_over_of_dominates (C gamma K : ℝ) (S B : ℕ → ℝ) (hC : 0 ≤ C) (hgamma : 0 < gamma) (hK : 0 < K) (hS : Tendsto (fun n : ℕ ↦ S n / (n : ℝ) ^ (-1 / 2 : ℝ)) atTop atTop) (hB : ∀ᶠ n in atTop, K * S n ≤ B n) : Tendsto (fun n : ℕ ↦ sqrt (C / (gamma * n)) / B n) atTop (nhds 0) := by have hscale : ∀ᶠ n : ℕ in atTop, 0 < (n : ℝ) ^ (-1 / 2 : ℝ) := by filter_upwards [Filter.eventually_ge_atTop (1 : ℕ)] with n hn positivity have hratio : ∀ᶠ n : ℕ in atTop, 0 < S n / (n : ℝ) ^ (-1 / 2 : ℝ) := hS.eventually (Filter.eventually_gt_atTop (0 : ℝ)) have hSinv : Tendsto (fun n : ℕ ↦ (S n / (n : ℝ) ^ (-1 / 2 : ℝ))⁻¹) atTop (nhds 0) := (tendsto_inv_atTop_nhdsGT_zero.comp hS).mono_right inf_le_left have hupper : Tendsto (fun n : ℕ ↦ (sqrt (C / gamma) / K) * (S n / (n : ℝ) ^ (-1 / 2 : ℝ))⁻¹) atTop (nhds 0) := by simpa using (tendsto_const_nhds.mul hSinv) refine squeeze_zero' ?_ ?_ hupper · filter_upwards [hscale, hratio, hB] with n hnscale hnratio hnB have hSpos : 0 < S n := (div_pos_iff.mp hnratio).elim (fun h ↦ h.1) (fun h ↦ elim ((not_lt_of_ge hnscale.le) h.2)) have hBpos : 0 < B n := lt_of_lt_of_le (mul_pos hK hSpos) hnB exact div_nonneg (Real.sqrt_nonneg _) hBpos.le · filter_upwards [Filter.eventually_ge_atTop (1 : ℕ), hscale, hratio, hB] with n hn hnscale hnratio hnB have hSpos : 0 < S n := (div_pos_iff.mp hnratio).elim (fun h ↦ h.1) (fun h ↦ elim ((not_lt_of_ge hnscale.le) h.2)) rw [sqrt_div_nat_eq_scale C gamma n hC hgamma hn] have hnum : 0 ≤ sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) := mul_nonneg (Real.sqrt_nonneg _) hnscale.le have hdiv : sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) / B n ≤ sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) / (K * S n) := div_le_div_of_nonneg_left hnum (mul_pos hK hSpos) hnB calc sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) / B n ≤ sqrt (C / gamma) * (n : ℝ) ^ (-1 / 2 : ℝ) / (K * S n) := hdiv _ = (sqrt (C / gamma) / K) * (S n / (n : ℝ) ^ (-1 / 2 : ℝ))⁻¹ := by field_simp
CausalSmith.Stat.SaPlmCumulantConverse.tendsto_sqrt_div_over_of_dominates · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T4_JmsAceAlignment.lean:55
theorem jms_ace_alignment Proposition 1 in the paper ↗

The paper's spectral estimator and the published finite-order ACE procedure are put on a common footing, and the spectral guarantee eventually dominates. Fix an expansion order of at least two, a positive cumulant separation and positive bounds on the treatment effect, the two regressions and the two sub-Gaussian scales; then there is a positive constant, depending only on those inputs, such that for any published order-r ACE procedure enjoying its cited generalized-quantile guarantee at an overlap exponent strictly between one half and one: the published ACE class is contained in the paper's non-Gaussian class and contains the comparison subclass, and coincides with that subclass when the smoothness index equals the expansion order; the published estimator's generalized-quantile error over the published class is at most the cited finite-order ACE bound; the spectral estimator's worst-case generalized-quantile error over the same class is at most the square root of that constant divided by the overlap exponent times the sample size; and along any sequence of parameter blocks that keeps the fixed constants and whose ACE leading term outgrows the parametric rate, the ratio of the spectral guarantee to the published bound tends to zero.

Formal statement
∀ (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ),
2
≤ r → 0 < delta → 0 < Ctheta → 0 < Cg → 0 < Cq → 0 < psieta → 0 < psixi → ∃ Cspec : ℝ, 0 < Cspec ∧ ∀ {Xspace : Type u} [MeasurableSpace Xspace], ∀ (published : PublishedAceHandle Xspace), ∀ (gamma : ℝ), gamma ∈ Ioo (1 / 2 : ℝ) 1 → ∀ Cgamma : ℝ, JmsAceQuantileUpper published gamma Cgamma → ∀ (p0 : Parameters), p0.r = r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → p0.gamma = gamma → ∀ fixed : FixedExperimentRecords p0, ∀ (p : Parameters) (hfixed : SameFixedExperimentConstants p0 p), p.gamma = gamma → let pStarP := fixedBankInput fixed.bank hfixed let cStarP := fixedRangeInput fixed.range hfixed ∀ (gcode qcode : ℕ → Xspace → ℝ), (∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m → NonGaussianClass p p.n m) ∧ (∀ m : Model (Xspace := Xspace) p, AceComparisonSubclass p p.n m → JmsAceClass p p.n m) ∧ (p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, (JmsAceClass p p.n m ↔ AceComparisonSubclass p p.n m)) ∧ (∀ m : Model (Xspace := Xspace) p, barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClass p p.n m → jmsEligible p p.n → 0 < p.eps1n p.n → 0 ≤ p.eps2n p.n → generalizedQuantile p p.n m (fun data ↦ |published.estimator p.r p.n gcode qcode data - m.theta0|) ≤ jmsBound p p.n Cgamma p.delta) ∧ ((∃ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n) → 2 ≤ p.n → jmsEligible p p.n → 0 < p.eps1n p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : JmsAceClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP gcode data - m.theta0|))) ≤ ofReal (sqrt (Cspec / (p.gamma * p.n)))) ∧ (∀ (pSeq : ℕ → Parameters) (gcode qcode : ℕ → Xspace → ℝ), (∀ n, 1 ≤ n → (pSeq n).n = n ∧ SameFixedExperimentConstants p0 (pSeq n) ∧ (pSeq n).eps1n = p0.eps1n ∧ (pSeq n).eps2n = p0.eps2n ∧ (pSeq n).r = r ∧ (pSeq n).delta = delta ∧ (pSeq n).Ctheta = Ctheta ∧ (pSeq n).Cg = Cg ∧ (pSeq n).Cq = Cq ∧ (pSeq n).psieta = psieta ∧ (pSeq n).psixi = psixi ∧ (pSeq n).gamma = gamma) → (∀ᶠ n in atTop, 2 ≤ n ∧ jmsEligible (pSeq n) n ∧ 0 < (pSeq n).eps1n n ∧ 0 ≤ (pSeq n).eps2n n ∧ (pSeq n).eps1n n ≤ (4 * searchRadius (pSeq n) * exp (2 * (pSeq n).Cg * searchRadius (pSeq n)))⁻¹ ∧ (∃ m : Model (Xspace := Xspace) (pSeq n), JmsAceClass (pSeq n) n m ∧ barG (pSeq n) m n = clippedTreatmentCode (pSeq n) gcode n ∧ barQ (pSeq n) m n = clippedOutcomeCode (pSeq n) qcode n)) → Tendsto (fun n : ℕ ↦ ((pSeq n).eps1n n ^ r * (pSeq n).eps2n n + Ctheta * (pSeq n).eps1n n ^ (r + 1)) / (n : ℝ) ^ (-1 / 2 : ℝ)) atTop atTopTendsto (fun n : ℕ ↦ sqrt (Cspec / (gamma * n)) / jmsBound (pSeq n) n Cgamma delta) atTop (nhds 0))
Proof (Lean source)
-- @node: prop:jms-ace-alignment theorem jms_ace_alignment : ∀ (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ), 2 ≤ r → 0 < delta → 0 < Ctheta → 0 < Cg → 0 < Cq → 0 < psieta → 0 < psixi → ∃ Cspec : ℝ, 0 < Cspec ∧ ∀ {Xspace : Type u} [MeasurableSpace Xspace], ∀ (published : PublishedAceHandle Xspace), ∀ (gamma : ℝ), gamma ∈ Ioo (1 / 2 : ℝ) 1 → ∀ Cgamma : ℝ, JmsAceQuantileUpper published gamma Cgamma → ∀ (p0 : Parameters), p0.r = r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → p0.gamma = gamma → ∀ fixed : FixedExperimentRecords p0, ∀ (p : Parameters) (hfixed : SameFixedExperimentConstants p0 p), p.gamma = gamma → let pStarP := fixedBankInput fixed.bank hfixed let cStarP := fixedRangeInput fixed.range hfixed ∀ (gcode qcode : ℕ → Xspace → ℝ), (∀ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m → NonGaussianClass p p.n m) ∧ (∀ m : Model (Xspace := Xspace) p, AceComparisonSubclass p p.n m → JmsAceClass p p.n m) ∧ (p.s = (p.r : ENNReal) → ∀ m : Model (Xspace := Xspace) p, (JmsAceClass p p.n m ↔ AceComparisonSubclass p p.n m)) ∧ (∀ m : Model (Xspace := Xspace) p, barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClass p p.n m → jmsEligible p p.n → 0 < p.eps1n p.n → 0 ≤ p.eps2n p.n → generalizedQuantile p p.n m (fun data ↦ |published.estimator p.r p.n gcode qcode data - m.theta0|) ≤ jmsBound p p.n Cgamma p.delta) ∧ ((∃ m : Model (Xspace := Xspace) p, JmsAceClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n) → 2 ≤ p.n → jmsEligible p p.n → 0 < p.eps1n p.n → p.eps1n p.n ≤ (4 * searchRadius p * exp (2 * p.Cg * searchRadius p))⁻¹ → (⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : JmsAceClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n), ofReal (generalizedQuantile p p.n m (fun data ↦ |thetaHatSpec p pStarP cStarP gcode data - m.theta0|))) ≤ ofReal (sqrt (Cspec / (p.gamma * p.n)))) ∧ (∀ (pSeq : ℕ → Parameters) (gcode qcode : ℕ → Xspace → ℝ), (∀ n, 1 ≤ n → (pSeq n).n = n ∧ SameFixedExperimentConstants p0 (pSeq n) ∧ (pSeq n).eps1n = p0.eps1n ∧ (pSeq n).eps2n = p0.eps2n ∧ (pSeq n).r = r ∧ (pSeq n).delta = delta ∧ (pSeq n).Ctheta = Ctheta ∧ (pSeq n).Cg = Cg ∧ (pSeq n).Cq = Cq ∧ (pSeq n).psieta = psieta ∧ (pSeq n).psixi = psixi ∧ (pSeq n).gamma = gamma) → (∀ᶠ n in atTop, 2 ≤ n ∧ jmsEligible (pSeq n) n ∧ 0 < (pSeq n).eps1n n ∧ 0 ≤ (pSeq n).eps2n n ∧ (pSeq n).eps1n n ≤ (4 * searchRadius (pSeq n) * exp (2 * (pSeq n).Cg * searchRadius (pSeq n)))⁻¹ ∧ (∃ m : Model (Xspace := Xspace) (pSeq n), JmsAceClass (pSeq n) n m ∧ barG (pSeq n) m n = clippedTreatmentCode (pSeq n) gcode n ∧ barQ (pSeq n) m n = clippedOutcomeCode (pSeq n) qcode n)) → Tendsto (fun n : ℕ ↦ ((pSeq n).eps1n n ^ r * (pSeq n).eps2n n + Ctheta * (pSeq n).eps1n n ^ (r + 1)) / (n : ℝ) ^ (-1 / 2 : ℝ)) atTop atTopTendsto (fun n : ℕ ↦ sqrt (Cspec / (gamma * n)) / jmsBound (pSeq n) n Cgamma delta) atTop (nhds 0)) := by intro r delta Ctheta Cg Cq psieta psixi hr hdelta hCtheta hCg hCq hpsieta hpsixi obtain ⟨c, Cspec, hc, hCspec, hspectral⟩ := adaptive_rootn_minimax r delta Ctheta Cg Cq psieta psixi hr hdelta hCtheta hCg hCq hpsieta hpsixi refine ⟨Cspec, hCspec, ?_⟩ intro Xspace inst published gamma hgamma Cgamma hJms p0 hp0r hp0delta hp0Ctheta hp0Cg hp0Cq hp0psieta hp0psixi hp0gamma fixed have hspectralFixed := hspectral (Xspace := Xspace) p0 hp0r hp0delta hp0Ctheta hp0Cg hp0Cq hp0psieta hp0psixi fixed intro p hfixed hpgamma dsimp intro gcode qcode have hrels := jms_ace_class_relations (Xspace := Xspace) p p.n refine ⟨hrels.1, hrels.2.1, hrels.2.2, ?_, ?_, ?_⟩ · intro m hmg hmq hm hEligible heps1 heps2 by_cases heps2pos : 0 < p.eps2n p.n · exact hJms.2 p hpgamma heps1 heps2pos gcode qcode m hmg hmq hm hEligible · have heps2zero : p.eps2n p.n = 0 := le_antisymm (not_lt.mp heps2pos) heps2 have hboundary : generalizedQuantile p p.n m (fun data ↦ |published.estimator p.r p.n gcode qcode data - m.theta0|) ≤ jmsBound p p.n Cgamma p.delta := by apply le_of_forall_gt_imp_ge_of_dense intro upper hupper let A : ℝ := Cgamma * p.r.factorial * 16 ^ p.r * p.delta⁻¹ * (p.eps1n p.n) ^ p.r have hA : 0 < A := by have hCgamma : 0 < Cgamma := hJms.1 have hdelta : 0 < p.delta := p.constants_pos.2.2.2.2.2.1 dsimp [A] positivity let t : ℝ := min (p.eps1n p.n / 2) ((upper - jmsBound p p.n Cgamma p.delta) / (2 * A)) have ht : 0 < t := by have hgap : 0 < upper - jmsBound p p.n Cgamma p.delta := sub_pos.mpr hupper dsimp [t] positivity have ht_lt_eps1 : t < p.eps1n p.n := by calc t ≤ p.eps1n p.n / 2 := min_le_left _ _ _ < p.eps1n p.n := by linarith let p' := p.withEps2Floor t let m' : Model (Xspace := Xspace) p' := m.reparam p' have hp'gamma : p'.gamma = gamma := hpgamma have hp'eps1 : 0 < p'.eps1n p'.n := heps1 have hp'eps2 : 0 < p'.eps2n p'.n := by simp [p', Parameters.withEps2Floor, heps2zero, ht] have hm' : JmsAceClass p' p'.n m' := by refine { n_pos := hm.n_pos independentTreatmentNoise := ?_ outcomeMeanIndependence := ?_ thetaRange := ?_ gRange := ?_ qRange := ?_ etaSubGaussian := ?_ xiSubGaussian := ?_ cumulantSeparation := ?_ treatmentCodeRadiusLr := ?_ outcomeCodeRadiusLr := ?_ } all_goals try first | exact hm.independentTreatmentNoise | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.independentTreatmentNoise all_goals try first | exact hm.outcomeMeanIndependence | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.outcomeMeanIndependence all_goals try first | exact hm.thetaRange | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.thetaRange all_goals try first | exact hm.gRange | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.gRange all_goals try first | exact hm.qRange | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.qRange all_goals try first | exact hm.etaSubGaussian | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.etaSubGaussian all_goals try first | exact hm.xiSubGaussian | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.xiSubGaussian all_goals try first | exact hm.cumulantSeparation | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.cumulantSeparation all_goals try first | exact hm.treatmentCodeRadiusLr | simpa [p', m', Parameters.withEps2Floor, Model.reparam] using hm.treatmentCodeRadiusLr unfold OutcomeCodeRadiusLrAt have hbase : eLpNorm (fun x ↦ barQ p' m' p'.n x - m'.q0 x) (p'.r : ENNReal) (covariateLaw p' m') ≤ ofReal (p.eps2n p.n) := by exact hm.outcomeCodeRadiusLr exact hbase.trans (ENNReal.ofReal_le_ofReal (le_max_left _ _)) have hEligible' : jmsEligible p' p'.n := by have hmax (x : ℝ) : max (p.eps1n p.n) (max (max 0 t) x) = max (p.eps1n p.n) (max 0 x) := by rw [max_eq_right ht.le, ← max_assoc, max_eq_left ht_lt_eps1.le, ← max_assoc, max_eq_left heps1.le] simpa [jmsEligible, jmsEligibleAt, jmsA1, jmsB1, jmsA2, jmsB2, p', Parameters.withEps2Floor, heps2zero, hmax] using hEligible have hbound := hJms.2 p' hp'gamma hp'eps1 hp'eps2 gcode qcode m' (by exact hmg) (by exact hmq) hm' hEligible' have hquantile : generalizedQuantile p p.n m (fun data ↦ |published.estimator p.r p.n gcode qcode data - m.theta0|) = generalizedQuantile p' p'.n m' (fun data ↦ |published.estimator p'.r p'.n gcode qcode data - m'.theta0|) := by rfl rw [hquantile] exact hbound.trans (by have ht_gap : t ≤ (upper - jmsBound p p.n Cgamma p.delta) / (2 * A) := by exact min_le_right _ _ have hAt : A * t ≤ (upper - jmsBound p p.n Cgamma p.delta) / 2 := by calc A * t ≤ A * ((upper - jmsBound p p.n Cgamma p.delta) / (2 * A)) := mul_le_mul_of_nonneg_left ht_gap hA.le _ = (upper - jmsBound p p.n Cgamma p.delta) / 2 := by field_simp [hA.ne'] have hbound_eq : jmsBound p' p'.n Cgamma p'.delta = jmsBound p p.n Cgamma p.delta + A * t := by dsimp [jmsBound, p', Parameters.withEps2Floor, A] rw [heps2zero, max_eq_right ht.le] ring rw [hbound_eq] linarith) exact hboundary · rintro ⟨m, hm, hmg, hmq⟩ hn _hEligible _heps1 heps have hgclip : clippedTreatmentCode p gcode p.n = clippedTreatmentCode p m.gcode p.n := by exact hmg.symm -- … truncated; follow the source link for the rest …
CausalSmith.Stat.SaPlmCumulantConverse.jms_ace_alignment · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T4_JmsAceAlignment.lean:109
T5_CommonExperimentDichotomy 4 declarations Separate common-experiment conclusions

Separate common-experiment conclusions

def compiledSpectralProgram

Compatibility name for the represented wrapper now defined beside the single option-A adapter.

Definition (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.compiledSpectralProgram · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T5_CommonExperimentDichotomy.lean:16

A compiled implementation of the bounded spectral adapter is a faithful execution of the estimator built from the given parameter block, certified primitive records, certified range record, and treatment-regression code: everything the compiled build reports agrees with what the estimator's own specification demands.

Definition (Lean source)
abbrev CompiledRepresentedExecution {Xspace : Type*} [MeasurableSpace Xspace] (compiled : CompiledBoundedSpectralAdapter) (p : Parameters) (pStar : CertifiedBankInputs p) (cStar : CertifiedRangeInput p) (gcode : ℕ → Xspace → ℝ) : Prop := RepresentedExecution compiled p pStar cStar gcode
CausalSmith.Stat.SaPlmCumulantConverse.CompiledRepresentedExecution · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T5_CommonExperimentDichotomy.lean:22
theorem compiledSpectralProgram_eq_instrumented

Running the contour-selection program through a compiled implementation of the bounded adapter returns exactly the same outcome — reported value, execution trace, selected contour, decoded winding number, and enclosure — as the reference instrumented program, so the choice of compiled build never changes what the estimator reports.

Formal statement
Proof (Lean source)
CausalSmith.Stat.SaPlmCumulantConverse.compiledSpectralProgram_eq_instrumented · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T5_CommonExperimentDichotomy.lean:35
theorem common_experiment_dichotomy Theorem 4 in the paper ↗

Fix the experiment-wide constants of the partially linear design: a cumulant order of at least two, a strictly positive cumulant-separation constant, a strictly positive range bound for the treatment coefficient, strictly positive uniform bounds for the treatment and outcome regressions, and strictly positive sub-Gaussian scales for the treatment noise and the outcome noise. Then the same experiment splits into two sharply different halves: on the non-Gaussian class a single pair of positive constants c and C bounds the minimax mean squared error between c/n and C/n along every sequence of sample sizes that carries these constants, the assembled estimator is Borel measurable, attains the C/n upper bound over that class, is executed faithfully by every compiled build, and is read off a contour bank that never changes with the sample size; whereas on the simultaneous bounded-outcome Gaussian class the treatment coefficient is forced to be zero, so both the Gaussian minimax mean squared error and the Gaussian minimax generalized-quantile error vanish identically.

Formal statement
r :
delta Ctheta Cg Cq psieta psixi :
hr :
2 ≤ r
hdelta :
0 < delta
hCtheta :
0 < Ctheta
hCg :
0 < Cg
hCq :
0 < Cq
hpsieta :
0 < psieta
hpsixi :
0 < psixi
∀ {Xspace : Type*} [MeasurableSpace Xspace],
(∀ (p0 : Parameters), p0.r = r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → (fixed : FixedExperimentRecords p0) → ∀ (pSeq : ℕ → Parameters) (gcode qcode : ℕ → Xspace → ℝ) (eps1 eps2 : ℕ → ℝ), (∀ j, Measurable (gcode j)) → (∀ j, Measurable (qcode j)) → (hfixed : ∀ j, SameFixedExperimentConstants p0 (pSeq j) ∧ (pSeq j).eps1n = eps1 ∧ (pSeq j).eps2n = eps2) → Tendsto (fun j ↦ (pSeq j).n) atTop atTop → (∀ᶠ j in atTop, ({m : Model (Xspace := Xspace) (pSeq j) | NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n}).Nonempty ∧ 2 ≤ (pSeq j).n ∧ (pSeq j).eps1n (pSeq j).n ≤ (4 * searchRadius (pSeq j) * exp (2 * (pSeq j).Cg * searchRadius (pSeq j)))⁻¹) → ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ let B := contourBank p0 fixed.bank ∀ᶠ j in atTop, let pStarj := fixedBankInput fixed.bank (hfixed j).1 let cStarj := fixedRangeInput fixed.range (hfixed j).1 contourBank (pSeq j) pStarj = B ∧ ofReal (c / (pSeq j).n) ≤ minimaxRisk (pSeq j) (pSeq j).n gcode qcode ∧ minimaxRisk (pSeq j) (pSeq j).n gcode qcode ≤ ofReal (C / (pSeq j).n) ∧ Measurable (thetaHatSpec (pSeq j) pStarj cStarj gcode) ∧ (∀ compiled : CompiledBoundedSpectralAdapter, FullCanonicalBuildAndCompilation compiled (pSeq j) pStarj cStarj gcode → CompiledRepresentedExecution compiled (pSeq j) pStarj cStarj gcode) ∧ (⨆ m : Model (Xspace := Xspace) (pSeq j), ⨆ (_ : NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n), mseRisk m (pSeq j).n (thetaHatSpec (pSeq j) pStarj cStarj gcode)) ≤ ofReal (C / (pSeq j).n)) ∧
(∀ (p : Parameters) (m : Model (Xspace := Xspace) p), GaussianClass p p.n m → m.theta0 = 0) ∧
(∀ (p : Parameters) (gcode qcode : ℕ → Xspace → ℝ), (∀ j, Measurable (gcode j)) → (∀ j, Measurable (qcode j)) → ({m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n}).Nonempty → minimaxRiskG (Xspace := Xspace) p p.n gcode qcode = 0 ∧ minimaxQuantileRiskG (Xspace := Xspace) p p.n gcode qcode = 0)
Proof (Lean source)
-- @node: thm:common-experiment-dichotomy theorem common_experiment_dichotomy (r : ℕ) (delta Ctheta Cg Cq psieta psixi : ℝ) (hr : 2 ≤ r) (hdelta : 0 < delta) (hCtheta : 0 < Ctheta) (hCg : 0 < Cg) (hCq : 0 < Cq) (hpsieta : 0 < psieta) (hpsixi : 0 < psixi) : ∀ {Xspace : Type*} [MeasurableSpace Xspace], (∀ (p0 : Parameters), p0.r = r → p0.delta = delta → p0.Ctheta = Ctheta → p0.Cg = Cg → p0.Cq = Cq → p0.psieta = psieta → p0.psixi = psixi → (fixed : FixedExperimentRecords p0) → ∀ (pSeq : ℕ → Parameters) (gcode qcode : ℕ → Xspace → ℝ) (eps1 eps2 : ℕ → ℝ), (∀ j, Measurable (gcode j)) → (∀ j, Measurable (qcode j)) → (hfixed : ∀ j, SameFixedExperimentConstants p0 (pSeq j) ∧ (pSeq j).eps1n = eps1 ∧ (pSeq j).eps2n = eps2) → Tendsto (fun j ↦ (pSeq j).n) atTop atTop → (∀ᶠ j in atTop, ({m : Model (Xspace := Xspace) (pSeq j) | NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n}).Nonempty ∧ 2 ≤ (pSeq j).n ∧ (pSeq j).eps1n (pSeq j).n ≤ (4 * searchRadius (pSeq j) * exp (2 * (pSeq j).Cg * searchRadius (pSeq j)))⁻¹) → ∃ c C : ℝ, 0 < c ∧ 0 < C ∧ let B := contourBank p0 fixed.bank ∀ᶠ j in atTop, let pStarj := fixedBankInput fixed.bank (hfixed j).1 let cStarj := fixedRangeInput fixed.range (hfixed j).1 contourBank (pSeq j) pStarj = B ∧ ofReal (c / (pSeq j).n) ≤ minimaxRisk (pSeq j) (pSeq j).n gcode qcode ∧ minimaxRisk (pSeq j) (pSeq j).n gcode qcode ≤ ofReal (C / (pSeq j).n) ∧ Measurable (thetaHatSpec (pSeq j) pStarj cStarj gcode) ∧ (∀ compiled : CompiledBoundedSpectralAdapter, FullCanonicalBuildAndCompilation compiled (pSeq j) pStarj cStarj gcode → CompiledRepresentedExecution compiled (pSeq j) pStarj cStarj gcode) ∧ (⨆ m : Model (Xspace := Xspace) (pSeq j), ⨆ (_ : NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n), mseRisk m (pSeq j).n (thetaHatSpec (pSeq j) pStarj cStarj gcode)) ≤ ofReal (C / (pSeq j).n)) ∧ (∀ (p : Parameters) (m : Model (Xspace := Xspace) p), GaussianClass p p.n m → m.theta0 = 0) ∧ (∀ (p : Parameters) (gcode qcode : ℕ → Xspace → ℝ), (∀ j, Measurable (gcode j)) → (∀ j, Measurable (qcode j)) → ({m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n}).Nonempty → minimaxRiskG (Xspace := Xspace) p p.n gcode qcode = 0 ∧ minimaxQuantileRiskG (Xspace := Xspace) p p.n gcode qcode = 0) := by rcases adaptive_rootn_minimax r delta Ctheta Cg Cq psieta psixi hr hdelta hCtheta hCg hCq hpsieta hpsixi with ⟨c, C, hc, hC, hmain⟩ intro Xspace inst have hgauss := bounded_outcome_gaussian_degeneracy (Xspace := Xspace) refine ⟨?_, ?_, ?_⟩ · intro p0 hp0r hp0delta hp0Ctheta hp0Cg hp0Cq hp0psieta hp0psixi fixed have hmain' := hmain (Xspace := Xspace) p0 hp0r hp0delta hp0Ctheta hp0Cg hp0Cq hp0psieta hp0psixi fixed intro pSeq gcode qcode eps1 eps2 _hgcodeMeas _hqcodeMeas hfixed _htend hevent refine ⟨c, C, hc, hC, ?_⟩ dsimp only filter_upwards [hevent] with j hj rcases hj.1 with ⟨base, hbaseClass, hgcode, hqcode⟩ have hgclip : clippedTreatmentCode (pSeq j) gcode (pSeq j).n = clippedTreatmentCode (pSeq j) base.gcode (pSeq j).n := by exact hgcode.symm have hqclip : clippedOutcomeCode (pSeq j) qcode (pSeq j).n = clippedOutcomeCode (pSeq j) base.qcode (pSeq j).n := by exact hqcode.symm have hresult := hmain' (pSeq j) (hfixed j).1 base rcases hresult with ⟨hmeas, _hrepr, _hclass, _heq, hrisk, _hace⟩ have hiid : IidSampling (pSeq j).n base.P (iidLaw base (pSeq j).n) := rfl have hlaws : ({m : Model (Xspace := Xspace) (pSeq j) | NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = barG (pSeq j) base (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = barQ (pSeq j) base (pSeq j).n}).Nonempty := ⟨base, hbaseClass, rfl, rfl⟩ rcases hrisk hiid hlaws hj.2.1 hj.2.2 with ⟨hlower, hminimaxEst, hestUpper, _hquantile⟩ have hriskEq : minimaxRisk (pSeq j) (pSeq j).n gcode qcode = minimaxRisk (pSeq j) (pSeq j).n base.gcode base.qcode := by change minimaxRiskOn (pSeq j) (pSeq j).n {m | NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n} = minimaxRiskOn (pSeq j) (pSeq j).n {m | NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) base.gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) base.qcode (pSeq j).n} congr 1 ext m simp only [Set.mem_setOf_eq] rw [hgclip, hqclip] have htheta : (thetaHatSpec (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode : (Fin (pSeq j).n → Obs Xspace) → ℝ) = thetaHatSpec (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) base.gcode := by apply thetaHatSpec_congr_current exact fun x ↦ congrFun hgclip x have hmeas' : Measurable (thetaHatSpec (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode) := by rw [htheta] exact hmeas have hcompiled : ∀ compiled : CompiledBoundedSpectralAdapter, FullCanonicalBuildAndCompilation compiled (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode → CompiledRepresentedExecution compiled (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode := by intro compiled hfull exact representedExecution_of_fullCanonicalBuildAndCompilation compiled (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode hfull have hestUpper' : (⨆ m : Model (Xspace := Xspace) (pSeq j), ⨆ (_ : NonGaussianClass (pSeq j) (pSeq j).n m ∧ barG (pSeq j) m (pSeq j).n = clippedTreatmentCode (pSeq j) gcode (pSeq j).n ∧ barQ (pSeq j) m (pSeq j).n = clippedOutcomeCode (pSeq j) qcode (pSeq j).n), mseRisk m (pSeq j).n (thetaHatSpec (pSeq j) (fixedBankInput fixed.bank (hfixed j).1) (fixedRangeInput fixed.range (hfixed j).1) gcode)) ≤ ofReal (C / (pSeq j).n) := by rw [hgclip, hqclip, htheta] exact hestUpper refine ⟨?_, ?_, ?_, hmeas', hcompiled, hestUpper'⟩ · simp [fixedBankInput, CertifiedBankInputs.transport, contourBank] · rw [hriskEq] exact hlower · rw [hriskEq] exact hminimaxEst.trans hestUpper · intro p m hm exact (hgauss p).1 m hm · intro p gcode qcode _hgcodeMeas _hqcodeMeas hnonempty exact (hgauss p).2 gcode qcode hnonempty
CausalSmith.Stat.SaPlmCumulantConverse.common_experiment_dichotomy · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T5_CommonExperimentDichotomy.lean:45
T6_SymmetricMixtureReduction 4 declarations Symmetric Gaussian-mixture reduction

Symmetric Gaussian-mixture reduction

def symmetricGaussianMixture

Equal mixture of N(-1,1) and N(1,1).

Definition (Lean source)
def symmetricGaussianMixture : Measure ℝ := (ofReal (1 / 2 : ℝ)) • gaussianReal (-1) (1 : NNReal) + (ofReal (1 / 2 : ℝ)) • gaussianReal 1 (1 : NNReal)
CausalSmith.Stat.SaPlmCumulantConverse.symmetricGaussianMixture · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T6_SymmetricMixtureReduction.lean:15
instance instIsProbabilityMeasureRealSymmetricGaussianMixture

The symmetric Gaussian mixture — equal weight on a unit-variance normal centred at minus one and on a unit-variance normal centred at plus one — is a probability measure, its total mass being one.

Definition (Lean source)
instance : IsProbabilityMeasure symmetricGaussianMixture where measure_univ := by simpa [symmetricGaussianMixture] using ENNReal.inv_two_add_inv_two
CausalSmith.Stat.SaPlmCumulantConverse.instIsProbabilityMeasureRealSymmetricGaussianMixture · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T6_SymmetricMixtureReduction.lean:20
theorem symmetricGaussianMixture_second_lintegral_le Lemma symmetricGaussianMixture_second_lintegral_le in the paper ↗

The stipulated symmetric mixture has a uniform second-moment envelope.

Formal statement
∫⁻ x : ℝ, ofReal (x ^ 2) ∂symmetricGaussianMixture ≤ 4
Proof (Lean source)
-- @node: symmetricGaussianMixture_second_lintegral_le lemma symmetricGaussianMixture_second_lintegral_le : ∫⁻ x : ℝ, ofReal (x ^ 2) ∂symmetricGaussianMixture ≤ 4 := by have hsecond (u : ℝ) : ∫ x : ℝ, x ^ 2 ∂gaussianReal u (1 : NNReal) = 1 + u ^ 2 := by have hsq : Integrable (fun x : ℝ ↦ x ^ 2) (gaussianReal u (1 : NNReal)) := by simpa only [id_eq, Real.norm_eq_abs, sq_abs] using (memLp_id_gaussianReal (μ := u) (v := (1 : NNReal)) 2).integrable_sq have hcenter : Integrable (fun x : ℝ ↦ (x - u) ^ 2) (gaussianReal u (1 : NNReal)) := by exact ((memLp_id_gaussianReal (μ := u) (v := (1 : NNReal)) 2).sub (memLp_const u)).integrable_sq have hid : Integrable (fun x : ℝ ↦ x) (gaussianReal u (1 : NNReal)) := by exact (memLp_id_gaussianReal (μ := u) (v := (1 : NNReal)) 1).integrable (by norm_num) have hv := variance_fun_id_gaussianReal (μ := u) (v := (1 : NNReal)) rw [variance_eq_integral measurable_id'.aemeasurable] at hv simp only [integral_id_gaussianReal] at hv calc ∫ x : ℝ, x ^ 2 ∂gaussianReal u (1 : NNReal) = ∫ x : ℝ, ((x - u) ^ 2 + 2 * u * x - u ^ 2) ∂gaussianReal u (1 : NNReal) := by apply integral_congr_ae filter_upwards [] with x ring _ = 1 + u ^ 2 := by calc _ = (∫ x : ℝ, (x - u) ^ 2 + 2 * u * x ∂gaussianReal u (1 : NNReal)) - ∫ _x : ℝ, u ^ 2 ∂gaussianReal u (1 : NNReal) := integral_sub (hcenter.add (hid.const_mul _)) (integrable_const _) _ = ((∫ x : ℝ, (x - u) ^ 2 ∂gaussianReal u (1 : NNReal)) + ∫ x : ℝ, 2 * u * x ∂gaussianReal u (1 : NNReal)) - ∫ _x : ℝ, u ^ 2 ∂gaussianReal u (1 : NNReal) := by rw [integral_add hcenter (hid.const_mul _)] _ = 1 + u ^ 2 := by rw [integral_const_mul, integral_id_gaussianReal] simp [hv] ring have hlin (u : ℝ) : ∫⁻ x : ℝ, ofReal (x ^ 2) ∂gaussianReal u (1 : NNReal) = ofReal (1 + u ^ 2) := by have hsq : Integrable (fun x : ℝ ↦ x ^ 2) (gaussianReal u (1 : NNReal)) := by simpa only [id_eq, Real.norm_eq_abs, sq_abs] using (memLp_id_gaussianReal (μ := u) (v := (1 : NNReal)) 2).integrable_sq rw [← ofReal_integral_eq_lintegral_ofReal hsq (Filter.Eventually.of_forall fun x ↦ sq_nonneg x), hsecond] unfold symmetricGaussianMixture rw [lintegral_add_measure, lintegral_smul_measure, lintegral_smul_measure, hlin, hlin] simp only [smul_eq_mul] norm_num only [neg_sq, one_pow] have hhalf : ofReal (1 / 2 : ℝ) = (1 / 2 : ENNReal) := by rw [ENNReal.ofReal_div_of_pos (by norm_num : (0 : ℝ) < 2)] norm_num rw [hhalf] have htwo : (2 : ENNReal) = ofReal (2 : ℝ) := by norm_num have hfirst : ofReal (1 + 1 : ℝ) ≤ (2 : ENNReal) := by rw [htwo] exact ENNReal.ofReal_le_ofReal (by norm_num) have hsecond' : ofReal (2 : ℝ) ≤ (2 : ENNReal) := by rw [htwo] calc _ ≤ (1 : ENNReal) * 2 + (1 : ENNReal) * 2 := by gcongr all_goals first | exact hfirst | exact hsecond' | exact (by simpa [div_eq_mul_inv] using (ENNReal.inv_le_one (a := (2 : ENNReal))).2 (by norm_num)) _ ≤ 4 := by norm_num
CausalSmith.Stat.SaPlmCumulantConverse.symmetricGaussianMixture_second_lintegral_le · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T6_SymmetricMixtureReduction.lean:150
theorem symmetric_mixture_reduction Proposition 3 in the paper ↗

Once the range bound for the treatment coefficient, the two regression bounds, and the outcome-noise scale are fixed, one constant works for every sample size: for any model in which the treatment noise follows the symmetric two-component Gaussian mixture, the data are drawn independently, the usual regularity conditions of the non-Gaussian class hold, and the treatment code is accurate in mean to within one over pi, the fourth cumulant of the treatment noise is exactly minus two, the treatment moment generating function vanishes at the imaginary point i times pi over two, the population sine score equals exp(-π²/8) times the average cosine of the treatment-code error, that score is bounded below by half of exp(-π²/8), and the resulting clipped sine estimator has mean squared error at most the constant divided by the sample size.

Formal statement
Ctheta Cg Cq psixi :
∃ C : ℝ,
0 < C ∧
∀ (p : Parameters),
p.Ctheta
= Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → ∀ (m : Model (Xspace := Xspace) p), m.P.map (eta p m) = symmetricGaussianMixtureIidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → p.eps1n p.n ≤ 1 / pifourthCumulant p m = -2 ∧ treatmentMGF p m (I * (pi / 2 : ℝ)) = 0 ∧ ∫ o, learnedResidual p m p.n o * sin (pi * learnedResidual p m p.n o / 2) ∂m.P = exp (-pi ^ 2 / 8) * ∫ o, cos (pi * treatmentError p m p.n o / 2) ∂m.P ∧ exp (-pi ^ 2 / 8) / 2 ≤ ∫ o, learnedResidual p m p.n o * sin (pi * learnedResidual p m p.n o / 2) ∂m.P ∧ mseRisk m p.n (thetaHatSin p m) ≤ ofReal (C / p.n)
Proof (Lean source)
-- @node: prop:symmetric-mixture-reduction theorem symmetric_mixture_reduction (Ctheta Cg Cq psixi : ℝ) : ∃ C : ℝ, 0 < C ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → ∀ (m : Model (Xspace := Xspace) p), m.P.map (eta p m) = symmetricGaussianMixtureIidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → p.eps1n p.n ≤ 1 / pifourthCumulant p m = -2 ∧ treatmentMGF p m (I * (pi / 2 : ℝ)) = 0 ∧ ∫ o, learnedResidual p m p.n o * sin (pi * learnedResidual p m p.n o / 2) ∂m.P = exp (-pi ^ 2 / 8) * ∫ o, cos (pi * treatmentError p m p.n o / 2) ∂m.P ∧ exp (-pi ^ 2 / 8) / 2 ≤ ∫ o, learnedResidual p m p.n o * sin (pi * learnedResidual p m p.n o / 2) ∂m.P ∧ mseRisk m p.n (thetaHatSin p m) ≤ ofReal (C / p.n) := by let A : ℝ := exp (-pi ^ 2 / 8) let K : ℝ := 4 * (Cq + 2 * Ctheta * Cg) ^ 2 + 4 * psixi ^ 2 + Ctheta ^ 2 * (8 + 16 * Cg ^ 2) let C : ℝ := 1 + 16 / A ^ 2 * K have hA : 0 < A := Real.exp_pos _ have hK : 0 ≤ K := by dsimp [K]; positivity have hC : 0 < C := by dsimp [C]; positivity refine ⟨C, hC, ?_⟩ intro p hpTheta hpG hpQ hpXi m hlaw _hiid hind hout htheta hg hq hxi hL1 hsmall let t : ℝ := pi / 2 let W : Obs Xspace → ℝ := fun o ↦ learnedResidual p m p.n o * sin (t * learnedResidual p m p.n o) let R : Obs Xspace → ℝ := fun o ↦ (outcome o - m.theta0 * learnedResidual p m p.n o) * sin (t * learnedResidual p m p.n o) have ht : 0 < t := div_pos Real.pi_pos zero_lt_two have hmgf := treatmentMGF_eq_symmetricGaussianMixture p m hlaw have hzero : treatmentMGF p m (I * t) = 0 := by rw [hmgf] dsimp [t] rw [show I * ((pi / 2 : ℝ) : ℂ) = ((pi / 2 : ℝ) : ℂ) * I by ring, Complex.cosh_mul_I] simp have hkappa : fourthCumulant p m = -2 := by unfold treatmentMGF at hmgf rw [fourthCumulant] simp_rw [congrFun hmgf] simpa using gaussianRademacher_logMGF_fourth 1 1 have hetaInt : Integrable (eta p m) m.P := by have hp := eta_integrable_exp_symmetricGaussianMixture p m hlaw 1 have hn := eta_integrable_exp_symmetricGaussianMixture p m hlaw (-1) apply (hp.add hn).mono' (by unfold eta treatment covariate exact (measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst)).aestronglyMeasurable) filter_upwards [] with o simp only [Pi.add_apply, one_mul, neg_mul, Real.norm_eq_abs] by_cases ho : 0 ≤ eta p m o · rw [abs_of_nonneg ho] linarith [Real.add_one_le_exp (eta p m o), Real.exp_pos (-eta p m o)] · rw [abs_of_neg (lt_of_not_ge ho)] linarith [Real.add_one_le_exp (-eta p m o), Real.exp_pos (eta p m o)] have hmoment : ∫ o, (eta p m o : ℂ) * exp ((I * t) * (eta p m o : ℂ)) ∂m.P = I * A := by simpa only [t, A] using eta_cexp_moment_symmetricGaussianMixture p m hlaw have hdenId := learnedResidual_sine_denominator_identity p m p.n t A hzero hmoment hetaInt hind hg have htSmall : t * p.eps1n p.n ≤ 1 / 2 := by dsimp [t] calc pi / 2 * p.eps1n p.n ≤ pi / 2 * (1 / pi) := mul_le_mul_of_nonneg_left hsmall (by positivity) _ = 1 / 2 := by field_simp [Real.pi_ne_zero] have hdenLower := learnedResidual_sine_denominator_lower p m p.n t A ht hA hdenId hL1 htSmall have hremMean : ∫ o, R o ∂m.P = 0 := by simpa only [R] using sine_remainder_centered_of_mgf_zero p m p.n t hzero hind hout htheta hg hq have hetaMeas : Measurable (eta p m) := by unfold eta treatment covariate exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hetaSq : ∫⁻ o, ofReal ((eta p m o) ^ 2) ∂m.P ≤ 4 := by calc _ = ∫⁻ x : ℝ, ofReal (x ^ 2) ∂(m.P.map (eta p m)) := by rw [lintegral_map (by fun_prop) hetaMeas] _ = ∫⁻ x : ℝ, ofReal (x ^ 2) ∂symmetricGaussianMixture := by rw [hlaw] _ ≤ 4 := symmetricGaussianMixture_second_lintegral_le have hscore := sine_score_memLp_of_eta_second_lintegral_le p m p.n t hetaSq htheta hg hq hxi have hriskRaw := clippedRatioFromScores_lintegral_le m.P p.Ctheta m.theta0 A p.n W R (∫ o, W o ∂m.P) p.n_pos htheta hA (by simpa only [W] using hdenLower) hscore.1 hscore.2.1 hscore.2.2.1 hscore.2.2.2.1 rfl hremMean have hrisk : mseRisk m p.n (thetaHatSin p m) ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2)) := by unfold mseRisk iidLaw thetaHatSin rw [show thetaHatAt p m p.n (pi / 2) (exp (-pi ^ 2 / 8) / 4) = clippedRatioFromScores p.Ctheta m.theta0 p.n (A / 4) W R by funext data simpa only [W, R, t, A] using thetaHatAt_eq_clippedRatioFromScores p m p.n t (A / 4) data] exact hriskRaw have hscoreBound : ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2) ≤ ofReal K := by calc _ ≤ ofReal (4 * (p.Cq + 2 * p.Ctheta * p.Cg) ^ 2 + 4 * p.psixi ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal (8 + 16 * p.Cg ^ 2) := by gcongr · exact hscore.2.2.2.2.2 · exact hscore.2.2.2.2.1 _ = ofReal K := by rw [← ENNReal.ofReal_mul (sq_nonneg p.Ctheta), ← ENNReal.ofReal_add (by positivity) (by positivity)] congr 1 dsimp [K] rw [hpTheta, hpG, hpQ, hpXi] have hnR : (0 : ℝ) < p.n := by exact_mod_cast p.n_pos have hriskFinal : mseRisk m p.n (thetaHatSin p m) ≤ ofReal (C / p.n) := by calc _ ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * (ofReal ((eLpNorm R 2 m.P).toReal ^ 2) + ofReal (p.Ctheta ^ 2) * ofReal ((eLpNorm W 2 m.P).toReal ^ 2)) := hrisk _ ≤ ofReal (16 / A ^ 2) * (p.n : ENNReal)⁻¹ * ofReal K := by gcongr _ = ofReal ((16 / A ^ 2 * K) / p.n) := by rw [← ENNReal.ofReal_natCast, ← ENNReal.ofReal_inv_of_pos hnR, ← ENNReal.ofReal_mul (by positivity : 0 ≤ 16 / A ^ 2), ← ENNReal.ofReal_mul (by positivity)] congr 1 ring _ ≤ ofReal (C / p.n) := ENNReal.ofReal_le_ofReal (by have hn0 : (0 : ℝ) ≤ p.n := hnR.le apply div_le_div_of_nonneg_right _ hn0 dsimp [C] linarith) refine ⟨hkappa, hzero, ?_, ?_, hriskFinal⟩ · simpa only [t, A, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hdenId · simpa only [t, A, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hdenLower
CausalSmith.Stat.SaPlmCumulantConverse.symmetric_mixture_reduction · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T6_SymmetricMixtureReduction.lean:222
T7_LocalToGaussianPartialBenchmarks 1 declarations Closed local-to-Gaussian upper benchmarks

Closed local-to-Gaussian upper benchmarks

theorem local_to_gaussian_partial_benchmarks Theorem 5 in the paper ↗

Along a cumulant-separation schedule that is strictly positive at every sample size, nonincreasing, and shrinking to zero, so that the treatment noise drifts toward Gaussian as the sample grows, two closed upper benchmarks are available and can be combined: first, one constant, depending only on the range and regression bounds and the outcome-noise scale, delivers the parametric mean squared error bound for every Gaussian--Rademacher mixture whose mixing weight is strictly positive and at most one, under the usual regularity conditions of the class; second, any published adaptive-cumulant-estimator procedure carrying its stated generalized-quantile guarantee keeps that guarantee at each sample size along this schedule, and a risk that respects both the double-machine-learning benchmark and the adaptive-cumulant benchmark also respects the smaller of the two.

Formal statement
deltaSeq :
ℕ → ℝ
@realizes deltaSeq(carrier Nat to Real)
hdeltaPos :
∀ n, 0 < deltaSeq n
@realizes deltaSeq(pointwise positive)
hdeltaAnti :
Antitone deltaSeq
@realizes deltaSeq(nonincreasing)
hdeltaZero :
Tendsto deltaSeq atTop (nhds 0)
@realizes deltaSeq(converges to zero)
Ctheta Cg Cq psixi :
(∃ C : ℝ, 0 < C ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → p.k = 4 → p.r = 3 → ∀ a : ℝ, a ∈ Ioc (0 : ℝ) 1 → ∀ m : Model (Xspace := Xspace) p, m.P.map (eta p m) = gaussianRademacherLaw a → IidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → GaussianRademacherPathConclusion p m a C) ∧
(∀ (published : PublishedAceHandle Xspace) (gamma Cgamma : ℝ), JmsAceTheoremFiveFour published gamma Cgamma → (0 < Cgamma ∧ ∀ (p : Parameters), p.gamma = gamma → 0 < p.eps1n p.n → 0 < p.eps2n p.n → ∀ (gcode qcode : ℕ → Xspace → ℝ) (m : Model (Xspace := Xspace) p), barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClassAt p p.n m (deltaSeq p.n) → jmsEligibleAt p p.n (deltaSeq p.n) → generalizedQuantile p p.n m (fun data ↦ abs (published.estimator p.r p.n gcode qcode data - m.theta0)) ≤ jmsBound p p.n Cgamma (deltaSeq p.n)))
Proof (Lean source)
-- @node: thm:local-to-gaussian-partial-benchmarks theorem local_to_gaussian_partial_benchmarks (deltaSeq : ℕ → ℝ) -- @realizes deltaSeq(carrier Nat to Real) (hdeltaPos : ∀ n, 0 < deltaSeq n) -- @realizes deltaSeq(pointwise positive) (hdeltaAnti : Antitone deltaSeq) -- @realizes deltaSeq(nonincreasing) (hdeltaZero : Tendsto deltaSeq atTop (nhds 0)) -- @realizes deltaSeq(converges to zero) (Ctheta Cg Cq psixi : ℝ) : (∃ C : ℝ, 0 < C ∧ ∀ (p : Parameters), p.Ctheta = Ctheta → p.Cg = Cg → p.Cq = Cq → p.psixi = psixi → p.k = 4 → p.r = 3 → ∀ a : ℝ, a ∈ Ioc (0 : ℝ) 1 → ∀ m : Model (Xspace := Xspace) p, m.P.map (eta p m) = gaussianRademacherLaw a → IidSampling p.n m.P (iidLaw m p.n) → IndependentTreatmentNoise p m → OutcomeMeanIndependence p m → ThetaRange p m → GRange p m → QRange p m → XiSubGaussian p m → TreatmentCodeRadiusL1At p m p.n → GaussianRademacherPathConclusion p m a C) ∧ (∀ (published : PublishedAceHandle Xspace) (gamma Cgamma : ℝ), JmsAceTheoremFiveFour published gamma Cgamma → (0 < Cgamma ∧ ∀ (p : Parameters), p.gamma = gamma → 0 < p.eps1n p.n → 0 < p.eps2n p.n → ∀ (gcode qcode : ℕ → Xspace → ℝ) (m : Model (Xspace := Xspace) p), barG p m p.n = clippedTreatmentCode p gcode p.n → barQ p m p.n = clippedOutcomeCode p qcode p.n → JmsAceClassAt p p.n m (deltaSeq p.n) → jmsEligibleAt p p.n (deltaSeq p.n) → generalizedQuantile p p.n m (fun data ↦ abs (published.estimator p.r p.n gcode qcode data - m.theta0)) ≤ jmsBound p p.n Cgamma (deltaSeq p.n))) := by constructor · obtain ⟨C, hC, hpath⟩ := gaussian_rademacher_l1_benchmark (Xspace := Xspace) Ctheta Cg Cq psixi refine ⟨C, hC, ?_⟩ intro p hCtheta hCg hCq hpsixi hk hr a ha m hlaw hiid hind hout htheta hg hq hxi hcode exact hpath p hCtheta hCg hCq hpsixi hk a ha m hlaw hiid hind hout htheta hg hq hxi hcode · intro published gamma Cgamma hJms rcases hJms with ⟨hCgamma, hbound⟩ refine ⟨hCgamma, ?_⟩ intro p hgamma heps1 heps2 gcode qcode m hgcode hqcode hclass heligible exact hbound p hgamma (deltaSeq p.n) (hdeltaPos p.n) heps1 heps2 gcode qcode m hgcode hqcode hclass heligible
CausalSmith.Stat.SaPlmCumulantConverse.local_to_gaussian_partial_benchmarks · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T7_LocalToGaussianPartialBenchmarks.lean:16
T8_BoundedOutcomeGaussianDegeneracy 3 declarations Degeneracy of the simultaneous bounded-outcome Gaussian intersection

Degeneracy of the simultaneous bounded-outcome Gaussian intersection

theorem gaussianClass_theta_eq_zero Lemma gaussianClass_theta_eq_zero in the paper ↗

A bounded conditional-mean PLM with nondegenerate Gaussian treatment noise cannot have a nonzero treatment coefficient.

Formal statement
m :
Model (Xspace := Xspace) p
h :
m.theta0 = 0
Proof (Lean source)
lemma gaussianClass_theta_eq_zero (p : Parameters) (m : Model (Xspace := Xspace) p) (h : GaussianClass p p.n m) : m.theta0 = 0 := by have hXT : xTSigma (Xspace := Xspace) ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := by rw [xTSigma] exact comap_le (show Measurable (fun o : Obs Xspace ↦ (o.1, o.2.1)) by fun_prop) have hq_int : Integrable (fun o : Obs Xspace ↦ m.q0 (covariate o)) m.P := by exact integrable_condExp.congr m.q0_condMean have hg_int : Integrable (fun o : Obs Xspace ↦ m.g0 (covariate o)) m.P := by exact integrable_condExp.congr m.g0_condMean have heta_int : Integrable (eta p m) m.P := m.treatment_integrable.sub hg_int have hpair : Measurable[xTSigma (Xspace := Xspace)] (fun o : Obs Xspace ↦ (covariate o, treatment o)) := comap_measurable _ have hq_meas : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o : Obs Xspace ↦ m.q0 (covariate o)) := by apply Measurable.stronglyMeasurable have hproj : Measurable (fun xt : Xspace × ℝ ↦ m.q0 xt.1) := m.q0_measurable.comp measurable_fst exact hproj.comp hpair have heta_meas : StronglyMeasurable[xTSigma (Xspace := Xspace)] (eta p m) := by apply Measurable.stronglyMeasurable change Measurable[xTSigma (Xspace := Xspace)] (fun o : Obs Xspace ↦ treatment o - m.g0 (covariate o)) have hproj : Measurable (fun xt : Xspace × ℝ ↦ xt.2 - m.g0 xt.1) := measurable_snd.sub (m.g0_measurable.comp measurable_fst) exact hproj.comp hpair have hthetaeta_int : Integrable (fun o ↦ m.theta0 * eta p m o) m.P := heta_int.const_mul m.theta0 have hthetaeta_meas : StronglyMeasurable[xTSigma (Xspace := Xspace)] (fun o ↦ m.theta0 * eta p m o) := heta_meas.const_mul _ have hq_cond : (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun o ↦ m.q0 (covariate o))) =ᵐ[m.P] (fun o ↦ m.q0 (covariate o)) := by exact Filter.Eventually.of_forall fun o ↦ congrFun (condExp_of_stronglyMeasurable hXT hq_meas hq_int) o have heta_cond : (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun o ↦ m.theta0 * eta p m o)) =ᵐ[m.P] (fun o ↦ m.theta0 * eta p m o) := by exact Filter.Eventually.of_forall fun o ↦ congrFun (condExp_of_stronglyMeasurable hXT hthetaeta_meas hthetaeta_int) o have hsub1 := condExp_sub m.outcome_integrable hq_int (xTSigma (Xspace := Xspace)) have hsub2 := condExp_sub (m.outcome_integrable.sub hq_int) hthetaeta_int (xTSigma (Xspace := Xspace)) have hmean : (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P outcome) =ᵐ[m.P] (fun o ↦ m.q0 (covariate o) + m.theta0 * eta p m o) := by filter_upwards [h.outcomeMeanIndependence.2, hsub1, hsub2, hq_cond, heta_cond] with o hxi hs1 hs2 hq he simp only [Pi.sub_apply] at hs1 hs2 change m.P[(fun o ↦ outcome o - m.q0 (covariate o) - m.theta0 * eta p m o) | xTSigma] o = 0 at hxi have hxs : m.P[(fun o ↦ outcome o - m.q0 (covariate o) - m.theta0 * eta p m o) | xTSigma] o = m.P[(fun o ↦ outcome o - m.q0 (covariate o)) | xTSigma] o - m.P[(fun o ↦ m.theta0 * eta p m o) | xTSigma] o := by exact hs2 have hqs : m.P[(fun o ↦ outcome o - m.q0 (covariate o)) | xTSigma] o = m.P[outcome | xTSigma] o - m.P[(fun o ↦ m.q0 (covariate o)) | xTSigma] o := by exact hs1 linarith have hy_lower : (fun _ : Obs Xspace ↦ -p.Cq) ≤ᵐ[m.P] outcome := by filter_upwards [h.boundedGaussianOutcome] with o ho exact neg_le_of_abs_le ho have hy_upper : outcome ≤ᵐ[m.P] (fun _ : Obs Xspace ↦ p.Cq) := by filter_upwards [h.boundedGaussianOutcome] with o ho exact le_of_abs_le ho have hconst_int : Integrable (fun _ : Obs Xspace ↦ p.Cq) m.P := integrable_const _ have hnconst_int : Integrable (fun _ : Obs Xspace ↦ -p.Cq) m.P := integrable_const _ have hcq_cond : (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun _ ↦ p.Cq)) = (fun _ ↦ p.Cq) := condExp_const hXT p.Cq have hncq_cond : (@condExp (Obs Xspace) ℝ (xTSigma (Xspace := Xspace)) inferInstance _ _ m.P (fun _ ↦ -p.Cq)) = (fun _ ↦ -p.Cq) := condExp_const hXT (-p.Cq) have hmean_lower := condExp_mono hnconst_int m.outcome_integrable hy_lower (m := xTSigma (Xspace := Xspace)) have hmean_upper := condExp_mono m.outcome_integrable hconst_int hy_upper (m := xTSigma (Xspace := Xspace)) have hlinear_bdd : ∀ᵐ o ∂m.P, |m.q0 (covariate o) + m.theta0 * eta p m o| ≤ p.Cq := by filter_upwards [hmean, hmean_lower, hmean_upper] with o hm hlo hhi rw [congrFun hncq_cond o] at hlo rw [congrFun hcq_cond o] at hhi have hm' : m.P[(fun o ↦ o.2.2) | xTSigma] o = m.q0 (covariate o) + m.theta0 * eta p m o := by exact hm rw [hm'] at hlo hhi exact abs_le.2 ⟨hlo, hhi⟩ have hX : comap covariate inferInstance ≤ (inferInstance : MeasurableSpace (Obs Xspace)) := by exact comap_le (measurable_fst : Measurable (fun o : Obs Xspace ↦ o.1)) have hcq_cond_X : (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun _ ↦ p.Cq)) = (fun _ ↦ p.Cq) := condExp_const hX p.Cq have hncq_cond_X : (@condExp (Obs Xspace) ℝ (comap covariate inferInstance) inferInstance _ _ m.P (fun _ ↦ -p.Cq)) = (fun _ ↦ -p.Cq) := condExp_const hX (-p.Cq) have hq_lower := condExp_mono hnconst_int m.outcome_integrable hy_lower (m := comap covariate inferInstance) have hq_upper := condExp_mono m.outcome_integrable hconst_int hy_upper (m := comap covariate inferInstance) have hq_bdd : ∀ᵐ o ∂m.P, |m.q0 (covariate o)| ≤ p.Cq := by filter_upwards [m.q0_condMean, hq_lower, hq_upper] with o hqo hlo hhi rw [congrFun hncq_cond_X o] at hlo rw [congrFun hcq_cond_X o] at hhi have hqo' : m.P[(fun o ↦ o.2.2) | comap covariate inferInstance] o = m.q0 (covariate o) := by exact hqo rw [hqo'] at hlo hhi exact abs_le.2 ⟨hlo, hhi⟩ have hthetaeta_bdd : ∀ᵐ o ∂m.P, |m.theta0 * eta p m o| ≤ 2 * p.Cq := by filter_upwards [hlinear_bdd, hq_bdd] with o hlin hq calc |m.theta0 * eta p m o| = |(m.q0 (covariate o) + m.theta0 * eta p m o) - m.q0 (covariate o)| := by ring_nf _ ≤ |m.q0 (covariate o) + m.theta0 * eta p m o| + |m.q0 (covariate o)| := abs_sub _ _ _ ≤ p.Cq + p.Cq := add_le_add hlin hq _ = 2 * p.Cq := by ring by_contra htheta have habs : 0 < |m.theta0| := abs_pos.2 htheta let B := 2 * p.Cq / |m.theta0| have heta_bdd : ∀ᵐ o ∂m.P, |eta p m o| ≤ B := by filter_upwards [hthetaeta_bdd] with o ho rw [show B = 2 * p.Cq / |m.theta0| by rfl] apply (le_div_iff₀ habs).2 simpa [abs_mul, mul_comm] using ho have hprezero : m.P (eta p m ⁻¹' Ioi B) = 0 := by rw [measure_eq_zero_iff_ae_notMem] filter_upwards [heta_bdd] with o ho simp only [mem_preimage, mem_Ioi, not_lt] exact le_trans (le_abs_self _) ho have heta_meas_full : Measurable (eta p m) := by change Measurable (fun o : Obs Xspace ↦ o.2.1 - m.g0 o.1) exact measurable_snd.fst.sub (m.g0_measurable.comp measurable_fst) have hgausszero : gaussianReal 0 ⟨p.sigma ^ 2, sq_nonneg p.sigma⟩ (Ioi B) = 0 := by rw [← h.gaussianTreatmentNoise, Measure.map_apply_of_aemeasurable heta_meas_full.aemeasurable measurableSet_Ioi] exact hprezero have hv : (⟨p.sigma ^ 2, sq_nonneg p.sigma⟩ : NNReal) ≠ 0 := by intro hv0 have hsquare : p.sigma ^ 2 = 0 := congrArg (fun x : NNReal ↦ (x : ℝ)) hv0 exact (pow_ne_zero 2 (ne_of_gt p.constants_pos.2.2.2.2.2.2)) hsquare have hvolzero : (volume : Measure ℝ) (Ioi B) = 0 := (gaussianReal_absolutelyContinuous' 0 hv) hgausszero rw [Real.volume_Ioi] at hvolzero exact ENNReal.top_ne_zero hvolzero
CausalSmith.Stat.SaPlmCumulantConverse.gaussianClass_theta_eq_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T8_BoundedOutcomeGaussianDegeneracy.lean:17
theorem generalizedQuantile_zero Lemma generalizedQuantile_zero in the paper ↗

The generalized lower quantile of the identically zero loss is zero at the paper's interior probability level.

Formal statement
m :
Model (Xspace := Xspace) p
generalizedQuantile p p.n m (fun _ ↦ 0) = 0
Proof (Lean source)
lemma generalizedQuantile_zero (p : Parameters) (m : Model (Xspace := Xspace) p) : generalizedQuantile p p.n m (fun _ ↦ 0) = 0 := by have htau0 : 0 < 1 - p.gamma := sub_pos.mpr p.gamma_mem.2 have htau1 : 1 - p.gamma < 1 := sub_lt_self 1 (lt_trans (by norm_num) p.gamma_mem.1) have hiid : iidLaw m p.n univ = 1 := by simp [iidLaw] have hmap : Measure.map (fun _ : Fin p.n → Obs Xspace ↦ (0 : ℝ)) (iidLaw m p.n) = Measure.dirac 0 := by rw [Measure.map_const] simp [hiid] change quantile (Measure.map (fun _ : Fin p.n → Obs Xspace ↦ (0 : ℝ)) (iidLaw m p.n)) (1 - p.gamma) = 0 rw [hmap] apply le_antisymm · apply (quantile_le_iff htau0 htau1).2 rw [cdf_eq_real] simp [measureReal_def] exact le_of_lt (lt_trans (by norm_num) p.gamma_mem.1) · by_contra hnle have hlt : quantile (Measure.dirac 0) (1 - p.gamma) < 0 := lt_of_not_ge hnle have hcdf := (quantile_le_iff htau0 htau1).1 (show quantile (Measure.dirac 0) (1 - p.gamma) ≤ _ from le_rfl) rw [cdf_eq_real] at hcdf simp [measureReal_def, hlt] at hcdf linarith [p.gamma_mem.2]
CausalSmith.Stat.SaPlmCumulantConverse.generalizedQuantile_zero · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T8_BoundedOutcomeGaussianDegeneracy.lean:174
theorem bounded_outcome_gaussian_degeneracy Proposition 2 in the paper ↗

The simultaneous bounded-outcome Gaussian class is degenerate: every model in it has treatment coefficient exactly zero, so for any supplied pair of treatment- and outcome-code sequences that the class can match, both the minimax mean squared error and the minimax generalized-quantile error over that class are exactly zero — the estimator that always reports zero is perfect there.

Formal statement
(∀ m : Model (Xspace := Xspace) p, GaussianClass p p.n m → m.theta0 = 0) ∧
(∀ gcode qcode : ℕ → Xspace → ℝ, ({m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n}).Nonempty → minimaxRiskG p p.n gcode qcode = 0 ∧ minimaxQuantileRiskG p p.n gcode qcode = 0)
Proof (Lean source)
-- @node: prop:bounded-outcome-gaussian-degeneracy theorem bounded_outcome_gaussian_degeneracy (p : Parameters) : (∀ m : Model (Xspace := Xspace) p, GaussianClass p p.n m → m.theta0 = 0) ∧ (∀ gcode qcode : ℕ → Xspace → ℝ, ({m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n}).Nonempty → minimaxRiskG p p.n gcode qcode = 0 ∧ minimaxQuantileRiskG p p.n gcode qcode = 0) := by constructor · exact fun m hm ↦ gaussianClass_theta_eq_zero p m hm · intro gcode qcode _hne constructor · change minimaxRiskOn p p.n {m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n} = 0 apply le_antisymm · calc minimaxRiskOn p p.n {m : Model (Xspace := Xspace) p | GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n} ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n), mseRisk m p.n (fun _ ↦ 0) := by apply iInf_le_of_le ⟨(fun _ ↦ 0), measurable_const⟩ exact le_rfl _ = 0 := by apply le_antisymm · apply iSup_le intro m apply iSup_le intro hm simp [mseRisk, gaussianClass_theta_eq_zero p m hm.1] · exact bot_le · exact bot_le · change minimaxQuantileRiskGOn p p.n gcode qcode = 0 apply le_antisymm · calc minimaxQuantileRiskGOn p p.n gcode qcode ≤ ⨆ m : Model (Xspace := Xspace) p, ⨆ (_ : GaussianClass p p.n m ∧ barG p m p.n = clippedTreatmentCode p gcode p.n ∧ barQ p m p.n = clippedOutcomeCode p qcode p.n), ofReal (generalizedQuantile p p.n m (fun _ ↦ |(0 : ℝ) - m.theta0|)) := by apply iInf_le_of_le ⟨(fun _ ↦ 0), measurable_const⟩ exact le_rfl _ = 0 := by apply le_antisymm · apply iSup_le intro m apply iSup_le intro hm rw [gaussianClass_theta_eq_zero p m hm.1] simp only [sub_zero, abs_zero] rw [generalizedQuantile_zero] simp · exact bot_le · exact bot_le
CausalSmith.Stat.SaPlmCumulantConverse.bounded_outcome_gaussian_degeneracy · CausalSmith/Stat/STAT_SaPlmCumulantConverse_Research/T8_BoundedOutcomeGaussianDegeneracy.lean:204