Formalization: Minimax Estimation of Optimal Treatment Values with Discrete Covariates

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.

CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Basic 40 declarations Finite-PMF substrate for the observed and full-data experiments.

Discrete optimal-value minimax model

Finite-PMF substrate for the observed and full-data experiments. The general regime-indexed potential-outcome API is intentionally bypassed because all variables here are coordinates of a finite product.

The treatment-outcome coordinate set.

Definition (Lean source)
Cell :
Type
Fin 2 × Fin 2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Cell · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:23
def Obs

One observed unit.

Definition (Lean source)
d :
Obs d :
Type
Fin d × Bool × Bool
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Obs · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:26

A probability law on the observed finite alphabet.

Definition (Lean source)
d :
pmf :
PMF (Obs d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DiscreteLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:30
def obsLaw

For the specified discrete law, the observed-data law is the probability measure associated with the discrete probability mass function.

Definition (Lean source)
d :
P :
obsLaw P :
Measure (Obs d)
P.pmf.toMeasure
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.obsLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:34
instance instIsProbabilityMeasureObsObsLaw

For the specified discrete law, the observed-data law induced by a discrete law is a probability measure.

Definition (Lean source)
instance {d : ℕ} (P : DiscreteLaw d) : IsProbabilityMeasure (obsLaw P) := by unfold obsLaw infer_instance
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.instIsProbabilityMeasureObsObsLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:37
def jointMass

An observed atom mass.

Definition (Lean source)
d :
P :
x :
Fin d
a y :
jointMass P x a y :
(P.pmf (x, a, y)).toReal
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:42
def cellVector

The four observed masses in one covariate cell.

Definition (Lean source)
d :
P :
x :
Fin d
cellVector P x :
Cell → ℝ
fun j => jointMass P x (finTwoEquiv j.1) (finTwoEquiv j.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:47
def cellMass

The mass of a covariate cell.

Definition (Lean source)
d :
P :
x :
Fin d
cellMass P x :
∑ a : Bool, ∑ y : Bool, jointMass P x a y
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:52
def armMass

The mass of one treatment arm within a covariate cell.

Definition (Lean source)
d :
P :
a :
x :
Fin d
armMass P a x :
∑ y : Bool, jointMass P x a y
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:57
def propensity

The totalized propensity.

Definition (Lean source)
d :
P :
x :
Fin d
propensity P x :
armMass P true x / cellMass P x
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.propensity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:61
def outcomeMean

The totalized binary outcome regression.

Definition (Lean source)
d :
P :
a :
x :
Fin d
outcomeMean P a x :
jointMass P x a true / armMass P a x
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.outcomeMean · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:66

Canonical finite product law.

Definition (Lean source)
d :
P :
n :
productLaw P n :
Measure (Fin n → Obs d)
Measure.pi (fun _ : Fin n => obsLaw P)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.productLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:71
instance instIsProbabilityMeasureForallFinObsProductLaw

For the specified discrete law, the finite observed-data product law is a probability measure.

Definition (Lean source)
instance {d n : ℕ} (P : DiscreteLaw d) : IsProbabilityMeasure (productLaw P n) := by unfold productLaw infer_instance
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.instIsProbabilityMeasureForallFinObsProductLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:76
def IidSampling

The supplied sample law equals the canonical product law.

Definition (Lean source)
d n :
P :
mu_n :
Measure (Fin n → Obs d)
IidSampling P mu_n :
Prop
mu_n = productLaw P n
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.IidSampling · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:87
def Overlap

Every occupied cell has propensity in the fixed overlap interval.

Definition (Lean source)
d :
epsilon :
P :
x :
0 < cellMass P x
Overlap epsilon P :
Prop
clause 1
epsilon ≤ propensity P x
clause 2
propensity P x ≤ 1 - epsilon
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Overlap · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:92
def FullObs

A full-data atom (X,A,Y,Y(0),Y(1)).

Definition (Lean source)
d :
FullObs d :
Type
Fin d × Bool × Bool × Bool × Bool
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FullObs · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:98

A probability law on the full-data alphabet.

Definition (Lean source)
d :
pmf :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.PotentialLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:102
def fullMass

For the specified rectangle or law, data point or sample, the full-data atom mass is the real-valued probability assigned by the potential-outcome law to that atom.

Definition (Lean source)
d :
Q :
z :
fullMass Q z :
(Q.pmf z).toReal
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fullMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:106
def Consistency

Observed outcomes equal the selected potential outcome almost surely.

Definition (Lean source)
d :
Q :
z :
z.2.2.1 ≠ (if z.2.1 then z.2.2.2.2 else z.2.2.2.1)
Consistency Q :
Prop
fullMass Q z = 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Consistency · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:114
def poAtom

For the specified rectangle or law, cell, treatment arm, y0, y1, the potential-outcome atom mass marginalizes the full-data law over the observed outcome while fixing covariate, treatment, and both potential outcomes.

Definition (Lean source)
d :
Q :
x :
Fin d
a y0 y1 :
poAtom Q x a y0 y1 :
∑ y : Bool, fullMass Q (x, a, y, y0, y1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poAtom · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:119
def poArmAtom

The (Y(r),A,X) atom obtained by marginalizing the other potential outcome.

Definition (Lean source)
d :
Q :
x :
Fin d
r :
Fin 2
a ya :
poArmAtom Q x r a ya :
if r = 0 then ∑ y1 : Bool, poAtom Q x a ya y1 else ∑ y0 : Bool, poAtom Q x a y0 ya
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poArmAtom · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:124
def ConditionalExchangeability

Armwise finite conditional independence Y(r) ⟂ A | X, separately for each arm.

Definition (Lean source)
d :
Q :
x r a ya :
ConditionalExchangeability Q :
Prop
poArmAtom Q x r a ya * (∑ a' : Bool, ∑ y' : Bool, poArmAtom Q x r a' y')
= (∑ a' : Bool, poArmAtom Q x r a' ya) * (∑ y' : Bool, poArmAtom Q x r a y')
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ConditionalExchangeability · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:131
def observedMarginal

Push a full-data law to its observed margin.

Definition (Lean source)
d :
Q :
observedMarginal Q :
pmf := Q.pmf.map (fun z => (z.1, z.2.1, z.2.2.1))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:140
structure ObservedModelClass

The unrestricted observed finite-law class, restricted only by overlap.

Definition (Lean source)
epsilon :
d :
P :
d_ge_two :
2 ≤ d
epsilon_pos :
0 < epsilon
epsilon_lt_half :
epsilon < 1 / 2
overlap :
Overlap epsilon P
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ObservedModelClass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:146
structure CausalCompletionClass

Consistent, exchangeable causal completions with an overlapping observed margin.

Definition (Lean source)
epsilon :
d :
Q :
d_ge_two :
2 ≤ d
epsilon_pos :
0 < epsilon
epsilon_lt_half :
epsilon < 1 / 2
consistency :
Consistency Q
exchangeability :
overlap :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.CausalCompletionClass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:154
theorem observedModel

If the potential-outcome law satisfies the stated causal restrictions, then the observed marginal belongs to the observed model class.

Formal statement
epsilon :
d :
hQ :
Proof (Lean source)
theorem CausalCompletionClass.observedModel {epsilon : ℝ} {d : ℕ} {Q : PotentialLaw d} (hQ : CausalCompletionClass epsilon Q) : ObservedModelClass epsilon (observedMarginal Q) := ⟨hQ.d_ge_two, hQ.epsilon_pos, hQ.epsilon_lt_half, hQ.overlap⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.CausalCompletionClass.observedModel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:164
theorem observedModelClass_factorization

The observed-law factorization using the canonical cell mass, propensity, and regressions. This uses the observed law satisfies the stated model restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
epsilon :
P :
hP :
x a :
conclusion 1
jointMass P x a true
= cellMass P x * (if a then propensity P x else 1 - propensity P x) * outcomeMean P a x
conclusion 2
jointMass P x a false
= cellMass P x * (if a then propensity P x else 1 - propensity P x) * (1 - outcomeMean P a x)
Proof (Lean source)
lemma observedModelClass_factorization {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : ∀ x a, jointMass P x a true = cellMass P x * (if a then propensity P x else 1 - propensity P x) * outcomeMean P a x ∧ jointMass P x a false = cellMass P x * (if a then propensity P x else 1 - propensity P x) * (1 - outcomeMean P a x) := by intro x a have hmass (a y : Bool) : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg have hcell : 0 ≤ cellMass P x := by simp [cellMass] nlinarith [hmass false false, hmass false true, hmass true false, hmass true true] by_cases hx : cellMass P x = 0 · have hs : jointMass P x true true + jointMass P x true false + (jointMass P x false true + jointMass P x false false) = 0 := by simpa [cellMass] using hx have hz00 : jointMass P x false false = 0 := by nlinarith [hmass false false, hmass false true, hmass true false, hmass true true] have hz01 : jointMass P x false true = 0 := by nlinarith [hmass false false, hmass false true, hmass true false, hmass true true] have hz10 : jointMass P x true false = 0 := by nlinarith [hmass false false, hmass false true, hmass true false, hmass true true] have hz11 : jointMass P x true true = 0 := by nlinarith [hmass false false, hmass false true, hmass true false, hmass true true] fin_cases a <;> simp [propensity, outcomeMean, armMass, hx, hz00, hz01, hz10, hz11] · have hxpos : 0 < cellMass P x := lt_of_le_of_ne hcell (Ne.symm hx) have hov := hP.overlap x hxpos have ht : 0 < armMass P true x := by have : 0 < epsilon * cellMass P x := mul_pos hP.epsilon_pos hxpos exact lt_of_lt_of_le this ((le_div_iff₀ hxpos).mp hov.1) have hcell_eq : cellMass P x = armMass P false x + armMass P true x := by simp [cellMass, armMass] ring have hf : 0 < armMass P false x := by have hbound := hov.2 rw [propensity, div_le_iff₀ hxpos] at hbound nlinarith [mul_pos hP.epsilon_pos hxpos] cases a <;> simp only [Bool.false_eq_true, ↓reduceIte] <;> unfold propensity outcomeMean <;> constructor <;> field_simp [hx, ne_of_gt ht, ne_of_gt hf] <;> simp [cellMass, armMass] at hcell_eq ⊢; nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedModelClass_factorization · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:169
def observedOptimalValueRaw

The formula underlying the observed optimal-regression value.

Definition (Lean source)
d :
P :
observedOptimalValueRaw P :
∑ x : Fin d, cellMass P x * max (outcomeMean P false x) (outcomeMean P true x)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOptimalValueRaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:214
def observedOptimalValue

The optimal-regression value, defined only on the published observed model class.

Definition (Lean source)
d :
epsilon :
P :
_hP :
observedOptimalValue P _hP :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOptimalValue · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:219
def poCellMass

Full-data cell mass.

Definition (Lean source)
d :
Q :
x :
Fin d
poCellMass Q x :
∑ a : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, fullMass Q (x, a, y, y0, y1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poCellMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:225
def poRegression

Totalized conditional potential-outcome mean.

Definition (Lean source)
d :
Q :
a :
Fin 2
x :
Fin d
poRegression Q a x :
numerator :
∑ arm : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, (if (if a = 0 then y0 else y1) then 1 else 0 : ℝ) * fullMass Q (x, arm, y, y0, y1)
numerator / poCellMass Q x
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:230
def oracleValue

The full-data unrestricted oracle value.

Definition (Lean source)
d :
Q :
oracleValue Q :
∑ x : Fin d, poCellMass Q x * max (poRegression Q 0 x) (poRegression Q 1 x)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.oracleValue · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:237
def Estimator

Measurable estimators for the fixed-sample experiment.

Definition (Lean source)
n d :
Estimator n d :
Type
{f : (Fin n → Obs d) → ℝ // Measurable f}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Estimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:242
def ModelLaw

Observed laws packaged with model-class membership.

Definition (Lean source)
d :
epsilon :
ModelLaw d epsilon :
Type
{P : DiscreteLaw d // ObservedModelClass epsilon P}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ModelLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:245
def observedRisk

Statewise squared-error risk.

Definition (Lean source)
epsilon :
shared
n :
d :
est :
P :
ModelLaw d epsilon
observedRisk epsilon n est P :
sqRisk (productLaw P.1 n) est.1 (observedOptimalValue P.1 P.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:249

Thin paper-local notation for the reused generic minimax value.

Definition (Lean source)
n d :
epsilon :
minimaxRisk n d epsilon :
minimaxValue (observedRisk n (d := d) (epsilon := epsilon))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.minimaxRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:255
def CausalModelLaw

For the specified alphabet size, overlap level, the causal model law is a potential-outcome law belonging to the causal completion class at the chosen overlap level.

Definition (Lean source)
d :
epsilon :
CausalModelLaw d epsilon :
Type
{Q : PotentialLaw d // CausalCompletionClass epsilon Q}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.CausalModelLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:260
def causalRisk

For the specified overlap level, sample size, estimator, rectangle or law, the causal risk is the squared-error risk of the estimator under the observed marginal, with the potential-outcome oracle value as target.

Definition (Lean source)
epsilon :
shared
n :
d :
est :
Q :
CausalModelLaw d epsilon
causalRisk epsilon n est Q :
sqRisk (productLaw (observedMarginal Q.1) n) est.1 (oracleValue Q.1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.causalRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:264

For the specified sample size, alphabet size, overlap level, the causal minimax risk is the minimax squared-error risk over the causal model class.

Definition (Lean source)
n d :
epsilon :
causalMinimaxRisk n d epsilon :
minimaxValue (causalRisk n (d := d) (epsilon := epsilon))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.causalMinimaxRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:269

The logarithmic alphabet scale.

Definition (Lean source)
d :
logAlphabet d :
log (exp 1 * d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.logAlphabet · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Basic.lean:273
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.AlphabetPadding 9 declarations Zero-mass alphabet padding for the paired fixed-sample L1 experiment.

Zero-mass alphabet padding for the paired fixed-sample L1 experiment.

theorem sum_function_extend_embedding_zero

extending a function by zero along an injection preserves its finite sum.

Formal statement
α β :
Type*
e :
α ↪ β
f :
α → ℝ
∑ y, extend e f 0 y = ∑ x, f x
Proof (Lean source)
lemma sum_function_extend_embedding_zero {α β : Type*} [Fintype α] [Fintype β] (e : α ↪ β) (f : α → ℝ) : ∑ y, extend e f 0 y = ∑ x, f x := by classical calc ∑ y, extend e f 0 y = ∑ y ∈ Finset.univ.image e, extend e f 0 y := by symm apply Finset.sum_subset (Finset.image_subset_iff.mpr fun _ _ => Finset.mem_univ _) intro y _ hy have hnot : ¬∃ x, e x = y := by intro hex obtain ⟨x, hx⟩ := hex apply hy exact Finset.mem_image.mpr ⟨x, Finset.mem_univ _, hx⟩ rw [Function.extend_apply' _ _ _ hnot] rfl _ = ∑ x, extend e f 0 (e x) := Finset.sum_image e.injective.injOn _ = ∑ x, f x := by apply Fintype.sum_congr intro x exact Function.Injective.extend_apply e.injective f 0 x
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sum_function_extend_embedding_zero · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:11
def padSimplex

For the specified alphabet embedding certificate, discrete law, the padded simplex point extends a smaller probability vector by zero on the added alphabet cells.

Definition (Lean source)
s d :
hsd :
s ≤ d
padSimplex hsd P :
by let e : Fin s ↪ Fin d := ⟨Fin.castLE hsd, Fin.castLE_injective hsd⟩ let f : Fin d → ℝ := extend e P.1 0 refine ⟨f, ?_, ?_⟩ · intro x dsimp [f] unfold extend split · exact P.2.1 _ · exact le_rfl · dsimp [f] rw [sum_function_extend_embedding_zero, P.2.2]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.padSimplex · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:37
theorem padSimplex_l1Distance

If the stated sd condition holds, then the stated pad simplex l1 distance relation holds.

Formal statement
s d :
hsd :
s ≤ d
l1Distance (padSimplex hsd P) (padSimplex hsd Q) = l1Distance P Q
Proof (Lean source)
lemma padSimplex_l1Distance {s d : ℕ} (hsd : s ≤ d) (P Q : ProbabilitySimplex s) : l1Distance (padSimplex hsd P) (padSimplex hsd Q) = l1Distance P Q := by unfold l1Distance padSimplex dsimp let e : Fin s ↪ Fin d := ⟨Fin.castLE hsd, Fin.castLE_injective hsd⟩ change (∑ x, |extend e P.1 0 x - extend e Q.1 0 x|) = _ rw [← sum_function_extend_embedding_zero e (fun i => |P.1 i - Q.1 i|)] apply Fintype.sum_congr intro x by_cases hx : ∃ i, e i = x · obtain ⟨i, rfl⟩ := hx rw [Function.Injective.extend_apply e.injective, Function.Injective.extend_apply e.injective, Function.Injective.extend_apply e.injective] · rw [Function.extend_apply' _ _ _ hx, Function.extend_apply' _ _ _ hx, Function.extend_apply' _ _ _ hx] simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.padSimplex_l1Distance · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:52
theorem simplexPMF_padSimplex

If the stated sd condition holds, then the stated simplex probability mass pad simplex relation holds.

Formal statement
s d :
hsd :
s ≤ d
Proof (Lean source)
lemma simplexPMF_padSimplex {s d : ℕ} (hsd : s ≤ d) (P : ProbabilitySimplex s) : simplexPMF (padSimplex hsd P) = map (castLE hsd) (simplexPMF P) := by classical apply PMF.ext intro x simp only [simplexPMF, PMF.ofFintype_apply, PMF.map_apply] unfold padSimplex dsimp by_cases hx : ∃ i : Fin s, x = castLE hsd i · obtain ⟨i, rfl⟩ := hx rw [Function.Injective.extend_apply (Fin.castLE_injective hsd)] simp · rw [Function.extend_apply'] · rw [Pi.zero_apply, ENNReal.ofReal_zero] symm rw [ENNReal.tsum_eq_zero] intro a rw [if_neg (fun ha => hx ⟨a, ha⟩)] · simpa [eq_comm] using hx
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.simplexPMF_padSimplex · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:72
theorem map_fixedPairSingle_padSimplex

If the stated sd condition holds, then the stated map fixed pair single pad simplex relation holds.

Formal statement
s d :
hsd :
s ≤ d
Measure.map (map (castLE hsd) (castLE hsd)) ((simplexPMF P).toMeasure.prod (simplexPMF Q).toMeasure)
= (simplexPMF (padSimplex hsd P)).toMeasure.prod (simplexPMF (padSimplex hsd Q)).toMeasure
Proof (Lean source)
lemma map_fixedPairSingle_padSimplex {s d : ℕ} (hsd : s ≤ d) (P Q : ProbabilitySimplex s) : Measure.map (map (castLE hsd) (castLE hsd)) ((simplexPMF P).toMeasure.prod (simplexPMF Q).toMeasure) = (simplexPMF (padSimplex hsd P)).toMeasure.prod (simplexPMF (padSimplex hsd Q)).toMeasure := by rw [simplexPMF_padSimplex, simplexPMF_padSimplex] rw [← PMF.toMeasure_map (castLE hsd) (simplexPMF P) (measurable_of_finite _), ← PMF.toMeasure_map (castLE hsd) (simplexPMF Q) (measurable_of_finite _)] exact (Measure.map_prod_map _ _ (measurable_of_finite _) (measurable_of_finite _)).symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_fixedPairSingle_padSimplex · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:94
def padPairSample

For the specified alphabet embedding certificate, data point or sample, the padded paired sample embeds both coordinates of every smaller-alphabet observation into the larger alphabet.

Definition (Lean source)
n s d :
hsd :
s ≤ d
z :
Fin n → Fin s × Fin s
padPairSample hsd z :
Fin n → Fin d × Fin d
fun i => (castLE hsd (z i).1, castLE hsd (z i).2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.padPairSample · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:106
theorem fixedL1Risk_padSimplex

If the stated sd condition holds, then zero-padding both distributions and the paired sample preserves fixed-sample L1 risk.

Formal statement
n s d :
hsd :
s ≤ d
est :
fixedL1Risk n ⟨fun z
=> est.1 (padPairSample hsd z), measurable_of_finite _⟩ (P, Q) = fixedL1Risk n est (padSimplex hsd P, padSimplex hsd Q)
Proof (Lean source)
lemma fixedL1Risk_padSimplex {n s d : ℕ} (hsd : s ≤ d) (est : FixedL1Estimator n d) (P Q : ProbabilitySimplex s) : fixedL1Risk n ⟨fun z => est.1 (padPairSample hsd z), measurable_of_finite _⟩ (P, Q) = fixedL1Risk n est (padSimplex hsd P, padSimplex hsd Q) := by unfold fixedL1Risk sqRisk fixedPairLaw rw [padSimplex_l1Distance] let mu := (simplexPMF P).toMeasure.prod (simplexPMF Q).toMeasure have hi := integral_comp_finCoordinatewise n mu (phi := map (castLE hsd) (castLE hsd)) (measurable_of_finite _) (fun z => (est.1 z - l1Distance P Q) ^ 2) (measurable_of_finite _) rw [map_fixedPairSingle_padSimplex hsd P Q] at hi have hfun : (fun z : Fin n → Fin s × Fin s => fun i => map (castLE hsd) (castLE hsd) (z i)) = padPairSample hsd := by funext z i rfl convert hi using 1 <;> simp only [mu] congr 1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1Risk_padSimplex · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:111
def simplexPointMass

For the specified smaller alphabet size, nonempty-alphabet certificate, the simplex point mass places all probability on the first cell of a nonempty alphabet.

Definition (Lean source)
s :
hs :
1 ≤ s
simplexPointMass s hs :
by let z : Fin s := ⟨0, hs⟩ refine ⟨fun x
=> if x = z then 1 else 0, ?_, ?_⟩ · intro x dsimp split <;> positivity · simp [z]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.simplexPointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:132
theorem fixedL1MinimaxRisk_mono_alphabet

If the stated support condition holds, and the stated sd condition holds, then fixed-sample L1 minimax risk cannot decrease when the alphabet is enlarged.

Formal statement
n s d :
hs :
1 ≤ s
hsd :
s ≤ d
Proof (Lean source)
lemma fixedL1MinimaxRisk_mono_alphabet {n s d : ℕ} (hs : 1 ≤ s) (hsd : s ≤ d) : fixedL1MinimaxRisk n s ≤ fixedL1MinimaxRisk n d := by classical let P0 := simplexPointMass s hs letI : Nonempty (ProbabilitySimplex s × ProbabilitySimplex s) := ⟨(P0, P0)⟩ letI : Nonempty (FixedL1Estimator n d) := ⟨⟨fun _ => 0, measurable_const⟩⟩ unfold fixedL1MinimaxRisk apply minimaxValue_le_minimaxValue (bddBelow_range_worstCaseRisk fun _ _ => by unfold fixedL1Risk sqRisk positivity) intro est let estSmall : FixedL1Estimator n s := ⟨fun z => est.1 (padPairSample hsd z), measurable_of_finite _⟩ refine ⟨estSmall, ?_⟩ apply worstCaseRisk_le intro PQ calc fixedL1Risk n estSmall PQ = fixedL1Risk n est (padSimplex hsd PQ.1, padSimplex hsd PQ.2) := fixedL1Risk_padSimplex hsd est PQ.1 PQ.2 _ ≤ worstCaseRisk (fixedL1Risk (d := d) n) est := le_worstCaseRisk (fixedL1Risk_bddAbove est) _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1MinimaxRisk_mono_alphabet · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/AlphabetPadding.lean:141
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.CitedGates 2 declarations Explicit cited logical gates.

Explicit cited logical gates. These are propositions, not proved declarations.

Cai and Low (2011), Lemma 1 and Section 3.1, arXiv:1105.3039. Symmetric probability measures on [-1,1] match moments through every positive even degree and attain twice the best absolute-value approximation error; that error is bounded above and below by universal multiples of the reciprocal degree.

Definition (Lean source)
CaiLowAbsoluteMomentPriors :
Sort 0
(∀ (K : ℕ) (hK : Even K), 0 < K → ∃ nu0 nu1 : Measure ℝ, IsProbabilityMeasure nu0 ∧ IsProbabilityMeasure nu1 ∧ nu0 (Icc (-1) 1)ᶜ = 0 ∧ nu1 (Icc (-1) 1)ᶜ = 0 ∧ Measure.map (fun t : ℝ => -t) nu0 = nu0 ∧ Measure.map (fun t : ℝ => -t) nu1 = nu1 ∧ (∀ l ≤ K, ∫ t, t ^ l ∂nu1 = ∫ t, t ^ l ∂nu0) ∧ (∫ t, |t| ∂nu1) - ∫ t, |t| ∂nu0 = 2 * bestEvenApproxError K) ∧
∃ c C : ℝ,
0 < c ∧
c < C ∧
∀ (K : ℕ) (hK : Even K),
0 < K → c / K ≤ bestEvenApproxError K ∧ bestEvenApproxError K ≤ C / K
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.CaiLowAbsoluteMomentPriors · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/CitedGates.lean:11

Jiao, Han, and Weissman (2018), Theorem 3, equation (24), DOI 10.1109/TIT.2018.2846245. The two-sample Poissonized L1 minimax risk has the stated large-alphabet lower rate in the displayed sample-size regime.

Definition (Lean source)
JhwPoissonL1Lower :
Sort 0
∀ c0 C0 : ℝ,
0 < c0 → 0 < C0 → ∃ c1 : ℝ, 0 < c1 ∧ ∀ d n : ℕ, 2
≤ d → c0 * d / log (exp 1 * d) ≤ n → log (exp 1 * n) ≤ C0 * log (exp 1 * d) → c1 * min 1 (d / (n * log (exp 1 * n))) ≤ poissonL1FiniteRiskMinimaxRisk n d
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.JhwPoissonL1Lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/CitedGates.lean:30
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.ConeExtension 7 declarations Four-cell overlap geometry and the global optimal-value extension.

Four-cell overlap geometry and the global optimal-value extension.

def vectorArmMass

Treatment-arm mass of a four-vector.

Definition (Lean source)
u :
Cell → ℝ
a :
Fin 2
vectorArmMass u a :
u (a, 0) + u (a, 1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.vectorArmMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:12
def vectorMass

Total mass of a four-vector.

Definition (Lean source)
u :
Cell → ℝ
vectorMass u :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.vectorMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:16

Nonnegative four-vectors whose treated mass is in the overlap band.

Definition (Lean source)
epsilon :
overlapCone epsilon :
Set (Cell → ℝ)
{u | (∀ j, 0 ≤ u j) ∧ epsilon * vectorMass u ≤ vectorArmMass u 1 ∧ vectorArmMass u 1 ≤ (1 - epsilon) * vectorMass u}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.overlapCone · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:21
def armCellValue

The arm-specific totalized global extension.

Definition (Lean source)
epsilon :
a :
Fin 2
u :
Cell → ℝ
armCellValue epsilon a u :
= 0 then 0 else vectorMass u * u (a, 1) / max (vectorArmMass u a) (epsilon * vectorMass u)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armCellValue · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:28
def globalCellValue

Totalized implementation of the optimal-value cell extension on ambient real vectors.

Definition (Lean source)
epsilon :
u :
Cell → ℝ
globalCellValue epsilon u :
max (armCellValue epsilon 0 u) (armCellValue epsilon 1 u)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.globalCellValue · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:33
def NonnegativeCellVector

The nonnegative four-vector domain appearing in the paper.

Definition (Lean source)
NonnegativeCellVector :
Type
{u : Cell → ℝ // ∀ j, 0 ≤ u j}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.NonnegativeCellVector · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:37
def globalCellValueNonnegative Definition 8 in the paper ↗

The paper-facing global extension on the nonnegative four-vector cone.

Definition (Lean source)
epsilon :
globalCellValueNonnegative epsilon u :
globalCellValue epsilon u.1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.globalCellValueNonnegative · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/ConeExtension.lean:41
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseConstruction 42 declarations Dense sign submodel and the quantities used in its fuzzy-hypothesis lower bound.

Dense sign submodel and the quantities used in its fuzzy-hypothesis lower bound.

def DenseContrast

For the specified alphabet size, the dense contrast is a coordinate vector whose alphabet has at least two cells and whose entries all lie between minus one half and one half.

Definition (Lean source)
d :
DenseContrast d :
Type
{theta : Fin d → ℝ // 2 ≤ d ∧ ∀ x, theta x ∈ Icc (-1 / 2) (1 / 2)}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DenseContrast · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:19
def denseFullMass

For the specified contrast, data point or sample, the dense full-data mass is the consistency-compatible product mass with the two outcome means shifted symmetrically by the contrast, and is zero off the consistency event.

Definition (Lean source)
d :
theta :
z :
denseFullMass theta z :
mu0 :
(1 - theta.1 z.1) / 2
mu1 :
(1 + theta.1 z.1) / 2
if z.2.2.1
= (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) then (d : ℝ)⁻¹ / 2 * bernoulliMass mu0 z.2.2.2.1 * bernoulliMass mu1 z.2.2.2.2 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseFullMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:24
theorem denseFullMass_nonneg_sum

the dense full-data masses are nonnegative and sum to one.

Formal statement
d :
theta :
conclusion 1
z :
0 ≤ denseFullMass theta z
conclusion 2
∑ z : FullObs d, ofReal (denseFullMass theta z) = 1
Proof (Lean source)
lemma denseFullMass_nonneg_sum {d : ℕ} (theta : DenseContrast d) : (∀ z, 0 ≤ denseFullMass theta z) ∧ ∑ z : FullObs d, ofReal (denseFullMass theta z) = 1 := by classical have hd : (d : ℝ) ≠ 0 := by exact_mod_cast (ne_of_gt (lt_of_lt_of_le (by norm_num) theta.2.1)) have hnonneg : ∀ z, 0 ≤ denseFullMass theta z := by rintro ⟨x, a, y, y0, y1⟩ have htheta := theta.2.2 x have hmu0 : 0 ≤ (1 - theta.1 x) / 2 := by linarith [htheta.2] have hmu0' : (1 - theta.1 x) / 2 ≤ 1 := by linarith [htheta.1] have hmu1 : 0 ≤ (1 + theta.1 x) / 2 := by linarith [htheta.1] have hmu1' : (1 + theta.1 x) / 2 ≤ 1 := by linarith [htheta.2] have hdnonneg : 0 ≤ (d : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg d) fin_cases a <;> fin_cases y <;> fin_cases y0 <;> fin_cases y1 <;> simp [denseFullMass, bernoulliMass] <;> positivity constructor · exact hnonneg · rw [← ENNReal.ofReal_sum_of_nonneg (fun z _hz => hnonneg z)] have hsum : ∑ z : FullObs d, denseFullMass theta z = 1 := by rw [Fintype.sum_prod_type] calc ∑ x, ∑ w, denseFullMass theta (x, w) = ∑ _x : Fin d, (d : ℝ)⁻¹ := by apply Finset.sum_congr rfl intro x _hx simp [denseFullMass, bernoulliMass, Fintype.sum_prod_type] ring _ = 1 := by simp [hd] rw [hsum] norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseFullMass_nonneg_sum · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:32

For the specified contrast, the dense law is the potential-outcome probability law induced by the dense full-data masses.

Definition (Lean source)
d :
theta :
denseLaw theta :
⟨PMF.ofFintype (fun z => ofReal (denseFullMass theta z)) (denseFullMass_nonneg_sum theta).2⟩
def EvenDegree

the positive even degree is a positive integer that is even.

Definition (Lean source)
EvenDegree :
Type
{K : ℕ // 0 < K ∧ Even K}
def bestEvenApproxError

For the specified degree, the best even-degree approximation error is the infimum uniform error for approximating absolute value on minus one to one by a polynomial of degree at most K.

Definition (Lean source)
K :
bestEvenApproxError K :
sInf {e : ℝ | ∃ p : Polynomial ℝ, p.natDegree ≤ K ∧ ∀ t ∈ Icc (-1 : ℝ) 1, abs (abs t - p.eval t) ≤ e}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bestEvenApproxError · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:74
def lowerDegree

For the specified alphabet size, the lower approximation degree is twice the ceiling of four times the logarithmic alphabet size.

Definition (Lean source)
d :
lowerDegree d :
2 * ⌈4 * logAlphabet d⌉₊
theorem lowerDegree_even

the lower approximation degree is even.

Formal statement
d :
Even (lowerDegree d)
Proof (Lean source)
lemma lowerDegree_even (d : ℕ) : Even (lowerDegree d) := by exact even_two_mul _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.lowerDegree_even · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:84

In the paper's nontrivial alphabet regime, the dense lower-bound degree is positive. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
2 ≤ d
Proof (Lean source)
lemma lowerDegree_pos (d : ℕ) (hd : 2 ≤ d) : 0 < lowerDegree d := by rw [lowerDegree] apply Nat.mul_pos (by norm_num) apply Nat.ceil_pos.mpr have hdR : (1 : ℝ) < d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have : 1 < exp 1 * (d : ℝ) := by nlinarith [Real.exp_pos 1] exact mul_pos (by norm_num) (Real.log_pos this)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.lowerDegree_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:89
def lowerEvenDegree

The lower-bound degree, packaged in the positive-even carrier in its stated alphabet regime.

Definition (Lean source)
d :
hd :
2 ≤ d
lowerEvenDegree d hd :
⟨lowerDegree d, lowerDegree_pos d hd, lowerDegree_even d⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.lowerEvenDegree · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:99
theorem lowerDegree_log_bounds

Rounding the logarithmic degree to the next even integer changes it by less than two. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
conclusion 1
conclusion 2
lowerDegree d < 8 * logAlphabet d + 2
Proof (Lean source)
lemma lowerDegree_log_bounds (d : ℕ) : 8 * logAlphabet d ≤ lowerDegree d ∧ lowerDegree d < 8 * logAlphabet d + 2 := by have hnonneg : 0 ≤ 4 * logAlphabet d := by by_cases hd : d = 0 · simp [hd, logAlphabet] · have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast Nat.one_le_iff_ne_zero.mpr hd have he : 1 ≤ exp 1 := Real.one_le_exp (by norm_num) exact mul_nonneg (by norm_num) (Real.log_nonneg (by nlinarith)) have hlo := Nat.le_ceil (4 * logAlphabet d) have hhi := Nat.ceil_lt_add_one hnonneg rw [lowerDegree] constructor <;> push_cast <;> nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.lowerDegree_log_bounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:104
def DenseRegime

For the specified sample size, alphabet size, the dense regime holds when the alphabet has at least two cells and its squared size is smaller than the sample size. The alphabet contains at least two cells, and its squared size is below the sample size.

Definition (Lean source)
n d :
DenseRegime n d :
Prop
clause 1
2 ≤ d
clause 2
d ^ 2 < n
def poissonCellIntensity

For the specified sample size, alphabet size, the Poisson cell intensity is twice the sample size divided by the alphabet size.

Definition (Lean source)
n d :
poissonCellIntensity n d :
2 * n / d
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonCellIntensity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:122
def denseAmplitude

For the specified sample size, alphabet size, the dense amplitude is the square root of the lower approximation degree divided by sixty-four times the Poisson cell intensity.

Definition (Lean source)
n d :
denseAmplitude n d :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseAmplitude · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:126

Squaring the dense amplitude removes the square root and gives the paper's exact scale. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
h :
denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n)
Proof (Lean source)
lemma denseAmplitude_sq (n d : ℕ) (h : DenseRegime n d) : denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n) := by have hdNat : 0 < d := lt_of_lt_of_le (by omega) h.1 have hdR : (0 : ℝ) < d := by exact_mod_cast hdNat have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_trans (Nat.pow_pos hdNat) h.2) have hintensity : 0 < poissonCellIntensity n d := by rw [poissonCellIntensity] positivity rw [denseAmplitude, Real.sq_sqrt (by positivity), poissonCellIntensity] field_simp ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseAmplitude_sq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:132
def DenseConstructionDomain

The intrinsic domain on which the scaled priors are laws on the stated contrast cube. The stronger inequality d ^ 2 < n belongs to the lower-bound lemma, not to the construction itself.

Definition (Lean source)
n d :
epsilon :
DenseConstructionDomain n d epsilon :
Prop
clause 1
2 ≤ d
clause 2
0 < epsilon
clause 3
epsilon < 1 / 2
clause 4
clause 5
denseAmplitude n d ≤ 1 / 2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DenseConstructionDomain · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:146
def DenseSignCounts

the dense sign-count pair records the two nonnegative integer counts in a cell.

Definition (Lean source)
DenseSignCounts :
Type
ℕ × ℕ
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DenseSignCounts · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:153
def oneCellLikelihood

The actual likelihood ratio for the two independent sign counts in one dense cell, relative to independent baseline Pois(lambda/2) counts. The exponential factors cancel between the two signs.

Definition (Lean source)
_lambda theta :
oneCellLikelihood _lambda theta r :
(1 + theta) ^ r.1 * (1 - theta) ^ r.2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.oneCellLikelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:156
def denseSignBaseline

For the specified lambda, the dense sign baseline is the product of two independent Poisson laws with equal half-intensity.

Definition (Lean source)
lambda :
denseSignBaseline lambda :
(poissonMeasure (lambda / 2).toNNReal).prod (poissonMeasure (lambda / 2).toNNReal)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSignBaseline · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:163

The probability generating function of a scalar Poisson count, in the real-valued form needed by the dense likelihood calculation. The displayed identity or bound is the asserted conclusion.

Formal statement
r :
c :
(∫ N : ℕ, c ^ N ∂ProbabilityTheory.poissonMeasure r) = exp ((r : ℝ) * (c - 1))
Proof (Lean source)
lemma poisson_power_mgf (r : NNReal) (c : ℝ) : (∫ N : ℕ, c ^ N ∂ProbabilityTheory.poissonMeasure r) = exp ((r : ℝ) * (c - 1)) := by rw [ProbabilityTheory.integral_poissonMeasure] simp only [smul_eq_mul] rw [show (fun n : ℕ => exp (-(r : ℝ)) * (r : ℝ) ^ n / (n.factorial : ℝ) * c ^ n) = fun n => exp (-(r : ℝ)) * (((r : ℝ) * c) ^ n / (n.factorial : ℝ)) by funext n rw [mul_pow] ring] rw [tsum_mul_left] rw [show (∑' n : ℕ, ((r : ℝ) * c) ^ n / (n.factorial : ℝ)) = exp ((r : ℝ) * c) by simpa only [Real.exp_eq_exp_ℝ] using (NormedSpace.expSeries_div_hasSum_exp ((r : ℝ) * c)).tsum_eq] rw [← Real.exp_add] congr 1 ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poisson_power_mgf · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:169
theorem oneCellLikelihood_inner Lemma oneCellLikelihood_inner in the paper ↗

The two independent Poisson sign counts have the exponential likelihood Gram kernel used by the moment-matching substrate. This uses the Poisson intensity is nonnegative. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda theta theta' :
hlambda :
0 ≤ lambda
(∫ r : DenseSignCounts, oneCellLikelihood lambda theta r * oneCellLikelihood lambda theta' r ∂denseSignBaseline lambda)
= exp (lambda * theta * theta')
Proof (Lean source)
lemma oneCellLikelihood_inner (lambda theta theta' : ℝ) (hlambda : 0 ≤ lambda) : (∫ r : DenseSignCounts, oneCellLikelihood lambda theta r * oneCellLikelihood lambda theta' r ∂denseSignBaseline lambda) = exp (lambda * theta * theta') := by let lam : NNReal := lambda.toNNReal / 2 have hlam : (lam : ℝ) = lambda / 2 := by simp [lam, Real.coe_toNNReal lambda hlambda] have hparam : (lambda / 2).toNNReal = lam := by apply NNReal.eq rw [Real.coe_toNNReal _ (div_nonneg hlambda (by norm_num)), hlam] rw [show denseSignBaseline lambda = (poissonMeasure lam).prod (poissonMeasure lam) by simp only [denseSignBaseline, hparam]] rw [show (fun r : DenseSignCounts => oneCellLikelihood lambda theta r * oneCellLikelihood lambda theta' r) = fun r => (((1 + theta) * (1 + theta')) ^ r.1) * (((1 - theta) * (1 - theta')) ^ r.2) by funext r simp only [oneCellLikelihood] rw [mul_pow, mul_pow] ring] rw [MeasureTheory.integral_prod_mul] rw [poisson_power_mgf, poisson_power_mgf, ← Real.exp_add, hlam] congr 1 ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.oneCellLikelihood_inner · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:193
theorem denseAmplitude_range Lemma 9 in the paper ↗

the stated dense amplitude range relation holds.

Formal statement
n d :
h :
conclusion 1
conclusion 2
denseAmplitude n d ≤ 1 / 2
Proof (Lean source)
lemma denseAmplitude_range (n d : ℕ) (h : DenseRegime n d) : 0 < denseAmplitude n d ∧ denseAmplitude n d ≤ 1 / 2 := by rcases h with ⟨hd, hn⟩ have hdNat : 0 < d := lt_of_lt_of_le (by norm_num) hd have hdR : 0 < (d : ℝ) := by exact_mod_cast hdNat have hnR : (d : ℝ) ^ 2 < (n : ℝ) := by exact_mod_cast hn have hlogd : log (d : ℝ) ≤ (d : ℝ) - 1 := Real.log_le_sub_one_of_pos hdR have hlog_eq : logAlphabet d = 1 + log (d : ℝ) := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdR), Real.log_exp] have hlog_le : logAlphabet d ≤ (d : ℝ) := by linarith have hlog_pos : 0 < logAlphabet d := by rw [logAlphabet] exact Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [show (2 : ℝ) ≤ d by exact_mod_cast hd]) have hceil_pos : 0 < ⌈4 * logAlphabet d⌉₊ := Nat.ceil_pos.mpr (mul_pos (by norm_num) hlog_pos) have hdegree_pos_nat : 0 < lowerDegree d := by rw [lowerDegree] exact Nat.mul_pos (by norm_num) hceil_pos have hdegree_pos : 0 < (lowerDegree d : ℝ) := by exact_mod_cast hdegree_pos_nat have hceil_le : ⌈4 * logAlphabet d⌉₊ ≤ 4 * d := by rw [Nat.ceil_le] push_cast linarith have hdegree_le : (lowerDegree d : ℝ) ≤ 8 * d := by rw [lowerDegree] push_cast nlinarith [show (⌈4 * logAlphabet d⌉₊ : ℝ) ≤ 4 * d by exact_mod_cast hceil_le] have hnNat : 0 < n := by omega have hnR0 : 0 < (n : ℝ) := by exact_mod_cast hnNat have hintensity_pos : 0 < poissonCellIntensity n d := by rw [poissonCellIntensity] exact div_pos (mul_pos (by norm_num) hnR0) hdR have hratio_pos : 0 < (lowerDegree d : ℝ) / (64 * poissonCellIntensity n d) := div_pos hdegree_pos (mul_pos (by norm_num) hintensity_pos) have hratio_le : (lowerDegree d : ℝ) / (64 * poissonCellIntensity n d) ≤ (1 / 2 : ℝ) ^ 2 := by rw [show (1 / 2 : ℝ) ^ 2 = 1 / 4 by norm_num] apply (div_le_iff₀ (mul_pos (by norm_num) hintensity_pos)).2 rw [poissonCellIntensity] rw [show (1 / 4 : ℝ) * (64 * (2 * n / d)) = 32 * n / d by ring] apply (le_div_iff₀ hdR).2 nlinarith [mul_nonneg (sub_nonneg.mpr hdegree_le) (le_of_lt hdR)] rw [denseAmplitude] constructor · exact Real.sqrt_pos.2 hratio_pos · rw [Real.sqrt_le_iff] exact ⟨by norm_num, hratio_le⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseAmplitude_range · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:222
theorem denseConstructionDomain_of_regime Lemma denseConstructionDomain_of_regime in the paper ↗

The dense sample-size regime and overlap inequalities discharge the construction domain. This uses the sample size and alphabet lie in the dense regime, and the overlap parameter satisfies its stated range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
Proof (Lean source)
lemma denseConstructionDomain_of_regime (n d : ℕ) (epsilon : ℝ) (hregime : DenseRegime n d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) : DenseConstructionDomain n d epsilon := by exact ⟨hregime.1, hepsilon.1, hepsilon.2, (denseAmplitude_range n d hregime).1, (denseAmplitude_range n d hregime).2⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseConstructionDomain_of_regime · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:276
def densePriorSeparation

For the specified sample size, alphabet size, the dense prior separation is the dense amplitude times the best even-polynomial approximation error.

Definition (Lean source)
n d :
densePriorSeparation n d :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorSeparation · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:283
theorem densePriorSeparation_range

If the stated e condition holds, then the stated dense prior separation range relation holds.

Formal statement
n d :
h :
conclusion 1
conclusion 2
Proof (Lean source)
lemma densePriorSeparation_range (n d : ℕ) (h : DenseRegime n d) (hE : 0 < bestEvenApproxError (lowerDegree d)) : 0 < densePriorSeparation n d ∧ densePriorSeparation n d ≤ 1 := by have ha := denseAmplitude_range n d h have hE_le : bestEvenApproxError (lowerDegree d) ≤ 1 := by unfold bestEvenApproxError apply csInf_le · refine ⟨0, ?_⟩ rintro e ⟨p, hpdeg, hp⟩ have hzero := hp 0 (by constructor <;> norm_num) have hzero' : |eval 0 p| ≤ e := by simpa only [abs_zero, zero_sub, abs_neg] using hzero exact (abs_nonneg _).trans hzero' · refine ⟨0, by simp, ?_⟩ intro t ht simpa using (abs_le.mpr ht) unfold densePriorSeparation constructor · exact mul_pos ha.1 hE · nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorSeparation_range · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:288
def denseScaledProductPrior

For the specified sample size, alphabet size, overlap level, domain certificate, coordinate prior, the scaled dense product prior is the coordinatewise product prior, restricted to the unit cube, scaled by the dense amplitude, and mapped into the contrast class.

Definition (Lean source)
n d :
epsilon :
hdom :
nu :
denseScaledProductPrior n d epsilon hdom nu :
Measure.map (fun t => if ht : ∀ j, t j ∈ Icc (-1 : ℝ) 1 then ⟨fun j => denseAmplitude n d * t j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (ht j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (ht j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ else ⟨fun _ => 0, hdom.1, by intro; norm_num⟩) ((Measure.pi (fun _ : Fin d => nu)).restrict {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1})
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseScaledProductPrior · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:311
def DensePoissonSample

For the specified alphabet size, the dense Poisson sample is a finite marked Poisson sample on the observed-data space.

Definition (Lean source)
d :
DensePoissonSample d :
Type
FiniteSample (Obs d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DensePoissonSample · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:328
def DensePoissonEstimator

For the specified alphabet size, the dense Poisson estimator is a measurable real-valued statistic of the dense Poisson sample.

Definition (Lean source)
d :
DensePoissonEstimator d :
Type
{f : DensePoissonSample d → ℝ // Measurable f}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DensePoissonEstimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:332
def poissonObservedRisk

For the specified Poisson mean, estimator, discrete law, the Poisson observed risk is squared-error risk of the clipped dense estimator under the finite Poisson observed-sample law.

Definition (Lean source)
mean :
d :
epsilon :
P :
ModelLaw d epsilon
poissonObservedRisk mean est P :
sqRisk (finitePoissonSampleLaw (obsLaw P.1) (toNNReal mean)) (fun sample => max 0 (min 1 (est.1 sample))) (observedOptimalValue P.1 P.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonObservedRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:336
def poissonOptimalValueRisk Definition 22 in the paper ↗

Minimax squared risk in the genuine experiment with an independent Poisson sample size having the displayed mean.

Definition (Lean source)
mean d :
epsilon :
poissonOptimalValueRisk mean d epsilon :
minimaxValue (poissonObservedRisk mean (d := d) (epsilon := epsilon))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonOptimalValueRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:345
theorem denseObservationKernel_exists

If the alphabet size satisfies its stated restriction, then the stated dense observation kernel exists relation holds.

Formal statement
n d :
hd :
2 ≤ d
Proof (Lean source)
lemma denseObservationKernel_exists (n d : ℕ) (hd : 2 ≤ d) : ∃ K : Kernel (DenseContrast d) (DensePoissonSample d), ∀ theta, K theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) := by classical let P : DenseContrast d → Measure (Obs d) := fun theta ↦ obsLaw (observedMarginal (denseLaw theta)) have hdenseMass (z : FullObs d) : Measurable (fun theta : DenseContrast d ↦ denseFullMass theta z) := by rcases z with ⟨x, a, y, y0, y1⟩ have htheta : Measurable (fun theta : DenseContrast d ↦ theta.1 x) := (measurable_pi_apply x).comp measurable_subtype_coe have hmu0 : Measurable (fun theta : DenseContrast d ↦ (1 - theta.1 x) / 2) := (measurable_const.sub htheta).div_const 2 have hmu1 : Measurable (fun theta : DenseContrast d ↦ (1 + theta.1 x) / 2) := (measurable_const.add htheta).div_const 2 have hb0 : Measurable (fun theta : DenseContrast d ↦ bernoulliMass ((1 - theta.1 x) / 2) y0) := by cases y0 · change Measurable ((fun _ : DenseContrast d ↦ (1 : ℝ)) - fun theta ↦ (1 - theta.1 x) / 2) exact measurable_const.sub hmu0 · simpa [bernoulliMass] using hmu0 have hb1 : Measurable (fun theta : DenseContrast d ↦ bernoulliMass ((1 + theta.1 x) / 2) y1) := by cases y1 · change Measurable ((fun _ : DenseContrast d ↦ (1 : ℝ)) - fun theta ↦ (1 + theta.1 x) / 2) exact measurable_const.sub hmu1 · simpa [bernoulliMass] using hmu1 by_cases hmatch : y = (if a then y1 else y0) · simp only [denseFullMass, hmatch, if_pos] change Measurable (((fun _ : DenseContrast d ↦ (d : ℝ)⁻¹ / 2) * fun theta ↦ bernoulliMass ((1 - theta.1 x) / 2) y0) * fun theta ↦ bernoulliMass ((1 + theta.1 x) / 2) y1) exact (measurable_const.mul hb0).mul hb1 · simp [denseFullMass, hmatch] have hP : ∀ z, Measurable (fun theta ↦ P theta {z}) := by intro z rw [show (fun theta ↦ P theta {z}) = fun theta ↦ (observedMarginal (denseLaw theta)).pmf z by funext theta exact PMF.toMeasure_apply_singleton _ _ (MeasurableSet.singleton _)] simp only [observedMarginal, denseLaw, PMF.map_ofFintype, PMF.ofFintype_apply] apply measurable_sum intro w _hw exact ENNReal.measurable_ofReal.comp (hdenseMass w) refine ⟨CausalSmith.Mathlib.Probability.parameterizedFinitePoissonSampleKernel P hP (toNNReal (2 * n)), ?_⟩ intro theta rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationKernel_exists · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:351
def denseObservationKernel

For the specified sample size, alphabet size, alphabet-size certificate, the dense observation kernel sends each contrast to its finite Poisson observed-sample law.

Definition (Lean source)
n d :
hd :
2 ≤ d
denseObservationKernel n d hd :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:408
def denseObservationMixture

Observation mixture induced by a scaled product prior and an independent Pois(2n) sample.

Definition (Lean source)
n d :
hd :
2 ≤ d
epsilon :
hdom :
nu :
denseObservationMixture n d hd epsilon hdom nu :
denseObservationKernel n d hd ∘ₘ denseScaledProductPrior n d epsilon hdom nu
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationMixture · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:413
def denseTargetAt

For the specified contrast, the dense target is one half plus the average absolute contrast divided by two.

Definition (Lean source)
d :
theta :
denseTargetAt theta :
1 / 2 + (∑ x : Fin d, |theta.1 x|) / (2 * d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseTargetAt · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:420
def densePriorTargetMean

For the specified sample size, alphabet size, overlap level, domain certificate, coordinate prior, the dense prior target mean is the expectation of the dense target under the scaled product prior.

Definition (Lean source)
n d :
epsilon :
hdom :
nu :
densePriorTargetMean n d epsilon hdom nu :
theta, denseTargetAt theta ∂denseScaledProductPrior n d epsilon hdom nu
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorTargetMean · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:424
theorem densePriorTargetMean_formula Lemma densePriorTargetMean_formula in the paper ↗

Under a supported probability prior, the dense target mean is the baseline one half plus the scaled sum of the one-coordinate absolute moments. This uses the dense construction domain conditions hold, and the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
hsupp :
nu (Icc (-1) 1)ᶜ = 0
densePriorTargetMean n d epsilon hdom nu
= 1 / 2 + denseAmplitude n d / (2 * d) * ∑ _x : Fin d, ∫ t, |t| ∂nu
Proof (Lean source)
lemma densePriorTargetMean_formula (n d : ℕ) (epsilon : ℝ) (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : densePriorTargetMean n d epsilon hdom nu = 1 / 2 + denseAmplitude n d / (2 * d) * ∑ _x : Fin d, ∫ t, |t| ∂nu := by let mu : Measure (Fin d → ℝ) := Measure.pi (fun _ : Fin d => nu) letI : IsProbabilityMeasure mu := by dsimp [mu]; infer_instance have hmem : ∀ᵐ t ∂mu, ∀ j, t j ∈ Icc (-1 : ℝ) 1 := by have hj : ∀ j : Fin d, ∀ᵐ t ∂mu, t j ∈ Icc (-1 : ℝ) 1 := by intro j have hs : ∀ᵐ x ∂nu, x ∈ Icc (-1 : ℝ) 1 := by exact mem_ae_iff.mpr hsupp exact (MeasureTheory.measurePreserving_eval (fun _ : Fin d => nu) j).quasiMeasurePreserving.ae hs exact ae_all_iff.mpr hj have hrestrict : mu.restrict {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} = mu := Measure.restrict_eq_self_of_ae_mem hmem rw [densePriorTargetMean, denseScaledProductPrior, hrestrict] rw [integral_map] · calc _ = ∫ t : Fin d → ℝ, (1 / 2 + (∑ x : Fin d, |denseAmplitude n d * t x|) / (2 * d)) ∂mu := by apply integral_congr_ae filter_upwards [hmem] with t ht rw [dif_pos ht] rfl _ = 1 / 2 + denseAmplitude n d / (2 * d) * ∑ _x : Fin d, ∫ t, |t| ∂nu := by have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hcoord : ∀ x : Fin d, Integrable (fun t : Fin d → ℝ => |t x|) mu := by intro x refine (integrable_const (μ := mu) (1 : ℝ)).mono' (continuous_abs.measurable.comp (measurable_pi_apply x)).aestronglyMeasurable ?_ filter_upwards [hmem] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (abs_nonneg _)] exact abs_le.mpr (ht x) have habs : ∀ x : Fin d, ∫ t : Fin d → ℝ, |t x| ∂mu = ∫ t : ℝ, |t| ∂nu := by intro x have hmp := MeasureTheory.measurePreserving_eval (fun _ : Fin d => nu) x have hsm : AEStronglyMeasurable abs (Measure.map (Function.eval x) (Measure.pi fun _ : Fin d => nu)) := by rw [hmp.map_eq] exact continuous_abs.measurable.aestronglyMeasurable have hm := integral_map hmp.aemeasurable hsm rw [hmp.map_eq] at hm exact hm.symm simp_rw [abs_mul, abs_of_nonneg ha0] rw [integral_add (integrable_const (1 / 2)) ((integrable_finsetSum univ fun x _ => (hcoord x).const_mul (denseAmplitude n d)).div_const (2 * d))] have hdiv : (∫ a : Fin d → ℝ, (∑ i, denseAmplitude n d * |a i|) / (2 * d) ∂mu) = (∫ a : Fin d → ℝ, ∑ i, denseAmplitude n d * |a i| ∂mu) / (2 * d) := integral_div (2 * (d : ℝ)) _ rw [hdiv, integral_finsetSum univ (fun x _ => (hcoord x).const_mul (denseAmplitude n d))] simp only [integral_const] simp_rw [integral_const_mul, habs] rw [show mu.real univ = 1 by simp [Measure.real]] rw [← Finset.mul_sum] ring · apply Measurable.aemeasurable let S : Set (Fin d → ℝ) := {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} have htrue : Measurable (fun t : S => (⟨fun j => denseAmplitude n d * t.1 j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (t.2 j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (t.2 j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ : DenseContrast d)) := by apply Measurable.subtype_mk apply measurable_pi_lambda intro j exact measurable_const.mul ((measurable_pi_apply j).comp measurable_subtype_coe) have hS : MeasurableSet S := by dsimp [S] convert MeasurableSet.iInter (fun j : Fin d => (measurableSet_Icc : MeasurableSet (Icc (-1 : ℝ) 1)).preimage (measurable_pi_apply j)) using 1 <;> ext t <;> simp exact htrue.dite measurable_const hS · apply Measurable.aestronglyMeasurable unfold denseTargetAt apply Measurable.add measurable_const apply Measurable.div_const apply measurable_sum intro j _hj exact continuous_abs.measurable.comp ((measurable_pi_apply j).comp measurable_subtype_coe)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorTargetMean_formula · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:430
def DensePriorPairConditions

The probability, support, symmetry, moment-matching, and absolute-gap clauses stated for the two dense priors at the fixed lower-bound degree.

Definition (Lean source)
K :
nu0 nu1 :
DensePriorPairConditions K nu0 nu1 :
Prop
clause 3
nu0 (Icc (-1) 1)ᶜ = 0
clause 4
nu1 (Icc (-1) 1)ᶜ = 0
clause 5
Measure.map (fun t : ℝ => -t) nu0 = nu0
clause 6
Measure.map (fun t : ℝ => -t) nu1 = nu1
clause 7
l ≤ K :
∫ t, t ^ l ∂nu1 = ∫ t, t ^ l ∂nu0
clause 8
(∫ t, |t| ∂nu1) - ∫ t, |t| ∂nu0 = 2 * bestEvenApproxError K
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DensePriorPairConditions · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:523
structure DensePriorFamily

An exact characterization of the Hahn--Banach prior pair at every even degree, before the lower-bound construction specializes the family.

Definition (Lean source)
nu0 :
nu1 :
conditions :
∀ K : EvenDegree, DensePriorPairConditions K.1 (nu0 K) (nu1 K)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DensePriorFamily · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:534
structure DenseMomentMatchingConstruction

The complete dense moment-matching construction at one even degree, including the hard submodel, two scaled priors and mixtures, the Poissonized experiment, and the prior target-mean separation.

Definition (Lean source)
n d :
epsilon :
domain :
law :
approximationError :
degree :
intensity :
amplitude :
nu0 :
nu1 :
prior0 :
prior1 :
mixture0 :
mixture1 :
poissonizedRisk :
priorMeanSeparation :
priorConditions :
degree_eq :
degree = lowerDegree d
priorMeanSeparation_eq :
priorMeanSeparation = densePriorSeparation n d
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DenseMomentMatchingConstruction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:541

For the specified sample size, alphabet size, overlap level, domain certificate, moment-matching prior family, the dense submodel is the moment-matching construction assembled from the dense law, approximation degree, scaled priors, mixtures, target separation, and their certificates. Its components are the domain certificate, the dense law, the approximation error, the approximation degree, the Poisson intensity, the dense amplitude, the first coordinate prior, the second coordinate prior, the first scaled product prior, the second scaled product prior, the first observation mixture, the second observation mixture, the Poissonized risk, the prior target separation, the prior conditions, the degree identity, the target-separation identity.

Definition (Lean source)
n d :
epsilon :
hdom :
priors :
denseSubmodel n d epsilon hdom priors :
clause 1
domain := hdom
clause 2
law := denseLaw
clause 3
approximationError := bestEvenApproxError (lowerDegree d)
clause 4
clause 5
intensity := poissonCellIntensity n d
clause 6
amplitude := denseAmplitude n d
clause 7
nu0 := priors.nu0 (lowerEvenDegree d hdom.1)
clause 8
nu1 := priors.nu1 (lowerEvenDegree d hdom.1)
clause 9
prior0 := denseScaledProductPrior n d epsilon hdom (priors.nu0 (lowerEvenDegree d hdom.1))
clause 10
prior1 := denseScaledProductPrior n d epsilon hdom (priors.nu1 (lowerEvenDegree d hdom.1))
clause 11
mixture0 := denseObservationMixture n d hdom.1 epsilon hdom (priors.nu0 (lowerEvenDegree d hdom.1))
clause 12
mixture1 := denseObservationMixture n d hdom.1 epsilon hdom (priors.nu1 (lowerEvenDegree d hdom.1))
clause 13
poissonizedRisk := poissonOptimalValueRisk (2 * n) d epsilon
clause 14
priorMeanSeparation := densePriorTargetMean n d epsilon hdom (priors.nu1 (lowerEvenDegree d hdom.1))
- densePriorTargetMean n d epsilon hdom (priors.nu0 (lowerEvenDegree d hdom.1))
clause 15
priorConditions := priors.conditions (lowerEvenDegree d hdom.1)
clause 16
degree_eq := rfl
clause 17
priorMeanSeparation_eq := by let K : EvenDegree := lowerEvenDegree d hdom.1 have hc := priors.conditions K letI : IsProbabilityMeasure (priors.nu0 K) := hc.1 letI : IsProbabilityMeasure (priors.nu1 K) := hc.2.1 rw [densePriorTargetMean_formula n d epsilon hdom (priors.nu1 K) hc.2.2.2.1, densePriorTargetMean_formula n d epsilon hdom (priors.nu0 K) hc.2.2.1] rcases hc with ⟨_hp0, _hp1, _hs0, _hs1, _hy0, _hy1, _hmom, hgap⟩ have hd0 : (d : ℝ)
≠ 0 := by exact_mod_cast (Nat.ne_of_gt (lt_of_lt_of_le (by norm_num) hdom.1)) simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] unfold densePriorSeparation change _ = denseAmplitude n d * bestEvenApproxError K.1 field_simp [hd0] linear_combination denseAmplitude n d * hgap
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSubmodel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:564
def densePriorMeanSeparation

Difference of the two target means for the priors bundled by the constructed dense experiment, rather than for arbitrary measures.

Definition (Lean source)
n d :
epsilon :
densePriorMeanSeparation C :
C.priorMeanSeparation
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorMeanSeparation · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:609
def denseLikelihoodTail

For the specified sample size, alphabet size, the dense likelihood tail is the exponential-series remainder above the lower approximation degree.

Definition (Lean source)
n d :
denseLikelihoodTail n d :
∑' r : ℕ, if lowerDegree d + 1
≤ r then (poissonCellIntensity n d * denseAmplitude n d ^ 2) ^ r / factorial r else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLikelihoodTail · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseConstruction.lean:616
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseDepoissonization 7 declarations Exact prefix-law substrate for the dense fixed/Poisson risk transfer.

Exact prefix-law substrate for the dense fixed/Poisson risk transfer.

The first n observations of a finite sample, totalized by a fallback array when the sample contains fewer than n points.

Definition (Lean source)
X :
x0 :
X
n :
s :
fixedPrefixObservations x0 n s :
Fin n → X
if h : n ≤ s.count then fun k => s.points (castLE h k) else fun _ => x0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedPrefixObservations · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:13
theorem measurable_fixedPrefixObservations

The totalized fixed-prefix map is measurable. The displayed identity or bound is the asserted conclusion.

Formal statement
X :
x0 :
X
n :
Measurable (fixedPrefixObservations x0 n : FiniteSample X → Fin n → X)
Proof (Lean source)
@[fun_prop] lemma measurable_fixedPrefixObservations {X : Type*} [MeasurableSpace X] (x0 : X) (n : ℕ) : Measurable (fixedPrefixObservations x0 n : FiniteSample X → Fin n → X) := by unfold fixedPrefixObservations apply measurable_pi_lambda intro k t ht rw [MeasurableSpace.measurableSet_iInf] intro m change MeasurableSet ((fun x : Fin m → X => (if h : n ≤ m then fun k => x (castLE h k) else fun _ => x0) k) ⁻¹' t) by_cases h : n ≤ m · simp only [dif_pos h] exact ht.preimage (measurable_pi_apply (castLE h k)) · simp only [dif_neg h] exact measurable_const ht
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_fixedPrefixObservations · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:20
theorem map_fixedPrefixObservations_restrict_count_ge

On the event that a finite Poisson sample contains at least n points, its first n observations have the unnormalised n-fold product law. This uses the stated lam condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
X :
lam :
ℝ≥0
x0 :
X
n :
Measure.map (fixedPrefixObservations x0 n) ((finitePoissonSampleLaw P lam).restrict (FiniteSample.count ⁻¹' Ici n))
= (poissonMeasure lam) (Ici n) • Measure.pi (fun _ : Fin n => P)
Proof (Lean source)
lemma map_fixedPrefixObservations_restrict_count_ge {X : Type*} [MeasurableSpace X] (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (x0 : X) (n : ℕ) : Measure.map (fixedPrefixObservations x0 n) ((finitePoissonSampleLaw P lam).restrict (FiniteSample.count ⁻¹' Ici n)) = (poissonMeasure lam) (Ici n) • Measure.pi (fun _ : Fin n => P) := by unfold finitePoissonSampleLaw rw [Measure.restrict_map measurable_streamToFiniteSample (measurable_finiteSample_count (measurableSet_Ici))] rw [Measure.map_map (measurable_fixedPrefixObservations x0 n) measurable_streamToFiniteSample] have hpre : streamToFiniteSample ⁻¹' (FiniteSample.count ⁻¹' Ici n) = Ici n ×ˢ (Set.univ : Set (ℕ → X)) := by ext z simp [streamToFiniteSample, FiniteSample.count] rw [hpre] unfold poissonIIDStreamLaw rw [← Measure.restrict_prod_eq_prod_univ] have hmprod : ∀ᵐ z ∂((poissonMeasure lam).restrict (Ici n)).prod (iidStreamLaw P), z.1 ∈ Ici n := Measure.quasiMeasurePreserving_fst.ae (ae_restrict_mem measurableSet_Ici) have hmapcongr : fixedPrefixObservations x0 n ∘ streamToFiniteSample =ᵐ[ ((poissonMeasure lam).restrict (Ici n)).prod (iidStreamLaw P)] (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) := by filter_upwards [hmprod] with z hz change n ≤ z.1 at hz unfold fixedPrefixObservations streamToFiniteSample FiniteSample.count FiniteSample.points simp only [Function.comp_apply] simp [hz] rw [Measure.map_congr hmapcongr] rw [show (fun z : ℕ × (ℕ → X) => fun i : Fin n => z.2 i) = (fun stream : ℕ → X => fun i : Fin n => stream i) ∘ snd by rfl, ← Measure.map_map (by fun_prop) (by fun_prop), Measure.map_snd_prod, Measure.map_smul, iidStreamLaw_map_finPrefix] rw [Measure.restrict_apply_univ]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_fixedPrefixObservations_restrict_count_ge · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:39

A fixed-sample estimator applied to the first n points of a Poisson sample, with zero output when the Poisson sample is too short.

Definition (Lean source)
n d :
x0 :
Obs d
est :
densePrefixPoissonEstimator x0 est :
⟨fun s
=> if n ≤ s.count then est.1 (fixedPrefixObservations x0 n s) else 0, by apply Measurable.ite · exact measurable_finiteSample_count measurableSet_Ici · exact est.2.comp (measurable_fixedPrefixObservations x0 n) · exact measurable_const⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePrefixPoissonEstimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:78
theorem sq_clip_unitInterval_le_denseDepoissonization Lemma sq_clip_unitInterval_le_denseDepoissonization in the paper ↗

Projection to the unit interval cannot increase squared distance from a point already in that interval. This uses the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
x theta :
htheta :
theta ∈ Icc (0 : ℝ) 1
(max 0 (min 1 x) - theta) ^ 2 ≤ (x - theta) ^ 2
Proof (Lean source)
lemma sq_clip_unitInterval_le_denseDepoissonization (x theta : ℝ) (htheta : theta ∈ Icc (0 : ℝ) 1) : (max 0 (min 1 x) - theta) ^ 2 ≤ (x - theta) ^ 2 := by by_cases hx0 : x ≤ 0 · rw [min_eq_right (hx0.trans (by norm_num)), max_eq_left hx0] have hfac : 0 ≤ (-x) * (2 * theta - x) := mul_nonneg (by linarith) (by linarith [htheta.1]) nlinarith by_cases hx1 : 1 ≤ x · rw [min_eq_left hx1, max_eq_right (by norm_num : (0 : ℝ) ≤ 1)] have hfac : 0 ≤ (x - 1) * (x + 1 - 2 * theta) := mul_nonneg (by linarith) (by linarith [htheta.2]) nlinarith · rw [min_eq_right (le_of_not_ge hx1), max_eq_right (le_of_not_ge hx0)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sq_clip_unitInterval_le_denseDepoissonization · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:90
theorem poissonObservedRisk_densePrefix_le

Applying a fixed-sample estimator to a successful Poisson prefix costs at most its fixed-sample risk; the short-sample event costs at most its probability. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
est :
P :
ModelLaw d epsilon
poissonObservedRisk (2 * n) (densePrefixPoissonEstimator (⟨0, by have hd := P.2.d_ge_two; omega⟩, false, false) est) P
observedRisk n (d := d) (epsilon := epsilon) est P
+ (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal
Proof (Lean source)
lemma poissonObservedRisk_densePrefix_le {n d : ℕ} {epsilon : ℝ} (est : Estimator n d) (P : ModelLaw d epsilon) : poissonObservedRisk (2 * n) (densePrefixPoissonEstimator (⟨0, by have hd := P.2.d_ge_two; omega⟩, false, false) est) P ≤ observedRisk n (d := d) (epsilon := epsilon) est P + (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal := by let mu := finitePoissonSampleLaw (obsLaw P.1) (toNNReal (2 * n)) let good : Set (DensePoissonSample d) := FiniteSample.count ⁻¹' Ici n let theta := observedOptimalValue P.1 P.2 let x0 : Obs d := (⟨0, by have hd := P.2.d_ge_two; omega⟩, false, false) have htheta : theta ∈ Icc (0 : ℝ) 1 := observedOptimalValue_mem_unitInterval P.1 P.2 have hgood : MeasurableSet good := measurable_finiteSample_count measurableSet_Ici let loss : DensePoissonSample d → ℝ := fun s => (max 0 (min 1 ((densePrefixPoissonEstimator x0 est).1 s)) - theta) ^ 2 have hloss_meas : Measurable loss := by dsimp [loss] fun_prop have hloss_le : ∀ s, loss s ≤ 1 := by intro s have hs : max 0 (min 1 ((densePrefixPoissonEstimator x0 est).1 s)) ∈ Icc (0 : ℝ) 1 := ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ dsimp [loss] rw [← sq_abs] have habs : |max 0 (min 1 ((densePrefixPoissonEstimator x0 est).1 s)) - theta| ≤ 1 := by rw [abs_sub_le_iff] constructor <;> linarith [hs.1, hs.2, htheta.1, htheta.2] calc |max 0 (min 1 ((densePrefixPoissonEstimator x0 est).1 s)) - theta| ^ 2 ≤ (1 : ℝ) ^ 2 := (sq_le_sq₀ (abs_nonneg _) (by norm_num)).2 habs _ = 1 := by norm_num have hloss_int : Integrable loss mu := by refine (integrable_const (1 : ℝ)).mono' hloss_meas.aestronglyMeasurable ?_ filter_upwards [] with s rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact hloss_le s have hsplit : (∫ s, loss s ∂mu) = ∫ s, loss s ∂mu.restrict good + ∫ s, loss s ∂mu.restrict goodᶜ := by rw [← integral_add_measure hloss_int.restrict hloss_int.restrict, Measure.restrict_add_restrict_compl hgood] have hgood_loss : ∀ᵐ s ∂mu.restrict good, loss s = (max 0 (min 1 (est.1 (fixedPrefixObservations x0 n s))) - theta) ^ 2 := by filter_upwards [ae_restrict_mem hgood] with s hs change n ≤ s.count at hs simp [loss, densePrefixPoissonEstimator, x0, hs] have hgood_eq : (∫ s, loss s ∂mu.restrict good) = (poissonMeasure (toNNReal (2 * n)) (Ici n)).toReal * Causalean.Stat.sqRisk (productLaw P.1 n) (fun z => max 0 (min 1 (est.1 z))) theta := by rw [integral_congr_ae hgood_loss] let fixedLoss : (Fin n → Obs d) → ℝ := fun z => (max 0 (min 1 (est.1 z)) - theta) ^ 2 have hfixed : AEStronglyMeasurable fixedLoss (Measure.map (fixedPrefixObservations x0 n) (mu.restrict good)) := (((measurable_const.max (measurable_const.min est.2)).sub measurable_const).pow_const 2 ).aestronglyMeasurable calc (∫ s, (max 0 (min 1 (est.1 (fixedPrefixObservations x0 n s))) - theta) ^ 2 ∂mu.restrict good) = ∫ z, fixedLoss z ∂Measure.map (fixedPrefixObservations x0 n) (mu.restrict good) := (integral_map (measurable_fixedPrefixObservations x0 n).aemeasurable hfixed).symm _ = _ := by rw [show Measure.map (fixedPrefixObservations x0 n) (mu.restrict good) = (poissonMeasure (toNNReal (2 * n))) (Ici n) • productLaw P.1 n by exact map_fixedPrefixObservations_restrict_count_ge (obsLaw P.1) (toNNReal (2 * n)) x0 n] unfold Causalean.Stat.sqRisk fixedLoss rw [MeasureTheory.integral_smul_measure] simp [Measure.real, mul_comm] have hclip : Causalean.Stat.sqRisk (productLaw P.1 n) (fun z => max 0 (min 1 (est.1 z))) theta ≤ observedRisk n (d := d) (epsilon := epsilon) est P := by unfold Causalean.Stat.sqRisk observedRisk apply integral_mono · refine (integrable_const (1 : ℝ)).mono' (((measurable_const.max (measurable_const.min est.2)).sub measurable_const).pow_const 2).aestronglyMeasurable ?_ filter_upwards [] with z rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hz : max 0 (min 1 (est.1 z)) ∈ Icc (0 : ℝ) 1 := ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ have habs : |max 0 (min 1 (est.1 z)) - theta| ≤ 1 := by rw [abs_sub_le_iff] constructor <;> linarith [hz.1, hz.2, htheta.1, htheta.2] rw [← sq_abs] calc |max 0 (min 1 (est.1 z)) - theta| ^ 2 ≤ (1 : ℝ) ^ 2 := (sq_le_sq₀ (abs_nonneg _) (by norm_num)).2 habs _ = 1 := by norm_num · let M := ∑ z : Fin n → Obs d, |(est.1 z - theta) ^ 2| refine (integrable_const M).mono' ((est.2.sub measurable_const).pow_const 2).aestronglyMeasurable ?_ filter_upwards [] with z exact Finset.single_le_sum (fun w _hw => abs_nonneg ((est.1 w - theta) ^ 2)) (Finset.mem_univ z) · intro z exact sq_clip_unitInterval_le_denseDepoissonization (est.1 z) theta htheta have hprob_good : (poissonMeasure (toNNReal (2 * n)) (Ici n)).toReal ≤ 1 := by rw [← ENNReal.toReal_one] apply ENNReal.toReal_mono (by norm_num) calc poissonMeasure (toNNReal (2 * n)) (Ici n) ≤ poissonMeasure (toNNReal (2 * n)) univ := measure_mono (Set.subset_univ (Ici n)) _ = 1 := measure_univ have hrisk_nonneg : 0 ≤ Causalean.Stat.sqRisk (productLaw P.1 n) (fun z => max 0 (min 1 (est.1 z))) theta := by unfold Causalean.Stat.sqRisk positivity have hgood_le : (∫ s, loss s ∂mu.restrict good) ≤ observedRisk n (d := d) (epsilon := epsilon) est P := by rw [hgood_eq] exact (mul_le_of_le_one_left hrisk_nonneg hprob_good).trans hclip have hbad_set : goodᶜ = FiniteSample.count ⁻¹' {k | k < n} := by ext s simp [good] have hbad_le : (∫ s, loss s ∂mu.restrict goodᶜ) ≤ (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal := by calc (∫ s, loss s ∂mu.restrict goodᶜ) ≤ ∫ _s, (1 : ℝ) ∂mu.restrict goodᶜ := by apply integral_mono hloss_int.restrict (integrable_const (1 : ℝ)) hloss_le _ = (mu goodᶜ).toReal := by simp [Measure.real] _ = _ := by rw [hbad_set] have hmap := finitePoissonSampleLaw_map_count (obsLaw P.1) (toNNReal (2 * n)) rw [← hmap] rw [Measure.map_apply measurable_finiteSample_count (by measurability)] have htotal : (∫ s, loss s ∂mu) ≤ observedRisk n (d := d) (epsilon := epsilon) est P + (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal := by rw [hsplit] exact add_le_add hgood_le hbad_le simpa [poissonObservedRisk, Causalean.Stat.sqRisk, mu, loss, x0, Nat.cast_mul] using htotal
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonObservedRisk_densePrefix_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:108
theorem minimaxRisk_ge_poissonOptimalValueRisk_sub_lowerTail

The first-n prefix construction transfers the genuine mean-2n Poisson minimax lower bound to the fixed-sample experiment, losing only the Poisson lower-tail probability. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
Nonempty (ModelLaw d epsilon)
poissonOptimalValueRisk (2 * n) d epsilon
- (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal
minimaxRisk n d epsilon
Proof (Lean source)
lemma minimaxRisk_ge_poissonOptimalValueRisk_sub_lowerTail {n d : ℕ} {epsilon : ℝ} [Nonempty (ModelLaw d epsilon)] : poissonOptimalValueRisk (2 * n) d epsilon - (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal ≤ minimaxRisk n d epsilon := by let tail := (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal letI : Nonempty (Estimator n d) := ⟨⟨fun _ => 0, measurable_const⟩⟩ apply Causalean.Stat.le_minimaxValue intro est let x0 : Obs d := (⟨0, by let P : ModelLaw d epsilon := choice inferInstance have hd := P.2.d_ge_two omega⟩, false, false) let pest : DensePoissonEstimator d := densePrefixPoissonEstimator x0 est have hpois_nonneg : ∀ e : DensePoissonEstimator d, ∀ P : ModelLaw d epsilon, 0 ≤ poissonObservedRisk (2 * n) e P := by intro e P unfold poissonObservedRisk Causalean.Stat.sqRisk positivity have hupper : poissonOptimalValueRisk (2 * n) d epsilon ≤ worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) pest := Causalean.Stat.minimaxValue_le_worstCaseRisk_of_nonneg hpois_nonneg pest have hworst : worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) pest ≤ worstCaseRisk (observedRisk n (d := d) (epsilon := epsilon)) est + tail := by apply worstCaseRisk_le intro P have hp := poissonObservedRisk_densePrefix_le est P have hx0 : x0 = (⟨0, by have hd := P.2.d_ge_two; omega⟩, false, false) := by ext <;> simp [x0] rw [show pest = densePrefixPoissonEstimator (⟨0, by have hd := P.2.d_ge_two; omega⟩, false, false) est by simp [pest, hx0]] exact hp.trans (add_le_add (le_worstCaseRisk (observedRisk_bddAbove est) P) le_rfl) change poissonOptimalValueRisk (2 * n) d epsilon - tail ≤ _ linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.minimaxRisk_ge_poissonOptimalValueRisk_sub_lowerTail · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseDepoissonization.lean:254
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseLowerAssembly 12 declarations Assembly of the dense fuzzy-hypothesis and de-Poissonization certificate.

Assembly of the dense fuzzy-hypothesis and de-Poissonization certificate.

theorem denseObservationKernel_apply

The chosen dense observation kernel is the genuine Poisson sample law at each contrast. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hd :
2 ≤ d
theta :
Proof (Lean source)
lemma denseObservationKernel_apply (n d : ℕ) (hd : 2 ≤ d) (theta : DenseContrast d) : denseObservationKernel n d hd theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) := by exact Classical.choose_spec (denseObservationKernel_exists n d hd) theta
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationKernel_apply · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:15
theorem denseObservationMixture_eq_priorPredictive Lemma denseObservationMixture_eq_priorPredictive in the paper ↗

The paper's dense observation mixture is exactly the prior predictive law of its genuine Poisson observation kernel. This uses the alphabet size satisfies its stated restriction, and the dense construction domain conditions hold. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hd :
2 ≤ d
epsilon :
hdom :
nu :
denseObservationMixture n d hd epsilon hdom nu
Proof (Lean source)
lemma denseObservationMixture_eq_priorPredictive (n d : ℕ) (hd : 2 ≤ d) (epsilon : ℝ) (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) : denseObservationMixture n d hd epsilon hdom nu = priorPredictive (denseScaledProductPrior n d epsilon hdom nu) (denseObservationKernel n d hd) := by rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationMixture_eq_priorPredictive · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:26
theorem denseFuzzyMinimax_lower

The standard two-fuzzy-hypotheses theorem converts the paper's dense observation-mixture and target-concentration bounds into an ENNReal minimax lower bound for the dense Poisson experiment. This uses the dense construction domain conditions hold, and the stated delta condition holds, and the two experiments have the stated total-variation bound, and the stated prior-tail bound holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
priors :
hDelta :
htv :
tvDist (denseSubmodel n d epsilon hdom priors).mixture0 (denseSubmodel n d epsilon hdom priors).mixture1
≤ 1 / 16
htail :
∀ nu ∈ ({(denseSubmodel n d epsilon hdom priors).nu0, (denseSubmodel n d epsilon hdom priors).nu1} : Set (Measure ℝ)),
denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4}
≤ 1 / 8
Proof (Lean source)
lemma denseFuzzyMinimax_lower {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (priors : DensePriorFamily) (hDelta : 0 < densePriorSeparation n d) (htv : tvDist (denseSubmodel n d epsilon hdom priors).mixture0 (denseSubmodel n d epsilon hdom priors).mixture1 ≤ 1 / 16) (htail : ∀ nu ∈ ({(denseSubmodel n d epsilon hdom priors).nu0, (denseSubmodel n d epsilon hdom priors).nu1} : Set (Measure ℝ)), denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8) : ofReal (11 * densePriorSeparation n d ^ 2 / 512) ≤ minimaxSquaredRisk (denseObservationKernel n d hdom.1) denseTargetAt := by let C := denseSubmodel n d epsilon hdom priors let pi0 := denseScaledProductPrior n d epsilon hdom C.nu0 let pi1 := denseScaledProductPrior n d epsilon hdom C.nu1 let K := denseObservationKernel n d hdom.1 letI : IsProbabilityMeasure C.nu0 := C.priorConditions.1 letI : IsProbabilityMeasure C.nu1 := C.priorConditions.2.1 letI : IsProbabilityMeasure pi0 := denseScaledProductPrior_isProbability hdom C.nu0 C.priorConditions.2.2.1 letI : IsProbabilityMeasure pi1 := denseScaledProductPrior_isProbability hdom C.nu1 C.priorConditions.2.2.2.1 have hK : ∀ theta, IsProbabilityMeasure (K theta) := by intro theta rw [show K theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) by exact denseObservationKernel_apply n d hdom.1 theta] infer_instance have htail0 : pi0.real {theta | densePriorSeparation n d / 4 < |denseTargetAt theta - densePriorTargetMean n d epsilon hdom C.nu0|} ≤ 1 / 8 := by have hh := htail C.nu0 (by left; rfl) have hh' : pi0 {theta | densePriorSeparation n d / 4 < |denseTargetAt theta - densePriorTargetMean n d epsilon hdom C.nu0|} ≤ ofReal (1 / 8 : ℝ) := by simpa [pi0, C] using hh simpa [Measure.real, ENNReal.toReal_ofReal] using ENNReal.toReal_mono (by norm_num) hh' have htail1 : pi1.real {theta | densePriorSeparation n d / 4 < |denseTargetAt theta - densePriorTargetMean n d epsilon hdom C.nu1|} ≤ 1 / 8 := by have hh := htail C.nu1 (by right; rfl) have hh' : pi1 {theta | densePriorSeparation n d / 4 < |denseTargetAt theta - densePriorTargetMean n d epsilon hdom C.nu1|} ≤ ofReal (1 / 8 : ℝ) := by simpa [pi1, C] using hh simpa [Measure.real, ENNReal.toReal_ofReal] using ENNReal.toReal_mono (by norm_num) hh' apply twoFuzzyHypotheses_minimax_lower_standard pi0 pi1 K denseTargetAt hK measurable_denseTargetAt (densePriorTargetMean n d epsilon hdom C.nu0) (densePriorTargetMean n d epsilon hdom C.nu1) (densePriorSeparation n d) hDelta · simpa [C, denseSubmodel] using C.priorMeanSeparation_eq.symm.le · exact htail0 · exact htail1 · simpa [pi0, pi1, K, C, denseSubmodel, denseObservationMixture, priorPredictive] using htv
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseFuzzyMinimax_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:38
theorem observedOptimalValue_mem_unitInterval_denseAssembly

Every observed-model target is in the unit interval. This uses the observed law satisfies the stated model restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
epsilon :
P :
hP :
observedOptimalValue P hP ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma observedOptimalValue_mem_unitInterval_denseAssembly {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : observedOptimalValue P hP ∈ Icc (0 : ℝ) 1 := by have hj (x : Fin d) (a y : Bool) : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg have hc (x : Fin d) : 0 ≤ cellMass P x := by exact sum_nonneg fun a _ => sum_nonneg fun y _ => hj x a y have hm (x : Fin d) (a : Bool) : outcomeMean P a x ∈ Icc (0 : ℝ) 1 := by have ha : 0 ≤ armMass P a x := sum_nonneg fun y _ => hj x a y have hle : jointMass P x a truearmMass P a x := by simp [armMass] exact hj x a false exact ⟨div_nonneg (hj x a true) ha, div_le_one_of_le₀ hle ha⟩ have hsum : ∑ x : Fin d, cellMass P x = 1 := by calc _ = ∑ z : Obs d, (P.pmf z).toReal := by simp [cellMass, jointMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm rw [observedOptimalValue, observedOptimalValueRaw] constructor · exact sum_nonneg fun x _ => mul_nonneg (hc x) ((hm x false).1.trans (le_max_left _ _)) · calc ∑ x : Fin d, cellMass P x * max (outcomeMean P false x) (outcomeMean P true x) ≤ ∑ x : Fin d, cellMass P x * 1 := by apply Finset.sum_le_sum intro x _hx exact mul_le_mul_of_nonneg_left (max_le (hm x false).2 (hm x true).2) (hc x) _ = 1 := by simpa using hsum
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOptimalValue_mem_unitInterval_denseAssembly · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:103
theorem denseFuzzyMinimax_to_poissonRisk Lemma denseFuzzyMinimax_to_poissonRisk in the paper ↗

The dense fuzzy minimax problem is a restriction of the genuine clipped Poisson observed-law problem. This also converts its ENNReal risk to the paper's real-valued minimax convention. This uses the dense construction domain conditions hold. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
Proof (Lean source)
lemma denseFuzzyMinimax_to_poissonRisk {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) : (minimaxSquaredRisk (denseObservationKernel n d hdom.1) denseTargetAt).toRealpoissonOptimalValueRisk (2 * n) d epsilon := by let K := denseObservationKernel n d hdom.1 let target := denseTargetAt (d := d) have htarget (theta : DenseContrast d) : target theta ∈ Icc (0 : ℝ) 1 := by obtain ⟨hP, _hcell, _hprop, _hmu1, _hmu0, hvalue⟩ := denseLaw_observed_spec epsilon ⟨hdom.2.1, hdom.2.2.1⟩ theta have hvalue' : observedOptimalValue (observedMarginal (denseLaw theta)) hP = target theta := by simpa [target, denseTargetAt] using hvalue rw [← hvalue'] exact observedOptimalValue_mem_unitInterval_denseAssembly _ hP have hpoisson_bdd (est : DensePoissonEstimator d) : BddAbove (range (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon) est)) := by refine ⟨1, ?_⟩ rintro _ ⟨P, rfl⟩ have ht := observedOptimalValue_mem_unitInterval_denseAssembly P.1 P.2 unfold poissonObservedRisk Causalean.Stat.sqRisk have hbound : ∀ s : DensePoissonSample d, (max 0 (min 1 (est.1 s)) - observedOptimalValue P.1 P.2) ^ 2 ≤ 1 := by intro s have hs : max 0 (min 1 (est.1 s)) ∈ Icc (0 : ℝ) 1 := by constructor · exact le_max_left _ _ · exact max_le (by norm_num) (min_le_left _ _) have habs : |max 0 (min 1 (est.1 s)) - observedOptimalValue P.1 P.2| ≤ 1 := by rw [abs_sub_le_iff] constructor <;> linarith [hs.1, hs.2, ht.1, ht.2] rw [← sq_abs] simpa using (sq_le_sq₀ (abs_nonneg _) (by norm_num)).2 habs let mu := finitePoissonSampleLaw (obsLaw P.1) (toNNReal (2 * n)) have hint : Integrable (fun s : DensePoissonSample d => (max 0 (min 1 (est.1 s)) - observedOptimalValue P.1 P.2) ^ 2) mu := by refine (integrable_const (1 : ℝ)).mono' ?_ (ae_of_all _ fun s => ?_) · fun_prop · rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact hbound s simp only [Nat.cast_mul, Nat.cast_ofNat] change (∫ s, (max 0 (min 1 (est.1 s)) - observedOptimalValue P.1 P.2) ^ 2 ∂mu) ≤ 1 simpa using integral_mono hint (integrable_const (1 : ℝ)) hbound letI : Nonempty (DensePoissonEstimator d) := ⟨⟨0, measurable_const⟩⟩ apply Causalean.Stat.le_minimaxValue intro est let clipped : DensePoissonSample d → ℝ := fun s => max 0 (min 1 (est.1 s)) have hclipped : Measurable clipped := by dsimp [clipped] fun_prop have hmini : minimaxSquaredRisk K targetworstCaseSquaredRisk K target clipped := by unfold minimaxSquaredRisk exact iInf_le_of_le ⟨clipped, hclipped⟩ le_rfl have hworst : worstCaseSquaredRisk K target clipped ≤ ofReal (worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est) := by apply iSup_le intro theta obtain ⟨hP, _hcell, _hprop, _hmu1, _hmu0, hvalue⟩ := denseLaw_observed_spec epsilon ⟨hdom.2.1, hdom.2.2.1⟩ theta let Ptheta : ModelLaw d epsilon := ⟨observedMarginal (denseLaw theta), hP⟩ have hvalue' : observedOptimalValue Ptheta.1 Ptheta.2 = target theta := by simpa [Ptheta, target, denseTargetAt] using hvalue have hrisk_le : poissonObservedRisk (2 * n) est Ptheta ≤ worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est := le_worstCaseRisk (hpoisson_bdd est) Ptheta calc squaredRisk K target clipped theta = ofReal (poissonObservedRisk (2 * n) est Ptheta) := by unfold squaredRisk poissonObservedRisk Causalean.Stat.sqRisk simp only [Nat.cast_mul, Nat.cast_ofNat] rw [show K theta = finitePoissonSampleLaw (obsLaw Ptheta.1) (toNNReal (2 * n)) by simpa [K, Ptheta] using denseObservationKernel_apply n d hdom.1 theta] rw [hvalue'] dsimp [clipped] change (∫⁻ x, ofReal ((clipped x - target theta) ^ 2) ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw (obsLaw Ptheta.1) (toNNReal (2 * n))) = ofReal (∫ x, (clipped x - target theta) ^ 2 ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw (obsLaw Ptheta.1) (toNNReal (2 * n))) symm apply MeasureTheory.ofReal_integral_eq_lintegral_ofReal · refine (integrable_const (1 : ℝ)).mono' (((hclipped.sub measurable_const).pow_const 2).aestronglyMeasurable) ?_ filter_upwards with s rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hs : clipped s ∈ Icc (0 : ℝ) 1 := by dsimp [clipped] exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ have habs : |clipped s - target theta| ≤ 1 := by rw [abs_sub_le_iff] constructor <;> linarith [hs.1, hs.2, (htarget theta).1, (htarget theta).2] rw [← sq_abs] simpa using (sq_le_sq₀ (abs_nonneg _) (by norm_num)).2 habs · exact ae_of_all _ fun _ => sq_nonneg _ _ ≤ ofReal (worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est) := ENNReal.ofReal_le_ofReal hrisk_le have hfinite : ofReal (worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est) ≠ ⊤ := ENNReal.ofReal_ne_top calc (minimaxSquaredRisk K target).toReal ≤ (ofReal (worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est)).toReal := ENNReal.toReal_mono hfinite (hmini.trans hworst) _ = worstCaseRisk (poissonObservedRisk (2 * n) (d := d) (epsilon := epsilon)) est := by rw [ENNReal.toReal_ofReal] exact worstCaseRisk_nonneg (fun _ => by unfold poissonObservedRisk Causalean.Stat.sqRisk positivity)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseFuzzyMinimax_to_poissonRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:137
theorem fuzzyMinimaxSquaredRisk_ne_top_of_unitTarget Lemma fuzzyMinimaxSquaredRisk_ne_top_of_unitTarget in the paper ↗

A probability experiment with a target in the unit interval has finite minimax squared risk: the constant-zero estimator has risk at most one. This uses the approximation degree satisfies its stated restriction, and the target lies in the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
Theta X :
K :
Kernel Theta X
target :
Theta → ℝ
htarget :
theta, target thetaIcc (0 : ℝ) 1
minimaxSquaredRisk K target ≠ ⊤
Proof (Lean source)
lemma fuzzyMinimaxSquaredRisk_ne_top_of_unitTarget {Theta X : Type*} [MeasurableSpace Theta] [MeasurableSpace X] (K : Kernel Theta X) (target : Theta → ℝ) (hK : ∀ theta, IsProbabilityMeasure (K theta)) (htarget : ∀ theta, target theta ∈ Icc (0 : ℝ) 1) : minimaxSquaredRisk K target ≠ ⊤ := by let zeroEstimator : {f : X → ℝ // Measurable f} := ⟨fun _ => 0, measurable_const⟩ have hworst : Causalean.Stat.Minimax.FuzzyHypotheses.worstCaseSquaredRisk K target zeroEstimator.1 ≤ 1 := by unfold Causalean.Stat.Minimax.FuzzyHypotheses.worstCaseSquaredRisk apply iSup_le intro theta letI : IsProbabilityMeasure (K theta) := hK theta unfold squaredRisk calc (∫⁻ x, ofReal ((zeroEstimator.1 x - target theta) ^ 2) ∂(K theta)) ≤ (∫⁻ x : X, (1 : ENNReal) ∂(K theta)) := by apply lintegral_mono intro x apply ENNReal.ofReal_le_one.mpr dsimp [zeroEstimator] nlinarith [(htarget theta).1, (htarget theta).2] _ = 1 := by simp apply ne_top_of_le_ne_top (by norm_num : (1 : ENNReal) ≠ ⊤) exact (iInf_le (fun estimator : {f : X → ℝ // Measurable f} => Causalean.Stat.Minimax.FuzzyHypotheses.worstCaseSquaredRisk K target estimator.1) zeroEstimator).trans hworst
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fuzzyMinimaxSquaredRisk_ne_top_of_unitTarget · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:265
theorem denseFuzzyLower_to_poissonRisk

The fuzzy-hypothesis lower bound transfers, with its exact numerical constant, to the paper's genuine Poissonized observed-law minimax risk. This uses the dense construction domain conditions hold, and the stated delta condition holds, and the two experiments have the stated total-variation bound, and the stated prior-tail bound holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
priors :
hDelta :
htv :
tvDist (denseSubmodel n d epsilon hdom priors).mixture0 (denseSubmodel n d epsilon hdom priors).mixture1
≤ 1 / 16
htail :
∀ nu ∈ ({(denseSubmodel n d epsilon hdom priors).nu0, (denseSubmodel n d epsilon hdom priors).nu1} : Set (Measure ℝ)),
denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4}
≤ 1 / 8
11 * densePriorSeparation n d ^ 2 / 512 ≤ poissonOptimalValueRisk (2 * n) d epsilon
Proof (Lean source)
lemma denseFuzzyLower_to_poissonRisk {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (priors : DensePriorFamily) (hDelta : 0 < densePriorSeparation n d) (htv : tvDist (denseSubmodel n d epsilon hdom priors).mixture0 (denseSubmodel n d epsilon hdom priors).mixture1 ≤ 1 / 16) (htail : ∀ nu ∈ ({(denseSubmodel n d epsilon hdom priors).nu0, (denseSubmodel n d epsilon hdom priors).nu1} : Set (Measure ℝ)), denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8) : 11 * densePriorSeparation n d ^ 2 / 512 ≤ poissonOptimalValueRisk (2 * n) d epsilon := by let K := denseObservationKernel n d hdom.1 have hK : ∀ theta, IsProbabilityMeasure (K theta) := by intro theta rw [show K theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) by exact denseObservationKernel_apply n d hdom.1 theta] infer_instance have htarget (theta : DenseContrast d) : denseTargetAt theta ∈ Icc (0 : ℝ) 1 := by obtain ⟨hP, _hcell, _hprop, _hmu1, _hmu0, hvalue⟩ := denseLaw_observed_spec epsilon ⟨hdom.2.1, hdom.2.2.1⟩ theta unfold denseTargetAt rw [← hvalue] exact observedOptimalValue_mem_unitInterval_denseAssembly _ hP have hfinite : minimaxSquaredRisk K denseTargetAt ≠ ⊤ := fuzzyMinimaxSquaredRisk_ne_top_of_unitTarget K denseTargetAt hK htarget have hfuzzy := denseFuzzyMinimax_lower hdom priors hDelta htv htail have hreal := ENNReal.toReal_mono hfinite hfuzzy rw [ENNReal.toReal_ofReal (by positivity)] at hreal exact hreal.trans (denseFuzzyMinimax_to_poissonRisk hdom)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseFuzzyLower_to_poissonRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:298
theorem eventually_densePrior_concentration_scale Lemma eventually_densePrior_concentration_scale in the paper ↗

The reciprocal-degree Cai--Low bound and logarithmic degree choice make the product-prior concentration scale valid above a universal alphabet cutoff. This uses the Cai--Low moment-matching prior result is available. The displayed identity or bound is the asserted conclusion.

Formal statement
∃ D0 : ℕ, ∀ d : ℕ, D0 ≤ d → 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2
Proof (Lean source)
lemma eventually_densePrior_concentration_scale (h_cai_low : CaiLowAbsoluteMomentPriors) : ∃ D0 : ℕ, ∀ d : ℕ, D0 ≤ d → 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2 := by obtain ⟨c, _C, hc, _hcC, hE⟩ := h_cai_low.2 have hlog : (fun x : ℝ => log x ^ (2 : ℝ)) =o[atTop] (fun x : ℝ => x ^ (1 / 2 : ℝ)) := isLittleO_log_rpow_rpow_atTop 2 (by norm_num : (0 : ℝ) < 1 / 2) have hev : ∀ᶠ x : ℝ in atTop, log x ^ (2 : ℝ) ≤ x ^ (1 / 2 : ℝ) := by filter_upwards [hlog.bound (by norm_num : (0 : ℝ) < 1), eventually_ge_atTop (1 : ℝ)] with x hx hx1 have hf0 : 0 ≤ log x ^ (2 : ℝ) := Real.rpow_nonneg (Real.log_nonneg hx1) _ have hg0 : 0 ≤ x ^ (1 / 2 : ℝ) := Real.rpow_nonneg (by linarith) _ simpa only [Real.norm_eq_abs, abs_of_nonneg hf0, abs_of_nonneg hg0, one_mul] using hx have hevNat : ∀ᶠ d : ℕ in atTop, log (exp 1 * d) ^ 2 ≤ sqrt (exp 1) * sqrt d := by have ht : Tendsto (fun d : ℕ => exp 1 * (d : ℝ)) atTop atTop := by exact tendsto_natCast_atTop_atTop.const_mul_atTop (Real.exp_pos 1) filter_upwards [hev.filter_mono ht] with d hd rw [← Real.sqrt_mul (Real.exp_nonneg 1)] simpa [Real.sqrt_eq_rpow, Real.rpow_two] using hd have hsqrt : Tendsto (fun d : ℕ => sqrt d) atTop atTop := Real.tendsto_sqrt_atTop.comp tendsto_natCast_atTop_atTop have hlarge : ∀ᶠ d : ℕ in atTop, 3200 * sqrt (exp 1) ≤ c ^ 2 * sqrt d := by exact (tendsto_atTop.1 (hsqrt.const_mul_atTop (sq_pos_of_pos hc))) (3200 * sqrt (exp 1)) have hall : ∀ᶠ d : ℕ in atTop, 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2 := by filter_upwards [hevNat, hlarge, eventually_ge_atTop (2 : ℕ)] with d hlogSq hlarge hd have hL : 1 ≤ logAlphabet d := by rw [logAlphabet] calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * d) := by apply Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) (by positivity)) simpa only [mul_one] using mul_le_mul_of_nonneg_left (show (1 : ℝ) ≤ d by exact_mod_cast (by omega : 1 ≤ d)) (Real.exp_nonneg 1) have hKpos : (0 : ℝ) < lowerDegree d := by exact_mod_cast lowerDegree_pos d hd have hKle : (lowerDegree d : ℝ) ≤ 10 * logAlphabet d := by have h := (lowerDegree_log_bounds d).2 linarith have hElower := (hE (lowerDegree d) (lowerDegree_even d) (lowerDegree_pos d hd)).1 have hEpos : 0 < bestEvenApproxError (lowerDegree d) := by have hcdiv : 0 < c / (lowerDegree d : ℝ) := div_pos hc hKpos linarith have hroot0 : 0 ≤ sqrt (d : ℝ) := Real.sqrt_nonneg _ have hrootSq : sqrt (d : ℝ) ^ 2 = d := Real.sq_sqrt (by positivity) have hKsq : (lowerDegree d : ℝ) ^ 2 ≤ 100 * sqrt (exp 1) * sqrt d := by have hk := sq_le_sq₀ (le_of_lt hKpos) (by positivity : 0 ≤ 10 * logAlphabet d) have hk' : (lowerDegree d : ℝ) ^ 2 ≤ 100 * logAlphabet d ^ 2 := by nlinarith [hk.mpr hKle] calc (lowerDegree d : ℝ) ^ 2 ≤ 100 * logAlphabet d ^ 2 := hk' _ ≤ 100 * (sqrt (exp 1) * sqrt d) := mul_le_mul_of_nonneg_left hlogSq (by norm_num) _ = 100 * sqrt (exp 1) * sqrt d := by ring have hcprod : c ≤ (lowerDegree d : ℝ) * bestEvenApproxError (lowerDegree d) := by rw [div_le_iff₀ hKpos] at hElower linarith have hcSq : c ^ 2 ≤ (lowerDegree d : ℝ) ^ 2 * bestEvenApproxError (lowerDegree d) ^ 2 := by nlinarith have hsqrtExpPos : 0 < sqrt (exp 1) := Real.sqrt_pos.2 (Real.exp_pos 1) have hbound : c ^ 2 ≤ (100 * sqrt (exp 1) * sqrt d) * bestEvenApproxError (lowerDegree d) ^ 2 := hcSq.trans (mul_le_mul_of_nonneg_right hKsq (sq_nonneg _)) have hbound' : c ^ 2 * sqrt d ≤ 100 * sqrt (exp 1) * d * bestEvenApproxError (lowerDegree d) ^ 2 := by have h := mul_le_mul_of_nonneg_right hbound hroot0 calc c ^ 2 * sqrt d ≤ (100 * sqrt (exp 1) * sqrt d) * bestEvenApproxError (lowerDegree d) ^ 2 * sqrt d := h _ = 100 * sqrt (exp 1) * sqrt d ^ 2 * bestEvenApproxError (lowerDegree d) ^ 2 := by ring _ = 100 * sqrt (exp 1) * d * bestEvenApproxError (lowerDegree d) ^ 2 := by rw [hrootSq] nlinarith rw [eventually_atTop] at hall exact hall
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.eventually_densePrior_concentration_scale · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:338
theorem densePriorSeparation_sq_lower

The reciprocal Cai--Low approximation bound gives the exact squared separation scale needed by the fuzzy-hypothesis lower bound. This uses the Cai--Low moment-matching prior result is available. The displayed identity or bound is the asserted conclusion.

Formal statement
∃ c0 : ℝ,
0 < c0
conclusion 1
n d :
c0 * d / (n * lowerDegree d) ≤ 11 * densePriorSeparation n d ^ 2 / 512
Proof (Lean source)
-- @node: densePriorSeparation_sq_lower lemma densePriorSeparation_sq_lower (h_cai_low : CaiLowAbsoluteMomentPriors) : ∃ c0 : ℝ, 0 < c0 ∧ ∀ n d : ℕ, DenseRegime n d → c0 * d / (n * lowerDegree d) ≤ 11 * densePriorSeparation n d ^ 2 / 512 := by obtain ⟨c, _C, hc, _hcC, hbounds⟩ := h_cai_low.2 refine ⟨11 * c ^ 2 / (512 * 128), by positivity, ?_⟩ intro n d hregime have hKpos : (0 : ℝ) < lowerDegree d := by exact_mod_cast lowerDegree_pos d hregime.1 have hnpos : (0 : ℝ) < n := by have hdpos : 0 < d := lt_trans (by norm_num) hregime.1 exact_mod_cast (lt_trans (Nat.pow_pos hdpos) hregime.2) have hE := (hbounds (lowerDegree d) (lowerDegree_even d) (lowerDegree_pos d hregime.1)).1 have hEsq : c ^ 2 / (lowerDegree d : ℝ) ^ 2 ≤ bestEvenApproxError (lowerDegree d) ^ 2 := by have hcdiv0 : 0 ≤ c / (lowerDegree d : ℝ) := by positivity rw [← div_pow] exact (sq_le_sq₀ hcdiv0 (hcdiv0.trans hE)).2 hE rw [densePriorSeparation, mul_pow, denseAmplitude_sq n d hregime] calc 11 * c ^ 2 / (512 * 128) * d / (n * lowerDegree d) = 11 / 512 * (lowerDegree d * d / (128 * n)) * (c ^ 2 / (lowerDegree d : ℝ) ^ 2) := by field_simp _ ≤ 11 / 512 * (lowerDegree d * d / (128 * n)) * bestEvenApproxError (lowerDegree d) ^ 2 := by gcongr _ = 11 * ((lowerDegree d * d / (128 * n)) * bestEvenApproxError (lowerDegree d) ^ 2) / 512 := by ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorSeparation_sq_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:439
def DenseMomentMatchingCertificate

The complete dense fuzzy-hypothesis certificate: construction identities, moment matching, likelihood/tensorization control, concentration, and both Poissonized and fixed-sample risk conclusions.

Definition (Lean source)
D0 d n :
epsilon cepsilon :
DenseMomentMatchingCertificate D0 d n epsilon cepsilon :
Prop
clause 1
0 < epsilon
clause 2
epsilon < 1 / 2
clause 3
D0 ≤ d
clause 4
d ^ 2 < n
clause 5
clause 6
denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n)
clause 7
denseAmplitude n d ≤ 1 / 2
clause 8
theta :
Fin d → ℝ
(∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d))
∃ theta' : DenseContrast d,
theta'.1 = theta
∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')),
x :
cellMass (observedMarginal (denseLaw theta')) x = 1 / d
x :
propensity (observedMarginal (denseLaw theta')) x = 1 / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2
= 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)
clause 9
∃ hdom : DenseConstructionDomain n d epsilon,
∃ priors : DensePriorFamily,
let C := denseSubmodel n d epsilon hdom priors densePriorMeanSeparation C
tvDist C.mixture0 C.mixture1 ≤ d * sqrt (denseLikelihoodTail n d) ∧
≤ d * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ∧
d * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ≤ 1 / 16 ∧
(∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), ∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧
(∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorMeanSeparation C / 4} ≤ 1 / 8)
clause 10
theta theta' :
(∫ r : DenseSignCounts, oneCellLikelihood (poissonCellIntensity n d) theta r * oneCellLikelihood (poissonCellIntensity n d) theta' r ∂denseSignBaseline (poissonCellIntensity n d))
= exp (poissonCellIntensity n d * theta * theta')
clause 12
cepsilon * densePriorSeparation n d ^ 2 ≤ poissonOptimalValueRisk (2 * n) d epsilon
clause 13
cepsilon * d / (n * lowerDegree d) ≤ poissonOptimalValueRisk (2 * n) d epsilon
clause 14
minimaxRisk n d epsilon
poissonOptimalValueRisk (2 * n) d epsilon
- (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal
clause 15
cepsilon * d / (n * logAlphabet d) ≤ minimaxRisk n d epsilon
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.DenseMomentMatchingCertificate · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:473
theorem denseConstructionAndPriorCertificate Lemma denseConstructionAndPriorCertificate in the paper ↗

The already-localized analytic ingredients assemble into the complete construction and supported-prior portion of the dense lower-bound argument. This isolates the remaining observation-regrouping and minimax-transfer work. This uses the sample size and alphabet lie in the dense regime, and the overlap parameter satisfies its stated range restriction, and the Cai--Low moment-matching prior result is available, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hscale :
32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2
conclusion 1
conclusion 2
denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n)
conclusion 3
denseAmplitude n d ≤ 1 / 2
conclusion 4
theta :
Fin d → ℝ
(∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d))
∃ theta' : DenseContrast d,
theta'.1 = theta
∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')),
x :
cellMass (observedMarginal (denseLaw theta')) x = 1 / d
x :
propensity (observedMarginal (denseLaw theta')) x = 1 / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2
= 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)
conclusion 5
∃ hdom : DenseConstructionDomain n d epsilon,
∃ priors : DensePriorFamily,
let C := denseSubmodel n d epsilon hdom priors densePriorMeanSeparation C
≤ d * sqrt (denseLikelihoodTail n d) ∧
(∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧ denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8)
conclusion 6
theta theta' :
(∫ r : DenseSignCounts, oneCellLikelihood (poissonCellIntensity n d) theta r * oneCellLikelihood (poissonCellIntensity n d) theta' r ∂denseSignBaseline (poissonCellIntensity n d))
= exp (poissonCellIntensity n d * theta * theta')
Proof (Lean source)
lemma denseConstructionAndPriorCertificate {n d : ℕ} {epsilon : ℝ} (hregime : DenseRegime n d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (h_cai_low : CaiLowAbsoluteMomentPriors) (hscale : 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2) : (8 * logAlphabet d ≤ lowerDegree d ∧ lowerDegree d < 8 * logAlphabet d + 2) ∧ denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n) ∧ denseAmplitude n d ≤ 1 / 2 ∧ (∀ theta : Fin d → ℝ, (∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d)) → ∃ theta' : DenseContrast d, theta'.1 = theta ∧ ∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')), (∀ x, cellMass (observedMarginal (denseLaw theta')) x = 1 / d) ∧ (∀ x, propensity (observedMarginal (denseLaw theta')) x = 1 / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2) ∧ observedOptimalValue (observedMarginal (denseLaw theta')) hmodel = 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)) ∧ (∃ hdom : DenseConstructionDomain n d epsilon, ∃ priors : DensePriorFamily, let C := denseSubmodel n d epsilon hdom priors densePriorMeanSeparation C = densePriorSeparation n d ∧ 0 < densePriorMeanSeparation C ∧ densePriorMeanSeparation C ≤ 1 ∧ tvDist (productPriorPredictive d C.nu0 (denseSupportedSignKernel n d)) (productPriorPredictive d C.nu1 (denseSupportedSignKernel n d)) ≤ d * sqrt (denseLikelihoodTail n d) ∧ (∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧ denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8)) ∧ (∀ theta theta' : ℝ, (∫ r : DenseSignCounts, oneCellLikelihood (poissonCellIntensity n d) theta r * oneCellLikelihood (poissonCellIntensity n d) theta' r ∂denseSignBaseline (poissonCellIntensity n d)) = exp (poissonCellIntensity n d * theta * theta')) ∧ densePriorSeparation n d = denseAmplitude n d * bestEvenApproxError (lowerDegree d) := by let hdom := denseConstructionDomain_of_regime n d epsilon hregime hepsilon obtain ⟨hdegree, hamplitude, harange, hbox, hgram, hsep⟩ := denseConstructionCertificate hdom hregime.2 obtain ⟨hdom', priors, hprior⟩ := densePriorSetup hregime hepsilon h_cai_low hscale exact ⟨hdegree, hamplitude, harange, hbox, ⟨hdom', priors, hprior⟩, hgram, hsep⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseConstructionAndPriorCertificate · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:526
theorem dense_moment_matching_lower Lemma 10 in the paper ↗

If the product experiment has the stated independent-sampling law, and the Cai--Low moment-matching prior result is available, then in the dense regime, the minimax risk is bounded below by a positive constant times d/(nlog(ed))d/(nlog(ed)).

Formal statement
h_iid :
∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)
h_cai_low_of_gate :
∃ (D0 : ℕ) (hD0 : 2 ≤ D0),
∀ epsilon : ℝ,
0 < epsilon → epsilon < 1 / 2 → ∃ cepsilon : ℝ, 0 < cepsilon ∧ ∀ (d n : ℕ) (hd : D0 ≤ d) (hn : d ^ 2 < n), DenseMomentMatchingCertificate D0 d n epsilon cepsilon
Proof (Lean source)
lemma dense_moment_matching_lower (h_iid : ∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)) (h_cai_low_of_gate : CaiLowAbsoluteMomentPriors) : ∃ (D0 : ℕ) (hD0 : 2 ≤ D0), ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ cepsilon : ℝ, 0 < cepsilon ∧ ∀ (d n : ℕ) (hd : D0 ≤ d) (hn : d ^ 2 < n), DenseMomentMatchingCertificate D0 d n epsilon cepsilon := by obtain ⟨Dscale, hscale⟩ := eventually_densePrior_concentration_scale h_cai_low_of_gate obtain ⟨Dtv, htvGeom⟩ := eventually_denseGeometric_tv_le obtain ⟨c0, hc0, hsepRate⟩ := densePriorSeparation_sq_lower h_cai_low_of_gate obtain ⟨Dtail, htailAbsorb⟩ := eventually_densePoissonTail_absorbed (c0 / 20) (by positivity) let D0 := max 2 (max Dscale (max Dtv Dtail)) refine ⟨D0, by simp [D0], ?_⟩ intro epsilon hepsilon0 hepsilonHalf let cepsilon : ℝ := min (11 / 512) (min c0 (c0 / 20)) have hcepsilon : 0 < cepsilon := by dsimp [cepsilon] positivity refine ⟨cepsilon, hcepsilon, ?_⟩ intro d n hd hn have hd2 : 2 ≤ d := le_trans (by simp [D0]) hd have hregime : DenseRegime n d := ⟨hd2, hn⟩ have hscale' : 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2 := hscale d (le_trans (by simp [D0]) hd) obtain ⟨hdegree, hamplitude, harange, hbox, hprior0, hgram, hsep⟩ := denseConstructionAndPriorCertificate hregime ⟨hepsilon0, hepsilonHalf⟩ h_cai_low_of_gate hscale' obtain ⟨hdom, priors, hprior⟩ := hprior0 let C := denseSubmodel n d epsilon hdom priors rcases hprior with ⟨hmeanSep, hsepPos, hsepOne, hsignTV, hpairTail⟩ have hgeomTail := denseLikelihoodTail_le_geometric n d hregime have hgeomSmall : (d : ℝ) * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ≤ 1 / 16 := htvGeom d (le_trans (by simp [D0]) hd) have hfullTail : tvDist C.mixture0 C.mixture1 ≤ d * sqrt (denseLikelihoodTail n d) := by have hp0 : IsProbabilityMeasure C.nu0 := C.priorConditions.1 have hp1 : IsProbabilityMeasure C.nu1 := C.priorConditions.2.1 letI : IsProbabilityMeasure C.nu0 := hp0 letI : IsProbabilityMeasure C.nu1 := hp1 calc tvDist C.mixture0 C.mixture1 ≤ tvDist (productPriorPredictive d C.nu0 (denseSupportedSignKernel n d)) (productPriorPredictive d C.nu1 (denseSupportedSignKernel n d)) := by exact denseObservationMixtures_tv_le_product hregime hdom C.nu0 C.nu1 C.priorConditions.2.2.1 C.priorConditions.2.2.2.1 _ ≤ d * sqrt (denseLikelihoodTail n d) := hsignTV have hfullTV : tvDist C.mixture0 C.mixture1 ≤ 1 / 16 := by calc tvDist C.mixture0 C.mixture1 ≤ d * sqrt (denseLikelihoodTail n d) := hfullTail _ ≤ d * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) := by gcongr _ ≤ 1 / 16 := hgeomSmall have htail : ∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8 := fun nu hnu ↦ (hpairTail nu hnu).2 have hpoisSep : 11 * densePriorSeparation n d ^ 2 / 512 ≤ poissonOptimalValueRisk (2 * n) d epsilon := denseFuzzyLower_to_poissonRisk hdom priors (by rw [← hmeanSep] exact hsepPos) (by simpa [C] using hfullTV) (by simpa [C] using htail) have hrate0 : c0 * d / (n * lowerDegree d) ≤ 11 * densePriorSeparation n d ^ 2 / 512 := hsepRate n d hregime have hpoisRate : cepsilon * d / (n * lowerDegree d) ≤ poissonOptimalValueRisk (2 * n) d epsilon := by have hce0 : cepsilon ≤ c0 := le_trans (min_le_right _ _) (min_le_left _ _) have hcmp : cepsilon * d / (n * lowerDegree d) ≤ c0 * d / (n * lowerDegree d) := by gcongr exact hcmp.trans (hrate0.trans hpoisSep) obtain ⟨hzeroModel, _hcellZero, _hpropZero, _hmu1Zero, _hmu0Zero, _hvalueZero⟩ := denseLaw_observed_spec epsilon ⟨hepsilon0, hepsilonHalf⟩ (denseZeroContrast d hd2) letI : Nonempty (ModelLaw d epsilon) := ⟨⟨observedMarginal (denseLaw (denseZeroContrast d hd2)), hzeroModel⟩⟩ have hfixed := minimaxRisk_ge_poissonOptimalValueRisk_sub_lowerTail (n := n) (d := d) (epsilon := epsilon) have htailSmall := htailAbsorb d n (le_trans (by simp [D0]) hd) hn have hLpos : 0 < logAlphabet d := by unfold logAlphabet apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast (by omega : 1 ≤ d) have hegt : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)] have hKle : (lowerDegree d : ℝ) ≤ 10 * logAlphabet d := by have hL : 1 ≤ logAlphabet d := by unfold logAlphabet have hdR : (1 : ℝ) ≤ d := by exact_mod_cast (by omega : 1 ≤ d) have harg : exp 1 ≤ exp 1 * (d : ℝ) := by simpa only [mul_one] using mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1) have hlog := Real.log_le_log (Real.exp_pos 1) harg simpa using hlog linarith [(lowerDegree_log_bounds d).2] have hpoisLog : (c0 / 10) * d / (n * logAlphabet d) ≤ poissonOptimalValueRisk (2 * n) d epsilon := by have hnpos : (0 : ℝ) < n := by exact_mod_cast (by omega : 0 < n) have hKpos : (0 : ℝ) < lowerDegree d := by exact_mod_cast lowerDegree_pos d hd2 calc (c0 / 10) * d / (n * logAlphabet d) ≤ c0 * d / (n * lowerDegree d) := by apply (div_le_div_iff₀ (mul_pos hnpos hLpos) (mul_pos hnpos hKpos)).2 calc (c0 / 10 * d) * (n * lowerDegree d) = (c0 * d * n / 10) * lowerDegree d := by ring _ ≤ (c0 * d * n / 10) * (10 * logAlphabet d) := by gcongr _ = (c0 * d) * (n * logAlphabet d) := by ring _ ≤ _ := hrate0.trans hpoisSep have hfinal : cepsilon * d / (n * logAlphabet d) ≤ minimaxRisk n d epsilon := by have hce20 : cepsilon ≤ c0 / 20 := le_trans (min_le_right _ _) (min_le_right _ _) have hscaleNonneg : 0 ≤ (d : ℝ) / (n * logAlphabet d) := by positivity have hhalf : (c0 / 20) * d / (n * logAlphabet d) ≤ poissonOptimalValueRisk (2 * n) d epsilon - (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal := by calc (c0 / 20) * d / (n * logAlphabet d) = (c0 / 10) * d / (n * logAlphabet d) - (c0 / 20) * d / (n * logAlphabet d) := by ring _ ≤ _ := sub_le_sub hpoisLog htailSmall exact (by calc cepsilon * d / (n * logAlphabet d) ≤ (c0 / 20) * d / (n * logAlphabet d) := by have hh := mul_le_mul_of_nonneg_right hce20 hscaleNonneg simpa [mul_div_assoc] using hh _ ≤ _ := hhalf _ ≤ _ := hfixed) refine ⟨hepsilon0, hepsilonHalf, hd, hn, hdegree, hamplitude, harange, hbox, ?_, hgram, hsep, ?_, hpoisRate, ?_, hfinal⟩ · refine ⟨hdom, priors, ?_⟩ dsimp only refine ⟨hmeanSep, hsepPos, hsepOne, ?_, ?_, hgeomSmall, ?_, ?_⟩ · exact hfullTail · gcongr · intro nu hnu exact (hpairTail nu hnu).1 · simpa [C, hmeanSep] using htail · have hce : cepsilon ≤ 11 / 512 := min_le_left _ _ nlinarith [hpoisSep, sq_nonneg (densePriorSeparation n d)] · exact hfixed
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.dense_moment_matching_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseLowerAssembly.lean:586
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseMomentMatchingLower 28 declarations Conditional dense moment-matching lower bound.

Conditional dense moment-matching lower bound.

theorem measurable_oneCellLikelihood Lemma measurable_oneCellLikelihood in the paper ↗

The Poisson sign-count likelihood is jointly measurable in its contrast parameter and the two observed counts. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
Measurable (fun p : ℝ × DenseSignCounts => oneCellLikelihood lambda p.1 p.2)
Proof (Lean source)
-- @node: measurable_oneCellLikelihood @[fun_prop] lemma measurable_oneCellLikelihood (lambda : ℝ) : Measurable (fun p : ℝ × DenseSignCounts => oneCellLikelihood lambda p.1 p.2) := by apply measurable_from_prod_countable_left intro r unfold oneCellLikelihood fun_prop
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_oneCellLikelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:15
theorem oneCellLikelihood_nonnegative_of_abs_le_one Lemma oneCellLikelihood_nonnegative_of_abs_le_one in the paper ↗

On the prior support, both sign factors in the Poisson likelihood are nonnegative. This uses the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda theta :
htheta :
|theta| ≤ 1
0 ≤ oneCellLikelihood lambda theta r
Proof (Lean source)
-- @node: oneCellLikelihood_nonnegative_of_abs_le_one lemma oneCellLikelihood_nonnegative_of_abs_le_one (lambda theta : ℝ) (htheta : |theta| ≤ 1) (r : DenseSignCounts) : 0 ≤ oneCellLikelihood lambda theta r := by have ht := (abs_le.mp htheta) unfold oneCellLikelihood exact mul_nonneg (pow_nonneg (by linarith [ht.1]) _) (pow_nonneg (by linarith [ht.2]) _)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.oneCellLikelihood_nonnegative_of_abs_le_one · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:26
theorem integral_oneCellLikelihood_denseSignBaseline Lemma integral_oneCellLikelihood_denseSignBaseline in the paper ↗

The likelihood ratio integrates to one under the zero-contrast sign-count law. This uses the Poisson intensity is nonnegative. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda theta :
hlambda :
0 ≤ lambda
∫ r : DenseSignCounts, oneCellLikelihood lambda theta r ∂denseSignBaseline lambda = 1
Proof (Lean source)
-- @node: integral_oneCellLikelihood_denseSignBaseline lemma integral_oneCellLikelihood_denseSignBaseline (lambda theta : ℝ) (hlambda : 0 ≤ lambda) : ∫ r : DenseSignCounts, oneCellLikelihood lambda theta r ∂denseSignBaseline lambda = 1 := by let lam : NNReal := lambda.toNNReal / 2 have hlam : (lam : ℝ) = lambda / 2 := by simp [lam, Real.coe_toNNReal lambda hlambda] have hparam : (lambda / 2).toNNReal = lam := by apply NNReal.eq rw [Real.coe_toNNReal _ (div_nonneg hlambda (by norm_num)), hlam] rw [show denseSignBaseline lambda = (poissonMeasure lam).prod (poissonMeasure lam) by simp only [denseSignBaseline, hparam]] rw [show (fun r : DenseSignCounts => oneCellLikelihood lambda theta r) = fun r => (1 + theta) ^ r.1 * (1 - theta) ^ r.2 by funext r rfl] rw [integral_prod_mul, poisson_power_mgf, poisson_power_mgf, ← Real.exp_add, hlam] rw [show lambda / 2 * (1 + theta - 1) + lambda / 2 * (1 - theta - 1) = 0 by ring] exact Real.exp_zero
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_oneCellLikelihood_denseSignBaseline · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:37

The two independent Poisson sign counts at contrast theta.

Definition (Lean source)
lambda theta :
denseSignLaw lambda theta :
(poissonMeasure (lambda / 2 * (1 + theta)).toNNReal).prod (poissonMeasure (lambda / 2 * (1 - theta)).toNNReal)
theorem denseSignLaw_eq_withDensity

On the contrast interval, the exact sign-count experiment has the paper's likelihood ratio with respect to the zero-contrast law. This uses the Poisson intensity is nonnegative, and the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda theta :
hlambda :
0 ≤ lambda
htheta :
|theta| ≤ 1
denseSignLaw lambda theta
= (denseSignBaseline lambda).withDensity (fun r => ofReal (oneCellLikelihood lambda theta r))
Proof (Lean source)
lemma denseSignLaw_eq_withDensity (lambda theta : ℝ) (hlambda : 0 ≤ lambda) (htheta : |theta| ≤ 1) : denseSignLaw lambda theta = (denseSignBaseline lambda).withDensity (fun r => ofReal (oneCellLikelihood lambda theta r)) := by apply Measure.ext_of_singleton intro r rw [withDensity_apply _ (MeasurableSet.singleton r)] rw [show ({r} : Set DenseSignCounts) = {r.1} ×ˢ {r.2} by ext; simp, denseSignLaw, denseSignBaseline, Measure.prod_prod] simp [ProbabilityTheory.poissonMeasure_singleton, oneCellLikelihood] rw [show ({r} : Set DenseSignCounts) = {r.1} ×ˢ {r.2} by ext; simp, Measure.prod_prod] simp only [ProbabilityTheory.poissonMeasure_singleton] have ht := abs_le.mp htheta have hplus : 0 ≤ 1 + theta := by linarith [ht.1] have hminus : 0 ≤ 1 - theta := by linarith [ht.2] rw [← ENNReal.toReal_eq_toReal_iff' (by finiteness) (by finiteness)] have h1 : 0 ≤ exp (-max (lambda / 2 * (1 + theta)) 0) * max (lambda / 2 * (1 + theta)) 0 ^ r.1 / (r.1.factorial : ℝ) := by positivity have h2 : 0 ≤ exp (-max (lambda / 2 * (1 - theta)) 0) * max (lambda / 2 * (1 - theta)) 0 ^ r.2 / (r.2.factorial : ℝ) := by positivity have h3 : 0 ≤ exp (-((lambda / 2).toNNReal : ℝ)) * ((lambda / 2).toNNReal : ℝ) ^ r.1 / (r.1.factorial : ℝ) := by positivity have h4 : 0 ≤ exp (-((lambda / 2).toNNReal : ℝ)) * ((lambda / 2).toNNReal : ℝ) ^ r.2 / (r.2.factorial : ℝ) := by positivity have h5 : 0 ≤ (1 + theta) ^ r.1 * (1 - theta) ^ r.2 := mul_nonneg (pow_nonneg hplus _) (pow_nonneg hminus _) rw [ENNReal.toReal_mul, ENNReal.toReal_mul, ENNReal.toReal_mul, ENNReal.toReal_ofReal h1, ENNReal.toReal_ofReal h2, ENNReal.toReal_ofReal h3, ENNReal.toReal_ofReal h4, ENNReal.toReal_ofReal h5] rw [Real.coe_toNNReal _ (div_nonneg hlambda (by norm_num))] rw [max_eq_left (mul_nonneg (div_nonneg hlambda (by norm_num)) hplus), max_eq_left (mul_nonneg (div_nonneg hlambda (by norm_num)) hminus)] rw [mul_pow, mul_pow] field_simp have hexp : exp (-(lambda * (1 + theta) / 2)) * exp (-(lambda * (1 - theta) / 2)) = exp (-(lambda / 2)) ^ 2 := by rw [pow_two, ← Real.exp_add, ← Real.exp_add] congr 1 ring calc _ = (exp (-(lambda * (1 + theta) / 2)) * exp (-(lambda * (1 - theta) / 2))) * ((lambda / 2) ^ r.1 * (1 + theta) ^ r.1 * (lambda / 2) ^ r.2 * (1 - theta) ^ r.2) := by ring _ = exp (-(lambda / 2)) ^ 2 * ((lambda / 2) ^ r.1 * (1 + theta) ^ r.1 * (lambda / 2) ^ r.2 * (1 - theta) ^ r.2) := by rw [hexp] _ = _ := by ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSignLaw_eq_withDensity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:71

The likelihood family after scaling the Cai--Low support to the dense amplitude.

Definition (Lean source)
n d :
t :
scaledDenseLikelihood n d t r :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scaledDenseLikelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:125
theorem scaledDenseSignLaw_eq_withDensity

The scaled one-cell hard experiment has the likelihood density required by the support-localized moment-matching theorem. This uses the sample size and alphabet lie in the dense regime, and the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
t :
ht :
|t| ≤ 1
Proof (Lean source)
lemma scaledDenseSignLaw_eq_withDensity (n d : ℕ) (hregime : DenseRegime n d) (t : ℝ) (ht : |t| ≤ 1) : denseSignLaw (poissonCellIntensity n d) (denseAmplitude n d * t) = (denseSignBaseline (poissonCellIntensity n d)).withDensity (fun r => ofReal (scaledDenseLikelihood n d t r)) := by have hdNat : 0 < d := lt_of_lt_of_le (by omega : 0 < 2) hregime.1 have hnNat : 0 < n := lt_trans (Nat.pow_pos hdNat) hregime.2 have hlambda : 0 ≤ poissonCellIntensity n d := by unfold poissonCellIntensity positivity have ha := denseAmplitude_range n d hregime have hscaled : |denseAmplitude n d * t| ≤ 1 := by rw [abs_mul, abs_of_nonneg (le_of_lt ha.1)] nlinarith [abs_nonneg t] simpa only [scaledDenseLikelihood] using denseSignLaw_eq_withDensity (poissonCellIntensity n d) (denseAmplitude n d * t) hlambda hscaled
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scaledDenseSignLaw_eq_withDensity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:133
theorem measurable_scaledDenseLikelihood

The scaled dense likelihood remains jointly measurable. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
Measurable (fun p : ℝ × DenseSignCounts => scaledDenseLikelihood n d p.1 p.2)
Proof (Lean source)
-- @node: measurable_scaledDenseLikelihood @[fun_prop] lemma measurable_scaledDenseLikelihood (n d : ℕ) : Measurable (fun p : ℝ × DenseSignCounts => scaledDenseLikelihood n d p.1 p.2) := by unfold scaledDenseLikelihood apply measurable_from_prod_countable_left intro r unfold oneCellLikelihood fun_prop
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_scaledDenseLikelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:153
theorem scaledDenseLikelihood_nonnegative_of_supported

The scaled likelihood is nonnegative on the Cai--Low support. This uses the sample size and alphabet lie in the dense regime, and the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
t :
ht :
|t| ≤ 1
0 ≤ scaledDenseLikelihood n d t r
Proof (Lean source)
-- @node: scaledDenseLikelihood_nonnegative_of_supported lemma scaledDenseLikelihood_nonnegative_of_supported (n d : ℕ) (hregime : DenseRegime n d) (t : ℝ) (ht : |t| ≤ 1) (r : DenseSignCounts) : 0 ≤ scaledDenseLikelihood n d t r := by apply oneCellLikelihood_nonnegative_of_abs_le_one rw [abs_mul] have ha := (denseAmplitude_range n d hregime).2 have ha0 := le_of_lt (denseAmplitude_range n d hregime).1 rw [abs_of_nonneg ha0] nlinarith [abs_nonneg t]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scaledDenseLikelihood_nonnegative_of_supported · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:163
theorem scaledDenseLikelihood_exponentialGram

On the prior support, the scaled likelihood has the exponential Gram kernel with interaction parameter lambda * amplitude². This uses the sample size and alphabet lie in the dense regime, and the stated t condition holds, and the stated t' condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
t :
_ht :
|t| ≤ 1
t' :
_ht' :
|t'| ≤ 1
(∫ r : DenseSignCounts, scaledDenseLikelihood n d t r * scaledDenseLikelihood n d t' r ∂denseSignBaseline (poissonCellIntensity n d))
= exp ((poissonCellIntensity n d * denseAmplitude n d ^ 2) * t * t')
Proof (Lean source)
-- @node: scaledDenseLikelihood_exponentialGram lemma scaledDenseLikelihood_exponentialGram (n d : ℕ) (hregime : DenseRegime n d) (t : ℝ) (_ht : |t| ≤ 1) (t' : ℝ) (_ht' : |t'| ≤ 1) : (∫ r : DenseSignCounts, scaledDenseLikelihood n d t r * scaledDenseLikelihood n d t' r ∂denseSignBaseline (poissonCellIntensity n d)) = exp ((poissonCellIntensity n d * denseAmplitude n d ^ 2) * t * t') := by have hdNat : 0 < d := lt_of_lt_of_le (by omega : 0 < 2) hregime.1 have hd : (0 : ℝ) < d := by exact_mod_cast hdNat have hn : (0 : ℝ) < n := by exact_mod_cast (lt_trans (Nat.pow_pos hdNat) hregime.2) unfold scaledDenseLikelihood rw [oneCellLikelihood_inner _ _ _ (le_of_lt (by unfold poissonCellIntensity positivity : 0 < poissonCellIntensity n d))] congr 1 ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scaledDenseLikelihood_exponentialGram · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:175
theorem denseLaw_jointMass

the dense observed law has the four stated symmetric atom masses in every cell.

Formal statement
d :
theta :
conclusion 1
x :
jointMass (observedMarginal (denseLaw theta)) x true true
= (d : ℝ)⁻¹ / 4 * (1 + theta.1 x)
conclusion 2
x :
jointMass (observedMarginal (denseLaw theta)) x true false
= (d : ℝ)⁻¹ / 4 * (1 - theta.1 x)
conclusion 3
x :
jointMass (observedMarginal (denseLaw theta)) x false true
= (d : ℝ)⁻¹ / 4 * (1 - theta.1 x)
conclusion 4
x :
jointMass (observedMarginal (denseLaw theta)) x false false
= (d : ℝ)⁻¹ / 4 * (1 + theta.1 x)
Proof (Lean source)
lemma denseLaw_jointMass {d : ℕ} (theta : DenseContrast d) : (∀ x, jointMass (observedMarginal (denseLaw theta)) x true true = (d : ℝ)⁻¹ / 4 * (1 + theta.1 x)) ∧ (∀ x, jointMass (observedMarginal (denseLaw theta)) x true false = (d : ℝ)⁻¹ / 4 * (1 - theta.1 x)) ∧ (∀ x, jointMass (observedMarginal (denseLaw theta)) x false true = (d : ℝ)⁻¹ / 4 * (1 - theta.1 x)) ∧ (∀ x, jointMass (observedMarginal (denseLaw theta)) x false false = (d : ℝ)⁻¹ / 4 * (1 + theta.1 x)) := by classical have ht (x : Fin d) := theta.2.2 x constructor · intro x have hplus : 0 ≤ 1 + theta.1 x := by linarith [(ht x).1] have hminus : 0 ≤ 1 - theta.1 x := by linarith [(ht x).2] have hmu0c : 0 ≤ 1 - (1 - theta.1 x) / 2 := by linarith have hmu1c : 0 ≤ 1 - (1 + theta.1 x) / 2 := by linarith simp [jointMass, observedMarginal, denseLaw, denseFullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] repeat' rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] ring · constructor · intro x have hplus : 0 ≤ 1 + theta.1 x := by linarith [(ht x).1] have hminus : 0 ≤ 1 - theta.1 x := by linarith [(ht x).2] have hmu0c : 0 ≤ 1 - (1 - theta.1 x) / 2 := by linarith have hmu1c : 0 ≤ 1 - (1 + theta.1 x) / 2 := by linarith simp [jointMass, observedMarginal, denseLaw, denseFullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] repeat' rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] ring · constructor · intro x have hplus : 0 ≤ 1 + theta.1 x := by linarith [(ht x).1] have hminus : 0 ≤ 1 - theta.1 x := by linarith [(ht x).2] have hmu0c : 0 ≤ 1 - (1 - theta.1 x) / 2 := by linarith have hmu1c : 0 ≤ 1 - (1 + theta.1 x) / 2 := by linarith simp [jointMass, observedMarginal, denseLaw, denseFullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] repeat' rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] ring · intro x have hplus : 0 ≤ 1 + theta.1 x := by linarith [(ht x).1] have hminus : 0 ≤ 1 - theta.1 x := by linarith [(ht x).2] have hmu0c : 0 ≤ 1 - (1 - theta.1 x) / 2 := by linarith have hmu1c : 0 ≤ 1 - (1 + theta.1 x) / 2 := by linarith simp [jointMass, observedMarginal, denseLaw, denseFullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] repeat' rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLaw_jointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:199

The zero contrast is the common reference point of the dense experiment.

Definition (Lean source)
d :
hd :
2 ≤ d
denseZeroContrast d hd :
⟨fun _ => 0, hd, by intro x; exact Set.mem_Icc.mpr (by norm_num)⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseZeroContrast · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:257
theorem denseLaw_atom_likelihood

Relative to the zero-contrast law, one observed atom contributes the positive or negative likelihood factor according as treatment and outcome agree or disagree. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
theta :
x :
Fin d
a y :
jointMass (observedMarginal (denseLaw theta)) x a y
= jointMass (observedMarginal (denseLaw (denseZeroContrast d theta.2.1))) x a y * (if a = y then 1 + theta.1 x else 1 - theta.1 x)
Proof (Lean source)
lemma denseLaw_atom_likelihood {d : ℕ} (theta : DenseContrast d) (x : Fin d) (a y : Bool) : jointMass (observedMarginal (denseLaw theta)) x a y = jointMass (observedMarginal (denseLaw (denseZeroContrast d theta.2.1))) x a y * (if a = y then 1 + theta.1 x else 1 - theta.1 x) := by have htheta := denseLaw_jointMass theta have hzero := denseLaw_jointMass (denseZeroContrast d theta.2.1) fin_cases a <;> fin_cases y · rw [htheta.1, hzero.1] simp [denseZeroContrast] · rw [htheta.2.1, hzero.2.1] simp [denseZeroContrast] · rw [htheta.2.2.1, hzero.2.2.1] simp [denseZeroContrast] · rw [htheta.2.2.2, hzero.2.2.2] simp [denseZeroContrast]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLaw_atom_likelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:262
theorem denseLaw_observed_spec

If the overlap parameter satisfies its stated range restriction, then the dense law is an overlapping observed model with uniform cell masses, propensity one half, shifted outcome means, and the stated optimal value.

Formal statement
d :
epsilon :
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
theta :
∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta)),
conclusion 1
x :
cellMass (observedMarginal (denseLaw theta)) x = 1 / d
conclusion 2
x :
propensity (observedMarginal (denseLaw theta)) x = 1 / 2
conclusion 3
x :
outcomeMean (observedMarginal (denseLaw theta)) true x = (1 + theta.1 x) / 2
conclusion 4
x :
outcomeMean (observedMarginal (denseLaw theta)) false x = (1 - theta.1 x) / 2
conclusion 5
= 1 / 2 + (∑ x : Fin d, |theta.1 x|) / (2 * d)
Proof (Lean source)
lemma denseLaw_observed_spec {d : ℕ} (epsilon : ℝ) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (theta : DenseContrast d) : ∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta)), (∀ x, cellMass (observedMarginal (denseLaw theta)) x = 1 / d) ∧ (∀ x, propensity (observedMarginal (denseLaw theta)) x = 1 / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta)) true x = (1 + theta.1 x) / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta)) false x = (1 - theta.1 x) / 2) ∧ observedOptimalValue (observedMarginal (denseLaw theta)) hmodel = 1 / 2 + (∑ x : Fin d, |theta.1 x|) / (2 * d) := by classical let P := observedMarginal (denseLaw theta) have hj := denseLaw_jointMass theta have hd0 : (d : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (lt_of_lt_of_le (by omega) theta.2.1)) have hcell : ∀ x, cellMass P x = 1 / d := by intro x simp [P, cellMass, hj.1 x, hj.2.1 x, hj.2.2.1 x, hj.2.2.2 x] field_simp [hd0] ring have harm : ∀ a x, armMass P a x = 1 / (2 * d) := by intro a x fin_cases a <;> simp [P, armMass, hj.1 x, hj.2.1 x, hj.2.2.1 x, hj.2.2.2 x] <;> field_simp [hd0] <;> ring have hprop : ∀ x, propensity P x = 1 / 2 := by intro x rw [propensity, harm, hcell] field_simp [hd0] have houtTrue : ∀ x, outcomeMean P true x = (1 + theta.1 x) / 2 := by intro x rw [outcomeMean, hj.1, harm] field_simp [hd0] ring have houtFalse : ∀ x, outcomeMean P false x = (1 - theta.1 x) / 2 := by intro x rw [outcomeMean, hj.2.2.1, harm] field_simp [hd0] ring have hP : ObservedModelClass epsilon P := by refine ⟨theta.2.1, hepsilon.1, hepsilon.2, ?_⟩ intro x _hx rw [hprop] constructor <;> linarith refine ⟨hP, hcell, hprop, houtTrue, houtFalse, ?_⟩ change observedOptimalValueRaw P = _ rw [observedOptimalValueRaw] simp_rw [hcell, houtFalse, houtTrue] have hmax (x : Fin d) : max ((1 - theta.1 x) / 2) ((1 + theta.1 x) / 2) = (1 + |theta.1 x|) / 2 := by by_cases hx : 0 ≤ theta.1 x · rw [max_eq_right (by linarith), abs_of_nonneg hx] · have hx' : theta.1 x ≤ 0 := le_of_not_ge hx rw [max_eq_left (by linarith), abs_of_nonpos hx'] ring simp_rw [hmax] have hterm (x : Fin d) : 1 / (d : ℝ) * ((1 + |theta.1 x|) / 2) = 1 / (2 * d) + |theta.1 x| / (2 * d) := by field_simp [hd0] simp_rw [hterm] rw [Finset.sum_add_distrib, Finset.sum_div] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp [hd0]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLaw_observed_spec · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:282
theorem denseBox_observed_spec

Every contrast in the scaled dense cube gives the required observed hard-submodel law. This uses the dense construction domain conditions hold, and the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
theta :
Fin d → ℝ
htheta :
∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d)
∃ theta' : DenseContrast d,
theta'.1 = theta
conclusion 1
∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')),
x :
cellMass (observedMarginal (denseLaw theta')) x = 1 / d
x :
propensity (observedMarginal (denseLaw theta')) x = 1 / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2
= 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)
Proof (Lean source)
lemma denseBox_observed_spec {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (theta : Fin d → ℝ) (htheta : ∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d)) : ∃ theta' : DenseContrast d, theta'.1 = theta ∧ ∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')), (∀ x, cellMass (observedMarginal (denseLaw theta')) x = 1 / d) ∧ (∀ x, propensity (observedMarginal (denseLaw theta')) x = 1 / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2) ∧ observedOptimalValue (observedMarginal (denseLaw theta')) hmodel = 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d) := by let theta' : DenseContrast d := ⟨theta, hdom.1, by intro x have hx := htheta x have hlo : (-1 / 2 : ℝ) ≤ -denseAmplitude n d := by linarith [hdom.2.2.2.2] constructor · exact hlo.trans hx.1 · exact hx.2.trans (by linarith [hdom.2.2.2.2])⟩ obtain ⟨hmodel, hcell, hprop, hmu1, hmu0, hvalue⟩ := denseLaw_observed_spec epsilon ⟨hdom.2.1, hdom.2.2.1⟩ theta' refine ⟨theta', rfl, hmodel, hcell, hprop, ?_, ?_, ?_⟩ · simpa [theta'] using hmu1 · simpa [theta'] using hmu0 · simpa [theta'] using hvalue
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseBox_observed_spec · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:351

Cai--Low supplies the exact supported, symmetric moment-matched pair at the chosen dense degree. This uses the Cai--Low moment-matching prior result is available, and the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
2 ≤ d
∃ nu0 nu1 : Measure ℝ, DensePriorPairConditions (lowerDegree d) nu0 nu1
Proof (Lean source)
lemma densePriorPair_exists (h_cai_low : CaiLowAbsoluteMomentPriors) (d : ℕ) (hd : 2 ≤ d) : ∃ nu0 nu1 : Measure ℝ, DensePriorPairConditions (lowerDegree d) nu0 nu1 := by obtain ⟨nu0, nu1, hpair⟩ := h_cai_low.1 (lowerDegree d) (lowerDegree_even d) (lowerDegree_pos d hd) exact ⟨nu0, nu1, hpair⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorPair_exists · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:380
def densePriorFamily_of_caiLow

Cai--Low's positive-even-degree prior pairs assemble into the family used by the dense construction.

Definition (Lean source)
densePriorFamily_of_caiLow h_cai_low :
clause 1
nu0 K := choose (h_cai_low.1 K.1 K.2.2 K.2.1)
clause 2
nu1 K := choose (Classical.choose_spec (h_cai_low.1 K.1 K.2.2 K.2.1))
clause 3
conditions K := by exact Classical.choose_spec (Classical.choose_spec (h_cai_low.1 K.1 K.2.2 K.2.1))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorFamily_of_caiLow · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:389
theorem denseScaledProductPrior_isProbability Lemma denseScaledProductPrior_isProbability in the paper ↗

Scaling a supported probability product prior into the dense contrast cube produces a probability measure. This uses the dense construction domain conditions hold, and the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
hsupp :
nu (Icc (-1) 1)ᶜ = 0
Proof (Lean source)
lemma denseScaledProductPrior_isProbability {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : IsProbabilityMeasure (denseScaledProductPrior n d epsilon hdom nu) := by let mu : Measure (Fin d → ℝ) := Measure.pi fun _ : Fin d => nu letI : IsProbabilityMeasure mu := by dsimp [mu]; infer_instance let S : Set (Fin d → ℝ) := {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} have hmem : ∀ᵐ t ∂mu, t ∈ S := by have hj : ∀ j : Fin d, ∀ᵐ t ∂mu, t j ∈ Icc (-1 : ℝ) 1 := by intro j exact (MeasureTheory.measurePreserving_eval (fun _ : Fin d => nu) j).quasiMeasurePreserving.ae (mem_ae_iff.mpr hsupp) exact ae_all_iff.mpr hj have hrestrict : mu.restrict S = mu := Measure.restrict_eq_self_of_ae_mem hmem let F : (Fin d → ℝ) → DenseContrast d := fun t => if ht : ∀ j, t j ∈ Icc (-1 : ℝ) 1 then ⟨fun j => denseAmplitude n d * t j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (ht j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (ht j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ else ⟨fun _ => 0, hdom.1, by intro; norm_num⟩ have hS : MeasurableSet S := by dsimp [S] convert MeasurableSet.iInter (fun j : Fin d => (measurableSet_Icc : MeasurableSet (Icc (-1 : ℝ) 1)).preimage (measurable_pi_apply j)) using 1 <;> ext t <;> simp have hF : Measurable F := by unfold F have htrue : Measurable (fun t : S => (⟨fun j => denseAmplitude n d * t.1 j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (t.2 j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (t.2 j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ : DenseContrast d)) := by apply Measurable.subtype_mk apply measurable_pi_lambda intro j exact measurable_const.mul ((measurable_pi_apply j).comp measurable_subtype_coe) exact htrue.dite measurable_const hS change IsProbabilityMeasure (Measure.map F (mu.restrict S)) rw [hrestrict] exact Measure.isProbabilityMeasure_map hF.aemeasurable
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseScaledProductPrior_isProbability · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:400
theorem measurable_denseTargetAt Lemma measurable_denseTargetAt in the paper ↗

The dense target is measurable on the finite contrast cube. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
Measurable (denseTargetAt : DenseContrast d → ℝ)
Proof (Lean source)
-- @node: measurable_denseTargetAt @[fun_prop] lemma measurable_denseTargetAt {d : ℕ} : Measurable (denseTargetAt : DenseContrast d → ℝ) := by unfold denseTargetAt apply Measurable.add measurable_const apply Measurable.div_const apply measurable_sum intro j _hj exact continuous_abs.measurable.comp ((measurable_pi_apply j).comp measurable_subtype_coe)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_denseTargetAt · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:448
theorem densePriorTarget_variance_le Lemma densePriorTarget_variance_le in the paper ↗

Under either supported coordinate prior, the dense target has the required 1 / d variance gain from the independent product coordinates. This uses the dense construction domain conditions hold, and the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
hsupp :
nu (Icc (-1) 1)ᶜ = 0
theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu
denseAmplitude n d ^ 2 / (4 * d)
Proof (Lean source)
-- @node: densePriorTarget_variance_le lemma densePriorTarget_variance_le {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : ∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d) := by let mu : Measure (Fin d → ℝ) := Measure.pi fun _ : Fin d => nu letI : IsProbabilityMeasure mu := by dsimp [mu]; infer_instance let S : Set (Fin d → ℝ) := {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} have hmem : ∀ᵐ t ∂mu, t ∈ S := by apply ae_all_iff.mpr intro j exact (MeasureTheory.measurePreserving_eval (fun _ : Fin d => nu) j).quasiMeasurePreserving.ae (mem_ae_iff.mpr hsupp) have hrestrict : mu.restrict S = mu := Measure.restrict_eq_self_of_ae_mem hmem let F : (Fin d → ℝ) → DenseContrast d := fun t => if ht : t ∈ S then ⟨fun j => denseAmplitude n d * t j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (ht j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (ht j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ else ⟨fun _ => 0, hdom.1, by intro; norm_num⟩ have hSmeas : MeasurableSet S := by dsimp [S] convert MeasurableSet.iInter (fun j : Fin d => (measurableSet_Icc : MeasurableSet (Icc (-1 : ℝ) 1)).preimage (measurable_pi_apply j)) using 1 <;> ext t <;> simp have hF : Measurable F := by unfold F have htrue : Measurable (fun t : S => (⟨fun j => denseAmplitude n d * t.1 j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (t.2 j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (t.2 j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ : DenseContrast d)) := by apply Measurable.subtype_mk apply measurable_pi_lambda intro j exact measurable_const.mul ((measurable_pi_apply j).comp measurable_subtype_coe) exact htrue.dite measurable_const hSmeas have habs_mem : MemLp (fun t : ℝ => |t|) 2 nu := by apply MemLp.of_bound continuous_abs.measurable.aestronglyMeasurable 1 filter_upwards [mem_ae_iff.mpr hsupp] with t ht rw [Real.norm_eq_abs, abs_of_nonneg (abs_nonneg t)] exact abs_le.mpr ht have habs_var : Var[fun t : ℝ => |t|; nu] ≤ 1 / 4 := by have hbounded : ∀ᵐ t ∂nu, |t| ∈ Icc (0 : ℝ) 1 := by filter_upwards [mem_ae_iff.mpr hsupp] with t ht exact ⟨abs_nonneg t, abs_le.mpr ht⟩ convert ProbabilityTheory.variance_le_sq_of_bounded hbounded continuous_abs.measurable.aemeasurable using 1 <;> norm_num let sumAbs : (Fin d → ℝ) → ℝ := fun t => ∑ j, |t j| have hsum_mem : MemLp sumAbs 2 mu := by dsimp [sumAbs] rw [show (fun t : Fin d → ℝ => ∑ j : Fin d, |t j|) = ∑ j : Fin d, fun t => |t j| by ext t; simp [Finset.sum_apply]] apply MeasureTheory.memLp_finset_sum' intro j _hj exact habs_mem.comp_measurePreserving (MeasureTheory.measurePreserving_eval (fun _ : Fin d => nu) j) have hsum_integral : ∫ t, sumAbs t ∂mu = d * ∫ t, |t| ∂nu := by simpa [mu, sumAbs] using integral_sum_pi_eq (N := d) nu (fun t : ℝ => |t|) (habs_mem.integrable (by norm_num)) have hsum_variance : Var[sumAbs; mu] = d * Var[fun t : ℝ => |t|; nu] := by simpa [mu, sumAbs] using variance_sum_pi_eq (N := d) nu (fun t : ℝ => |t|) habs_mem have hmean : densePriorTargetMean n d epsilon hdom nu = 1 / 2 + denseAmplitude n d / (2 * d) * (d * ∫ t, |t| ∂nu) := by rw [densePriorTargetMean_formula n d epsilon hdom nu hsupp] simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] have hdR : (0 : ℝ) < d := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) hdom.1) change (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂Measure.map F (mu.restrict S)) ≤ _ rw [hrestrict] have htargetStrong : AEStronglyMeasurable (fun theta : DenseContrast d => (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2) (Measure.map F mu) := ((measurable_denseTargetAt.sub measurable_const).pow_const 2).aestronglyMeasurable rw [integral_map hF.aemeasurable htargetStrong] have hpoint : ∀ᵐ t ∂mu, denseTargetAt (F t) = 1 / 2 + denseAmplitude n d / (2 * d) * sumAbs t := by filter_upwards [hmem] with t ht simp only [F, ht, ↓reduceDIte, denseTargetAt, sumAbs] have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 simp_rw [abs_mul, abs_of_nonneg ha0] congr 1 rw [Finset.sum_div] rw [Finset.mul_sum] apply Finset.sum_congr rfl intro x _hx ring calc ∫ t, (denseTargetAt (F t) - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂mu = ∫ t, (denseAmplitude n d / (2 * d)) ^ 2 * (sumAbs t - ∫ t, sumAbs t ∂mu) ^ 2 ∂mu := by rw [hmean] apply integral_congr_ae filter_upwards [hpoint] with t ht rw [ht, hsum_integral] ring _ = (denseAmplitude n d / (2 * d)) ^ 2 * Var[sumAbs; mu] := by rw [integral_const_mul] congr 1 exact (ProbabilityTheory.variance_eq_integral hsum_mem.aemeasurable).symm _ = (denseAmplitude n d / (2 * d)) ^ 2 * (d * Var[fun t : ℝ => |t|; nu]) := by rw [hsum_variance] _ ≤ (denseAmplitude n d / (2 * d)) ^ 2 * (d * (1 / 4)) := by gcongr _ ≤ denseAmplitude n d ^ 2 / (4 * d) := by field_simp nlinarith [sq_nonneg (denseAmplitude n d), hdR]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorTarget_variance_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:460
theorem densePriorTarget_tail_le Lemma densePriorTarget_tail_le in the paper ↗

Chebyshev turns the product-prior variance bound into the one-eighth concentration clause used by the standard fuzzy-hypothesis theorem. This uses the dense construction domain conditions hold, and the prior is supported on the unit interval, and the stated e condition holds, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
hsupp :
nu (Icc (-1) 1)ᶜ = 0
hscale :
32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2
denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4}
≤ 1 / 8
Proof (Lean source)
lemma densePriorTarget_tail_le {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) (hE : 0 < bestEvenApproxError (lowerDegree d)) (hscale : 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2) : denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8 := by let prior := denseScaledProductPrior n d epsilon hdom nu letI : IsProbabilityMeasure prior := denseScaledProductPrior_isProbability hdom nu hsupp have htarget_mem : MemLp (denseTargetAt : DenseContrast d → ℝ) 2 prior := by apply MemLp.of_bound measurable_denseTargetAt.aestronglyMeasurable 1 filter_upwards with theta rw [Real.norm_eq_abs, abs_of_nonneg] · unfold denseTargetAt have habs (x : Fin d) : |theta.1 x| ≤ 1 / 2 := by apply abs_le.mpr constructor <;> linarith [(theta.2.2 x).1, (theta.2.2 x).2] calc 1 / 2 + (∑ x, |theta.1 x|) / (2 * d) ≤ 1 / 2 + (∑ _x : Fin d, (1 / 2 : ℝ)) / (2 * d) := by gcongr exact habs x _ ≤ 1 := by have hdR : (0 : ℝ) < d := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) theta.2.1) simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] field_simp linarith · unfold denseTargetAt positivity have hsep : 0 < densePriorSeparation n d := by unfold densePriorSeparation exact mul_pos hdom.2.2.2.1 hE have hcheb := ProbabilityTheory.meas_ge_le_variance_div_sq htarget_mem (show 0 < densePriorSeparation n d / 4 by positivity) have hvar : Var[(denseTargetAt : DenseContrast d → ℝ); prior] ≤ denseAmplitude n d ^ 2 / (4 * d) := by rw [ProbabilityTheory.variance_eq_integral measurable_denseTargetAt.aemeasurable] exact densePriorTarget_variance_le hdom nu hsupp have hratio : Var[(denseTargetAt : DenseContrast d → ℝ); prior] / (densePriorSeparation n d / 4) ^ 2 ≤ 1 / 8 := by have ha : 0 < denseAmplitude n d := hdom.2.2.2.1 have hd : (0 : ℝ) < d := by exact_mod_cast (lt_of_lt_of_le (by norm_num : 0 < 2) hdom.1) calc _ ≤ (denseAmplitude n d ^ 2 / (4 * d)) / (densePriorSeparation n d / 4) ^ 2 := by gcongr _ ≤ 1 / 8 := by unfold densePriorSeparation field_simp nlinarith [sq_pos_of_pos ha, sq_pos_of_pos hE] calc prior {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ prior {theta | densePriorSeparation n d / 4 ≤ |denseTargetAt theta - ∫ x, denseTargetAt x ∂prior|} := by apply measure_mono intro theta htheta change densePriorSeparation n d / 4 < _ at htheta exact le_of_lt htheta _ ≤ ofReal (Var[(denseTargetAt : DenseContrast d → ℝ); prior] / (densePriorSeparation n d / 4) ^ 2) := hcheb _ ≤ 1 / 8 := by simpa using ENNReal.ofReal_le_ofReal hratio
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorTarget_tail_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:586
theorem bestEvenApproxError_lowerDegree_pos Lemma bestEvenApproxError_lowerDegree_pos in the paper ↗

The cited reciprocal approximation lower bound makes the chosen error strictly positive. This uses the Cai--Low moment-matching prior result is available, and the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
2 ≤ d
Proof (Lean source)
lemma bestEvenApproxError_lowerDegree_pos (h_cai_low : CaiLowAbsoluteMomentPriors) (d : ℕ) (hd : 2 ≤ d) : 0 < bestEvenApproxError (lowerDegree d) := by obtain ⟨c, C, hc, _hcC, hbounds⟩ := h_cai_low.2 have hK : (0 : ℝ) < lowerDegree d := by exact_mod_cast lowerDegree_pos d hd have hlower := (hbounds (lowerDegree d) (lowerDegree_even d) (lowerDegree_pos d hd)).1 exact lt_of_lt_of_le (div_pos hc hK) hlower
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bestEvenApproxError_lowerDegree_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:659
theorem denseLikelihoodTail_eq_exponentialSeriesTail Lemma denseLikelihoodTail_eq_exponentialSeriesTail in the paper ↗

The paper's likelihood tail is exactly the tail used by the generic moment-matched-mixture substrate. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLikelihoodTail_eq_exponentialSeriesTail · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:669
theorem poissonCellIntensity_mul_denseAmplitude_sq Lemma poissonCellIntensity_mul_denseAmplitude_sq in the paper ↗

In the dense regime the exponential-tail argument is the chosen degree divided by sixty-four. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
h :
Proof (Lean source)
lemma poissonCellIntensity_mul_denseAmplitude_sq (n d : ℕ) (h : DenseRegime n d) : poissonCellIntensity n d * denseAmplitude n d ^ 2 = lowerDegree d / 64 := by have hdNat : 0 < d := lt_of_lt_of_le (by omega) h.1 have hnNat : 0 < n := lt_trans (Nat.pow_pos hdNat) h.2 have hn : (n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hnNat) have hd : (d : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hdNat) rw [denseAmplitude_sq n d h, poissonCellIntensity] field_simp ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonCellIntensity_mul_denseAmplitude_sq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:680
theorem densePriorPair_support_mass_one Lemma densePriorPair_support_mass_one in the paper ↗

A probability prior whose complement of [-1,1] is null has unit mass on the support set, in the form expected by the mixture substrate. This uses the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
hsupp :
nu (Icc (-1) 1)ᶜ = 0
nu {t : ℝ | |t| ≤ 1} = 1
Proof (Lean source)
lemma densePriorPair_support_mass_one (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : nu {t : ℝ | |t| ≤ 1} = 1 := by have hset : {t : ℝ | |t| ≤ 1} = Icc (-1) 1 := by ext t simp [abs_le] rw [hset] have hmeas : MeasurableSet (Icc (-1 : ℝ) 1) := measurableSet_Icc have hunion : nu (Icc (-1 : ℝ) 1) + nu (Icc (-1) 1)ᶜ = nu univ := by rw [← measure_union disjoint_compl_right hmeas.compl] congr exact Set.union_compl_self _ rw [hsupp, add_zero, measure_univ] at hunion exact hunion
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorPair_support_mass_one · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:695

A globally probability-valued version of the scaled sign-count experiment. Outside the prior support it falls back to the zero-contrast baseline; on the support it is exactly the scaled Poisson sign-count law.

Definition (Lean source)
n d :
denseSupportedSignKernel n d :
(Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))).withDensity (fun t r => if |t| ≤ 1 then ofReal (scaledDenseLikelihood n d t r) else 1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSupportedSignKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:713
theorem denseMomentMatchedSignProduct_tv Lemma denseMomentMatchedSignProduct_tv in the paper ↗

The promoted support-localized mixture theorem gives the paper's product sign-count total-variation bound directly from the Cai--Low prior conditions. This uses the sample size and alphabet lie in the dense regime, and the two priors satisfy the moment-matching certificate. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
nu0 nu1 :
Proof (Lean source)
lemma denseMomentMatchedSignProduct_tv {n d : ℕ} (hregime : DenseRegime n d) (nu0 nu1 : Measure ℝ) (hpair : DensePriorPairConditions (lowerDegree d) nu0 nu1) : tvDist (productPriorPredictive d nu0 (denseSupportedSignKernel n d)) (productPriorPredictive d nu1 (denseSupportedSignKernel n d)) ≤ d * sqrt (denseLikelihoodTail n d) := by let Q : Measure DenseSignCounts := denseSignBaseline (poissonCellIntensity n d) let K : KernelDenseSignCounts := denseSupportedSignKernel n d letI : IsProbabilityMeasure nu0 := hpair.1 letI : IsProbabilityMeasure nu1 := hpair.2.1 have hQ : IsProbabilityMeasure Q := by dsimp [Q, denseSignBaseline] infer_instance letI : IsProbabilityMeasure Q := hQ have hf : Measurable (uncurry fun t r => if |t| ≤ 1 then ofReal (scaledDenseLikelihood n d t r) else 1) := by exact (measurable_scaledDenseLikelihood n d).ennreal_ofReal.ite (measurableSet_le (continuous_abs.measurable.comp measurable_fst) measurable_const) measurable_const have hK : ∀ t, IsProbabilityMeasure (K t) := by intro t rw [isProbabilityMeasure_iff] by_cases ht : |t| ≤ 1 · rw [show K t = denseSignLaw (poissonCellIntensity n d) (denseAmplitude n d * t) by dsimp [K, Q, denseSupportedSignKernel] rw [Kernel.withDensity_apply (Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))) hf t] simp only [ht, ↓reduceIte] exact (scaledDenseSignLaw_eq_withDensity n d hregime t ht).symm] simp [denseSignLaw] · dsimp [K, denseSupportedSignKernel] rw [Kernel.withDensity_apply (Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))) hf t] simp [ht, measure_univ] have hsupp0 : nu0 {t : ℝ | |t| ≤ 1} = 1 := densePriorPair_support_mass_one nu0 hpair.2.2.1 have hsupp1 : nu1 {t : ℝ | |t| ≤ 1} = 1 := densePriorPair_support_mass_one nu1 hpair.2.2.2.1 have hmom : ∀ r ≤ lowerDegree d, ∫ t, t ^ r ∂nu0 = ∫ t, t ^ r ∂nu1 := by intro r hr exact (hpair.2.2.2.2.2.2.1 r hr).symm have htv := momentMatchedProductMixture_tv_le_of_supported d nu0 nu1 K Q (scaledDenseLikelihood n d) hK (poissonCellIntensity n d * denseAmplitude n d ^ 2) 1 (lowerDegree d) (by rw [poissonCellIntensity_mul_denseAmplitude_sq n d hregime]; positivity) (by norm_num) (measurable_scaledDenseLikelihood n d) (scaledDenseLikelihood_nonnegative_of_supported n d hregime) (by intro t ht dsimp [K, Q, denseSupportedSignKernel] rw [Kernel.withDensity_apply (Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))) hf t] simp [ht]) (scaledDenseLikelihood_exponentialGram n d hregime) hsupp0 hsupp1 hmom rw [denseLikelihoodTail_eq_exponentialSeriesTail] simpa [K, Q] using htv
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseMomentMatchedSignProduct_tv · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:720
theorem denseConstructionCertificate Lemma denseConstructionCertificate in the paper ↗

The deterministic construction part of the dense certificate follows from the degree, amplitude, observed-law, and one-cell likelihood identities. This uses the dense construction domain conditions hold, and the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
hn :
d ^ 2 < n
conclusion 1
conclusion 2
denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n)
conclusion 3
denseAmplitude n d ≤ 1 / 2
conclusion 4
theta :
Fin d → ℝ
(∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d))
∃ theta' : DenseContrast d,
theta'.1 = theta
∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')),
x :
cellMass (observedMarginal (denseLaw theta')) x = 1 / d
x :
propensity (observedMarginal (denseLaw theta')) x = 1 / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2
x :
outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2
= 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)
conclusion 5
theta theta' :
(∫ r : DenseSignCounts, oneCellLikelihood (poissonCellIntensity n d) theta r * oneCellLikelihood (poissonCellIntensity n d) theta' r ∂denseSignBaseline (poissonCellIntensity n d))
= exp (poissonCellIntensity n d * theta * theta')
Proof (Lean source)
lemma denseConstructionCertificate {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (hn : d ^ 2 < n) : (8 * logAlphabet d ≤ lowerDegree d ∧ lowerDegree d < 8 * logAlphabet d + 2) ∧ denseAmplitude n d ^ 2 = lowerDegree d * d / (128 * n) ∧ denseAmplitude n d ≤ 1 / 2 ∧ (∀ theta : Fin d → ℝ, (∀ x, theta x ∈ Icc (-denseAmplitude n d) (denseAmplitude n d)) → ∃ theta' : DenseContrast d, theta'.1 = theta ∧ ∃ hmodel : ObservedModelClass epsilon (observedMarginal (denseLaw theta')), (∀ x, cellMass (observedMarginal (denseLaw theta')) x = 1 / d) ∧ (∀ x, propensity (observedMarginal (denseLaw theta')) x = 1 / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) true x = (1 + theta x) / 2) ∧ (∀ x, outcomeMean (observedMarginal (denseLaw theta')) false x = (1 - theta x) / 2) ∧ observedOptimalValue (observedMarginal (denseLaw theta')) hmodel = 1 / 2 + (∑ x : Fin d, |theta x|) / (2 * d)) ∧ (∀ theta theta' : ℝ, (∫ r : DenseSignCounts, oneCellLikelihood (poissonCellIntensity n d) theta r * oneCellLikelihood (poissonCellIntensity n d) theta' r ∂denseSignBaseline (poissonCellIntensity n d)) = exp (poissonCellIntensity n d * theta * theta')) ∧ densePriorSeparation n d = denseAmplitude n d * bestEvenApproxError (lowerDegree d) := by have hregime : DenseRegime n d := ⟨hdom.1, hn⟩ refine ⟨lowerDegree_log_bounds d, denseAmplitude_sq n d hregime, (denseAmplitude_range n d hregime).2, ?_, ?_, rfl⟩ · intro theta htheta exact denseBox_observed_spec hdom theta htheta · intro theta theta' exact oneCellLikelihood_inner _ _ _ (le_of_lt (by unfold poissonCellIntensity have hn0 : 0 < n := lt_trans (Nat.pow_pos (lt_of_lt_of_le (by omega) hdom.1)) hn have hnR : (0 : ℝ) < n := by exact_mod_cast hn0 have hdR : (0 : ℝ) < d := by exact_mod_cast (lt_of_lt_of_le (by omega) hdom.1) positivity))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseConstructionCertificate · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseMomentMatchingLower.lean:785
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseNumerics 3 declarations Numerical exponential-tail estimates for the dense moment-matching lower bound.

Numerical exponential-tail estimates for the dense moment-matching lower bound.

theorem denseLikelihoodTail_le_geometric Lemma denseLikelihoodTail_le_geometric in the paper ↗

The factorial tail at the calibrated dense intensity is dominated by the geometric series with ratio exp(1) / 64 used in the paper. This uses the sample size and alphabet lie in the dense regime. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
denseLikelihoodTail n d ≤ (exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)
Proof (Lean source)
lemma denseLikelihoodTail_le_geometric (n d : ℕ) (hregime : DenseRegime n d) : denseLikelihoodTail n d ≤ (exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64) := by rw [denseLikelihoodTail_eq_exponentialSeriesTail, poissonCellIntensity_mul_denseAmplitude_sq n d hregime] unfold Causalean.Stat.Minimax.MomentMatchedMixture.exponentialSeriesTail let q : ℝ := exp 1 / 64 have hq0 : 0 ≤ q := by positivity have hq1 : q < 1 := by dsimp [q] linarith [Real.exp_one_lt_three] have hterm : ∀ r : ℕ, lowerDegree d < r → ((lowerDegree d : ℝ) / 64) ^ r / (r.factorial : ℝ) ≤ q ^ r := by intro r hr have hrpos : 0 < r := lt_of_le_of_lt (zero_le _) hr have hKr : (lowerDegree d : ℝ) ≤ r := by exact_mod_cast (le_of_lt hr) have hsqrt : 1 ≤ sqrt (2 * pi * r) := by have hpi : 3 < pi := Real.pi_gt_three have harg : (1 : ℝ) ≤ 2 * pi * r := by calc (1 : ℝ) ≤ 2 * 3 * 1 := by norm_num _ ≤ 2 * pi * r := by gcongr exact_mod_cast hrpos exact (Real.le_sqrt (by norm_num) (by positivity)).2 (by simpa using harg) have hfac := Stirling.le_factorial_stirling r have hbase : 0 ≤ (r : ℝ) / exp 1 := by positivity have hpow : ((lowerDegree d : ℝ) / exp 1) ^ r ≤ ((r : ℝ) / exp 1) ^ r := by gcongr have hfac' : ((lowerDegree d : ℝ) / exp 1) ^ r ≤ (r.factorial : ℝ) := by calc _ ≤ ((r : ℝ) / exp 1) ^ r := hpow _ ≤ sqrt (2 * pi * r) * ((r : ℝ) / exp 1) ^ r := by exact le_mul_of_one_le_left (pow_nonneg hbase r) hsqrt _ ≤ (r.factorial : ℝ) := hfac have hfacpos : (0 : ℝ) < r.factorial := by positivity rw [div_le_iff₀ hfacpos] have hepos : 0 < exp 1 := Real.exp_pos 1 rw [show (lowerDegree d : ℝ) / 64 = q * ((lowerDegree d : ℝ) / exp 1) by dsimp [q] field_simp] rw [mul_pow] exact mul_le_mul_of_nonneg_left hfac' (pow_nonneg hq0 r) have hg : Summable (fun r : ℕ => q ^ r) := summable_geometric_of_norm_lt_one (by simpa [Real.norm_eq_abs, abs_of_nonneg hq0]) have hgTail : Summable (fun r : ℕ => if lowerDegree d < r then q ^ r else 0) := Summable.of_nonneg_of_le (f := fun r : ℕ => q ^ r) (fun r => by positivity) (fun r => by by_cases hr : lowerDegree d < r · simp [hr] · simp [hr, pow_nonneg hq0]) hg have hleft : Summable (fun r : ℕ => if lowerDegree d < r then ((lowerDegree d : ℝ) / 64) ^ r / (r.factorial : ℝ) else 0) := by exact Summable.of_nonneg_of_le (f := fun r : ℕ => if lowerDegree d < r then q ^ r else 0) (g := fun r : ℕ => if lowerDegree d < r then ((lowerDegree d : ℝ) / 64) ^ r / (r.factorial : ℝ) else 0) (fun r => by positivity) (fun r => by by_cases hr : lowerDegree d < r · simp only [hr, if_true] exact hterm r hr · simp [hr]) hgTail calc (∑' r : ℕ, if lowerDegree d < r then ((lowerDegree d : ℝ) / 64) ^ r / (r.factorial : ℝ) else 0) ≤ ∑' r : ℕ, if lowerDegree d < r then q ^ r else 0 := by apply hleft.tsum_le_tsum · intro r by_cases hr : lowerDegree d < r · simp only [hr, if_true] exact hterm r hr · simp [hr] · exact hgTail _ = q ^ (lowerDegree d + 1) / (1 - q) := by let f : ℕ → ℝ := fun r => if lowerDegree d < r then q ^ r else 0 have hsplit := hgTail.sum_add_tsum_nat_add (lowerDegree d + 1) have hzero : ∑ r ∈ range (lowerDegree d + 1), f r = 0 := by apply Finset.sum_eq_zero intro r hr simp only [f] rw [if_neg] have hr' := Finset.mem_range.1 hr omega have hshift : (∑' r : ℕ, f (r + (lowerDegree d + 1))) = q ^ (lowerDegree d + 1) * (1 - q)⁻¹ := by simp only [f, show ∀ r : ℕ, lowerDegree d < r + (lowerDegree d + 1) by omega, if_true, pow_add] rw [tsum_mul_right, tsum_geometric_of_norm_lt_one] · ring · simpa [Real.norm_eq_abs, abs_of_nonneg hq0] change (∑' r : ℕ, f r) = _ rw [← hsplit, hzero, zero_add, hshift] rw [div_eq_mul_inv] _ = _ := rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseLikelihoodTail_le_geometric · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseNumerics.lean:15
theorem eventually_denseGeometric_tv_le Lemma eventually_denseGeometric_tv_le in the paper ↗

The geometric likelihood-tail envelope is uniformly small after a universal alphabet cutoff. The displayed identity or bound is the asserted conclusion.

Formal statement
∃ D0 : ℕ,
∀ d : ℕ,
D0
≤ d → (d : ℝ) * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ≤ 1 / 16
Proof (Lean source)
lemma eventually_denseGeometric_tv_le : ∃ D0 : ℕ, ∀ d : ℕ, D0 ≤ d → (d : ℝ) * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ≤ 1 / 16 := by refine ⟨2, ?_⟩ intro d hd let q : ℝ := exp 1 / 64 have hdNat : 2 ≤ d := hd have hdR : (2 : ℝ) ≤ d := by exact_mod_cast hdNat have hed : 0 < exp 1 * (d : ℝ) := mul_pos (Real.exp_pos 1) (by positivity) have hq0 : 0 ≤ q := by positivity have hqexp : q ≤ exp (-2) := by rw [show exp (-2) = (exp 1)⁻¹ ^ 2 by calc exp (-2) = exp (-1 + -1) := by norm_num _ = exp (-1) * exp (-1) := Real.exp_add _ _ _ = (exp 1)⁻¹ ^ 2 := by rw [Real.exp_neg]; ring] have he : exp 1 < 3 := Real.exp_one_lt_three have hepos : 0 < exp 1 := Real.exp_pos 1 rw [inv_pow, inv_eq_one_div] apply (le_div_iff₀ (by positivity : 0 < (exp 1) ^ 2)).2 dsimp [q] field_simp nlinarith [sq_pos_of_pos hepos] have hK : (8 * logAlphabet d : ℝ) ≤ lowerDegree d := (lowerDegree_log_bounds d).1 have hlogpos : 0 < logAlphabet d := by unfold logAlphabet have hegt : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) exact Real.log_pos (by nlinarith [Real.exp_pos 1]) have hpow : q ^ (lowerDegree d + 1) ≤ exp (-2) ^ (lowerDegree d + 1) := by gcongr have hexpK : exp (-2) ^ (lowerDegree d + 1) ≤ exp (-16 * logAlphabet d) := by rw [← Real.exp_nat_mul] apply Real.exp_le_exp.mpr push_cast nlinarith have hrewrite : exp (-16 * logAlphabet d) = (exp 1 * (d : ℝ))⁻¹ ^ 16 := by rw [show -16 * logAlphabet d = (16 : ℕ) * (-logAlphabet d) by norm_num] rw [Real.exp_nat_mul, Real.exp_neg, logAlphabet, Real.exp_log hed] have hsmall : (exp 1 * (d : ℝ))⁻¹ ^ 16 ≤ 1 / (512 * (d : ℝ) ^ 2) := by have he1 : 1 ≤ exp 1 := Real.one_le_exp (by norm_num) have hbase : 2 ≤ exp 1 * (d : ℝ) := by nlinarith [Real.exp_pos 1] have hpos : 0 < exp 1 * (d : ℝ) := hed rw [inv_pow] rw [inv_eq_one_div] have hd2 : (0 : ℝ) ≤ d := by positivity have hbasepow : (2 : ℝ) ^ 10 ≤ (exp 1 * (d : ℝ)) ^ 10 := by gcongr have hdPow : (d : ℝ) ^ 2 ≤ (exp 1 * (d : ℝ)) ^ 2 := by have hde : (d : ℝ) ≤ exp 1 * d := by simpa only [one_mul] using mul_le_mul_of_nonneg_right he1 hd2 exact pow_le_pow_left₀ hd2 hde 2 apply one_div_le_one_div_of_le (by positivity : 0 < 512 * (d : ℝ) ^ 2) calc 512 * (d : ℝ) ^ 2 ≤ 2 ^ 10 * (d : ℝ) ^ 2 := by nlinarith [sq_nonneg (d : ℝ)] _ ≤ (exp 1 * (d : ℝ)) ^ 10 * (exp 1 * (d : ℝ)) ^ 2 := by gcongr _ ≤ (exp 1 * (d : ℝ)) ^ 16 := by rw [← pow_add] exact pow_le_pow_right₀ (by linarith [hbase]) (by norm_num : 12 ≤ 16) have hqpow : q ^ (lowerDegree d + 1) ≤ 1 / (512 * (d : ℝ) ^ 2) := by calc _ ≤ exp (-2) ^ (lowerDegree d + 1) := hpow _ ≤ exp (-16 * logAlphabet d) := hexpK _ = (exp 1 * (d : ℝ))⁻¹ ^ 16 := hrewrite _ ≤ _ := hsmall have hden : (1 / 2 : ℝ) ≤ 1 - q := by dsimp [q] nlinarith [Real.exp_one_lt_three] have hfrac : q ^ (lowerDegree d + 1) / (1 - q) ≤ 1 / (256 * (d : ℝ) ^ 2) := by apply (div_le_iff₀ (by linarith : 0 < 1 - q)).2 calc q ^ (lowerDegree d + 1) ≤ 1 / (512 * (d : ℝ) ^ 2) := hqpow _ ≤ 1 / (256 * (d : ℝ) ^ 2) * (1 - q) := by have hdpos : (0 : ℝ) < d := by positivity apply (div_le_iff₀ (by positivity : 0 < 512 * (d : ℝ) ^ 2)).2 field_simp nlinarith have hsqrt : sqrt (q ^ (lowerDegree d + 1) / (1 - q)) ≤ 1 / (16 * d) := by rw [← Real.sqrt_sq (by positivity : 0 ≤ 1 / (16 * (d : ℝ)))] apply Real.sqrt_le_sqrt convert hfrac using 1 <;> field_simp <;> ring dsimp [q] at hsqrt ⊢ have hdpos : (0 : ℝ) < d := by positivity calc (d : ℝ) * sqrt ((exp 1 / 64) ^ (lowerDegree d + 1) / (1 - exp 1 / 64)) ≤ d * (1 / (16 * d)) := by gcongr _ = 1 / 16 := by field_simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.eventually_denseGeometric_tv_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseNumerics.lean:120
theorem eventually_densePoissonTail_absorbed

In the dense regime the mean-2n Poisson lower tail is eventually absorbed by any fixed positive multiple of the target dense rate. This uses the stated c condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
c :
hc :
0 < c
∃ D0 : ℕ,
∀ d n : ℕ,
D0
≤ d → d ^ 2 < n → (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal ≤ c * d / (n * logAlphabet d)
Proof (Lean source)
lemma eventually_densePoissonTail_absorbed (c : ℝ) (hc : 0 < c) : ∃ D0 : ℕ, ∀ d n : ℕ, D0 ≤ d → d ^ 2 < n → (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toReal ≤ c * d / (n * logAlphabet d) := by have hlogLittle : (fun x : ℝ => log x) =o[atTop] (fun x => x) := Real.isLittleO_log_id_atTop have hlogBound : ∀ᶠ x : ℝ in atTop, log x ≤ (c / 3) * x := by have hb := hlogLittle.bound (div_pos hc (by norm_num : (0 : ℝ) < 3)) filter_upwards [hb, eventually_ge_atTop (1 : ℝ)] with x hx hx1 have hlog0 : 0 ≤ log x := Real.log_nonneg hx1 simpa only [Real.norm_eq_abs, abs_of_nonneg hlog0, abs_of_nonneg (by positivity : 0 ≤ x)] using hx have ht : Tendsto (fun d : ℕ => exp 1 * (d : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop.const_mul_atTop (Real.exp_pos 1) have hlogNat : ∀ᶠ d : ℕ in atTop, logAlphabet d ≤ c * d := by filter_upwards [hlogBound.filter_mono ht] with d hd unfold logAlphabet have he : exp 1 < 3 := Real.exp_one_lt_three have hd0 : (0 : ℝ) ≤ d := by positivity calc log (exp 1 * (d : ℝ)) ≤ (c / 3) * (exp 1 * d) := hd _ ≤ c * d := by have := mul_le_mul_of_nonneg_right he.le hd0 nlinarith rw [eventually_atTop] at hlogNat obtain ⟨Dlog, hDlog⟩ := hlogNat refine ⟨max 20 Dlog, ?_⟩ intro d n hd hn have hd20 : 20 ≤ d := le_trans (Nat.le_max_left _ _) hd have hdlog : Dlog ≤ d := le_trans (Nat.le_max_right _ _) hd have hdSq : 20 ^ 2 ≤ d ^ 2 := by simpa only [pow_two] using Nat.mul_le_mul hd20 hd20 have hn400 : 400 ≤ n := by omega have hdpos : (0 : ℝ) < d := by positivity have hnpos : (0 : ℝ) < n := by positivity have hLpos : 0 < logAlphabet d := by unfold logAlphabet have hegt : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) exact Real.log_pos (by have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast (by omega : 1 ≤ d) nlinarith [Real.exp_pos 1]) have htail := Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.poisson_two_n_lower_tail n have hparam : toNNReal (2 * (n : ℝ)) = 2 * (n : NNReal) := by apply NNReal.eq simp [Real.coe_toNNReal (2 * (n : ℝ)) (by positivity)] have htailReal : (poissonMeasure (toNNReal (2 * n)) {k | k < n}).toRealexp (-(n : ℝ) * (1 - log 2)) := by rw [hparam] calc (poissonMeasure (2 * (n : NNReal)) {k | k < n}).toReal ≤ (ofReal (exp (-(n : ℝ) * (1 - log 2)))).toReal := ENNReal.toReal_mono (by simp) htail _ = exp (-(n : ℝ) * (1 - log 2)) := ENNReal.toReal_ofReal (Real.exp_nonneg _) have hsqrt0 : 0 ≤ sqrt (n : ℝ) := Real.sqrt_nonneg _ have hsqrt_sq : sqrt (n : ℝ) ^ 2 = (n : ℝ) := Real.sq_sqrt hnpos.le have hsqrt20 : 20 ≤ sqrt (n : ℝ) := by rw [← Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 20)] exact Real.sqrt_le_sqrt (by exact_mod_cast hn400) have hlogn : log (n : ℝ) ≤ 2 * sqrt (n : ℝ) := by calc log (n : ℝ) ≤ (n : ℝ) ^ (1 / 2 : ℝ) / (1 / 2 : ℝ) := Real.log_le_rpow_div hnpos.le (by norm_num) _ = 2 * sqrt (n : ℝ) := by rw [← Real.sqrt_eq_rpow] ring have halpha : (3 / 10 : ℝ) < 1 - log 2 := by nlinarith [Real.log_two_lt_d9] have hbudget : 2 * log (n : ℝ) ≤ (n : ℝ) * (1 - log 2) := by nlinarith have hexp : exp (-(n : ℝ) * (1 - log 2)) ≤ (n : ℝ)⁻¹ ^ 2 := by calc exp (-(n : ℝ) * (1 - log 2)) ≤ exp (-2 * log (n : ℝ)) := by apply Real.exp_le_exp.mpr linarith _ = (n : ℝ)⁻¹ ^ 2 := by rw [show -2 * log (n : ℝ) = -(log (n : ℝ)) + -(log (n : ℝ)) by ring, Real.exp_add, Real.exp_neg, Real.exp_log hnpos] ring have hinvRate : (n : ℝ)⁻¹ ^ 2 ≤ c * d / (n * logAlphabet d) := by rw [inv_pow, inv_eq_one_div] have hLn : logAlphabet d ≤ c * d * n := by calc logAlphabet d ≤ c * d := hDlog d hdlog _ ≤ c * d * n := by have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (by omega : 1 ≤ n) nlinarith [mul_pos hc hdpos] rw [div_le_div_iff₀ (sq_pos_of_pos hnpos) (mul_pos hnpos hLpos)] nlinarith [mul_pos hc hdpos] exact htailReal.trans (hexp.trans hinvRate)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.eventually_densePoissonTail_absorbed · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseNumerics.lean:222
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseObservationRegrouping 7 declarations Measure-theoretic tools for regrouping the dense Poisson observation experiment.

Measure-theoretic tools for regrouping the dense Poisson observation experiment.

theorem densePoissonSampleLaw_reconstruct

The baseline conditional law given the dense sign statistic reconstructs every member of the dense Poisson family from its sign-count pushforward. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
Nonempty (DensePoissonSample d)
theta :
Proof (Lean source)
lemma densePoissonSampleLaw_reconstruct {n d : ℕ} [Nonempty (DensePoissonSample d)] (theta : DenseContrast d) : condDistrib id denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1)))) (toNNReal (2 * n))) ∘ₘ Measure.map denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n))) = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) := by let Q0 := finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1)))) (toNNReal (2 * n)) let g : (Fin d → DenseSignCounts) → ENNReal := fun r ↦ ∏ x, ofReal (oneCellLikelihood 0 (theta.1 x) (r x)) have hg : Measurable g := measurable_of_countable _ have hfactor : denseSampleLikelihoodENN theta = g ∘ denseSignStatistic := by funext s rw [denseSampleLikelihoodENN_factors] rfl have hQ : finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) = Q0.withDensity (g ∘ denseSignStatistic) := by rw [densePoissonSampleLaw_eq_withDensity, hfactor] letI : IsProbabilityMeasure (Q0.withDensity (g ∘ denseSignStatistic)) := by rw [← hQ] infer_instance rw [hQ] exact condDistrib_reconstruct_withDensity_factor Q0 denseSignStatistic measurable_denseSignStatistic g hg
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePoissonSampleLaw_reconstruct · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:10
theorem denseSupportedSignKernel_apply_of_abs_le

On the Cai--Low support, the totalized supported sign kernel is the scaled one-cell Poisson sign law. This uses the sample size and alphabet lie in the dense regime, and the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
t :
ht :
|t| ≤ 1
Proof (Lean source)
lemma denseSupportedSignKernel_apply_of_abs_le {n d : ℕ} (hregime : DenseRegime n d) (t : ℝ) (ht : |t| ≤ 1) : denseSupportedSignKernel n d t = denseSignLaw (poissonCellIntensity n d) (denseAmplitude n d * t) := by let Q : Measure DenseSignCounts := denseSignBaseline (poissonCellIntensity n d) have hf : Measurable (uncurry fun t r ↦ if |t| ≤ 1 then ofReal (scaledDenseLikelihood n d t r) else 1) := by exact (measurable_scaledDenseLikelihood n d).ennreal_ofReal.ite (measurableSet_le (continuous_abs.measurable.comp measurable_fst) measurable_const) measurable_const dsimp [denseSupportedSignKernel] rw [Kernel.withDensity_apply (Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))) hf t] simp only [ht, ↓reduceIte] exact (scaledDenseSignLaw_eq_withDensity n d hregime t ht).symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSupportedSignKernel_apply_of_abs_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:47
theorem denseSupportedSignKernel_isProbability

The supported sign kernel is probability-valued both on and off the Cai--Low support. This uses the sample size and alphabet lie in the dense regime. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
hregime :
t :
Proof (Lean source)
lemma denseSupportedSignKernel_isProbability {n d : ℕ} (hregime : DenseRegime n d) (t : ℝ) : IsProbabilityMeasure (denseSupportedSignKernel n d t) := by letI : IsProbabilityMeasure (denseSignBaseline (poissonCellIntensity n d)) := by unfold denseSignBaseline infer_instance rw [isProbabilityMeasure_iff] by_cases ht : |t| ≤ 1 · rw [denseSupportedSignKernel_apply_of_abs_le hregime t ht] simp [denseSignLaw] · have hf : Measurable (uncurry fun t r ↦ if |t| ≤ 1 then ofReal (scaledDenseLikelihood n d t r) else 1) := by exact (measurable_scaledDenseLikelihood n d).ennreal_ofReal.ite (measurableSet_le (continuous_abs.measurable.comp measurable_fst) measurable_const) measurable_const dsimp [denseSupportedSignKernel] rw [Kernel.withDensity_apply (Kernel.const ℝ (denseSignBaseline (poissonCellIntensity n d))) hf t] simp [ht]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSupportedSignKernel_isProbability · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:66
theorem map_denseObservationMixture_eq_productPriorPredictive

Pushing the genuine dense observation mixture through its sufficient sign statistic gives exactly the supported product prior-predictive law. This uses the sample size and alphabet lie in the dense regime, and the dense construction domain conditions hold, and the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hdom :
hsupp :
nu (Icc (-1) 1)ᶜ = 0
Proof (Lean source)
lemma map_denseObservationMixture_eq_productPriorPredictive {n d : ℕ} {epsilon : ℝ} (hregime : DenseRegime n d) (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : Measure.map denseSignStatistic (denseObservationMixture n d hdom.1 epsilon hdom nu) = productPriorPredictive d nu (denseSupportedSignKernel n d) := by classical have hK : ∀ t, IsProbabilityMeasure (denseSupportedSignKernel n d t) := denseSupportedSignKernel_isProbability hregime letI (_x : Fin d) : IsProbabilityMeasure (priorPredictive nu (denseSupportedSignKernel n d)) := priorPredictive_isProbability nu (denseSupportedSignKernel n d) hK apply Measure.ext_of_singleton intro r rw [Measure.map_apply measurable_denseSignStatistic (measurableSet_singleton r)] rw [denseObservationMixture, Measure.bind_apply (measurable_denseSignStatistic (measurableSet_singleton r)) (denseObservationKernel n d hdom.1).aemeasurable] have hkernel (theta : DenseContrast d) : denseObservationKernel n d hdom.1 theta (denseSignStatistic ⁻¹' {r}) = (Measure.pi fun x : Fin d ↦ denseSignLaw (poissonCellIntensity n d) (theta.1 x)) {r} := by rw [show denseObservationKernel n d hdom.1 theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) by exact Classical.choose_spec (denseObservationKernel_exists n d hdom.1) theta] have hm := congrArg (fun mu : Measure (Fin d → DenseSignCounts) ↦ mu {r}) (map_denseSignStatistic_denseLaw (n := n) theta) rw [Measure.map_apply measurable_denseSignStatistic (measurableSet_singleton r)] at hm exact hm simp_rw [hkernel] unfold productPriorPredictive rw [Measure.pi_singleton] simp_rw [priorPredictive_apply _ _ (measurableSet_singleton (r _))] let mu : Measure (Fin d → ℝ) := Measure.pi (fun _ : Fin d ↦ nu) have hmem : ∀ᵐ t ∂mu, ∀ j, t j ∈ Icc (-1 : ℝ) 1 := by have hj : ∀ j : Fin d, ∀ᵐ t ∂mu, t j ∈ Icc (-1 : ℝ) 1 := by intro j have hs : ∀ᵐ x ∂nu, x ∈ Icc (-1 : ℝ) 1 := mem_ae_iff.mpr hsupp exact (MeasureTheory.measurePreserving_eval (fun _ : Fin d ↦ nu) j).quasiMeasurePreserving.ae hs exact ae_all_iff.mpr hj have hrestrict : mu.restrict {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} = mu := Measure.restrict_eq_self_of_ae_mem hmem letI (a : DenseContrast d) (x : Fin d) : IsProbabilityMeasure (denseSignLaw (poissonCellIntensity n d) (a.1 x)) := by unfold denseSignLaw infer_instance have hsingle (x : Fin d) : Measurable (fun a : DenseContrast d ↦ denseSignLaw (poissonCellIntensity n d) (a.1 x) {r x}) := by have heq (a : DenseContrast d) : denseSignLaw (poissonCellIntensity n d) (a.1 x) {r x} = denseSignBaseline (poissonCellIntensity n d) {r x} * ofReal (oneCellLikelihood (poissonCellIntensity n d) (a.1 x) (r x)) := by rw [denseSignLaw_eq_withDensity] · rw [withDensity_apply _ (measurableSet_singleton (r x)), lintegral_singleton] ring · unfold poissonCellIntensity positivity · rw [abs_le] constructor <;> linarith [(a.2.2 x).1, (a.2.2 x).2] simp_rw [heq] have hcoord : Measurable (fun a : DenseContrast d ↦ a.1 x) := (measurable_pi_apply x).comp measurable_subtype_coe exact measurable_const.mul (ENNReal.measurable_ofReal.comp (((measurable_const.add hcoord).pow_const (r x).1).mul ((measurable_const.sub hcoord).pow_const (r x).2))) have hmeas : Measurable (fun a : DenseContrast d ↦ (Measure.pi fun x ↦ denseSignLaw (poissonCellIntensity n d) (a.1 x)) {r}) := by simp_rw [Measure.pi_singleton] exact Finset.univ.measurable_prod fun x _ ↦ hsingle x rw [denseScaledProductPrior, show (Measure.pi (fun _ : Fin d ↦ nu)).restrict {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} = mu by exact hrestrict] rw [lintegral_map] · simp_rw [Measure.pi_singleton] calc (∫⁻ a : Fin d → ℝ, ∏ i, denseSignLaw (poissonCellIntensity n d) ((if ht : ∀ j, a j ∈ Icc (-1 : ℝ) 1 then (⟨fun j ↦ denseAmplitude n d * a j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (ht j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (ht j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ : DenseContrast d) else ⟨fun _ ↦ 0, hdom.1, by intro; norm_num⟩).1 i) {r i} ∂mu) = ∫⁻ a : Fin d → ℝ, ∏ i, denseSupportedSignKernel n d (a i) {r i} ∂mu := by apply lintegral_congr_ae filter_upwards [hmem] with t ht simp only [dif_pos ht] apply Finset.prod_congr rfl intro x _hx rw [← denseSupportedSignKernel_apply_of_abs_le hregime (t x)] simpa [abs_le] using ht x _ = ∏ x, ∫⁻ theta : ℝ, denseSupportedSignKernel n d theta {r x} ∂nu := by let X : Fin d → (Fin d → ℝ) → ENNReal := fun x t ↦ denseSupportedSignKernel n d (t x) {r x} have hXm (x : Fin d) : Measurable (X x) := ((denseSupportedSignKernel n d).measurable_coe (measurableSet_singleton (r x))).comp (measurable_pi_apply x) have hXi : iIndepFun X mu := by simpa [X, mu] using (iIndepFun_pi (X := fun x (t : ℝ) ↦ denseSupportedSignKernel n d t {r x}) (fun x ↦ ((denseSupportedSignKernel n d).measurable_coe (measurableSet_singleton (r x))).aemeasurable)) rw [show (∫⁻ a : Fin d → ℝ, ∏ i, denseSupportedSignKernel n d (a i) {r i} ∂mu) = ∏ x, ∫⁻ a : Fin d → ℝ, denseSupportedSignKernel n d (a x) {r x} ∂mu by simpa [X] using (lintegral_prod_eq_prod_lintegral_of_indepFun univ X hXi hXm)] apply Finset.prod_congr rfl intro x _hx exact (measurePreserving_eval (fun _ : Fin d ↦ nu) x).lintegral_comp ((denseSupportedSignKernel n d).measurable_coe (measurableSet_singleton (r x))) · exact hmeas · let S : Set (Fin d → ℝ) := {t | ∀ j, t j ∈ Icc (-1 : ℝ) 1} have htrue : Measurable (fun t : S ↦ (⟨fun j ↦ denseAmplitude n d * t.1 j, hdom.1, by intro j have ha0 : 0 ≤ denseAmplitude n d := le_of_lt hdom.2.2.2.1 have hjlo := mul_le_mul_of_nonneg_left (t.2 j).1 ha0 have hjhi := mul_le_mul_of_nonneg_left (t.2 j).2 ha0 constructor <;> nlinarith [hdom.2.2.2.2]⟩ : DenseContrast d)) := by apply Measurable.subtype_mk apply measurable_pi_lambda intro j exact measurable_const.mul ((measurable_pi_apply j).comp measurable_subtype_coe) have hS : MeasurableSet S := by dsimp [S] convert MeasurableSet.iInter (fun j : Fin d ↦ (measurableSet_Icc : MeasurableSet (Icc (-1 : ℝ) 1)).preimage (measurable_pi_apply j)) using 1 <;> ext t <;> simp exact htrue.dite measurable_const hS
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_denseObservationMixture_eq_productPriorPredictive · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:89
theorem denseObservationMixture_reconstruct_from_product

The same baseline conditional kernel reconstructs the full observation mixture from the supported product sign-count predictive law. This uses the sample size and alphabet lie in the dense regime, and the dense construction domain conditions hold, and the prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hdom :
Nonempty (DensePoissonSample d)
hsupp :
nu (Icc (-1) 1)ᶜ = 0
= denseObservationMixture n d hdom.1 epsilon hdom nu
Proof (Lean source)
lemma denseObservationMixture_reconstruct_from_product {n d : ℕ} {epsilon : ℝ} (hregime : DenseRegime n d) (hdom : DenseConstructionDomain n d epsilon) (nu : Measure ℝ) [IsProbabilityMeasure nu] [Nonempty (DensePoissonSample d)] (hsupp : nu (Icc (-1) 1)ᶜ = 0) : let Krec := ProbabilityTheory.condDistrib id denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hdom.1)))) (toNNReal (2 * n))) Krec ∘ₘ productPriorPredictive d nu (denseSupportedSignKernel n d) = denseObservationMixture n d hdom.1 epsilon hdom nu := by let prior := denseScaledProductPrior n d epsilon hdom nu let Kobs := denseObservationKernel n d hdom.1 let Kstat := Kobs.map denseSignStatistic let Q0 := finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hdom.1)))) (toNNReal (2 * n)) let Krec := ProbabilityTheory.condDistrib id denseSignStatistic Q0 have hstatKernel : Kernel.deterministic denseSignStatistic measurable_denseSignStatistic ∘ₖ Kobs = Kstat := by ext theta rw [Kernel.comp_apply, Measure.deterministic_comp_eq_map, Kernel.map_apply _ measurable_denseSignStatistic] have hreconstruct : Krec ∘ₖ Kstat = Kobs := by ext theta s rw [Kernel.comp_apply, Kernel.map_apply _ measurable_denseSignStatistic] have hKobs : Kobs theta = finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) := Classical.choose_spec (denseObservationKernel_exists n d hdom.1) theta exact congrArg (fun mu : Measure (DensePoissonSample d) ↦ mu s) (by rw [hKobs] simpa [Krec, Q0] using (densePoissonSampleLaw_reconstruct (n := n) theta)) have hmapMixture : Measure.map denseSignStatistic (Kobs ∘ₘ prior) = Kstat ∘ₘ prior := by calc Measure.map denseSignStatistic (Kobs ∘ₘ prior) = Kernel.deterministic denseSignStatistic measurable_denseSignStatistic ∘ₘ (Kobs ∘ₘ prior) := by rw [Measure.deterministic_comp_eq_map] _ = (Kernel.deterministic denseSignStatistic measurable_denseSignStatistic ∘ₖ Kobs) ∘ₘ prior := Measure.comp_assoc _ = Kstat ∘ₘ prior := by rw [hstatKernel] rw [← map_denseObservationMixture_eq_productPriorPredictive hregime hdom nu hsupp] change Krec ∘ₘ Measure.map denseSignStatistic (Kobs ∘ₘ prior) = Kobs ∘ₘ prior rw [hmapMixture, Measure.comp_assoc, hreconstruct]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationMixture_reconstruct_from_product · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:239
theorem tvDist_bind_le_denseRegrouping Lemma tvDist_bind_le_denseRegrouping in the paper ↗

Passing two probability laws through the same Markov kernel cannot increase their total-variation distance. The displayed identity or bound is the asserted conclusion.

Formal statement
tvDist (K ∘ₘ mu) (K ∘ₘ nu) ≤ tvDist mu nu
Proof (Lean source)
lemma tvDist_bind_le_denseRegrouping {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (mu nu : Measure X) [IsProbabilityMeasure mu] [IsProbabilityMeasure nu] (K : Kernel X Y) [IsMarkovKernel K] : tvDist (K ∘ₘ mu) (K ∘ₘ nu) ≤ tvDist mu nu := by unfold tvDist apply ciSup_le rintro ⟨A, hA⟩ rw [Measure.real, Measure.real, Measure.bind_apply hA K.aemeasurable, Measure.bind_apply hA K.aemeasurable] have hmeas : Measurable (fun x => (K x A).toReal) := (K.measurable_coe hA).ennreal_toReal have hrange : ∀ x, (K x A).toRealIcc (0 : ℝ) (0 + 1) := by intro x letI : IsProbabilityMeasure (K x) := inferInstance exact ⟨ENNReal.toReal_nonneg, by simpa only [Measure.real, zero_add] using (measureReal_le_one : (K x).real A ≤ 1)⟩ have hfinite : ∀ x, K x A < ⊤ := by intro x letI : IsProbabilityMeasure (K x) := inferInstance exact measure_lt_top _ _ rw [← integral_toReal (K.measurable_coe hA).aemeasurable (Filter.Eventually.of_forall hfinite), ← integral_toReal (K.measurable_coe hA).aemeasurable (Filter.Eventually.of_forall hfinite)] change |∫ x, (K x A).toReal ∂mu - ∫ x, (K x A).toReal ∂nu| ≤ tvDist mu nu simpa only [zero_add, mul_one] using (tvDist_integral_range mu nu (fun x => (K x A).toReal) hmeas 0 1 zero_le_one hrange)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.tvDist_bind_le_denseRegrouping · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:294
theorem denseObservationMixtures_tv_le_product

Dense full-observation prior mixtures are no farther apart than their product sign-count prior predictives. This uses the sample size and alphabet lie in the dense regime, and the dense construction domain conditions hold, and the first prior is supported on the unit interval, and the second prior is supported on the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hdom :
hsupp0 :
nu0 (Icc (-1) 1)ᶜ = 0
hsupp1 :
nu1 (Icc (-1) 1)ᶜ = 0
Proof (Lean source)
lemma denseObservationMixtures_tv_le_product {n d : ℕ} {epsilon : ℝ} (hregime : DenseRegime n d) (hdom : DenseConstructionDomain n d epsilon) (nu0 nu1 : Measure ℝ) [IsProbabilityMeasure nu0] [IsProbabilityMeasure nu1] (hsupp0 : nu0 (Icc (-1) 1)ᶜ = 0) (hsupp1 : nu1 (Icc (-1) 1)ᶜ = 0) : tvDist (denseObservationMixture n d hdom.1 epsilon hdom nu0) (denseObservationMixture n d hdom.1 epsilon hdom nu1) ≤ tvDist (productPriorPredictive d nu0 (denseSupportedSignKernel n d)) (productPriorPredictive d nu1 (denseSupportedSignKernel n d)) := by letI : Nonempty (DensePoissonSample d) := ⟨⟨0, fun i ↦ elim0 i⟩⟩ let Krec := condDistrib id denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hdom.1)))) (toNNReal (2 * n))) let pred0 := productPriorPredictive d nu0 (denseSupportedSignKernel n d) let pred1 := productPriorPredictive d nu1 (denseSupportedSignKernel n d) have hK : ∀ t, IsProbabilityMeasure (denseSupportedSignKernel n d t) := denseSupportedSignKernel_isProbability hregime letI : IsProbabilityMeasure pred0 := productPriorPredictive_isProbability d nu0 (denseSupportedSignKernel n d) hK letI : IsProbabilityMeasure pred1 := productPriorPredictive_isProbability d nu1 (denseSupportedSignKernel n d) hK have hrec0 : Krec ∘ₘ pred0 = denseObservationMixture n d hdom.1 epsilon hdom nu0 := by simpa [Krec, pred0] using denseObservationMixture_reconstruct_from_product hregime hdom nu0 hsupp0 have hrec1 : Krec ∘ₘ pred1 = denseObservationMixture n d hdom.1 epsilon hdom nu1 := by simpa [Krec, pred1] using denseObservationMixture_reconstruct_from_product hregime hdom nu1 hsupp1 rw [← hrec0, ← hrec1] exact tvDist_bind_le_denseRegrouping pred0 pred1 Krec
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservationMixtures_tv_le_product · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationRegrouping.lean:330
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseObservationStatisticLaw 9 declarations

For the specified data point or sample, the dense sign cell records the alphabet cell and whether treatment and outcome agree.

Definition (Lean source)
d :
z :
Obs d
denseSignCell z :
Fin d × Fin 2
(z.1, if z.2.1 = z.2.2 then 0 else 1)
theorem measurable_denseSignCell

the stated measurable dense sign cell relation holds.

Formal statement
d :
Measurable (denseSignCell : Obs d → Fin d × Fin 2)
Proof (Lean source)
@[fun_prop] lemma measurable_denseSignCell {d : ℕ} : Measurable (denseSignCell : Obs d → Fin d × Fin 2) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_denseSignCell · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:15
theorem denseSignCell_mass_zero

If the alphabet size satisfies its stated restriction, then under the zero contrast, every dense sign cell has mass 1/(2d)1/(2d).

Formal statement
d :
hd :
2 ≤ d
x :
Fin d
j :
Fin 2
obsLaw (observedMarginal (denseLaw (denseZeroContrast d hd))) (denseSignCell ⁻¹' {(x,j)})
= ofReal (1 / (2 * d : ℝ))
Proof (Lean source)
lemma denseSignCell_mass_zero {d : ℕ} (hd : 2 ≤ d) (x : Fin d) (j : Fin 2) : obsLaw (observedMarginal (denseLaw (denseZeroContrast d hd))) (denseSignCell ⁻¹' {(x,j)}) = ofReal (1 / (2 * d : ℝ)) := by rw [← Measure.map_apply measurable_denseSignCell (MeasurableSet.singleton (x,j))] apply (ENNReal.toReal_eq_toReal_iff' (measure_ne_top _ _) ENNReal.ofReal_ne_top).mp rw [ENNReal.toReal_ofReal (by positivity)] rw [obsLaw, PMF.toMeasure_map _ (f := denseSignCell) measurable_denseSignCell, PMF.toMeasure_apply_singleton] rw [PMF.map_apply, tsum_fintype] rw [ENNReal.toReal_sum (fun z _hz ↦ by split_ifs · exact PMF.apply_ne_top _ _ · exact ENNReal.zero_ne_top)] have hatom (z : Obs d) : ((observedMarginal (denseLaw (denseZeroContrast d hd))).pmf z).toReal = 1 / (4 * d : ℝ) := by rw [show ((observedMarginal (denseLaw (denseZeroContrast d hd))).pmf z).toReal = jointMass (observedMarginal (denseLaw (denseZeroContrast d hd))) z.1 z.2.1 z.2.2 by rfl, denseObservedAtomMass] simp [denseZeroContrast] have hite (p : Prop) [Decidable p] (a : ENNReal) : (if p then a else 0).toReal = if p then a.toReal else 0 := by split_ifs <;> simp_all simp_rw [hite, hatom] have hd0 : (d : ℝ) ≠ 0 := by positivity have harith : (d : ℝ) * ((d : ℝ)⁻¹ * 4⁻¹ * 2) * 2 = 1 := by field_simp [hd0] norm_num have hsum (c : ℝ) : ∑ x' : Fin d, (if x = x' then c else 0) = c := by rw [Finset.sum_eq_single x] · simp · intro b _hb hbx simp [Ne.symm hbx] · simp fin_cases j <;> simp [denseSignCell, Fintype.sum_prod_type] all_goals try measurability all_goals rw [Finset.sum_add_distrib, hsum] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSignCell_mass_zero · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:21

For the specified count table, the regrouped dense counts pair the two sign-category counts within each alphabet cell.

Definition (Lean source)
d :
c :
Fin d × Fin 2 → ℕ
denseRegroupCounts c :
fun x ↦ (c (x, 0), c (x, 1))
theorem measurable_denseRegroupCounts

the stated measurable dense regroup counts relation holds.

Formal statement
d :
Measurable (denseRegroupCounts : (Fin d × Fin 2 → ℕ) → Fin d → DenseSignCounts)
Proof (Lean source)
@[fun_prop] lemma measurable_denseRegroupCounts {d : ℕ} : Measurable (denseRegroupCounts : (Fin d × Fin 2 → ℕ) → Fin d → DenseSignCounts) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_denseRegroupCounts · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:70
theorem denseSignStatistic_eq_regroupHistogram

the dense sign statistic equals the regrouped observation histogram.

Formal statement
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSignStatistic_eq_regroupHistogram · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:78
theorem map_denseRegroupCounts_pi_poisson

the stated map dense regroup counts product poisson relation holds.

Formal statement
d :
r :
Measure.map denseRegroupCounts (Measure.pi (fun _ : Fin d × Fin 2 ↦ poissonMeasure r))
= Measure.pi (fun _ : Fin d ↦ (poissonMeasure r).prod (poissonMeasure r))
Proof (Lean source)
lemma map_denseRegroupCounts_pi_poisson (d : ℕ) (r : NNReal) : Measure.map denseRegroupCounts (Measure.pi (fun _ : Fin d × Fin 2 ↦ poissonMeasure r)) = Measure.pi (fun _ : Fin d ↦ (poissonMeasure r).prod (poissonMeasure r)) := by apply Measure.ext_of_singleton intro v rw [Measure.map_apply measurable_denseRegroupCounts (MeasurableSet.singleton v)] have hpre : denseRegroupCounts ⁻¹' {v} = {fun z : Fin d × Fin 2 ↦ if z.2 = 0 then (v z.1).1 else (v z.1).2} := by ext c simp only [Set.mem_preimage, Set.mem_singleton_iff] constructor · intro hc funext z rcases z with ⟨zx, zj⟩ have hx := congrFun hc zx fin_cases zj · exact congrArg fst hx · exact congrArg snd hx · intro hc funext x apply Prod.ext · simpa [denseRegroupCounts] using congrFun hc (x, 0) · simpa [denseRegroupCounts] using congrFun hc (x, 1) rw [hpre, Measure.pi_singleton] rw [Measure.pi_singleton] rw [Fintype.prod_prod_type] apply Finset.prod_congr rfl intro x _hx rw [Fin.prod_univ_two] rw [show ({v x} : Set DenseSignCounts) = {(v x).1} ×ˢ {(v x).2} by ext z simp [Prod.ext_iff]] rw [Measure.prod_prod] simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_denseRegroupCounts_pi_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:87
theorem map_denseSignStatistic_baseline

If the alphabet size satisfies its stated restriction, then the stated map dense sign statistic baseline relation holds.

Formal statement
n d :
hd :
2 ≤ d
= Measure.pi (fun _ : Fin d ↦ denseSignBaseline (poissonCellIntensity n d))
Proof (Lean source)
lemma map_denseSignStatistic_baseline {n d : ℕ} (hd : 2 ≤ d) : Measure.map denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hd)))) (toNNReal (2 * n))) = Measure.pi (fun _ : Fin d ↦ denseSignBaseline (poissonCellIntensity n d)) := by rw [show Measure.map denseSignStatistic _ = Measure.map denseRegroupCounts (Measure.map (finitePoissonHistogram denseSignCell) (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hd)))) (toNNReal (2 * n)))) by rw [Measure.map_map measurable_denseRegroupCounts (measurable_finitePoissonHistogram denseSignCell measurable_denseSignCell)] congr 1 funext s exact denseSignStatistic_eq_regroupHistogram s] rw [finitePoissonHistogram_law _ denseSignCell measurable_denseSignCell] have hmean (z : Fin d × Fin 2) : toNNReal (2 * n) * (obsLaw (observedMarginal (denseLaw (denseZeroContrast d hd))) (denseSignCell ⁻¹' {z})).toNNReal = (poissonCellIntensity n d / 2).toNNReal := by rw [denseSignCell_mass_zero hd z.1 z.2] apply NNReal.eq push_cast rw [ENNReal.toReal_ofReal (by positivity)] rw [Real.coe_toNNReal _ (by positivity)] rw [Real.coe_toNNReal _ (by unfold poissonCellIntensity; positivity)] simp [poissonCellIntensity] field_simp simp_rw [hmean] rw [map_denseRegroupCounts_pi_poisson] congr 1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_denseSignStatistic_baseline · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:126
theorem map_denseSignStatistic_denseLaw

the stated map dense sign statistic dense law relation holds.

Formal statement
n d :
theta :
= Measure.pi (fun x : Fin d ↦ denseSignLaw (poissonCellIntensity n d) (theta.1 x))
Proof (Lean source)
lemma map_denseSignStatistic_denseLaw {n d : ℕ} (theta : DenseContrast d) : Measure.map denseSignStatistic (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n))) = Measure.pi (fun x : Fin d ↦ denseSignLaw (poissonCellIntensity n d) (theta.1 x)) := by let Q0 := finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1)))) (toNNReal (2 * n)) let g : (Fin d → DenseSignCounts) → ENNReal := fun r ↦ ∏ x, ofReal (oneCellLikelihood 0 (theta.1 x) (r x)) have hg : Measurable g := measurable_of_countable _ have hfactor : denseSampleLikelihoodENN theta = g ∘ denseSignStatistic := by funext s rw [denseSampleLikelihoodENN_factors] rfl rw [densePoissonSampleLaw_eq_withDensity, hfactor] apply Measure.ext_of_singleton intro r rw [map_withDensity_comp_singleton Q0 denseSignStatistic measurable_denseSignStatistic g hg] rw [show Measure.map denseSignStatistic Q0 = Measure.pi (fun _ : Fin d ↦ denseSignBaseline (poissonCellIntensity n d)) by exact map_denseSignStatistic_baseline theta.2.1] letI (_x : Fin d) : IsProbabilityMeasure (denseSignBaseline (poissonCellIntensity n d)) := by unfold denseSignBaseline infer_instance letI (x : Fin d) : IsProbabilityMeasure (denseSignLaw (poissonCellIntensity n d) (theta.1 x)) := by unfold denseSignLaw infer_instance rw [Measure.pi_singleton, Measure.pi_singleton] unfold g rw [← Finset.prod_mul_distrib] congr 1 funext x rw [denseSignLaw_eq_withDensity] · rw [withDensity_apply _ (MeasurableSet.singleton (r x)), lintegral_singleton] rfl · unfold poissonCellIntensity positivity · rw [abs_le] constructor <;> linarith [(theta.2.2 x).1, (theta.2.2 x).2]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_denseSignStatistic_denseLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationStatisticLaw.lean:163
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DenseObservationSufficiency 14 declarations
theorem denseObservedAtomMass

each dense observed atom has mass (1+hetax)/(4d)(1+ heta_x)/(4d) when treatment and outcome agree and (1hetax)/(4d)(1- heta_x)/(4d) otherwise.

Formal statement
d :
theta :
x :
Fin d
a y :
jointMass (observedMarginal (denseLaw theta)) x a y
= (1 + (if a = y then theta.1 x else -theta.1 x)) / (4 * d)
Proof (Lean source)
lemma denseObservedAtomMass {d : ℕ} (theta : DenseContrast d) (x : Fin d) (a y : Bool) : jointMass (observedMarginal (denseLaw theta)) x a y = (1 + (if a = y then theta.1 x else -theta.1 x)) / (4 * d) := by have h := denseLaw_jointMass theta fin_cases a <;> fin_cases y · rw [h.1]; simp; ring · rw [h.2.1]; simp; ring · rw [h.2.2.1]; simp; ring · rw [h.2.2.2]; simp; ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservedAtomMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:9
theorem finitePoissonSampleLaw_singleton_denseSufficiency Lemma finitePoissonSampleLaw_singleton_denseSufficiency in the paper ↗

If the stated lam condition holds, then the stated finite poisson sample law singleton dense sufficiency relation holds.

Formal statement
finitePoissonSampleLaw P lam {s} = poissonMeasure lam {s.count} * ∏ i, P {s.points i}
Proof (Lean source)
lemma finitePoissonSampleLaw_singleton_denseSufficiency {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] (P : Measure X) [IsProbabilityMeasure P] (lam : ℝ≥0) (s : FiniteSample X) : finitePoissonSampleLaw P lam {s} = poissonMeasure lam {s.count} * ∏ i, P {s.points i} := by rcases s with ⟨m, s⟩ have hm : Measure.map (fixedSizeEmbed m) (Measure.pi (fun _ : Fin m => P)) {⟨m, s⟩} = Measure.pi (fun _ : Fin m => P) {s} := by rw [Measure.map_apply (measurable_fixedSizeEmbed m) (measurableSet_singleton ⟨m, s⟩)] congr 1 ext x simp [fixedSizeEmbed] have h := congrArg (fun mu : Measure (FiniteSample X) => mu {⟨m, s⟩}) (finitePoissonSampleLaw_restrict_count_eq P lam m) convert h using 1 <;> simp [Measure.restrict_apply, hm, Measure.pi_singleton, FiniteSample.count, FiniteSample.points] all_goals congr
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.finitePoissonSampleLaw_singleton_denseSufficiency · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:24
theorem denseObservedAtomMeasure_likelihood

each dense observed atom equals its zero-contrast mass times the corresponding one-observation likelihood factor.

Formal statement
d :
theta :
z :
Obs d
obsLaw (observedMarginal (denseLaw theta)) {z}
= obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1))) {z} * ofReal (if z.2.1 = z.2.2 then 1 + theta.1 z.1 else 1 - theta.1 z.1)
Proof (Lean source)
lemma denseObservedAtomMeasure_likelihood {d : ℕ} (theta : DenseContrast d) (z : Obs d) : obsLaw (observedMarginal (denseLaw theta)) {z} = obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1))) {z} * ofReal (if z.2.1 = z.2.2 then 1 + theta.1 z.1 else 1 - theta.1 z.1) := by have hf : 0 ≤ (if z.2.1 = z.2.2 then 1 + theta.1 z.1 else 1 - theta.1 z.1) := by split_ifs <;> linarith [(theta.2.2 z.1).1, (theta.2.2 z.1).2] apply (ENNReal.toReal_eq_toReal_iff' (measure_ne_top _ _) (ENNReal.mul_ne_top (measure_ne_top _ _) ENNReal.ofReal_ne_top)).mp rw [ENNReal.toReal_mul, ENNReal.toReal_ofReal hf] simpa [obsLaw, jointMass, PMF.toMeasure_apply_singleton] using denseLaw_atom_likelihood theta z.1 z.2.1 z.2.2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseObservedAtomMeasure_likelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:48

For the specified contrast, smaller alphabet size, the dense sample likelihood is the product of the observation-level likelihood factors relative to the zero contrast.

Definition (Lean source)
d :
theta :
denseSampleLikelihoodENN theta s :
ℝ≥0∞
∏ i, ofReal (if (s.points i).2.1 = (s.points i).2.2 then 1 + theta.1 (s.points i).1 else 1 - theta.1 (s.points i).1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSampleLikelihoodENN · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:64
theorem densePoissonSample_singleton_likelihood

each dense Poisson sample probability equals its zero-contrast probability times the dense sample likelihood.

Formal statement
n d :
theta :
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePoissonSample_singleton_likelihood · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:72

For the specified smaller alphabet size, the dense sign statistic counts, in each cell, observations where treatment and outcome agree and disagree.

Definition (Lean source)
d :
denseSignStatistic s :
fun x
=> ((Finset.univ.filter fun i => (s.points i).1 = x ∧ (s.points i).2.1 = (s.points i).2.2).card, (Finset.univ.filter fun i => (s.points i).1 = x ∧ (s.points i).2.1 ≠ (s.points i).2.2).card)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSignStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:88
theorem measurable_denseSignStatistic

the stated measurable dense sign statistic relation holds.

Formal statement
d :
Measurable (denseSignStatistic : DensePoissonSample d → Fin d → DenseSignCounts)
Proof (Lean source)
@[fun_prop] lemma measurable_denseSignStatistic {d : ℕ} : Measurable (denseSignStatistic : DensePoissonSample d → Fin d → DenseSignCounts) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_denseSignStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:97
theorem denseSampleLikelihoodENN_factors

the dense sample likelihood factors across alphabet cells into one-cell likelihoods.

Formal statement
d :
theta :
= ∏ x : Fin d, ofReal (oneCellLikelihood 0 (theta.1 x) (denseSignStatistic s x))
Proof (Lean source)
lemma denseSampleLikelihoodENN_factors {d : ℕ} (theta : DenseContrast d) (s : DensePoissonSample d) : denseSampleLikelihoodENN theta s = ∏ x : Fin d, ofReal (oneCellLikelihood 0 (theta.1 x) (denseSignStatistic s x)) := by classical have hp (x : Fin d) : 0 ≤ 1 + theta.1 x := by linarith [(theta.2.2 x).1] have hm (x : Fin d) : 0 ≤ 1 - theta.1 x := by linarith [(theta.2.2 x).2] simp only [denseSampleLikelihoodENN, oneCellLikelihood, denseSignStatistic] simp_rw [ENNReal.ofReal_mul (pow_nonneg (hp _) _), ENNReal.ofReal_pow (hp _), ENNReal.ofReal_pow (hm _)] let f : Fin s.count → ℝ≥0∞ := fun i => ofReal (if (s.points i).2.1 = (s.points i).2.2 then 1 + theta.1 (s.points i).1 else 1 - theta.1 (s.points i).1) rw [← Finset.prod_fiberwise univ (fun i => (s.points i).1) f] apply Finset.prod_congr rfl intro x _hx rw [← Finset.prod_filter_mul_prod_filter_not (Finset.univ.filter fun i => (s.points i).1 = x) (fun i => (s.points i).2.1 = (s.points i).2.2) f] have hplus : (∏ i ∈ (Finset.univ.filter fun i => (s.points i).1 = x) with (s.points i).2.1 = (s.points i).2.2, f i) = ofReal (1 + theta.1 x) ^ (Finset.univ.filter fun i => (s.points i).1 = x ∧ (s.points i).2.1 = (s.points i).2.2).card := by rw [Finset.prod_eq_pow_card] · congr 2 ext i simp · intro i hi simp only [mem_filter, Finset.mem_univ, true_and] at hi simp [f, hi.2, hi.1] have hminus : (∏ i ∈ (Finset.univ.filter fun i => (s.points i).1 = x) with ¬(s.points i).2.1 = (s.points i).2.2, f i) = ofReal (1 - theta.1 x) ^ (Finset.univ.filter fun i => (s.points i).1 = x ∧ (s.points i).2.1 ≠ (s.points i).2.2).card := by rw [Finset.prod_eq_pow_card] · congr 2 ext i simp · intro i hi simp only [mem_filter, Finset.mem_univ, true_and] at hi simp [f, hi.2, hi.1] rw [hplus, hminus]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.denseSampleLikelihoodENN_factors · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:104
theorem measurable_denseSampleLikelihoodENN

the stated measurable dense sample likelihood enn relation holds.

Formal statement
d :
theta :
Proof (Lean source)
@[fun_prop] lemma measurable_denseSampleLikelihoodENN {d : ℕ} (theta : DenseContrast d) : Measurable (denseSampleLikelihoodENN theta) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_denseSampleLikelihoodENN · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:156
theorem densePoissonSampleLaw_eq_withDensity

the dense Poisson sample law is the zero-contrast law tilted by the dense sample likelihood.

Formal statement
n d :
theta :
Proof (Lean source)
lemma densePoissonSampleLaw_eq_withDensity {n d : ℕ} (theta : DenseContrast d) : finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw theta))) (toNNReal (2 * n)) = (finitePoissonSampleLaw (obsLaw (observedMarginal (denseLaw (denseZeroContrast d theta.2.1)))) (toNNReal (2 * n))).withDensity (denseSampleLikelihoodENN theta) := by apply Measure.ext_of_singleton intro s rw [withDensity_apply _ (measurableSet_singleton s), lintegral_singleton] simpa [mul_comm] using (densePoissonSample_singleton_likelihood (n := n) theta s)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePoissonSampleLaw_eq_withDensity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:163
theorem map_withDensity_comp_singleton Lemma map_withDensity_comp_singleton in the paper ↗

If the stated stat condition holds, and the stated g condition holds, then the stated map with density composition singleton relation holds.

Formal statement
Q0 :
stat :
Z → S
hstat :
g :
S → ℝ≥0∞
_hg :
s :
S
Measure.map stat (Q0.withDensity (g ∘ stat)) {s} = g s * Measure.map stat Q0 {s}
Proof (Lean source)
lemma map_withDensity_comp_singleton {Z S : Type*} [MeasurableSpace Z] [MeasurableSpace S] [MeasurableSingletonClass S] (Q0 : Measure Z) (stat : Z → S) (hstat : Measurable stat) (g : S → ℝ≥0∞) (_hg : Measurable g) (s : S) : Measure.map stat (Q0.withDensity (g ∘ stat)) {s} = g s * Measure.map stat Q0 {s} := by rw [Measure.map_apply hstat (measurableSet_singleton s), withDensity_apply _ (hstat (measurableSet_singleton s)), Measure.map_apply hstat (measurableSet_singleton s)] calc (∫⁻ z in stat ⁻¹' {s}, (g ∘ stat) z ∂Q0) = ∫⁻ _z in stat ⁻¹' {s}, g s ∂Q0 := by apply setLIntegral_congr_fun (hstat (measurableSet_singleton s)) intro z hz simp only [Set.mem_preimage, Set.mem_singleton_iff] at hz simp [Function.comp_apply, hz] _ = g s * Q0 (stat ⁻¹' {s}) := by simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_withDensity_comp_singleton · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:178
theorem condDistrib_tilt_eq_of_factor Lemma condDistrib_tilt_eq_of_factor in the paper ↗

If the stated stat condition holds, and the stated g condition holds, and the stated g condition holds, and the stated support condition holds, and the stated base condition holds, then at every supported statistic value with positive baseline mass, tilting by a statistic-measurable density leaves the conditional distribution unchanged.

Formal statement
stat :
Z → S
hstat :
g :
S → ℝ≥0∞
hg :
IsProbabilityMeasure (Q0.withDensity (g ∘ stat))
s :
S
hs :
g s ≠ 0
hbase :
Measure.map stat Q0 {s} ≠ 0
condDistrib id stat (Q0.withDensity (g ∘ stat)) s
= condDistrib id stat Q0 s
Proof (Lean source)
lemma condDistrib_tilt_eq_of_factor {Z S : Type*} [MeasurableSpace Z] [StandardBorelSpace Z] [Countable Z] [Nonempty Z] [MeasurableSpace S] [StandardBorelSpace S] [Countable S] [MeasurableSingletonClass S] (Q0 : Measure Z) [IsProbabilityMeasure Q0] (stat : Z → S) (hstat : Measurable stat) (g : S → ℝ≥0∞) (hg : Measurable g) [IsProbabilityMeasure (Q0.withDensity (g ∘ stat))] (s : S) (hs : g s ≠ 0) (hbase : Measure.map stat Q0 {s} ≠ 0) : condDistrib id stat (Q0.withDensity (g ∘ stat)) s = condDistrib id stat Q0 s := by classical let Q := Q0.withDensity (g ∘ stat) have hmapQ : Measure.map stat Q {s} ≠ 0 := by rw [show Measure.map stat Q {s} = g s * Measure.map stat Q0 {s} by exact map_withDensity_comp_singleton Q0 stat hstat g hg s] exact mul_ne_zero hs hbase apply Measure.ext_of_singleton intro z rw [ProbabilityTheory.condDistrib_apply_of_ne_zero (μ := Q) measurable_id s hmapQ {z}, ProbabilityTheory.condDistrib_apply_of_ne_zero (μ := Q0) measurable_id s hbase {z}] have hjoint (mu : Measure Z) : Measure.map (fun a => (stat a, id a)) mu ({s} ×ˢ {z}) = if stat z = s then mu {z} else 0 := by rw [Measure.map_apply (hstat.prodMk measurable_id) (MeasurableSet.singleton s |>.prod (MeasurableSet.singleton z))] split_ifs with hsz · congr 1 ext w simp only [Set.mem_preimage, Set.mem_prod, Set.mem_singleton_iff, id_eq, and_iff_right_iff_imp] intro hw simpa [hw] using hsz · have hempty : (fun a => (stat a, id a)) ⁻¹' ({s} ×ˢ {z}) = ∅ := by ext w simp only [Set.mem_preimage, Set.mem_prod, Set.mem_singleton_iff, id_eq, Set.mem_empty_iff_false, iff_false, not_and] intro hw hwz apply hsz simpa [hwz] using hw rw [hempty, measure_empty] rw [hjoint Q, hjoint Q0] by_cases hzs : stat z = s · simp only [hzs, ↓reduceIte] have hQz : Q {z} = g s * Q0 {z} := by dsimp [Q] rw [withDensity_apply _ (measurableSet_singleton z), lintegral_singleton] simp [Function.comp_apply, hzs] rw [hQz] rw [show Measure.map stat Q {s} = g s * Measure.map stat Q0 {s} by exact map_withDensity_comp_singleton Q0 stat hstat g hg s] have hgsTop : g s ≠ ⊤ := by intro htop have hfinite : Measure.map stat Q {s} ≠ ⊤ := measure_ne_top _ _ rw [show Measure.map stat Q {s} = g s * Measure.map stat Q0 {s} by exact map_withDensity_comp_singleton Q0 stat hstat g hg s, htop, ENNReal.top_mul hbase] at hfinite exact hfinite rfl rw [ENNReal.mul_inv (inl hs) (inr hbase)] calc (g s)⁻¹ * (Measure.map stat Q0 {s})⁻¹ * (g s * Q0 {z}) = ((g s)⁻¹ * g s) * ((Measure.map stat Q0 {s})⁻¹ * Q0 {z}) := by ring _ = (Measure.map stat Q0 {s})⁻¹ * Q0 {z} := by rw [ENNReal.inv_mul_cancel hs hgsTop] simp · simp [hzs]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.condDistrib_tilt_eq_of_factor · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:199
theorem ae_singleton_measure_ne_zero Lemma ae_singleton_measure_ne_zero in the paper ↗

almost every point has nonzero singleton mass.

Formal statement
S :
μ :
∀ᵐ s ∂μ, μ {s} ≠ 0
Proof (Lean source)
lemma ae_singleton_measure_ne_zero {S : Type*} [MeasurableSpace S] [MeasurableSingletonClass S] [Countable S] (μ : Measure S) : ∀ᵐ s ∂μ, μ {s} ≠ 0 := by apply mem_ae_iff.mpr have hbad : {s : S | μ {s} = 0} = ⋃ s : {s : S // μ {s} = 0}, ({s.1} : Set S) := by ext s simp have hcompl : {s : S | μ {s} ≠ 0}ᶜ = {s : S | μ {s} = 0} := by ext s simp rw [hcompl, hbad] exact measure_iUnion_null fun s ↦ s.property
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ae_singleton_measure_ne_zero · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:271
theorem condDistrib_reconstruct_withDensity_factor Lemma condDistrib_reconstruct_withDensity_factor in the paper ↗

If the stated stat condition holds, and the stated g condition holds, and the stated g condition holds, then the baseline conditional kernel, mixed against the tilted statistic law, reconstructs the tilted distribution.

Formal statement
stat :
Z → S
hstat :
g :
S → ℝ≥0∞
hg :
IsProbabilityMeasure (Q0.withDensity (g ∘ stat))
condDistrib id stat Q0 ∘ₘ Measure.map stat (Q0.withDensity (g ∘ stat))
= Q0.withDensity (g ∘ stat)
Proof (Lean source)
lemma condDistrib_reconstruct_withDensity_factor {Z S : Type*} [MeasurableSpace Z] [StandardBorelSpace Z] [Countable Z] [Nonempty Z] [MeasurableSpace S] [StandardBorelSpace S] [Countable S] [MeasurableSingletonClass S] (Q0 : Measure Z) [IsProbabilityMeasure Q0] (stat : Z → S) (hstat : Measurable stat) (g : S → ℝ≥0∞) (hg : Measurable g) [IsProbabilityMeasure (Q0.withDensity (g ∘ stat))] : condDistrib id stat Q0 ∘ₘ Measure.map stat (Q0.withDensity (g ∘ stat)) = Q0.withDensity (g ∘ stat) := by let Q := Q0.withDensity (g ∘ stat) have hnonzero : ∀ᵐ s ∂Measure.map stat Q, g s ≠ 0 := by apply mem_ae_iff.mpr have hzero : Measure.map stat Q {s | g s = 0} = 0 := by have hset : {s | g s = 0} = g ⁻¹' {0} := by ext; simp rw [hset, Measure.map_apply hstat (hg (measurableSet_singleton 0)), show Q = Q0.withDensity (g ∘ stat) by rfl, withDensity_apply _ (hstat (hg (measurableSet_singleton 0)))] apply setLIntegral_eq_zero · exact hstat (hg (measurableSet_singleton 0)) · intro z hz simp only [Set.mem_preimage, Set.mem_singleton_iff] at hz simp [Function.comp_apply, hz] have hcomp : {s | g s ≠ 0}ᶜ = {s | g s = 0} := by ext s simp rw [hcomp] exact hzero have hcond : condDistrib id stat Q0 =ᵐ[Measure.map stat Q] condDistrib id stat Q := by have hbaseQ0 : ∀ᵐ s ∂Measure.map stat Q0, Measure.map stat Q0 {s} ≠ 0 := ae_singleton_measure_ne_zero (Measure.map stat Q0) have hmap : Measure.map stat Q = (Measure.map stat Q0).withDensity g := by apply Measure.ext_of_singleton intro s rw [show Q = Q0.withDensity (g ∘ stat) by rfl, map_withDensity_comp_singleton Q0 stat hstat g hg s, withDensity_apply _ (measurableSet_singleton s), lintegral_singleton] have hbaseQ : ∀ᵐ s ∂Measure.map stat Q, Measure.map stat Q0 {s} ≠ 0 := by rw [hmap] apply (ae_withDensity_iff hg).2 filter_upwards [hbaseQ0] with s hs exact fun _ ↦ hs filter_upwards [hnonzero, hbaseQ] with s hs hbase symm exact condDistrib_tilt_eq_of_factor Q0 stat hstat g hg s hs hbase calc condDistrib id stat Q0 ∘ₘ Measure.map stat Q = condDistrib id stat Q ∘ₘ Measure.map stat Q := by exact Measure.comp_congr hcond _ = Q := by simpa using ProbabilityTheory.condDistrib_comp_map (μ := Q) (X := stat) (Y := id) hstat.aemeasurable aemeasurable_id
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.condDistrib_reconstruct_withDensity_factor · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DenseObservationSufficiency.lean:287
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DensePriorConcentration 1 declarations Pairwise assembly of the dense priors' variance and concentration bounds.

Pairwise assembly of the dense priors' variance and concentration bounds.

theorem densePriorPair_variance_and_concentration Lemma densePriorPair_variance_and_concentration in the paper ↗

Both members of a Cai--Low prior pair satisfy the variance and one-eighth target-concentration clauses needed by the dense fuzzy-hypothesis argument. This uses the dense construction domain conditions hold, and the two priors satisfy the moment-matching certificate, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hdom :
nu0 nu1 :
hscale :
32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2
nu ∈ ({nu0, nu1} : Set (Measure ℝ)) :
conclusion 1
theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu
denseAmplitude n d ^ 2 / (4 * d)
conclusion 2
denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4}
≤ 1 / 8
Proof (Lean source)
lemma densePriorPair_variance_and_concentration {n d : ℕ} {epsilon : ℝ} (hdom : DenseConstructionDomain n d epsilon) (nu0 nu1 : Measure ℝ) (hpair : DensePriorPairConditions (lowerDegree d) nu0 nu1) (hscale : 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2) : ∀ nu ∈ ({nu0, nu1} : Set (Measure ℝ)), (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧ denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8 := by have hE_nonneg : 0 ≤ bestEvenApproxError (lowerDegree d) := by unfold bestEvenApproxError apply le_csInf · refine ⟨1, 0, by simp, ?_⟩ intro t ht simpa using (abs_le.mpr ht) · intro e he rcases he with ⟨p, _hpdeg, hp⟩ have hzero := hp 0 (by constructor <;> norm_num) have hzero' : |eval 0 p| ≤ e := by simpa only [abs_zero, zero_sub, abs_neg] using hzero exact (abs_nonneg _).trans hzero' have hE : 0 < bestEvenApproxError (lowerDegree d) := by by_contra hnot have hzero : bestEvenApproxError (lowerDegree d) = 0 := le_antisymm (le_of_not_gt hnot) hE_nonneg rw [hzero] at hscale norm_num at hscale intro nu hnu simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hnu rcases hnu with hnu | hnu · subst nu letI : IsProbabilityMeasure nu0 := hpair.1 exact ⟨densePriorTarget_variance_le hdom nu0 hpair.2.2.1, densePriorTarget_tail_le hdom nu0 hpair.2.2.1 hE hscale⟩ · subst nu letI : IsProbabilityMeasure nu1 := hpair.2.1 exact ⟨densePriorTarget_variance_le hdom nu1 hpair.2.2.2.1, densePriorTarget_tail_le hdom nu1 hpair.2.2.2.1 hE hscale⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorPair_variance_and_concentration · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DensePriorConcentration.lean:9
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.DensePriorSetup 1 declarations Assembly of the supported Cai--Low product priors used by the dense lower bound.

Assembly of the supported Cai--Low product priors used by the dense lower bound.

In the dense regime, the cited Cai--Low pair gives supported product priors with the required separation, sign-count mixture bound, variance, and target concentration. This uses the sample size and alphabet lie in the dense regime, and the overlap parameter satisfies its stated range restriction, and the Cai--Low moment-matching prior result is available, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon :
hregime :
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hscale :
32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2
∃ hdom : DenseConstructionDomain n d epsilon,
∃ priors : DensePriorFamily,
let C := denseSubmodel n d epsilon hdom priors densePriorMeanSeparation C
≤ d * sqrt (denseLikelihoodTail n d) ∧
(∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧ denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8)
Proof (Lean source)
lemma densePriorSetup {n d : ℕ} {epsilon : ℝ} (hregime : DenseRegime n d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (h_cai_low : CaiLowAbsoluteMomentPriors) (hscale : 32 ≤ (d : ℝ) * bestEvenApproxError (lowerDegree d) ^ 2) : ∃ hdom : DenseConstructionDomain n d epsilon, ∃ priors : DensePriorFamily, let C := denseSubmodel n d epsilon hdom priors densePriorMeanSeparation C = densePriorSeparation n d ∧ 0 < densePriorMeanSeparation C ∧ densePriorMeanSeparation C ≤ 1 ∧ tvDist (productPriorPredictive d C.nu0 (denseSupportedSignKernel n d)) (productPriorPredictive d C.nu1 (denseSupportedSignKernel n d)) ≤ d * sqrt (denseLikelihoodTail n d) ∧ (∀ nu ∈ ({C.nu0, C.nu1} : Set (Measure ℝ)), (∫ theta, (denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu) ^ 2 ∂denseScaledProductPrior n d epsilon hdom nu ≤ denseAmplitude n d ^ 2 / (4 * d)) ∧ denseScaledProductPrior n d epsilon hdom nu {theta | |denseTargetAt theta - densePriorTargetMean n d epsilon hdom nu| > densePriorSeparation n d / 4} ≤ 1 / 8) := by let hdom := denseConstructionDomain_of_regime n d epsilon hregime hepsilon let priors := densePriorFamily_of_caiLow h_cai_low let C := denseSubmodel n d epsilon hdom priors have hpair : DensePriorPairConditions (lowerDegree d) C.nu0 C.nu1 := C.priorConditions have hE := bestEvenApproxError_lowerDegree_pos h_cai_low d hregime.1 have hsep := densePriorSeparation_range n d hregime hE refine ⟨hdom, priors, C.priorMeanSeparation_eq, ?_, ?_, ?_, ?_⟩ · change 0 < C.priorMeanSeparation rw [C.priorMeanSeparation_eq] exact hsep.1 · change C.priorMeanSeparation ≤ 1 rw [C.priorMeanSeparation_eq] exact hsep.2 · exact denseMomentMatchedSignProduct_tv hregime C.nu0 C.nu1 hpair · exact densePriorPair_variance_and_concentration hdom C.nu0 C.nu1 hpair hscale
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.densePriorSetup · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/DensePriorSetup.lean:9
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.EmpiricalRatioRisk 26 declarations The bounded-alphabet empirical-ratio branch of the upper bound.

The bounded-alphabet empirical-ratio branch of the upper bound.

For the specified observed datum, the observed binary mark is one for a successful outcome and zero otherwise.

Definition (Lean source)
d :
o :
Obs d
observedBinaryMark o :
if o.2.2 then 1 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedBinaryMark · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:14
theorem categoryMass_obsLaw

under the observed-data law, a category has probability equal to its cell mass.

Formal statement
d :
P :
x :
Fin d
categoryMass (obsLaw P) (fun o : Obs d => o.1) x = cellMass P x
Proof (Lean source)
lemma categoryMass_obsLaw {d : ℕ} (P : DiscreteLaw d) (x : Fin d) : categoryMass (obsLaw P) (fun o : Obs d => o.1) x = cellMass P x := by unfold categoryMass categoryEvent groupEvent obsLaw rw [PMF.toMeasure_apply_fintype] simp only [Set.indicator_apply, Set.mem_setOf_eq, Fintype.sum_prod_type] rw [Finset.sum_eq_single x] · simp only [if_true] rw [ENNReal.toReal_sum (by simp [P.pmf.apply_ne_top])] apply congrArg funext a rw [ENNReal.toReal_sum (by simp [P.pmf.apply_ne_top])] rfl · intro b _ hb simp [hb] · simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.categoryMass_obsLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:19
theorem armCategoryMass_obsLaw

under the observed-data law, an arm-and-cell category has probability equal to its arm mass.

Formal statement
d :
P :
x :
Fin d
a :
armCategoryMass (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) a x = armMass P a x
Proof (Lean source)
lemma armCategoryMass_obsLaw {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a : Bool) : armCategoryMass (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) a x = armMass P a x := by unfold armCategoryMass armCategoryEvent armGroupEvent obsLaw rw [PMF.toMeasure_apply_fintype] simp only [Set.indicator_apply, Set.mem_setOf_eq, Fintype.sum_prod_type] rw [Finset.sum_eq_single x] · simp only [true_and] rw [Finset.sum_eq_single a] · simp only [if_true] rw [ENNReal.toReal_sum (by simp [P.pmf.apply_ne_top])] rfl · intro b _ hb simp [hb] · simp · intro b _ hb simp [hb] · simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armCategoryMass_obsLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:37
theorem categoryCount_eq_sampleCellCount Lemma categoryCount_eq_sampleCellCount in the paper ↗

the stated category count identity sample cell count relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
categoryCount (fun o : Obs d => o.1) (fun o => o.2.1) z x = sampleCellCount z x
Proof (Lean source)
lemma categoryCount_eq_sampleCellCount {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) : categoryCount (fun o : Obs d => o.1) (fun o => o.2.1) z x = sampleCellCount z x := by unfold categoryCount groupCount groupArmCount sampleCellCount rw [Finset.card_eq_sum_ones, Finset.card_eq_sum_ones] simp_rw [Finset.sum_filter] rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i hi cases h : (z i).2.1 <;> simp [h]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.categoryCount_eq_sampleCellCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:58
theorem categoryArmCount_eq_sampleArmCount Lemma categoryArmCount_eq_sampleArmCount in the paper ↗

the stated category arm count identity sample arm count relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
a :
categoryArmCount (fun o : Obs d => o.1) (fun o => o.2.1) z a x = sampleArmCount z x a
Proof (Lean source)
lemma categoryArmCount_eq_sampleArmCount {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) (a : Bool) : categoryArmCount (fun o : Obs d => o.1) (fun o => o.2.1) z a x = sampleArmCount z x a := by unfold categoryArmCount groupArmCount sampleArmCount rw [Finset.card_eq_sum_ones] simp_rw [Finset.sum_filter]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.categoryArmCount_eq_sampleArmCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:71
theorem armMarkSum_eq_sampleSuccessCount

the stated arm mark sum identity sample success count relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
a :
armMarkSum (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark z a x
Proof (Lean source)
lemma armMarkSum_eq_sampleSuccessCount {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) (a : Bool) : armMarkSum (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark z a x = sampleSuccessCount z x a := by unfold armMarkSum supportedArmMark armCategoryEvent Causalean.Stat.armGroupEvent observedBinaryMark sampleSuccessCount push_cast apply Finset.sum_congr rfl intro i hi by_cases ha : (z i).1 = x ∧ (z i).2.1 = a · cases hy : (z i).2.2 <;> simp [ha, hy] · cases hy : (z i).2.2 <;> simp [ha, hy]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armMarkSum_eq_sampleSuccessCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:81
theorem totalizedArmMean_eq_sampleRatio

the stated totalized arm mean identity sample ratio relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
a :
totalizedArmMean (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark z a x
= (sampleSuccessCount z x a : ℝ) / sampleArmCount z x a
Proof (Lean source)
lemma totalizedArmMean_eq_sampleRatio {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) (a : Bool) : totalizedArmMean (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark z a x = (sampleSuccessCount z x a : ℝ) / sampleArmCount z x a := by unfold totalizedArmMean rw [categoryArmCount_eq_sampleArmCount, armMarkSum_eq_sampleSuccessCount] by_cases h : 0 < sampleArmCount z x a · rw [if_pos h, div_eq_inv_mul] · rw [if_neg h] have hz : sampleArmCount z x a = 0 := Nat.eq_zero_of_not_pos h simp [hz]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.totalizedArmMean_eq_sampleRatio · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:96
theorem fixedStratumArmScore_singleton_eq

the stated fixed stratum arm score singleton identity relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
a :
fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a z
= (sampleCellCount z x : ℝ) / n * ((sampleSuccessCount z x a : ℝ) / sampleArmCount z x a)
Proof (Lean source)
lemma fixedStratumArmScore_singleton_eq {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) (a : Bool) : fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a z = (sampleCellCount z x : ℝ) / n * ((sampleSuccessCount z x a : ℝ) / sampleArmCount z x a) := by unfold fixedStratumArmScore simp only [Finset.sum_singleton, categoryCount_eq_sampleCellCount] rw [totalizedArmMean_eq_sampleRatio]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedStratumArmScore_singleton_eq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:111
theorem integral_observedBinaryMark_armCategory

the stated integral observed binary mark arm category relation holds.

Formal statement
d :
P :
x :
Fin d
a :
(∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, observedBinaryMark o ∂obsLaw P)
= jointMass P x a true
Proof (Lean source)
lemma integral_observedBinaryMark_armCategory {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a : Bool) : (∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, observedBinaryMark o ∂obsLaw P) = jointMass P x a true := by rw [← integral_indicator] · unfold obsLaw rw [PMF.integral_eq_sum] unfold armCategoryEvent armGroupEvent observedBinaryMark simp only [Set.indicator_apply, Set.mem_setOf_eq, Fintype.sum_prod_type] rw [Finset.sum_eq_single x] · simp only [true_and] rw [Finset.sum_eq_single a] · simpa [jointMass] · intro b _ hb simp [hb] · simp · intro b _ hb simp [hb] · simp · exact measurableSet_armGroupEvent _ _ (by fun_prop) (by fun_prop) _ _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_observedBinaryMark_armCategory · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:123
theorem outcomeMean_mem_unitInterval_empirical

the stated outcome mean mem unit interval empirical relation holds.

Formal statement
d :
P :
a :
x :
Fin d
outcomeMean P a x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma outcomeMean_mem_unitInterval_empirical {d : ℕ} (P : DiscreteLaw d) (a : Bool) (x : Fin d) : outcomeMean P a x ∈ Icc (0 : ℝ) 1 := by have hj (y : Bool) : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg have ha : 0 ≤ armMass P a x := sum_nonneg fun y _ => hj y have hle : jointMass P x a truearmMass P a x := by simp [armMass] exact hj false exact ⟨div_nonneg (hj true) ha, div_le_one_of_le₀ hle ha⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.outcomeMean_mem_unitInterval_empirical · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:146
theorem integral_observedBinaryResidual_eq_zero

the stated integral observed binary residual identity zero relation holds.

Formal statement
d :
P :
x :
Fin d
a :
(∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, (observedBinaryMark o - outcomeMean P a x) ∂obsLaw P)
= 0
Proof (Lean source)
lemma integral_observedBinaryResidual_eq_zero {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a : Bool) : (∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, (observedBinaryMark o - outcomeMean P a x) ∂obsLaw P) = 0 := by have hset := measurableSet_armGroupEvent (fun o : Obs d => o.1) (fun o => o.2.1) (by fun_prop) (by fun_prop) a x rw [integral_sub (by fun_prop) (integrableOn_const (C := outcomeMean P a x)), integral_observedBinaryMark_armCategory, setIntegral_const] change jointMass P x a true - (obsLaw P (armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x)).toReal * outcomeMean P a x = 0 rw [show (obsLaw P (armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x)).toReal = armMass P a x by exact armCategoryMass_obsLaw P x a] unfold outcomeMean by_cases ha : armMass P a x = 0 · have hj : 0 ≤ jointMass P x a true := ENNReal.toReal_nonneg have hle : jointMass P x a truearmMass P a x := by simp [armMass] exact ENNReal.toReal_nonneg have hz : jointMass P x a true = 0 := le_antisymm (hle.trans_eq ha) hj simp [ha, hz] · field_simp [ha] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_observedBinaryResidual_eq_zero · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:157
theorem observedArmResidual_memLp_two

the stated observed arm residual mem lp two relation holds.

Formal statement
d :
P :
a :
x :
Fin d
MemLp (supportedArmResidual (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark (fun a x => outcomeMean P a x) a x) 2 (obsLaw P)
Proof (Lean source)
lemma observedArmResidual_memLp_two {d : ℕ} (P : DiscreteLaw d) (a : Bool) (x : Fin d) : MemLp (supportedArmResidual (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark (fun a x => outcomeMean P a x) a x) 2 (obsLaw P) := by apply MemLp.of_bound (by fun_prop) 1 filter_upwards [] with o rw [Real.norm_eq_abs] unfold supportedArmResidual Causalean.Stat.supportedArmGroupResidual Causalean.Stat.armGroupResidual by_cases h : o ∈ armGroupEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x · rw [Set.indicator_of_mem h] have hm := outcomeMean_mem_unitInterval_empirical P a x have habs : |outcomeMean P a x| ≤ 1 := abs_le.mpr ⟨by linarith [hm.1], hm.2⟩ have habs1 : |1 - outcomeMean P a x| ≤ 1 := abs_le.mpr ⟨by linarith [hm.2], by linarith [hm.1]⟩ cases hy : o.2.2 · simpa [observedBinaryMark, hy] using habs · simpa [observedBinaryMark, hy] using habs1 · simp [h]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedArmResidual_memLp_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:185
theorem integral_observedBinaryResidual_sq_le

the stated integral observed binary residual squared upper bound relation holds.

Formal statement
d :
P :
a :
x :
Fin d
(∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, (observedBinaryMark o - outcomeMean P a x) ^ 2 ∂obsLaw P)
armMass P a x
Proof (Lean source)
lemma integral_observedBinaryResidual_sq_le {d : ℕ} (P : DiscreteLaw d) (a : Bool) (x : Fin d) : (∫ o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, (observedBinaryMark o - outcomeMean P a x) ^ 2 ∂obsLaw P) ≤ armMass P a x := by have hset := measurableSet_armGroupEvent (fun o : Obs d => o.1) (fun o => o.2.1) (by fun_prop) (by fun_prop) a x have hint : IntegrableOn (fun o : Obs d => (observedBinaryMark o - outcomeMean P a x) ^ 2) (armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x) (obsLaw P) := by exact (Integrable.of_finite : Integrable (fun o : Obs d => (observedBinaryMark o - outcomeMean P a x) ^ 2) (obsLaw P)).integrableOn calc _ ≤ ∫ _o in armCategoryEvent (fun o : Obs d => o.1) (fun o => o.2.1) a x, (1 : ℝ) ∂obsLaw P := by apply MeasureTheory.setIntegral_mono_on hint (integrableOn_const) hset intro o ho have hm := outcomeMean_mem_unitInterval_empirical P a x have habs : |outcomeMean P a x| ≤ 1 := abs_le.mpr ⟨by linarith [hm.1], hm.2⟩ have habs1 : |1 - outcomeMean P a x| ≤ 1 := abs_le.mpr ⟨by linarith [hm.2], by linarith [hm.1]⟩ cases hy : o.2.2 · simp [observedBinaryMark, hy] nlinarith [sq_abs (outcomeMean P a x), habs, sq_nonneg (outcomeMean P a x)] · simp [observedBinaryMark, hy] nlinarith [sq_abs (1 - outcomeMean P a x), habs1, sq_nonneg (1 - outcomeMean P a x)] _ = armMass P a x := by rw [setIntegral_const] rw [smul_eq_mul, mul_one, measureReal_def] exact armCategoryMass_obsLaw P x a
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_observedBinaryResidual_sq_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:209
theorem observedOverlap_armMass_lower

If the observed law satisfies the stated model restrictions, and the stated x condition holds, then the stated observed overlap arm mass lower relation holds.

Formal statement
d :
epsilon :
P :
hP :
a :
x :
Fin d
hx :
0 < cellMass P x
epsilon * cellMass P x ≤ armMass P a x
Proof (Lean source)
lemma observedOverlap_armMass_lower {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (a : Bool) (x : Fin d) (hx : 0 < cellMass P x) : epsilon * cellMass P x ≤ armMass P a x := by have ht : epsilon * cellMass P x ≤ armMass P true x := by exact (le_div_iff₀ hx).mp (hP.overlap x hx).1 have hsum : cellMass P x = armMass P false x + armMass P true x := by simp [cellMass, armMass] ring have hf : epsilon * cellMass P x ≤ armMass P false x := by have hu : armMass P true x ≤ (1 - epsilon) * cellMass P x := by exact (div_le_iff₀ hx).mp (hP.overlap x hx).2 nlinarith cases a <;> assumption
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOverlap_armMass_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:245
theorem fixedStratumArmTarget_singleton_eq

If the observed law satisfies the stated model restrictions, then the stated fixed stratum arm target singleton identity relation holds.

Formal statement
d :
epsilon :
P :
hP :
x :
Fin d
a :
fixedStratumArmTarget (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a
= cellMass P x * outcomeMean P a x
Proof (Lean source)
lemma fixedStratumArmTarget_singleton_eq {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) (a : Bool) : fixedStratumArmTarget (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a = cellMass P x * outcomeMean P a x := by have hpositive : ∀ k ∈ ({x} : Finset (Fin d)), 0 < categoryMass (obsLaw P) (fun o : Obs d => o.1) k → 0 < armCategoryMass (obsLaw P) (fun o => o.1) (fun o => o.2.1) a k := by intro k hk hmass rw [categoryMass_obsLaw] at hmass rw [armCategoryMass_obsLaw] exact (mul_pos hP.epsilon_pos hmass).trans_le (observedOverlap_armMass_lower P hP a k hmass) have hcenter := fixedStratumArmCenterTarget_eq_target (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark (fun a x => outcomeMean P a x) {x} a (by fun_prop) (by fun_prop) (fun k => observedArmResidual_memLp_two P a k) (fun k => integral_observedBinaryResidual_eq_zero P k a) hpositive rw [← hcenter] simp [fixedStratumArmCenterTarget, categoryMass_obsLaw]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedStratumArmTarget_singleton_eq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:261
theorem nonneg_mul_exp_neg_le_inv Lemma nonneg_mul_exp_neg_le_inv in the paper ↗

If the stated u condition holds, and the stated p condition holds, then the stated nonnegativity product exp neg upper bound reciprocal relation holds.

Formal statement
u p :
hu :
0 < u
hp :
0 ≤ p
p * exp (-(u * p)) ≤ u⁻¹
Proof (Lean source)
lemma nonneg_mul_exp_neg_le_inv (u p : ℝ) (hu : 0 < u) (hp : 0 ≤ p) : p * exp (-(u * p)) ≤ u⁻¹ := by by_cases hz : p = 0 · simp [hz, le_of_lt hu] have hp' : 0 < p := lt_of_le_of_ne hp (Ne.symm hz) have ht : 0 < u * p := mul_pos hu hp' have hlin : u * p ≤ exp (u * p) := by nlinarith [Real.add_one_le_exp (u * p)] have hmul := mul_le_mul_of_nonneg_right hlin (Real.exp_pos (-(u * p))).le rw [← Real.exp_add] at hmul simp only [add_neg_cancel, Real.exp_zero] at hmul rw [inv_eq_one_div, le_div_iff₀ hu] nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.nonneg_mul_exp_neg_le_inv · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:283
theorem missingArmEnvelope_singleton_le

If the sample size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, then the stated missing arm envelope singleton upper bound relation holds.

Formal statement
n d :
P :
x :
Fin d
epsilon :
hn :
4 ≤ n
hepsilon :
0 < epsilon
missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x}
≤ 4 / (n * epsilon)
Proof (Lean source)
lemma missingArmEnvelope_singleton_le {n d : ℕ} (P : DiscreteLaw d) (x : Fin d) (epsilon : ℝ) (hn : 4 ≤ n) (hepsilon : 0 < epsilon) : missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x} ≤ 4 / (n * epsilon) := by rw [show missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x} = cellMass P x * exp (-(((n - 2 : ℕ) : ℝ) / 2 * epsilon * cellMass P x)) by simp [missingArmExponentialEnvelope, categoryMass_obsLaw]] let u : ℝ := ((n - 2 : ℕ) : ℝ) / 2 * epsilon have hnR : 0 < (n : ℝ) := by positivity have hsub : ((n - 2 : ℕ) : ℝ) = (n : ℝ) - 2 := by rw [Nat.cast_sub (by omega : 2 ≤ n)] norm_num have hu : 0 < u := by dsimp [u] rw [hsub] have hn4 : (4 : ℝ) ≤ n := by exact_mod_cast hn exact mul_pos (by nlinarith) hepsilon have hbase := nonneg_mul_exp_neg_le_inv u (cellMass P x) hu (cellMass_nonneg P x) have hulower : (n : ℝ) * epsilon / 4 ≤ u := by dsimp [u] rw [hsub] have hn4 : (4 : ℝ) ≤ n := by exact_mod_cast hn nlinarith calc cellMass P x * exp (-(((n - 2 : ℕ) : ℝ) / 2 * epsilon * cellMass P x)) = cellMass P x * exp (-(u * cellMass P x)) := by rfl _ ≤ u⁻¹ := hbase _ ≤ 4 / (n * epsilon) := by have hden : 0 < (n : ℝ) * epsilon / 4 := by positivity calc u⁻¹ = 1 / u := by rw [one_div] _ ≤ 1 / ((n : ℝ) * epsilon / 4) := one_div_le_one_div_of_le hden hulower _ = 4 / (n * epsilon) := by field_simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.missingArmEnvelope_singleton_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:299
theorem cellMass_le_one_empirical

every cell mass is at most one.

Formal statement
d :
P :
x :
Fin d
cellMass P x ≤ 1
Proof (Lean source)
lemma cellMass_le_one_empirical {d : ℕ} (P : DiscreteLaw d) (x : Fin d) : cellMass P x ≤ 1 := by have hsum : ∑ k : Fin d, cellMass P k = 1 := by calc _ = ∑ z : Obs d, (P.pmf z).toReal := by simp [cellMass, jointMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm calc cellMass P x ≤ ∑ k : Fin d, cellMass P k := Finset.single_le_sum (fun k _ => cellMass_nonneg P k) (Finset.mem_univ x) _ = 1 := hsum
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass_le_one_empirical · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:337
theorem fixedStratumArmScore_singleton_mse_le

If the observed law satisfies the stated model restrictions, and the sample size satisfies its stated restriction, then the stated fixed stratum arm score singleton mse upper bound relation holds.

Formal statement
n d :
epsilon :
P :
hP :
x :
Fin d
a :
hn :
4 ≤ n
∫ z : Fin n → Obs d, (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a z - cellMass P x * outcomeMean P a x) ^ 2 ∂productLaw P n
≤ 100 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n
Proof (Lean source)
lemma fixedStratumArmScore_singleton_mse_le {n d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) (a : Bool) (hn : 4 ≤ n) : ∫ z : Fin n → Obs d, (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a z - cellMass P x * outcomeMean P a x) ^ 2 ∂productLaw P n ≤ 100 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := by have hbase := integral_fixedStratumArm_error_sq_le_exponential (m := n) (obsLaw P) (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark (fun a x => outcomeMean P a x) {x} a 1 epsilon (by fun_prop) (by fun_prop) (by fun_prop) (fun k => observedArmResidual_memLp_two P a k) (fun k => integral_observedBinaryResidual_eq_zero P k a) (fun k => by rw [armCategoryMass_obsLaw] simpa using integral_observedBinaryResidual_sq_le P a k) (fun k => by have hm := outcomeMean_mem_unitInterval_empirical P a k exact abs_le.mpr ⟨by linarith [hm.1], hm.2⟩) hP.epsilon_pos (fun k hk => by rw [categoryMass_obsLaw] at hk ⊢ rw [armCategoryMass_obsLaw] exact observedOverlap_armMass_lower P hP a k hk) rw [fixedStratumArmTarget_singleton_eq P hP x a] at hbase change (∫ z : Fin n → Obs d, _ ∂productLaw P n) ≤ _ rw [show productLaw P n = Measure.pi (fun _ : Fin n => obsLaw P) by rfl] calc _ ≤ 1 ^ 2 * (8 * (∑ k ∈ ({x} : Finset (Fin d)), categoryMass (obsLaw P) (fun o : Obs d => o.1) k) / (safeSampleSize n * epsilon) + 6 / safeSampleSize n + 4 * (missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x}) ^ 2) := hbase _ ≤ 100 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := by have hnR : 0 < (n : ℝ) := by positivity have hsafe : safeSampleSize n = n := by simp [safeSampleSize, max_eq_right (by omega : 1 ≤ n)] have henv := missingArmEnvelope_singleton_le P x epsilon hn hP.epsilon_pos have henv0 : 0 ≤ missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x} := by simp only [missingArmExponentialEnvelope, Finset.sum_singleton, categoryMass_obsLaw] exact mul_nonneg (cellMass_nonneg P x) (Real.exp_nonneg _) have henvSq := pow_le_pow_left₀ henv0 henv 2 have hp := cellMass_le_one_empirical P x simp only [Finset.sum_singleton, categoryMass_obsLaw, one_pow, one_mul] rw [hsafe] have hterm1 : 8 * cellMass P x / (n * epsilon) ≤ 8 * epsilon⁻¹ / n := by calc _ ≤ 8 * 1 / (n * epsilon) := by apply div_le_div_of_nonneg_right · nlinarith · exact (mul_pos hnR hP.epsilon_pos).le _ = 8 * epsilon⁻¹ / n := by field_simp [ne_of_gt hnR, ne_of_gt hP.epsilon_pos] have hterm3 : 4 * missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x} ^ 2 ≤ 64 * epsilon⁻¹ ^ 2 / n := by have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast (le_trans (by omega : 1 ≤ 4) hn) have hinv0 : 0 ≤ (n : ℝ)⁻¹ := inv_nonneg.mpr (le_of_lt hnR) have hinv1 : (n : ℝ)⁻¹ ≤ 1 := (inv_le_one₀ hnR).2 hn1 have hinvSq : (n : ℝ)⁻¹ ^ 2 ≤ (n : ℝ)⁻¹ := by nlinarith [sq_nonneg ((n : ℝ)⁻¹)] calc _ ≤ 4 * (4 / (n * epsilon)) ^ 2 := by nlinarith _ = 64 * epsilon⁻¹ ^ 2 * (n : ℝ)⁻¹ ^ 2 := by field_simp [ne_of_gt hnR, ne_of_gt hP.epsilon_pos] <;> norm_num _ ≤ 64 * epsilon⁻¹ ^ 2 * (n : ℝ)⁻¹ := by gcongr _ = 64 * epsilon⁻¹ ^ 2 / n := by rw [div_eq_mul_inv] calc 8 * cellMass P x / (n * epsilon) + 6 / n + 4 * missingArmExponentialEnvelope (obsLaw P) (fun o : Obs d => o.1) n epsilon {x} ^ 2 ≤ 8 * epsilon⁻¹ / n + 6 / n + 64 * epsilon⁻¹ ^ 2 / n := by linarith _ ≤ 100 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := by let t : ℝ := epsilon⁻¹ change 8 * t / n + 6 / n + 64 * t ^ 2 / n ≤ 100 * (1 + t + t ^ 2) / n have ht : 0 ≤ t := by dsimp [t] exact inv_nonneg.mpr (le_of_lt hP.epsilon_pos) field_simp [ne_of_gt hnR] nlinarith [sq_nonneg t]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedStratumArmScore_singleton_mse_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:352
theorem empiricalRatio_eq_max_armScores

the empirical-ratio estimator equals the sum across strata of the larger empirical arm score.

Formal statement
n d :
z :
Fin n → Obs d
= ∑ x : Fin d, max (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} false z) (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} true z)
Proof (Lean source)
lemma empiricalRatio_eq_max_armScores {n d : ℕ} (z : Fin n → Obs d) : empiricalRatioEstimator z = ∑ x : Fin d, max (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} false z) (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} true z) := by unfold empiricalRatioEstimator apply Finset.sum_congr rfl intro x hx rw [fixedStratumArmScore_singleton_eq, fixedStratumArmScore_singleton_eq, ← mul_max_of_nonneg] positivity
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.empiricalRatio_eq_max_armScores · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:442
theorem observedOptimalValue_eq_max_armTargets

If the observed law satisfies the stated model restrictions, then the stated observed optimal value identity max arm targets relation holds.

Formal statement
d :
epsilon :
P :
hP :
= ∑ x : Fin d, max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x)
Proof (Lean source)
lemma observedOptimalValue_eq_max_armTargets {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : observedOptimalValue P hP = ∑ x : Fin d, max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x) := by unfold observedOptimalValue observedOptimalValueRaw apply Finset.sum_congr rfl intro x hx rw [← mul_max_of_nonneg] exact cellMass_nonneg P x
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOptimalValue_eq_max_armTargets · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:458
theorem empiricalRatio_pointwise_sq_le_armScores

If the observed law satisfies the stated model restrictions, then the squared empirical-ratio error is bounded by twice the sum of the two arm-score errors.

Formal statement
n d :
epsilon :
P :
hP :
z :
Fin n → Obs d
≤ (2 * d) * ∑ xa : Fin d × Bool, (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {xa.1} xa.2 z - cellMass P xa.1 * outcomeMean P xa.2 xa.1) ^ 2
Proof (Lean source)
lemma empiricalRatio_pointwise_sq_le_armScores {n d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (z : Fin n → Obs d) : (empiricalRatioEstimator z - observedOptimalValue P hP) ^ 2 ≤ (2 * d) * ∑ xa : Fin d × Bool, (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {xa.1} xa.2 z - cellMass P xa.1 * outcomeMean P xa.2 xa.1) ^ 2 := by let e : Fin d → Bool → ℝ := fun x a => fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} a z - cellMass P x * outcomeMean P a x have habs : |empiricalRatioEstimator z - observedOptimalValue P hP| ≤ ∑ xa : Fin d × Bool, |e xa.1 xa.2| := by rw [empiricalRatio_eq_max_armScores, observedOptimalValue_eq_max_armTargets, ← Finset.sum_sub_distrib] calc |∑ x : Fin d, (max (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} false z) (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} true z) - max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x))| ≤ ∑ x : Fin d, |max (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} false z) (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} true z) - max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x)| := by simpa using Finset.abs_sum_le_sum_abs (fun x : Fin d => max (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} false z) (fixedStratumArmScore (fun o : Obs d => o.1) (fun o => o.2.1) observedBinaryMark {x} true z) - max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x)) Finset.univ _ ≤ ∑ x : Fin d, (|e x false| + |e x true|) := by apply Finset.sum_le_sum intro x hx refine (abs_max_sub_max_le_max _ _ _ _).trans ?_ exact max_le (le_add_of_nonneg_right (abs_nonneg _)) (le_add_of_nonneg_left (abs_nonneg _)) _ = ∑ xa : Fin d × Bool, |e xa.1 xa.2| := by rw [Fintype.sum_prod_type] apply Finset.sum_congr rfl intro x hx simp [Fintype.sum_bool, add_comm] have hsum := sq_sum_le_card_mul_sum_sq (s := Finset.univ) (f := fun xa : Fin d × Bool => |e xa.1 xa.2|) calc (empiricalRatioEstimator z - observedOptimalValue P hP) ^ 2 = |empiricalRatioEstimator z - observedOptimalValue P hP| ^ 2 := by rw [sq_abs] _ ≤ (∑ xa : Fin d × Bool, |e xa.1 xa.2|) ^ 2 := pow_le_pow_left₀ (abs_nonneg _) habs 2 _ ≤ (2 * d) * ∑ xa : Fin d × Bool, |e xa.1 xa.2| ^ 2 := by simpa [mul_comm] using hsum _ = (2 * d) * ∑ xa : Fin d × Bool, (e xa.1 xa.2) ^ 2 := by simp only [sq_abs]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.empiricalRatio_pointwise_sq_le_armScores · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:471
theorem empiricalRatio_sqRisk_two_le

If the observed law satisfies the stated model restrictions, and the sample size satisfies its stated restriction, then the empirical-ratio estimator has the stated uniform squared-risk upper bound.

Formal statement
n :
epsilon :
P :
hP :
hn :
4 ≤ n
≤ 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n
Proof (Lean source)
lemma empiricalRatio_sqRisk_two_le {n : ℕ} {epsilon : ℝ} (P : DiscreteLaw 2) (hP : ObservedModelClass epsilon P) (hn : 4 ≤ n) : sqRisk (productLaw P n) empiricalRatioEstimator (observedOptimalValue P hP) ≤ 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := by unfold sqRisk have hpoint := empiricalRatio_pointwise_sq_le_armScores (n := n) P hP calc _ ≤ ∫ z : Fin n → Obs 2, (4 * ∑ xa : Fin 2 × Bool, (fixedStratumArmScore (fun o : Obs 2 => o.1) (fun o => o.2.1) observedBinaryMark {xa.1} xa.2 z - cellMass P xa.1 * outcomeMean P xa.2 xa.1) ^ 2) ∂productLaw P n := by apply integral_mono (Integrable.of_finite) (Integrable.of_finite) intro z have hz := hpoint z norm_num at hz exact hz _ = 4 * ∑ xa : Fin 2 × Bool, ∫ z : Fin n → Obs 2, (fixedStratumArmScore (fun o : Obs 2 => o.1) (fun o => o.2.1) observedBinaryMark {xa.1} xa.2 z - cellMass P xa.1 * outcomeMean P xa.2 xa.1) ^ 2 ∂productLaw P n := by rw [integral_const_mul, integral_finset_sum] intro xa hxa exact Integrable.of_finite _ ≤ 4 * ∑ _xa : Fin 2 × Bool, (100 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n) := by gcongr exact fixedStratumArmScore_singleton_mse_le P hP _ _ hn _ = 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := by norm_num [Fintype.sum_prod_type, Fintype.sum_bool] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.empiricalRatio_sqRisk_two_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:535
theorem sampleSuccessCount_le_sampleArmCount Lemma sampleSuccessCount_le_sampleArmCount in the paper ↗

the stated sample success count upper bound sample arm count relation holds.

Formal statement
n d :
z :
Fin n → Obs d
x :
Fin d
a :
Proof (Lean source)
lemma sampleSuccessCount_le_sampleArmCount {n d : ℕ} (z : Fin n → Obs d) (x : Fin d) (a : Bool) : sampleSuccessCount z x a ≤ sampleArmCount z x a := by unfold sampleSuccessCount sampleArmCount apply Finset.sum_le_sum intro i hi split <;> split <;> simp_all
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sampleSuccessCount_le_sampleArmCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:571

sample cell counts sum to the total sample size.

Formal statement
n d :
z :
Fin n → Obs d
∑ x : Fin d, sampleCellCount z x = n
Proof (Lean source)
lemma sum_sampleCellCount {n d : ℕ} (z : Fin n → Obs d) : ∑ x : Fin d, sampleCellCount z x = n := by unfold sampleCellCount rw [Finset.sum_comm] calc (∑ i : Fin n, ∑ x : Fin d, if (z i).1 = x then 1 else 0) = ∑ _i : Fin n, 1 := by apply Finset.sum_congr rfl intro i hi rw [Finset.sum_eq_single (z i).1] · simp · intro x _ hx simp [hx.symm] · simp _ = n := by simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sum_sampleCellCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:580
theorem empiricalRatioEstimator_mem_unitInterval

If the sample size satisfies its stated restriction, then the stated empirical ratio estimator mem unit interval relation holds.

Formal statement
n d :
z :
Fin n → Obs d
hn :
0 < n
empiricalRatioEstimator z ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma empiricalRatioEstimator_mem_unitInterval {n d : ℕ} (z : Fin n → Obs d) (hn : 0 < n) : empiricalRatioEstimator z ∈ Icc (0 : ℝ) 1 := by have hratio (x : Fin d) (a : Bool) : (sampleSuccessCount z x a : ℝ) / sampleArmCount z x a ∈ Icc (0 : ℝ) 1 := by have hs0 : (0 : ℝ) ≤ sampleSuccessCount z x a := by positivity have ha0 : (0 : ℝ) ≤ sampleArmCount z x a := by positivity have hle : (sampleSuccessCount z x a : ℝ) ≤ sampleArmCount z x a := by exact_mod_cast sampleSuccessCount_le_sampleArmCount z x a exact ⟨div_nonneg hs0 ha0, div_le_one_of_le₀ hle ha0⟩ have hweights : ∑ x : Fin d, (sampleCellCount z x : ℝ) / n = 1 := by rw [← Finset.sum_div, ← Nat.cast_sum, sum_sampleCellCount] field_simp unfold empiricalRatioEstimator constructor · exact sum_nonneg fun x _ => mul_nonneg (by positivity) ((hratio x false).1.trans (le_max_left _ _)) · calc ∑ x : Fin d, (sampleCellCount z x : ℝ) / n * max ((sampleSuccessCount z x false : ℝ) / sampleArmCount z x false) ((sampleSuccessCount z x true : ℝ) / sampleArmCount z x true) ≤ ∑ x : Fin d, (sampleCellCount z x : ℝ) / n * 1 := by apply Finset.sum_le_sum intro x hx gcongr exact max_le (hratio x false).2 (hratio x true).2 _ = 1 := by simpa using hweights
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.empiricalRatioEstimator_mem_unitInterval · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/EmpiricalRatioRisk.lean:598
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.Estimator 18 declarations Empirical-ratio fallback and the all-data Jackson--factorial estimator.

Empirical-ratio fallback and the all-data Jackson--factorial estimator.

def sampleCellCount

For the specified observed sample, cell, the sample cell count is the number of observations in the specified alphabet cell.

Definition (Lean source)
n d :
sample :
Fin n → Obs d
x :
Fin d
sampleCellCount sample x :
∑ i, if (sample i).1 = x then 1 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sampleCellCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:16
def sampleArmCount

For the specified observed sample, cell, treatment arm, the sample arm count is the number of observations in the specified cell and treatment arm.

Definition (Lean source)
n d :
sample :
Fin n → Obs d
x :
Fin d
a :
sampleArmCount sample x a :
∑ i, if (sample i).1 = x ∧ (sample i).2.1 = a then 1 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sampleArmCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:20
def sampleSuccessCount

For the specified observed sample, cell, treatment arm, the sample success count is the number of successful observations in the specified cell and treatment arm.

Definition (Lean source)
n d :
sample :
Fin n → Obs d
x :
Fin d
a :
sampleSuccessCount sample x a :
∑ i, if (sample i).1 = x ∧ (sample i).2.1 = a ∧ (sample i).2.2 then 1 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sampleSuccessCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:24
def empiricalRatioEstimator Definition 10 in the paper ↗

For the specified observed sample, the empirical-ratio estimator sums empirical cell shares times the larger of the two totalized within-arm success ratios.

Definition (Lean source)
n d :
sample :
Fin n → Obs d
empiricalRatioEstimator sample :
∑ x : Fin d, (sampleCellCount sample x : ℝ) / n * max ((sampleSuccessCount sample x false : ℝ) / sampleArmCount sample x false) ((sampleSuccessCount sample x true : ℝ) / sampleArmCount sample x true)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.empiricalRatioEstimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:29

The named universal tuning constants whose admissible values are chosen by the risk theorem.

Definition (Lean source)
pilotRadiusConstant :
jacksonDegreeConstant :
boundedAlphabetCutoff :
pilotRadiusConstant_pos :
0 < pilotRadiusConstant
jacksonDegreeConstant_pos :
0 < jacksonDegreeConstant
jacksonDegreeConstant_lt_one :
jacksonDegreeConstant < 1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.JacksonTuning · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:36
def jacksonDegree

For the specified tuning rule, alphabet size, the Jackson degree is the larger of two and the integer part of the tuning constant times the logarithmic alphabet size.

Definition (Lean source)
tuning :
d :
jacksonDegree tuning d :
max 2 ⌊tuning.jacksonDegreeConstant * logAlphabet d⌋₊
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonDegree · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:45
theorem jacksonDegree_ge_two

the stated jackson degree lower bound two relation holds.

Formal statement
tuning :
d :
2 ≤ jacksonDegree tuning d
Proof (Lean source)
lemma jacksonDegree_ge_two (tuning : JacksonTuning) (d : ℕ) : 2 ≤ jacksonDegree tuning d := by exact le_max_left 2 _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonDegree_ge_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:50
def markedCellCount

Count one observed four-cell coordinate among the first M units carrying a given fair mark.

Definition (Lean source)
n d :
sample :
Fin n → Obs d
M :
marks :
Fin n → Bool
pilot :
x :
Fin d
j :
markedCellCount sample M marks pilot x j :
∑ i, if i.1 < M ∧
marks i = pilot ∧
(sample i).1 = x ∧
(sample i).2.1 = finTwoEquiv j.1 ∧
(sample i).2.2 = finTwoEquiv j.2 then 1 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.markedCellCount · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:55
def pilotCenter

Coordinatewise pilot center c_j = N'_j/m.

Definition (Lean source)
m :
pilot :
Cell → ℕ
j :
pilotCenter m pilot j :
(pilot j : ℝ) / m
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotCenter · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:62
def pilotRadius

Coordinatewise pilot radius h_j from the frozen estimator definition.

Definition (Lean source)
tuning :
m :
d :
pilot :
Cell → ℕ
j :
pilotRadius tuning m d pilot j :
tuning.pilotRadiusConstant * (sqrt (pilotCenter m pilot j * logAlphabet d / m) + logAlphabet d / m)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRadius · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:66
def pilotRectangle

Pilot-local rectangle constructed from the marked pilot counts.

Definition (Lean source)
tuning :
m :
d :
pilot :
Cell → ℕ
pilotRectangle tuning m d pilot :
(fun j => max 0 (pilotCenter m pilot j - pilotRadius tuning m d pilot j), fun j => pilotCenter m pilot j + pilotRadius tuning m d pilot j)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRectangle · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:72
theorem pilotRectangle_valid

If the Poisson intensity is positive, then the stated pilot rectangle valid relation holds.

Formal statement
tuning :
m :
d :
pilot :
Cell → ℕ
hm :
0 < m
(pilotRectangle tuning m d pilot).Valid
Proof (Lean source)
lemma pilotRectangle_valid (tuning : JacksonTuning) (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hm : 0 < m) : (pilotRectangle tuning m d pilot).Valid := by intro j have hlog : 0 ≤ logAlphabet d := by by_cases hd : d = 0 · simp [logAlphabet, hd] · have hdpos : (0 : ℝ) < d := by exact_mod_cast (Nat.pos_of_ne_zero hd) have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast (Nat.one_le_iff_ne_zero.mpr hd) have hexp : (1 : ℝ) ≤ exp 1 := Real.one_le_exp (by norm_num) have hprod : 1 ≤ exp 1 * (d : ℝ) := by nlinarith exact Real.log_nonneg hprod have hcenter : 0 ≤ pilotCenter m pilot j := by exact div_nonneg (Nat.cast_nonneg _) (le_of_lt hm) have hradius : 0 ≤ pilotRadius tuning m d pilot j := by unfold pilotRadius have hfrac : 0 ≤ pilotCenter m pilot j * logAlphabet d / m := by positivity have hlogdiv : 0 ≤ logAlphabet d / m := by positivity exact mul_nonneg (le_of_lt tuning.pilotRadiusConstant_pos) (add_nonneg (Real.sqrt_nonneg _) hlogdiv) simp only [pilotRectangle] exact max_le (by positivity) (by linarith)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRectangle_valid · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:79
theorem pilotRectangle_nonneg

the stated pilot rectangle nonnegativity relation holds.

Formal statement
tuning :
m :
d :
pilot :
Cell → ℕ
j :
0 ≤ (pilotRectangle tuning m d pilot).1 j
Proof (Lean source)
lemma pilotRectangle_nonneg (tuning : JacksonTuning) (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) : ∀ j, 0 ≤ (pilotRectangle tuning m d pilot).1 j := by intro j simp [pilotRectangle]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRectangle_nonneg · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:103
theorem pilotRectangle_radius_pos

In the paper's nontrivial alphabet regime, every pilot rectangle has a strictly positive radius, including coordinates whose pilot count is zero. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
tuning :
m :
d :
pilot :
Cell → ℕ
hm :
0 < m
hd :
1 ≤ d
j :
0 < rectangleRadius (pilotRectangle tuning m d pilot) j
Proof (Lean source)
lemma pilotRectangle_radius_pos (tuning : JacksonTuning) (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hm : 0 < m) (hd : 1 ≤ d) : ∀ j, 0 < rectangleRadius (pilotRectangle tuning m d pilot) j := by intro j have hdR : (0 : ℝ) < d := by positivity have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast hd have hlog : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have hexp : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) exact hexp.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hcenter : 0 ≤ pilotCenter m pilot j := by exact div_nonneg (Nat.cast_nonneg _) (le_of_lt hm) have hsqrt : 0 ≤ sqrt (pilotCenter m pilot j * logAlphabet d / m) := Real.sqrt_nonneg _ have hradius : 0 < pilotRadius tuning m d pilot j := by unfold pilotRadius exact mul_pos tuning.pilotRadiusConstant_pos (add_pos_of_nonneg_of_pos hsqrt (div_pos hlog hm)) simp only [rectangleRadius, pilotRectangle] by_cases h : pilotCenter m pilot j - pilotRadius tuning m d pilot j ≤ 0 · rw [max_eq_left h] nlinarith · rw [max_eq_right (le_of_not_ge h)] nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRectangle_radius_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:111
def jacksonCellStatistic

The clipped pilot-local cell statistic built from the Jackson polynomial and its factorial lift.

Definition (Lean source)
tuning :
epsilon :
d :
m :
pilot eval :
Cell → ℕ
hm :
0 < m
jacksonCellStatistic tuning epsilon d m pilot eval hm :
Q :
pilotRectangle tuning m d pilot
center :
radius :
p :
jacksonTensorPolynomial epsilon (jacksonDegree tuning d) (jacksonDegree_ge_two tuning d) Q (pilotRectangle_valid tuning m d pilot hm) (pilotRectangle_nonneg tuning m d pilot)
centerValue :
globalCellValue epsilon center
raw :
centerValue + factorialPolynomialLift m p eval center radius centerValue
scale :
(1 + epsilon⁻¹) * ∑ j : Cell, radius j
max (globalCellValue epsilon center - d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * ∑ j, radius j) (min raw (globalCellValue epsilon center + d ^ (1 / 4 : ℝ) * scale))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonCellStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:140
def fairMarkLaw

The fair product law of the Bernoulli marks.

Definition (Lean source)
n :
fairMarkLaw n :
Measure (Fin n → Bool)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairMarkLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:156
def jacksonRandomizedStatistic

Randomized projected statistic before Rao--Blackwellization.

Definition (Lean source)
n d :
tuning :
epsilon :
sample :
Fin n → Obs d
M :
marks :
Fin n → Bool
jacksonRandomizedStatistic tuning epsilon sample M marks :
if hn : 0 < n then if M
≤ n then let m : ℝ := n / 8 let hm : 0 < m := by positivity let total := ∑ x : Fin d, jacksonCellStatistic tuning epsilon d m (fun j => markedCellCount sample M marks false x j) (fun j => markedCellCount sample M marks true x j) hm max 0 (min 1 total) else 0 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonRandomizedStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:161
def jacksonFactorialEstimator

For the specified tuning rule, overlap level, observed sample, the Jackson factorial estimator uses the empirical ratio for small alphabets, one half in the saturated regime, and otherwise averages the randomized Jackson statistic over Poisson truncation and fair marks.

Definition (Lean source)
n d :
tuning :
epsilon :
sample :
Fin n → Obs d
jacksonFactorialEstimator tuning epsilon sample :
if d < tuning.boundedAlphabetCutoff then empiricalRatioEstimator sample else if (n : ℝ) < d / logAlphabet d then 1 / 2 else ∫ M : ℕ, (∫ marks : Fin n → Bool, jacksonRandomizedStatistic tuning epsilon sample M marks ∂fairMarkLaw n) ∂ProbabilityTheory.poissonMeasure (toNNReal (n / 4))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonFactorialEstimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/Estimator.lean:178
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.FactorialLift 14 declarations Centered falling-factorial lifts for Poisson counts.

Centered falling-factorial lifts for Poisson counts.

theorem descPochhammer_mul_linearization Lemma descPochhammer_mul_linearization in the paper ↗

Linearization of a product of two falling-factorial basis polynomials, classified by the size of the overlap between the two ordered selections. The displayed identity or bound is the asserted conclusion.

Formal statement
a b :
= ∑ l ∈ range (min a b + 1), C (choose a l * choose b l * l.factorial : ℤ) * descPochhammer ℤ (a + b - l)
Proof (Lean source)
lemma descPochhammer_mul_linearization (a b : ℕ) : descPochhammer ℤ a * descPochhammer ℤ b = ∑ l ∈ range (min a b + 1), C (choose a l * choose b l * l.factorial : ℤ) * descPochhammer ℤ (a + b - l) := by classical wlog hab : a ≤ b generalizing a b · rw [mul_comm] simpa [Nat.min_comm, mul_comm, Nat.add_comm] using this b a (le_of_not_ge hab) rw [Nat.min_eq_left hab] have hadd := Ring.descPochhammer_smeval_add (R := ℤ[X]) b (Commute.all (X - C (a : ℤ)) (C (a : ℤ))) simp only [sub_add_cancel] at hadd have hsX (p : ℤ[X]) : p.smeval X = p := by rw [← Polynomial.eval₂_smulOneHom_eq_smeval] simpa using Polynomial.eval₂_C_X p have hscomp (p : ℤ[X]) : p.smeval (X - C (a : ℤ)) = p.comp (X - C (a : ℤ)) := by rw [← Polynomial.eval₂_smulOneHom_eq_smeval] have hhom : (RingHom.smulOneHom : ℤ →+* ℤ[X]) = C := by ext z simp rw [hhom] rfl have hsC (p : ℤ[X]) : p.smeval (C (a : ℤ)) = C (p.eval (a : ℤ)) := by rw [← Polynomial.eval₂_smulOneHom_eq_smeval] simpa using Polynomial.eval₂_at_apply C (a : ℤ) (p := p) simp only [hsX, hscomp, hsC] at hadd rw [← Finset.Nat.sum_antidiagonal_swap] at hadd rw [Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk] at hadd simp only [swap, fst, snd, Nat.succ_eq_add_one] at hadd have heval (l : ℕ) : (descPochhammer ℤ l).eval (a : ℤ) = (a.descFactorial l : ℤ) := by simpa [Polynomial.eval_eq_smeval] using (Polynomial.descPochhammer_smeval_eq_descFactorial (R := ℤ) a l) have hbform : descPochhammer ℤ b = ∑ l ∈ range (b + 1), C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * (descPochhammer ℤ (b - l)).comp (X - C (a : ℤ)) := by rw [hadd] apply Finset.sum_congr rfl intro l hl rw [heval] have hl' : l ≤ b := Nat.le_of_lt_succ (by simpa using Finset.mem_range.mp hl) rw [Nat.choose_symm hl'] simp ring calc descPochhammer ℤ a * descPochhammer ℤ b = descPochhammer ℤ a * (∑ l ∈ range (b + 1), C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * (descPochhammer ℤ (b - l)).comp (X - C (a : ℤ))) := by rw [hbform] _ = ∑ l ∈ range (b + 1), C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * descPochhammer ℤ (a + (b - l)) := by simp only [Finset.mul_sum] apply Finset.sum_congr rfl intro l _hl calc descPochhammer ℤ a * (C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * (descPochhammer ℤ (b - l)).comp (X - C (a : ℤ))) = C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * (descPochhammer ℤ a * (descPochhammer ℤ (b - l)).comp (X - C (a : ℤ))) := by ring _ = _ := by rw [show C (a : ℤ) = (a : ℤ[X]) by simp] rw [descPochhammer_mul] _ = ∑ l ∈ range (a + 1), C ((b.choose l : ℤ) * (a.descFactorial l : ℤ)) * descPochhammer ℤ (a + (b - l)) := by symm apply Finset.sum_subset · intro l hl exact Finset.mem_range.mpr ((Finset.mem_range.mp hl).trans_le (Nat.succ_le_succ hab)) · intro l hlBig hlSmall have ha_lt : a < l := by have := Finset.mem_range.mp hlBig simpa [Finset.mem_range] using hlSmall rw [Nat.descFactorial_eq_zero_iff_lt.mpr ha_lt] simp _ = ∑ l ∈ range (a + 1), C (choose a l * choose b l * l.factorial : ℤ) * descPochhammer ℤ (a + b - l) := by apply Finset.sum_congr rfl intro l hl have hl' : l ≤ a := Nat.le_of_lt_succ (by simpa using Finset.mem_range.mp hl) rw [Nat.descFactorial_eq_factorial_mul_choose] congr 1 · push_cast ring · rw [Nat.add_sub_assoc (le_trans hl' hab) a]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.descPochhammer_mul_linearization · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:14
theorem descFactorial_mul_identity Lemma descFactorial_mul_identity in the paper ↗

Exact overlap expansion for the product of two descending factorials. The displayed identity or bound is the asserted conclusion.

Formal statement
N a b :
N.descFactorial a * N.descFactorial b
= ∑ l ∈ range (min a b + 1), choose a l * choose b l * l.factorial * N.descFactorial (a + b - l)
Proof (Lean source)
lemma descFactorial_mul_identity (N a b : ℕ) : N.descFactorial a * N.descFactorial b = ∑ l ∈ range (min a b + 1), choose a l * choose b l * l.factorial * N.descFactorial (a + b - l) := by have hp := congrArg (eval (N : ℤ)) (descPochhammer_mul_linearization a b) simp only [Polynomial.eval_mul, Polynomial.eval_finset_sum, Polynomial.eval_C, descPochhammer_eval_eq_descFactorial] at hp exact_mod_cast hp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.descFactorial_mul_identity · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:112
def fallingFactorial

Falling factorial (N)_t.

Definition (Lean source)
N t :
fallingFactorial N t :
∏ j ∈ range t, (N - j)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fallingFactorial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:124
theorem fallingFactorial_eq_descFactorial Lemma fallingFactorial_eq_descFactorial in the paper ↗

The paper's product definition of a falling factorial agrees with Mathlib's descending factorial. The displayed identity or bound is the asserted conclusion.

Formal statement
N t :
fallingFactorial N t = N.descFactorial t
Proof (Lean source)
lemma fallingFactorial_eq_descFactorial (N t : ℕ) : fallingFactorial N t = N.descFactorial t := by exact (Nat.descFactorial_eq_prod_range N t).symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fallingFactorial_eq_descFactorial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:128
theorem poisson_descFactorial_shift Lemma poisson_descFactorial_shift in the paper ↗

Shifting a Poisson falling-factorial summand by its order cancels the factorial denominator. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
t k :
exp (-(lambda : ℝ)) * (lambda : ℝ) ^ (k + t) / ((k + t).factorial : ℝ) * ((k + t).descFactorial t : ℝ)
= ((lambda : ℝ) ^ t * exp (-(lambda : ℝ))) * ((lambda : ℝ) ^ k / (k.factorial : ℝ))
Proof (Lean source)
lemma poisson_descFactorial_shift (lambda : NNReal) (t k : ℕ) : exp (-(lambda : ℝ)) * (lambda : ℝ) ^ (k + t) / ((k + t).factorial : ℝ) * ((k + t).descFactorial t : ℝ) = ((lambda : ℝ) ^ t * exp (-(lambda : ℝ))) * ((lambda : ℝ) ^ k / (k.factorial : ℝ)) := by have hfacNat : k.factorial * (k + t).descFactorial t = (k + t).factorial := by simpa [Nat.add_sub_cancel] using (Nat.factorial_mul_descFactorial (n := k + t) (k := t) (Nat.le_add_left t k)) have hfac : (k.factorial : ℝ) * ((k + t).descFactorial t : ℝ) = ((k + t).factorial : ℝ) := by exact_mod_cast hfacNat rw [pow_add] field_simp [Nat.factorial_ne_zero] linear_combination ((lambda : ℝ) ^ k * (lambda : ℝ) ^ t) * hfac
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poisson_descFactorial_shift · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:135
theorem summable_poisson_descFactorial Lemma summable_poisson_descFactorial in the paper ↗

Every falling factorial is summable against a Poisson mass function. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
t :
Summable (fun N : ℕ => exp (-(lambda : ℝ)) * (lambda : ℝ) ^ N / (N.factorial : ℝ) * (N.descFactorial t : ℝ))
Proof (Lean source)
lemma summable_poisson_descFactorial (lambda : NNReal) (t : ℕ) : Summable (fun N : ℕ => exp (-(lambda : ℝ)) * (lambda : ℝ) ^ N / (N.factorial : ℝ) * (N.descFactorial t : ℝ)) := by let f : ℕ → ℝ := fun N => exp (-(lambda : ℝ)) * (lambda : ℝ) ^ N / (N.factorial : ℝ) * (N.descFactorial t : ℝ) have hshift : Summable (fun k => f (k + t)) := by apply Summable.congr ((NormedSpace.expSeries_div_hasSum_exp (lambda : ℝ)).summable.mul_left ((lambda : ℝ) ^ t * exp (-(lambda : ℝ)))) intro k exact (poisson_descFactorial_shift lambda t k).symm exact (summable_nat_add_iff t).mp hshift
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.summable_poisson_descFactorial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:153
theorem integral_fallingFactorial_poisson Lemma integral_fallingFactorial_poisson in the paper ↗

The order-t falling factorial of a Poisson count has expectation equal to the t-th power of its mean. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
t :
∫ N : ℕ, (fallingFactorial N t : ℝ) ∂poissonMeasure lambda = (lambda : ℝ) ^ t
Proof (Lean source)
lemma integral_fallingFactorial_poisson (lambda : NNReal) (t : ℕ) : ∫ N : ℕ, (fallingFactorial N t : ℝ) ∂poissonMeasure lambda = (lambda : ℝ) ^ t := by rw [integral_poissonMeasure] simp only [smul_eq_mul, fallingFactorial_eq_descFactorial] let f : ℕ → ℝ := fun N => exp (-(lambda : ℝ)) * (lambda : ℝ) ^ N / (N.factorial : ℝ) * (N.descFactorial t : ℝ) have hshift : Summable (fun k => f (k + t)) := (summable_nat_add_iff t).mpr (summable_poisson_descFactorial lambda t) have hprefix : ∑ k ∈ range t, f k = 0 := by apply Finset.sum_eq_zero intro k hk have hkt : k < t := Finset.mem_range.mp hk simp [f, Nat.descFactorial_eq_zero_iff_lt.mpr hkt] calc ∑' N, exp (-(lambda : ℝ)) * (lambda : ℝ) ^ N / ↑N.factorial * ↑(N.descFactorial t) = ∑' N, f N := by rfl _ = ∑ k ∈ range t, f k + ∑' k, f (k + t) := (hshift.sum_add_tsum_nat_add').symm _ = ∑' k, (((lambda : ℝ) ^ t * exp (-(lambda : ℝ))) * ((lambda : ℝ) ^ k / (k.factorial : ℝ))) := by rw [hprefix, zero_add] congr 1 funext k exact poisson_descFactorial_shift lambda t k _ = ((lambda : ℝ) ^ t * exp (-(lambda : ℝ))) * exp (lambda : ℝ) := by rw [tsum_mul_left] simpa only [Real.exp_eq_exp_ℝ] using congrArg (fun z : ℝ => ((lambda : ℝ) ^ t * exp (-(lambda : ℝ))) * z) (NormedSpace.expSeries_div_hasSum_exp (lambda : ℝ)).tsum_eq _ = (lambda : ℝ) ^ t := by rw [mul_assoc, ← Real.exp_add] ring_nf simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_fallingFactorial_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:170
theorem integrable_fallingFactorial_poisson Lemma integrable_fallingFactorial_poisson in the paper ↗

Every falling factorial of a Poisson count is integrable. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
t :
Integrable (fun N : ℕ => (fallingFactorial N t : ℝ)) (poissonMeasure lambda)
Proof (Lean source)
lemma integrable_fallingFactorial_poisson (lambda : NNReal) (t : ℕ) : Integrable (fun N : ℕ => (fallingFactorial N t : ℝ)) (poissonMeasure lambda) := by rw [integrable_poissonMeasure_iff] convert summable_poisson_descFactorial lambda t using 1 funext N rw [fallingFactorial_eq_descFactorial, Real.norm_eq_abs, abs_of_nonneg] positivity
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integrable_fallingFactorial_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:209
theorem integrable_fallingFactorial_mul_poisson Lemma integrable_fallingFactorial_mul_poisson in the paper ↗

A product of two falling factorials is integrable under every Poisson law. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
a b :
Integrable (fun N : ℕ => (fallingFactorial N a : ℝ) * fallingFactorial N b) (poissonMeasure lambda)
Proof (Lean source)
lemma integrable_fallingFactorial_mul_poisson (lambda : NNReal) (a b : ℕ) : Integrable (fun N : ℕ => (fallingFactorial N a : ℝ) * fallingFactorial N b) (poissonMeasure lambda) := by have hpoint (N : ℕ) : (fallingFactorial N a : ℝ) * fallingFactorial N b = ∑ l ∈ range (min a b + 1), (choose a l * choose b l * l.factorial : ℝ) * fallingFactorial N (a + b - l) := by simp only [fallingFactorial_eq_descFactorial] exact_mod_cast descFactorial_mul_identity N a b simp_rw [hpoint] apply integrable_finset_sum intro l _hl exact (integrable_fallingFactorial_poisson lambda (a + b - l)).const_mul _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integrable_fallingFactorial_mul_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:219
theorem integral_fallingFactorial_mul_poisson Lemma integral_fallingFactorial_mul_poisson in the paper ↗

The joint Poisson moment of two falling factorials is the exact finite overlap expansion. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
a b :
(∫ N : ℕ, (fallingFactorial N a : ℝ) * fallingFactorial N b ∂poissonMeasure lambda)
= ∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * (lambda : ℝ) ^ (a + b - l)
Proof (Lean source)
lemma integral_fallingFactorial_mul_poisson (lambda : NNReal) (a b : ℕ) : (∫ N : ℕ, (fallingFactorial N a : ℝ) * fallingFactorial N b ∂poissonMeasure lambda) = ∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * (lambda : ℝ) ^ (a + b - l) := by have hpoint (N : ℕ) : (fallingFactorial N a : ℝ) * fallingFactorial N b = ∑ l ∈ range (min a b + 1), (Nat.choose a l * Nat.choose b l * l.factorial : ℝ) * fallingFactorial N (a + b - l) := by simp only [fallingFactorial_eq_descFactorial] exact_mod_cast descFactorial_mul_identity N a b simp_rw [hpoint] rw [integral_finsetSum] · apply Finset.sum_congr rfl intro l _hl rw [integral_const_mul, integral_fallingFactorial_poisson] · intro l _hl exact (integrable_fallingFactorial_poisson lambda (a + b - l)).const_mul _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_fallingFactorial_mul_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:236
def centeredFactorial

Centered factorial lift of a monomial.

Definition (Lean source)
m :
h N :
z :
centeredFactorial m h N z :
∑ t ∈ range (h + 1), (Nat.choose h t : ℝ) * (-z) ^ (h - t) * (fallingFactorial N t : ℝ) / m ^ t
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centeredFactorial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:259
theorem integral_centeredFactorial_poisson Lemma integral_centeredFactorial_poisson in the paper ↗

A centered factorial lift is unbiased for the corresponding centered power under a Poisson count with mean m*q. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m q z :
hm :
0 < m
hq :
0 ≤ q
h :
∫ N : ℕ, centeredFactorial m h N z ∂poissonMeasure (m * q).toNNReal = (q - z) ^ h
Proof (Lean source)
lemma integral_centeredFactorial_poisson (m q z : ℝ) (hm : 0 < m) (hq : 0 ≤ q) (h : ℕ) : ∫ N : ℕ, centeredFactorial m h N z ∂poissonMeasure (m * q).toNNReal = (q - z) ^ h := by simp only [centeredFactorial] rw [integral_finsetSum] · simp_rw [integral_div, integral_const_mul, show ∀ t : ℕ, (∫ N : ℕ, (fallingFactorial N t : ℝ) ∂poissonMeasure (m * q).toNNReal) = (m * q) ^ t by intro t simpa [Real.coe_toNNReal (m * q) (mul_nonneg (le_of_lt hm) hq)] using integral_fallingFactorial_poisson (m * q).toNNReal t] have hratio (x : ℕ) : (Nat.choose h x : ℝ) * (-z) ^ (h - x) * (m * q) ^ x / m ^ x = (Nat.choose h x : ℝ) * (-z) ^ (h - x) * q ^ x := by rw [mul_pow] field_simp simp_rw [hratio] calc ∑ x ∈ range (h + 1), (Nat.choose h x : ℝ) * (-z) ^ (h - x) * q ^ x = ∑ x ∈ range (h + 1), q ^ x * (-z) ^ (h - x) * Nat.choose h x := by apply Finset.sum_congr rfl intro x hx ring _ = (q + (-z)) ^ h := (add_pow q (-z) h).symm _ = (q - z) ^ h := by ring · intro t ht exact (integrable_fallingFactorial_poisson (m * q).toNNReal t).const_mul ((Nat.choose h t : ℝ) * (-z) ^ (h - t)) |>.div_const (m ^ t)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_centeredFactorial_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:266
theorem integrable_centeredFactorial_mul_poisson Lemma integrable_centeredFactorial_mul_poisson in the paper ↗

Two centered factorial lifts have an integrable product under every Poisson law. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
m z :
h t :
Integrable (fun N : ℕ => centeredFactorial m h N z * centeredFactorial m t N z) (poissonMeasure lambda)
Proof (Lean source)
lemma integrable_centeredFactorial_mul_poisson (lambda : NNReal) (m z : ℝ) (h t : ℕ) : Integrable (fun N : ℕ => centeredFactorial m h N z * centeredFactorial m t N z) (poissonMeasure lambda) := by simp only [centeredFactorial, Finset.sum_mul, Finset.mul_sum] apply integrable_finset_sum intro a _ha apply integrable_finset_sum intro b _hb have hab := integrable_fallingFactorial_mul_poisson lambda b a have hc := hab.const_mul (((Nat.choose h b : ℝ) * (-z) ^ (h - b) / m ^ b) * ((Nat.choose t a : ℝ) * (-z) ^ (t - a) / m ^ a)) exact hc.congr (Filter.Eventually.of_forall (fun N => by ring))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integrable_centeredFactorial_mul_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:299
theorem integral_centeredFactorial_mul_poisson_expanded Lemma integral_centeredFactorial_mul_poisson_expanded in the paper ↗

Expanding both lifts and classifying the overlap gives the raw finite-sum form of their joint Poisson moment. The displayed identity or bound is the asserted conclusion.

Formal statement
lambda :
m z :
h t :
(∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂poissonMeasure lambda)
= ∑ b ∈ range (t + 1), ∑ a ∈ range (h + 1), ((Nat.choose h a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((Nat.choose t b : ℝ) * (-z) ^ (t - b) / m ^ b) * (∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * (lambda : ℝ) ^ (a + b - l))
Proof (Lean source)
lemma integral_centeredFactorial_mul_poisson_expanded (lambda : NNReal) (m z : ℝ) (h t : ℕ) : (∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂poissonMeasure lambda) = ∑ b ∈ range (t + 1), ∑ a ∈ range (h + 1), ((Nat.choose h a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((Nat.choose t b : ℝ) * (-z) ^ (t - b) / m ^ b) * (∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * (lambda : ℝ) ^ (a + b - l)) := by simp only [centeredFactorial, Finset.sum_mul, Finset.mul_sum] rw [integral_finsetSum] · apply Finset.sum_congr rfl intro b _hb rw [integral_finsetSum] · apply Finset.sum_congr rfl intro a _ha rw [show (fun N : ℕ => (↑(h.choose a) * (-z) ^ (h - a) * ↑(fallingFactorial N a) / m ^ a) * (↑(t.choose b) * (-z) ^ (t - b) * ↑(fallingFactorial N b) / m ^ b)) = fun N => (((h.choose a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((t.choose b : ℝ) * (-z) ^ (t - b) / m ^ b)) * ((fallingFactorial N a : ℝ) * fallingFactorial N b) by funext N; ring] rw [integral_const_mul, integral_fallingFactorial_mul_poisson] rw [Finset.mul_sum] · intro a _ha have hc := (integrable_fallingFactorial_mul_poisson lambda a b).const_mul (((h.choose a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((t.choose b : ℝ) * (-z) ^ (t - b) / m ^ b)) exact hc.congr (Filter.Eventually.of_forall (fun N => by ring)) · intro b _hb apply integrable_finset_sum intro a _ha have hab := integrable_fallingFactorial_mul_poisson lambda a b have hc := hab.const_mul (((h.choose a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((t.choose b : ℝ) * (-z) ^ (t - b) / m ^ b)) exact hc.congr (Filter.Eventually.of_forall (fun N => by ring))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_centeredFactorial_mul_poisson_expanded · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialLift.lean:317
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.FactorialProductRisk 8 declarations Product-Poisson L² control for normalized centered-factorial monomials.

Product-Poisson L² control for normalized centered-factorial monomials.

theorem centeredNormalizedPolynomial_eq_of_expansion

A pointwise normalized-coordinate expansion identifies the actual centered polynomial used by the factorial lift. This uses the stated r condition holds, and the stated exp condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon :
Q :
p :
S :
Finset (Cell →₀ ℕ)
coeff :
(Cell →₀ ℕ) → ℝ
hr :
∀ j, 0 < rectangleRadius Q j
hexp :
CenteredCoefficientExpansion epsilon Q p S coeff
= ∑ alpha ∈ S, monomial alpha (coeff alpha)
Proof (Lean source)
lemma centeredNormalizedPolynomial_eq_of_expansion (epsilon : ℝ) (Q : Rectangle) (p : MvPolynomial Cell ℝ) (S : Finset (Cell →₀ ℕ)) (coeff : (Cell →₀ ℕ) → ℝ) (hr : ∀ j, 0 < rectangleRadius Q j) (hexp : CenteredCoefficientExpansion epsilon Q p S coeff) : centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q)) = ∑ alpha ∈ S, monomial alpha (coeff alpha) := by apply MvPolynomial.funext intro y have h := hexp (fun j ↦ rectangleCenter Q j + rectangleRadius Q j * y j) change eval y (centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))) = _ unfold centeredNormalizedPolynomial rw [map_sub, MvPolynomial.eval_C] have heval : eval y (MvPolynomial.eval₂Hom C (fun j ↦ C (rectangleCenter Q j) + C (rectangleRadius Q j) * X j) p) = eval (fun j ↦ rectangleCenter Q j + rectangleRadius Q j * y j) p := by rw [MvPolynomial.map_eval₂Hom] apply MvPolynomial.eval₂Hom_congr · ext r simp · funext j simp · rfl rw [heval] simp only [map_sum, MvPolynomial.eval_monomial] rw [h] apply Finset.sum_congr rfl intro alpha halpha congr 1 have hj (j : Cell) : (rectangleCenter Q j + rectangleRadius Q j * y j - rectangleCenter Q j) / rectangleRadius Q j = y j := by field_simp [ne_of_gt (hr j)] ring simp_rw [hj] rw [alpha.prod_fintype _ (fun _ ↦ pow_zero _)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centeredNormalizedPolynomial_eq_of_expansion · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:13
theorem centeredNormalizedPolynomial_coeffL1_le_of_expansion

The coefficient envelope in a normalized pointwise expansion bounds the coefficient ℓ1 norm of the centered polynomial actually lifted by the estimator. This uses the stated r condition holds, and the stated exp condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon :
Q :
p :
S :
Finset (Cell →₀ ℕ)
coeff :
(Cell →₀ ℕ) → ℝ
hr :
∀ j, 0 < rectangleRadius Q j
hexp :
CenteredCoefficientExpansion epsilon Q p S coeff
≤ ∑ alpha ∈ S, |coeff alpha|
Proof (Lean source)
lemma centeredNormalizedPolynomial_coeffL1_le_of_expansion (epsilon : ℝ) (Q : Rectangle) (p : MvPolynomial Cell ℝ) (S : Finset (Cell →₀ ℕ)) (coeff : (Cell →₀ ℕ) → ℝ) (hr : ∀ j, 0 < rectangleRadius Q j) (hexp : CenteredCoefficientExpansion epsilon Q p S coeff) : ∑ alpha ∈ (centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support, |(centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).coeff alpha| ≤ ∑ alpha ∈ S, |coeff alpha| := by let centered := centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q)) have heq : centered = ∑ alpha ∈ S, monomial alpha (coeff alpha) := centeredNormalizedPolynomial_eq_of_expansion epsilon Q p S coeff hr hexp have hcoeff (alpha : Cell →₀ ℕ) : centered.coeff alpha = if alpha ∈ S then coeff alpha else 0 := by rw [heq] simp [MvPolynomial.coeff_sum] have hsupport : centered.support ⊆ S := by intro alpha halpha by_contra hnot have hzero : centered.coeff alpha = 0 := by simp [hcoeff, hnot] exact (centered.mem_support_iff.mp halpha) hzero calc ∑ alpha ∈ centered.support, |centered.coeff alpha| = ∑ alpha ∈ centered.support, |coeff alpha| := by apply Finset.sum_congr rfl intro alpha halpha rw [hcoeff, if_pos (hsupport halpha)] _ ≤ ∑ alpha ∈ S, |coeff alpha| := by exact Finset.sum_le_sum_of_subset_of_nonneg hsupport (fun alpha _halpha _hnot ↦ abs_nonneg (coeff alpha))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centeredNormalizedPolynomial_coeffL1_le_of_expansion · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:60
theorem jacksonCenteredNormalizedPolynomial_coeffL1_le Lemma 7 in the paper ↗

The chosen Jackson polynomial has the explicit normalized coefficient envelope needed by the factorial-risk calculation. This uses the overlap parameter satisfies its stated range restriction, and the approximation degree satisfies its stated restriction, and the potential-outcome law satisfies the stated causal restrictions, and the stated q0 condition holds, and the stated qr condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon :
hepsilon :
0 < epsilon
K :
hK :
2 ≤ K
Q :
hQ :
Q.Valid
hQ0 :
∀ j, 0 ≤ Q.1 j
hQr :
∀ j, 0 < rectangleRadius Q j
conclusion 1
≤ ((2 : ℝ) ^ 60) ^ K * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j
conclusion 2
alpha ∈ (centeredNormalizedPolynomial (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support :
j :
alpha j ≤ 2 * (K - 1)
Proof (Lean source)
lemma jacksonCenteredNormalizedPolynomial_coeffL1_le (epsilon : ℝ) (hepsilon : 0 < epsilon) (K : ℕ) (hK : 2 ≤ K) (Q : Rectangle) (hQ : Q.Valid) (hQ0 : ∀ j, 0 ≤ Q.1 j) (hQr : ∀ j, 0 < rectangleRadius Q j) : (∑ alpha ∈ (centeredNormalizedPolynomial (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support, |(centeredNormalizedPolynomial (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).coeff alpha| ≤ ((2 : ℝ) ^ 60) ^ K * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ∧ (∀ alpha ∈ (centeredNormalizedPolynomial (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support, ∀ j, alpha j ≤ 2 * (K - 1)) := by classical let data := choice (jacksonTensorPolynomialData_exists epsilon K hK Q hQ0 hepsilon hQr) have hp : jacksonTensorPolynomial epsilon K hK Q hQ hQ0 = data.p := by simp only [jacksonTensorPolynomial, dif_pos hepsilon, dif_pos hQr, data] let qCell : MvPolynomial Cell ℝ := MvPolynomial.rename cellFinFourEquiv.symm data.q let g : (Fin 4 →₀ ℕ) → (Cell →₀ ℕ) := Finsupp.mapDomain cellFinFourEquiv.symm have hexp : CenteredCoefficientExpansion epsilon Q (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (data.q.support.image g) qCell.coeff := by intro v rw [hp, data.physicalEval] change eval ((fun j => (v j - rectangleCenter Q j) / rectangleRadius Q j) ∘ cellFinFourEquiv.symm) data.q = _ rw [← MvPolynomial.eval_rename] change eval _ qCell = _ rw [MvPolynomial.eval_eq'] rw [show qCell.support = data.q.support.image g by exact MvPolynomial.support_rename_of_injective cellFinFourEquiv.symm.injective] constructor · refine (centeredNormalizedPolynomial_coeffL1_le_of_expansion epsilon Q _ _ _ hQr hexp).trans ?_ change (∑ alpha ∈ data.q.support.image g, |qCell.coeff alpha|) ≤ _ rw [Finset.sum_image (Finsupp.mapDomain_injective cellFinFourEquiv.symm.injective).injOn] simp only [qCell, MvPolynomial.coeff_rename_mapDomain, cellFinFourEquiv.symm.injective] change mvCoeffL1 data.q ≤ _ refine data.coefficientBound.trans ?_ have hpow : (2 : ℝ) ^ (40 * K + 20) ≤ ((2 : ℝ) ^ 60) ^ K := by rw [← pow_mul] exact_mod_cast Nat.pow_le_pow_right (n := 2) (by omega) (by omega : 40 * K + 20 ≤ 60 * K) gcongr exact sum_nonneg fun j _ => le_of_lt (hQr j) · have heq := centeredNormalizedPolynomial_eq_of_expansion epsilon Q _ _ _ hQr hexp intro alpha halpha j have halphaS : alpha ∈ data.q.support.image g := by by_contra hnot have hz : (centeredNormalizedPolynomial (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).coeff alpha = 0 := by rw [heq] simp [MvPolynomial.coeff_sum, hnot] exact (MvPolynomial.mem_support_iff.mp halpha) hz rw [mem_image] at halphaS obtain ⟨beta, hbeta, rfl⟩ := halphaS rw [Finsupp.mapDomain_equiv_apply] exact data.normalizedCoordinateDegree beta hbeta (cellFinFourEquiv j)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonCenteredNormalizedPolynomial_coeffL1_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:97

The tensor monomial obtained by multiplying normalized centered-factorial coordinates with the exponents in alpha.

Definition (Lean source)
m :
center radius :
Cell → ℝ
alpha :
Cell →₀ ℕ
eval :
Cell → ℕ
normalizedCenteredFactorialMonomial m center radius alpha eval :
∏ j : Cell, centeredFactorial m (alpha j) (eval j) (center j) / radius j ^ alpha j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.normalizedCenteredFactorialMonomial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:172
theorem normalizedCenteredFactorialMonomial_memLp_two

Every normalized centered-factorial tensor monomial is square-integrable under a product of scalar Poisson laws when all normalization radii are nonzero. This uses the stated r condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
q center radius :
Cell → ℝ
hr :
∀ j, 0 < radius j
alpha :
Cell →₀ ℕ
MemLp (normalizedCenteredFactorialMonomial m center radius alpha) 2 (Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal))
Proof (Lean source)
lemma normalizedCenteredFactorialMonomial_memLp_two (m : ℝ) (q center radius : Cell → ℝ) (hr : ∀ j, 0 < radius j) (alpha : Cell →₀ ℕ) : MemLp (normalizedCenteredFactorialMonomial m center radius alpha) 2 (Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal)) := by have hcoordInt (j : Cell) : Integrable (fun N : ℕ ↦ (centeredFactorial m (alpha j) N (center j) / radius j ^ alpha j) ^ 2) (poissonMeasure (m * q j).toNNReal) := by have hi := integrable_centeredFactorial_mul_poisson (m * q j).toNNReal m (center j) (alpha j) (alpha j) have hi' := hi.const_mul (1 / radius j ^ (2 * alpha j)) apply hi'.congr filter_upwards with N field_simp [ne_of_gt (hr j)] ring apply (memLp_two_iff_integrable_sq (by fun_prop)).2 have hprod := Integrable.fintype_prod hcoordInt convert hprod using 1 funext eval simp [normalizedCenteredFactorialMonomial, Finset.prod_pow]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.normalizedCenteredFactorialMonomial_memLp_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:180
theorem integral_sq_normalizedCenteredFactorialMonomial_le_exp

Coordinatewise Poisson noise-to-radius bounds tensorize: the normalized monomial's second moment is bounded by the exponential of the sum of squared coordinate degrees. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, and the stated r condition holds, and the centering parameters satisfy the stated bounds, and the intensity-to-center ratio satisfies the stated bound. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
q center radius :
Cell → ℝ
rho :
hm :
0 < m
hq :
∀ j, 0 ≤ q j
hr :
∀ j, 0 < radius j
hcenter :
∀ j, |q j - center j| ≤ radius j
hratio :
∀ j, q j / (m * radius j ^ 2) ≤ rho
alpha :
Cell →₀ ℕ
∫ eval : Cell → ℕ, normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal)
exp (rho * ∑ j : Cell, (alpha j : ℝ) ^ 2)
Proof (Lean source)
lemma integral_sq_normalizedCenteredFactorialMonomial_le_exp (m : ℝ) (q center radius : Cell → ℝ) (rho : ℝ) (hm : 0 < m) (hq : ∀ j, 0 ≤ q j) (hr : ∀ j, 0 < radius j) (hcenter : ∀ j, |q j - center j| ≤ radius j) (hratio : ∀ j, q j / (m * radius j ^ 2) ≤ rho) (alpha : Cell →₀ ℕ) : ∫ eval : Cell → ℕ, normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal) ≤ exp (rho * ∑ j : Cell, (alpha j : ℝ) ^ 2) := by have hcoordInt (j : Cell) : Integrable (fun N : ℕ ↦ (centeredFactorial m (alpha j) N (center j) / radius j ^ alpha j) ^ 2) (poissonMeasure (m * q j).toNNReal) := by have hi := integrable_centeredFactorial_mul_poisson (m * q j).toNNReal m (center j) (alpha j) (alpha j) have hi' := hi.const_mul (1 / radius j ^ (2 * alpha j)) apply hi'.congr filter_upwards with N field_simp [ne_of_gt (hr j)] ring rw [show (fun eval : Cell → ℕ ↦ normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2) = fun eval ↦ ∏ j : Cell, (centeredFactorial m (alpha j) (eval j) (center j) / radius j ^ alpha j) ^ 2 by funext eval simp [normalizedCenteredFactorialMonomial, Finset.prod_pow]] rw [MeasureTheory.integral_fintype_prod_eq_prod (fun j N ↦ (centeredFactorial m (alpha j) N (center j) / radius j ^ alpha j) ^ 2)] calc ∏ j : Cell, ∫ N : ℕ, (centeredFactorial m (alpha j) N (center j) / radius j ^ alpha j) ^ 2 ∂poissonMeasure (m * q j).toNNReal ≤ ∏ j : Cell, exp ((alpha j : ℝ) ^ 2 * rho) := by apply Finset.prod_le_prod · intro j _hj positivity · intro j _hj exact integral_sq_normalizedCenteredFactorial_le_exp m (q j) (center j) (radius j) rho hm (hq j) (hr j) (hcenter j) (hratio j) (alpha j) _ = exp (rho * ∑ j : Cell, (alpha j : ℝ) ^ 2) := by rw [← Real.exp_sum] congr 1 rw [← Finset.sum_mul] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_sq_normalizedCenteredFactorialMonomial_le_exp · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:204
theorem integral_sq_normalizedCenteredFactorialMonomial_le_exp_degree

If every coordinate degree is at most K, the four-coordinate tensor monomial has the uniform exponential second-moment bound used by the Jackson coefficient envelope. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, and the stated r condition holds, and the centering parameters satisfy the stated bounds, and the intensity-to-center ratio satisfies the stated bound, and the exponential-moment parameter is below one, and the multi-index degree satisfies the stated bound. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
q center radius :
Cell → ℝ
rho :
hm :
0 < m
hq :
∀ j, 0 ≤ q j
hr :
∀ j, 0 < radius j
hcenter :
∀ j, |q j - center j| ≤ radius j
hratio :
∀ j, q j / (m * radius j ^ 2) ≤ rho
hrho :
0 ≤ rho
alpha :
Cell →₀ ℕ
K :
hdegree :
∀ j, alpha j ≤ K
∫ eval : Cell → ℕ, normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal)
exp (4 * (K : ℝ) ^ 2 * rho)
Proof (Lean source)
lemma integral_sq_normalizedCenteredFactorialMonomial_le_exp_degree (m : ℝ) (q center radius : Cell → ℝ) (rho : ℝ) (hm : 0 < m) (hq : ∀ j, 0 ≤ q j) (hr : ∀ j, 0 < radius j) (hcenter : ∀ j, |q j - center j| ≤ radius j) (hratio : ∀ j, q j / (m * radius j ^ 2) ≤ rho) (hrho : 0 ≤ rho) (alpha : Cell →₀ ℕ) (K : ℕ) (hdegree : ∀ j, alpha j ≤ K) : ∫ eval : Cell → ℕ, normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal) ≤ exp (4 * (K : ℝ) ^ 2 * rho) := by refine (integral_sq_normalizedCenteredFactorialMonomial_le_exp m q center radius rho hm hq hr hcenter hratio alpha).trans ?_ apply Real.exp_le_exp.mpr have hsum : ∑ j : Cell, (alpha j : ℝ) ^ 2 ≤ 4 * (K : ℝ) ^ 2 := by calc ∑ j : Cell, (alpha j : ℝ) ^ 2 ≤ ∑ _j : Cell, (K : ℝ) ^ 2 := by apply Finset.sum_le_sum intro j _hj exact (sq_le_sq₀ (by positivity) (by positivity)).2 (by exact_mod_cast hdegree j) _ = 4 * (K : ℝ) ^ 2 := by norm_num [Cell] nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_sq_normalizedCenteredFactorialMonomial_le_exp_degree · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:257
theorem factorialPolynomialLift_sq_le_coeffL1

A centered polynomial lift inherits a product-Poisson L² bound from its normalized coefficient ℓ1 norm and a common coordinate-degree bound. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, and the stated r condition holds, and the centering parameters satisfy the stated bounds, and the intensity-to-center ratio satisfies the stated bound, and the exponential-moment parameter is below one, and the multi-index degree satisfies the stated bound. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
q center radius :
Cell → ℝ
rho :
hm :
0 < m
hq :
∀ j, 0 ≤ q j
hr :
∀ j, 0 < radius j
hcenter :
∀ j, |q j - center j| ≤ radius j
hratio :
∀ j, q j / (m * radius j ^ 2) ≤ rho
hrho :
0 ≤ rho
p :
centerValue :
K :
hdegree :
∀ alpha ∈ (centeredNormalizedPolynomial p center radius centerValue).support,
∀ j, alpha j ≤ K
∫ eval : Cell → ℕ, factorialPolynomialLift m p eval center radius centerValue ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal)
≤ (∑ alpha ∈ (centeredNormalizedPolynomial p center radius centerValue).support, |(centeredNormalizedPolynomial p center radius centerValue).coeff alpha|) ^ 2 * exp (4 * (K : ℝ) ^ 2 * rho)
Proof (Lean source)
lemma factorialPolynomialLift_sq_le_coeffL1 (m : ℝ) (q center radius : Cell → ℝ) (rho : ℝ) (hm : 0 < m) (hq : ∀ j, 0 ≤ q j) (hr : ∀ j, 0 < radius j) (hcenter : ∀ j, |q j - center j| ≤ radius j) (hratio : ∀ j, q j / (m * radius j ^ 2) ≤ rho) (hrho : 0 ≤ rho) (p : MvPolynomial Cell ℝ) (centerValue : ℝ) (K : ℕ) (hdegree : ∀ alpha ∈ (centeredNormalizedPolynomial p center radius centerValue).support, ∀ j, alpha j ≤ K) : ∫ eval : Cell → ℕ, factorialPolynomialLift m p eval center radius centerValue ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal) ≤ (∑ alpha ∈ (centeredNormalizedPolynomial p center radius centerValue).support, |(centeredNormalizedPolynomial p center radius centerValue).coeff alpha|) ^ 2 * exp (4 * (K : ℝ) ^ 2 * rho) := by let centered := centeredNormalizedPolynomial p center radius centerValue let mu := Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal) let R := exp (2 * (K : ℝ) ^ 2 * rho) have hR : 0 ≤ R := le_of_lt (Real.exp_pos _) have hbase := integral_sq_finset_sum_le_coeffL1 mu centered.support centered.coeff (fun alpha ↦ normalizedCenteredFactorialMonomial m center radius alpha) R hR (fun alpha _halpha ↦ normalizedCenteredFactorialMonomial_memLp_two m q center radius hr alpha) (fun alpha halpha ↦ by have h := integral_sq_normalizedCenteredFactorialMonomial_le_exp_degree m q center radius rho hm hq hr hcenter hratio hrho alpha K (hdegree alpha halpha) change (∫ eval : Cell → ℕ, normalizedCenteredFactorialMonomial m center radius alpha eval ^ 2 ∂Measure.pi (fun j : CellpoissonMeasure (m * q j).toNNReal)) ≤ R ^ 2 refine h.trans_eq ?_ dsimp [R] calc exp (4 * (K : ℝ) ^ 2 * rho) = exp (2 * (K : ℝ) ^ 2 * rho + 2 * (K : ℝ) ^ 2 * rho) := by congr 1 ring _ = exp (2 * (K : ℝ) ^ 2 * rho) ^ 2 := by rw [Real.exp_add] ring) have hRsq : R ^ 2 = exp (4 * (K : ℝ) ^ 2 * rho) := by dsimp [R] calc exp (2 * (K : ℝ) ^ 2 * rho) ^ 2 = exp (2 * (K : ℝ) ^ 2 * rho + 2 * (K : ℝ) ^ 2 * rho) := by rw [Real.exp_add] ring _ = exp (4 * (K : ℝ) ^ 2 * rho) := by congr 1 ring rw [hRsq] at hbase change (∫ eval : Cell → ℕ, factorialPolynomialLift m p eval center radius centerValue ^ 2 ∂mu) ≤ _ simpa only [factorialPolynomialLift, centered, mu, normalizedCenteredFactorialMonomial] using hbase
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.factorialPolynomialLift_sq_le_coeffL1 · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialProductRisk.lean:285
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.FactorialRisk 11 declarations Generic risk bounds and exact moments for centered factorial polynomials.

Generic risk bounds and exact moments for centered factorial polynomials.

Translate a polynomial to normalized coordinates around a center and subtract its value at that center.

Definition (Lean source)
p :
center radius :
Cell → ℝ
centerValue :
centeredNormalizedPolynomial p center radius centerValue :
MvPolynomial.eval₂Hom C (fun j => C (center j) + C (radius j) * X j) p
- C centerValue
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centeredNormalizedPolynomial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:15

Centered factorial lift of every monomial of a normalized polynomial.

Definition (Lean source)
m :
p :
eval :
Cell → ℕ
center radius :
Cell → ℝ
centerValue :
factorialPolynomialLift m p eval center radius centerValue :
centered :
centeredNormalizedPolynomial p center radius centerValue
∑ alpha ∈ centered.support, centered.coeff alpha * ∏ j : Cell, centeredFactorial m (alpha j) (eval j) (center j) / radius j ^ alpha j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.factorialPolynomialLift · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:24
theorem factorialPolynomialLift_expectation

Under independent Poisson coordinates, the centered factorial lift is unbiased for the original polynomial minus the declared center value. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, and the stated r condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
q center radius :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
hr :
∀ j, 0 < radius j
p :
centerValue :
∫ eval : Cell → ℕ, factorialPolynomialLift m p eval center radius centerValue ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)
= eval q p - centerValue
Proof (Lean source)
lemma factorialPolynomialLift_expectation (m : ℝ) (hm : 0 < m) (q center radius : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hr : ∀ j, 0 < radius j) (p : MvPolynomial Cell ℝ) (centerValue : ℝ) : ∫ eval : Cell → ℕ, factorialPolynomialLift m p eval center radius centerValue ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) = eval q p - centerValue := by let mu : Measure (Cell → ℕ) := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let centered := centeredNormalizedPolynomial p center radius centerValue have hcoordScalar (j : Cell) (h : ℕ) : Integrable (fun N : ℕ => centeredFactorial m h N (center j) / radius j ^ h) (poissonMeasure (m * q j).toNNReal) := by have hscalar : Integrable (fun N : ℕ => centeredFactorial m h N (center j)) (poissonMeasure (m * q j).toNNReal) := by simp only [centeredFactorial] apply integrable_finsetSum intro t _ht have hi := (integrable_fallingFactorial_poisson (m * q j).toNNReal t).const_mul ((Nat.choose h t : ℝ) * (-center j) ^ (h - t) / m ^ t) exact hi.congr (Filter.Eventually.of_forall fun N => by ring) exact hscalar.div_const _ have hprodInt (alpha : Cell →₀ ℕ) : Integrable (fun eval : Cell → ℕ => ∏ j : Cell, centeredFactorial m (alpha j) (eval j) (center j) / radius j ^ alpha j) mu := by exact Integrable.fintype_prod fun j => hcoordScalar j (alpha j) have hmonomial (alpha : Cell →₀ ℕ) : (∫ eval : Cell → ℕ, ∏ j : Cell, centeredFactorial m (alpha j) (eval j) (center j) / radius j ^ alpha j ∂mu) = ∏ j : Cell, ((q j - center j) / radius j) ^ alpha j := by dsimp [mu] rw [MeasureTheory.integral_fintype_prod_eq_prod (fun j N => centeredFactorial m (alpha j) N (center j) / radius j ^ alpha j)] apply Finset.prod_congr rfl intro j _hj rw [integral_div, integral_centeredFactorial_poisson m (q j) (center j) hm (hq j), div_pow] unfold factorialPolynomialLift dsimp only rw [integral_finsetSum] · apply trans (Finset.sum_congr rfl (fun alpha _ => by rw [integral_const_mul, hmonomial])) rw [← MvPolynomial.eval_eq'] change eval (fun j => (q j - center j) / radius j) centered = _ unfold centered centeredNormalizedPolynomial rw [map_sub, MvPolynomial.map_eval₂Hom] simp only [MvPolynomial.eval_C, MvPolynomial.eval_add, MvPolynomial.eval_mul, MvPolynomial.eval_X] congr 1 apply MvPolynomial.eval₂Hom_congr · ext r simp · funext j field_simp [ne_of_gt (hr j)] ring · rfl · intro alpha _halpha exact (hprodInt alpha).const_mul _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.factorialPolynomialLift_expectation · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:34
theorem chooseSqFactorialSum_le_exp Lemma chooseSqFactorialSum_le_exp in the paper ↗

The binomial-overlap sum occurring in a centered factorial second moment is bounded by its exponential generating function. This uses the exponential-moment parameter is below one. The displayed identity or bound is the asserted conclusion.

Formal statement
h :
rho :
hrho :
0 ≤ rho
(∑ l ∈ range (h + 1), (Nat.choose h l : ℝ) ^ 2 * factorial l * rho ^ l)
exp ((h : ℝ) ^ 2 * rho)
Proof (Lean source)
lemma chooseSqFactorialSum_le_exp (h : ℕ) (rho : ℝ) (hrho : 0 ≤ rho) : (∑ l ∈ range (h + 1), (Nat.choose h l : ℝ) ^ 2 * Nat.factorial l * rho ^ l) ≤ exp ((h : ℝ) ^ 2 * rho) := by refine (Finset.sum_le_sum ?_).trans (Real.sum_le_exp_of_nonneg (mul_nonneg (sq_nonneg _) hrho) (h + 1)) intro l hl have hc : (Nat.choose h l : ℝ) ≤ (h : ℝ) ^ l / (Nat.factorial l : ℝ) := Nat.choose_le_pow_div l h have hfac : 0 < (Nat.factorial l : ℝ) := by positivity have hchoose : 0 ≤ (Nat.choose h l : ℝ) := by positivity have hdiv : 0 ≤ (h : ℝ) ^ l / (Nat.factorial l : ℝ) := by positivity have hsq : (Nat.choose h l : ℝ) ^ 2 ≤ ((h : ℝ) ^ l / (Nat.factorial l : ℝ)) ^ 2 := (sq_le_sq₀ hchoose hdiv).2 hc have hbase : (Nat.choose h l : ℝ) ^ 2 * (Nat.factorial l : ℝ) ≤ ((h : ℝ) ^ 2) ^ l / (Nat.factorial l : ℝ) := by calc (Nat.choose h l : ℝ) ^ 2 * (Nat.factorial l : ℝ) ≤ ((h : ℝ) ^ l / (Nat.factorial l : ℝ)) ^ 2 * (Nat.factorial l : ℝ) := mul_le_mul_of_nonneg_right hsq (le_of_lt hfac) _ = ((h : ℝ) ^ 2) ^ l / (Nat.factorial l : ℝ) := by field_simp ring calc (Nat.choose h l : ℝ) ^ 2 * Nat.factorial l * rho ^ l ≤ (((h : ℝ) ^ 2) ^ l / (Nat.factorial l : ℝ)) * rho ^ l := mul_le_mul_of_nonneg_right hbase (pow_nonneg hrho _) _ = (((h : ℝ) ^ 2 * rho) ^ l) / (Nat.factorial l : ℝ) := by rw [mul_pow] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.chooseSqFactorialSum_le_exp · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:101
def clipAround

Clip a real number to the interval of radius t around c.

Definition (Lean source)
c t w :
clipAround c t w :
max (c - t) (min w (c + t))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.clipAround · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:137
theorem abs_clipAround_sub_center_le

Clipping around a center cannot increase distance from that center. This uses the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
c t w :
ht :
0 ≤ t
|clipAround c t w - c| ≤ |w - c|
Proof (Lean source)
lemma abs_clipAround_sub_center_le (c t w : ℝ) (ht : 0 ≤ t) : |clipAround c t w - c| ≤ |w - c| := by unfold clipAround by_cases hlo : w < c - t · have hmin : min w (c + t) = w := min_eq_left (by linarith) rw [hmin, max_eq_left (le_of_lt hlo)] rw [abs_of_nonpos (by linarith : c - t - c ≤ 0), abs_of_nonpos (by linarith : w - c ≤ 0)] linarith · have hlo_not : c - t ≤ w := le_of_not_gt hlo by_cases hhi : w ≤ c + t · rw [min_eq_left hhi, max_eq_right hlo_not] · have hhi_not : c + t < w := lt_of_not_ge hhi rw [min_eq_right (le_of_lt hhi_not), max_eq_right (by linarith)] rw [abs_of_nonneg (by linarith : 0 ≤ c + t - c), abs_of_nonneg (by linarith : 0 ≤ w - c)] linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.abs_clipAround_sub_center_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:140
theorem abs_clipAround_sub_center_le_radius Lemma abs_clipAround_sub_center_le_radius in the paper ↗

Clipping to the interval centered at c with nonnegative radius t stays within distance t of its center. This uses the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
c t w :
ht :
0 ≤ t
|clipAround c t w - c| ≤ t
Proof (Lean source)
lemma abs_clipAround_sub_center_le_radius (c t w : ℝ) (ht : 0 ≤ t) : |clipAround c t w - c| ≤ t := by unfold clipAround by_cases hlo : w < c - t · have hmin : min w (c + t) = w := min_eq_left (by linarith) rw [hmin, max_eq_left (le_of_lt hlo)] rw [abs_of_nonpos (by linarith)] linarith · have hlo_not : c - t ≤ w := le_of_not_gt hlo by_cases hhi : w ≤ c + t · rw [min_eq_left hhi, max_eq_right hlo_not] rw [abs_le] exact ⟨by linarith, by linarith⟩ · have hhi_not : c + t < w := lt_of_not_ge hhi rw [min_eq_right (le_of_lt hhi_not), max_eq_right (by linarith)] rw [abs_of_nonneg (by linarith)] linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.abs_clipAround_sub_center_le_radius · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:160
theorem abs_clipAround_sub_self_le_sq_div

The clipping displacement is controlled by squared distance divided by the radius. This uses the argument satisfies the stated support or positivity restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
c t w :
ht :
0 < t
|clipAround c t w - w| ≤ (w - c) ^ 2 / t
Proof (Lean source)
lemma abs_clipAround_sub_self_le_sq_div (c t w : ℝ) (ht : 0 < t) : |clipAround c t w - w| ≤ (w - c) ^ 2 / t := by unfold clipAround by_cases hlo : w < c - t · have hmin : min w (c + t) = w := min_eq_left (by linarith) rw [hmin, max_eq_left (le_of_lt hlo)] rw [abs_of_pos (by linarith : 0 < c - t - w)] apply (le_div_iff₀ ht).2 nlinarith [sq_nonneg (w - c + t)] · have hlo_not : c - t ≤ w := le_of_not_gt hlo by_cases hhi : w ≤ c + t · rw [min_eq_left hhi, max_eq_right hlo_not] simp only [sub_self, abs_zero] exact div_nonneg (sq_nonneg _) (le_of_lt ht) · have hhi_not : c + t < w := lt_of_not_ge hhi rw [min_eq_right (le_of_lt hhi_not), max_eq_right (by linarith)] rw [abs_of_neg (by linarith : c + t - w < 0)] apply (le_div_iff₀ ht).2 nlinarith [sq_nonneg (w - c - t)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.abs_clipAround_sub_self_le_sq_div · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:180
theorem integral_sq_finset_sum_le_coeffL1

A finite linear combination whose summands have a common bound is controlled by the coefficient ℓ₁ norm. This uses the stated r condition holds, and the stated x condition holds, and the stated x2 condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
Ω ι :
S :
a :
ι → ℝ
X :
ι → Ω → ℝ
R :
hR :
0 ≤ R
hX :
∀ i ∈ S, MemLp (X i) 2 μ
hX2 :
∀ i ∈ S, ∫ ω, (X i ω) ^ 2 ∂μ ≤ R ^ 2
∫ ω, (∑ i ∈ S, a i * X i ω) ^ 2 ∂μ ≤ (∑ i ∈ S, |a i|) ^ 2 * R ^ 2
Proof (Lean source)
lemma integral_sq_finset_sum_le_coeffL1 {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (S : Finset ι) (a : ι → ℝ) (X : ι → Ω → ℝ) (R : ℝ) (hR : 0 ≤ R) (hX : ∀ i ∈ S, MemLp (X i) 2 μ) (hX2 : ∀ i ∈ S, ∫ ω, (X i ω) ^ 2 ∂μ ≤ R ^ 2) : ∫ ω, (∑ i ∈ S, a i * X i ω) ^ 2 ∂μ ≤ (∑ i ∈ S, |a i|) ^ 2 * R ^ 2 := by classical let sgn : ι → ℝ := fun i => if 0 ≤ a i then 1 else -1 have ha (i : ι) : |a i| * sgn i = a i := by dsimp [sgn] split_ifs with h · rw [abs_of_nonneg h, mul_one] · rw [abs_of_neg (lt_of_not_ge h)] ring have hpoint (ω : Ω) : (∑ i ∈ S, a i * X i ω) ^ 2 ≤ (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * (X i ω) ^ 2 := by have hcs := weighted_inner_sq_le S (fun i => |a i|) (fun _ => 1) (fun i => sgn i * X i ω) (fun i _ => abs_nonneg (a i)) have hsgn (i : ι) : (sgn i) ^ 2 = 1 := by dsimp [sgn] split_ifs <;> norm_num calc (∑ i ∈ S, a i * X i ω) ^ 2 = (∑ i ∈ S, |a i| * (1 * (sgn i * X i ω))) ^ 2 := by congr 1 apply Finset.sum_congr rfl intro i hi rw [one_mul, ← mul_assoc, ha] _ ≤ (∑ i ∈ S, |a i| * 1 ^ 2) * ∑ i ∈ S, |a i| * (sgn i * X i ω) ^ 2 := hcs _ = (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * (X i ω) ^ 2 := by simp only [one_pow, mul_one, mul_pow, hsgn, one_mul] have hXi2 (i : ι) (hi : i ∈ S) : Integrable (fun ω => (X i ω) ^ 2) μ := by exact (memLp_two_iff_integrable_sq (hX i hi).1).mp (hX i hi) have hsumLp : MemLp (fun ω => ∑ i ∈ S, a i * X i ω) 2 μ := by exact memLp_finsetSum S fun i hi => (hX i hi).const_mul (a i) have hSum : Integrable (fun ω => (∑ i ∈ S, a i * X i ω) ^ 2) μ := by exact (memLp_two_iff_integrable_sq hsumLp.1).mp hsumLp have hRight : Integrable (fun ω => (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * (X i ω) ^ 2) μ := by apply Integrable.const_mul apply integrable_finsetSum intro i hi exact (hXi2 i hi).const_mul _ calc (∫ ω, (∑ i ∈ S, a i * X i ω) ^ 2 ∂μ) ≤ ∫ ω, (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * (X i ω) ^ 2 ∂μ := integral_mono hSum hRight hpoint _ = (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * ∫ ω, (X i ω) ^ 2 ∂μ := by rw [integral_const_mul, integral_finsetSum] · apply congrArg apply Finset.sum_congr rfl intro i hi rw [integral_const_mul] · intro i hi exact (hXi2 i hi).const_mul _ _ ≤ (∑ i ∈ S, |a i|) * ∑ i ∈ S, |a i| * R ^ 2 := by apply mul_le_mul_of_nonneg_left · apply Finset.sum_le_sum intro i hi exact mul_le_mul_of_nonneg_left (hX2 i hi) (abs_nonneg _) · exact sum_nonneg fun i _ => abs_nonneg _ _ = (∑ i ∈ S, |a i|) ^ 2 * R ^ 2 := by rw [← Finset.sum_mul] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_sq_finset_sum_le_coeffL1 · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:201
theorem integral_centeredFactorial_mul_poisson Lemma integral_centeredFactorial_mul_poisson in the paper ↗

If the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, then the stated integral centered factorial product poisson relation holds.

Formal statement
m q z :
hm :
0 < m
hq :
0 ≤ q
h t :
(∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂ProbabilityTheory.poissonMeasure (m * q).toNNReal)
= ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (q / m) ^ l * (q - z) ^ (h + t - 2 * l)
Proof (Lean source)
lemma integral_centeredFactorial_mul_poisson (m q z : ℝ) (hm : 0 < m) (hq : 0 ≤ q) (h t : ℕ) : (∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂ProbabilityTheory.poissonMeasure (m * q).toNNReal) = ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (q / m) ^ l * (q - z) ^ (h + t - 2 * l) := by rw [integral_centeredFactorial_mul_poisson_expanded] have hmq : 0 ≤ m * q := mul_nonneg (le_of_lt hm) hq simp only [Real.coe_toNNReal (m * q) hmq] simp_rw [Finset.mul_sum] change (∑ b ∈ range (t + 1), ∑ a ∈ range (h + 1), ∑ l ∈ range (min a b + 1), rawTerm m q z h t a b l) = _ exact rawMoment_collapse m q z (ne_of_gt hm) h t
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_centeredFactorial_mul_poisson · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:545
theorem integral_sq_normalizedCenteredFactorial_le_exp Lemma integral_sq_normalizedCenteredFactorial_le_exp in the paper ↗

If the true mean lies within radius r of the centering point and the Poisson noise-to-radius ratio is at most rho, the normalized centered factorial monomial has the exponential L² bound used by the Jackson lift. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions, and the stated r condition holds, and the stated z condition holds, and the intensity-to-center ratio satisfies the stated bound. The displayed identity or bound is the asserted conclusion.

Formal statement
m q z r rho :
hm :
0 < m
hq :
0 ≤ q
hr :
0 < r
hz :
|q - z| ≤ r
hratio :
q / (m * r ^ 2) ≤ rho
h :
(∫ N : ℕ, (centeredFactorial m h N z / r ^ h) ^ 2 ∂ProbabilityTheory.poissonMeasure (m * q).toNNReal)
exp ((h : ℝ) ^ 2 * rho)
Proof (Lean source)
lemma integral_sq_normalizedCenteredFactorial_le_exp (m q z r rho : ℝ) (hm : 0 < m) (hq : 0 ≤ q) (hr : 0 < r) (hz : |q - z| ≤ r) (hratio : q / (m * r ^ 2) ≤ rho) (h : ℕ) : (∫ N : ℕ, (centeredFactorial m h N z / r ^ h) ^ 2 ∂ProbabilityTheory.poissonMeasure (m * q).toNNReal) ≤ exp ((h : ℝ) ^ 2 * rho) := by have hrho : 0 ≤ rho := le_trans (by positivity : 0 ≤ q / (m * r ^ 2)) hratio have hnorm : |(q - z) / r| ≤ 1 := by rw [abs_div, abs_of_pos hr] exact (div_le_one hr).2 hz have hnormpow (l : ℕ) (hl : l ≤ h) : ((q - z) / r) ^ (2 * (h - l)) ≤ 1 := by have habs : |(q - z) / r| ^ (2 * (h - l)) ≤ 1 := pow_le_one₀ (abs_nonneg _) hnorm have hnonneg : 0 ≤ ((q - z) / r) ^ (2 * (h - l)) := by rw [pow_mul] positivity calc ((q - z) / r) ^ (2 * (h - l)) = |((q - z) / r) ^ (2 * (h - l))| := (abs_of_nonneg hnonneg).symm _ = |(q - z) / r| ^ (2 * (h - l)) := abs_pow _ _ _ ≤ 1 := habs rw [show (fun N : ℕ => (centeredFactorial m h N z / r ^ h) ^ 2) = fun N => (1 / r ^ (2 * h)) * (centeredFactorial m h N z * centeredFactorial m h N z) by funext N field_simp ring] rw [integral_const_mul, integral_centeredFactorial_mul_poisson m q z hm hq h h] rw [Finset.mul_sum] simp only [Nat.min_self] refine (Finset.sum_le_sum ?_).trans (chooseSqFactorialSum_le_exp h rho hrho) intro l hl have hlh : l ≤ h := by simp only [Finset.mem_range] at hl omega have hexp : h + h - 2 * l = 2 * (h - l) := by omega rw [hexp] have halg : 1 / r ^ (2 * h) * ((Nat.choose h l : ℝ) * Nat.choose h l * factorial l * (q / m) ^ l * (q - z) ^ (2 * (h - l))) = (Nat.choose h l : ℝ) ^ 2 * factorial l * (q / (m * r ^ 2)) ^ l * ((q - z) / r) ^ (2 * (h - l)) := by simp only [div_pow] field_simp [ne_of_gt hm, ne_of_gt hr] simp only [mul_pow, pow_mul] have hrpow : (r ^ 2) ^ l * (r ^ 2) ^ (h - l) = (r ^ 2) ^ h := by rw [← pow_add, Nat.add_sub_of_le hlh] rw [← hrpow] ring rw [halg] calc (Nat.choose h l : ℝ) ^ 2 * factorial l * (q / (m * r ^ 2)) ^ l * ((q - z) / r) ^ (2 * (h - l)) ≤ (Nat.choose h l : ℝ) ^ 2 * factorial l * (q / (m * r ^ 2)) ^ l := by have hcoefficient : 0 ≤ (Nat.choose h l : ℝ) ^ 2 * factorial l * (q / (m * r ^ 2)) ^ l := by positivity simpa only [mul_one] using mul_le_mul_of_nonneg_left (hnormpow l hlh) hcoefficient _ ≤ (Nat.choose h l : ℝ) ^ 2 * factorial l * rho ^ l := by gcongr
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.integral_sq_normalizedCenteredFactorial_le_exp · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FactorialRisk.lean:562
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.FinitePoissonHistogram 4 declarations Exact histogram law for an unmarked finite Poisson sample.

Exact histogram law for an unmarked finite Poisson sample.

Counts the observations assigned to each cell by a finite classifier.

Definition (Lean source)
X I :
cell :
X → I
s :
finitePoissonHistogram cell s :
I → ℕ
by classical exact fun j ↦ (Finset.univ.filter fun k ↦ cell (s.points k) = j).card
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.finitePoissonHistogram · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FinitePoissonHistogram.lean:12
theorem measurable_finitePoissonHistogram

If the stated cell condition holds, then the stated measurable finite poisson histogram relation holds.

Formal statement
Measurable (finitePoissonHistogram cell : FiniteSample X → I → ℕ)
Proof (Lean source)
@[fun_prop] lemma measurable_finitePoissonHistogram {X I : Type*} [MeasurableSpace X] [Countable X] [MeasurableSingletonClass X] [MeasurableSingletonClass (FiniteSample X)] [MeasurableSpace I] [Fintype I] [MeasurableSingletonClass I] (cell : X → I) (hcell : Measurable cell) : Measurable (finitePoissonHistogram cell : FiniteSample X → I → ℕ) := by exact measurable_of_countable _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_finitePoissonHistogram · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FinitePoissonHistogram.lean:20
theorem map_finitePoissonSampleLaw_finiteSampleMap_dense Lemma map_finitePoissonSampleLaw_finiteSampleMap_dense in the paper ↗

Mapping every point of a finite Poisson sample maps its base law. This uses the target function is continuous. The displayed identity or bound is the asserted conclusion.

Formal statement
f :
X → Y
hf :
lam :
Measure.map (finiteSampleMap f) (finitePoissonSampleLaw P lam)
= (letI : IsProbabilityMeasure (Measure.map f P) := Measure.isProbabilityMeasure_map hf.aemeasurable finitePoissonSampleLaw (Measure.map f P) lam)
Proof (Lean source)
lemma map_finitePoissonSampleLaw_finiteSampleMap_dense {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] (P : Measure X) [IsProbabilityMeasure P] (f : X → Y) (hf : Measurable f) (lam : NNReal) : Measure.map (finiteSampleMap f) (finitePoissonSampleLaw P lam) = (letI : IsProbabilityMeasure (Measure.map f P) := Measure.isProbabilityMeasure_map hf.aemeasurable finitePoissonSampleLaw (Measure.map f P) lam) := by letI : IsProbabilityMeasure (Measure.map f P) := Measure.isProbabilityMeasure_map hf.aemeasurable let F := finiteSampleMap f have hF : Measurable F := measurable_finiteSampleMap f hf let mu := Measure.map F (finitePoissonSampleLaw P lam) let nu := finitePoissonSampleLaw (Measure.map f P) lam have hrest (m : ℕ) : mu.restrict (FiniteSample.count ⁻¹' ({m} : Set ℕ)) = nu.restrict (FiniteSample.count ⁻¹' ({m} : Set ℕ)) := by rw [show mu = Measure.map F (finitePoissonSampleLaw P lam) by rfl, Measure.restrict_map hF (measurable_finiteSample_count (MeasurableSet.singleton m))] have hpre : F ⁻¹' (FiniteSample.count ⁻¹' ({m} : Set ℕ)) = FiniteSample.count ⁻¹' ({m} : Set ℕ) := by ext s; rfl rw [hpre, finitePoissonSampleLaw_restrict_count_eq, show nu = finitePoissonSampleLaw (Measure.map f P) lam by rfl, finitePoissonSampleLaw_restrict_count_eq, Measure.map_smul, Measure.map_map hF (measurable_fixedSizeEmbed m)] have hfun : F ∘ fixedSizeEmbed m = fixedSizeEmbed m ∘ (fun x : Fin m → X ↦ fun i ↦ f (x i)) := by funext x exact finiteSampleMap_fixedSizeEmbed f m x rw [hfun] congr 1 let G : (Fin m → X) → (Fin m → Y) := fun x i ↦ f (x i) have hG : Measurable G := measurable_pi_lambda _ fun i ↦ hf.comp (measurable_pi_apply i) change Measure.map (fixedSizeEmbed m ∘ G) (Measure.pi fun _ : Fin m ↦ P) = _ calc Measure.map (fixedSizeEmbed m ∘ G) (Measure.pi fun _ : Fin m ↦ P) = Measure.map (fixedSizeEmbed m) (Measure.map G (Measure.pi fun _ : Fin m ↦ P)) := (Measure.map_map (measurable_fixedSizeEmbed m) hG).symm _ = Measure.map (fixedSizeEmbed m) (Measure.pi fun _ : Fin m ↦ Measure.map f P) := by rw [show G = (fun x i ↦ f (x i)) by rfl, Measure.pi_map_pi (fun _ ↦ hf.aemeasurable)] have hdecomp (eta : Measure (FiniteSample Y)) : eta = Measure.sum (fun m ↦ eta.restrict (FiniteSample.count ⁻¹' ({m} : Set ℕ))) := by have hdis : Pairwise (onFun Disjoint (fun m : ℕ ↦ (FiniteSample.count : FiniteSample Y → ℕ) ⁻¹' ({m} : Set ℕ))) := by intro i j hij apply Set.disjoint_left.2 intro s hi hj apply hij simpa using hi.symm.trans hj have hcover : ⋃ m : ℕ, (FiniteSample.count : FiniteSample Y → ℕ) ⁻¹' ({m} : Set ℕ) = univ := by ext s; simp calc eta = eta.restrict univ := by rw [Measure.restrict_univ] _ = eta.restrict (⋃ m : ℕ, FiniteSample.count ⁻¹' ({m} : Set ℕ)) := by rw [hcover] _ = Measure.sum (fun m ↦ eta.restrict (FiniteSample.count ⁻¹' ({m} : Set ℕ))) := by exact Measure.restrict_iUnion hdis (fun m ↦ measurable_finiteSample_count (MeasurableSet.singleton m)) change mu = nu rw [hdecomp mu, hdecomp nu] congr 1 funext m exact hrest m
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.map_finitePoissonSampleLaw_finiteSampleMap_dense · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FinitePoissonHistogram.lean:32
theorem finitePoissonHistogram_law

A measurable finite classifier turns a Poisson sample into independent Poisson cell counts with the corresponding thinned means. This uses the stated cell condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
= Measure.pi (fun j : I ↦ poissonMeasure (lam * (P (cell ⁻¹' {j})).toNNReal))
Proof (Lean source)
lemma finitePoissonHistogram_law {X I : Type*} [MeasurableSpace X] [StandardBorelSpace X] [Countable X] [MeasurableSingletonClass X] [MeasurableSingletonClass (FiniteSample X)] [MeasurableSpace I] [Fintype I] [MeasurableSingletonClass I] (P : Measure X) [IsProbabilityMeasure P] (cell : X → I) (hcell : Measurable cell) (lam : NNReal) : Measure.map (finitePoissonHistogram cell) (finitePoissonSampleLaw P lam) = Measure.pi (fun j : I ↦ poissonMeasure (lam * (P (cell ⁻¹' {j})).toNNReal)) := by let p : FiniteMeasurablePartition X I := ⟨cell, hcell⟩ let R : Measure ℝ := Measure.dirac 0 let countFamily : (I → FiniteSample (X × ℝ)) → I → ℕ := fun q j ↦ (q j).count have hcountFamily : Measurable countFamily := measurable_pi_lambda _ fun j ↦ measurable_finiteSample_count.comp (measurable_pi_apply j) have hmarked : Measure.map (fun s : FiniteSample (X × ℝ) ↦ fun j ↦ (p.restrictCell j s).count) (finiteMarkedPoissonSampleLaw P R lam) = Measure.pi (fun j : I ↦ poissonMeasure (lam * p.cellMass P j)) := by calc _ = Measure.map countFamily (Measure.map p.restrictPartition (finiteMarkedPoissonSampleLaw P R lam)) := by rw [Measure.map_map hcountFamily p.measurable_restrictPartition] rfl _ = Measure.map countFamily (Measure.pi (fun j : I ↦ finiteMarkedPoissonSampleLaw (p.cellObservationLaw P j) R (lam * p.cellMass P j))) := by rw [p.map_restrictPartition_finiteMarkedPoissonSampleLaw] _ = Measure.pi (fun j : I ↦ Measure.map FiniteSample.count (finiteMarkedPoissonSampleLaw (p.cellObservationLaw P j) R (lam * p.cellMass P j))) := by exact Measure.pi_map_pi (fun _ ↦ measurable_finiteSample_count.aemeasurable) _ = Measure.pi (fun j : I ↦ poissonMeasure (lam * p.cellMass P j)) := by congr with j rw [finiteMarkedPoissonSampleLaw_map_count] have herase := map_finitePoissonSampleLaw_finiteSampleMap_dense (P.prod (Measure.dirac (0 : ℝ))) Prod.fst measurable_fst lam have hprod : Measure.map Prod.fst (P.prod (Measure.dirac (0 : ℝ))) = P := by rw [Measure.map_fst_prod, measure_univ, one_smul] have herase' : Measure.map (finiteSampleMap Prod.fst) (finitePoissonSampleLaw (P.prod (Measure.dirac (0 : ℝ))) lam) = finitePoissonSampleLaw P lam := by simpa only [hprod] using herase have hcounts (s : FiniteSample (X × ℝ)) : (fun j ↦ (p.restrictCell j s).count) = finitePoissonHistogram cell (finiteSampleMap Prod.fst s) := by classical funext j rcases s with ⟨m, points⟩ unfold FiniteMeasurablePartition.restrictCell finitePoissonHistogram FiniteMeasurablePartition.cellIndices simp only [FiniteSample.count, finiteSampleMap, FiniteSample.points] apply congrArg card ext k rw [show p.cell = cell by rfl] constructor <;> intro hk · exact Finset.mem_filter.2 ⟨Finset.mem_univ _, (Finset.mem_filter.1 hk).2⟩ · exact Finset.mem_filter.2 ⟨Finset.mem_univ _, (Finset.mem_filter.1 hk).2⟩ change _ = Measure.pi (fun j : I ↦ poissonMeasure (lam * p.cellMass P j)) rw [← hmarked, ← herase', show finiteMarkedPoissonSampleLaw P (Measure.dirac (0 : ℝ)) lam = finitePoissonSampleLaw (P.prod (Measure.dirac (0 : ℝ))) lam by rfl, Measure.map_map (measurable_finitePoissonHistogram cell hcell) (measurable_finiteSampleMap Prod.fst measurable_fst)] simpa [Function.comp_def] using congrArg (fun f : FiniteSample (X × ℝ) → I → ℕ ↦ Measure.map f (finitePoissonSampleLaw (P.prod (Measure.dirac (0 : ℝ))) lam)) (funext hcounts) |>.symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.finitePoissonHistogram_law · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/FinitePoissonHistogram.lean:108
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.GlobalLipschitz 12 declarations

For the specified first cell vector, second cell vector, the cellwise L1 distance is the sum of absolute coordinate differences across the four cells.

Definition (Lean source)
u v :
Cell → ℝ
l1CellDistance u v :
∑ j, |u j - v j|
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1CellDistance · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:6

If the overlap parameter satisfies its stated range restriction, and the stated u condition holds, then the stated arm cell value bounds relation holds.

Formal statement
epsilon :
hepsilon :
0 < epsilon
u :
Cell → ℝ
hu :
∀ j, 0 ≤ u j
a :
Fin 2
conclusion 1
0 ≤ armCellValue epsilon a u
conclusion 2
armCellValue epsilon a u ≤ vectorMass u
Proof (Lean source)
lemma armCellValue_bounds {epsilon : ℝ} (hepsilon : 0 < epsilon) (u : Cell → ℝ) (hu : ∀ j, 0 ≤ u j) (a : Fin 2) : 0 ≤ armCellValue epsilon a u ∧ armCellValue epsilon a u ≤ vectorMass u := by have hArm : 0 ≤ vectorArmMass u a := by exact add_nonneg (hu (a, 0)) (hu (a, 1)) have hz : 0 ≤ u (a, 1) := hu _ have hzle : u (a, 1) ≤ vectorArmMass u a := by simp [vectorArmMass] exact hu (a, 0) have hMass : 0 ≤ vectorMass u := by unfold vectorMass exact add_nonneg (add_nonneg (hu (0, 0)) (hu (0, 1))) (add_nonneg (hu (1, 0)) (hu (1, 1))) by_cases hzero : vectorMass u = 0 · simp [armCellValue, hzero] · have hMassPos : 0 < vectorMass u := lt_of_le_of_ne hMass (Ne.symm hzero) have hden : 0 < max (vectorArmMass u a) (epsilon * vectorMass u) := lt_of_lt_of_le (mul_pos hepsilon hMassPos) (le_max_right _ _) rw [armCellValue, if_neg hzero] constructor · positivity · rw [div_le_iff₀ hden] exact mul_le_mul_of_nonneg_left (hzle.trans (le_max_left _ _)) hMass
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armCellValue_bounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:10

If the overlap parameter satisfies its stated range restriction, and the stated u condition holds, then the stated global cell value bounds relation holds.

Formal statement
epsilon :
hepsilon :
0 < epsilon
u :
Cell → ℝ
hu :
∀ j, 0 ≤ u j
conclusion 1
0 ≤ globalCellValue epsilon u
conclusion 2
globalCellValue epsilon u ≤ vectorMass u
Proof (Lean source)
lemma globalCellValue_bounds {epsilon : ℝ} (hepsilon : 0 < epsilon) (u : Cell → ℝ) (hu : ∀ j, 0 ≤ u j) : 0 ≤ globalCellValue epsilon u ∧ globalCellValue epsilon u ≤ vectorMass u := by have h0 := armCellValue_bounds hepsilon u hu 0 have h1 := armCellValue_bounds hepsilon u hu 1 exact ⟨h0.1.trans (le_max_left _ _), max_le h0.2 h1.2⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.globalCellValue_bounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:38

If the target function is continuous, and the stated z condition holds, and the stated f' condition holds, and the stated z' condition holds, and the argument satisfies the stated support or positivity restriction, and the stated t' condition holds, then the stated unit ratio diff bound relation holds.

Formal statement
f z f' z' :
hf :
0 ≤ f
hz :
0 ≤ z
hf' :
0 ≤ f'
hz' :
0 ≤ z'
ht :
0 < f + z
ht' :
0 < f' + z'
|z / (f + z) - z' / (f' + z')| ≤ (|z - z'| + |f - f'|) / (f + z)
Proof (Lean source)
lemma unitRatio_diff_bound (f z f' z' : ℝ) (hf : 0 ≤ f) (hz : 0 ≤ z) (hf' : 0 ≤ f') (hz' : 0 ≤ z') (ht : 0 < f + z) (ht' : 0 < f' + z') : |z / (f + z) - z' / (f' + z')| ≤ (|z - z'| + |f - f'|) / (f + z) := by have hiden : z / (f + z) - z' / (f' + z') = (f' * (z - z') + z' * (f' - f)) / ((f + z) * (f' + z')) := by field_simp ring rw [hiden, abs_div, abs_mul, abs_of_pos ht, abs_of_pos ht'] have hden : 0 < (f + z) * (f' + z') := mul_pos ht ht' calc |f' * (z - z') + z' * (f' - f)| / ((f + z) * (f' + z')) ≤ (f' * |z - z'| + z' * |f - f'|) / ((f + z) * (f' + z')) := by gcongr calc |f' * (z - z') + z' * (f' - f)| ≤ |f' * (z - z')| + |z' * (f' - f)| := abs_add_le _ _ _ = f' * |z - z'| + z' * |f - f'| := by rw [abs_mul, abs_mul, abs_of_nonneg hf', abs_of_nonneg hz', abs_sub_comm f' f] _ ≤ ((f' + z') * (|z - z'| + |f - f'|)) / ((f + z) * (f' + z')) := by gcongr nlinarith [abs_nonneg (z - z'), abs_nonneg (f - f')] _ = (|z - z'| + |f - f'|) / (f + z) := by field_simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.unitRatio_diff_bound · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:47

For the specified overlap level, first failure mass, data point or sample, third cell mass, smaller alphabet size, the scalar arm value is zero at zero total mass and otherwise equals total mass times the success-cell mass divided by the larger of arm mass and overlap-truncated total mass.

Definition (Lean source)
epsilon f z r s :
scalarArmValue epsilon f z r s :
S :
f + z + r + s
if S = 0 then 0 else S * z / max (f + z) (epsilon * S)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scalarArmValue · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:76
theorem scalarArmValue_of_low

If the overlap parameter satisfies its stated range restriction, and the stated s condition holds, and the stated low condition holds, then the stated scalar arm value of low relation holds.

Formal statement
epsilon f z r s :
hepsilon :
0 < epsilon
hS :
0 < f + z + r + s
hlow :
f + z ≤ epsilon * (f + z + r + s)
scalarArmValue epsilon f z r s = z / epsilon
Proof (Lean source)
lemma scalarArmValue_of_low {epsilon f z r s : ℝ} (hepsilon : 0 < epsilon) (hS : 0 < f + z + r + s) (hlow : f + z ≤ epsilon * (f + z + r + s)) : scalarArmValue epsilon f z r s = z / epsilon := by rw [scalarArmValue, if_neg (ne_of_gt hS), max_eq_right hlow] field_simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scalarArmValue_of_low · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:82
theorem scalarArmValue_of_high

If the stated s condition holds, and the stated high condition holds, then the stated scalar arm value of high relation holds.

Formal statement
epsilon f z r s :
hS :
0 < f + z + r + s
hhigh :
epsilon * (f + z + r + s) ≤ f + z
scalarArmValue epsilon f z r s = (f + z + r + s) * (z / (f + z))
Proof (Lean source)
lemma scalarArmValue_of_high {epsilon f z r s : ℝ} (hS : 0 < f + z + r + s) (hhigh : epsilon * (f + z + r + s) ≤ f + z) : scalarArmValue epsilon f z r s = (f + z + r + s) * (z / (f + z)) := by rw [scalarArmValue, if_neg (ne_of_gt hS), max_eq_left hhigh] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scalarArmValue_of_high · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:90
theorem scalarArmValue_lipschitz_of_pos

If the overlap parameter satisfies its stated range restriction, and the target function is continuous, and the stated z condition holds, and the stated r condition holds, and the stated support condition holds, and the stated f' condition holds, and the stated z' condition holds, and the stated r' condition holds, and the stated s' condition holds, and the stated s condition holds, and the stated s' condition holds, then the stated scalar arm value lipschitz of pos relation holds.

Formal statement
epsilon :
hepsilon :
0 < epsilon
f z r s f' z' r' s' :
hf :
0 ≤ f
hz :
0 ≤ z
hr :
0 ≤ r
hs :
0 ≤ s
hf' :
0 ≤ f'
hz' :
0 ≤ z'
hr' :
0 ≤ r'
hs' :
0 ≤ s'
hS :
0 < f + z + r + s
hS' :
0 < f' + z' + r' + s'
|scalarArmValue epsilon f z r s - scalarArmValue epsilon f' z' r' s'|
≤ (1 + epsilon⁻¹) * (|f - f'| + |z - z'| + |r - r'| + |s - s'|)
Proof (Lean source)
lemma scalarArmValue_lipschitz_of_pos {epsilon : ℝ} (hepsilon : 0 < epsilon) (f z r s f' z' r' s' : ℝ) (hf : 0 ≤ f) (hz : 0 ≤ z) (hr : 0 ≤ r) (hs : 0 ≤ s) (hf' : 0 ≤ f') (hz' : 0 ≤ z') (hr' : 0 ≤ r') (hs' : 0 ≤ s') (hS : 0 < f + z + r + s) (hS' : 0 < f' + z' + r' + s') : |scalarArmValue epsilon f z r s - scalarArmValue epsilon f' z' r' s'| ≤ (1 + epsilon⁻¹) * (|f - f'| + |z - z'| + |r - r'| + |s - s'|) := by let S := f + z + r + s let S' := f' + z' + r' + s' let D := |f - f'| + |z - z'| + |r - r'| + |s - s'| have hD : 0 ≤ D := by dsimp [D] positivity have hmass : |S - S'| ≤ D := by dsimp [S, S', D] calc |(f + z + r + s) - (f' + z' + r' + s')| = |(f - f') + (z - z') + (r - r') + (s - s')| := by ring_nf _ ≤ |f - f'| + |z - z'| + |r - r'| + |s - s'| := by calc |(f - f') + (z - z') + (r - r') + (s - s')| ≤ |(f - f') + (z - z') + (r - r')| + |s - s'| := abs_add_le _ _ _ ≤ (|(f - f') + (z - z')| + |r - r'|) + |s - s'| := by gcongr exact abs_add_le _ _ _ ≤ |f - f'| + |z - z'| + |r - r'| + |s - s'| := by gcongr exact abs_add_le _ _ have harm : |z - z'| + |f - f'| ≤ D := by dsimp [D] nlinarith [abs_nonneg (r - r'), abs_nonneg (s - s')] have hfd : |f - f'| ≤ D := by apply le_trans (show |f - f'| ≤ |z - z'| + |f - f'| by nlinarith [abs_nonneg (z - z')]) harm have hzD : |z - z'| ≤ D := by apply le_trans (show |z - z'| ≤ |z - z'| + |f - f'| by nlinarith [abs_nonneg (f - f')]) harm have hinv : 0 < epsilon⁻¹ := inv_pos.mpr hepsilon have heinv : epsilon * epsilon⁻¹ = 1 := mul_inv_cancel₀ (ne_of_gt hepsilon) have hcoef : 0 ≤ 1 + epsilon⁻¹ := by positivity by_cases hu : f + z ≤ epsilon * S · rw [scalarArmValue_of_low hepsilon hS (by simpa [S] using hu)] by_cases hv : f' + z' ≤ epsilon * S' · rw [scalarArmValue_of_low hepsilon hS' (by simpa [S'] using hv)] rw [← sub_div, abs_div, abs_of_pos hepsilon] calc |z - z'| / epsilon ≤ epsilon⁻¹ * D := by rw [div_eq_inv_mul] exact mul_le_mul_of_nonneg_left hzD (le_of_lt hinv) _ ≤ (1 + epsilon⁻¹) * D := by exact mul_le_mul_of_nonneg_right (by linarith) hD · have hv' : epsilon * S' ≤ f' + z' := le_of_not_ge hv rw [scalarArmValue_of_high hS' (by simpa [S'] using hv')] have ht' : 0 < f' + z' := lt_of_lt_of_le (mul_pos hepsilon hS') hv' have hratio : 0 ≤ z' / (f' + z') ∧ z' / (f' + z') ≤ 1 := by constructor · positivity · exact (div_le_one ht').2 (by linarith) have hgap : 0 ≤ (f' + z') - epsilon * S' := by linarith have hid : z / epsilon - S' * (z' / (f' + z')) = (z - z') / epsilon + (z' / (f' + z')) * (((f' + z') - epsilon * S') / epsilon) := by field_simp ring rw [hid, abs_le] constructor · have hlower : -(1 + epsilon⁻¹) * D ≤ (z - z') / epsilon := by rw [div_eq_inv_mul] have hzabs := neg_abs_le (z - z') dsimp [D] at * nlinarith [abs_nonneg (f - f'), abs_nonneg (r - r'), abs_nonneg (s - s')] have hsecond : 0 ≤ (z' / (f' + z')) * (((f' + z') - epsilon * S') / epsilon) := by positivity linarith · have hgap_le : (f' + z') - epsilon * S' ≤ ((f' + z') - (f + z)) - epsilon * (S' - S) := by linarith have hsecond_le : (z' / (f' + z')) * (((f' + z') - epsilon * S') / epsilon) ≤ (((f' + z') - epsilon * S') / epsilon) := by exact mul_le_of_le_one_left (by positivity) hratio.2 have hraw : (z - z') / epsilon + (((f' + z') - epsilon * S') / epsilon) ≤ (f' - f - epsilon * (S' - S)) / epsilon := by rw [← add_div, div_le_div_iff_of_pos_right hepsilon] linarith have hbound : (f' - f - epsilon * (S' - S)) / epsilon ≤ (1 + epsilon⁻¹) * D := by have hrewrite : (f' - f - epsilon * (S' - S)) / epsilon = epsilon⁻¹ * (f' - f) - (S' - S) := by field_simp rw [hrewrite] have hff := le_abs_self (f' - f) have hm : -(S' - S) ≤ D := by calc -(S' - S) ≤ |S' - S| := neg_le_abs _ _ = |S - S'| := abs_sub_comm _ _ _ ≤ D := hmass rw [abs_sub_comm f' f] at hff have hmul := mul_le_mul_of_nonneg_left hff (le_of_lt hinv) nlinarith linarith · have hu' : epsilon * S ≤ f + z := le_of_not_ge hu rw [scalarArmValue_of_high hS (by simpa [S] using hu')] by_cases hv : f' + z' ≤ epsilon * S' · rw [scalarArmValue_of_low hepsilon hS' (by simpa [S'] using hv)] have ht : 0 < f + z := lt_of_lt_of_le (mul_pos hepsilon hS) hu' have hratio : 0 ≤ z / (f + z) ∧ z / (f + z) ≤ 1 := by constructor · positivity · exact (div_le_one ht).2 (by linarith) have hgap : 0 ≤ (f + z) - epsilon * S := by linarith have hid : S * (z / (f + z)) - z' / epsilon = (z - z') / epsilon - (z / (f + z)) * (((f + z) - epsilon * S) / epsilon) := by field_simp ring rw [hid, abs_le] constructor · have hgap_le : (f + z) - epsilon * S ≤ ((f + z) - (f' + z')) - epsilon * (S - S') := by linarith have hsecond_le : (z / (f + z)) * (((f + z) - epsilon * S) / epsilon) ≤ (((f + z) - epsilon * S) / epsilon) := by exact mul_le_of_le_one_left (by positivity) hratio.2 have hraw : (f' - f + epsilon * (S - S')) / epsilon ≤ (z - z') / epsilon - (((f + z) - epsilon * S) / epsilon) := by rw [← sub_div, div_le_div_iff_of_pos_right hepsilon] linarith have hbound : -(1 + epsilon⁻¹) * D ≤ (f' - f + epsilon * (S - S')) / epsilon := by have hrewrite : (f' - f + epsilon * (S - S')) / epsilon = epsilon⁻¹ * (f' - f) + (S - S') := by field_simp rw [hrewrite] have hff := neg_abs_le (f' - f) rw [abs_sub_comm f' f] at hff have hm : -D ≤ S - S' := by calc -D ≤ -|S - S'| := neg_le_neg hmass _ ≤ S - S' := neg_abs_le _ have hmul := mul_le_mul_of_nonneg_left hff (le_of_lt hinv) nlinarith linarith · have hupper : (z - z') / epsilon ≤ (1 + epsilon⁻¹) * D := by rw [div_eq_inv_mul] have hzabs := le_trans (le_abs_self (z - z')) hzD have hmul := mul_le_mul_of_nonneg_left hzabs (le_of_lt hinv) exact hmul.trans (mul_le_mul_of_nonneg_right (by linarith) hD) have hsecond : 0 ≤ (z / (f + z)) * (((f + z) - epsilon * S) / epsilon) := by positivity linarith · have hv' : epsilon * S' ≤ f' + z' := le_of_not_ge hv rw [scalarArmValue_of_high hS' (by simpa [S'] using hv')] have ht : 0 < f + z := lt_of_lt_of_le (mul_pos hepsilon hS) hu' have ht' : 0 < f' + z' := lt_of_lt_of_le (mul_pos hepsilon hS') hv' have hratio' : 0 ≤ z' / (f' + z') ∧ z' / (f' + z') ≤ 1 := by constructor · positivity · exact (div_le_one ht').2 (by linarith) have hratioDiff := unitRatio_diff_bound f z f' z' hf hz hf' hz' ht ht' have hid : S * (z / (f + z)) - S' * (z' / (f' + z')) = (S - S') * (z' / (f' + z')) + S * (z / (f + z) - z' / (f' + z')) := by ring rw [hid] calc |(S - S') * (z' / (f' + z')) + S * (z / (f + z) - z' / (f' + z'))| ≤ |S - S'| * (z' / (f' + z')) + S * |z / (f + z) - z' / (f' + z')| := by calc _ ≤ |(S - S') * (z' / (f' + z'))| + |S * (z / (f + z) - z' / (f' + z'))| := abs_add_le _ _ _ = _ := by rw [abs_mul, abs_mul, abs_of_nonneg hratio'.1, abs_of_pos hS] _ ≤ |S - S'| + S * ((|z - z'| + |f - f'|) / (f + z)) := by apply add_le_add · exact mul_le_of_le_one_right (abs_nonneg _) hratio'.2 · exact mul_le_mul_of_nonneg_left hratioDiff (le_of_lt hS) _ ≤ D + epsilon⁻¹ * (|z - z'| + |f - f'|) := by have hSt : S / (f + z) ≤ epsilon⁻¹ := by calc S / (f + z) ≤ ((f + z) / epsilon) / (f + z) := by gcongr exact (le_div_iff₀ hepsilon).2 (by simpa [mul_comm] using hu') _ = epsilon⁻¹ := by field_simp have hmul : S * ((|z - z'| + |f - f'|) / (f + z)) = (S / (f + z)) * (|z - z'| + |f - f'|) := by ring rw [hmul] exact add_le_add hmass (mul_le_mul_of_nonneg_right hSt (by positivity)) _ ≤ D + epsilon⁻¹ * D := by gcongr _ = (1 + epsilon⁻¹) * D := by ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.scalarArmValue_lipschitz_of_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:98
theorem cell_eq_zero_of_vectorMass_eq_zero Lemma cell_eq_zero_of_vectorMass_eq_zero in the paper ↗

If the stated u condition holds, and the stated mass condition holds, then a nonnegative cell vector with zero total mass vanishes in every coordinate.

Formal statement
u :
Cell → ℝ
hu :
∀ j, 0 ≤ u j
hmass :
j :
u j = 0
Proof (Lean source)
lemma cell_eq_zero_of_vectorMass_eq_zero (u : Cell → ℝ) (hu : ∀ j, 0 ≤ u j) (hmass : vectorMass u = 0) : ∀ j, u j = 0 := by rintro ⟨a, y⟩ fin_cases a <;> fin_cases y <;> simp [vectorMass, vectorArmMass] at hmass ⊢ <;> nlinarith [hu (0, 0), hu (0, 1), hu (1, 0), hu (1, 1)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cell_eq_zero_of_vectorMass_eq_zero · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:292
theorem l1CellDistance_zero_left

If the stated u condition holds, and the stated v condition holds, then the stated l1 cell distance zero left relation holds.

Formal statement
u v :
Cell → ℝ
hu :
∀ j, u j = 0
hv :
∀ j, 0 ≤ v j
Proof (Lean source)
lemma l1CellDistance_zero_left (u v : Cell → ℝ) (hu : ∀ j, u j = 0) (hv : ∀ j, 0 ≤ v j) : l1CellDistance u v = vectorMass v := by simp only [l1CellDistance, Fintype.sum_prod_type, hu, zero_sub, abs_neg, vectorMass, vectorArmMass, Fin.sum_univ_two] rw [abs_of_nonneg (hv (0, 0)), abs_of_nonneg (hv (0, 1)), abs_of_nonneg (hv (1, 0)), abs_of_nonneg (hv (1, 1))]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1CellDistance_zero_left · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:301
theorem armCellValue_lipschitz

If the overlap parameter satisfies its stated range restriction, and the stated u condition holds, and the stated v condition holds, then arm value is Lipschitz in cellwise L1 distance with constant 1+1/epsilon1+1/epsilon.

Formal statement
epsilon :
hepsilon :
0 < epsilon
u v :
Cell → ℝ
hu :
∀ j, 0 ≤ u j
hv :
∀ j, 0 ≤ v j
a :
Fin 2
|armCellValue epsilon a u - armCellValue epsilon a v|
≤ (1 + epsilon⁻¹) * l1CellDistance u v
Proof (Lean source)
lemma armCellValue_lipschitz {epsilon : ℝ} (hepsilon : 0 < epsilon) (u v : Cell → ℝ) (hu : ∀ j, 0 ≤ u j) (hv : ∀ j, 0 ≤ v j) (a : Fin 2) : |armCellValue epsilon a u - armCellValue epsilon a v| ≤ (1 + epsilon⁻¹) * l1CellDistance u v := by have hmu := (armCellValue_bounds hepsilon u hu a) have hmv := (armCellValue_bounds hepsilon v hv a) have hMassU : 0 ≤ vectorMass u := hmu.1.trans hmu.2 have hMassV : 0 ≤ vectorMass v := hmv.1.trans hmv.2 have hinv : 0 < epsilon⁻¹ := inv_pos.mpr hepsilon have hcoef : 1 ≤ 1 + epsilon⁻¹ := by linarith by_cases hU : vectorMass u = 0 · have hu0 := cell_eq_zero_of_vectorMass_eq_zero u hu hU have hdist := l1CellDistance_zero_left u v hu0 hv have huvalue : armCellValue epsilon a u = 0 := by rw [armCellValue, if_pos hU] rw [huvalue, zero_sub, abs_neg, abs_of_nonneg hmv.1, hdist] exact hmv.2.trans (by simpa using mul_le_mul_of_nonneg_right hcoef hMassV) · by_cases hV : vectorMass v = 0 · have hv0 := cell_eq_zero_of_vectorMass_eq_zero v hv hV have hdist := l1CellDistance_zero_left v u hv0 hu have hvvalue : armCellValue epsilon a v = 0 := by rw [armCellValue, if_pos hV] rw [hvvalue, sub_zero, abs_of_nonneg hmu.1] have hsym : l1CellDistance u v = l1CellDistance v u := by simp [l1CellDistance, abs_sub_comm] rw [hsym, hdist] exact hmu.2.trans (by simpa using mul_le_mul_of_nonneg_right hcoef hMassU) · have hUpos : 0 < vectorMass u := lt_of_le_of_ne hMassU (Ne.symm hU) have hVpos : 0 < vectorMass v := lt_of_le_of_ne hMassV (Ne.symm hV) fin_cases a · simpa [scalarArmValue, armCellValue, vectorMass, vectorArmMass, l1CellDistance, Fintype.sum_prod_type, add_assoc] using (scalarArmValue_lipschitz_of_pos hepsilon (u (0, 0)) (u (0, 1)) (u (1, 0)) (u (1, 1)) (v (0, 0)) (v (0, 1)) (v (1, 0)) (v (1, 1)) (hu _) (hu _) (hu _) (hu _) (hv _) (hv _) (hv _) (hv _) (by simpa [vectorMass, vectorArmMass, add_assoc] using hUpos) (by simpa [vectorMass, vectorArmMass, add_assoc] using hVpos)) · simpa [scalarArmValue, armCellValue, vectorMass, vectorArmMass, l1CellDistance, Fintype.sum_prod_type, add_assoc, add_comm, add_left_comm] using (scalarArmValue_lipschitz_of_pos hepsilon (u (1, 0)) (u (1, 1)) (u (0, 0)) (u (0, 1)) (v (1, 0)) (v (1, 1)) (v (0, 0)) (v (0, 1)) (hu _) (hu _) (hu _) (hu _) (hv _) (hv _) (hv _) (hv _) (by simpa [vectorMass, vectorArmMass, add_assoc, add_comm, add_left_comm] using hUpos) (by simpa [vectorMass, vectorArmMass, add_assoc, add_comm, add_left_comm] using hVpos))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armCellValue_lipschitz · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:310
theorem globalCellValue_lipschitz

If the overlap parameter satisfies its stated range restriction, and the stated u condition holds, and the stated v condition holds, then global cell value is Lipschitz in cellwise L1 distance with constant 1+1/epsilon1+1/epsilon.

Formal statement
epsilon :
hepsilon :
0 < epsilon
u v :
Cell → ℝ
hu :
∀ j, 0 ≤ u j
hv :
∀ j, 0 ≤ v j
|globalCellValue epsilon u - globalCellValue epsilon v|
≤ (1 + epsilon⁻¹) * l1CellDistance u v
Proof (Lean source)
lemma globalCellValue_lipschitz {epsilon : ℝ} (hepsilon : 0 < epsilon) (u v : Cell → ℝ) (hu : ∀ j, 0 ≤ u j) (hv : ∀ j, 0 ≤ v j) : |globalCellValue epsilon u - globalCellValue epsilon v| ≤ (1 + epsilon⁻¹) * l1CellDistance u v := by rw [globalCellValue] exact (abs_max_sub_max_le_max _ _ _ _).trans (max_le (armCellValue_lipschitz hepsilon u v hu hv 0) (armCellValue_lipschitz hepsilon u v hu hv 1))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.globalCellValue_lipschitz · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/GlobalLipschitz.lean:357
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.JacksonCertificate 6 declarations Simultaneous pointwise and coefficient control for the tensor Jackson approximant.

Simultaneous pointwise and coefficient control for the tensor Jackson approximant.

def inRectangle

For the specified rectangle or law, second cell vector, the rectangle-membership condition requires every cell coordinate to lie between its lower and upper endpoints. In each cell, the coordinate is at least the lower endpoint and at most the upper endpoint.

Definition (Lean source)
Q :
v :
Cell → ℝ
j :
inRectangle Q v :
Prop
clause 1
Q.1 j ≤ v j
clause 2
v j ≤ Q.2 j
def jacksonPointwiseScale

For the specified rectangle or law, degree, second cell vector, the Jackson pointwise scale sums the local square-root boundary widths and second-order rectangle radii across the four cells.

Definition (Lean source)
Q :
K :
v :
Cell → ℝ
jacksonPointwiseScale Q K v :
∑ j : Cell, (sqrt ((v j - Q.1 j) * (Q.2 j - v j)) / K + rectangleRadius Q j / K ^ 2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonPointwiseScale · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonCertificate.lean:15
theorem tensorConvolution_approx_weighted Lemma tensorConvolution_approx_weighted in the paper ↗

A tensor Jackson convolution inherits a coordinatewise first/second-order modulus. This uses the approximation degree satisfies its stated restriction, and the Lipschitz scale is positive, and the target function is continuous, and the linear weights are nonnegative, and the quadratic weights are nonnegative, and the target function obeys the stated weighted increment bound. The displayed identity or bound is the asserted conclusion.

Formal statement
d K :
hK :
0 < K
f :
(Fin d → ℝ) → ℝ
L :
hL :
0 ≤ L
a b :
Fin d → ℝ
ha :
∀ i, 0 ≤ a i
hb :
∀ i, 0 ≤ b i
x :
Fin d → ℝ
hdiff :
∀ u,
|f (cosPoint (x - u))
- f (cosPoint x)|
≤ L * ∑ i, (a i * |u i| + b i * (u i) ^ 2)
- f (cosPoint x)|
≤ L * ∑ i, (32 * a i / (K : ℝ) + 64 * b i / (K : ℝ) ^ 2)
Proof (Lean source)
lemma tensorConvolution_approx_weighted {d K : ℕ} (hK : 0 < K) (f : (Fin d → ℝ) → ℝ) (L : ℝ) (hL : 0 ≤ L) (hf : ContinuousOn f (normalizedCube d)) (a b : Fin d → ℝ) (ha : ∀ i, 0 ≤ a i) (hb : ∀ i, 0 ≤ b i) (x : Fin d → ℝ) (hdiff : ∀ u, |f (cosPoint (x - u)) - f (cosPoint x)| ≤ L * ∑ i, (a i * |u i| + b i * (u i) ^ 2)) : |tensorConvolution K f x - f (cosPoint x)| ≤ L * ∑ i, (32 * a i / (K : ℝ) + 64 * b i / (K : ℝ) ^ 2) := by classical let box := periodBox d let ker := Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d have hcompact : IsCompact box := by rw [show box = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ => isCompact_Icc have hfcos : Continuous (fun u : Fin d → ℝ => f (cosPoint (x - u))) := by apply hf.comp_continuous · unfold cosPoint fun_prop · exact fun u => cosPoint_mem_normalizedCube (x - u) have hker : Continuous ker := by dsimp [ker] unfold Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson fun_prop have hintDiff : IntegrableOn (fun u : Fin d → ℝ => (f (cosPoint (x - u)) - f (cosPoint x)) * ker u) box := ((hfcos.sub continuous_const).mul hker).continuousOn.integrableOn_compact hcompact have hintBound : IntegrableOn (fun u : Fin d → ℝ => L * (∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u) box := by have hc : Continuous (fun u : Fin d → ℝ => L * (∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u) := by fun_prop exact hc.continuousOn.integrableOn_compact hcompact have hconvDiff : tensorConvolution K f x - f (cosPoint x) = ∫ u in box, (f (cosPoint (x - u)) - f (cosPoint x)) * ker u := by unfold tensorConvolution dsimp [box, ker] calc (∫ u in periodBox d, f (cosPoint (x - u)) * Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d u) - f (cosPoint x) = (∫ u in periodBox d, f (cosPoint (x - u)) * Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d u) - f (cosPoint x) * (∫ u in periodBox d, Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d u) := by rw [tensorJackson_integral_eq_one hK, mul_one] _ = (∫ u in periodBox d, f (cosPoint (x - u)) * Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d u) - ∫ u in periodBox d, f (cosPoint x) * Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson K d u := by rw [MeasureTheory.integral_const_mul] _ = _ := by rw [← MeasureTheory.integral_sub] · apply MeasureTheory.integral_congr_ae filter_upwards intro u ring · exact (hfcos.mul hker).continuousOn.integrableOn_compact hcompact · exact (continuous_const.mul hker).continuousOn.integrableOn_compact hcompact rw [hconvDiff] calc |∫ u in box, (f (cosPoint (x - u)) - f (cosPoint x)) * ker u| ≤ ∫ u in box, |(f (cosPoint (x - u)) - f (cosPoint x)) * ker u| := abs_integral_le_integral_abs _ ≤ ∫ u in box, L * (∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u := by apply setIntegral_mono hintDiff.abs hintBound intro u change |(f (cosPoint (x - u)) - f (cosPoint x)) * ker u| ≤ _ rw [abs_mul, abs_of_nonneg (tensorJackson_nonneg hK u)] exact mul_le_mul_of_nonneg_right (hdiff u) (tensorJackson_nonneg hK u) _ = L * ∑ i, (a i * (∫ u in box, |u i| * ker u) + b i * (∫ u in box, (u i) ^ 2 * ker u)) := by rw [show (fun u => L * (∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u) = fun u => L * ((∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u) by funext u; ring, MeasureTheory.integral_const_mul] rw [show (fun u => (∑ i, (a i * |u i| + b i * (u i) ^ 2)) * ker u) = fun u => ∑ i, (a i * |u i| + b i * (u i) ^ 2) * ker u by funext u; rw [Finset.sum_mul]] rw [MeasureTheory.integral_finsetSum] · apply congrArg apply Finset.sum_congr rfl intro i _ have hfirst : IntegrableOn (fun u : Fin d → ℝ => a i * (|u i| * ker u)) box := by exact (show Continuous (fun u : Fin d → ℝ => a i * (|u i| * ker u)) by fun_prop).continuousOn.integrableOn_compact hcompact have hsecond : IntegrableOn (fun u : Fin d → ℝ => b i * ((u i) ^ 2 * ker u)) box := by exact (show Continuous (fun u : Fin d → ℝ => b i * ((u i) ^ 2 * ker u)) by fun_prop).continuousOn.integrableOn_compact hcompact rw [show (fun u => (a i * |u i| + b i * (u i) ^ 2) * ker u) = fun u => a i * (|u i| * ker u) + b i * ((u i) ^ 2 * ker u) by funext u; ring] rw [MeasureTheory.integral_add hfirst hsecond, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul] · intro i _ exact (show Continuous (fun u : Fin d → ℝ => (a i * |u i| + b i * (u i) ^ 2) * ker u) by fun_prop).continuousOn.integrableOn_compact hcompact _ ≤ L * ∑ i, (a i * (32 / (K : ℝ)) + b i * (64 / (K : ℝ) ^ 2)) := by apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro i _ apply add_le_add · apply mul_le_mul_of_nonneg_left _ (ha i) dsimp [box, ker] rw [tensorJackson_first_moment_eq hK i] exact jackson_first_moment K hK · apply mul_le_mul_of_nonneg_left _ (hb i) dsimp [box, ker] rw [tensorJackson_second_moment_eq hK i] exact jackson_second_moment K hK _ = L * ∑ i, (32 * a i / (K : ℝ) + 64 * b i / (K : ℝ) ^ 2) := by congr 1 apply Finset.sum_congr rfl intro i _ ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.tensorConvolution_approx_weighted · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonCertificate.lean:21

A cosine shift has the first/second-order bound used at rectangle faces. The displayed identity or bound is the asserted conclusion.

Formal statement
x u :
|cos (x - u) - cos x| ≤ |sin x| * |u| + u ^ 2 / 2
Proof (Lean source)
lemma abs_cos_sub_shift_le (x u : ℝ) : |cos (x - u) - cos x| ≤ |sin x| * |u| + u ^ 2 / 2 := by calc |cos (x - u) - cos x| = |cos x * (cos u - 1) + sin x * sin u| := by rw [Real.cos_sub] congr 1 ring _ ≤ |cos x * (cos u - 1)| + |sin x * sin u| := abs_add_le _ _ _ = |cos x| * (1 - cos u) + |sin x| * |sin u| := by rw [abs_mul, abs_mul, abs_of_nonpos (sub_nonpos.mpr (Real.cos_le_one u))] ring _ ≤ 1 * (u ^ 2 / 2) + |sin x| * |u| := by apply add_le_add · apply mul_le_mul (Real.abs_cos_le_one x) (by linarith [Real.one_sub_sq_div_two_le_cos (x := u)]) (sub_nonneg.mpr (Real.cos_le_one u)) (by positivity) · exact mul_le_mul_of_nonneg_left Real.abs_sin_le_abs (abs_nonneg _) _ = |sin x| * |u| + u ^ 2 / 2 := by ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.abs_cos_sub_shift_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonCertificate.lean:164
def CenteredCoefficientExpansion

A finite centered, radius-scaled monomial expansion of a physical polynomial.

Definition (Lean source)
epsilon :
Q :
p :
S :
Finset (Cell →₀ ℕ)
coeff :
(Cell →₀ ℕ) → ℝ
v :
Cell → ℝ
CenteredCoefficientExpansion epsilon Q p S coeff :
Prop
= ∑ alpha ∈ S, coeff alpha * ∏ j : Cell, ((v j - rectangleCenter Q j) / rectangleRadius Q j) ^ alpha j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.CenteredCoefficientExpansion · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonCertificate.lean:186
theorem simultaneous_jackson_certificate Lemma 4 in the paper ↗

one universal exponential coefficient constant yields, for every overlap level, simultaneous degree, approximation, and centered-coefficient bounds for the Jackson polynomial.

Formal statement
∃ A : ℝ,
0 < A
conclusion 1
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ Cepsilon : ℝ,
0 < Cepsilon
K :
Q :
hK :
2 ≤ K
hQ :
Q.Valid
hQ0 :
∀ j, 0 ≤ Q.1 j
(∀ j, 0 < rectangleRadius Q j)
p :
jacksonTensorPolynomial epsilon K hK Q hQ hQ0
j :
p.degreeOf j ≤ 2 * (K - 1)
v :
|eval v p - globalCellValue epsilon v|
≤ Cepsilon * jacksonPointwiseScale Q K v
∃ S : Finset (Cell →₀ ℕ), ∃ coeff : (Cell →₀ ℕ) → ℝ,
CenteredCoefficientExpansion epsilon Q p S coeff
alpha ∈ S :
j :
alpha j ≤ 2 * (K - 1)
(∑ alpha ∈ S, |coeff alpha|) ≤ A ^ K * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j
Proof (Lean source)
lemma simultaneous_jackson_certificate : ∃ A : ℝ, 0 < A ∧ ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ Cepsilon : ℝ, 0 < Cepsilon ∧ ∀ (K : ℕ) (Q : Rectangle), ∀ (hK : 2 ≤ K), ∀ (hQ : Q.Valid), ∀ (hQ0 : ∀ j, 0 ≤ Q.1 j), (∀ j, 0 < rectangleRadius Q j) → let p := jacksonTensorPolynomial epsilon K hK Q hQ hQ0 (∀ j, p.degreeOf j ≤ 2 * (K - 1)) ∧ (∀ v, inRectangle Q v → |eval v p - globalCellValue epsilon v| ≤ Cepsilon * jacksonPointwiseScale Q K v) ∧ ∃ S : Finset (Cell →₀ ℕ), ∃ coeff : (Cell →₀ ℕ) → ℝ, CenteredCoefficientExpansion epsilon Q p S coeff ∧ (∀ alpha ∈ S, ∀ j, alpha j ≤ 2 * (K - 1)) ∧ (∑ alpha ∈ S, |coeff alpha|) ≤ A ^ K * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j := by classical refine ⟨(2 : ℝ) ^ 60, by positivity, ?_⟩ intro epsilon hepsilon _hepsilon_half refine ⟨32 * (1 + epsilon⁻¹), by positivity, ?_⟩ intro K Q hK _hQ hQ0 hQr let data := choice (jacksonTensorPolynomialData_exists epsilon K hK Q hQ0 hepsilon hQr) have hp : jacksonTensorPolynomial epsilon K hK Q _hQ hQ0 = data.p := by simp only [jacksonTensorPolynomial, dif_pos hepsilon, dif_pos hQr, data] dsimp only constructor · rw [hp] exact data.coordinateDegree constructor · intro v hv let e := cellFinFourEquiv let c : Fin 4 → ℝ := fun i => rectangleCenter Q (e.symm i) let r : Fin 4 → ℝ := fun i => rectangleRadius Q (e.symm i) let y : Fin 4 → ℝ := fun i => v (e.symm i) let z := Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint c r y let x : Fin 4 → ℝ := fun i => arccos (z i) let F : (Fin 4 → ℝ) → ℝ := fun w => jacksonAffineFunction epsilon (affinePoint c r w) have hr : ∀ i, 0 < r i := fun i => hQr (e.symm i) have hy : y ∈ centeredRectangle c r := by intro i dsimp [y, c, r] rw [abs_le] have hi := hv (e.symm i) constructor <;> simp only [rectangleCenter, rectangleRadius] <;> nlinarith have hz := Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint_mem_normalizedCube c r y hr hy have hcos : cosPoint x = z := by funext i exact Real.cos_arccos (hz i).1 (hz i).2 have hnonneg (w : Fin 4 → ℝ) (hw : w ∈ normalizedCube 4) : ∀ j, 0 ≤ affinePoint c r w (e j) := by intro j have hwj := (hw (e j)).1 have hlower : c (e j) - r (e j) = Q.1 j := by simp only [c, r, Equiv.symm_apply_apply, rectangleCenter, rectangleRadius] ring dsimp [affinePoint] have hrj := hr (e j) rw [show c (e j) = Q.1 j + r (e j) by linarith] nlinarith [hQ0 j] have hF : ContinuousOn F (normalizedCube 4) := by apply LipschitzOnWith.continuousOn apply LipschitzOnWith.of_dist_le' (K := (1 + epsilon⁻¹) * (∑ i : Fin 4, r i)) intro w hw w' hw' rw [Real.dist_eq] have hbase := globalCellValue_lipschitz hepsilon (fun j => affinePoint c r w (e j)) (fun j => affinePoint c r w' (e j)) (hnonneg w hw) (hnonneg w' hw') dsimp [F, jacksonAffineFunction] refine hbase.trans ?_ unfold l1CellDistance have hcoord (i : Fin 4) : |affinePoint c r w i - affinePoint c r w' i| ≤ r i * dist w w' := by have hi : |w i - w' i| ≤ dist w w' := by simpa [Real.dist_eq] using dist_le_pi_dist w w' i simp only [affinePoint] rw [show c i + r i * w i - (c i + r i * w' i) = r i * (w i - w' i) by ring, abs_mul, abs_of_pos (hr i)] exact mul_le_mul_of_nonneg_left hi (le_of_lt (hr i)) calc (1 + epsilon⁻¹) * (∑ j : Cell, |affinePoint c r w (e j) - affinePoint c r w' (e j)|) ≤ (1 + epsilon⁻¹) * ∑ i : Fin 4, r i * dist w w' := by apply mul_le_mul_of_nonneg_left _ (by positivity) calc (∑ j : Cell, |affinePoint c r w (e j) - affinePoint c r w' (e j)|) = ∑ i : Fin 4, |affinePoint c r w i - affinePoint c r w' i| := Fintype.sum_equiv e _ _ (fun j => by simp) _ ≤ ∑ i : Fin 4, r i * dist w w' := Finset.sum_le_sum fun i _ => hcoord i _ = (1 + epsilon⁻¹) * (∑ i : Fin 4, r i) * dist w w' := by rw [show (∑ i : Fin 4, r i * dist w w') = (∑ i : Fin 4, r i) * dist w w' by rw [Finset.sum_mul]] ring have hdiff (u : Fin 4 → ℝ) : |F (cosPoint (x - u)) - F (cosPoint x)| ≤ (1 + epsilon⁻¹) * ∑ i, (r i * |sin (x i)| * |u i| + (r i / 2) * (u i) ^ 2) := by have hbase := globalCellValue_lipschitz hepsilon (fun j => affinePoint c r (cosPoint (x - u)) (e j)) (fun j => affinePoint c r (cosPoint x) (e j)) (hnonneg _ (cosPoint_mem_normalizedCube _)) (hnonneg _ (cosPoint_mem_normalizedCube _)) dsimp [F, jacksonAffineFunction] refine hbase.trans (mul_le_mul_of_nonneg_left ?_ (by positivity)) unfold l1CellDistance calc (∑ j : Cell, |(fun j => affinePoint c r (cosPoint (x - u)) (e j)) j - (fun j => affinePoint c r (cosPoint x) (e j)) j|) = ∑ i : Fin 4, |affinePoint c r (cosPoint (x - u)) i - affinePoint c r (cosPoint x) i| := Fintype.sum_equiv e _ _ (fun j => by simp) _ ≤ ∑ i : Fin 4, (r i * |sin (x i)| * |u i| + (r i / 2) * (u i) ^ 2) := by apply Finset.sum_le_sum intro i _ simp only [affinePoint, cosPoint, Pi.sub_apply] rw [show c i + r i * cos (x i - u i) - (c i + r i * cos (x i)) = r i * (cos (x i - u i) - cos (x i)) by ring, abs_mul, abs_of_pos (hr i)] nlinarith [mul_le_mul_of_nonneg_left (abs_cos_sub_shift_le (x i) (u i)) (le_of_lt (hr i))] have happ := tensorConvolution_approx_weighted (lt_of_lt_of_le (by omega) hK) F (1 + epsilon⁻¹) (by positivity) hF (fun i => r i * |sin (x i)|) (fun i => r i / 2) (fun i => mul_nonneg (le_of_lt (hr i)) (abs_nonneg _)) (fun i => div_nonneg (le_of_lt (hr i)) (by norm_num)) x hdiff rw [hp] have heval := data.convolutionEval (fun j => x (e j)) have hphysical : (fun j => rectangleCenter Q j + rectangleRadius Q j * cos (x (e j))) = v := by funext j have haff := affinePoint_normalizedPoint c r y hr have hj := congrFun haff (e j) calc rectangleCenter Q j + rectangleRadius Q j * cos (x (e j)) = affinePoint c r (cosPoint x) (e j) := by simp [c, r, e, affinePoint, cosPoint] _ = affinePoint c r z (e j) := by rw [hcos] _ = affinePoint c r (Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint c r y) (e j) := rfl _ = y (e j) := hj _ = v j := by simp [y, e] rw [hphysical] at heval rw [heval] have hconv : jacksonSubstrateConvolution epsilon K Q (fun j => x (e j)) = tensorConvolution K F x := by rfl rw [hconv] have hFv : F (cosPoint x) = globalCellValue epsilon v := by dsimp [F, jacksonAffineFunction] change globalCellValue epsilon (fun j => rectangleCenter Q j + rectangleRadius Q j * cos (x (e j))) = _ rw [hphysical] rw [hFv] at happ refine happ.trans_eq ?_ have hsin (j : Cell) : r (e j) * |sin (x (e j))| = sqrt ((v j - Q.1 j) * (Q.2 j - v j)) := by rw [show x (e j) = arccos (z (e j)) by rfl, Real.sin_arccos, abs_of_nonneg (Real.sqrt_nonneg _)] have hzj : z (e j) = (v j - rectangleCenter Q j) / rectangleRadius Q j := by simp [z, Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint, y, c, r, e] rw [hzj] have halg : (v j - Q.1 j) * (Q.2 j - v j) = (rectangleRadius Q j) ^ 2 * (1 - ((v j - rectangleCenter Q j) / rectangleRadius Q j) ^ 2) := by field_simp [ne_of_gt (hQr j)] simp only [rectangleCenter, rectangleRadius] ring rw [halg, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq_eq_abs, abs_of_pos (hQr j)] simp [r, e] have hscale : (∑ i : Fin 4, (32 * (r i * |sin (x i)|) / (K : ℝ) + 64 * (r i / 2) / (K : ℝ) ^ 2)) = 32 * jacksonPointwiseScale Q K v := by unfold jacksonPointwiseScale calc (∑ i : Fin 4, (32 * (r i * |sin (x i)|) / (K : ℝ) + 64 * (r i / 2) / (K : ℝ) ^ 2)) = ∑ j : Cell, (32 * (r (e j) * |sin (x (e j))|) / (K : ℝ) + 64 * (r (e j) / 2) / (K : ℝ) ^ 2) := Fintype.sum_equiv e.symm _ _ (fun i => by simp) _ = 32 * ∑ j : Cell, (sqrt ((v j - Q.1 j) * (Q.2 j - v j)) / (K : ℝ) + rectangleRadius Q j / (K : ℝ) ^ 2) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ rw [hsin j] simp only [r, Equiv.symm_apply_apply] ring rw [hscale] ring_nf · let qCell : MvPolynomial Cell ℝ := MvPolynomial.rename cellFinFourEquiv.symm data.q let g : (Fin 4 →₀ ℕ) → (Cell →₀ ℕ) := Finsupp.mapDomain cellFinFourEquiv.symm refine ⟨data.q.support.image g, qCell.coeff, ?_, ?_, ?_⟩ · intro v rw [hp, data.physicalEval] change eval ((fun j => (v j - rectangleCenter Q j) / rectangleRadius Q j) ∘ cellFinFourEquiv.symm) data.q = _ rw [← MvPolynomial.eval_rename] change eval _ qCell = _ rw [MvPolynomial.eval_eq'] rw [show qCell.support = data.q.support.image g by exact MvPolynomial.support_rename_of_injective cellFinFourEquiv.symm.injective] · intro alpha halpha j rw [mem_image] at halpha obtain ⟨beta, hbeta, rfl⟩ := halpha have hmap : g beta j = beta (cellFinFourEquiv j) := by exact Finsupp.mapDomain_equiv_apply beta j rw [hmap] exact data.normalizedCoordinateDegree beta hbeta (cellFinFourEquiv j) · change (∑ alpha ∈ data.q.support.image g, |qCell.coeff alpha|) ≤ _ rw [Finset.sum_image (Finsupp.mapDomain_injective cellFinFourEquiv.symm.injective).injOn] -- … truncated; follow the source link for the rest …
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.simultaneous_jackson_certificate · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonCertificate.lean:196
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.JacksonKernel 11 declarations The order-four Jackson kernel and its tensor-convolution representation.

The order-four Jackson kernel and its tensor-convolution representation.

def Rectangle

A pilot rectangle represented by lower and upper endpoints.

Definition (Lean source)
Rectangle :
Type
(Cell → ℝ) × (Cell → ℝ)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Rectangle · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:15
def Valid

The endpoint condition required of a genuine rectangle.

Definition (Lean source)
Q :
j :
Valid Q :
Prop
Q.1 j ≤ Q.2 j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.Rectangle.Valid · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:19
def rectangleCenter

For the specified rectangle or law, cell index, the rectangle center is the midpoint of the lower and upper endpoint in the selected cell.

Definition (Lean source)
Q :
j :
rectangleCenter Q j :
(Q.1 j + Q.2 j) / 2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.rectangleCenter · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:22
def rectangleRadius

For the specified rectangle or law, cell index, the rectangle radius is half the difference between the upper and lower endpoint in the selected cell.

Definition (Lean source)
Q :
j :
rectangleRadius Q j :
(Q.2 j - Q.1 j) / 2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.rectangleRadius · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:24

The canonical enumeration of the four treatment--outcome coordinates.

Definition (Lean source)
cellFinFourEquiv :
CellFin 4
finProdFinEquiv
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellFinFourEquiv · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:28

The cell functional, reindexed on the four-coordinate type used by the Jackson substrate.

Definition (Lean source)
epsilon :
jacksonAffineFunction epsilon :
(Fin 4 → ℝ) → ℝ
fun y => globalCellValue epsilon (fun j => y (cellFinFourEquiv j))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonAffineFunction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:32

The affine tensor Jackson convolution after enumerating the four cell coordinates.

Definition (Lean source)
epsilon :
K :
Q :
theta :
Cell → ℝ
jacksonSubstrateConvolution epsilon K Q theta :
tensorConvolution K (fun z => jacksonAffineFunction epsilon (affinePoint (fun i => rectangleCenter Q (cellFinFourEquiv.symm i)) (fun i => rectangleRadius Q (cellFinFourEquiv.symm i)) z)) (fun i => theta (cellFinFourEquiv.symm i))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonSubstrateConvolution · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:37

One polynomial together with the normalized-coordinate representative used for its coefficient envelope.

Definition (Lean source)
epsilon :
K :
Q :
p :
q :
coordinateDegree :
∀ j, p.degreeOf j ≤ 2 * (K - 1)
normalizedCoordinateDegree :
∀ m ∈ q.support, ∀ i, m i ≤ 2 * (K - 1)
physicalEval :
∀ y : Cell → ℝ,
= eval (fun i => (y (cellFinFourEquiv.symm i) - rectangleCenter Q (cellFinFourEquiv.symm i)) / rectangleRadius Q (cellFinFourEquiv.symm i)) q
convolutionEval :
∀ theta : Cell → ℝ,
eval (fun j => rectangleCenter Q j + rectangleRadius Q j * cos (theta j)) p
= jacksonSubstrateConvolution epsilon K Q theta
coefficientBound :
≤ (2 : ℝ) ^ (40 * K + 20) * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.JacksonTensorPolynomialData · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:48
theorem jacksonTensorPolynomialData_exists Lemma 2 in the paper ↗

If the approximation degree satisfies its stated restriction, and the stated q0 condition holds, and the overlap parameter satisfies its stated range restriction, and the stated qr condition holds, then the stated jackson tensor polynomial data exists relation holds.

Formal statement
epsilon :
K :
hK :
2 ≤ K
Q :
hQ0 :
∀ j, 0 ≤ Q.1 j
hepsilon :
0 < epsilon
hQr :
∀ j, 0 < rectangleRadius Q j
Nonempty (JacksonTensorPolynomialData epsilon K Q)
Proof (Lean source)
lemma jacksonTensorPolynomialData_exists (epsilon : ℝ) (K : ℕ) (hK : 2 ≤ K) (Q : Rectangle) (hQ0 : ∀ j, 0 ≤ Q.1 j) (hepsilon : 0 < epsilon) (hQr : ∀ j, 0 < rectangleRadius Q j) : Nonempty (JacksonTensorPolynomialData epsilon K Q) := by classical let e := cellFinFourEquiv let c : Fin 4 → ℝ := fun i => rectangleCenter Q (e.symm i) let r : Fin 4 → ℝ := fun i => rectangleRadius Q (e.symm i) let f : (Fin 4 → ℝ) → ℝ := jacksonAffineFunction epsilon let f0 : (Fin 4 → ℝ) → ℝ := fun y => f y - f c let B : ℝ := (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j have hr : ∀ i, 0 < r i := fun i => hQr (e.symm i) have hnonneg : ∀ y ∈ centeredRectangle c r, ∀ j, 0 ≤ y (e j) := by intro y hy j have hj := hy (e j) dsimp [c, r] at hj simp only [Equiv.symm_apply_apply] at hj rw [abs_le] at hj have hc : rectangleCenter Q j - rectangleRadius Q j = Q.1 j := by simp only [rectangleCenter, rectangleRadius] ring nlinarith [hQ0 j] have hc_mem : c ∈ centeredRectangle c r := by intro i simp [le_of_lt (hr i)] have hf : ContinuousOn f (centeredRectangle c r) := by apply LipschitzOnWith.continuousOn apply LipschitzOnWith.of_dist_le' (K := 4 * (1 + epsilon⁻¹)) intro y hy z hz rw [Real.dist_eq] have hbase := globalCellValue_lipschitz hepsilon (fun j => y (e j)) (fun j => z (e j)) (hnonneg y hy) (hnonneg z hz) have hsum : l1CellDistance (fun j => y (e j)) (fun j => z (e j)) ≤ 4 * dist y z := by unfold l1CellDistance calc (∑ j : Cell, |y (e j) - z (e j)|) ≤ ∑ _j : Cell, dist y z := by gcongr with j have hcoord : dist (y (e j)) (z (e j)) ≤ dist y z := by exact_mod_cast nndist_le_pi_nndist y z (e j) simpa [Real.dist_eq] using hcoord _ = 4 * dist y z := by simp [Fintype.card_congr e] calc _ ≤ (1 + epsilon⁻¹) * (4 * dist y z) := hbase.trans (mul_le_mul_of_nonneg_left hsum (by positivity)) _ = 4 * (1 + epsilon⁻¹) * dist y z := by ring have hf0 : ContinuousOn f0 (centeredRectangle c r) := hf.sub continuousOn_const have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) have hB : 0 ≤ B := by dsimp [B] exact mul_nonneg (by positivity) (sum_nonneg fun j _ => le_of_lt (hQr j)) have hbound : ∀ y ∈ centeredRectangle c r, |f0 y| ≤ B := by intro y hy have hbase := globalCellValue_lipschitz hepsilon (fun j => y (e j)) (fun j => c (e j)) (hnonneg y hy) (hnonneg c hc_mem) refine hbase.trans (mul_le_mul_of_nonneg_left ?_ (by positivity)) unfold l1CellDistance apply Finset.sum_le_sum intro j _ simpa [c, r, e] using hy (e j) have hpull : ContinuousOn (fun z => f0 (affinePoint c r z)) (normalizedCube 4) := by apply hf0.comp · exact haff.continuousOn · exact fun z hz => Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint_mem_centeredRectangle c r z hr hz have hbound_pull : ∀ z ∈ normalizedCube 4, |f0 (affinePoint c r z)| ≤ B := fun z hz => hbound _ (Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint_mem_centeredRectangle c r z hr hz) obtain ⟨q, hqeval, hqcoord, _hqtotal, hqcoeff⟩ := tensorConvolution_exists_mvPolynomial_four_coeffBound (lt_of_lt_of_le (by omega) hK) _ B hB hpull hbound_pull obtain ⟨p4, hp4eval, hp4coord, _hp4total, _⟩ := mvPolynomial_affine_substitution_four q c r (2 * (K - 1)) hr hqcoord let p : MvPolynomial Cell ℝ := MvPolynomial.rename e.symm p4 + C (globalCellValue epsilon (rectangleCenter Q)) have hpdeg : ∀ j, p.degreeOf j ≤ 2 * (K - 1) := by intro j apply (MvPolynomial.degreeOf_add_le _ _ _).trans simp only [p, sup_le_iff] constructor · rw [show j = e.symm (e j) by simp, MvPolynomial.degreeOf_rename_of_injective e.symm.injective] exact MvPolynomial.degreeOf_le_iff.mpr (fun m hm => hp4coord m hm (e j)) · simp refine ⟨⟨p, q, hpdeg, hqcoord, ?_, ?_, ?_⟩⟩ · intro y simp only [p, MvPolynomial.eval_add, MvPolynomial.eval_rename, MvPolynomial.eval_C, add_sub_cancel_right] rw [hp4eval] rfl · intro theta simp only [p, MvPolynomial.eval_add, MvPolynomial.eval_rename, MvPolynomial.eval_C] rw [hp4eval] have hnorm := normalizedPoint_affinePoint c r (fun i => cos (theta (e.symm i))) hr rw [show ((fun j => rectangleCenter Q j + rectangleRadius Q j * cos (theta j)) ∘ e.symm) = affinePoint c r (fun i => cos (theta (e.symm i))) by rfl, hnorm] change eval (cosPoint (fun i => theta (e.symm i))) q + _ = _ rw [hqeval] change tensorConvolution K (fun z => f0 (affinePoint c r z)) _ + globalCellValue epsilon (rectangleCenter Q) = _ unfold tensorConvolution rw [show (fun u => f0 (affinePoint c r (cosPoint ((fun i => theta (e.symm i)) - u))) * tensorJackson K 4 u) = fun u => f (affinePoint c r (cosPoint ((fun i => theta (e.symm i)) - u))) * tensorJackson K 4 u - f c * tensorJackson K 4 u by funext u; dsimp [f0]; ring] rw [MeasureTheory.integral_sub] · rw [MeasureTheory.integral_const_mul, tensorJackson_integral_eq_one (lt_of_lt_of_le (by omega) hK)] have hfc : f c = globalCellValue epsilon (rectangleCenter Q) := by simp [f, c, e, jacksonAffineFunction] rw [hfc] rw [mul_one, sub_add_cancel] unfold jacksonSubstrateConvolution simp only [tensorConvolution] rfl · have hcompact : IsCompact (periodBox 4) := by rw [show periodBox 4 = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ => isCompact_Icc have hcosaff : Continuous (fun u : Fin 4 → ℝ => affinePoint c r (cosPoint ((fun i => theta (e.symm i)) - u))) := by exact haff.comp (by unfold cosPoint; fun_prop) have hkernel : Continuous (tensorJackson K 4) := by unfold tensorJackson fun_prop exact ((hf.comp_continuous hcosaff (fun _ => Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint_mem_centeredRectangle c r _ hr (cosPoint_mem_normalizedCube _))).mul hkernel).continuousOn.integrableOn_compact hcompact · have hcompact : IsCompact (periodBox 4) := by rw [show periodBox 4 = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ => isCompact_Icc have hkernel : Continuous (tensorJackson K 4) := by unfold tensorJackson fun_prop exact (continuous_const.mul hkernel).continuousOn.integrableOn_compact hcompact · dsimp [B] at hqcoeff nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonTensorPolynomialData_exists · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:71
theorem jacksonTensorPolynomial_degenerate_exists Lemma jacksonTensorPolynomial_degenerate_exists in the paper ↗

On a rectangle with at least one zero-radius coordinate, the tensor convolution still has a physical-coordinate polynomial representative. Zero-radius coordinates are frozen at their singleton endpoint rather than causing the whole polynomial to vanish. This uses the approximation degree satisfies its stated restriction, and the potential-outcome law satisfies the stated causal restrictions, and the stated q0 condition holds, and the overlap parameter satisfies its stated range restriction, and the stated deg condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon :
K :
hK :
2 ≤ K
Q :
hQ :
Q.Valid
hQ0 :
∀ j, 0 ≤ Q.1 j
hepsilon :
0 < epsilon
_hdeg :
¬ ∀ j, 0 < rectangleRadius Q j
∃ p : MvPolynomial Cell ℝ,
conclusion 1
j :
p.degreeOf j ≤ 2 * (K - 1)
conclusion 2
theta :
Cell → ℝ
eval (fun j => rectangleCenter Q j + rectangleRadius Q j * cos (theta j)) p
= jacksonSubstrateConvolution epsilon K Q theta
Proof (Lean source)
lemma jacksonTensorPolynomial_degenerate_exists (epsilon : ℝ) (K : ℕ) (hK : 2 ≤ K) (Q : Rectangle) (hQ : Q.Valid) (hQ0 : ∀ j, 0 ≤ Q.1 j) (hepsilon : 0 < epsilon) (_hdeg : ¬ ∀ j, 0 < rectangleRadius Q j) : ∃ p : MvPolynomial Cell ℝ, (∀ j, p.degreeOf j ≤ 2 * (K - 1)) ∧ ∀ theta : Cell → ℝ, eval (fun j => rectangleCenter Q j + rectangleRadius Q j * cos (theta j)) p = jacksonSubstrateConvolution epsilon K Q theta := by classical let e := cellFinFourEquiv let c : Fin 4 → ℝ := fun i => rectangleCenter Q (e.symm i) let r : Fin 4 → ℝ := fun i => rectangleRadius Q (e.symm i) let f : (Fin 4 → ℝ) → ℝ := jacksonAffineFunction epsilon have hr0 : ∀ i, 0 ≤ r i := by intro i have hi := hQ (e.symm i) dsimp [r, rectangleRadius] linarith have hnonneg : ∀ z ∈ normalizedCube 4, ∀ j, 0 ≤ affinePoint c r z (e j) := by intro z hz j have hzlo : -1 ≤ z (e j) := (hz (e j)).1 have hmul : -r (e j) ≤ r (e j) * z (e j) := by nlinarith [mul_le_mul_of_nonneg_left hzlo (hr0 (e j))] have hc : c (e j) - r (e j) = Q.1 j := by simp [c, r, e, rectangleCenter, rectangleRadius] ring change 0 ≤ c (e j) + r (e j) * z (e j) linarith [hQ0 j] have hpull : ContinuousOn (fun z => f (affinePoint c r z)) (normalizedCube 4) := by apply LipschitzOnWith.continuousOn apply LipschitzOnWith.of_dist_le' (K := (1 + epsilon⁻¹) * ∑ j : Cell, |r (e j)|) intro y hy z hz rw [Real.dist_eq] have hbase := globalCellValue_lipschitz hepsilon (fun j => affinePoint c r y (e j)) (fun j => affinePoint c r z (e j)) (hnonneg y hy) (hnonneg z hz) have hsum : l1CellDistance (fun j => affinePoint c r y (e j)) (fun j => affinePoint c r z (e j)) ≤ (∑ j : Cell, |r (e j)|) * dist y z := by unfold l1CellDistance rw [Finset.sum_mul] apply Finset.sum_le_sum intro j _ have hcoord : |y (e j) - z (e j)| ≤ dist y z := by have h := nndist_le_pi_nndist y z (e j) exact_mod_cast h simp only [affinePoint] rw [add_sub_add_left_eq_sub, ← mul_sub, abs_mul] exact mul_le_mul_of_nonneg_left hcoord (abs_nonneg _) change |globalCellValue epsilon _ - globalCellValue epsilon _| ≤ _ calc _ ≤ (1 + epsilon⁻¹) * l1CellDistance _ _ := hbase _ ≤ (1 + epsilon⁻¹) * ((∑ j : Cell, |r (e j)|) * dist y z) := mul_le_mul_of_nonneg_left hsum (by positivity) _ = ((1 + epsilon⁻¹) * ∑ j : Cell, |r (e j)|) * dist y z := by ring obtain ⟨q, hqeval, hqcoord, _hqtotal⟩ := tensorConvolution_exists_mvPolynomial (lt_of_lt_of_le (by omega) hK) (fun z => f (affinePoint c r z)) hpull let r' : Fin 4 → ℝ := fun i => if r i = 0 then 1 else r i have hr' : ∀ i, 0 < r' i := by intro i dsimp [r'] split_ifs with hi · norm_num · exact lt_of_le_of_ne (hr0 i) (Ne.symm hi) obtain ⟨p4, hp4eval, hp4coord, _hp4total, _hp4coeff⟩ := mvPolynomial_affine_substitution_four q c r' (2 * (K - 1)) hr' hqcoord let p : MvPolynomial Cell ℝ := MvPolynomial.rename e.symm p4 refine ⟨p, ?_, ?_⟩ · intro j rw [show j = e.symm (e j) by simp, MvPolynomial.degreeOf_rename_of_injective e.symm.injective] exact MvPolynomial.degreeOf_le_iff.mpr (fun m hm => hp4coord m hm (e j)) · intro theta let theta' : Fin 4 → ℝ := fun i => if r i = 0 then pi / 2 else theta (e.symm i) have hnorm : normalizedPoint c r' ((fun j => rectangleCenter Q j + rectangleRadius Q j * cos (theta j)) ∘ e.symm) = cosPoint theta' := by funext i simp only [normalizedPoint, cosPoint] by_cases hi : r i = 0 · simp [theta', r', hi, c, r, e] · simp [theta', r', hi, c, r, e] have haffine (u : Fin 4 → ℝ) : affinePoint c r (cosPoint (theta' - u)) = affinePoint c r (cosPoint ((fun i => theta (e.symm i)) - u)) := by funext i by_cases hi : r i = 0 · simp [affinePoint, hi] · change c i + r i * cos (theta' i - u i) = c i + r i * cos (theta (e.symm i) - u i) have ht : theta' i = theta (e.symm i) := by simp [theta', hi] rw [ht] have hconv : tensorConvolution K (fun z => f (affinePoint c r z)) theta' = tensorConvolution K (fun z => f (affinePoint c r z)) (fun i => theta (e.symm i)) := by unfold tensorConvolution congr 1 with u change f (affinePoint c r (cosPoint (theta' - u))) * _ = f (affinePoint c r (cosPoint ((fun i => theta (e.symm i)) - u))) * _ rw [haffine u] simp only [p, MvPolynomial.eval_rename] rw [hp4eval, hnorm, hqeval, hconv] rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonTensorPolynomial_degenerate_exists · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:249
def jacksonTensorPolynomial Definition 12 in the paper ↗

The physical-coordinate polynomial induced by the four-dimensional Jackson convolution.

Definition (Lean source)
epsilon :
K :
hK :
2 ≤ K
Q :
hQ :
Q.Valid
hQ0 :
∀ j, 0 ≤ Q.1 j
jacksonTensorPolynomial epsilon K hK Q hQ hQ0 :
if hepsilon : 0 < epsilon then if hQr : ∀ j, 0 < rectangleRadius Q j then (choice (jacksonTensorPolynomialData_exists epsilon K hK Q hQ0 hepsilon hQr)).p else choose (jacksonTensorPolynomial_degenerate_exists epsilon K hK Q hQ hQ0 hepsilon hQr) else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonTensorPolynomial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/JacksonKernel.lean:386
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.L1Depoissonization 5 declarations This file specializes the reusable paired-histogram Rao--Blackwell theorem to the two simplex laws used by the paper.

Fixed/Poisson transfer for the paired L1 experiment

This file specializes the reusable paired-histogram Rao--Blackwell theorem to the two simplex laws used by the paper.

theorem l1Distance_nonneg_le_two Lemma l1Distance_nonneg_le_two in the paper ↗

the L1 distance between two probability vectors lies between zero and two.

Formal statement
d :
conclusion 1
0 ≤ l1Distance P Q
conclusion 2
l1Distance P Q ≤ 2
Proof (Lean source)
lemma l1Distance_nonneg_le_two {d : ℕ} (P Q : ProbabilitySimplex d) : 0 ≤ l1Distance P Q ∧ l1Distance P Q ≤ 2 := by constructor · exact sum_nonneg fun _ _ => abs_nonneg _ · unfold l1Distance calc (∑ x : Fin d, |P.1 x - Q.1 x|) ≤ ∑ x : Fin d, (P.1 x + Q.1 x) := by apply Finset.sum_le_sum intro x _hx calc |P.1 x - Q.1 x| ≤ |P.1 x| + |Q.1 x| := abs_sub _ _ _ = P.1 x + Q.1 x := by rw [abs_of_nonneg (P.2.1 x), abs_of_nonneg (Q.2.1 x)] _ = 2 := by rw [Finset.sum_add_distrib, P.2.2, Q.2.2]; norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1Distance_nonneg_le_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Depoissonization.lean:18

the family of fixed-sample L1 risks is bounded above.

Formal statement
n d :
est :
Proof (Lean source)
lemma fixedL1Risk_bddAbove {n d : ℕ} (est : FixedL1Estimator n d) : BddAbove (range (fixedL1Risk n est)) := by classical letI (PQ : ProbabilitySimplex d × ProbabilitySimplex d) : IsProbabilityMeasure (fixedPairLaw n PQ) := by unfold fixedPairLaw infer_instance let M : ℝ := ∑ z, |est.1 z| have hM : 0 ≤ M := sum_nonneg fun _ _ => abs_nonneg _ have hest (z : Fin n → Fin d × Fin d) : |est.1 z| ≤ M := Finset.single_le_sum (fun w _hw => abs_nonneg (est.1 w)) (Finset.mem_univ z) refine ⟨(M + 2) ^ 2, ?_⟩ rintro _ ⟨PQ, rfl⟩ have htheta := l1Distance_nonneg_le_two PQ.1 PQ.2 unfold fixedL1Risk sqRisk have hi := norm_integral_le_of_norm_le_const (μ := fixedPairLaw n PQ) (f := fun z => (est.1 z - l1Distance PQ.1 PQ.2) ^ 2) (C := (M + 2) ^ 2) (Filter.Eventually.of_forall fun z => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _), sq_le_sq, abs_of_nonneg (add_nonneg hM (by norm_num))] exact (abs_sub _ _).trans (add_le_add (hest z) (by rw [abs_of_nonneg htheta.1]; exact htheta.2))) exact (le_abs_self _).trans (by simpa [Real.norm_eq_abs] using hi)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1Risk_bddAbove · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Depoissonization.lean:35
theorem poissonL1Risk_pairedHistogram_le Lemma poissonL1Risk_pairedHistogram_le in the paper ↗

the risk of the paired-histogram estimator in the Poisson experiment is no greater than its fixed-sample counterpart plus the stated tail.

Formal statement
n d :
est :
poissonL1Risk n ⟨pairedPoissonHistogramEstimator est.1 0, measurable_pairedPoissonHistogramEstimator est.1 0⟩ PQ
fixedL1Risk n est PQ + 8 * exp (-(n : ℝ) * (1 - log 2))
Proof (Lean source)
lemma poissonL1Risk_pairedHistogram_le {n d : ℕ} (est : FixedL1Estimator n d) (PQ : ProbabilitySimplex d × ProbabilitySimplex d) : poissonL1Risk n ⟨pairedPoissonHistogramEstimator est.1 0, measurable_pairedPoissonHistogramEstimator est.1 0⟩ PQ ≤ fixedL1Risk n est PQ + 8 * exp (-(n : ℝ) * (1 - log 2)) := by have htheta := l1Distance_nonneg_le_two PQ.1 PQ.2 have h := pairedPoissonHistogramRisk_two_n_exp_le (simplexPMF PQ.1).toMeasure (simplexPMF PQ.2).toMeasure est.1 (l1Distance PQ.1 PQ.2) 2 (by rw [abs_of_nonneg htheta.1] exact htheta.2) unfold poissonL1Risk fixedL1Risk sqRisk dsimp [poissonPairLaw, fixedPairLaw] convert h using 1 <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonL1Risk_pairedHistogram_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Depoissonization.lean:61
theorem fixedL1MinimaxRisk_ge_poisson_sub_expTail Lemma fixedL1MinimaxRisk_ge_poisson_sub_expTail in the paper ↗

fixed-sample L1 minimax risk is at least the Poissonized risk minus the stated exponential tail.

Formal statement
n d :
P0 Q0 :
poissonL1FiniteRiskMinimaxRisk n d - 8 * exp (-(n : ℝ) * (1 - log 2))
Proof (Lean source)
lemma fixedL1MinimaxRisk_ge_poisson_sub_expTail {n d : ℕ} (P0 Q0 : ProbabilitySimplex d) : poissonL1FiniteRiskMinimaxRisk n d - 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ fixedL1MinimaxRisk n d := by classical letI : Nonempty (ProbabilitySimplex d × ProbabilitySimplex d) := ⟨(P0, Q0)⟩ letI : Nonempty (FixedL1Estimator n d) := ⟨⟨fun _ => 0, measurable_const⟩⟩ unfold fixedL1MinimaxRisk apply Causalean.Stat.le_minimaxValue intro est let poisEst : FiniteRiskL1Estimator n d := ⟨⟨pairedPoissonHistogramEstimator est.1 0, measurable_pairedPoissonHistogramEstimator est.1 0⟩, by constructor · intro PQ simpa [poissonPairLaw] using (pairedPoissonHistogramRisk_le_fixedRisk_add_tails (simplexPMF PQ.1).toMeasure (simplexPMF PQ.2).toMeasure (2 * n) (2 * n) est.1 0 (l1Distance PQ.1 PQ.2)).1 · obtain ⟨M, hM⟩ := fixedL1Risk_bddAbove est refine ⟨M + 8 * exp (-(n : ℝ) * (1 - log 2)), ?_⟩ rintro _ ⟨PQ, rfl⟩ exact (poissonL1Risk_pairedHistogram_le est PQ).trans (by simpa [add_comm] using (add_le_add_right (hM ⟨PQ, rfl⟩) (8 * exp (-(n : ℝ) * (1 - log 2)))))⟩ have hpmin : poissonL1FiniteRiskMinimaxRisk n d ≤ worstCaseRisk (fun est : FiniteRiskL1Estimator n d => poissonL1Risk n est.1) poisEst := by unfold poissonL1FiniteRiskMinimaxRisk exact minimaxValue_le_worstCaseRisk_of_nonneg (fun _ _ => by unfold poissonL1Risk sqRisk; positivity) poisEst have hpwc : worstCaseRisk (fun est : FiniteRiskL1Estimator n d => poissonL1Risk n est.1) poisEst ≤ worstCaseRisk (fixedL1Risk (d := d) n) est + 8 * exp (-(n : ℝ) * (1 - log 2)) := by apply worstCaseRisk_le intro PQ calc poissonL1Risk n poisEst.1 PQ ≤ fixedL1Risk n est PQ + 8 * exp (-(n : ℝ) * (1 - log 2)) := poissonL1Risk_pairedHistogram_le est PQ _ ≤ worstCaseRisk (fixedL1Risk (d := d) n) est + 8 * exp (-(n : ℝ) * (1 - log 2)) := by gcongr exact le_worstCaseRisk (fixedL1Risk_bddAbove est) PQ linarith [hpmin.trans hpwc]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1MinimaxRisk_ge_poisson_sub_expTail · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Depoissonization.lean:79
theorem jhw_fixedL1_lower_sub_expTail Lemma jhw_fixedL1_lower_sub_expTail in the paper ↗

If the Jiao--Han--Weissman Poisson L1 lower bound is available, and the stated c0 condition holds, and the stated c0 condition holds, then the stated jhw fixed l1 lower sub exp tail relation holds.

Formal statement
c0 C0 :
hc0 :
0 < c0
hC0 :
0 < C0
∃ c1 : ℝ,
0 < c1
conclusion 1
d n :
2 ≤ d
c0 * d / log (exp 1 * d) ≤ n
log (exp 1 * n) ≤ C0 * log (exp 1 * d)
P0 Q0 :
c1 * min 1 (d / (n * log (exp 1 * n)))
- 8 * exp (-(n : ℝ) * (1 - log 2))
Proof (Lean source)
lemma jhw_fixedL1_lower_sub_expTail (h_jhw : JhwPoissonL1Lower) (c0 C0 : ℝ) (hc0 : 0 < c0) (hC0 : 0 < C0) : ∃ c1 : ℝ, 0 < c1 ∧ ∀ d n : ℕ, 2 ≤ d → c0 * d / log (exp 1 * d) ≤ n → log (exp 1 * n) ≤ C0 * log (exp 1 * d) → ∀ P0 Q0 : ProbabilitySimplex d, c1 * min 1 (d / (n * log (exp 1 * n))) - 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ fixedL1MinimaxRisk n d := by obtain ⟨c1, hc1, hbound⟩ := h_jhw c0 C0 hc0 hC0 refine ⟨c1, hc1, ?_⟩ intro d n hd hn hlog P0 Q0 exact (sub_le_sub_right (hbound d n hd hn hlog) (8 * exp (-(n : ℝ) * (1 - log 2)))).trans (fixedL1MinimaxRisk_ge_poisson_sub_expTail P0 Q0)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jhw_fixedL1_lower_sub_expTail · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Depoissonization.lean:130
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.L1Embedding 20 declarations Equal-propensity embedding of the normalized two-sample L1 experiment.

Equal-propensity embedding of the normalized two-sample L1 experiment.

def ProbabilitySimplex

For the specified alphabet size, the probability simplex consists of nonnegative weights on the alphabet that sum to one.

Definition (Lean source)
d :
ProbabilitySimplex d :
Type
{R : Fin d → ℝ // (∀ x, 0 ≤ R x) ∧ ∑ x, R x = 1}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.ProbabilitySimplex · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:13
def bernoulliMass

For the specified success probability, binary value, the Bernoulli mass assigns probability p to success and one minus p to failure.

Definition (Lean source)
p :
y :
bernoulliMass p y :
if y then p else 1 - p
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:18
def l1FullMass

For the specified first probability vector, second probability vector, data point or sample, the L1 embedding full-data mass is the consistency-compatible product mass formed from the two simplex weights and their normalized outcome means, and is zero off the consistency event.

Definition (Lean source)
d :
Pv Qv :
z :
l1FullMass Pv Qv z :
s :
Pv.1 z.1 + Qv.1 z.1
mu0 :
Qv.1 z.1 / s
mu1 :
Pv.1 z.1 / s
if z.2.2.1
= (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) then s / 4 * bernoulliMass mu0 z.2.2.2.1 * bernoulliMass mu1 z.2.2.2.2 else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1FullMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:21
theorem l1FullMass_nonneg_sum

the L1 embedding masses are nonnegative and sum to one.

Formal statement
d :
Pv Qv :
conclusion 1
z :
0 ≤ l1FullMass Pv Qv z
conclusion 2
∑ z : FullObs d, ofReal (l1FullMass Pv Qv z) = 1
Proof (Lean source)
lemma l1FullMass_nonneg_sum {d : ℕ} (Pv Qv : ProbabilitySimplex d) : (∀ z, 0 ≤ l1FullMass Pv Qv z) ∧ ∑ z : FullObs d, ofReal (l1FullMass Pv Qv z) = 1 := by classical have hnonneg : ∀ z, 0 ≤ l1FullMass Pv Qv z := by rintro ⟨x, a, y, y0, y1⟩ have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith have hq0 : Qv.1 x = 0 := by nlinarith simp [l1FullMass, bernoulliMass, hp0, hq0] · have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hs) have hmu0 : 0 ≤ Qv.1 x / (Pv.1 x + Qv.1 x) := div_nonneg hq (le_of_lt hspos) have hmu0' : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_left hp) have hmu1 : 0 ≤ Pv.1 x / (Pv.1 x + Qv.1 x) := div_nonneg hp (le_of_lt hspos) have hmu1' : Pv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_right hq) fin_cases a <;> fin_cases y <;> fin_cases y0 <;> fin_cases y1 <;> simp [l1FullMass, bernoulliMass] <;> positivity constructor · exact hnonneg · rw [← ENNReal.ofReal_sum_of_nonneg (fun z _hz => hnonneg z)] have hsum : ∑ z : FullObs d, l1FullMass Pv Qv z = 1 := by rw [Fintype.sum_prod_type] calc ∑ x, ∑ w, l1FullMass Pv Qv (x, w) = ∑ x, (Pv.1 x + Qv.1 x) / 2 := by apply Finset.sum_congr rfl intro x _hx have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith have hq0 : Qv.1 x = 0 := by nlinarith simp [l1FullMass, bernoulliMass, hp0, hq0] · simp [l1FullMass, bernoulliMass, Fintype.sum_prod_type] field_simp [hs] ring _ = 1 := by rw [← Finset.sum_div, Finset.sum_add_distrib, Pv.2.2, Qv.2.2] norm_num rw [hsum] norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1FullMass_nonneg_sum · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:31
def l1Embedding

For the specified first probability vector, second probability vector, the L1 embedding is the potential-outcome law induced by the embedding full-data masses.

Definition (Lean source)
d :
Pv Qv :
l1Embedding Pv Qv :
⟨PMF.ofFintype (fun z => ofReal (l1FullMass Pv Qv z)) (l1FullMass_nonneg_sum Pv Qv).2⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1Embedding · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:79
theorem l1Embedding_spec

The explicit embedding has the four required atom identities, fair propensity, armwise exchangeability, and consistency. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
Pv Qv :
conclusion 1
Consistency (l1Embedding Pv Qv)
conclusion 3
x :
jointMass (observedMarginal (l1Embedding Pv Qv)) x true true = Pv.1 x / 4
conclusion 4
x :
jointMass (observedMarginal (l1Embedding Pv Qv)) x false false = Pv.1 x / 4
conclusion 5
x :
jointMass (observedMarginal (l1Embedding Pv Qv)) x true false = Qv.1 x / 4
conclusion 6
x :
jointMass (observedMarginal (l1Embedding Pv Qv)) x false true = Qv.1 x / 4
Proof (Lean source)
lemma l1Embedding_spec {d : ℕ} (Pv Qv : ProbabilitySimplex d) : Consistency (l1Embedding Pv Qv) ∧ ConditionalExchangeability (l1Embedding Pv Qv) ∧ (∀ x, jointMass (observedMarginal (l1Embedding Pv Qv)) x true true = Pv.1 x / 4) ∧ (∀ x, jointMass (observedMarginal (l1Embedding Pv Qv)) x false false = Pv.1 x / 4) ∧ (∀ x, jointMass (observedMarginal (l1Embedding Pv Qv)) x true false = Qv.1 x / 4) ∧ (∀ x, jointMass (observedMarginal (l1Embedding Pv Qv)) x false true = Qv.1 x / 4) := by classical constructor · rintro ⟨x, a, y, y0, y1⟩ hne simp [l1Embedding, fullMass, l1FullMass, hne] · constructor · intro x r a ya fin_cases r <;> fin_cases a <;> fin_cases ya <;> simp [poArmAtom, poAtom, l1Embedding, fullMass, l1FullMass, bernoulliMass] <;> ring · constructor · intro x simp [jointMass, observedMarginal, l1Embedding, l1FullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] have hq0 : Qv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] simp [hp0, hq0] · have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hs) have hqdiv : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_left hp) have ht1 : 0 ≤ (Pv.1 x + Qv.1 x) / 4 * (Qv.1 x / (Pv.1 x + Qv.1 x)) * (Pv.1 x / (Pv.1 x + Qv.1 x)) := by positivity have ht2 : 0 ≤ (Pv.1 x + Qv.1 x) / 4 * (1 - Qv.1 x / (Pv.1 x + Qv.1 x)) * (Pv.1 x / (Pv.1 x + Qv.1 x)) := by positivity rw [ENNReal.toReal_add (by simp) (by simp)] rw [ENNReal.toReal_ofReal ht1, ENNReal.toReal_ofReal ht2] field_simp [hs] ring · constructor · intro x simp [jointMass, observedMarginal, l1Embedding, l1FullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] have hq0 : Qv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] simp [hp0, hq0] · have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hs) have hpdiv : Pv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_right hq) have hqdiv : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_left hp) rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] field_simp [hs] ring · constructor · intro x simp [jointMass, observedMarginal, l1Embedding, l1FullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] have hq0 : Qv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] simp [hp0, hq0] · have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hs) have hpdiv : Pv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_right hq) have hqdiv : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_left hp) rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] field_simp [hs] ring · intro x simp [jointMass, observedMarginal, l1Embedding, l1FullMass, bernoulliMass, PMF.ofFintype_apply, Finset.sum_filter, Fintype.sum_prod_type] by_cases hs : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] have hq0 : Qv.1 x = 0 := by nlinarith [Pv.2.1 x, Qv.2.1 x] simp [hp0, hq0] · have hp : 0 ≤ Pv.1 x := Pv.2.1 x have hq : 0 ≤ Qv.1 x := Qv.2.1 x have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hs) have hpdiv : Pv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_right hq) have hqdiv : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ 1 := (div_le_one hspos).2 (le_add_of_nonneg_left hp) rw [ENNReal.toReal_add (by simp) (by simp)] repeat' rw [ENNReal.toReal_ofReal (by positivity)] field_simp [hs] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1Embedding_spec · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:87
def l1Distance

For the specified first probability vector, second probability vector, the L1 distance is the sum of absolute differences between the two probability vectors.

Definition (Lean source)
d :
Pv Qv :
l1Distance Pv Qv :
∑ x, |Pv.1 x - Qv.1 x|
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1Distance · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:199
theorem simplexENNReal_sum

the simplex weights, viewed as extended nonnegative reals, sum to one.

Formal statement
d :
∑ x : Fin d, ofReal (P.1 x) = 1
Proof (Lean source)
lemma simplexENNReal_sum {d : ℕ} (P : ProbabilitySimplex d) : ∑ x : Fin d, ofReal (P.1 x) = 1 := by rw [← ENNReal.ofReal_sum_of_nonneg (fun i _hi => P.2.1 i), P.2.2] norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.simplexENNReal_sum · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:203
def simplexPMF

For the specified discrete law, the simplex probability mass function assigns each alphabet point its simplex weight.

Definition (Lean source)
d :
simplexPMF P :
PMF (Fin d)
PMF.ofFintype (fun x => ofReal (P.1 x)) (simplexENNReal_sum P)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.simplexPMF · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:209
def l1SingleKernel

A single paired draw is randomized into one of the four displayed observed atoms.

Definition (Lean source)
d :
l1SingleKernel :
Kernel (Fin d × Fin d) (Obs d)
ProbabilityTheory.Kernel.ofFunOfCountable fun z
=> (map (fun k : Fin 4 => if k = 0 then (z.1, false, false) else if k = 1 then (z.1, true, true) else if k = 2 then (z.2, false, true) else (z.2, true, false)) (uniformOfFintype (Fin 4))).toMeasure
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1SingleKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:213
def l1FixedSampleKernel

The explicit fixed-n product Markov kernel used in the reduction.

Definition (Lean source)
n d :
l1FixedSampleKernel n d :
Kernel (Fin n → (Fin d × Fin d)) (Fin n → Obs d)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1FixedSampleKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:222
def fixedPairLaw

For the specified sample size, pair of probability vectors, the fixed paired-sample law is the product law of independent draws from the two categorical distributions at every sample index.

Definition (Lean source)
d :
n :
fixedPairLaw n PQ :
Measure (Fin n → (Fin d × Fin d))
pi (fun _ : Fin n => (simplexPMF PQ.1).toMeasure.prod (simplexPMF PQ.2).toMeasure)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedPairLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:227
def FixedL1Estimator

For the specified sample size, alphabet size, the fixed-sample L1 estimator is a measurable real-valued statistic of paired categorical samples.

Definition (Lean source)
n d :
FixedL1Estimator n d :
Type
{f : (Fin n → (Fin d × Fin d)) → ℝ // Measurable f}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FixedL1Estimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:234
def fixedL1Risk

For the specified sample size, estimator, pair of probability vectors, the fixed-sample L1 risk is squared-error risk for estimating the L1 distance between two categorical distributions.

Definition (Lean source)
d :
n :
est :
fixedL1Risk n est PQ :
sqRisk (fixedPairLaw n PQ) est.1 (l1Distance PQ.1 PQ.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1Risk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:238
def fixedL1MinimaxRisk

For the specified sample size, alphabet size, the fixed-sample L1 minimax risk is the minimax squared-error risk for the paired categorical experiment.

Definition (Lean source)
n d :
fixedL1MinimaxRisk n d :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fixedL1MinimaxRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:243
def poissonPairLaw

Two independent vectors of Poisson counts with means 2n P_x and 2n Q_x.

Definition (Lean source)
d :
n :
poissonPairLaw n PQ :
Measure ((Fin d → ℕ) × (Fin d → ℕ))
P :
Q :
(countLaw P (2 * n)).prod (countLaw Q (2 * n))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonPairLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:247
def L1Estimator

For the specified alphabet size, the Poissonized L1 estimator is a measurable real-valued statistic of two categorical histograms.

Definition (Lean source)
d :
L1Estimator d :
Type
{f : ((Fin d → ℕ) × (Fin d → ℕ)) → ℝ // Measurable f}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.L1Estimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:256
def poissonL1Risk

For the specified sample size, estimator, pair of probability vectors, the Poissonized L1 risk is squared-error risk for estimating L1 distance from the paired Poisson histograms.

Definition (Lean source)
d :
n :
est :
poissonL1Risk n est PQ :
sqRisk (poissonPairLaw n PQ) est.1 (l1Distance PQ.1 PQ.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonL1Risk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:260
def FiniteRiskL1Estimator

Measurable Poisson-histogram estimators whose squared loss is integrable at every pair of simplex laws and whose worst-case risk is finite. This scopes ordinary real-valued Bochner risk to the finite-risk estimators represented by the cited minimax theorem.

Definition (Lean source)
n d :
FiniteRiskL1Estimator n d :
Type
{est : L1Estimator d // (∀ PQ : ProbabilitySimplex d × ProbabilitySimplex d, Integrable (fun z => (est.1 z - l1Distance PQ.1 PQ.2) ^ 2) (poissonPairLaw n PQ)) ∧ BddAbove (range (poissonL1Risk n est))}
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.FiniteRiskL1Estimator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:265
def poissonL1FiniteRiskMinimaxRisk

The two-sample Poissonized L1 minimax risk over measurable estimators with finite worst-case risk. The finite-risk scope prevents both the Bochner integral and the real supremum from taking junk values.

Definition (Lean source)
n d :
poissonL1FiniteRiskMinimaxRisk n d :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poissonL1FiniteRiskMinimaxRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/L1Embedding.lean:276
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.LowerSplice 6 declarations Numerical and statistical assembly for the lower-bound regime splice.

Numerical and statistical assembly for the lower-bound regime splice.

If the alphabet size satisfies its stated restriction, then the logarithmic alphabet size is positive.

Formal statement
d :
hd :
1 ≤ d
Proof (Lean source)
lemma logAlphabet_pos (d : ℕ) (hd : 1 ≤ d) : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.logAlphabet_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:12

If the alphabet size satisfies its stated restriction, then the logarithmic alphabet size is at least one.

Formal statement
d :
hd :
1 ≤ d
1 ≤ logAlphabet d
Proof (Lean source)
lemma logAlphabet_one_le (d : ℕ) (hd : 1 ≤ d) : 1 ≤ logAlphabet d := by rw [logAlphabet] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * d) := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) (by positivity)) (by simpa only [mul_one] using mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.logAlphabet_one_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:20
theorem eventually_logAlphabet_le_half Lemma eventually_logAlphabet_le_half in the paper ↗

for all sufficiently large alphabets, log(ed)log(ed) is at most d/2d/2.

Formal statement
∃ D : ℕ, ∀ d : ℕ, D ≤ d → logAlphabet d ≤ (d : ℝ) / 2
Proof (Lean source)
lemma eventually_logAlphabet_le_half : ∃ D : ℕ, ∀ d : ℕ, D ≤ d → logAlphabet d ≤ (d : ℝ) / 2 := by have hsmall := Real.isLittleO_log_id_atTop.bound (by norm_num : (0 : ℝ) < 1 / 6) have ht : Tendsto (fun d : ℕ => exp 1 * (d : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop.const_mul_atTop (Real.exp_pos 1) have hev : ∀ᶠ d : ℕ in atTop, logAlphabet d ≤ (d : ℝ) / 2 := by filter_upwards [hsmall.filter_mono ht, eventually_ge_atTop (1 : ℕ)] with d hd hd1 have hlog0 : 0 ≤ log (exp 1 * (d : ℝ)) := (logAlphabet_one_le d hd1).trans' (by norm_num) have hd0 : 0 ≤ (d : ℝ) := by positivity have he : exp 1 < 3 := Real.exp_one_lt_three change ‖Real.log (exp 1 * (d : ℝ))‖ ≤ (1 / 6 : ℝ) * ‖id (exp 1 * (d : ℝ))‖ at hd rw [Real.norm_eq_abs, abs_of_nonneg hlog0, Real.norm_eq_abs] at hd have hd' : log (exp 1 * (d : ℝ)) ≤ (1 / 6 : ℝ) * (exp 1 * d) := by simpa only [id_eq, abs_of_nonneg (mul_nonneg (Real.exp_nonneg 1) hd0)] using hd unfold logAlphabet calc log (exp 1 * (d : ℝ)) ≤ (1 / 6) * (exp 1 * d) := hd' _ ≤ d / 2 := by nlinarith [mul_le_mul_of_nonneg_right he.le hd0] simpa only [eventually_atTop] using hev
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.eventually_logAlphabet_le_half · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:30

If the stated c condition holds, then beyond a finite sample-size cutoff, the paired Poisson tail is absorbed by the stated constant bounds.

Formal statement
c :
hc :
0 < c
∃ N : ℕ,
2 ≤ N
conclusion 1
n :
N ≤ n
8 * exp (-(n : ℝ) * (1 - log 2)) ≤ c / (2 * n)
8 * exp (-(n : ℝ) * (1 - log 2)) ≤ c / 2
Proof (Lean source)
lemma pairedTail_cutoff (c : ℝ) (hc : 0 < c) : ∃ N : ℕ, 2 ≤ N ∧ ∀ n : ℕ, N ≤ n → 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ c / (2 * n) ∧ 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ c / 2 := by have ha : 0 < 1 - log 2 := by linarith [Real.log_two_lt_d9] have htReal := tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero 1 (1 - log 2) ha have ht : Tendsto (fun n : ℕ => (n : ℝ) * exp (-(n : ℝ) * (1 - log 2))) atTop (nhds 0) := by convert htReal.comp tendsto_natCast_atTop_atTop using 1 funext n simp only [Function.comp_apply, Real.rpow_one] congr 2 <;> ring rw [Metric.tendsto_atTop] at ht obtain ⟨N0, hN0⟩ := ht (c / 16) (by positivity) refine ⟨max 2 N0, Nat.le_max_left _ _, ?_⟩ intro n hn have hn0 : N0 ≤ n := le_trans (Nat.le_max_right _ _) hn have hn2 : 2 ≤ n := le_trans (Nat.le_max_left _ _) hn have hnR : (0 : ℝ) < n := by positivity have hdist := hN0 n hn0 rw [Real.dist_eq, sub_zero, abs_of_nonneg (mul_nonneg (by positivity) (Real.exp_nonneg _))] at hdist constructor · apply (le_div_iff₀ (mul_pos (by norm_num) hnR)).2 nlinarith · have htail_nonneg : 0 ≤ 8 * exp (-(n : ℝ) * (1 - log 2)) := by positivity have hone : (1 : ℝ) ≤ n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hn2) nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pairedTail_cutoff · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:54

For the specified sample size, the saturated alphabet size is the ceiling of sample size times its logarithmic scale.

Definition (Lean source)
n :
saturatedAlphabet n :
⌈(n : ℝ) * log (exp 1 * n)⌉₊
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.saturatedAlphabet · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:86
theorem saturatedAlphabet_properties Lemma saturatedAlphabet_properties in the paper ↗

If the sample size satisfies its stated restriction, and the alphabet size satisfies its stated restriction, and the stated sat condition holds, then the saturated alphabet is at least two, fits inside the original alphabet, meets the L1 lower-bound gate, and has the stated logarithmic ratio bounds.

Formal statement
n d :
hn :
2 ≤ n
hd :
2 ≤ d
hsat :
(n : ℝ) < (1 / 4 : ℝ) * d / logAlphabet d
2 ≤ s
s ≤ d
(1 / 4 : ℝ) * s / log (exp 1 * s) ≤ n
log (exp 1 * n) ≤ 2 * log (exp 1 * s)
1 ≤ (s : ℝ) / (n * log (exp 1 * n))
Proof (Lean source)
lemma saturatedAlphabet_properties (n d : ℕ) (hn : 2 ≤ n) (hd : 2 ≤ d) (hsat : (n : ℝ) < (1 / 4 : ℝ) * d / logAlphabet d) : let s := saturatedAlphabet n 2 ≤ s ∧ s ≤ d ∧ (1 / 4 : ℝ) * s / log (exp 1 * s) ≤ n ∧ log (exp 1 * n) ≤ 2 * log (exp 1 * s) ∧ 1 ≤ (s : ℝ) / (n * log (exp 1 * n)) := by let Ln := log (exp 1 * (n : ℝ)) let Ld := logAlphabet d let s := saturatedAlphabet n have hnR : (0 : ℝ) < n := by positivity have hdR : (0 : ℝ) < d := by positivity have hLn1 : 1 ≤ Ln := by dsimp [Ln] exact logAlphabet_one_le n (by omega) have hLd : 0 < Ld := logAlphabet_pos d (by omega) have hLd1 : 1 ≤ Ld := logAlphabet_one_le d (by omega) have hnd : n < d := by have hfour : (n : ℝ) * Ld < d / 4 := by apply (lt_div_iff₀ hLd).mp at hsat nlinarith have : (n : ℝ) < d := by nlinarith [mul_le_mul_of_nonneg_left hLd1 hnR.le] exact_mod_cast this have hLnLd : Ln ≤ Ld := by dsimp [Ln, Ld] have hndR : (n : ℝ) ≤ d := by exact_mod_cast hnd.le exact Real.strictMonoOn_log.monotoneOn (show 0 < exp 1 * (n : ℝ) by positivity) (show 0 < exp 1 * (d : ℝ) by positivity) (mul_le_mul_of_nonneg_left hndR (Real.exp_nonneg 1)) have hprod_lt : (n : ℝ) * Ln < d := by have hfour : (n : ℝ) * Ld < d / 4 := by apply (lt_div_iff₀ hLd).mp at hsat nlinarith nlinarith [mul_le_mul_of_nonneg_left hLnLd hnR.le] have hs_le : s ≤ d := by apply Nat.ceil_le.mpr exact hprod_lt.le have hprod_le_s : (n : ℝ) * Ln ≤ s := by exact Nat.le_ceil _ have hn_le_s : n ≤ s := by exact_mod_cast (calc (n : ℝ) ≤ n * Ln := by nlinarith _ ≤ s := hprod_le_s) have hs2 : 2 ≤ s := le_trans hn hn_le_s have hLs : Ln ≤ log (exp 1 * (s : ℝ)) := by dsimp [Ln] have hnsR : (n : ℝ) ≤ s := by exact_mod_cast hn_le_s exact Real.strictMonoOn_log.monotoneOn (show 0 < exp 1 * (n : ℝ) by positivity) (show 0 < exp 1 * (s : ℝ) by positivity) (mul_le_mul_of_nonneg_left hnsR (Real.exp_nonneg 1)) have hs_upper : (s : ℝ) ≤ 2 * n * Ln := by have hceil := Nat.ceil_lt_add_one (mul_nonneg hnR.le (le_trans (by norm_num) hLn1)) change (s : ℝ) < (n : ℝ) * Ln + 1 at hceil have hn2R : (2 : ℝ) ≤ n := by exact_mod_cast hn have hprod_ge : 2 ≤ (n : ℝ) * Ln := by nlinarith [mul_le_mul_of_nonneg_left hLn1 hnR.le] nlinarith have hLspos : 0 < log (exp 1 * (s : ℝ)) := lt_of_lt_of_le (by positivity : 0 < Ln) hLs refine ⟨hs2, hs_le, ?_, by nlinarith, ?_⟩ · apply (div_le_iff₀ hLspos).2 nlinarith [hs_upper, mul_le_mul_of_nonneg_left hLs (by positivity : (0 : ℝ) ≤ n)] · apply (le_div_iff₀ (mul_pos hnR (by positivity : 0 < Ln))).2 simpa [mul_assoc] using hprod_le_s
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.saturatedAlphabet_properties · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/LowerSplice.lean:90
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotControl 30 declarations Moment, bias, and variance control for the pilot-local factorial construction.

Moment, bias, and variance control for the pilot-local factorial construction.

def canonicalJacksonTuning

A concrete universal tuning with the promoted self-normalized Poisson radius and a cutoff strictly above the smallest admissible alphabet.

Definition (Lean source)
canonicalJacksonTuning :
clause 1
pilotRadiusConstant := universalH
clause 2
jacksonDegreeConstant := 1 / 100000
clause 3
boundedAlphabetCutoff := 3
clause 4
pilotRadiusConstant_pos := universalH_pos
clause 5
jacksonDegreeConstant_pos := by norm_num
clause 6
jacksonDegreeConstant_lt_one := by norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonTuning · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:18
theorem canonicalJacksonTuning_cutoff Lemma canonicalJacksonTuning_cutoff in the paper ↗

the canonical bounded-alphabet cutoff is strictly greater than two.

Formal statement
2 < canonicalJacksonTuning.boundedAlphabetCutoff
Proof (Lean source)
lemma canonicalJacksonTuning_cutoff : 2 < canonicalJacksonTuning.boundedAlphabetCutoff := by norm_num [canonicalJacksonTuning]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonTuning_cutoff · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:31
def pilotEvaluationLaw

Independent pilot and evaluation Poisson counts in all four coordinates.

Definition (Lean source)
m :
q :
Cell → ℝ
pilotEvaluationLaw m q :
Measure ((Cell → ℕ) × (Cell → ℕ))
(Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)).prod (Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotEvaluationLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:36
def UncappedCountTable

A complete table of pilot and evaluation counts, before the fixed-sample cap is imposed.

Definition (Lean source)
d :
UncappedCountTable d :
Type
(Fin d → Cell → ℕ) × (Fin d → Cell → ℕ)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.UncappedCountTable · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:42
def uncappedFairMarkLaw

The fair mark law used in the uncapped Poisson comparison experiment.

Definition (Lean source)
uncappedFairMarkLaw :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedFairMarkLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:46
instance instIsProbabilityMeasureBoolUncappedFairMarkLaw

the fair uncapped mark law is a probability measure.

Definition (Lean source)
instance : IsProbabilityMeasure uncappedFairMarkLaw := by unfold uncappedFairMarkLaw infer_instance
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.instIsProbabilityMeasureBoolUncappedFairMarkLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:50
def uncappedMarkedCountMap

Read the total count and the pilot/evaluation cell-count tables from a marked finite sample.

Definition (Lean source)
d :
s :
FiniteSample (Obs d × Bool)
uncappedMarkedCountMap s :
(s.count, ((fun x j => ∑ i : Fin s.count, if (s.points i).2 = false ∧ (s.points i).1.1 = x ∧ (s.points i).1.2.1 = finTwoEquiv j.1 ∧ (s.points i).1.2.2 = finTwoEquiv j.2 then 1 else 0), (fun x j => ∑ i : Fin s.count, if (s.points i).2 = true ∧ (s.points i).1.1 = x ∧ (s.points i).1.2.1 = finTwoEquiv j.1 ∧ (s.points i).1.2.2 = finTwoEquiv j.2 then 1 else 0)))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:55
theorem measurable_uncappedMarkedCountMap Lemma measurable_uncappedMarkedCountMap in the paper ↗

The full marked count-table readout is measurable on the finite-sample space. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
Proof (Lean source)
@[fun_prop] lemma measurable_uncappedMarkedCountMap {d : ℕ} : Measurable (uncappedMarkedCountMap (d := d)) := by intro s hs rw [MeasurableSpace.measurableSet_iInf] intro k change MeasurableSet ((fun x : Fin k → Obs d × Bool => uncappedMarkedCountMap ⟨k, x⟩) ⁻¹' s) exact hs.preimage (measurable_of_countable _)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_uncappedMarkedCountMap · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:69
def uncappedMarkedCountLaw

The uncapped experiment induced by M ~ Pois(n/4), i.i.d. observations, and fair marks.

Definition (Lean source)
d :
n :
P :
uncappedMarkedCountLaw n P :
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:79
theorem uncappedMarkedCountLaw_count

The total coordinate of the uncapped marked experiment retains its original Poisson count law. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
n :
P :
Measure.map fst (uncappedMarkedCountLaw n P)
= poissonMeasure (toNNReal ((n : ℝ) / 4))
Proof (Lean source)
lemma uncappedMarkedCountLaw_count {d : ℕ} (n : ℕ) (P : DiscreteLaw d) : Measure.map fst (uncappedMarkedCountLaw n P) = poissonMeasure (toNNReal ((n : ℝ) / 4)) := by unfold uncappedMarkedCountLaw rw [Measure.map_map measurable_fst measurable_uncappedMarkedCountMap] change Measure.map FiniteSample.count (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal ((n : ℝ) / 4))) = _ exact finitePoissonSampleLaw_map_count _ _
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw_count · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:87
def pilotEvaluationTableLaw

Independent pilot and evaluation count tables, each having mean scale m.

Definition (Lean source)
d :
m :
P :
pilotEvaluationTableLaw m P :
(Measure.pi (fun x : Fin d => Measure.pi (fun j : Cell => poissonMeasure (m * jointMass P x (finTwoEquiv j.1) (finTwoEquiv j.2)).toNNReal))).prod (Measure.pi (fun x : Fin d => Measure.pi (fun j : Cell => poissonMeasure (m * jointMass P x (finTwoEquiv j.1) (finTwoEquiv j.2)).toNNReal)))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotEvaluationTableLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:382
theorem uncappedMarkedCountLaw_table

The table component of the uncapped marked experiment is the full product of independent pilot and evaluation Poisson count tables at scale n / 8. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
n :
P :
Measure.map snd (uncappedMarkedCountLaw n P) = pilotEvaluationTableLaw (n / 8) P
Proof (Lean source)
lemma uncappedMarkedCountLaw_table {d : ℕ} (n : ℕ) (P : DiscreteLaw d) : Measure.map snd (uncappedMarkedCountLaw n P) = pilotEvaluationTableLaw (n / 8) P := by unfold uncappedMarkedCountLaw rw [Measure.map_map measurable_snd measurable_uncappedMarkedCountMap] rw [show snduncappedMarkedCountMap = uncappedHistogramToTable ∘ uncappedMarkedHistogram by funext s exact uncappedMarkedCountMap_snd s] rw [← Measure.map_map measurable_uncappedHistogramToTable measurable_uncappedMarkedHistogram] rw [uncappedMarkedHistogram_law] change Measure.map (uncappedHistogramTableEquiv d) _ = _ apply Measure.ext_of_singleton intro T rw [Measure.map_apply (uncappedHistogramTableEquiv d).measurable (MeasurableSet.singleton T)] rw [show (uncappedHistogramTableEquiv d) ⁻¹' ({T} : Set (UncappedCountTable d)) = {(uncappedHistogramTableEquiv d).symm T} by ext H constructor · intro h calc H = (uncappedHistogramTableEquiv d).symm ((uncappedHistogramTableEquiv d) H) := ((uncappedHistogramTableEquiv d).symm_apply_apply H).symm _ = (uncappedHistogramTableEquiv d).symm T := by rw [h] · intro h simp only [Set.mem_singleton_iff] at h subst H simpa only [Set.mem_preimage, Set.mem_singleton_iff] using (uncappedHistogramTableEquiv d).apply_symm_apply T] have hcellMass (x : Fin d) (a y b : Bool) : (uncappedAtomicPartition d).cellMass ((obsLaw P).prod uncappedFairMarkLaw) ((x, a, y), b) = (jointMass P x a y / 2).toNNReal := by simp only [FiniteMeasurablePartition.cellMass, FiniteMeasurablePartition.cellSet, uncappedAtomicPartition, id_eq, Set.preimage_id'] rw [show ({((x, a, y), b)} : Set (Obs d × Bool)) = ({(x, a, y)} : Set (Obs d)) ×ˢ ({b} : Set Bool) by ext; simp] change (((obsLaw P).prod uncappedFairMarkLaw) (({(x, a, y)} : Set (Obs d)) ×ˢ ({b} : Set Bool))).toNNReal = _ rw [Measure.prod_prod] simp [obsLaw, uncappedFairMarkLaw, jointMass, PMF.toMeasure_apply_singleton] apply NNReal.eq simp [ENNReal.coe_toNNReal_eq_toReal] rw [max_eq_left (div_nonneg ENNReal.toReal_nonneg (by norm_num))] ring unfold pilotEvaluationTableLaw rw [show ({T} : Set (UncappedCountTable d)) = {T.1} ×ˢ {T.2} by ext z simp [Prod.ext_iff], Measure.prod_prod] simp [Measure.pi_pi, uncappedHistogramTableEquiv, uncappedTableToHistogram, hcellMass] rw [Fintype.prod_prod_type] have hmean (x : Fin d) (a y : Bool) : (n / 4 : ℝ).toNNReal * (jointMass P x a y / 2).toNNReal = (n / 8 * jointMass P x a y : ℝ).toNNReal := by have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have hq0 : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg apply NNReal.eq simp only [NNReal.coe_mul] rw [Real.coe_toNNReal _ (div_nonneg hn0 (by norm_num)), Real.coe_toNNReal _ (div_nonneg hq0 (by norm_num)), Real.coe_toNNReal _ (mul_nonneg (div_nonneg hn0 (by norm_num)) hq0)] ring simp_rw [hmean] rw [Fintype.prod_prod_type] simp_rw [Fintype.prod_bool] simp only [if_true, Bool.false_eq_true, if_false] simp_rw [Finset.prod_mul_distrib] have hreindex (R : Fin d → Cell → ℕ) (x : Fin d) : (∏ ay : Bool × Bool, poissonMeasure (n / 8 * jointMass P x ay.1 ay.2).toNNReal {R x (finTwoEquiv.symm ay.1, finTwoEquiv.symm ay.2)}) = ∏ j : Cell, poissonMeasure (n / 8 * jointMass P x (finTwoEquiv j.1) (finTwoEquiv j.2)).toNNReal {R x j} := by symm apply Fintype.prod_equiv (finTwoEquiv.prodCongr finTwoEquiv) intro j simp simp_rw [hreindex] ac_rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountLaw_table · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:393
theorem pilotEvaluationTableLaw_cell

Each cell projection of the full independent count table is exactly the four-coordinate pilot/evaluation product law used by the cell statistic. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
m :
P :
x :
Fin d
Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P)
Proof (Lean source)
lemma pilotEvaluationTableLaw_cell {d : ℕ} (m : ℝ) (P : DiscreteLaw d) (x : Fin d) : Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P) = pilotEvaluationLaw m (cellVector P x) := by unfold pilotEvaluationTableLaw pilotEvaluationLaw change Measure.map (map (Function.eval x) (Function.eval x)) _ = _ rw [← Measure.map_prod_map] · simp [Measure.pi_map_eval, cellVector] · fun_prop · fun_prop
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotEvaluationTableLaw_cell · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:484
def conditionalEvaluationExpectation

Conditional expectation over evaluation counts after fixing the pilot table.

Definition (Lean source)
m :
q :
Cell → ℝ
_pilot :
Cell → ℕ
f :
(Cell → ℕ) → ℝ
conditionalEvaluationExpectation m q _pilot f :
∫ eval, f eval ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.conditionalEvaluationExpectation · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:496
theorem conditionalEvaluationExpectation_centeredFactorial Lemma conditionalEvaluationExpectation_centeredFactorial in the paper ↗

Conditional on any pilot table, a coordinatewise centered factorial lift has the centered-power expectation under the independent evaluation law. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
pilot :
Cell → ℕ
j :
z :
h :
conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z)
= (q j - z) ^ h
Proof (Lean source)
lemma conditionalEvaluationExpectation_centeredFactorial (m : ℝ) (hm : 0 < m) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (pilot : Cell → ℕ) (j : Cell) (z : ℝ) (h : ℕ) : conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z) = (q j - z) ^ h := by unfold conditionalEvaluationExpectation change (∫ eval : Cell → ℕ, centeredFactorial m h (eval j) z ∂Measure.pi (fun i : Cell => poissonMeasure (m * q i).toNNReal)) = _ calc _ = ∫ N : ℕ, centeredFactorial m h N z ∂poissonMeasure (m * q j).toNNReal := by exact MeasureTheory.integral_comp_eval (μ := fun i : Cell => poissonMeasure (m * q i).toNNReal) (i := j) (Measurable.of_discrete.aestronglyMeasurable : AEStronglyMeasurable (fun N : ℕ => centeredFactorial m h N z) (poissonMeasure (m * q j).toNNReal)) _ = _ := integral_centeredFactorial_poisson m (q j) z hm (hq j) h
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.conditionalEvaluationExpectation_centeredFactorial · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:503
theorem conditionalEvaluationExpectation_centeredFactorial_mul_expanded Lemma conditionalEvaluationExpectation_centeredFactorial_mul_expanded in the paper ↗

Conditional on any pilot table, the product of two centered factorial lifts has the raw finite overlap expansion inherited from its scalar Poisson coordinate. This is the pre-collapse form of the paper's second moment identity. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
q :
Cell → ℝ
pilot :
Cell → ℕ
j :
z :
h t :
conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z)
= ∑ b ∈ range (t + 1), ∑ a ∈ range (h + 1), ((Nat.choose h a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((Nat.choose t b : ℝ) * (-z) ^ (t - b) / m ^ b) * (∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * ((m * q j).toNNReal : ℝ) ^ (a + b - l))
Proof (Lean source)
lemma conditionalEvaluationExpectation_centeredFactorial_mul_expanded (m : ℝ) (q : Cell → ℝ) (pilot : Cell → ℕ) (j : Cell) (z : ℝ) (h t : ℕ) : conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z) = ∑ b ∈ range (t + 1), ∑ a ∈ range (h + 1), ((Nat.choose h a : ℝ) * (-z) ^ (h - a) / m ^ a) * ((Nat.choose t b : ℝ) * (-z) ^ (t - b) / m ^ b) * (∑ l ∈ range (min a b + 1), (Nat.choose a l : ℝ) * Nat.choose b l * factorial l * ((m * q j).toNNReal : ℝ) ^ (a + b - l)) := by unfold conditionalEvaluationExpectation change (∫ eval : Cell → ℕ, centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z ∂Measure.pi (fun i : Cell => poissonMeasure (m * q i).toNNReal)) = _ calc _ = ∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂poissonMeasure (m * q j).toNNReal := by exact MeasureTheory.integral_comp_eval (μ := fun i : Cell => poissonMeasure (m * q i).toNNReal) (i := j) (Measurable.of_discrete.aestronglyMeasurable : AEStronglyMeasurable (fun N : ℕ => centeredFactorial m h N z * centeredFactorial m t N z) (poissonMeasure (m * q j).toNNReal)) _ = _ := integral_centeredFactorial_mul_poisson_expanded (m * q j).toNNReal m z h t
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.conditionalEvaluationExpectation_centeredFactorial_mul_expanded · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:524
theorem conditionalEvaluationExpectation_centeredFactorial_mul

Conditional on the pilot table, the product of two centered factorial lifts has the collapsed overlap expansion from the paper. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
pilot :
Cell → ℕ
j :
z :
h t :
conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z)
= ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (q j / m) ^ l * (q j - z) ^ (h + t - 2 * l)
Proof (Lean source)
lemma conditionalEvaluationExpectation_centeredFactorial_mul (m : ℝ) (hm : 0 < m) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (pilot : Cell → ℕ) (j : Cell) (z : ℝ) (h t : ℕ) : conditionalEvaluationExpectation m q pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z) = ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (q j / m) ^ l * (q j - z) ^ (h + t - 2 * l) := by unfold conditionalEvaluationExpectation change (∫ eval : Cell → ℕ, centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z ∂Measure.pi (fun i : Cell => poissonMeasure (m * q i).toNNReal)) = _ calc _ = ∫ N : ℕ, centeredFactorial m h N z * centeredFactorial m t N z ∂poissonMeasure (m * q j).toNNReal := by exact MeasureTheory.integral_comp_eval (μ := fun i : Cell => poissonMeasure (m * q i).toNNReal) (i := j) (Measurable.of_discrete.aestronglyMeasurable : AEStronglyMeasurable (fun N : ℕ => centeredFactorial m h N z * centeredFactorial m t N z) (poissonMeasure (m * q j).toNNReal)) _ = _ := integral_centeredFactorial_mul_poisson m (q j) z hm (hq j) h t
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.conditionalEvaluationExpectation_centeredFactorial_mul · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:554
def cellStatisticExpectation

For the specified tuning rule, overlap level, alphabet size, Poisson intensity, cell-mass vector, positive-intensity certificate, the cell-statistic expectation is the mean of the Jackson cell statistic under the pilot-evaluation law.

Definition (Lean source)
tuning :
epsilon :
d :
m :
q :
Cell → ℝ
hm :
0 < m
cellStatisticExpectation tuning epsilon d m q hm :
∫ z, jacksonCellStatistic tuning epsilon d m z.1 z.2 hm ∂pilotEvaluationLaw m q
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellStatisticExpectation · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:581
def cellStatisticVariance

For the specified tuning rule, overlap level, alphabet size, Poisson intensity, cell-mass vector, positive-intensity certificate, the cell-statistic variance is the mean squared deviation of the Jackson cell statistic from its expectation under the pilot-evaluation law.

Definition (Lean source)
tuning :
epsilon :
d :
m :
q :
Cell → ℝ
hm :
0 < m
cellStatisticVariance tuning epsilon d m q hm :
e :
cellStatisticExpectation tuning epsilon d m q hm
∫ z, (jacksonCellStatistic tuning epsilon d m z.1 z.2 hm - e) ^ 2 ∂pilotEvaluationLaw m q
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellStatisticVariance · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:586
theorem jacksonCellStatistic_eq_clipAround

The estimator's nested maximum/minimum is exactly clipping around the pilot-center target at the declared random radius. This bridge lets the generic clipping-risk inequalities apply without unfolding the estimator. This uses the Poisson intensity is positive. The displayed identity or bound is the asserted conclusion.

Formal statement
tuning :
epsilon :
d :
m :
pilot eval :
Cell → ℕ
hm :
0 < m
jacksonCellStatistic tuning epsilon d m pilot eval hm
= let Q := pilotRectangle tuning m d pilot let center := rectangleCenter Q let radius := rectangleRadius Q let p := jacksonTensorPolynomial epsilon (jacksonDegree tuning d) (jacksonDegree_ge_two tuning d) Q (pilotRectangle_valid tuning m d pilot hm) (pilotRectangle_nonneg tuning m d pilot) let centerValue := globalCellValue epsilon center let raw := centerValue
+ factorialPolynomialLift m p eval center radius centerValue let scale := (1 + epsilon⁻¹) * ∑ j : Cell, radius j clipAround centerValue (d ^ (1 / 4 : ℝ) * scale) raw
Proof (Lean source)
lemma jacksonCellStatistic_eq_clipAround (tuning : JacksonTuning) (epsilon : ℝ) (d : ℕ) (m : ℝ) (pilot eval : Cell → ℕ) (hm : 0 < m) : jacksonCellStatistic tuning epsilon d m pilot eval hm = let Q := pilotRectangle tuning m d pilot let center := rectangleCenter Q let radius := rectangleRadius Q let p := jacksonTensorPolynomial epsilon (jacksonDegree tuning d) (jacksonDegree_ge_two tuning d) Q (pilotRectangle_valid tuning m d pilot hm) (pilotRectangle_nonneg tuning m d pilot) let centerValue := globalCellValue epsilon center let raw := centerValue + factorialPolynomialLift m p eval center radius centerValue let scale := (1 + epsilon⁻¹) * ∑ j : Cell, radius j clipAround centerValue (d ^ (1 / 4 : ℝ) * scale) raw := by simp only [jacksonCellStatistic, clipAround] congr 1 ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonCellStatistic_eq_clipAround · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:593
def pilotGoodEvent

The paper's good-pilot event G_x = ⋂_j {|N'_{j,x}/m - q_{j,x}| ≤ h_{j,x}/4}. This is deliberately stronger than mere membership of q_x in the (radius-h) pilot rectangle.

Definition (Lean source)
tuning :
m :
d :
pilot :
Cell → ℕ
q :
Cell → ℝ
j :
pilotGoodEvent tuning m d pilot q :
Prop
|pilotCenter m pilot j - q j| ≤ pilotRadius tuning m d pilot j / 4
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotGoodEvent · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:613
theorem pilotGoodEvent_mem_pilotRectangle

On the coordinatewise good-pilot event, the true cell vector belongs to the random pilot rectangle. This includes zero coordinates because the lower endpoint is truncated at zero. This uses the cell masses satisfy their stated restrictions, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
tuning :
m :
d :
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
hgood :
pilotGoodEvent tuning m d pilot q
j :
q j ∈ Icc ((pilotRectangle tuning m d pilot).1 j) ((pilotRectangle tuning m d pilot).2 j)
Proof (Lean source)
lemma pilotGoodEvent_mem_pilotRectangle (tuning : JacksonTuning) (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hgood : pilotGoodEvent tuning m d pilot q) : ∀ j, q j ∈ Icc ((pilotRectangle tuning m d pilot).1 j) ((pilotRectangle tuning m d pilot).2 j) := by intro j have habs := hgood j have hr : 0 ≤ pilotRadius tuning m d pilot j := by nlinarith [abs_nonneg (pilotCenter m pilot j - q j)] have hdifference := (abs_le.mp habs).1 have hdifference' := (abs_le.mp habs).2 simp only [pilotRectangle] constructor · apply max_le (hq j) linarith · linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotGoodEvent_mem_pilotRectangle · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:621
theorem pilotRectangle_radius_bounds

The radius of the zero-truncated pilot interval lies between one half and one times the untruncated radius. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
tuning :
m :
d :
pilot :
Cell → ℕ
hm :
0 < m
hd :
1 ≤ d
j :
conclusion 1
pilotRadius tuning m d pilot j / 2 ≤ rectangleRadius (pilotRectangle tuning m d pilot) j
conclusion 2
rectangleRadius (pilotRectangle tuning m d pilot) j ≤ pilotRadius tuning m d pilot j
Proof (Lean source)
lemma pilotRectangle_radius_bounds (tuning : JacksonTuning) (m : ℝ) (d : ℕ) (pilot : Cell → ℕ) (hm : 0 < m) (hd : 1 ≤ d) : ∀ j, pilotRadius tuning m d pilot j / 2 ≤ rectangleRadius (pilotRectangle tuning m d pilot) j ∧ rectangleRadius (pilotRectangle tuning m d pilot) j ≤ pilotRadius tuning m d pilot j := by intro j have hc : 0 ≤ pilotCenter m pilot j := by unfold pilotCenter positivity have hr : 0 < pilotRadius tuning m d pilot j := by have hrect := pilotRectangle_radius_pos tuning m d pilot hm hd j simp only [rectangleRadius, pilotRectangle] at hrect by_cases h : pilotCenter m pilot j - pilotRadius tuning m d pilot j ≤ 0 · rw [max_eq_left h] at hrect linarith · rw [max_eq_right (le_of_not_ge h)] at hrect linarith simp only [rectangleRadius, pilotRectangle] by_cases h : pilotCenter m pilot j - pilotRadius tuning m d pilot j ≤ 0 · rw [max_eq_left h] constructor <;> linarith · rw [max_eq_right (le_of_not_ge h)] constructor <;> linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotRectangle_radius_bounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:642
theorem canonicalNormalizedAggregateScore_eq

For the canonical tuning, the promoted normalized aggregate score is exactly the sum of the pilot deviations and the untruncated pilot radii. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot
= ∑ j : Cell, (|pilotCenter m pilot j - q j| + pilotRadius canonicalJacksonTuning m d pilot j)
Proof (Lean source)
lemma canonicalNormalizedAggregateScore_eq (m : ℝ) (hm : 0 < m) (d : ℕ) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot = ∑ j : Cell, (|pilotCenter m pilot j - q j| + pilotRadius canonicalJacksonTuning m d pilot j) := by apply Finset.sum_congr rfl intro j _hj simp only [ normalizedDeviation, normalizedRadius, pilotCenter, pilotRadius, canonicalJacksonTuning, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j)] ring_nf
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalNormalizedAggregateScore_eq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:670
theorem canonicalPilotGeometry_le_normalizedAggregateScore

The center displacement and the sum of the actual (zero-truncated) rectangle radii are pointwise dominated by the promoted aggregate score. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot
Proof (Lean source)
lemma canonicalPilotGeometry_le_normalizedAggregateScore (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : l1CellDistance (rectangleCenter (pilotRectangle canonicalJacksonTuning m d pilot)) q + ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot := by rw [canonicalNormalizedAggregateScore_eq m hm d pilot q hq] unfold l1CellDistance rw [← Finset.sum_add_distrib] apply Finset.sum_le_sum intro j _hj have htriangle : |rectangleCenter (pilotRectangle canonicalJacksonTuning m d pilot) j - q j| ≤ |rectangleCenter (pilotRectangle canonicalJacksonTuning m d pilot) j - pilotCenter m pilot j| + |pilotCenter m pilot j - q j| := by simpa only [sub_add_sub_cancel] using abs_add_le (rectangleCenter (pilotRectangle canonicalJacksonTuning m d pilot) j - pilotCenter m pilot j) (pilotCenter m pilot j - q j) have hsplit : |rectangleCenter (pilotRectangle canonicalJacksonTuning m d pilot) j - pilotCenter m pilot j| + rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j = pilotRadius canonicalJacksonTuning m d pilot j := by simp only [rectangleCenter, rectangleRadius, pilotRectangle] have hp : 0 ≤ pilotCenter m pilot j := by unfold pilotCenter positivity have hr0 : 0 ≤ pilotRadius canonicalJacksonTuning m d pilot j := by have hrect := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd j have hlo := (pilotRectangle_radius_bounds canonicalJacksonTuning m d pilot hm hd j).1 have hhi := (pilotRectangle_radius_bounds canonicalJacksonTuning m d pilot hm hd j).2 linarith by_cases h : pilotCenter m pilot j - pilotRadius canonicalJacksonTuning m d pilot j ≤ 0 · rw [max_eq_left h, abs_of_nonneg] · ring · linarith · rw [max_eq_right (le_of_not_ge h)] simp linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotGeometry_le_normalizedAggregateScore · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:691
theorem pilotGoodEvent_compl_eq_normalizedBadAny

For the canonical radius constant, failure of the paper's pilot event is exactly the promoted self-normalized Poisson bad event. This uses the Poisson intensity is positive, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
{pilot : Cell → ℕ | ¬ pilotGoodEvent canonicalJacksonTuning m d pilot q}
= normalizedBadAny (fun j (pilot : Cell → ℕ) => pilot j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)
Proof (Lean source)
lemma pilotGoodEvent_compl_eq_normalizedBadAny (m : ℝ) (hm : 0 < m) (d : ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : {pilot : Cell → ℕ | ¬ pilotGoodEvent canonicalJacksonTuning m d pilot q} = normalizedBadAny (fun j (pilot : Cell → ℕ) => pilot j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) := by classical ext pilot simp only [Set.mem_setOf_eq, normalizedBadAny, Set.mem_ofPred_eq, pilotGoodEvent, not_forall, not_le] apply exists_congr intro j simp only [pilotCenter, pilotRadius, normalizedDeviation, normalizedRadius, canonicalJacksonTuning, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j)] have hsqrt : sqrt ((pilot j : ℝ) / m * logAlphabet d / m) = sqrt ((pilot j : ℝ) / m * (logAlphabet d / m)) := by congr 1 ring rw [hsqrt] ring_nf
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotGoodEvent_compl_eq_normalizedBadAny · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:741
theorem canonicalPilotBadMoment Lemma canonicalPilotBadMoment in the paper ↗

The promoted four-coordinate Poisson theorem applies directly to a pilot array with independent coordinate laws. This uses the Poisson intensity is positive, and the argument satisfies the stated support or positivity restriction, and the Lipschitz scale is positive. The displayed identity or bound is the asserted conclusion.

Formal statement
q :
m :
hm :
0 < m
t :
ht :
t = 1 ∨ t = 2 ∨ t = 4
L :
hL :
1 ≤ L
∫ pilot : Cell → ℕ, (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH L m q).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH L m q pilot ^ t) pilot ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j))
productMomentConstant 4 t * exp (-20 * L) * (sqrt (((∑ j, (q j : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t
Proof (Lean source)
lemma canonicalPilotBadMoment (q : CellNNReal) (m : NNReal) (hm : 0 < m) {t : ℕ} (ht : t = 1 ∨ t = 2 ∨ t = 4) {L : ℝ} (hL : 1 ≤ L) : ∫ pilot : Cell → ℕ, (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH L m q).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH L m q pilot ^ t) pilot ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j)) ≤ productMomentConstant 4 t * exp (-20 * L) * (sqrt (((∑ j, (q j : ℝ)) * L) / (m : ℝ)) + L / (m : ℝ)) ^ t := by let μ : Measure (Cell → ℕ) := Measure.pi (fun j : Cell => poissonMeasure (m * q j)) letI : IsProbabilityMeasure μ := by dsimp [μ]; infer_instance apply independent_poisson_normalized_badAny_moment (μ := μ) (W := fun j (w : Cell → ℕ) => w j) (q := q) (m := m) hm · intro j fun_prop · intro j exact (MeasureTheory.measurePreserving_eval (fun i : Cell => poissonMeasure (m * q i)) j).hasLaw · exact ProbabilityTheory.iIndepFun_pi (X := fun _ (w : ℕ) => w) (fun _ => aemeasurable_id) · simp · exact ht · exact hL
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotBadMoment · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:771
theorem canonicalPilot_noiseToRadius_le

On a good pilot, every coordinate's Poisson noise-to-radius ratio is at most the reciprocal logarithmic level required by the factorial L² bound. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
j :
≤ 1 / logAlphabet d
Proof (Lean source)
lemma canonicalPilot_noiseToRadius_le (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) (j : Cell) : q j / (m * rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ^ 2) ≤ 1 / logAlphabet d := by have hL : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)] let c := pilotCenter m pilot j let tau := logAlphabet d / m let s := sqrt (c * tau) let h := pilotRadius canonicalJacksonTuning m d pilot j let r := rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j have hc : 0 ≤ c := by dsimp [c, pilotCenter]; positivity have htau : 0 < tau := div_pos hL hm have hs : 0 ≤ s := Real.sqrt_nonneg _ have hs2 : s ^ 2 = c * tau := by dsimp [s]; rw [Real.sq_sqrt] <;> positivity have hh : h = 1024 * (s + tau) := by simp [h, pilotRadius, canonicalJacksonTuning, universalH, s, tau, c] congr 2 ring have hqle : q j ≤ c + h / 4 := by have := (abs_le.mp (hgood j)).1 linarith have hrlo : h / 2 ≤ r := (pilotRectangle_radius_bounds canonicalJacksonTuning m d pilot hm hd j).1 have hrpos : 0 < r := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd j have hqbound : q j ≤ 384 * (c + tau) := by rw [hh] at hqle nlinarith [sq_nonneg (s - (c + tau) / 2)] have hrsq : 384 * (c + tau) * logAlphabet d ≤ m * r ^ 2 := by rw [hh] at hrlo have hm_tau : m * tau = logAlphabet d := by dsimp [tau]; field_simp have hst : 0 ≤ s + tau := add_nonneg hs (le_of_lt htau) have hr512 : 512 * (s + tau) ≤ r := by linarith have hr2 : (512 * (s + tau)) ^ 2 ≤ r ^ 2 := (sq_le_sq₀ (mul_nonneg (by norm_num) hst) (le_of_lt hrpos)).2 hr512 have hbase : tau * (c + tau) ≤ (s + tau) ^ 2 := by nlinarith [mul_nonneg hs (le_of_lt htau), hs2] rw [← hm_tau] nlinarith [mul_le_mul_of_nonneg_left hr2 (le_of_lt hm), mul_le_mul_of_nonneg_left hbase (le_of_lt hm)] apply (div_le_div_iff₀ (mul_pos hm (sq_pos_of_pos hrpos)) hL).2 nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilot_noiseToRadius_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:805
def pilotFailureContribution

Pilot-failure contribution, restricted to the complement of the paper's coordinatewise good-pilot event.

Definition (Lean source)
tuning :
epsilon :
d :
m :
q :
Cell → ℝ
hm :
0 < m
pilotFailureContribution tuning epsilon d m q hm :
by classical exact ∫ z, if pilotGoodEvent tuning m d z.1 q then 0 else |jacksonCellStatistic tuning epsilon d m z.1 z.2 hm
- globalCellValue epsilon q| ∂pilotEvaluationLaw m q
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotFailureContribution · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:859
def pilotFailureSecondMomentContribution

Squared pilot-failure contribution, at the local second-moment scale.

Definition (Lean source)
tuning :
epsilon :
d :
m :
q :
Cell → ℝ
hm :
0 < m
pilotFailureSecondMomentContribution tuning epsilon d m q hm :
by classical exact ∫ z, if pilotGoodEvent tuning m d z.1 q then 0 else (jacksonCellStatistic tuning epsilon d m z.1 z.2 hm - globalCellValue epsilon q) ^ 2 ∂pilotEvaluationLaw m q
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotFailureSecondMomentContribution · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControl.lean:868
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotControlIntegration 6 declarations Integrated good-pilot and pilot-failure bounds for the cellwise factorial risk.

Integrated good-pilot and pilot-failure bounds for the cellwise factorial risk.

theorem canonicalGoodPilotConditionalMSE

Conditional on a good pilot, clipping and the product-factorial bound give the stated local second-moment scale. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
∫ eval : Cell → ℕ, (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2 ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)
≤ 4 * exp 1000 * d ^ (1 / 16 : ℝ) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j) ^ 2
Proof (Lean source)
lemma canonicalGoodPilotConditionalMSE (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) : ∫ eval : Cell → ℕ, (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2 ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) ≤ 4 * exp 1000 * d ^ (1 / 16 : ℝ) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j) ^ 2 := by let Q := pilotRectangle canonicalJacksonTuning m d pilot let center := rectangleCenter Q let radius := rectangleRadius Q let K := jacksonDegree canonicalJacksonTuning d let p := jacksonTensorPolynomial epsilon K (jacksonDegree_ge_two canonicalJacksonTuning d) Q (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) let centerValue := globalCellValue epsilon center let lift := fun eval : Cell → ℕ => factorialPolynomialLift m p eval center radius centerValue let S := ∑ j : Cell, radius j let scale := (1 + epsilon⁻¹) * S let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) have hr : ∀ j, 0 < radius j := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd have hqmem := pilotGoodEvent_mem_pilotRectangle canonicalJacksonTuning m d pilot q hq hgood have hdist : l1CellDistance center q ≤ S := by unfold l1CellDistance apply Finset.sum_le_sum intro j _ rw [abs_le] have hj := hqmem j simp only [Q, center, radius, rectangleCenter, rectangleRadius] at hj ⊢ constructor <;> linarith [hj.1, hj.2] have hlip := globalCellValue_lipschitz hepsilon center q (fun j => by have hlo := pilotRectangle_nonneg canonicalJacksonTuning m d pilot j have hv := pilotRectangle_valid canonicalJacksonTuning m d pilot hm j simp only [Q, center, rectangleCenter] at hlo hv ⊢ linarith) hq have hcenterErr : |centerValue - globalCellValue epsilon q| ≤ scale := by dsimp [centerValue, scale] exact hlip.trans (mul_le_mul_of_nonneg_left hdist (by positivity)) have hscale0 : 0 ≤ scale := by dsimp [scale, S] exact mul_nonneg (by positivity) (sum_nonneg fun j _ => le_of_lt (hr j)) have hpoint (eval : Cell → ℕ) : (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2 ≤ 2 * (lift eval) ^ 2 + 2 * scale ^ 2 := by have hc : |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - centerValue| ≤ |lift eval| := by rw [jacksonCellStatistic_eq_clipAround] simpa [centerValue, lift] using abs_clipAround_sub_center_le centerValue (d ^ (1 / 4 : ℝ) * scale) (centerValue + lift eval) (mul_nonneg (by positivity) hscale0) have habs : |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q| ≤ |lift eval| + scale := by calc |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q| = |(jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - centerValue) + (centerValue - globalCellValue epsilon q)| := by ring_nf _ ≤ |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - centerValue| + |centerValue - globalCellValue epsilon q| := abs_add_le _ _ _ ≤ |lift eval| + scale := add_le_add hc hcenterErr have hsquare := (sq_le_sq₀ (abs_nonneg _) (add_nonneg (abs_nonneg _) hscale0)).2 habs rw [sq_abs] at hsquare nlinarith [hsquare, sq_nonneg (|lift eval| - scale), sq_abs (lift eval)] have hliftInt : Integrable (fun eval => (lift eval) ^ 2) μe := by apply (memLp_two_iff_integrable_sq (by fun_prop)).mp dsimp [lift, μe] simp only [factorialPolynomialLift] exact memLp_finsetSum _ fun alpha halpha => (normalizedCenteredFactorialMonomial_memLp_two m q center radius hr alpha).const_mul _ have herrInt : Integrable (fun eval => (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2) μe := by apply ((hliftInt.const_mul 2).add (integrable_const (2 * scale ^ 2))).mono' · fun_prop · filter_upwards with eval rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] simpa only [Pi.add_apply] using hpoint eval calc (∫ eval, (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2 ∂μe) ≤ ∫ eval, (2 * (lift eval) ^ 2 + 2 * scale ^ 2) ∂μe := integral_mono herrInt ((hliftInt.const_mul 2).add (integrable_const _)) hpoint _ = 2 * (∫ eval, (lift eval) ^ 2 ∂μe) + 2 * scale ^ 2 := by rw [integral_add, integral_const_mul, integral_const, probReal_univ, one_smul] · exact hliftInt.const_mul 2 · exact integrable_const _ _ ≤ 2 * (exp 1000 * d ^ (1 / 16 : ℝ) * scale ^ 2) + 2 * scale ^ 2 := by gcongr exact canonicalGoodPilotFactorialLift_sq_le epsilon m hepsilon hm d hd pilot q hq hgood _ ≤ 4 * exp 1000 * d ^ (1 / 16 : ℝ) * scale ^ 2 := by have he : 1 ≤ exp 1000 := Real.one_le_exp (by norm_num) have hdpow : 1 ≤ (d : ℝ) ^ (1 / 16 : ℝ) := Real.one_le_rpow (by exact_mod_cast hd) (by norm_num) nlinarith [sq_nonneg scale, mul_le_mul he hdpow (by norm_num) (by positivity)] _ = _ := by rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalGoodPilotConditionalMSE · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:11
theorem canonicalNormalizedAggregateScore_memLp_two

The normalized four-coordinate pilot score is square-integrable under the independent product-Poisson pilot law. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
hd :
1 ≤ d
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
MemLp (normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)) 2 (Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal))
Proof (Lean source)
lemma canonicalNormalizedAggregateScore_memLp_two (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : MemLp (normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)) 2 (Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)) := by let L := logAlphabet d have hL : 1 ≤ L := by dsimp [L, logAlphabet] have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hlog : 0 ≤ log (d : ℝ) := Real.log_nonneg hdR rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith let coord := fun j (w : Cell → ℕ) => normalizedDeviation m.toNNReal (q j).toNNReal (w j) + universalH * normalizedRadius m.toNNReal L (w j) have hmean (j : Cell) : m.toNNReal * (q j).toNNReal = (m * q j).toNNReal := by apply NNReal.eq simp only [NNReal.coe_mul, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j), Real.coe_toNNReal (m * q j) (mul_nonneg (le_of_lt hm) (hq j))] have hcoord (j : Cell) : MemLp (coord j) 2 (Measure.pi (fun i : Cell => poissonMeasure (m * q i).toNNReal)) := by let scalar := fun w : ℕ => score universalH L (m.toNNReal * (q j).toNNReal) w / m have hscalarSq : Integrable (fun w => (scalar w) ^ 2) (poissonMeasure (m * q j).toNNReal) := by rw [← hmean j] exact (integrable_score_pow (m.toNNReal * (q j).toNNReal) hL (t := 2) (by norm_num)).const_mul (1 / m ^ 2) |>.congr (Filter.Eventually.of_forall fun w => by dsimp [scalar]; ring) have hscalar : MemLp scalar 2 (poissonMeasure (m * q j).toNNReal) := (memLp_two_iff_integrable_sq (by fun_prop)).2 hscalarSq have hcomp := hscalar.comp_measurePreserving (MeasureTheory.measurePreserving_eval (fun i : Cell => poissonMeasure (m * q i).toNNReal) j) have heq : coord j = scalar ∘ Function.eval j := by funext w dsimp [coord, scalar] unfold normalizedDeviation normalizedRadius score deviation radius rw [Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j)] have hsqrt : sqrt (((w j : ℝ) / m) * (L / m)) = sqrt ((w j : ℝ) * L) / m := by rw [show ((w j : ℝ) / m) * (L / m) = ((w j : ℝ) * L) / m ^ 2 by field_simp] rw [Real.sqrt_div (by positivity), Real.sqrt_sq_eq_abs, abs_of_pos hm] rw [hsqrt] rw [show |(w j : ℝ) / m - q j| = |(w j : ℝ) - m * q j| / m by rw [show (w j : ℝ) / m - q j = ((w j : ℝ) - m * q j) / m by field_simp, abs_div, abs_of_pos hm]] simp only [NNReal.coe_mul, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j)] ring rw [heq] exact hcomp unfold normalizedAggregateScore exact memLp_finsetSum _ fun j _ => hcoord j
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalNormalizedAggregateScore_memLp_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:127
theorem canonicalPilotFailureBounds

Integrating the pointwise clipping bound on the bad-pilot event gives the promoted exponentially small local first- and second-moment contributions. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
v :
sqrt (((∑ j : Cell, q j) * logAlphabet d) / m) + logAlphabet d / m
≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * productMomentConstant 4 1 * exp (-20 * logAlphabet d) * v
≤ (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹)) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * v ^ 2
Proof (Lean source)
lemma canonicalPilotFailureBounds (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : let v := sqrt (((∑ j : Cell, q j) * logAlphabet d) / m) + logAlphabet d / m pilotFailureContribution canonicalJacksonTuning epsilon d m q hm ≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * productMomentConstant 4 1 * exp (-20 * logAlphabet d) * v ∧ pilotFailureSecondMomentContribution canonicalJacksonTuning epsilon d m q hm ≤ (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹)) ^ 2 * productMomentConstant 4 2 * exp (-20 * logAlphabet d) * v ^ 2 := by classical dsimp only let μp := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let bad := normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) let score := normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) let A := 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) have hscoreLp := canonicalNormalizedAggregateScore_memLp_two m hm d hd q hq have hscoreInt : Integrable score μp := hscoreLp.integrable one_le_two have hscoreSqInt : Integrable (fun pilot => score pilot ^ 2) μp := hscoreLp.integrable_sq have hbadMeas : MeasurableSet bad := by exact (Set.to_countable bad).measurableSet have hbadEq : {pilot : Cell → ℕ | ¬ pilotGoodEvent canonicalJacksonTuning m d pilot q} = bad := pilotGoodEvent_compl_eq_normalizedBadAny m hm d q hq have hA : 0 ≤ A := by dsimp [A]; positivity have hone : pilotFailureContribution canonicalJacksonTuning epsilon d m q hm ≤ A * ∫ pilot, bad.indicator score pilot ∂μp := by let f := fun z : (Cell → ℕ) × (Cell → ℕ) => if pilotGoodEvent canonicalJacksonTuning m d z.1 q then 0 else |jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm - globalCellValue epsilon q| let g := fun z : (Cell → ℕ) × (Cell → ℕ) => A * bad.indicator score z.1 have hgInt : Integrable g (μp.prod μe) := by exact ((hscoreInt.indicator hbadMeas).const_mul A).comp_fst μe have hpoint (z : (Cell → ℕ) × (Cell → ℕ)) : f z ≤ g z := by have h := canonicalPilotFailureIntegrand_le_badScore epsilon m hepsilon hm d hd z.1 z.2 q hq dsimp [f, g, A] by_cases hz : pilotGoodEvent canonicalJacksonTuning m d z.1 q · have hznot : z.1 ∉ bad := by rw [← hbadEq] simpa only [Set.mem_setOf_eq, not_not] simp [hz, hznot] · have hzbad : z.1 ∈ bad := by rw [← hbadEq]; exact hz simp only [hz, ↓reduceIte, bad, score, Set.indicator_of_mem hzbad] exact canonicalJacksonCellError_le_normalizedAggregateScore epsilon m hepsilon hm d hd z.1 z.2 q hq have hfInt : Integrable f (μp.prod μe) := by apply hgInt.mono' · fun_prop · filter_upwards with z have hf0 : 0 ≤ f z := by dsimp [f]; split_ifs <;> positivity rw [Real.norm_eq_abs, abs_of_nonneg hf0] exact hpoint z unfold pilotFailureContribution pilotEvaluationLaw change (∫ z, f z ∂μp.prod μe) ≤ _ calc (∫ z, f z ∂μp.prod μe) ≤ ∫ z, g z ∂μp.prod μe := integral_mono hfInt hgInt hpoint _ = A * ∫ pilot, bad.indicator score pilot ∂μp := by rw [MeasureTheory.integral_prod g hgInt] simp only [g, integral_const, probReal_univ, one_smul, integral_const_mul] have htwo : pilotFailureSecondMomentContribution canonicalJacksonTuning epsilon d m q hm ≤ A ^ 2 * ∫ pilot, bad.indicator (fun pilot => score pilot ^ 2) pilot ∂μp := by let f := fun z : (Cell → ℕ) × (Cell → ℕ) => if pilotGoodEvent canonicalJacksonTuning m d z.1 q then 0 else (jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm - globalCellValue epsilon q) ^ 2 let g := fun z : (Cell → ℕ) × (Cell → ℕ) => A ^ 2 * bad.indicator (fun pilot => score pilot ^ 2) z.1 have hgInt : Integrable g (μp.prod μe) := by exact ((hscoreSqInt.indicator hbadMeas).const_mul (A ^ 2)).comp_fst μe have hpoint (z : (Cell → ℕ) × (Cell → ℕ)) : f z ≤ g z := by have h := canonicalPilotFailureSqIntegrand_le_badScoreSq epsilon m hepsilon hm d hd z.1 z.2 q hq dsimp [f, g, A] by_cases hz : pilotGoodEvent canonicalJacksonTuning m d z.1 q · have hznot : z.1 ∉ bad := by rw [← hbadEq] simpa only [Set.mem_setOf_eq, not_not] simp [hz, hznot] · have hzbad : z.1 ∈ bad := by rw [← hbadEq]; exact hz simp only [hz, ↓reduceIte, bad, score, Set.indicator_of_mem hzbad] simpa only [A, bad, score, Set.indicator_of_mem hzbad] using h have hfInt : Integrable f (μp.prod μe) := by apply hgInt.mono' · fun_prop · filter_upwards with z rw [Real.norm_eq_abs, abs_of_nonneg] · exact hpoint z · dsimp [f]; split_ifs <;> positivity unfold pilotFailureSecondMomentContribution pilotEvaluationLaw change (∫ z, f z ∂μp.prod μe) ≤ _ calc (∫ z, f z ∂μp.prod μe) ≤ ∫ z, g z ∂μp.prod μe := integral_mono hfInt hgInt hpoint _ = A ^ 2 * ∫ pilot, bad.indicator (fun pilot => score pilot ^ 2) pilot ∂μp := by rw [MeasureTheory.integral_prod g hgInt] simp only [g, integral_const, probReal_univ, one_smul, integral_const_mul] have hL : 1 ≤ logAlphabet d := by have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith [Real.log_nonneg hdR] have hmean (j : Cell) : m.toNNReal * (q j).toNNReal = (m * q j).toNNReal := by apply NNReal.eq simp only [NNReal.coe_mul, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q j) (hq j), Real.coe_toNNReal (m * q j) (mul_nonneg (le_of_lt hm) (hq j))] constructor · have hmom := canonicalPilotBadMoment (fun j => (q j).toNNReal) m.toNNReal (by simpa using hm) (t := 1) (inl rfl) hL simp_rw [hmean] at hmom have hmom' : (∫ pilot, bad.indicator score pilot ∂μp) ≤ productMomentConstant 4 1 * exp (-20 * logAlphabet d) * (sqrt (((∑ j : Cell, q j) * logAlphabet d) / m) + logAlphabet d / m) := by simpa [μp, bad, score, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q _) (hq _)] using hmom refine hone.trans ?_ exact (mul_le_mul_of_nonneg_left hmom' hA).trans_eq (by dsimp [A]; ring) · have hmom := canonicalPilotBadMoment (fun j => (q j).toNNReal) m.toNNReal (by simpa using hm) (t := 2) (inr (inl rfl)) hL simp_rw [hmean] at hmom have hmom' : (∫ pilot, bad.indicator (fun pilot => score pilot ^ 2) pilot ∂μp) ≤ productMomentConstant 4 2 * exp (-20 * logAlphabet d) * (sqrt (((∑ j : Cell, q j) * logAlphabet d) / m) + logAlphabet d / m) ^ 2 := by simpa [μp, bad, score, Real.coe_toNNReal m (le_of_lt hm), Real.coe_toNNReal (q _) (hq _)] using hmom refine htwo.trans ?_ exact (mul_le_mul_of_nonneg_left hmom' (sq_nonneg A)).trans_eq (by dsimp [A]; ring)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotFailureBounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:197
theorem canonicalLogPowerBounds

The logarithmic factors left by approximation and bad-pilot integration are absorbed by the fixed fractional powers of the alphabet size. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
1 ≤ d
conclusion 1
conclusion 2
logAlphabet d * d ^ (-3 / 16 : ℝ) ≤ 7
conclusion 3
logAlphabet d * d ^ (1 / 4 : ℝ) * exp (-20 * logAlphabet d) ≤ 7
conclusion 4
d ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) ≤ d ^ (1 / 16 : ℝ)
Proof (Lean source)
lemma canonicalLogPowerBounds (d : ℕ) (hd : 1 ≤ d) : logAlphabet d / jacksonDegree canonicalJacksonTuning d ≤ 150000 ∧ logAlphabet d * d ^ (-3 / 16 : ℝ) ≤ 7 ∧ logAlphabet d * d ^ (1 / 4 : ℝ) * exp (-20 * logAlphabet d) ≤ 7 ∧ d ^ (1 / 2 : ℝ) * exp (-20 * logAlphabet d) ≤ d ^ (1 / 16 : ℝ) := by let L := logAlphabet d let K := jacksonDegree canonicalJacksonTuning d have hdpos : (0 : ℝ) < d := by positivity have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hdpow (a : ℝ) (ha : 0 ≤ a) : 1 ≤ (d : ℝ) ^ a := Real.one_le_rpow (by exact_mod_cast hd) ha have hL : 1 ≤ L := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] linarith [Real.log_nonneg (by exact_mod_cast hd : (1 : ℝ) ≤ d)] have hLK : L / K ≤ 150000 := by have hdeg := canonicalJacksonDegree_log_le d have hK2 : (2 : ℝ) ≤ K := by exact_mod_cast jacksonDegree_ge_two canonicalJacksonTuning d apply (div_le_iff₀ (by positivity)).2 nlinarith have hlogpow : L ≤ 7 * (d : ℝ) ^ (3 / 16 : ℝ) := by have hlog := Real.log_natCast_le_rpow_div d (show (0 : ℝ) < 3 / 16 by norm_num) have hpow1 := hdpow (3 / 16) (by norm_num) dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] norm_num at hlog nlinarith have hsecond : L * d ^ (-3 / 16 : ℝ) ≤ 7 := by rw [show (-3 / 16 : ℝ) = -(3 / 16) by norm_num, Real.rpow_neg (le_of_lt hdpos), ← div_eq_mul_inv] exact (div_le_iff₀ (Real.rpow_pos_of_pos hdpos _)).2 hlogpow have hexp : exp (-20 * L) ≤ 1 / (d : ℝ) := by have hneg : -20 * L ≤ -L := by nlinarith calc exp (-20 * L) ≤ exp (-L) := Real.exp_le_exp.mpr hneg _ = (exp 1 * d)⁻¹ := by dsimp [L, logAlphabet] rw [Real.exp_neg, Real.exp_log (by positivity)] _ ≤ 1 / d := by simpa only [one_div] using inv_anti₀ hdpos (by calc (d : ℝ) = 1 * d := by ring _ ≤ exp 1 * d := by gcongr exact Real.one_le_exp (show (0 : ℝ) ≤ 1 by norm_num)) have hthird : L * d ^ (1 / 4 : ℝ) * exp (-20 * L) ≤ 7 := by calc L * d ^ (1 / 4 : ℝ) * exp (-20 * L) ≤ L * d ^ (1 / 4 : ℝ) * (1 / d) := by gcongr _ = L * d ^ (-3 / 4 : ℝ) := by rw [show (-3 / 4 : ℝ) = 1 / 4 - 1 by norm_num, Real.rpow_sub hdpos, Real.rpow_one] field_simp _ ≤ L * d ^ (-3 / 16 : ℝ) := by exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hdR (by norm_num)) (by linarith) _ ≤ 7 := hsecond have hfourth : d ^ (1 / 2 : ℝ) * exp (-20 * L) ≤ d ^ (1 / 16 : ℝ) := by calc d ^ (1 / 2 : ℝ) * exp (-20 * L) ≤ d ^ (1 / 2 : ℝ) * (1 / d) := by gcongr _ = d ^ (-1 / 2 : ℝ) := by rw [show (-1 / 2 : ℝ) = 1 / 2 - 1 by norm_num, Real.rpow_sub hdpos, Real.rpow_one] field_simp _ ≤ d ^ (1 / 16 : ℝ) := Real.rpow_le_rpow_of_exponent_le hdR (by norm_num) exact ⟨hLK, hsecond, hthird, hfourth⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalLogPowerBounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:351
theorem canonicalLogSquaredPowerBounds

Two coarse logarithmic bounds used to absorb the squared localized pilot radius into fixed powers of the alphabet size. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
1 ≤ d
conclusion 1
logAlphabet d ^ 2 * d ^ (-3 / 16 : ℝ) ≤ 225
conclusion 2
logAlphabet d ^ 2 * d ^ (1 / 4 : ℝ) * exp (-20 * logAlphabet d) ≤ 225
Proof (Lean source)
lemma canonicalLogSquaredPowerBounds (d : ℕ) (hd : 1 ≤ d) : logAlphabet d ^ 2 * d ^ (-3 / 16 : ℝ) ≤ 225 ∧ logAlphabet d ^ 2 * d ^ (1 / 4 : ℝ) * exp (-20 * logAlphabet d) ≤ 225 := by let L := logAlphabet d have hdpos : (0 : ℝ) < d := by positivity have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hL : 1 ≤ L := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] linarith [Real.log_nonneg hdR] have hlog := Real.log_natCast_le_rpow_div d (show (0 : ℝ) < 3 / 32 by norm_num) have hpow : 1 ≤ (d : ℝ) ^ (3 / 32 : ℝ) := Real.one_le_rpow hdR (by norm_num) have hLpow : L ≤ 15 * (d : ℝ) ^ (3 / 32 : ℝ) := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] norm_num at hlog nlinarith have hsquare : L ^ 2 ≤ 225 * (d : ℝ) ^ (3 / 16 : ℝ) := by have hs := (sq_le_sq₀ (by linarith) (by positivity)).2 hLpow calc L ^ 2 ≤ (15 * (d : ℝ) ^ (3 / 32 : ℝ)) ^ 2 := hs _ = 225 * (d : ℝ) ^ (3 / 16 : ℝ) := by rw [mul_pow, ← Real.rpow_mul_natCast (le_of_lt hdpos)] norm_num have hfirst : L ^ 2 * (d : ℝ) ^ (-3 / 16 : ℝ) ≤ 225 := by rw [show (-3 / 16 : ℝ) = -(3 / 16) by norm_num, Real.rpow_neg (le_of_lt hdpos), ← div_eq_mul_inv] exact (div_le_iff₀ (Real.rpow_pos_of_pos hdpos _)).2 hsquare have hexp : exp (-20 * L) ≤ 1 / (d : ℝ) := by have hneg : -20 * L ≤ -L := by nlinarith calc exp (-20 * L) ≤ exp (-L) := Real.exp_le_exp.mpr hneg _ = (exp 1 * d)⁻¹ := by dsimp [L, logAlphabet] rw [Real.exp_neg, Real.exp_log (by positivity)] _ ≤ 1 / d := by simpa only [one_div] using inv_anti₀ hdpos (by calc (d : ℝ) = 1 * d := by ring _ ≤ exp 1 * d := by gcongr exact Real.one_le_exp (by norm_num)) refine ⟨hfirst, ?_⟩ calc L ^ 2 * d ^ (1 / 4 : ℝ) * exp (-20 * L) ≤ L ^ 2 * d ^ (1 / 4 : ℝ) * (1 / d) := by gcongr _ = L ^ 2 * d ^ (-3 / 4 : ℝ) := by rw [show (-3 / 4 : ℝ) = 1 / 4 - 1 by norm_num, Real.rpow_sub hdpos, Real.rpow_one] field_simp _ ≤ L ^ 2 * d ^ (-3 / 16 : ℝ) := by exact mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_le hdR (by norm_num)) (sq_nonneg L) _ ≤ 225 := hfirst
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalLogSquaredPowerBounds · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:424

Cauchy--Schwarz over the four cell coordinates controls the sum of local square-root scales by twice the aggregate square-root scale. This uses the cell masses satisfy their stated restrictions, and the stated tau condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
tau :
htau :
0 ≤ tau
(∑ j : Cell, sqrt (q j * tau)) ≤ 2 * sqrt ((∑ j : Cell, q j) * tau)
Proof (Lean source)
lemma sum_cell_sqrt_mul_le (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (tau : ℝ) (htau : 0 ≤ tau) : (∑ j : Cell, sqrt (q j * tau)) ≤ 2 * sqrt ((∑ j : Cell, q j) * tau) := by have hsum0 : 0 ≤ ∑ j : Cell, sqrt (q j * tau) := sum_nonneg fun _ _ => Real.sqrt_nonneg _ have hqsum0 : 0 ≤ (∑ j : Cell, q j) * tau := mul_nonneg (sum_nonneg fun j _ => hq j) htau apply (sq_le_sq₀ hsum0 (by positivity)).mp calc (∑ j : Cell, sqrt (q j * tau)) ^ 2 ≤ 4 * ∑ j : Cell, (sqrt (q j * tau)) ^ 2 := by simpa [Cell] using weighted_inner_sq_le (Finset.univ : Finset Cell) (fun _ => (1 : ℝ)) (fun _ => (1 : ℝ)) (fun j => sqrt (q j * tau)) (fun _ _ => by norm_num) _ = (2 * sqrt ((∑ j : Cell, q j) * tau)) ^ 2 := by simp_rw [Real.sq_sqrt (mul_nonneg (hq _) htau)] rw [show ∑ x : Cell, q x * tau = (∑ x : Cell, q x) * tau by rw [Finset.sum_mul]] rw [show (2 * sqrt ((∑ j : Cell, q j) * tau)) ^ 2 = 4 * sqrt ((∑ j : Cell, q j) * tau) ^ 2 by ring, Real.sq_sqrt hqsum0]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sum_cell_sqrt_mul_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlIntegration.lean:485
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotControlPointwise 8 declarations Final pilot-failure estimate and assembly of the cellwise factorial risk theorem.

Final pilot-failure estimate and assembly of the cellwise factorial risk theorem.

theorem canonicalJacksonCellError_le_normalizedAggregateScore

The clipped cell estimator's pointwise error is controlled by the promoted self-normalized aggregate pilot score, uniformly in the evaluation counts. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot eval :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
|jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm
- globalCellValue epsilon q|
≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot
Proof (Lean source)
lemma canonicalJacksonCellError_le_normalizedAggregateScore (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot eval : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q| ≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot := by let Q := pilotRectangle canonicalJacksonTuning m d pilot let center := rectangleCenter Q let radius := rectangleRadius Q let S := ∑ j : Cell, radius j let score := normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot have hcenter_nonneg : ∀ j, 0 ≤ center j := by intro j have hlo := pilotRectangle_nonneg canonicalJacksonTuning m d pilot j have hvalid := pilotRectangle_valid canonicalJacksonTuning m d pilot hm j dsimp [center, Q, rectangleCenter] nlinarith have hfactor : 0 ≤ 1 + epsilon⁻¹ := by positivity have hS : 0 ≤ S := sum_nonneg fun j _ => by exact le_of_lt (pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd j) have hdpow : 1 ≤ (d : ℝ) ^ (1 / 4 : ℝ) := by apply Real.one_le_rpow · exact_mod_cast hd · norm_num have hclip : |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon center| ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * S) := by rw [jacksonCellStatistic_eq_clipAround] exact abs_clipAround_sub_center_le_radius _ _ _ (by positivity) have hlip := globalCellValue_lipschitz hepsilon center q hcenter_nonneg hq have hgeom : l1CellDistance center q + S ≤ score := by exact canonicalPilotGeometry_le_normalizedAggregateScore m hm d hd pilot q hq have hdist : 0 ≤ l1CellDistance center q := by exact sum_nonneg fun _ _ => abs_nonneg _ have hscore : 0 ≤ score := le_trans (add_nonneg hdist hS) hgeom calc |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q| ≤ |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon center| + |globalCellValue epsilon center - globalCellValue epsilon q| := by simpa only [sub_add_sub_cancel] using abs_add_le (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon center) (globalCellValue epsilon center - globalCellValue epsilon q) _ ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * S) + (1 + epsilon⁻¹) * l1CellDistance center q := add_le_add hclip hlip _ ≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * score := by have hSle : S ≤ score := by linarith have hdistle : l1CellDistance center q ≤ score := by linarith have hfacscore : 0 ≤ (1 + epsilon⁻¹) * score := mul_nonneg hfactor hscore have hfirst : d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * S) ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * score) := by gcongr have hsecond : (1 + epsilon⁻¹) * l1CellDistance center q ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * score) := by calc (1 + epsilon⁻¹) * l1CellDistance center q ≤ (1 + epsilon⁻¹) * score := by gcongr _ = 1 * ((1 + epsilon⁻¹) * score) := by ring _ ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * score) := mul_le_mul_of_nonneg_right hdpow hfacscore calc d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * S) + (1 + epsilon⁻¹) * l1CellDistance center q ≤ d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * score) + d ^ (1 / 4 : ℝ) * ((1 + epsilon⁻¹) * score) := add_le_add hfirst hsecond _ = 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * score := by ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonCellError_le_normalizedAggregateScore · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:11
theorem canonicalPilotFailureIntegrand_le_badScore

The first-moment pilot-failure integrand is bounded pointwise by the promoted bad-event aggregate score. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot eval :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
(normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun _pilot => |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q|) pilot
≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot) pilot
Proof (Lean source)
lemma canonicalPilotFailureIntegrand_le_badScore (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot eval : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun _pilot => |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q|) pilot ≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot) pilot := by let bad := normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) by_cases hbad : pilot ∈ bad · simp only [bad, Set.indicator_of_mem hbad] exact canonicalJacksonCellError_le_normalizedAggregateScore epsilon m hepsilon hm d hd pilot eval q hq · simp only [bad, Set.indicator_of_notMem hbad, mul_zero, le_refl]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotFailureIntegrand_le_badScore · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:92
theorem canonicalPilotFailureSqIntegrand_le_badScoreSq

The squared pilot-failure integrand is bounded pointwise by the square of the promoted bad-event aggregate score. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot eval :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
(normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun _pilot => (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2) pilot
≤ (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹)) ^ 2 * (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot ^ 2) pilot
Proof (Lean source)
lemma canonicalPilotFailureSqIntegrand_le_badScoreSq (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot eval : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun _pilot => (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2) pilot ≤ (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹)) ^ 2 * (normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal)).indicator (fun pilot => normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot ^ 2) pilot := by let bad := normalizedBadAny (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) by_cases hbad : pilot ∈ bad · simp only [bad, Set.indicator_of_mem hbad] have h := canonicalJacksonCellError_le_normalizedAggregateScore epsilon m hepsilon hm d hd pilot eval q hq have hfactor : 0 ≤ 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) := by positivity have hscore : 0 ≤ normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot := by have hL : 0 ≤ logAlphabet d := by rw [logAlphabet] exact Real.log_nonneg (by have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 ≤ exp 1 := (Real.one_le_exp_iff.mpr (by norm_num)) nlinarith [mul_le_mul he hd1 (by norm_num) (by positivity)]) unfold normalizedAggregateScore apply sum_nonneg intro j _hj exact add_nonneg (abs_nonneg _) (mul_nonneg (le_of_lt universalH_pos) (by unfold normalizedRadius exact add_nonneg (Real.sqrt_nonneg _) (div_nonneg hL (by positivity)))) calc (jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q) ^ 2 = |jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm - globalCellValue epsilon q| ^ 2 := (sq_abs _).symm _ ≤ (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) * normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot) ^ 2 := (sq_le_sq₀ (abs_nonneg _) (mul_nonneg hfactor hscore)).2 h _ = (2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹)) ^ 2 * normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) pilot ^ 2 := by ring · simp only [bad, Set.indicator_of_notMem hbad, mul_zero, le_refl]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotFailureSqIntegrand_le_badScoreSq · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:126
theorem canonicalJacksonDegree_log_le

The deliberately small canonical Jackson constant still gives a degree large enough, up to a universal factor, to absorb one logarithmic level. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
Proof (Lean source)
lemma canonicalJacksonDegree_log_le (d : ℕ) : logAlphabet d ≤ 100000 * (jacksonDegree canonicalJacksonTuning d + 1) := by have h := Nat.lt_floor_add_one ((1 / 100000 : ℝ) * logAlphabet d) have hfloor : ⌊(1 / 100000 : ℝ) * logAlphabet d⌋₊ ≤ jacksonDegree canonicalJacksonTuning d := by unfold jacksonDegree rw [show canonicalJacksonTuning.jacksonDegreeConstant = (1 / 100000 : ℝ) by rw [canonicalJacksonTuning]] exact Nat.le_max_right _ _ have hcast : (⌊(1 / 100000 : ℝ) * logAlphabet d⌋₊ : ℝ) ≤ jacksonDegree canonicalJacksonTuning d := by exact_mod_cast hfloor nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonDegree_log_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:195
theorem canonicalPilotGoodRadiusSum_le Lemma 6 in the paper ↗

On a good pilot, the sum of the four random rectangle radii has the local square-root-plus-linear scale, uniformly down to zero cell masses. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
≤ 2000000 * (sqrt ((∑ j : Cell, q j) * logAlphabet d / m) + logAlphabet d / m)
Proof (Lean source)
lemma canonicalPilotGoodRadiusSum_le (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) : ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ 2000000 * (sqrt ((∑ j : Cell, q j) * logAlphabet d / m) + logAlphabet d / m) := by let tau := logAlphabet d / m have hL : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)] have htau : 0 < tau := div_pos hL hm have hcoord (j : Cell) : rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ 2048 * sqrt (q j * tau) + 308224 * tau := by let c := pilotCenter m pilot j let s := sqrt (c * tau) let h := pilotRadius canonicalJacksonTuning m d pilot j have hc : 0 ≤ c := by dsimp [c, pilotCenter]; positivity have hs : 0 ≤ s := Real.sqrt_nonneg _ have hs2 : s ^ 2 = c * tau := by dsimp [s] rw [Real.sq_sqrt] <;> positivity have hh : h = 1024 * (s + tau) := by simp [h, pilotRadius, canonicalJacksonTuning, universalH, s, tau, c] congr 2 ring have hyoung : s ≤ c / 512 + 128 * tau := by apply Real.sqrt_le_iff.mpr constructor · positivity · nlinarith [sq_nonneg (c / 512 - 128 * tau)] have hqle : c ≤ q j + h / 4 := by have := (abs_le.mp (hgood j)).2 linarith have hcle : c ≤ 2 * q j + 66048 * tau := by rw [hh] at hqle nlinarith have hqsqrt : sqrt (q j * tau) ^ 2 = q j * tau := by rw [Real.sq_sqrt] exact mul_nonneg (hq j) (le_of_lt htau) have hs_le : s ≤ 2 * sqrt (q j * tau) + 300 * tau := by apply Real.sqrt_le_iff.mpr constructor · positivity · have hctau : c * tau ≤ (2 * q j + 66048 * tau) * tau := mul_le_mul_of_nonneg_right hcle (le_of_lt htau) nlinarith [hctau, hqsqrt, mul_nonneg (Real.sqrt_nonneg (q j * tau)) (le_of_lt htau)] have hr := (pilotRectangle_radius_bounds canonicalJacksonTuning m d pilot hm hd j).2 change rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ h at hr rw [hh] at hr nlinarith calc ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ ∑ j : Cell, (2048 * sqrt (q j * tau) + 308224 * tau) := Finset.sum_le_sum fun j _ => hcoord j _ ≤ 2000000 * (sqrt ((∑ j : Cell, q j) * tau) + tau) := by have hsqrtSum : (∑ j : Cell, sqrt (q j * tau)) ≤ 2 * sqrt ((∑ j : Cell, q j) * tau) := by have hsum0 : 0 ≤ ∑ j : Cell, sqrt (q j * tau) := sum_nonneg fun _ _ => Real.sqrt_nonneg _ have hqsum0 : 0 ≤ (∑ j : Cell, q j) * tau := mul_nonneg (sum_nonneg fun j _ => hq j) (le_of_lt htau) apply (sq_le_sq₀ hsum0 (by positivity)).mp calc (∑ j : Cell, sqrt (q j * tau)) ^ 2 ≤ 4 * ∑ j : Cell, (sqrt (q j * tau)) ^ 2 := by simpa [Cell] using weighted_inner_sq_le (Finset.univ : Finset Cell) (fun _ => (1 : ℝ)) (fun _ => (1 : ℝ)) (fun j => sqrt (q j * tau)) (fun _ _ => by norm_num) _ = (2 * sqrt ((∑ j : Cell, q j) * tau)) ^ 2 := by simp_rw [Real.sq_sqrt (mul_nonneg (hq _) (le_of_lt htau))] rw [show ∑ x : Cell, q x * tau = (∑ x : Cell, q x) * tau by rw [Finset.sum_mul]] rw [show (2 * sqrt ((∑ j : Cell, q j) * tau)) ^ 2 = 4 * sqrt ((∑ j : Cell, q j) * tau) ^ 2 by ring, Real.sq_sqrt hqsum0] rw [Finset.sum_add_distrib, Finset.sum_const, ← Finset.mul_sum] norm_num [Cell] nlinarith [hsqrtSum, Real.sqrt_nonneg ((∑ j : Cell, q j) * tau)] _ = _ := by dsimp [tau] congr 1 congr 1 ring_nf
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotGoodRadiusSum_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:212
theorem canonicalJacksonCoefficientGrowth

The chosen degree constant makes the squared coefficient envelope and factorial-moment exponential fit strictly inside the stated d^(1/16) loss. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
1 ≤ d
(((2 : ℝ) ^ 60) ^ (2 * jacksonDegree canonicalJacksonTuning d)) * exp (16 * (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2 / logAlphabet d)
exp 1000 * d ^ (1 / 16 : ℝ)
Proof (Lean source)
lemma canonicalJacksonCoefficientGrowth (d : ℕ) (hd : 1 ≤ d) : (((2 : ℝ) ^ 60) ^ (2 * jacksonDegree canonicalJacksonTuning d)) * exp (16 * (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2 / logAlphabet d) ≤ exp 1000 * d ^ (1 / 16 : ℝ) := by let L := logAlphabet d let K := jacksonDegree canonicalJacksonTuning d have hdpos : (0 : ℝ) < d := by positivity have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hlogd : 0 ≤ log (d : ℝ) := Real.log_nonneg (by exact_mod_cast hd) have hL_eq : L = 1 + log (d : ℝ) := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdpos), Real.log_exp] have hL : 1 ≤ L := by rw [hL_eq]; linarith have hfloor : (⌊(1 / 100000 : ℝ) * L⌋₊ : ℝ) ≤ (1 / 100000 : ℝ) * L := Nat.floor_le (by positivity) have hK : (K : ℝ) ≤ 2 + L / 100000 := by dsimp [K, jacksonDegree] rw [show canonicalJacksonTuning.jacksonDegreeConstant = (1 / 100000 : ℝ) by rw [canonicalJacksonTuning]] rw [Nat.cast_max] apply max_le · linarith · exact hfloor.trans (by linarith) have hK0 : 0 ≤ (K : ℝ) := by positivity have hKsq : (K : ℝ) ^ 2 ≤ L * (5 + L / 10000000000) := by have hsquare := (sq_le_sq₀ hK0 (by positivity)).2 hK nlinarith have hKsqdiv : (K : ℝ) ^ 2 / L ≤ 5 + L / 10000000000 := (div_le_iff₀ (lt_of_lt_of_le (by norm_num) hL)).2 (by nlinarith [hKsq]) have hexponent : 120 * (K : ℝ) + 16 * (K : ℝ) ^ 2 / L ≤ 1000 + log (d : ℝ) / 16 := by have hlog : log (d : ℝ) = L - 1 := by linarith [hL_eq] rw [hlog] calc 120 * (K : ℝ) + 16 * (K : ℝ) ^ 2 / L ≤ 120 * (2 + L / 100000) + 16 * (5 + L / 10000000000) := by apply add_le_add · exact mul_le_mul_of_nonneg_left hK (by norm_num) · calc 16 * (K : ℝ) ^ 2 / L = 16 * ((K : ℝ) ^ 2 / L) := by ring _ ≤ 16 * (5 + L / 10000000000) := mul_le_mul_of_nonneg_left hKsqdiv (by norm_num) _ ≤ 1000 + (L - 1) / 16 := by norm_num nlinarith [hL] have hpow : (((2 : ℝ) ^ 60) ^ (2 * K)) ≤ exp (120 * (K : ℝ)) := by calc (((2 : ℝ) ^ 60) ^ (2 * K)) = (2 : ℝ) ^ (120 * K) := by rw [← pow_mul] congr 1 omega _ ≤ (exp 1) ^ (120 * K) := by exact pow_le_pow_left₀ (by norm_num) Real.exp_one_gt_two.le _ _ = exp (120 * (K : ℝ)) := by rw [← Real.exp_nat_mul] congr 1 norm_num calc (((2 : ℝ) ^ 60) ^ (2 * K)) * exp (16 * (K : ℝ) ^ 2 / L) ≤ exp (120 * (K : ℝ)) * exp (16 * (K : ℝ) ^ 2 / L) := by gcongr _ = exp (120 * (K : ℝ) + 16 * (K : ℝ) ^ 2 / L) := by rw [Real.exp_add] _ ≤ exp (1000 + log (d : ℝ) / 16) := Real.exp_le_exp.mpr hexponent _ = exp 1000 * d ^ (1 / 16 : ℝ) := by rw [Real.exp_add, Real.rpow_def_of_pos hdpos] congr 2 ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonCoefficientGrowth · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:309
theorem canonicalGoodPilotFactorialLift_sq_le

On a good pilot, the centered factorial lift of the chosen Jackson polynomial has the required local product-Poisson second moment. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
∫ eval : Cell → ℕ, factorialPolynomialLift m p eval (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q)) ^ 2 ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)
exp 1000 * d ^ (1 / 16 : ℝ) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ^ 2
Proof (Lean source)
lemma canonicalGoodPilotFactorialLift_sq_le (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) : let Q := pilotRectangle canonicalJacksonTuning m d pilot let p := jacksonTensorPolynomial epsilon (jacksonDegree canonicalJacksonTuning d) (jacksonDegree_ge_two canonicalJacksonTuning d) Q (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) ∫ eval : Cell → ℕ, factorialPolynomialLift m p eval (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q)) ^ 2 ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) ≤ exp 1000 * d ^ (1 / 16 : ℝ) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ^ 2 := by dsimp only let Q := pilotRectangle canonicalJacksonTuning m d pilot let K := jacksonDegree canonicalJacksonTuning d let p := jacksonTensorPolynomial epsilon K (jacksonDegree_ge_two canonicalJacksonTuning d) Q (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) have hr : ∀ j, 0 < rectangleRadius Q j := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd have hmem : ∀ j, |q j - rectangleCenter Q j| ≤ rectangleRadius Q j := by intro j have hj := pilotGoodEvent_mem_pilotRectangle canonicalJacksonTuning m d pilot q hq hgood j rw [abs_le] simp only [Q, rectangleCenter, rectangleRadius] at hj ⊢ constructor <;> linarith [hj.1, hj.2] have hratio : ∀ j, q j / (m * rectangleRadius Q j ^ 2) ≤ 1 / logAlphabet d := by exact canonicalPilot_noiseToRadius_le m hm d hd pilot q hgood have hL : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)] have henv := jacksonCenteredNormalizedPolynomial_coeffL1_le epsilon hepsilon K (jacksonDegree_ge_two canonicalJacksonTuning d) Q (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) hr have hbase := factorialPolynomialLift_sq_le_coeffL1 m q (rectangleCenter Q) (rectangleRadius Q) (1 / logAlphabet d) hm hq hr hmem hratio (by positivity) p (globalCellValue epsilon (rectangleCenter Q)) (2 * K) (fun alpha halpha j => (henv.2 alpha halpha j).trans (by exact_mod_cast (by omega : 2 * (K - 1) ≤ 2 * K))) have hbase' : (∫ eval : Cell → ℕ, factorialPolynomialLift m p eval (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q)) ^ 2 ∂Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)) ≤ (∑ alpha ∈ (centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support, |(centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).coeff alpha|) ^ 2 * exp (4 * (2 * (K : ℝ)) ^ 2 * (1 / logAlphabet d)) := by simpa only [Nat.cast_mul, Nat.cast_ofNat] using hbase refine hbase'.trans ?_ have hgrowth := canonicalJacksonCoefficientGrowth d hd have hfac : 0 ≤ 1 + epsilon⁻¹ := by positivity have hS : 0 ≤ ∑ j : Cell, rectangleRadius Q j := sum_nonneg fun j _ => le_of_lt (hr j) have hpoweq : ((((2 : ℝ) ^ 60) ^ K) ^ 2) = ((2 : ℝ) ^ 60) ^ (2 * K) := by calc ((((2 : ℝ) ^ 60) ^ K) ^ 2) = ((2 : ℝ) ^ 60) ^ (K * 2) := by rw [pow_mul] _ = ((2 : ℝ) ^ 60) ^ (2 * K) := by rw [Nat.mul_comm] calc (∑ alpha ∈ (centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).support, |(centeredNormalizedPolynomial p (rectangleCenter Q) (rectangleRadius Q) (globalCellValue epsilon (rectangleCenter Q))).coeff alpha|) ^ 2 * exp (4 * (2 * K : ℝ) ^ 2 * (1 / logAlphabet d)) ≤ ((((2 : ℝ) ^ 60) ^ K * (1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ^ 2) * exp (4 * (2 * (K : ℝ)) ^ 2 * (1 / logAlphabet d)) := by gcongr exact henv.1 _ = ((((2 : ℝ) ^ 60) ^ (2 * K)) * exp (16 * (K : ℝ) ^ 2 / logAlphabet d)) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ^ 2 := by have hexpeq : exp (4 * (2 * (K : ℝ)) ^ 2 * (1 / logAlphabet d)) = exp (16 * (K : ℝ) ^ 2 / logAlphabet d) := by congr 1 field_simp ring rw [mul_pow, mul_pow, hpoweq] rw [hexpeq] ring _ ≤ exp 1000 * d ^ (1 / 16 : ℝ) * ((1 + epsilon⁻¹) * ∑ j : Cell, rectangleRadius Q j) ^ 2 := by gcongr
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalGoodPilotFactorialLift_sq_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:385
theorem canonicalGoodPilotConditionalBias

Conditional on a good pilot, Jackson approximation plus clipping gives the local bias bound before averaging over the pilot. This uses the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, and the stated cj condition holds, and the polynomial has the stated approximation guarantee, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
Cj :
hCj :
0 < Cj
happrox :
∀ (K : ℕ) (Q : Rectangle) (hK : 2 ≤ K) (hQ : Q.Valid) (hQ0 : ∀ j, 0 ≤ Q.1 j),
(∀ j, 0 < rectangleRadius Q j) → ∀ v, inRectangle Q v → |eval v (jacksonTensorPolynomial epsilon K hK Q hQ hQ0)
- globalCellValue epsilon v|
≤ Cj * jacksonPointwiseScale Q K v
hgood :
pilotGoodEvent canonicalJacksonTuning m d pilot q
μe :
Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal)
|(∫ eval : Cell → ℕ, jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm ∂μe)
- globalCellValue epsilon q|
≤ Cj * ∑ j : Cell, (10000000 * sqrt (q j * (logAlphabet d / m)) / jacksonDegree canonicalJacksonTuning d + rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j / (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2)
+ exp 1000 * (1 + epsilon⁻¹) * d ^ (-3 / 16 : ℝ) * ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j
Proof (Lean source)
lemma canonicalGoodPilotConditionalBias (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (Cj : ℝ) (hCj : 0 < Cj) (happrox : ∀ (K : ℕ) (Q : Rectangle) (hK : 2 ≤ K) (hQ : Q.Valid) (hQ0 : ∀ j, 0 ≤ Q.1 j), (∀ j, 0 < rectangleRadius Q j) → ∀ v, inRectangle Q v → |eval v (jacksonTensorPolynomial epsilon K hK Q hQ hQ0) - globalCellValue epsilon v| ≤ Cj * jacksonPointwiseScale Q K v) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) : let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) |(∫ eval : Cell → ℕ, jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm ∂μe) - globalCellValue epsilon q| ≤ Cj * ∑ j : Cell, (10000000 * sqrt (q j * (logAlphabet d / m)) / jacksonDegree canonicalJacksonTuning d + rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j / (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2) + exp 1000 * (1 + epsilon⁻¹) * d ^ (-3 / 16 : ℝ) * ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j := by dsimp only let Q := pilotRectangle canonicalJacksonTuning m d pilot let center := rectangleCenter Q let radius := rectangleRadius Q let K := jacksonDegree canonicalJacksonTuning d let p := jacksonTensorPolynomial epsilon K (jacksonDegree_ge_two canonicalJacksonTuning d) Q (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) let centerValue := globalCellValue epsilon center let lift := fun eval : Cell → ℕ => factorialPolynomialLift m p eval center radius centerValue let raw := fun eval : Cell → ℕ => centerValue + lift eval let S := ∑ j : Cell, radius j let scale := (1 + epsilon⁻¹) * S let clipRadius := d ^ (1 / 4 : ℝ) * scale let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) have hr : ∀ j, 0 < radius j := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd have hS : 0 < S := Finset.sum_pos (fun j _ => hr j) (Finset.univ_nonempty) have hfac : 0 < 1 + epsilon⁻¹ := by positivity have hclipRadius : 0 < clipRadius := by dsimp [clipRadius, scale] positivity have hliftInt : Integrable lift μe := by dsimp [lift, μe] simp only [factorialPolynomialLift] apply integrable_finsetSum intro alpha _halpha exact (normalizedCenteredFactorialMonomial_memLp_two m q center radius hr alpha).integrable one_le_two |>.const_mul _ have hliftSqInt : Integrable (fun eval => (lift eval) ^ 2) μe := by exact (memLp_two_iff_integrable_sq hliftInt.aestronglyMeasurable).mp (by dsimp [lift, μe] exact memLp_finsetSum _ fun alpha halpha => (normalizedCenteredFactorialMonomial_memLp_two m q center radius hr alpha).const_mul _) have hliftMean : ∫ eval, lift eval ∂μe = eval q p - centerValue := by exact factorialPolynomialLift_expectation m hm q center radius hq hr p centerValue have hstat (eval : Cell → ℕ) : jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm = clipAround centerValue clipRadius (raw eval) := by rw [jacksonCellStatistic_eq_clipAround] have hdisp (eval : Cell → ℕ) : |clipAround centerValue clipRadius (raw eval) - raw eval| ≤ (lift eval) ^ 2 / clipRadius := by simpa [raw, lift] using abs_clipAround_sub_self_le_sq_div centerValue clipRadius (raw eval) hclipRadius have hdispInt : Integrable (fun eval => clipAround centerValue clipRadius (raw eval) - raw eval) μe := by apply (hliftSqInt.div_const clipRadius).mono' · fun_prop · filter_upwards with eval simpa only [Real.norm_eq_abs] using hdisp eval have hrawInt : Integrable raw μe := (integrable_const centerValue).add hliftInt have hmeanDecomp : (∫ eval, jacksonCellStatistic canonicalJacksonTuning epsilon d m pilot eval hm ∂μe) - globalCellValue epsilon q = (eval q p - globalCellValue epsilon q) + ∫ eval, (clipAround centerValue clipRadius (raw eval) - raw eval) ∂μe := by simp_rw [hstat] rw [show (fun eval => clipAround centerValue clipRadius (raw eval)) = fun eval => raw eval + (clipAround centerValue clipRadius (raw eval) - raw eval) by funext eval; ring] rw [integral_add hrawInt hdispInt, integral_add, hliftMean] · simp only [integral_const, probReal_univ, one_smul] ring · exact integrable_const centerValue · exact hliftInt have hqmem := pilotGoodEvent_mem_pilotRectangle canonicalJacksonTuning m d pilot q hq hgood have happ0 := happrox K Q (jacksonDegree_ge_two canonicalJacksonTuning d) (pilotRectangle_valid canonicalJacksonTuning m d pilot hm) (pilotRectangle_nonneg canonicalJacksonTuning m d pilot) hr q (fun j => hqmem j) have hscale : jacksonPointwiseScale Q K q ≤ ∑ j : Cell, (10000000 * sqrt (q j * (logAlphabet d / m)) / (K : ℝ) + radius j / (K : ℝ) ^ 2) := by unfold jacksonPointwiseScale have hKpos : (0 : ℝ) < K := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (jacksonDegree_ge_two canonicalJacksonTuning d)) apply Finset.sum_le_sum intro j _ apply add_le_add · exact div_le_div_of_nonneg_right (by simpa [Q] using (canonicalPilotGoodSqrtWidth_le m hm d hd pilot q hq hgood j)) (le_of_lt hKpos) · rfl have happ : |eval q p - globalCellValue epsilon q| ≤ Cj * ∑ j : Cell, (10000000 * sqrt (q j * (logAlphabet d / m)) / (K : ℝ) + radius j / (K : ℝ) ^ 2) := by refine happ0.trans ?_ exact mul_le_mul_of_nonneg_left hscale (le_of_lt hCj) have hl2 := canonicalGoodPilotFactorialLift_sq_le epsilon m hepsilon hm d hd pilot q hq hgood have hintDisp : |∫ eval, (clipAround centerValue clipRadius (raw eval) - raw eval) ∂μe| ≤ exp 1000 * (1 + epsilon⁻¹) * d ^ (-3 / 16 : ℝ) * S := by calc |∫ eval, (clipAround centerValue clipRadius (raw eval) - raw eval) ∂μe| ≤ ∫ eval, |clipAround centerValue clipRadius (raw eval) - raw eval| ∂μe := abs_integral_le_integral_abs _ ≤ ∫ eval, (lift eval) ^ 2 / clipRadius ∂μe := by exact integral_mono hdispInt.abs (hliftSqInt.div_const _) hdisp _ = (∫ eval, (lift eval) ^ 2 ∂μe) / clipRadius := by rw [integral_div] _ ≤ (exp 1000 * d ^ (1 / 16 : ℝ) * scale ^ 2) / clipRadius := by gcongr _ = exp 1000 * (1 + epsilon⁻¹) * d ^ (-3 / 16 : ℝ) * S := by dsimp [clipRadius, scale] rw [show (-3 / 16 : ℝ) = 1 / 16 - 1 / 4 by norm_num, Real.rpow_sub (by positivity : (0 : ℝ) < d)] field_simp rw [hmeanDecomp] refine (abs_add_le _ _).trans ?_ calc |eval q p - globalCellValue epsilon q| + |∫ eval, clipAround centerValue clipRadius (raw eval) - raw eval ∂μe| ≤ Cj * ∑ j : Cell, (10000000 * sqrt (q j * (logAlphabet d / m)) / (K : ℝ) + radius j / (K : ℝ) ^ 2) + exp 1000 * (1 + epsilon⁻¹) * d ^ (-3 / 16 : ℝ) * S := add_le_add happ hintDisp _ = _ := by rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalGoodPilotConditionalBias · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlPointwise.lean:489
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotControlTheorem 1 declarations Final assembly of the cellwise factorial risk theorem.

Final assembly of the cellwise factorial risk theorem.

theorem centered_factorial_pilot_control Lemma 8 in the paper ↗

If the product experiment has the stated independent-sampling law, then the canonical Jackson tuning simultaneously provides the stated pilot/evaluation laws, factorial moment identities, and uniform bias, variance, and pilot-failure bounds.

Formal statement
h_iid :
∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)
conclusion 1
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ Cepsilon : ℝ,
0 < Cepsilon
n d :
P :
(hn : 0 < n)
m :
n / 8 (: ℝ)
hm :
by exact div_pos (Nat.cast_pos.mpr hn) (by norm_num) (: 0 < m)
Measure.map fst (uncappedMarkedCountLaw n P)
= poissonMeasure (toNNReal ((n : ℝ) / 4))
x :
Fin d
Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P)
x :
Fin d
pilot :
Cell → ℕ
j :
z :
h t :
conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z)
= (cellVector P x j - z) ^ h
conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z)
= ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (cellVector P x j / m) ^ l * (cellVector P x j - z) ^ (h + t - 2 * l)
x :
Fin d
|cellStatisticExpectation tuning epsilon d m (cellVector P x) hm
- globalCellValue epsilon (cellVector P x)|
≤ Cepsilon * (sqrt (cellMass P x / (m * logAlphabet d)) + 1 / (m * logAlphabet d))
cellStatisticVariance tuning epsilon d m (cellVector P x) hm
≤ Cepsilon * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / m + logAlphabet d ^ 2 / m ^ 2)
pilotFailureContribution tuning epsilon d m (cellVector P x) hm
≤ Cepsilon * (sqrt (cellMass P x / (m * logAlphabet d)) + 1 / (m * logAlphabet d))
≤ Cepsilon * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / m + logAlphabet d ^ 2 / m ^ 2)
Proof (Lean source)
lemma centered_factorial_pilot_control (h_iid : ∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)) : ∃ tuning : JacksonTuning, tuning = canonicalJacksonTuning ∧ ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ Cepsilon : ℝ, 0 < Cepsilon ∧ ∀ (n d : ℕ) (P : DiscreteLaw d), (hn : 0 < n) → ObservedModelClass epsilon P → let m : ℝ := n / 8 let hm : 0 < m := by exact div_pos (Nat.cast_pos.mpr hn) (by norm_num) Measure.map fst (uncappedMarkedCountLaw n P) = poissonMeasure (toNNReal ((n : ℝ) / 4)) ∧ Measure.map snd (uncappedMarkedCountLaw n P) = pilotEvaluationTableLaw m P ∧ (∀ x : Fin d, Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P) = pilotEvaluationLaw m (cellVector P x)) ∧ (∀ (x : Fin d) (pilot : Cell → ℕ) (j : Cell) (z : ℝ) (h t : ℕ), conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z) = (cellVector P x j - z) ^ h ∧ conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z) = ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (cellVector P x j / m) ^ l * (cellVector P x j - z) ^ (h + t - 2 * l)) ∧ ∀ x : Fin d, |cellStatisticExpectation tuning epsilon d m (cellVector P x) hm - globalCellValue epsilon (cellVector P x)| ≤ Cepsilon * (sqrt (cellMass P x / (m * logAlphabet d)) + 1 / (m * logAlphabet d)) ∧ cellStatisticVariance tuning epsilon d m (cellVector P x) hm ≤ Cepsilon * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / m + logAlphabet d ^ 2 / m ^ 2) ∧ pilotFailureContribution tuning epsilon d m (cellVector P x) hm ≤ Cepsilon * (sqrt (cellMass P x / (m * logAlphabet d)) + 1 / (m * logAlphabet d)) ∧ pilotFailureSecondMomentContribution tuning epsilon d m (cellVector P x) hm ≤ Cepsilon * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / m + logAlphabet d ^ 2 / m ^ 2) := by classical rcases simultaneous_jackson_certificate with ⟨_A, _hA, hcertificate⟩ refine ⟨canonicalJacksonTuning, rfl, ?_⟩ intro epsilon hepsilon hepsilonHalf rcases hcertificate epsilon hepsilon hepsilonHalf with ⟨Cj, hCj, hcert⟩ let C1 := productMomentConstant 4 1 let C2 := productMomentConstant 4 2 let F := 1 + epsilon⁻¹ let Cepsilon := 1 + (50000000000000000 * Cj + 450000000 * exp 1000 * F) + 450 * F * C1 + 8 * exp 1000 * F ^ 2 * 2000000 ^ 2 + 8 * F ^ 2 * C2 have hF : 0 < F := by dsimp [F]; positivity have hC1 : 0 < C1 := by exact productMomentConstant_pos 4 1 have hC2 : 0 < C2 := by exact productMomentConstant_pos 4 2 have hCepsilon : 0 < Cepsilon := by have hJ : 0 ≤ 50000000000000000 * Cj + 450000000 * exp 1000 * F := by positivity have h1 : 0 ≤ 450 * F * C1 := by positivity have h2 : 0 ≤ 8 * exp 1000 * F ^ 2 * 2000000 ^ 2 := by positivity have h3 : 0 ≤ 8 * F ^ 2 * C2 := mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg F)) (le_of_lt hC2) have htail : 0 ≤ (50000000000000000 * Cj + 450000000 * exp 1000 * F) + 450 * F * C1 + 8 * exp 1000 * F ^ 2 * 2000000 ^ 2 + 8 * F ^ 2 * C2 := by linarith dsimp [Cepsilon] linarith refine ⟨Cepsilon, hCepsilon, ?_⟩ intro n d P hn _hmodel dsimp only let m : ℝ := n / 8 have hm : 0 < m := div_pos (Nat.cast_pos.mpr hn) (by norm_num) refine ⟨uncappedMarkedCountLaw_count n P, ?_, pilotEvaluationTableLaw_cell m P, ?_, ?_⟩ · simpa [m] using uncappedMarkedCountLaw_table n P · intro x pilot j z h t have hq : ∀ k, 0 ≤ cellVector P x k := by intro k exact ENNReal.toReal_nonneg exact ⟨conditionalEvaluationExpectation_centeredFactorial m hm (cellVector P x) hq pilot j z h, conditionalEvaluationExpectation_centeredFactorial_mul m hm (cellVector P x) hq pilot j z h t⟩ · intro x let q := cellVector P x let target := globalCellValue epsilon q let L := logAlphabet d let v := sqrt (cellMass P x * L / m) + L / m let μp := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let stat := fun z : (Cell → ℕ) × (Cell → ℕ) => jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm let err := fun z : (Cell → ℕ) × (Cell → ℕ) => stat z - target let good := {pilot : Cell → ℕ | pilotGoodEvent canonicalJacksonTuning m d pilot q} have hd : 1 ≤ d := Fin.pos_iff_nonempty.mpr ⟨x⟩ have hq : ∀ j, 0 ≤ q j := fun _ => ENNReal.toReal_nonneg have hsumq : ∑ j : Cell, q j = cellMass P x := by dsimp [q] rw [Fintype.sum_prod_type] simp_rw [Fin.sum_univ_two] simp [cellVector, cellMass, finTwoEquiv] ring have hmass : 0 ≤ cellMass P x := by rw [← hsumq] exact Finset.sum_nonneg fun j _ => hq j have hL : 0 < L := by dsimp [L, logAlphabet] apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)] have hL1 : 1 ≤ L := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith [Real.log_nonneg (by exact_mod_cast hd : (1 : ℝ) ≤ d)] have hsqrtScaleEq : sqrt (cellMass P x * L / m) = L * sqrt (cellMass P x / (m * L)) := by have ha0 : 0 ≤ cellMass P x / (m * L) := by positivity calc sqrt (cellMass P x * L / m) = sqrt ((cellMass P x / (m * L)) * L ^ 2) := by congr 1 field_simp _ = sqrt (cellMass P x / (m * L)) * sqrt (L ^ 2) := Real.sqrt_mul ha0 _ _ = L * sqrt (cellMass P x / (m * L)) := by rw [Real.sqrt_sq_eq_abs, abs_of_pos hL] ring have hv0 : 0 ≤ v := by dsimp [v]; positivity have hgoodMeas : MeasurableSet good := (Set.to_countable good).measurableSet let score := Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) Causalean.Stat.Concentration.PoissonSelfNormalized.universalH L m.toNNReal (fun j => (q j).toNNReal) let Afail := 2 * d ^ (1 / 4 : ℝ) * F have hAfail : 0 ≤ Afail := by dsimp [Afail]; positivity have hscore0 (pilot : Cell → ℕ) : 0 ≤ score pilot := by dsimp [score] unfold Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedAggregateScore apply Finset.sum_nonneg intro j _hj unfold Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedDeviation Causalean.Stat.Concentration.PoissonSelfNormalized.normalizedRadius Causalean.Stat.Concentration.PoissonSelfNormalized.universalH positivity have hscoreLp : MemLp score 2 μp := by simpa [score, μp, L] using canonicalNormalizedAggregateScore_memLp_two m hm d hd q hq have herrPoint (z : (Cell → ℕ) × (Cell → ℕ)) : |err z| ≤ Afail * score z.1 := by simpa [err, stat, target, Afail, F, score, L] using canonicalJacksonCellError_le_normalizedAggregateScore epsilon m hepsilon hm d hd z.1 z.2 q hq have herrLp : MemLp err 2 (μp.prod μe) := by have hdom := (hscoreLp.const_mul Afail).comp_fst μe apply hdom.mono (by fun_prop) filter_upwards with z simpa only [Real.norm_eq_abs, norm_mul, Real.norm_eq_abs, abs_of_nonneg hAfail, abs_of_nonneg (hscore0 z.1)] using herrPoint z have herrInt : Integrable err (μp.prod μe) := herrLp.integrable one_le_two have herrSqInt : Integrable (fun z => err z ^ 2) (μp.prod μe) := herrLp.integrable_sq have hbiasDecomp : |cellStatisticExpectation canonicalJacksonTuning epsilon d m q hm - target| ≤ (50000000000000000 * Cj + 450000000 * exp 1000 * F) * (sqrt (cellMass P x / (m * L)) + 1 / (m * L)) + pilotFailureContribution canonicalJacksonTuning epsilon d m q hm := by let ce := fun pilot : Cell → ℕ => ∫ eval, err (pilot, eval) ∂μe let r := sqrt (cellMass P x / (m * L)) + 1 / (m * L) let Bgood := (50000000000000000 * Cj + 450000000 * exp 1000 * F) * r let goodProd : Set ((Cell → ℕ) × (Cell → ℕ)) := {z | z.1 ∈ good} have hgoodProdMeas : MeasurableSet goodProd := hgoodMeas.preimage measurable_fst have hceGood (pilot : Cell → ℕ) (hp : pilot ∈ good) : |ce pilot| ≤ Bgood := by have hb := canonicalGoodPilotConditionalBias epsilon m hepsilon hm d hd pilot q hq Cj hCj (fun K Q hK hQ hQ0 hQr v hv => (hcert K Q hK hQ hQ0 hQr).2.1 v hv) hp have hS := canonicalPilotGoodRadiusSum_le m hm d hd pilot q hq hp have hlogs := canonicalLogPowerBounds d hd have hlogs2 := canonicalLogSquaredPowerBounds d hd dsimp [ce, err, stat, target] at hb ⊢ have herrPilotInt : Integrable (fun eval => err (pilot, eval)) μe := by apply (integrable_const (Afail * score pilot)).mono' · fun_prop · filter_upwards with eval simpa only [Real.norm_eq_abs, abs_of_nonneg hAfail, abs_of_nonneg (hscore0 pilot)] using herrPoint (pilot, eval) have hstatPilotInt : Integrable (fun eval => stat (pilot, eval)) μe := by exact herrPilotInt.add (integrable_const target) |>.congr (Filter.Eventually.of_forall fun eval => by dsimp [err]; ring) have hceEq : (∫ eval, err (pilot, eval) ∂μe) = (∫ eval, stat (pilot, eval) ∂μe) - target := by rw [show (fun eval => err (pilot, eval)) = fun eval => stat (pilot, eval) - target by funext eval; rfl, integral_sub hstatPilotInt (integrable_const target), integral_const, probReal_univ, one_smul] have hS' : ∑ j : Cell, rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j ≤ 2000000 * v := by simpa [v, L, hsumq] using hS have hL1 : 1 ≤ L := by dsimp [L, logAlphabet] rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith [Real.log_nonneg (by exact_mod_cast hd : (1 : ℝ) ≤ d)] have hsqrtEq := hsqrtScaleEq have hvle : v ≤ L ^ 2 * r := by dsimp [v, r] rw [hsqrtEq] have ha := Real.sqrt_nonneg (cellMass P x / (m * L)) have hLL : L ≤ L ^ 2 := by nlinarith have hmul := mul_le_mul_of_nonneg_right hLL ha have hbEq : L ^ 2 * (1 / (m * L)) = L / m := by field_simp [ne_of_gt hL, ne_of_gt hm] calc L * sqrt (cellMass P x / (m * L)) + L / m ≤ L ^ 2 * sqrt (cellMass P x / (m * L)) + L / m := by linarith _ = L ^ 2 * (sqrt (cellMass P x / (m * L)) + 1 / (m * L)) := by rw [mul_add, hbEq] have hKpos : (0 : ℝ) < jacksonDegree canonicalJacksonTuning d := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (jacksonDegree_ge_two canonicalJacksonTuning d)) have hfirst : sqrt (cellMass P x * L / m) / jacksonDegree canonicalJacksonTuning d ≤ 150000 * sqrt (cellMass P x / (m * L)) := by rw [hsqrtEq] have := mul_le_mul_of_nonneg_right hlogs.1 (Real.sqrt_nonneg (cellMass P x / (m * L))) calc L * sqrt (cellMass P x / (m * L)) / jacksonDegree canonicalJacksonTuning d = (L / jacksonDegree canonicalJacksonTuning d) * sqrt (cellMass P x / (m * L)) := by ring _ ≤ _ := this have hLKsq : (L / (jacksonDegree canonicalJacksonTuning d : ℝ)) ^ 2 ≤ 150000 ^ 2 := (sq_le_sq₀ (by positivity) (by norm_num)).2 hlogs.1 have hsecond : (L / m) / (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2 ≤ 22500000000 * (1 / (m * L)) := by have ht := mul_le_mul_of_nonneg_right hLKsq (by positivity : 0 ≤ 1 / (m * L)) field_simp [ne_of_gt hL, ne_of_gt hm, ne_of_gt hKpos] at ht ⊢ nlinarith have hsqrtSum : (∑ j : Cell, sqrt (q j * (L / m))) ≤ 2 * sqrt (cellMass P x * L / m) := by have hs := sum_cell_sqrt_mul_le q hq (L / m) (by positivity) rw [hsumq] at hs convert hs using 1 <;> ring have hlocal : (∑ j : Cell, (10000000 * sqrt (q j * (L / m)) / jacksonDegree canonicalJacksonTuning d + rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j / (jacksonDegree canonicalJacksonTuning d : ℝ) ^ 2)) ≤ 22000000 * sqrt (cellMass P x * L / m) / jacksonDegree canonicalJacksonTuning d + -- … truncated; follow the source link for the rest …
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centered_factorial_pilot_control · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotControlTheorem.lean:13
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotExperimentCore 1 declarations Exact marked-Poisson laws and conditional factorial moments used by pilot control.

Exact marked-Poisson laws and conditional factorial moments used by pilot control.

theorem centeredFactorialPilotExperimentCore

The uncapped marked experiment has the required Poisson total, joint cell-product law, and coordinatewise conditional factorial-moment identities. This uses the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
hn :
0 < n
m :
n / 8 (: ℝ)
Measure.map fst (uncappedMarkedCountLaw n P)
= poissonMeasure (toNNReal ((n : ℝ) / 4))
x :
Fin d
Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P)
x :
Fin d
pilot :
Cell → ℕ
j :
z :
h t :
conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z)
= (cellVector P x j - z) ^ h
conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z)
= ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (cellVector P x j / m) ^ l * (cellVector P x j - z) ^ (h + t - 2 * l)
Proof (Lean source)
lemma centeredFactorialPilotExperimentCore {n d : ℕ} (P : DiscreteLaw d) (hn : 0 < n) : let m : ℝ := n / 8 Measure.map fst (uncappedMarkedCountLaw n P) = poissonMeasure (toNNReal ((n : ℝ) / 4)) ∧ Measure.map snd (uncappedMarkedCountLaw n P) = pilotEvaluationTableLaw m P ∧ (∀ x : Fin d, Measure.map (fun z => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P) = pilotEvaluationLaw m (cellVector P x)) ∧ ∀ (x : Fin d) (pilot : Cell → ℕ) (j : Cell) (z : ℝ) (h t : ℕ), conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z) = (cellVector P x j - z) ^ h ∧ conditionalEvaluationExpectation m (cellVector P x) pilot (fun eval => centeredFactorial m h (eval j) z * centeredFactorial m t (eval j) z) = ∑ l ∈ range (min h t + 1), (Nat.choose h l : ℝ) * Nat.choose t l * factorial l * (cellVector P x j / m) ^ l * (cellVector P x j - z) ^ (h + t - 2 * l) := by dsimp only have hm : (0 : ℝ) < n / 8 := div_pos (Nat.cast_pos.mpr hn) (by norm_num) refine ⟨uncappedMarkedCountLaw_count n P, uncappedMarkedCountLaw_table n P, fun x => pilotEvaluationTableLaw_cell (n / 8) P x, ?_⟩ intro x pilot j z h t exact ⟨conditionalEvaluationExpectation_centeredFactorial (n / 8) hm (cellVector P x) (fun _ => ENNReal.toReal_nonneg) pilot j z h, conditionalEvaluationExpectation_centeredFactorial_mul (n / 8) hm (cellVector P x) (fun _ => ENNReal.toReal_nonneg) pilot j z h t⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.centeredFactorialPilotExperimentCore · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotExperimentCore.lean:10
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.PilotLocalizedScale 1 declarations Localized geometry of the canonical pilot rectangle.

Localized geometry of the canonical pilot rectangle.

theorem canonicalPilotGoodSqrtWidth_le

On a good pilot, the Jackson endpoint weight vanishes at a null coordinate and otherwise has the local square-root scale. This uses the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, and the pilot sample lies in the good event. The displayed identity or bound is the asserted conclusion.

Formal statement
m :
hm :
0 < m
d :
hd :
1 ≤ d
pilot :
Cell → ℕ
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
j :
sqrt ((q j - (pilotRectangle canonicalJacksonTuning m d pilot).1 j) * ((pilotRectangle canonicalJacksonTuning m d pilot).2 j - q j))
≤ 10000000 * sqrt (q j * (logAlphabet d / m))
Proof (Lean source)
lemma canonicalPilotGoodSqrtWidth_le (m : ℝ) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (pilot : Cell → ℕ) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) (hgood : pilotGoodEvent canonicalJacksonTuning m d pilot q) (j : Cell) : sqrt ((q j - (pilotRectangle canonicalJacksonTuning m d pilot).1 j) * ((pilotRectangle canonicalJacksonTuning m d pilot).2 j - q j)) ≤ 10000000 * sqrt (q j * (logAlphabet d / m)) := by let tau := logAlphabet d / m let c := pilotCenter m pilot j let s := sqrt (c * tau) let h := pilotRadius canonicalJacksonTuning m d pilot j change sqrt ((q j - (pilotRectangle canonicalJacksonTuning m d pilot).1 j) * ((pilotRectangle canonicalJacksonTuning m d pilot).2 j - q j)) ≤ 10000000 * sqrt (q j * tau) have hL : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1)] have htau : 0 < tau := div_pos hL hm have hc : 0 ≤ c := by dsimp [c, pilotCenter]; positivity have hs : 0 ≤ s := Real.sqrt_nonneg _ have hs2 : s ^ 2 = c * tau := by dsimp [s] rw [Real.sq_sqrt] <;> positivity have hh : h = 1024 * (s + tau) := by simp [h, pilotRadius, canonicalJacksonTuning, universalH, s, tau, c] congr 2 ring have hmem := pilotGoodEvent_mem_pilotRectangle canonicalJacksonTuning m d pilot q hq hgood j have hqclose : |pilotCenter m pilot j - q j| ≤ h / 4 := by simpa [pilotGoodEvent, h] using hgood j change |c - q j| ≤ h / 4 at hqclose by_cases hlo : c - h ≤ 0 · have hyoung : s ≤ c / 2048 + 512 * tau := by apply Real.sqrt_le_iff.mpr constructor · positivity · rw [show c * tau = s ^ 2 by exact hs2.symm] nlinarith [sq_nonneg (c / 2048 - 512 * tau)] have hcle : c ≤ 1100000 * tau := by change c - h ≤ 0 at hlo rw [hh] at hlo nlinarith have hhle : h ≤ 1200000000 * tau := by rw [hh] nlinarith have hprod : (q j - (pilotRectangle canonicalJacksonTuning m d pilot).1 j) * ((pilotRectangle canonicalJacksonTuning m d pilot).2 j - q j) ≤ q j * (c + h) := by simp only [pilotRectangle] rw [max_eq_left hlo] dsimp only [c, h] nlinarith [hmem.1, hmem.2, sq_nonneg (q j)] apply Real.sqrt_le_iff.mpr constructor · positivity · rw [mul_pow, Real.sq_sqrt (mul_nonneg (hq j) (le_of_lt htau))] have hct : c + h ≤ 1201100000 * tau := by linarith have := mul_le_mul_of_nonneg_left hct (hq j) nlinarith · have hlo' : 0 < c - h := lt_of_not_ge hlo have hqge : 3 * c / 4 ≤ q j := by have := (abs_le.mp hqclose).2 nlinarith have htauc : tau ≤ c := by rw [hh] at hlo' nlinarith have htaus : tau ≤ s := by apply (sq_le_sq₀ (le_of_lt htau) hs).mp rw [hs2] nlinarith have hsqcomp : s ≤ 2 * sqrt (q j * tau) := by apply Real.sqrt_le_iff.mpr constructor · positivity · rw [show c * tau = s ^ 2 by exact hs2.symm, mul_pow, Real.sq_sqrt (mul_nonneg (hq j) (le_of_lt htau))] nlinarith [mul_le_mul_of_nonneg_right hqge (le_of_lt htau)] have hhle : h ≤ 4096 * sqrt (q j * tau) := by rw [hh] nlinarith have hr : rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j = h := by change ((c + h) - max 0 (c - h)) / 2 = h rw [max_eq_right (le_of_lt hlo')] ring have hsqrt : sqrt ((q j - (pilotRectangle canonicalJacksonTuning m d pilot).1 j) * ((pilotRectangle canonicalJacksonTuning m d pilot).2 j - q j)) ≤ rectangleRadius (pilotRectangle canonicalJacksonTuning m d pilot) j := by have hrpos := pilotRectangle_radius_pos canonicalJacksonTuning m d pilot hm hd j rw [Real.sqrt_le_iff] refine ⟨le_of_lt hrpos, ?_⟩ let a := (pilotRectangle canonicalJacksonTuning m d pilot).1 j let b := (pilotRectangle canonicalJacksonTuning m d pilot).2 j change (q j - a) * (b - q j) ≤ ((b - a) / 2) ^ 2 nlinarith [hmem.1, hmem.2, sq_nonneg (q j - ((pilotRectangle canonicalJacksonTuning m d pilot).1 j + (pilotRectangle canonicalJacksonTuning m d pilot).2 j) / 2)] exact hsqrt.trans (hr ▸ hhle) |>.trans (by gcongr <;> norm_num)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalPilotGoodSqrtWidth_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/PilotLocalizedScale.lean:10
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.RegularLower 9 declarations A regular parametric submodel for the bounded-alphabet lower bound.

A regular parametric submodel for the bounded-alphabet lower bound.

For the specified validity certificate, the regular null law is the discrete observed law generated by the valid null parametric data-generating process.

Definition (Lean source)
d :
Nonempty (Fin d)
g :
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)
regularNullLaw hv :
⟨Causalean.Estimation.MinimaxATE.obsPMF hv⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularNullLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:11

For the specified validity certificate, the regular perturbed law is the discrete observed law generated by the valid perturbed parametric data-generating process.

Definition (Lean source)
d :
Nonempty (Fin d)
g delta :
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)
regularPerturbedLaw hv :
⟨Causalean.Estimation.MinimaxATE.obsPMF hv⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularPerturbedLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:19
theorem regularNullLaw_jointMass Lemma regularNullLaw_jointMass in the paper ↗

If the stated v condition holds, then the stated regular null law joint mass relation holds.

Formal statement
d :
Nonempty (Fin d)
g :
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)
x :
Fin d
a y :
jointMass (regularNullLaw hv) x a y
= obsReal (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g) (x, a, y)
Proof (Lean source)
lemma regularNullLaw_jointMass {d : ℕ} [Nonempty (Fin d)] {g : ℝ} (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)) (x : Fin d) (a y : Bool) : jointMass (regularNullLaw hv) x a y = obsReal (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g) (x, a, y) := by simp [jointMass, regularNullLaw, obsPMF] simpa [one_div] using obsReal_nonneg hv (x, a, y)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularNullLaw_jointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:27
theorem regularPerturbedLaw_jointMass Lemma regularPerturbedLaw_jointMass in the paper ↗

If the stated v condition holds, then the stated regular perturbed law joint mass relation holds.

Formal statement
d :
Nonempty (Fin d)
g delta :
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)
x :
Fin d
a y :
jointMass (regularPerturbedLaw hv) x a y
= obsReal (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta) (x, a, y)
Proof (Lean source)
lemma regularPerturbedLaw_jointMass {d : ℕ} [Nonempty (Fin d)] {g delta : ℝ} (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)) (x : Fin d) (a y : Bool) : jointMass (regularPerturbedLaw hv) x a y = obsReal (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta) (x, a, y) := by simp [jointMass, regularPerturbedLaw, obsPMF] simpa [one_div] using obsReal_nonneg hv (x, a, y)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularPerturbedLaw_jointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:40

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the stated v condition holds, then the stated regular null law model relation holds.

Formal statement
d :
Nonempty (Fin d)
epsilon g :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)
Proof (Lean source)
lemma regularNullLaw_model {d : ℕ} [Nonempty (Fin d)] {epsilon g : ℝ} (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)) : ObservedModelClass epsilon (regularNullLaw hv) := by refine ⟨hd, hepsilon.1, hepsilon.2, ?_⟩ intro x hx have hcard : (card (Fin d) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero have hmass : cellMass (regularNullLaw hv) x = (card (Fin d) : ℝ)⁻¹ := by simp [cellMass, regularNullLaw_jointMass, obsReal, mC, gNull] ring have harm : armMass (regularNullLaw hv) true x = (1 / 2) * (card (Fin d) : ℝ)⁻¹ := by simp [armMass, regularNullLaw_jointMass, obsReal, mC, gNull] ring rw [propensity, hmass, harm] field_simp constructor <;> linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularNullLaw_model · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:53
theorem regularPerturbedLaw_model Lemma regularPerturbedLaw_model in the paper ↗

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the stated v condition holds, then the stated regular perturbed law model relation holds.

Formal statement
d :
Nonempty (Fin d)
epsilon g delta :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)
Proof (Lean source)
lemma regularPerturbedLaw_model {d : ℕ} [Nonempty (Fin d)] {epsilon g delta : ℝ} (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)) : ObservedModelClass epsilon (regularPerturbedLaw hv) := by refine ⟨hd, hepsilon.1, hepsilon.2, ?_⟩ intro x hx have hcard : (card (Fin d) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero have hmass : cellMass (regularPerturbedLaw hv) x = (card (Fin d) : ℝ)⁻¹ := by simp [cellMass, regularPerturbedLaw_jointMass, obsReal, mC, gPert] ring have harm : armMass (regularPerturbedLaw hv) true x = (1 / 2) * (card (Fin d) : ℝ)⁻¹ := by simp [armMass, regularPerturbedLaw_jointMass, obsReal, mC, gPert] ring rw [propensity, hmass, harm] field_simp constructor <;> linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularPerturbedLaw_model · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:83

If the stated v condition holds, and the observed law satisfies the stated model restrictions, then the stated regular null law value relation holds.

Formal statement
d :
Nonempty (Fin d)
epsilon g :
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)
Proof (Lean source)
lemma regularNullLaw_value {d : ℕ} [Nonempty (Fin d)] {epsilon g : ℝ} (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gNull (C := Fin d) g g)) (hP : ObservedModelClass epsilon (regularNullLaw hv)) : observedOptimalValue (regularNullLaw hv) hP = g := by rw [observedOptimalValue, observedOptimalValueRaw] have hcard : (card (Fin d) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero have hdcast : (d : ℝ) ≠ 0 := by simpa using hcard simp [cellMass, outcomeMean, armMass, regularNullLaw_jointMass, obsReal, mC, gNull] field_simp [hdcast] <;> ring_nf <;> simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularNullLaw_value · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:113
theorem regularPerturbedLaw_value Lemma regularPerturbedLaw_value in the paper ↗

If the stated delta condition holds, and the stated v condition holds, and the observed law satisfies the stated model restrictions, then the stated regular perturbed law value relation holds.

Formal statement
d :
Nonempty (Fin d)
epsilon g delta :
hdelta :
0 ≤ delta
hv :
ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)
Proof (Lean source)
lemma regularPerturbedLaw_value {d : ℕ} [Nonempty (Fin d)] {epsilon g delta : ℝ} (hdelta : 0 ≤ delta) (hv : ValidDGP (mC (C := Fin d) (1 / 2)) (gPert (C := Fin d) g g delta)) (hP : ObservedModelClass epsilon (regularPerturbedLaw hv)) : observedOptimalValue (regularPerturbedLaw hv) hP = g + delta := by rw [observedOptimalValue, observedOptimalValueRaw] have hcard : (card (Fin d) : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr Fintype.card_ne_zero have hdcast : (d : ℝ) ≠ 0 := by simpa using hcard simp [cellMass, outcomeMean, armMass, regularPerturbedLaw_jointMass, obsReal, mC, gPert] field_simp [hdcast] <;> ring_nf <;> simp [max_eq_right (by linarith : g ≤ g + delta)] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regularPerturbedLaw_value · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:130
theorem regular_parametric_lower Lemma regular_parametric_lower in the paper ↗

If the overlap parameter satisfies its stated range restriction, and the sample size satisfies its stated restriction, and the alphabet size satisfies its stated restriction, then every admissible model has minimax risk at least 1/(100n)1/(100n).

Formal statement
epsilon :
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
n d :
hn :
1 ≤ n
hd :
2 ≤ d
1 / (100 * (n : ℝ)) ≤ minimaxRisk n d epsilon
Proof (Lean source)
lemma regular_parametric_lower {epsilon : ℝ} (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (n d : ℕ) (hn : 1 ≤ n) (hd : 2 ≤ d) : 1 / (100 * (n : ℝ)) ≤ minimaxRisk n d epsilon := by letI : Nonempty (Fin d) := ⟨⟨0, lt_of_lt_of_le Nat.zero_lt_two hd⟩⟩ let delta : ℝ := (2 / 5) / Real.sqrt n have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hdelta0 : 0 ≤ delta := by dsimp [delta]; positivity have hdeltasq : delta ^ 2 = 4 / (25 * (n : ℝ)) := by dsimp [delta] rw [div_pow, Real.sq_sqrt hnR.le] ring let hv0 := validDGP_null (C := Fin d) (m₀ := (1 / 2 : ℝ)) (g₀ := (1 / 2 : ℝ)) (g₁ := (1 / 2 : ℝ)) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) have hdeltaU : (1 / 2 : ℝ) + delta ≤ 1 := by have hsqrt_one : 1 ≤ Real.sqrt (n : ℝ) := Real.one_le_sqrt.mpr (by exact_mod_cast hn) have : delta ≤ 2 / 5 := by dsimp [delta] exact div_le_self (by norm_num) hsqrt_one linarith let hv1 := validDGP_pert (C := Fin d) (m₀ := (1 / 2 : ℝ)) (g₀ := (1 / 2 : ℝ)) (g₁ := (1 / 2 : ℝ)) (δ := delta) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) hdelta0 hdeltaU let P0 : DiscreteLaw d := regularNullLaw hv0 let P1 : DiscreteLaw d := regularPerturbedLaw hv1 have hP0 : ObservedModelClass epsilon P0 := regularNullLaw_model hd hepsilon hv0 have hP1 : ObservedModelClass epsilon P1 := regularPerturbedLaw_model hd hepsilon hv1 let MP0 : ModelLaw d epsilon := ⟨P0, hP0⟩ let MP1 : ModelLaw d epsilon := ⟨P1, hP1⟩ have ht0 : observedOptimalValue P0 hP0 = 1 / 2 := regularNullLaw_value hv0 hP0 have ht1 : observedOptimalValue P1 hP1 = 1 / 2 + delta := regularPerturbedLaw_value hdelta0 hv1 hP1 have hreg : (n : ℝ) * ((1 / 2 : ℝ) * delta ^ 2 / ((1 / 2 : ℝ) * (1 - 1 / 2))) ≤ log 2 := by rw [hdeltasq] have hlog : (8 / 25 : ℝ) ≤ log 2 := le_trans (by norm_num) (le_of_lt Real.log_two_gt_d9) convert hlog using 1 <;> field_simp <;> ring have htv : tvDist (productLaw P0 n) (productLaw P1 n) ≤ 1 / 2 := by simpa [P0, P1, regularNullLaw, regularPerturbedLaw, productLaw, obsLaw, productLaw, obsLaw] using (tvDist_productLaw_le_half hv0 hv1 (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) (by norm_num) hreg) have hsep : 2 * (delta / 2) ≤ |observedOptimalValue MP0.1 MP0.2 - observedOptimalValue MP1.1 MP1.2| := by rw [show observedOptimalValue MP0.1 MP0.2 = (1 / 2 : ℝ) by simpa [MP0] using ht0, show observedOptimalValue MP1.1 MP1.2 = (1 / 2 : ℝ) + delta by simpa [MP1] using ht1] rw [show (1 / 2 : ℝ) - (1 / 2 + delta) = -delta by ring, abs_neg, abs_of_nonneg hdelta0] ring_nf exact le_refl delta have hlow := minimaxRisk_ge_two_model_tv MP0 MP1 (s := delta / 2) (by positivity) hsep htv calc 1 / (100 * (n : ℝ)) = (delta / 2) ^ 2 / 4 := by rw [show (delta / 2) ^ 2 = delta ^ 2 / 4 by ring, hdeltasq] field_simp <;> ring_nf _ ≤ minimaxRisk n d epsilon := hlow
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.regular_parametric_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/RegularLower.lean:149
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.TwoPointLower 1 declarations A reusable two-model testing lower bound for the observed minimax problem.

A reusable two-model testing lower bound for the observed minimax problem.

theorem minimaxRisk_ge_two_model_tv Lemma minimaxRisk_ge_two_model_tv in the paper ↗

Two observed models separated by 2s in target value and at total variation at most one half force minimax squared risk at least s²/4. This uses the stated support condition holds, and the two target values have the stated separation, and the two experiments have the stated total-variation bound. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
epsilon s :
P0 P1 :
ModelLaw d epsilon
hs :
0 ≤ s
hsep :
2 * s ≤ |observedOptimalValue P0.1 P0.2 - observedOptimalValue P1.1 P1.2|
htv :
tvDist (productLaw P0.1 n) (productLaw P1.1 n) ≤ 1 / 2
s ^ 2 / 4 ≤ minimaxRisk n d epsilon
Proof (Lean source)
lemma minimaxRisk_ge_two_model_tv {n d : ℕ} {epsilon s : ℝ} (P0 P1 : ModelLaw d epsilon) (hs : 0 ≤ s) (hsep : 2 * s ≤ |observedOptimalValue P0.1 P0.2 - observedOptimalValue P1.1 P1.2|) (htv : tvDist (productLaw P0.1 n) (productLaw P1.1 n) ≤ 1 / 2) : s ^ 2 / 4 ≤ minimaxRisk n d epsilon := by classical letI : Nonempty (Estimator n d) := ⟨⟨fun _ => 0, measurable_const⟩⟩ unfold minimaxRisk apply le_minimaxValue intro est let theta0 := observedOptimalValue P0.1 P0.2 let theta1 := observedOptimalValue P1.1 P1.2 have htest := two_point_lower_bound_of_tvDist_le (P₀ := productLaw P0.1 n) (P₁ := productLaw P1.1 n) est.2 (θ₀ := theta0) (θ₁ := theta1) (s := s) (c := (1 / 2 : ℝ)) (by simpa [theta0, theta1] using hsep) htv have hprob : 1 / 4 ≤ max ((productLaw P0.1 n).real {z | s ≤ |est.1 z - theta0|}) ((productLaw P1.1 n).real {z | s ≤ |est.1 z - theta1|}) := by convert htest using 1 <;> norm_num have hrisk (P : ModelLaw d epsilon) (theta : ℝ) (htheta : theta = observedOptimalValue P.1 P.2) : s ^ 2 * (productLaw P.1 n).real {z | s ≤ |est.1 z - theta|} ≤ observedRisk epsilon n est P := by subst theta unfold observedRisk Causalean.Stat.sqRisk let f : (Fin n → Obs d) → ℝ := fun z => (est.1 z - observedOptimalValue P.1 P.2) ^ 2 have hf_nonneg : 0 ≤ f := fun z => sq_nonneg _ have hf_int : Integrable f (productLaw P.1 n) := Integrable.of_finite have hmeas : MeasurableSet {z | s ^ 2 ≤ f z} := by exact measurableSet_le measurable_const ((est.2.sub measurable_const).pow_const 2) have hmarkov := mul_meas_ge_le_integral_of_nonneg (μ := productLaw P.1 n) (f := f) (ae_of_all _ hf_nonneg) hf_int (s ^ 2) have hevent : {z | s ≤ |est.1 z - observedOptimalValue P.1 P.2|} = {z | s ^ 2 ≤ f z} := by ext z simp only [Set.mem_setOf_eq, f] simpa [abs_of_nonneg hs, sq_abs] using (sq_le_sq₀ hs (abs_nonneg (est.1 z - observedOptimalValue P.1 P.2))).symm rw [hevent] simpa [Measure.real, hmeas] using hmarkov have hrisk0 : s ^ 2 * (productLaw P0.1 n).real {z | s ≤ |est.1 z - theta0|} ≤ observedRisk epsilon n est P0 := hrisk P0 theta0 rfl have hrisk1 : s ^ 2 * (productLaw P1.1 n).real {z | s ≤ |est.1 z - theta1|} ≤ observedRisk epsilon n est P1 := hrisk P1 theta1 rfl have hmax : s ^ 2 / 4 ≤ max (observedRisk epsilon n est P0) (observedRisk epsilon n est P1) := by calc s ^ 2 / 4 = s ^ 2 * (1 / 4) := by ring _ ≤ s ^ 2 * max ((productLaw P0.1 n).real {z | s ≤ |est.1 z - theta0|}) ((productLaw P1.1 n).real {z | s ≤ |est.1 z - theta1|}) := by gcongr _ = max (s ^ 2 * (productLaw P0.1 n).real {z | s ≤ |est.1 z - theta0|}) (s ^ 2 * (productLaw P1.1 n).real {z | s ≤ |est.1 z - theta1|}) := by rw [mul_max_of_nonneg _ _ (sq_nonneg s)] _ ≤ max (observedRisk epsilon n est P0) (observedRisk epsilon n est P1) := max_le_max hrisk0 hrisk1 exact hmax.trans (max_le (le_worstCaseRisk (observedRisk_bddAbove est) P0) (le_worstCaseRisk (observedRisk_bddAbove est) P1))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.minimaxRisk_ge_two_model_tv · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/TwoPointLower.lean:10
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.UpperRiskAggregation 9 declarations

If the alphabet size satisfies its stated restriction, and the stated c condition holds, and the Poisson intensity is positive, and the Lipschitz scale is positive, and the stated p condition holds, and the stated sump condition holds, and the quadratic weights are nonnegative, then the stated sum cell bias squared upper bound relation holds.

Formal statement
d :
Fin d → ℝ
C m L :
hd :
1 ≤ d
hC :
0 ≤ C
hm :
0 < m
hL :
0 < L
hp :
∀ x, 0 ≤ p x
hsump :
∑ x, p x = 1
hb :
∀ x, |b x| ≤ C * (sqrt (p x / (m * L)) + 1 / (m * L))
(∑ x, b x) ^ 2 ≤ 2 * C ^ 2 * (d / (m * L) + d ^ 2 / (m ^ 2 * L ^ 2))
Proof (Lean source)
lemma sumCellBias_sq_le {d : ℕ} {b p : Fin d → ℝ} {C m L : ℝ} (hd : 1 ≤ d) (hC : 0 ≤ C) (hm : 0 < m) (hL : 0 < L) (hp : ∀ x, 0 ≤ p x) (hsump : ∑ x, p x = 1) (hb : ∀ x, |b x| ≤ C * (sqrt (p x / (m * L)) + 1 / (m * L))) : (∑ x, b x) ^ 2 ≤ 2 * C ^ 2 * (d / (m * L) + d ^ 2 / (m ^ 2 * L ^ 2)) := by have hsqrt : (∑ x : Fin d, sqrt (p x)) ^ 2 ≤ d := by calc (∑ x : Fin d, sqrt (p x)) ^ 2 ≤ (∑ _x : Fin d, (1 : ℝ) ^ 2) * ∑ x : Fin d, (sqrt (p x)) ^ 2 := by simpa using (Finset.sum_mul_sq_le_sq_mul_sq univ (fun _ => (1 : ℝ)) (fun x => sqrt (p x))) _ = d := by simp [Real.sq_sqrt (hp _), hsump] have habs : |∑ x, b x| ≤ C * (sqrt (d / (m * L)) + d / (m * L)) := by calc |∑ x, b x| ≤ ∑ x, |b x| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ x, C * (sqrt (p x / (m * L)) + 1 / (m * L)) := Finset.sum_le_sum fun x _ => hb x _ = C * ((∑ x, sqrt (p x / (m * L))) + d / (m * L)) := by simp_rw [mul_add] rw [Finset.sum_add_distrib, ← Finset.mul_sum] simp ring _ ≤ C * (sqrt (d / (m * L)) + d / (m * L)) := by gcongr rw [show (∑ x : Fin d, sqrt (p x / (m * L))) = (∑ x, sqrt (p x)) / sqrt (m * L) by rw [Finset.sum_div] apply Finset.sum_congr rfl intro x _ rw [Real.sqrt_div (hp x)]] rw [div_le_iff₀ (Real.sqrt_pos.2 (mul_pos hm hL))] rw [← Real.sqrt_mul (by positivity : 0 ≤ (d : ℝ) / (m * L)), show d / (m * L) * (m * L) = d by field_simp] have hs0 : 0 ≤ ∑ x : Fin d, sqrt (p x) := sum_nonneg fun _ _ => Real.sqrt_nonneg _ have hd0 : 0 ≤ (d : ℝ) := Nat.cast_nonneg d exact (sq_le_sq₀ hs0 (Real.sqrt_nonneg _)).mp (by simpa [Real.sq_sqrt hd0] using hsqrt) have hright0 : 0 ≤ C * (sqrt (d / (m * L)) + d / (m * L)) := by positivity have hsquare := (sq_le_sq₀ (abs_nonneg _) hright0).2 habs rw [sq_abs] at hsquare have hinner : (sqrt (d / (m * L)) + d / (m * L)) ^ 2 ≤ 2 * (d / (m * L) + (d / (m * L)) ^ 2) := by nlinarith [sq_nonneg (sqrt (d / (m * L)) - d / (m * L)), Real.sq_sqrt (by positivity : 0 ≤ (d : ℝ) / (m * L))] calc (∑ x, b x) ^ 2 ≤ C ^ 2 * (sqrt (d / (m * L)) + d / (m * L)) ^ 2 := by simpa [mul_pow] using hsquare _ ≤ C ^ 2 * (2 * (d / (m * L) + (d / (m * L)) ^ 2)) := mul_le_mul_of_nonneg_left hinner (sq_nonneg C) _ = _ := by field_simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sumCellBias_sq_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:10
theorem canonicalJacksonCellStatistic_memLp_two

If the overlap parameter satisfies its stated range restriction, and the Poisson intensity is positive, and the alphabet size satisfies its stated restriction, and the cell masses satisfy their stated restrictions, then the stated canonical jackson cell statistic mem lp two relation holds.

Formal statement
epsilon m :
hepsilon :
0 < epsilon
hm :
0 < m
d :
hd :
1 ≤ d
q :
Cell → ℝ
hq :
∀ j, 0 ≤ q j
MemLp (fun z : (Cell → ℕ) × (Cell → ℕ) => jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm) 2 (pilotEvaluationLaw m q)
Proof (Lean source)
lemma canonicalJacksonCellStatistic_memLp_two (epsilon m : ℝ) (hepsilon : 0 < epsilon) (hm : 0 < m) (d : ℕ) (hd : 1 ≤ d) (q : Cell → ℝ) (hq : ∀ j, 0 ≤ q j) : MemLp (fun z : (Cell → ℕ) × (Cell → ℕ) => jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm) 2 (pilotEvaluationLaw m q) := by let μp := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let μe := Measure.pi (fun j : Cell => poissonMeasure (m * q j).toNNReal) let score := normalizedAggregateScore (fun j (w : Cell → ℕ) => w j) universalH (logAlphabet d) m.toNNReal (fun j => (q j).toNNReal) let target := globalCellValue epsilon q let A := 2 * d ^ (1 / 4 : ℝ) * (1 + epsilon⁻¹) have hscoreLp : MemLp score 2 μp := by simpa [score, μp] using canonicalNormalizedAggregateScore_memLp_two m hm d hd q hq have hL0 : 0 ≤ logAlphabet d := by have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd unfold logAlphabet rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity), Real.log_exp] linarith [Real.log_nonneg hdR] have hdom : MemLp (fun z : (Cell → ℕ) × (Cell → ℕ) => A * score z.1) 2 (μp.prod μe) := (hscoreLp.const_mul A).comp_fst μe have herr : MemLp (fun z : (Cell → ℕ) × (Cell → ℕ) => jacksonCellStatistic canonicalJacksonTuning epsilon d m z.1 z.2 hm - target) 2 (μp.prod μe) := by apply hdom.mono (by fun_prop) filter_upwards with z rw [Real.norm_eq_abs, Real.norm_eq_abs, abs_mul] have hs0 : 0 ≤ score z.1 := by dsimp [score] unfold normalizedAggregateScore apply sum_nonneg intro j _hj unfold normalizedDeviation normalizedRadius universalH exact add_nonneg (abs_nonneg _) (mul_nonneg (by positivity) (add_nonneg (Real.sqrt_nonneg _) (by positivity))) have hA0 : 0 ≤ A := by dsimp [A]; positivity rw [abs_of_nonneg hs0, abs_of_nonneg hA0] simpa [A, score, target] using canonicalJacksonCellError_le_normalizedAggregateScore epsilon m hepsilon hm d hd z.1 z.2 q hq have hconst : MemLp (fun _ : (Cell → ℕ) × (Cell → ℕ) => target) 2 (μp.prod μe) := memLp_const _ rw [show pilotEvaluationLaw m q = μp.prod μe by rfl] convert herr.add hconst using 1 ext z simp only [Pi.add_apply] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalJacksonCellStatistic_memLp_two · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:65
theorem sumIndependentCellRisk_le Lemma sumIndependentCellRisk_le in the paper ↗

If the stated t condition holds, then the stated sum independent cell risk upper bound relation holds.

Formal statement
d :
μ :
Fin d → Measure ((Cell → ℕ) × (Cell → ℕ))
∀ x, IsProbabilityMeasure (μ x)
T :
Fin d → ((Cell → ℕ) × (Cell → ℕ)) → ℝ
target :
Fin d → ℝ
hT :
∀ x, MemLp (T x) 2 (μ x)
∫ z, ((∑ x, T x (z x)) - ∑ x, target x) ^ 2 ∂Measure.pi μ
≤ 2 * (∑ x, Var[T x; μ x]) + 2 * ((∑ x, ∫ z, T x z ∂(μ x)) - ∑ x, target x) ^ 2
Proof (Lean source)
lemma sumIndependentCellRisk_le {d : ℕ} (μ : Fin d → Measure ((Cell → ℕ) × (Cell → ℕ))) [hprob : ∀ x, IsProbabilityMeasure (μ x)] (T : Fin d → ((Cell → ℕ) × (Cell → ℕ)) → ℝ) (target : Fin d → ℝ) (hT : ∀ x, MemLp (T x) 2 (μ x)) : ∫ z, ((∑ x, T x (z x)) - ∑ x, target x) ^ 2 ∂Measure.pi μ ≤ 2 * (∑ x, Var[T x; μ x]) + 2 * ((∑ x, ∫ z, T x z ∂(μ x)) - ∑ x, target x) ^ 2 := by let S := fun z : Fin d → ((Cell → ℕ) × (Cell → ℕ)) => ∑ x, T x (z x) let ES := ∑ x, ∫ z, T x z ∂μ x have hS : MemLp S 2 (Measure.pi μ) := memLp_finsetSum _ fun x _ => (hT x).comp_measurePreserving (MeasureTheory.measurePreserving_eval μ x) have hpoint (z : Fin d → ((Cell → ℕ) × (Cell → ℕ))) : (S z - ∑ x, target x) ^ 2 ≤ 2 * (S z - ES) ^ 2 + 2 * (ES - ∑ x, target x) ^ 2 := by nlinarith [sq_nonneg ((S z - ES) - (ES - ∑ x, target x))] have hleft : Integrable (fun z => (S z - ∑ x, target x) ^ 2) (Measure.pi μ) := (hS.sub (memLp_const _)).integrable_sq have hright : Integrable (fun z => 2 * (S z - ES) ^ 2 + 2 * (ES - ∑ x, target x) ^ 2) (Measure.pi μ) := ((hS.sub (memLp_const _)).integrable_sq.const_mul 2).add (integrable_const _) calc (∫ z, (S z - ∑ x, target x) ^ 2 ∂Measure.pi μ) ≤ ∫ z, (2 * (S z - ES) ^ 2 + 2 * (ES - ∑ x, target x) ^ 2) ∂Measure.pi μ := integral_mono hleft hright hpoint _ = 2 * Var[S; Measure.pi μ] + 2 * (ES - ∑ x, target x) ^ 2 := by have hES : (∫ z, S z ∂Measure.pi μ) = ES := by dsimp [S, ES] have hfun : (fun z : Fin d → ((Cell → ℕ) × (Cell → ℕ)) => ∑ x, T x (z x)) = ∑ x, fun z : Fin d → ((Cell → ℕ) × (Cell → ℕ)) => T x (z x) := by funext z simp rw [hfun] calc (∫ z, (∑ x, fun z : Fin d → ((Cell → ℕ) × (Cell → ℕ)) => T x (z x)) z ∂Measure.pi μ) = ∑ x ∈ univ, ∫ z, T x (z x) ∂Measure.pi μ := by simpa only [Finset.sum_const_zero, Finset.sum_apply, Finset.sum_filter, Function.comp_apply] using (integral_finset_sum univ fun x _ => ((hT x).comp_measurePreserving (MeasureTheory.measurePreserving_eval μ x)).integrable one_le_two) _ = ∑ x, ∫ z, T x z ∂μ x := by apply Finset.sum_congr rfl intro x _ let hmp := MeasureTheory.measurePreserving_eval μ x have htmap : AEStronglyMeasurable (T x) (Measure.map (Function.eval x) (Measure.pi μ)) := by rw [hmp.map_eq] exact (hT x).aestronglyMeasurable simpa only [Function.comp_apply, hmp.map_eq] using (integral_map hmp.aemeasurable htmap).symm have hcInt : Integrable (fun z => 2 * (S z - ES) ^ 2) (Measure.pi μ) := (hS.sub (memLp_const _)).integrable_sq.const_mul 2 have hkInt : Integrable (fun _ : Fin d → ((Cell → ℕ) × (Cell → ℕ)) => 2 * (ES - ∑ x, target x) ^ 2) (Measure.pi μ) := integrable_const _ rw [integral_add hcInt hkInt, integral_const_mul, variance_eq_integral hS.aestronglyMeasurable.aemeasurable, hES, integral_const, probReal_univ, one_smul] _ = 2 * (∑ x, Var[T x; μ x]) + 2 * ((∑ x, ∫ z, T x z ∂(μ x)) - ∑ x, target x) ^ 2 := by have hvar : Var[S; Measure.pi μ] = ∑ x, Var[T x; μ x] := by have hfun : S = ∑ x, fun z => T x (z x) := by funext z simp [S] rw [hfun] exact ProbabilityTheory.variance_sum_pi hT rw [hvar]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sumIndependentCellRisk_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:120
theorem pilotEvaluationTableLaw_pairing

Regrouping the independent pilot and evaluation tables by cells gives a product of the cellwise pilot--evaluation laws. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
m :
P :
Measure.map (fun z : UncappedCountTable d => fun x => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P)
= Measure.pi (fun x : Fin d => pilotEvaluationLaw m (cellVector P x))
Proof (Lean source)
-- @node: pilotEvaluationTableLaw_pairing lemma pilotEvaluationTableLaw_pairing {d : ℕ} (m : ℝ) (P : DiscreteLaw d) : Measure.map (fun z : UncappedCountTable d => fun x => (z.1 x, z.2 x)) (pilotEvaluationTableLaw m P) = Measure.pi (fun x : Fin d => pilotEvaluationLaw m (cellVector P x)) := by let μ : Fin d → Measure (Cell → ℕ) := fun x => Measure.pi (fun j : Cell => poissonMeasure (m * cellVector P x j).toNNReal) have hmp := MeasureTheory.measurePreserving_arrowProdEquivProdArrow (Cell → ℕ) (Cell → ℕ) (Fin d) μ μ have hs := hmp.symm.map_eq have hfun : (fun z : UncappedCountTable d => fun x => (z.1 x, z.2 x)) = ⇑(MeasurableEquiv.arrowProdEquivProdArrow (Cell → ℕ) (Cell → ℕ) (Fin d)).symm := by funext z x rfl rw [hfun] simpa [pilotEvaluationTableLaw, pilotEvaluationLaw, cellVector, μ] using hs
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.pilotEvaluationTableLaw_pairing · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:191
theorem sqRisk_jacksonUncapped_eq_pairTable

The uncapped statistic's risk is the squared-error integral of the cellwise sum under the independent product of cell laws. This uses the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
epsilon theta :
hn :
0 < n
= ∫ z : Fin d → ((Cell → ℕ) × (Cell → ℕ)), (max 0 (min 1 (∑ x : Fin d, jacksonCellStatistic canonicalJacksonTuning epsilon d (n / 8) (z x).1 (z x).2 (by positivity))) - theta) ^ 2 ∂Measure.pi (fun x : Fin d => pilotEvaluationLaw (n / 8) (cellVector P x))
Proof (Lean source)
-- @node: sqRisk_jacksonUncapped_eq_pairTable lemma sqRisk_jacksonUncapped_eq_pairTable {n d : ℕ} (P : DiscreteLaw d) (epsilon theta : ℝ) (hn : 0 < n) : sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hn) theta = ∫ z : Fin d → ((Cell → ℕ) × (Cell → ℕ)), (max 0 (min 1 (∑ x : Fin d, jacksonCellStatistic canonicalJacksonTuning epsilon d (n / 8) (z x).1 (z x).2 (by positivity))) - theta) ^ 2 ∂Measure.pi (fun x : Fin d => pilotEvaluationLaw (n / 8) (cellVector P x)) := by let F := fun table : UncappedCountTable d => max 0 (min 1 (∑ x : Fin d, jacksonCellStatistic canonicalJacksonTuning epsilon d (n / 8) (table.1 x) (table.2 x) (by positivity))) let pair := fun table : UncappedCountTable d => fun x => (table.1 x, table.2 x) have hpair : Measurable pair := by fun_prop have hF : Measurable F := by fun_prop have hsq : AEStronglyMeasurable (fun r : ℝ => (r - theta) ^ 2) (Measure.map F (pilotEvaluationTableLaw (n / 8) P)) := by fun_prop unfold sqRisk calc (∫ s, (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hn s - theta) ^ 2 ∂Causalean.Mathlib.Probability.FiniteMarkedPoissonPartition.finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) = ∫ z, (F z.2 - theta) ^ 2 ∂uncappedMarkedCountLaw n P := by rw [uncappedMarkedCountLaw] symm rw [integral_map measurable_uncappedMarkedCountMap.aemeasurable] · rfl · fun_prop _ = ∫ table, (F table - theta) ^ 2 ∂pilotEvaluationTableLaw (n / 8) P := by rw [← uncappedMarkedCountLaw_table n P] symm rw [integral_map measurable_snd.aemeasurable] fun_prop _ = ∫ z : Fin d → ((Cell → ℕ) × (Cell → ℕ)), (max 0 (min 1 (∑ x : Fin d, jacksonCellStatistic canonicalJacksonTuning epsilon d (n / 8) (z x).1 (z x).2 (by positivity))) - theta) ^ 2 ∂Measure.pi (fun x : Fin d => pilotEvaluationLaw (n / 8) (cellVector P x)) := by rw [← pilotEvaluationTableLaw_pairing (n / 8) P] symm rw [integral_map hpair.aemeasurable] fun_prop
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sqRisk_jacksonUncapped_eq_pairTable · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:212
theorem sq_clip_unitInterval_le Lemma sq_clip_unitInterval_le in the paper ↗

Projection onto the unit interval does not increase squared loss from a target in that interval. This uses the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
u theta :
htheta :
theta ∈ Icc (0 : ℝ) 1
(max 0 (min 1 u) - theta) ^ 2 ≤ (u - theta) ^ 2
Proof (Lean source)
-- @node: sq_clip_unitInterval_le lemma sq_clip_unitInterval_le (u theta : ℝ) (htheta : theta ∈ Icc (0 : ℝ) 1) : (max 0 (min 1 u) - theta) ^ 2 ≤ (u - theta) ^ 2 := by by_cases hu0 : u < 0 · rw [min_eq_right (by linarith), max_eq_left (by linarith)] nlinarith [htheta.1] by_cases hu1 : 1 < u · rw [min_eq_left (by linarith), max_eq_right (by norm_num)] nlinarith [htheta.2] rw [min_eq_right (by linarith), max_eq_right (by linarith)]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sq_clip_unitInterval_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:261
theorem sqRisk_jacksonUncapped_le_cellRisk

Cellwise bias and variance bounds aggregate under Poisson splitting into the projected uncapped risk bound. This uses the sample size satisfies its stated restriction, and the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the stated c condition holds, and the target or contrast satisfies the stated unit-range restriction, and the target lies in the unit interval, and the stated cellwise bias bound holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
epsilon theta C :
hn :
0 < n
hd :
1 ≤ d
hepsilon :
0 < epsilon
hC :
0 ≤ C
htheta :
theta ∈ Icc (0 : ℝ) 1
htarget :
theta = ∑ x : Fin d, globalCellValue epsilon (cellVector P x)
hbias :
∀ x : Fin d,
|cellStatisticExpectation canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)
- globalCellValue epsilon (cellVector P x)|
≤ C * (sqrt (cellMass P x / ((n / 8) * logAlphabet d)) + 1 / ((n / 8) * logAlphabet d))
≤ 2 * (∑ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity))
+ 4 * C ^ 2 * (d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2))
Proof (Lean source)
-- @node: sqRisk_jacksonUncapped_le_cellRisk lemma sqRisk_jacksonUncapped_le_cellRisk {n d : ℕ} (P : DiscreteLaw d) (epsilon theta C : ℝ) (hn : 0 < n) (hd : 1 ≤ d) (hepsilon : 0 < epsilon) (hC : 0 ≤ C) (htheta : theta ∈ Icc (0 : ℝ) 1) (htarget : theta = ∑ x : Fin d, globalCellValue epsilon (cellVector P x)) (hbias : ∀ x : Fin d, |cellStatisticExpectation canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity) - globalCellValue epsilon (cellVector P x)| ≤ C * (sqrt (cellMass P x / ((n / 8) * logAlphabet d)) + 1 / ((n / 8) * logAlphabet d))) : sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hn) theta ≤ 2 * (∑ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)) + 4 * C ^ 2 * (d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2)) := by let μ := fun x : Fin d => pilotEvaluationLaw (n / 8) (cellVector P x) let T := fun x : Fin d => fun z : (Cell → ℕ) × (Cell → ℕ) => jacksonCellStatistic canonicalJacksonTuning epsilon d (n / 8) z.1 z.2 (by positivity) let target := fun x : Fin d => globalCellValue epsilon (cellVector P x) letI : ∀ x, IsProbabilityMeasure (μ x) := fun x => by dsimp [μ, pilotEvaluationLaw] infer_instance have hq (x : Fin d) (j : Cell) : 0 ≤ cellVector P x j := ENNReal.toReal_nonneg have hT : ∀ x, MemLp (T x) 2 (μ x) := fun x => by simpa [T, μ] using canonicalJacksonCellStatistic_memLp_two epsilon (n / 8) hepsilon (by positivity) d hd (cellVector P x) (hq x) have hsumMass : ∑ x : Fin d, cellMass P x = 1 := by calc _ = ∑ z : Obs d, (P.pmf z).toReal := by simp [cellMass, jointMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm have hmass0 (x : Fin d) : 0 ≤ cellMass P x := by unfold cellMass exact sum_nonneg fun _ _ => sum_nonneg fun _ _ => ENNReal.toReal_nonneg rw [sqRisk_jacksonUncapped_eq_pairTable P epsilon theta hn] calc (∫ z, (max 0 (min 1 (∑ x, T x (z x))) - theta) ^ 2 ∂Measure.pi μ) ≤ ∫ z, ((∑ x, T x (z x)) - ∑ x, target x) ^ 2 ∂Measure.pi μ := by have hTsum : MemLp (fun z => ∑ x, T x (z x)) 2 (Measure.pi μ) := memLp_finsetSum _ fun x _ => (hT x).comp_measurePreserving (MeasureTheory.measurePreserving_eval μ x) have hright : Integrable (fun z => ((∑ x, T x (z x)) - ∑ x, target x) ^ 2) (Measure.pi μ) := (hTsum.sub (memLp_const (∑ x, target x))).integrable_sq have hleft : Integrable (fun z => (max 0 (min 1 (∑ x, T x (z x))) - theta) ^ 2) (Measure.pi μ) := by apply hright.mono' · exact Measurable.of_discrete.aestronglyMeasurable · filter_upwards with z rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _), ← htarget] exact sq_clip_unitInterval_le _ theta htheta apply integral_mono hleft hright intro z rw [← htarget] exact sq_clip_unitInterval_le _ theta htheta _ ≤ 2 * (∑ x, Var[T x; μ x]) + 2 * ((∑ x, ∫ z, T x z ∂μ x) - ∑ x, target x) ^ 2 := sumIndependentCellRisk_le μ T target hT _ ≤ 2 * (∑ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)) + 4 * C ^ 2 * (d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2)) := by have hlog : 0 < logAlphabet d := by unfold logAlphabet apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd calc 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) _ = exp 1 * 1 := by ring _ ≤ exp 1 * d := mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1) have hb := sumCellBias_sq_le hd hC (by positivity) hlog hmass0 hsumMass hbias have hb' : ((∑ x, ∫ z, T x z ∂μ x) - ∑ x, target x) ^ 2 ≤ 2 * C ^ 2 * (d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2)) := by simpa [T, μ, target, cellStatisticExpectation] using hb have hvar : (∑ x, Var[T x; μ x]) = ∑ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity) := by apply Finset.sum_congr rfl intro x _ unfold cellStatisticVariance cellStatisticExpectation rw [variance_eq_integral (hT x).aestronglyMeasurable.aemeasurable] rw [hvar] nlinarith [hb']
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sqRisk_jacksonUncapped_le_cellRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:274
theorem canonicalVarianceLogAbsorption

The two logarithmic variance factors are uniformly absorbed by the fractional alphabet power left by the factorial coefficient envelope. This uses the alphabet size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
hd :
1 ≤ d
conclusion 1
logAlphabet d ^ 2 * d ^ (-15 / 16 : ℝ) ≤ 225
conclusion 2
logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ) ≤ 50625
Proof (Lean source)
-- @node: canonicalVarianceLogAbsorption lemma canonicalVarianceLogAbsorption (d : ℕ) (hd : 1 ≤ d) : logAlphabet d ^ 2 * d ^ (-15 / 16 : ℝ) ≤ 225 ∧ logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ) ≤ 50625 := by have hdR : (1 : ℝ) ≤ d := by exact_mod_cast hd have hd0 : (0 : ℝ) ≤ d := by positivity have hbase := (canonicalLogSquaredPowerBounds d hd).1 have hp12 : (d : ℝ) ^ (-12 / 16 : ℝ) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hdR (by norm_num) have hp9 : (d : ℝ) ^ (-9 / 16 : ℝ) ≤ 1 := Real.rpow_le_one_of_one_le_of_nonpos hdR (by norm_num) have hA0 : 0 ≤ logAlphabet d ^ 2 * d ^ (-3 / 16 : ℝ) := by positivity constructor · calc logAlphabet d ^ 2 * d ^ (-15 / 16 : ℝ) = (logAlphabet d ^ 2 * d ^ (-3 / 16 : ℝ)) * d ^ (-12 / 16 : ℝ) := by rw [show (-15 / 16 : ℝ) = -3 / 16 + -12 / 16 by norm_num, Real.rpow_add (by positivity)] ring _ ≤ 225 * 1 := mul_le_mul hbase hp12 (by positivity) (by norm_num) _ = 225 := by ring · calc logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ) = (logAlphabet d ^ 2 * d ^ (-3 / 16 : ℝ)) ^ 2 * d ^ (-9 / 16 : ℝ) := by rw [mul_pow, ← Real.rpow_mul_natCast hd0, show (-15 / 16 : ℝ) = (-3 / 16) * 2 + -9 / 16 by norm_num, Real.rpow_add (by positivity)] ring _ ≤ 225 ^ 2 * 1 := by exact mul_le_mul (pow_le_pow_left₀ hA0 hbase 2) hp9 (by positivity) (by positivity) _ = 50625 := by norm_num
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.canonicalVarianceLogAbsorption · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:370
theorem sqRisk_jacksonUncapped_le_rate

In the nontrivial Jackson regime, the summed cell bounds yield the target d /(n log(ed)) risk rate. This uses the sample size satisfies its stated restriction, and the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the stated c condition holds, and the target or contrast satisfies the stated unit-range restriction, and the target lies in the unit interval, and the stated scale inequality holds, and the stated cellwise bias bound holds, and the stated cellwise variance bound holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
epsilon theta C :
hn :
0 < n
hd :
2 ≤ d
hepsilon :
0 < epsilon
hC :
0 < C
htheta :
theta ∈ Icc (0 : ℝ) 1
htarget :
theta = ∑ x : Fin d, globalCellValue epsilon (cellVector P x)
hscale :
d / logAlphabet d ≤ (n : ℝ)
hbias :
∀ x : Fin d,
|cellStatisticExpectation canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)
- globalCellValue epsilon (cellVector P x)|
≤ C * (sqrt (cellMass P x / ((n / 8) * logAlphabet d)) + 1 / ((n / 8) * logAlphabet d))
hvar :
∀ x : Fin d,
cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)
≤ C * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / (n / 8) + logAlphabet d ^ 2 / (n / 8) ^ 2)
≤ (10000000 * (1 + C + C ^ 2)) * (d / (n * logAlphabet d))
Proof (Lean source)
-- @node: sqRisk_jacksonUncapped_le_rate lemma sqRisk_jacksonUncapped_le_rate {n d : ℕ} (P : DiscreteLaw d) (epsilon theta C : ℝ) (hn : 0 < n) (hd : 2 ≤ d) (hepsilon : 0 < epsilon) (hC : 0 < C) (htheta : theta ∈ Icc (0 : ℝ) 1) (htarget : theta = ∑ x : Fin d, globalCellValue epsilon (cellVector P x)) (hscale : d / logAlphabet d ≤ (n : ℝ)) (hbias : ∀ x : Fin d, |cellStatisticExpectation canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity) - globalCellValue epsilon (cellVector P x)| ≤ C * (sqrt (cellMass P x / ((n / 8) * logAlphabet d)) + 1 / ((n / 8) * logAlphabet d))) (hvar : ∀ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity) ≤ C * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / (n / 8) + logAlphabet d ^ 2 / (n / 8) ^ 2)) : sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hn) theta ≤ (10000000 * (1 + C + C ^ 2)) * (d / (n * logAlphabet d)) := by have hraw := sqRisk_jacksonUncapped_le_cellRisk P epsilon theta C hn (le_trans (by omega : 1 ≤ 2) hd) hepsilon (le_of_lt hC) htheta htarget hbias have hsumMass : ∑ x : Fin d, cellMass P x = 1 := by calc _ = ∑ z : Obs d, (P.pmf z).toReal := by simp [cellMass, jointMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm have hvsum : (∑ x : Fin d, cellStatisticVariance canonicalJacksonTuning epsilon d (n / 8) (cellVector P x) (by positivity)) ≤ C * d ^ (1 / 16 : ℝ) * (logAlphabet d / (n / 8) + d * logAlphabet d ^ 2 / (n / 8) ^ 2) := by calc _ ≤ ∑ x : Fin d, C * d ^ (1 / 16 : ℝ) * (cellMass P x * logAlphabet d / (n / 8) + logAlphabet d ^ 2 / (n / 8) ^ 2) := Finset.sum_le_sum fun x _ => hvar x _ = _ := by rw [← Finset.mul_sum] congr 1 rw [Finset.sum_add_distrib] have hf : (∑ x : Fin d, cellMass P x * logAlphabet d / (n / 8)) = (∑ x : Fin d, cellMass P x) * logAlphabet d / (n / 8) := by calc _ = ∑ x : Fin d, cellMass P x * (logAlphabet d / (n / 8)) := by apply Finset.sum_congr rfl intro x hx ring _ = (∑ x : Fin d, cellMass P x) * (logAlphabet d / (n / 8)) := by rw [← Finset.sum_mul] _ = _ := by ring rw [hf, hsumMass] simp ring have hL : 0 < logAlphabet d := by unfold logAlphabet apply Real.log_pos have hdR : (1 : ℝ) ≤ d := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) calc 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) _ = exp 1 * 1 := by ring _ ≤ exp 1 * d := mul_le_mul_of_nonneg_left hdR (Real.exp_nonneg 1) have hnR : 0 < (n : ℝ) := by exact_mod_cast hn let r : ℝ := d / (n * logAlphabet d) have hr0 : 0 ≤ r := by dsimp [r]; positivity have hr1 : r ≤ 1 := by dsimp [r] rw [div_le_one (mul_pos hnR hL)] rw [div_le_iff₀ hL] at hscale exact_mod_cast hscale have hpow := canonicalVarianceLogAbsorption d (le_trans (by omega : 1 ≤ 2) hd) have hbiasAbsorb : d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2) ≤ 72 * r := by dsimp [r] have hrSq : (d / (n * logAlphabet d)) ^ 2 ≤ d / (n * logAlphabet d) := by nlinarith [hr0, hr1] norm_num at * field_simp [ne_of_gt hnR, ne_of_gt hL] at hrSq ⊢ nlinarith have hvarAbsorb : d ^ (1 / 16 : ℝ) * (logAlphabet d / (n / 8) + d * logAlphabet d ^ 2 / (n / 8) ^ 2) ≤ 3300000 * r := by have hfirst : d ^ (1 / 16 : ℝ) * (logAlphabet d / (n / 8)) ≤ 1800 * r := by dsimp [r] norm_num field_simp [ne_of_gt hnR, ne_of_gt hL] have hdpos : (0 : ℝ) < d := by positivity have hid : d ^ (1 / 16 : ℝ) * logAlphabet d ^ 2 = logAlphabet d ^ 2 * d ^ (-15 / 16 : ℝ) * d := by rw [show (1 / 16 : ℝ) = -15 / 16 + 1 by norm_num, Real.rpow_add hdpos, Real.rpow_one] ring rw [hid] nlinarith [hpow.1] have hsecond : d ^ (1 / 16 : ℝ) * (d * logAlphabet d ^ 2 / (n / 8) ^ 2) ≤ 3240000 * r := by dsimp [r] norm_num field_simp [ne_of_gt hnR, ne_of_gt hL] have hdpos : (0 : ℝ) < d := by positivity have hid : d ^ (1 / 16 : ℝ) * d * logAlphabet d ^ 3 = (logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ)) * (d * d / logAlphabet d) := by rw [show (1 / 16 : ℝ) = -15 / 16 + 1 by norm_num, Real.rpow_add hdpos, Real.rpow_one] field_simp [ne_of_gt hL] have hscaleMul := mul_le_mul_of_nonneg_left hscale (show 0 ≤ logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ) by positivity) have hratio : (logAlphabet d ^ 4 * d ^ (-15 / 16 : ℝ)) * (d / logAlphabet d) = d ^ (1 / 16 : ℝ) * logAlphabet d ^ 3 := by rw [show (1 / 16 : ℝ) = -15 / 16 + 1 by norm_num, Real.rpow_add hdpos, Real.rpow_one] field_simp [ne_of_gt hL] rw [hratio] at hscaleMul have hAn := mul_le_mul_of_nonneg_right hpow.2 (le_of_lt hnR) nlinarith nlinarith calc _ ≤ 2 * (C * d ^ (1 / 16 : ℝ) * (logAlphabet d / (n / 8) + d * logAlphabet d ^ 2 / (n / 8) ^ 2)) + 4 * C ^ 2 * (d / ((n / 8) * logAlphabet d) + d ^ 2 / ((n / 8) ^ 2 * logAlphabet d ^ 2)) := by exact hraw.trans (add_le_add (mul_le_mul_of_nonneg_left hvsum (by norm_num)) (le_refl _)) _ ≤ 2 * C * (3300000 * r) + 4 * C ^ 2 * (72 * r) := by have hv := mul_le_mul_of_nonneg_left hvarAbsorb (show 0 ≤ 2 * C by positivity) have hb := mul_le_mul_of_nonneg_left hbiasAbsorb (show 0 ≤ 4 * C ^ 2 by positivity) nlinarith _ ≤ (10000000 * (1 + C + C ^ 2)) * r := by have := sq_nonneg C nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sqRisk_jacksonUncapped_le_rate · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskAggregation.lean:406
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.Helpers.UpperRiskCoupling 19 declarations The marked finite-Poisson statistic and its capped fixed-sample Rao--Blackwell coupling.

The marked finite-Poisson statistic and its capped fixed-sample Rao--Blackwell coupling.

def jacksonUncappedStatistic

The projected Jackson cell sum on an uncapped marked finite sample.

Definition (Lean source)
d :
tuning :
epsilon :
n :
hn :
0 < n
s :
FiniteSample (Obs d × Bool)
jacksonUncappedStatistic tuning epsilon n hn s :
m :
n / 8 (: ℝ)
hm :
by positivity (: 0 < m)
table :
max 0 (min 1 (∑ x : Fin d, jacksonCellStatistic tuning epsilon d m (table.1 x) (table.2 x) hm))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonUncappedStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:13
theorem measurable_jacksonUncappedStatistic

The uncapped projected statistic is measurable. This uses the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
tuning :
epsilon :
n :
hn :
0 < n
Measurable (jacksonUncappedStatistic (d := d) tuning epsilon n hn)
Proof (Lean source)
@[fun_prop] lemma measurable_jacksonUncappedStatistic {d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (n : ℕ) (hn : 0 < n) : Measurable (jacksonUncappedStatistic (d := d) tuning epsilon n hn) := by apply Measurable.max measurable_const apply Measurable.min measurable_const apply measurable_sum intro x _hx exact (Measurable.of_discrete : Measurable (fun table : UncappedCountTable d => jacksonCellStatistic tuning epsilon d (n / 8) (table.1 x) (table.2 x) (by positivity))).comp measurable_uncappedMarkedCountMap.snd
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.measurable_jacksonUncappedStatistic · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:23
theorem jacksonUncappedStatistic_mem_unitInterval

Projection places the uncapped statistic in the unit interval. This uses the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
tuning :
epsilon :
n :
hn :
0 < n
s :
FiniteSample (Obs d × Bool)
jacksonUncappedStatistic tuning epsilon n hn s ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma jacksonUncappedStatistic_mem_unitInterval {d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (n : ℕ) (hn : 0 < n) (s : FiniteSample (Obs d × Bool)) : jacksonUncappedStatistic tuning epsilon n hn s ∈ Icc (0 : ℝ) 1 := by unfold jacksonUncappedStatistic exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonUncappedStatistic_mem_unitInterval · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:37
theorem sum_fin_prefix_indicator Lemma sum_fin_prefix_indicator in the paper ↗

Extending a prefix indicator by zero preserves its finite sum. This uses the stated m condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n M :
hM :
M ≤ n
p :
Fin n → Prop
conclusion 1
(∑ i : Fin M, if p (castLE hM i) then 1 else 0) = ∑ i : Fin n, if i.1 < M
conclusion 2
p i then 1 else 0
Proof (Lean source)
lemma sum_fin_prefix_indicator {n M : ℕ} (hM : M ≤ n) (p : Fin n → Prop) [DecidablePred p] : (∑ i : Fin M, if p (castLE hM i) then 1 else 0) = ∑ i : Fin n, if i.1 < M ∧ p i then 1 else 0 := by rw [← Finset.card_filter, ← Finset.card_filter] apply Finset.card_bij (fun i _hi => castLE hM i) · intro i hi simp only [mem_filter, Finset.mem_univ, true_and] at hi ⊢ exact ⟨i.2, hi⟩ · intro i _hi j _hj hij exact Fin.castLE_injective hM hij · intro j hj simp only [mem_filter, Finset.mem_univ, true_and] at hj refine ⟨⟨j.1, hj.1⟩, ?_, ?_⟩ · simpa using hj.2 · apply Fin.ext rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sum_fin_prefix_indicator · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:45
theorem uncappedMarkedCountMap_prefix_table Lemma uncappedMarkedCountMap_prefix_table in the paper ↗

The uncapped count table of a fixed-array prefix is exactly the table used by the randomized estimator. This uses the stated m condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
sample :
Fin n → Obs d
marks :
Fin n → Bool
M :
hM :
M ≤ n
(uncappedMarkedCountMap (prefixOfLE (fun i => (sample i, marks i)) M hM)).2
= ((fun x j => markedCellCount sample M marks false x j), fun x j => markedCellCount sample M marks true x j)
Proof (Lean source)
lemma uncappedMarkedCountMap_prefix_table {n d : ℕ} (sample : Fin n → Obs d) (marks : Fin n → Bool) (M : ℕ) (hM : M ≤ n) : (uncappedMarkedCountMap (prefixOfLE (fun i => (sample i, marks i)) M hM)).2 = ((fun x j => markedCellCount sample M marks false x j), fun x j => markedCellCount sample M marks true x j) := by classical apply Prod.ext <;> funext x j · let p : Fin n → Prop := fun i => marks i = false ∧ (sample i).1 = x ∧ (sample i).2.1 = finTwoEquiv j.1 ∧ (sample i).2.2 = finTwoEquiv j.2 change (∑ i : Fin M, if p (castLE hM i) then 1 else 0) = ∑ i : Fin n, if i.1 < M ∧ p i then 1 else 0 exact sum_fin_prefix_indicator hM p · let p : Fin n → Prop := fun i => marks i = true ∧ (sample i).1 = x ∧ (sample i).2.1 = finTwoEquiv j.1 ∧ (sample i).2.2 = finTwoEquiv j.2 change (∑ i : Fin M, if p (castLE hM i) then 1 else 0) = ∑ i : Fin n, if i.1 < M ∧ p i then 1 else 0 exact sum_fin_prefix_indicator hM p
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uncappedMarkedCountMap_prefix_table · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:65
theorem jacksonUncappedStatistic_prefix

On nonoverflow, the generic prefix statistic is the paper's randomized statistic. This uses the sample size satisfies its stated restriction, and the stated m condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
tuning :
epsilon :
hn :
0 < n
sample :
Fin n → Obs d
marks :
Fin n → Bool
M :
hM :
M ≤ n
jacksonUncappedStatistic tuning epsilon n hn (prefixOfLE (fun i => (sample i, marks i)) M hM)
= jacksonRandomizedStatistic tuning epsilon sample M marks
Proof (Lean source)
lemma jacksonUncappedStatistic_prefix {n d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (hn : 0 < n) (sample : Fin n → Obs d) (marks : Fin n → Bool) (M : ℕ) (hM : M ≤ n) : jacksonUncappedStatistic tuning epsilon n hn (prefixOfLE (fun i => (sample i, marks i)) M hM) = jacksonRandomizedStatistic tuning epsilon sample M marks := by rw [jacksonRandomizedStatistic, dif_pos hn, if_pos hM] unfold jacksonUncappedStatistic rw [uncappedMarkedCountMap_prefix_table sample marks M hM]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonUncappedStatistic_prefix · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:87
theorem raoBlackwell_jacksonUncappedStatistic_apply

The inner Poisson average in the estimator is the generic capped Rao--Blackwell statistic associated with the uncapped marked statistic. This uses the sample size satisfies its stated restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
tuning :
epsilon :
hn :
0 < n
sample :
Fin n → Obs d
marks :
Fin n → Bool
raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0 (fun i => (sample i, marks i))
= ∫ M : ℕ, jacksonRandomizedStatistic tuning epsilon sample M marks ∂ProbabilityTheory.poissonMeasure (toNNReal (n / 4))
Proof (Lean source)
lemma raoBlackwell_jacksonUncappedStatistic_apply {n d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (hn : 0 < n) (sample : Fin n → Obs d) (marks : Fin n → Bool) : raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0 (fun i => (sample i, marks i)) = ∫ M : ℕ, jacksonRandomizedStatistic tuning epsilon sample M marks ∂ProbabilityTheory.poissonMeasure (toNNReal (n / 4)) := by rw [raoBlackwellStatistic_eq_integral _ _ (measurable_jacksonUncappedStatistic tuning epsilon n hn)] apply integral_congr_ae filter_upwards with M unfold cappedStatistic split_ifs with hM · exact jacksonUncappedStatistic_prefix tuning epsilon hn sample marks M hM · simp [jacksonRandomizedStatistic, hn, hM]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.raoBlackwell_jacksonUncappedStatistic_apply · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:99
theorem jacksonRandomizedStatistic_mem_unitInterval

The capped randomized statistic always belongs to the unit interval. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
tuning :
epsilon :
sample :
Fin n → Obs d
M :
marks :
Fin n → Bool
jacksonRandomizedStatistic tuning epsilon sample M marks ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma jacksonRandomizedStatistic_mem_unitInterval {n d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (sample : Fin n → Obs d) (M : ℕ) (marks : Fin n → Bool) : jacksonRandomizedStatistic tuning epsilon sample M marks ∈ Icc (0 : ℝ) 1 := by unfold jacksonRandomizedStatistic split_ifs · exact ⟨le_max_left _ _, max_le (by norm_num) (min_le_left _ _)⟩ all_goals simp
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonRandomizedStatistic_mem_unitInterval · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:119
theorem jacksonFactorialEstimator_eq_marked_raoBlackwell

In its Jackson regime, the explicit estimator is the fair-mark average of the generic capped Rao--Blackwell statistic. This uses the sample size satisfies its stated restriction, and the alphabet exceeds the bounded-alphabet cutoff, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
tuning :
epsilon :
hn :
0 < n
hcutoff :
¬ d < tuning.boundedAlphabetCutoff
hscale :
¬ (n : ℝ) < d / logAlphabet d
sample :
Fin n → Obs d
jacksonFactorialEstimator tuning epsilon sample
= ∫ marks : Fin n → Bool, raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0 (fun i => (sample i, marks i)) ∂fairMarkLaw n
Proof (Lean source)
lemma jacksonFactorialEstimator_eq_marked_raoBlackwell {n d : ℕ} (tuning : JacksonTuning) (epsilon : ℝ) (hn : 0 < n) (hcutoff : ¬ d < tuning.boundedAlphabetCutoff) (hscale : ¬ (n : ℝ) < d / logAlphabet d) (sample : Fin n → Obs d) : jacksonFactorialEstimator tuning epsilon sample = ∫ marks : Fin n → Bool, raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0 (fun i => (sample i, marks i)) ∂fairMarkLaw n := by rw [jacksonFactorialEstimator, if_neg hcutoff, if_neg hscale] letI : IsProbabilityMeasure (fairMarkLaw n) := by unfold fairMarkLaw infer_instance have hInt : Integrable (fun z : ℕ × (Fin n → Bool) => jacksonRandomizedStatistic tuning epsilon sample z.1 z.2) ((poissonMeasure (toNNReal (n / 4))).prod (fairMarkLaw n)) := (integrable_const (1 : ℝ)).mono' (Measurable.of_discrete.aestronglyMeasurable) (by filter_upwards with z rw [Real.norm_eq_abs, abs_of_nonneg (jacksonRandomizedStatistic_mem_unitInterval tuning epsilon sample z.1 z.2).1] exact (jacksonRandomizedStatistic_mem_unitInterval tuning epsilon sample z.1 z.2).2) rw [integral_integral_swap hInt] apply integral_congr_ae filter_upwards with marks rw [raoBlackwell_jacksonUncappedStatistic_apply tuning epsilon hn sample marks]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonFactorialEstimator_eq_marked_raoBlackwell · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:130
theorem sqRisk_marked_raoBlackwell_jackson_le

The fixed marked-sample risk is bounded by the uncapped finite-Poisson risk plus the exact overflow probability. This uses the sample size satisfies its stated restriction, and the target or contrast satisfies the stated unit-range restriction. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
tuning :
epsilon theta :
hn :
0 < n
htheta :
theta ∈ Icc (0 : ℝ) 1
sqRisk (Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)) (raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0) theta
sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic tuning epsilon n hn) theta
+ (poissonMeasure (toNNReal (n / 4))).real (Ioi n)
Proof (Lean source)
lemma sqRisk_marked_raoBlackwell_jackson_le {n d : ℕ} (P : DiscreteLaw d) (tuning : JacksonTuning) (epsilon theta : ℝ) (hn : 0 < n) (htheta : theta ∈ Icc (0 : ℝ) 1) : sqRisk (Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)) (raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0) theta ≤ sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic tuning epsilon n hn) theta + (poissonMeasure (toNNReal (n / 4))).real (Ioi n) := by exact sqRisk_raoBlackwellStatistic_unitInterval_le ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4)) n (measurable_jacksonUncappedStatistic tuning epsilon n hn) (jacksonUncappedStatistic_mem_unitInterval tuning epsilon n hn) htheta (by simp)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sqRisk_marked_raoBlackwell_jackson_le · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:163
theorem fairMarkLaw_eq_pi_uncappedFairMarkLaw Lemma fairMarkLaw_eq_pi_uncappedFairMarkLaw in the paper ↗

The explicit uniform law on all mark arrays is the independent product of the one-coordinate fair mark laws. The displayed identity or bound is the asserted conclusion.

Formal statement
n :
fairMarkLaw n = Measure.pi (fun _ : Fin n => uncappedFairMarkLaw)
Proof (Lean source)
lemma fairMarkLaw_eq_pi_uncappedFairMarkLaw (n : ℕ) : fairMarkLaw n = Measure.pi (fun _ : Fin n => uncappedFairMarkLaw) := by apply Measure.ext_of_singleton intro marks simp [fairMarkLaw, uncappedFairMarkLaw] exact ENNReal.inv_pow
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairMarkLaw_eq_pi_uncappedFairMarkLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:185

Adjoin one independent fair Boolean mark to an observation.

Definition (Lean source)
d :
fairObservationMarkKernel :
Kernel (Obs d) (Obs d × Bool)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairObservationMarkKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:195
instance isMarkovKernel

The fair observation-marking kernel preserves total probability one.

Definition (Lean source)
instance fairObservationMarkKernel.isMarkovKernel {d : ℕ} : IsMarkovKernel (fairObservationMarkKernel (d := d)) := by unfold fairObservationMarkKernel exact instIsMarkovKernelMechanismKernel _ measurable_id
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairObservationMarkKernel.isMarkovKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:201
theorem fairObservationMarkKernel_apply

Pointwise, adjoining a fair mark is the pushforward of the fair law by pairing. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
o :
Obs d
fairObservationMarkKernel o = Measure.map (fun b => (o, b)) uncappedFairMarkLaw
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairObservationMarkKernel_apply · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:208
theorem finProductFairObservationMarkKernel_apply

Conditional on an observation array, the coordinatewise marking kernel is the pushforward of the explicit fair array law. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
sample :
Fin n → Obs d
= Measure.map (fun marks : Fin n → Bool => fun i => (sample i, marks i)) (fairMarkLaw n)
Proof (Lean source)
lemma finProductFairObservationMarkKernel_apply {n d : ℕ} (sample : Fin n → Obs d) : finProductKernel n (fairObservationMarkKernel (d := d)) sample = Measure.map (fun marks : Fin n → Bool => fun i => (sample i, marks i)) (fairMarkLaw n) := by rw [finProductKernel_apply] simp_rw [fairObservationMarkKernel_apply] calc Measure.pi (fun i : Fin n => Measure.map (fun b => (sample i, b)) uncappedFairMarkLaw) = Measure.map (fun marks : Fin n → Bool => fun i => (sample i, marks i)) (Measure.pi (fun _ : Fin n => uncappedFairMarkLaw)) := by symm exact Measure.pi_map_pi (fun _ => Measurable.of_discrete.aemeasurable) _ = _ := by rw [← fairMarkLaw_eq_pi_uncappedFairMarkLaw]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.finProductFairObservationMarkKernel_apply · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:217
theorem kernelMean_finProductFairObservationMarkKernel

Averaging a statistic through the coordinatewise marking kernel is exactly integration over the paper's fair mark array. This uses the stated t condition holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
T :
(Fin n → Obs d × Bool) → ℝ
hT :
sample :
Fin n → Obs d
= ∫ marks : Fin n → Bool, T (fun i => (sample i, marks i)) ∂fairMarkLaw n
Proof (Lean source)
lemma kernelMean_finProductFairObservationMarkKernel {n d : ℕ} (T : (Fin n → Obs d × Bool) → ℝ) (hT : Measurable T) (sample : Fin n → Obs d) : kernelMean (finProductKernel n (fairObservationMarkKernel (d := d))) T sample = ∫ marks : Fin n → Bool, T (fun i => (sample i, marks i)) ∂fairMarkLaw n := by unfold kernelMean rw [finProductFairObservationMarkKernel_apply sample] exact integral_map Measurable.of_discrete.aemeasurable hT.aestronglyMeasurable
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.kernelMean_finProductFairObservationMarkKernel · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:236
theorem fairObservationMarkKernel_comp_obsLaw

Marking a single observation produces its product with the fair mark law. The displayed identity or bound is the asserted conclusion.

Formal statement
d :
P :
fairObservationMarkKernel (d := d) ∘ₘ obsLaw P = (obsLaw P).prod uncappedFairMarkLaw
Proof (Lean source)
lemma fairObservationMarkKernel_comp_obsLaw {d : ℕ} (P : DiscreteLaw d) : fairObservationMarkKernel (d := d) ∘ₘ obsLaw P = (obsLaw P).prod uncappedFairMarkLaw := by have hgraph : Measure.map (fun p : Obs d × Bool => (p.1, p)) ((obsLaw P).prod uncappedFairMarkLaw) = (obsLaw P).compProd (fairObservationMarkKernel (d := d)) := by simpa [fairObservationMarkKernel] using (map_graph_prod_eq_compProd (obsLaw P) uncappedFairMarkLaw (show Measurable (id : Obs d × Bool → Obs d × Bool) from measurable_id)) have hsnd := congrArg (Measure.map snd) hgraph rw [Measure.map_map measurable_snd (show Measurable (fun p : Obs d × Bool => (p.1, p)) from measurable_fst.prodMk measurable_id)] at hsnd change _ = ((obsLaw P) ⊗ₘ fairObservationMarkKernel (d := d)).snd at hsnd rw [Measure.snd_compProd] at hsnd simpa [Function.comp_def] using hsnd.symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.fairObservationMarkKernel_comp_obsLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:249
theorem finProductFairObservationMarkKernel_comp_productLaw

Coordinatewise fair marking of an iid observation array gives the iid law of independently marked observations. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
finProductKernel n (fairObservationMarkKernel (d := d)) ∘ₘ productLaw P n
= Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)
Proof (Lean source)
lemma finProductFairObservationMarkKernel_comp_productLaw {n d : ℕ} (P : DiscreteLaw d) : finProductKernel n (fairObservationMarkKernel (d := d)) ∘ₘ productLaw P n = Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw) := by unfold productLaw rw [finProductKernel_comp_pi] congr 1 funext i exact fairObservationMarkKernel_comp_obsLaw P
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.finProductFairObservationMarkKernel_comp_productLaw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:270
theorem sqRisk_jacksonFactorialEstimator_le_marked

In the Jackson regime, outer Rao--Blackwellization over the fair marks cannot increase risk relative to the marked fixed-array statistic. This uses the sample size satisfies its stated restriction, and the alphabet exceeds the bounded-alphabet cutoff, and the stated scale inequality holds. The displayed identity or bound is the asserted conclusion.

Formal statement
n d :
P :
tuning :
epsilon theta :
hn :
0 < n
hcutoff :
¬ d < tuning.boundedAlphabetCutoff
hscale :
¬ (n : ℝ) < d / logAlphabet d
sqRisk (productLaw P n) (jacksonFactorialEstimator tuning epsilon) theta
sqRisk (Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)) (raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0) theta
Proof (Lean source)
lemma sqRisk_jacksonFactorialEstimator_le_marked {n d : ℕ} (P : DiscreteLaw d) (tuning : JacksonTuning) (epsilon theta : ℝ) (hn : 0 < n) (hcutoff : ¬ d < tuning.boundedAlphabetCutoff) (hscale : ¬ (n : ℝ) < d / logAlphabet d) : sqRisk (productLaw P n) (jacksonFactorialEstimator tuning epsilon) theta ≤ sqRisk (Measure.pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)) (raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0) theta := by let T : (Fin n → Obs d × Bool) → ℝ := raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic tuning epsilon n hn) 0 have hbaseBound : UniformlyBounded (fun z : (Fin n → Obs d × Bool) × ℕ => cappedStatistic (jacksonUncappedStatistic tuning epsilon n hn) 0 z.1 z.2) := by refine ⟨1, by norm_num, ?_⟩ intro z change |if h : z.2 ≤ n then jacksonUncappedStatistic tuning epsilon n hn (prefixOfLE z.1 z.2 h) else 0| ≤ 1 split_ifs with h · have hz := jacksonUncappedStatistic_mem_unitInterval tuning epsilon n hn (prefixOfLE z.1 z.2 h) rw [abs_of_nonneg hz.1] exact hz.2 · simp have hTmeas : Measurable T := by dsimp [T, raoBlackwellStatistic] exact measurable_kernelMean _ (measurable_cappedStatistic (measurable_jacksonUncappedStatistic tuning epsilon n hn) 0) have hTbound : UniformlyBounded T := by dsimp [T, raoBlackwellStatistic] exact Causalean.Stat.uniformlyBounded_kernelMean _ hbaseBound have hmean : kernelMean (finProductKernel n (fairObservationMarkKernel (d := d))) T = jacksonFactorialEstimator tuning epsilon := by funext sample rw [kernelMean_finProductFairObservationMarkKernel T hTmeas sample] exact (jacksonFactorialEstimator_eq_marked_raoBlackwell tuning epsilon hn hcutoff hscale sample).symm calc sqRisk (productLaw P n) (jacksonFactorialEstimator tuning epsilon) theta = sqRisk (productLaw P n) (kernelMean (finProductKernel n (fairObservationMarkKernel (d := d))) T) theta := by rw [hmean] _ ≤ sqRisk (finProductKernel n (fairObservationMarkKernel (d := d)) ∘ₘ productLaw P n) T theta := sqRisk_kernelMean_le_comp (productLaw P n) (finProductKernel n (fairObservationMarkKernel (d := d))) hTmeas hTbound theta _ = _ := by rw [finProductFairObservationMarkKernel_comp_productLaw]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sqRisk_jacksonFactorialEstimator_le_marked · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/Helpers/UpperRiskCoupling.lean:284
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.OpenQuestions 2 declarations Nonassertive carriers for the unresolved sharp-constant route and question.

Nonassertive carriers for the unresolved sharp-constant route and question.

def sharpConstantHandle Definition 18 in the paper ↗

For the specified overlap level, the sharp-constant handle is the three-step research program of local Poisson rescaling, sharp polynomial bias-variance optimization, and dual moment-matching.

Definition (Lean source)
epsilon :
sharpConstantHandle epsilon :
_root_.List _root_.String
["rescale the pilot-local four-cell rectangles by their Poisson noise geometry", "optimize the tensor-polynomial bias-variance functional for the globally Lipschitz cell extension at the fixed overlap constant", "dualize the approximation constraint into moment-matched observed laws in the overlap class for the optimal-regression target"]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sharpConstantHandle · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/OpenQuestions.lean:11
def sharpOverlapConstantQuestion Remark 1 in the paper ↗

For the specified overlap level, the sharp-overlap-constant question asks whether the normalized nonsaturated minimax risk converges to a positive finite limit and whether the sharp-constant program yields an attaining estimator.

Definition (Lean source)
epsilon :
sharpOverlapConstantQuestion epsilon :
_root_.String
"Along nonsaturated sequences d tending to infinity with d/(n log(ed)) tending to zero, does (n log(ed)/d) times the minimax risk converge to a finite positive limit, and is an estimator attaining it derivable through the sharp-constant handle? The matched frontier proves only positive finite liminf/limsup bounds; it asserts neither convergence, a cone-dependent optimal leading constant, nor an attaining estimator."
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.sharpOverlapConstantQuestion · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/OpenQuestions.lean:19
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TAllEstimatorLower 1 declarations Conditional minimax lower bound over all measurable estimators.

Conditional minimax lower bound over all measurable estimators.

theorem all_estimator_lower Theorem 2 in the paper ↗

If the product experiment has the stated independent-sampling law, and the Cai--Low moment-matching prior result is available, and the Jiao--Han--Weissman Poisson L1 lower bound is available, then there is a positive constant, depending only on overlap, for which every estimator has risk at least that constant times the minimum of one and d/(nlog(ed))d/(nlog(ed)).

Formal statement
h_iid :
∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ cepsilon : ℝ,
0 < cepsilon
conclusion 1
n d :
1 ≤ n
2 ≤ d
cepsilon * min 1 (d / (n * logAlphabet d)) ≤ minimaxRisk n d epsilon
Proof (Lean source)
theorem all_estimator_lower (h_iid : ∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)) (h_cai_low : CaiLowAbsoluteMomentPriors) (h_jhw : JhwPoissonL1Lower) : ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ cepsilon : ℝ, 0 < cepsilon ∧ ∀ n d : ℕ, 1 ≤ n → 2 ≤ d → cepsilon * min 1 (d / (n * logAlphabet d)) ≤ minimaxRisk n d epsilon := by obtain ⟨Ddense, hDdense, hdense⟩ := dense_moment_matching_lower h_iid h_cai_low obtain ⟨cJ, hcJ, hJ⟩ := jhw_fixedL1_lower_sub_expTail h_jhw (1 / 4) 2 (by norm_num) (by norm_num) obtain ⟨Dlog, hDlog⟩ := eventually_logAlphabet_le_half obtain ⟨Ntail, hNtail2, htail⟩ := pairedTail_cutoff cJ hcJ let D := max Ddense Dlog let M := max D Ntail intro epsilon hepsilon hepsilonHalf obtain ⟨cDense, hcDense, hDense⟩ := hdense epsilon hepsilon hepsilonHalf let c : ℝ := min cDense (min (cJ / 64) (1 / (100 * (M : ℝ)))) have hM2 : 2 ≤ M := le_trans hNtail2 (Nat.le_max_right _ _) have hc : 0 < c := by dsimp [c]; positivity refine ⟨c, hc, ?_⟩ intro n d hn hd have hnR : (0 : ℝ) < n := by exact_mod_cast hn have hdR : (0 : ℝ) < d := by positivity have hLd : 0 < logAlphabet d := logAlphabet_pos d (by omega) have hscale_nonneg : 0 ≤ (d : ℝ) / (n * logAlphabet d) := by positivity have hregular := regular_parametric_lower ⟨hepsilon, hepsilonHalf⟩ n d hn hd by_cases hnsmall : n < Ntail · have hnM : n ≤ M := le_trans (le_of_lt hnsmall) (Nat.le_max_right _ _) have hcM : c ≤ 1 / (100 * (M : ℝ)) := le_trans (min_le_right _ _) (min_le_right _ _) have htarget : c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ 1 / (100 * (n : ℝ)) := by have hmin : min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ 1 := min_le_left _ _ have hnM' : (n : ℝ) ≤ M := by exact_mod_cast hnM have hMpos : (0 : ℝ) < M := by positivity calc c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ c := by nlinarith [mul_le_mul_of_nonneg_left hmin hc.le] _ ≤ 1 / (100 * (M : ℝ)) := hcM _ ≤ 1 / (100 * (n : ℝ)) := by apply one_div_le_one_div_of_le <;> nlinarith exact htarget.trans hregular have hnlarge : Ntail ≤ n := Nat.le_of_not_gt hnsmall by_cases hdsmall : d < D · have hdM : d ≤ M := le_trans (le_of_lt hdsmall) (Nat.le_max_left _ _) have hcM : c ≤ 1 / (100 * (M : ℝ)) := le_trans (min_le_right _ _) (min_le_right _ _) have hdM' : (d : ℝ) ≤ M := by exact_mod_cast hdM have htarget : c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ 1 / (100 * (n : ℝ)) := by calc c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ c * ((d : ℝ) / (n * logAlphabet d)) := by gcongr exact min_le_right _ _ _ ≤ (1 / (100 * (M : ℝ))) * ((d : ℝ) / (n * logAlphabet d)) := by gcongr _ ≤ 1 / (100 * (n : ℝ)) := by have hLone := logAlphabet_one_le d (by omega) have hMpos : (0 : ℝ) < M := by positivity field_simp [ne_of_gt hnR, ne_of_gt hLd, ne_of_gt hMpos] nlinarith exact htarget.trans hregular have hdD : D ≤ d := Nat.le_of_not_gt hdsmall by_cases hdenseRegime : d ^ 2 < n · have hcert := hDense d n (le_trans (Nat.le_max_left _ _) hdD) hdenseRegime rcases hcert with ⟨_, _, _, _, _, _, _, _, _, _, _, _, _, _, hfinal⟩ have hcDense' : c ≤ cDense := min_le_left _ _ have hcmp : c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ cDense * d / (n * logAlphabet d) := by calc c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ c * ((d : ℝ) / (n * logAlphabet d)) := by gcongr; exact min_le_right _ _ _ ≤ cDense * d / (n * logAlphabet d) := by have := mul_le_mul_of_nonneg_right hcDense' hscale_nonneg simpa [mul_div_assoc] using this exact hcmp.trans hfinal have hn_dsq : n ≤ d ^ 2 := Nat.le_of_not_gt hdenseRegime have hlogHalf : logAlphabet d ≤ (d : ℝ) / 2 := hDlog d (le_trans (Nat.le_max_right _ _) hdD) let Ln := log (exp 1 * (n : ℝ)) have hLn : 0 < Ln := by dsimp [Ln] exact logAlphabet_pos n hn have hlogCompare : Ln ≤ 2 * logAlphabet d := by have hncast : (n : ℝ) ≤ (d : ℝ) ^ 2 := by exact_mod_cast hn_dsq have harg : exp 1 * (n : ℝ) ≤ exp 1 * (d : ℝ) ^ 2 := mul_le_mul_of_nonneg_left hncast (Real.exp_nonneg 1) have hmono := Real.strictMonoOn_log.monotoneOn (show 0 < exp 1 * (n : ℝ) by positivity) (show 0 < exp 1 * (d : ℝ) ^ 2 by positivity) harg dsimp [Ln] rw [Real.log_mul (Real.exp_ne_zero 1) (by positivity : (d : ℝ) ^ 2 ≠ 0), Real.log_exp, Real.log_pow] at hmono rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (by positivity : (d : ℝ) ≠ 0), Real.log_exp] have hlogd0 : 0 ≤ log (d : ℝ) := Real.log_nonneg (by exact_mod_cast (by omega : 1 ≤ d)) calc log (exp 1 * (n : ℝ)) ≤ 1 + 2 * log (d : ℝ) := by simpa using hmono _ ≤ 2 * (1 + log (d : ℝ)) := by linarith by_cases hsaturated : (n : ℝ) < (1 / 4 : ℝ) * d / logAlphabet d · let s := saturatedAlphabet n obtain ⟨hs2, hsd, hgate, hlogs, hratio⟩ := saturatedAlphabet_properties n d (le_trans hNtail2 hnlarge) hd hsaturated let P0 := simplexPointMass s (by omega) have hraw := hJ s n hs2 hgate hlogs P0 P0 have htail' := (htail n hnlarge).2 have hfixed : cJ / 2 ≤ fixedL1MinimaxRisk n s := by have hmin : min 1 ((s : ℝ) / (n * Ln)) = 1 := min_eq_left hratio change cJ * min 1 ((s : ℝ) / (n * Ln)) - 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ fixedL1MinimaxRisk n s at hraw rw [hmin] at hraw linarith have hpad := fixedL1MinimaxRisk_mono_alphabet (n := n) (s := s) (d := d) (by omega) hsd let Pd := simplexPointMass d (by omega) have htransfer := l1_minimax_transfer (n := n) hd ⟨hepsilon, hepsilonHalf⟩ Pd Pd have hobs : cJ / 32 ≤ minimaxRisk n d epsilon := by linarith [hfixed.trans hpad, htransfer] have hscaleOne : min 1 ((d : ℝ) / (n * logAlphabet d)) = 1 := by apply min_eq_left have : 4 < (d : ℝ) / (n * logAlphabet d) := by apply (lt_div_iff₀ (mul_pos hnR hLd)).2 apply (lt_div_iff₀ hLd).mp at hsaturated nlinarith linarith rw [hscaleOne] have hcJ' : c ≤ cJ / 64 := le_trans (min_le_right _ _) (min_le_left _ _) nlinarith · have hgate : (1 / 4 : ℝ) * d / logAlphabet d ≤ n := le_of_not_gt hsaturated let P0 := simplexPointMass d (by omega) have hraw := hJ d n hd hgate hlogCompare P0 P0 have htail' := (htail n hnlarge).1 have hLn_le_d : Ln ≤ d := hlogCompare.trans (by linarith) have hinv : 1 / (n : ℝ) ≤ min 1 ((d : ℝ) / (n * Ln)) := by apply le_min · apply (div_le_iff₀ hnR).2 simpa only [one_mul] using (show (1 : ℝ) ≤ n by exact_mod_cast hn) · apply (div_le_div_iff₀ hnR (mul_pos hnR hLn)).2 nlinarith have hfixed : cJ / 2 * min 1 ((d : ℝ) / (n * Ln)) ≤ fixedL1MinimaxRisk n d := by change cJ * min 1 ((d : ℝ) / (n * Ln)) - 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ fixedL1MinimaxRisk n d at hraw have htailBound : 8 * exp (-(n : ℝ) * (1 - log 2)) ≤ cJ / 2 * min 1 ((d : ℝ) / (n * Ln)) := by calc _ ≤ cJ / (2 * n) := htail' _ = cJ / 2 * (1 / n) := by ring _ ≤ _ := by gcongr linarith have hratioCompare : (d : ℝ) / (n * logAlphabet d) ≤ 2 * (d / (n * Ln)) := by rw [show 2 * ((d : ℝ) / (n * Ln)) = (2 * d) / (n * Ln) by ring] apply (div_le_div_iff₀ (mul_pos hnR hLd) (mul_pos hnR hLn)).2 have hmul := mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hlogCompare hnR.le) hdR.le nlinarith [hmul] have hminCompare : min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ 2 * min 1 ((d : ℝ) / (n * Ln)) := by by_cases hbig : 1 ≤ (d : ℝ) / (n * Ln) · rw [min_eq_left hbig] exact (min_le_left _ _).trans (by norm_num) · rw [min_eq_right (le_of_not_ge hbig)] exact (min_le_right _ _).trans hratioCompare have htransfer := l1_minimax_transfer (n := n) hd ⟨hepsilon, hepsilonHalf⟩ P0 P0 have hcJ' : c ≤ cJ / 64 := le_trans (min_le_right _ _) (min_le_left _ _) calc c * min 1 ((d : ℝ) / (n * logAlphabet d)) ≤ cJ / 64 * (2 * min 1 ((d : ℝ) / (n * Ln))) := by gcongr _ ≤ fixedL1MinimaxRisk n d / 16 := by nlinarith [hfixed] _ ≤ minimaxRisk n d epsilon := htransfer
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.all_estimator_lower · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TAllEstimatorLower.lean:9
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TCausalOptimalValueCorollary 8 declarations Causal interpretation of the observed optimal-regression value.

Causal interpretation of the observed optimal-regression value.

theorem observedMarginal_jointMass

each observed-marginal atom equals the sum of compatible full-data atoms.

Formal statement
d :
Q :
x :
Fin d
a y :
jointMass (observedMarginal Q) x a y
= ∑ y0 : Bool, ∑ y1 : Bool, fullMass Q (x, a, y, y0, y1)
Proof (Lean source)
lemma observedMarginal_jointMass {d : ℕ} (Q : PotentialLaw d) (x : Fin d) (a y : Bool) : jointMass (observedMarginal Q) x a y = ∑ y0 : Bool, ∑ y1 : Bool, fullMass Q (x, a, y, y0, y1) := by classical have hmap : (observedMarginal Q).pmf (x, a, y) = ∑ y0 : Bool, ∑ y1 : Bool, Q.pmf (x, a, y, y0, y1) := by change (Q.pmf.map (fun z => (z.1, z.2.1, z.2.2.1))) (x, a, y) = _ rw [PMF.map_apply, tsum_fintype] rw [Fintype.sum_prod_type, Finset.sum_eq_single x] · fin_cases a <;> fin_cases y <;> simp [Fintype.sum_prod_type] · intro b _hb hbx simp [Ne.symm hbx] · simp rw [jointMass, hmap] simp [fullMass, ENNReal.toReal_add, PMF.apply_ne_top]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal_jointMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:10
theorem observedMarginal_cellMass

the cell mass of the observed marginal equals the corresponding covariate mass of the potential-outcome law.

Formal statement
d :
Q :
x :
Fin d
cellMass (observedMarginal Q) x = poCellMass Q x
Proof (Lean source)
lemma observedMarginal_cellMass {d : ℕ} (Q : PotentialLaw d) (x : Fin d) : cellMass (observedMarginal Q) x = poCellMass Q x := by simp [cellMass, poCellMass, observedMarginal_jointMass]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedMarginal_cellMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:29
theorem consistent_observed_selected_atom

under consistency, each observed atom equals the compatible selected potential-outcome atom.

Formal statement
d :
Q :
h :
Consistency Q
x :
Fin d
r :
Fin 2
y :
jointMass (observedMarginal Q) x (finTwoEquiv r) y = poArmAtom Q x r (finTwoEquiv r) y
Proof (Lean source)
lemma consistent_observed_selected_atom {d : ℕ} (Q : PotentialLaw d) (h : Consistency Q) (x : Fin d) (r : Fin 2) (y : Bool) : jointMass (observedMarginal Q) x (finTwoEquiv r) y = poArmAtom Q x r (finTwoEquiv r) y := by simp [Consistency] at h fin_cases r <;> fin_cases y <;> simp [observedMarginal_jointMass, poArmAtom, poAtom, finTwoEquiv, h]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.consistent_observed_selected_atom · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:35
theorem poRegression_eq_poArmAtom_ratio

the stated potential-outcome regression identity potential-outcome arm atom ratio relation holds.

Formal statement
d :
Q :
x :
Fin d
r :
Fin 2
poRegression Q r x = (∑ arm : Bool, poArmAtom Q x r arm true) / poCellMass Q x
Proof (Lean source)
lemma poRegression_eq_poArmAtom_ratio {d : ℕ} (Q : PotentialLaw d) (x : Fin d) (r : Fin 2) : poRegression Q r x = (∑ arm : Bool, poArmAtom Q x r arm true) / poCellMass Q x := by fin_cases r <;> simp [poRegression, poCellMass, poArmAtom, poAtom] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression_eq_poArmAtom_ratio · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:45
theorem consistent_observed_armMass

under consistency, observed arm mass equals the total compatible potential-outcome arm mass.

Formal statement
d :
Q :
h :
Consistency Q
x :
Fin d
r :
Fin 2
Proof (Lean source)
lemma consistent_observed_armMass {d : ℕ} (Q : PotentialLaw d) (h : Consistency Q) (x : Fin d) (r : Fin 2) : armMass (observedMarginal Q) (finTwoEquiv r) x = ∑ y : Bool, poArmAtom Q x r (finTwoEquiv r) y := by simp [armMass, consistent_observed_selected_atom Q h x r]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.consistent_observed_armMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:55
theorem poArmAtom_total_eq_cellMass

summing the compatible potential-outcome arm atoms over arm and outcome gives cell mass.

Formal statement
d :
Q :
x :
Fin d
r :
Fin 2
(∑ a : Bool, ∑ y : Bool, poArmAtom Q x r a y) = poCellMass Q x
Proof (Lean source)
lemma poArmAtom_total_eq_cellMass {d : ℕ} (Q : PotentialLaw d) (x : Fin d) (r : Fin 2) : (∑ a : Bool, ∑ y : Bool, poArmAtom Q x r a y) = poCellMass Q x := by fin_cases r <;> simp [poCellMass, poArmAtom, poAtom] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poArmAtom_total_eq_cellMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:63
theorem poRegression_eq_outcomeMean_of_pos

If the stated cons condition holds, and the stated exch condition holds, and the stated cell condition holds, and the stated arm condition holds, then the stated potential-outcome regression identity outcome mean of pos relation holds.

Formal statement
d :
Q :
hcons :
Consistency Q
x :
Fin d
r :
Fin 2
hcell :
0 < cellMass (observedMarginal Q) x
harm :
Proof (Lean source)
lemma poRegression_eq_outcomeMean_of_pos {d : ℕ} (Q : PotentialLaw d) (hcons : Consistency Q) (hexch : ConditionalExchangeability Q) (x : Fin d) (r : Fin 2) (hcell : 0 < cellMass (observedMarginal Q) x) (harm : 0 < armMass (observedMarginal Q) (finTwoEquiv r) x) : poRegression Q r x = outcomeMean (observedMarginal Q) (finTwoEquiv r) x := by have heq := hexch x r (finTwoEquiv r) true rw [poArmAtom_total_eq_cellMass] at heq rw [← observedMarginal_cellMass] at heq rw [consistent_observed_armMass Q hcons] at harm rw [poRegression_eq_poArmAtom_ratio, outcomeMean, consistent_observed_selected_atom Q hcons, consistent_observed_armMass Q hcons, ← observedMarginal_cellMass] field_simp [ne_of_gt hcell, ne_of_gt harm] nlinarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.poRegression_eq_outcomeMean_of_pos · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:72
theorem causal_optimal_value_corollary Proposition 2 in the paper ↗

If the potential-outcome law satisfies the stated causal restrictions, then the causal oracle value equals the optimal value identified from the observed marginal.

Formal statement
d :
epsilon :
Q :
hQ :
Proof (Lean source)
theorem causal_optimal_value_corollary {d : ℕ} {epsilon : ℝ} (Q : PotentialLaw d) (hQ : CausalCompletionClass epsilon Q) : oracleValue Q = observedOptimalValue (observedMarginal Q) hQ.observedModel := by classical rw [oracleValue, observedOptimalValue, observedOptimalValueRaw] apply Finset.sum_congr rfl intro x _hx rw [← observedMarginal_cellMass] by_cases hx : cellMass (observedMarginal Q) x = 0 · simp [hx] · have hnonneg : 0 ≤ cellMass (observedMarginal Q) x := by unfold cellMass jointMass positivity have hxpos : 0 < cellMass (observedMarginal Q) x := lt_of_le_of_ne hnonneg (Ne.symm hx) have hov := hQ.overlap x hxpos have ht : 0 < armMass (observedMarginal Q) true x := by have he : 0 < epsilon * cellMass (observedMarginal Q) x := mul_pos hQ.epsilon_pos hxpos exact lt_of_lt_of_le he ((le_div_iff₀ hxpos).mp hov.1) have hsum : cellMass (observedMarginal Q) x = armMass (observedMarginal Q) false x + armMass (observedMarginal Q) true x := by simp [cellMass, armMass] ring have hf : 0 < armMass (observedMarginal Q) false x := by rw [propensity, div_le_iff₀ hxpos] at hov nlinarith [mul_pos hQ.epsilon_pos hxpos] rw [poRegression_eq_outcomeMean_of_pos Q hQ.consistency hQ.exchangeability x 0 hxpos hf, poRegression_eq_outcomeMean_of_pos Q hQ.consistency hQ.exchangeability x 1 hxpos ht] rfl
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.causal_optimal_value_corollary · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TCausalOptimalValueCorollary.lean:90
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TConsistencyParametricBoundaries 7 declarations Consistency and parametric-rate boundaries along arbitrary alphabet sequences.

Consistency and parametric-rate boundaries along arbitrary alphabet sequences.

For the specified risk sequence, the parametric-rate property says that the risk is eventually bounded above and below by positive constant multiples of one over sample size. There are constants such that the lower constant is positive, it does not exceed the upper constant, and the risk eventually lies between those constants divided by sample size.

Definition (Lean source)
risk :
ℕ → ℝ
ParametricRate risk :
Prop
∃ c C : ℝ,
clause 1
0 < c
clause 2
c ≤ C
clause 3
∀ᶠ n in atTop, c / n ≤ risk n ∧ risk n ≤ C / n

For the specified alphabet-size sequence, the bounded-alphabet sequence is an alphabet-size sequence that remains uniformly bounded asymptotically.

Definition (Lean source)
dseq :
ℕ → ℕ
BoundedAlphabetSequence dseq :
Prop
IsBigO atTop (fun n => (dseq n : ℝ)) (fun _ => (1 : ℝ))
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.BoundedAlphabetSequence · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:14
theorem phase_scale_tendsto_iff_littleO

If the alphabet size satisfies its stated restriction, then the phase scale converges to zero exactly when d=o(nlog(en))d=o(nlog(en)).

Formal statement
dseq :
ℕ → ℕ
hd :
∀ n, 2 ≤ dseq n
Tendsto (phaseScale dseq) atTop (nhds 0)
IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n))
Proof (Lean source)
lemma phase_scale_tendsto_iff_littleO (dseq : ℕ → ℕ) (hd : ∀ n, 2 ≤ dseq n) : Tendsto (phaseScale dseq) atTop (nhds 0) ↔ IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n)) := by have hden : ∀ᶠ n : ℕ in atTop, (n : ℝ) * log (exp 1 * n) = 0 → (dseq n : ℝ) = 0 := by filter_upwards [eventually_ge_atTop 1] with n hn1 hn have hn0 : n ≠ 0 := by omega have hnpos : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn0 have hlog : 0 < log (exp 1 * n) := Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hn1R : (1 : ℝ) ≤ n := by exact_mod_cast hn1 exact lt_of_lt_of_le he (by nlinarith [Real.exp_pos 1])) nlinarith rw [Asymptotics.isLittleO_iff_tendsto' hden] change Tendsto (phaseScale dseq) atTop (nhds 0) ↔ Tendsto (littleOScale dseq) atTop (nhds 0) have hN : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop have hsqrt : Tendsto (fun n : ℕ => ((Real.sqrt n)⁻¹ : ℝ)) atTop (nhds 0) := tendsto_inv_atTop_zero.comp (Real.tendsto_sqrt_atTop.comp hN) have hlogN : Tendsto (fun n : ℕ => log (exp 1 * n)) atTop atTop := by apply Real.tendsto_log_atTop.comp exact hN.const_mul_atTop (Real.exp_pos 1) have hinvlog : Tendsto (fun n : ℕ => (log (exp 1 * n))⁻¹) atTop (nhds 0) := tendsto_inv_atTop_zero.comp hlogN constructor · intro hb have hraw : Tendsto (rawPhaseScale dseq) atTop (nhds 0) := by have hsmall : ∀ᶠ n in atTop, phaseScale dseq n < 1 / 2 := (tendsto_order.1 hb).2 (1 / 2) (by norm_num) have heq : ∀ᶠ n in atTop, phaseScale dseq n = rawPhaseScale dseq n := by filter_upwards [eventually_ge_atTop 1, hsmall] with n hn hs have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hdR : (0 : ℝ) < dseq n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (hd n)) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) calc 1 < exp 1 := he _ = exp 1 * 1 := by ring _ ≤ exp 1 * dseq n := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1) have hnonneg : 0 ≤ rawPhaseScale dseq n := by exact div_nonneg (le_of_lt hdR) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogd)) have hlt : rawPhaseScale dseq n < 1 := by by_contra h have : phaseScale dseq n = 1 := min_eq_left (le_of_not_gt h) rw [this] at hs norm_num at hs exact min_eq_right (le_of_lt hlt) exact hb.congr' heq have hupperT : Tendsto (fun n : ℕ => (log (exp 1 * n))⁻¹ + 2 * rawPhaseScale dseq n) atTop (nhds 0) := by convert hinvlog.add (hraw.const_mul 2) using 1 <;> norm_num have hsqueeze := tendsto_of_tendsto_of_tendsto_of_le_of_le' (f := littleOScale dseq) (show Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (nhds 0) from tendsto_const_nhds) hupperT apply (by simpa using hsqueeze : (∀ᶠ n in atTop, 0 ≤ littleOScale dseq n) → (∀ᶠ n in atTop, littleOScale dseq n ≤ (log (exp 1 * n))⁻¹ + 2 * rawPhaseScale dseq n) → Tendsto (littleOScale dseq) atTop (nhds 0)) · filter_upwards [eventually_ge_atTop 1] with n hn have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hlogn : 0 < log (exp 1 * n) := Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn exact lt_of_lt_of_le he (by nlinarith [Real.exp_pos 1])) exact div_nonneg (Nat.cast_nonneg _) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogn)) · have hraw_small_ev : ∀ᶠ n in atTop, rawPhaseScale dseq n ≤ 1 / 2 := ((tendsto_order.1 hraw).2 (1 / 2) (by norm_num)).mono (by intro n hn exact le_of_lt hn) filter_upwards [eventually_ge_atTop 1, hraw_small_ev] with n hn hraw_small have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hdR : (0 : ℝ) < dseq n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (hd n)) have hlogn : 0 < log (exp 1 * n) := Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn exact lt_of_lt_of_le he (by nlinarith [Real.exp_pos 1])) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) calc 1 < exp 1 := he _ = exp 1 * 1 := by ring _ ≤ exp 1 * dseq n := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1) have hnonneg : 0 ≤ littleOScale dseq n := by exact div_nonneg (Nat.cast_nonneg _) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogn)) have hrawnonneg : 0 ≤ rawPhaseScale dseq n := by exact div_nonneg (Nat.cast_nonneg _) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogd)) by_cases hdn : dseq n < n · have hratio : (dseq n : ℝ) / n ≤ 1 := by rw [div_le_one hnR] exact_mod_cast le_of_lt hdn calc littleOScale dseq n = ((dseq n : ℝ) / n) / log (exp 1 * n) := by simp [littleOScale, div_eq_mul_inv, mul_assoc, mul_comm, mul_left_comm] _ ≤ 1 / log (exp 1 * n) := by apply div_le_div_of_nonneg_right hratio (le_of_lt hlogn) _ ≤ (log (exp 1 * n))⁻¹ + 2 * rawPhaseScale dseq n := by rw [one_div] nlinarith · have hnd : n ≤ dseq n := le_of_not_gt hdn let t : ℝ := (dseq n : ℝ) / n have ht : 1 ≤ t := (one_le_div hnR).2 (by exact_mod_cast hnd) have htpos : 0 < t := lt_of_lt_of_le (by norm_num) ht have hsplit : logAlphabet (dseq n) = log (exp 1 * n) + log t := by dsimp [t] rw [logAlphabet, ← Real.log_mul (by positivity : exp 1 * (n : ℝ) ≠ 0) (by positivity : (dseq n : ℝ) / n ≠ 0)] congr 1 field_simp have hlogt : log t ≤ t := Real.log_le_self (le_of_lt htpos) have ht_le : t ≤ log (exp 1 * n) := by have hraw_eq : rawPhaseScale dseq n = t / (log (exp 1 * n) + log t) := by rw [rawPhaseScale, hsplit] dsimp [t] field_simp rw [hraw_eq] at hraw_small have hdenpos : 0 < log (exp 1 * n) + log t := add_pos_of_pos_of_nonneg hlogn (Real.log_nonneg ht) rw [div_le_iff₀ hdenpos] at hraw_small nlinarith have hden_le : log (exp 1 * n) + log t ≤ 2 * log (exp 1 * n) := by linarith have hcomp : littleOScale dseq n ≤ 2 * rawPhaseScale dseq n := by have hhalfpos : 0 < (log (exp 1 * n) + log t) / 2 := by exact div_pos (add_pos_of_pos_of_nonneg hlogn (Real.log_nonneg ht)) (by norm_num) calc littleOScale dseq n ≤ (dseq n : ℝ) / ((n : ℝ) * ((log (exp 1 * n) + log t) / 2)) := by unfold littleOScale apply div_le_div_of_nonneg_left (Nat.cast_nonneg _) (mul_pos hnR hhalfpos) exact mul_le_mul_of_nonneg_left (by linarith) (le_of_lt hnR) _ = 2 * rawPhaseScale dseq n := by rw [rawPhaseScale, hsplit] field_simp exact hcomp.trans (by linarith [show 0 ≤ (log (exp 1 * n))⁻¹ by positivity]) · intro ha have hraw : Tendsto (rawPhaseScale dseq) atTop (nhds 0) := by have hupperT : Tendsto (fun n : ℕ => (Real.sqrt n)⁻¹ + 2 * littleOScale dseq n) atTop (nhds 0) := by convert hsqrt.add (ha.const_mul 2) using 1 <;> norm_num apply tendsto_of_tendsto_of_tendsto_of_le_of_le' (show Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (nhds 0) from tendsto_const_nhds) hupperT · filter_upwards [eventually_ge_atTop 1] with n hn have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) exact div_nonneg (Nat.cast_nonneg _) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogd)) · filter_upwards [eventually_ge_atTop 1] with n hn have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hdR : (0 : ℝ) < dseq n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (hd n)) have hsqrtpos : 0 < Real.sqrt n := Real.sqrt_pos.2 hnR have hsqrtn : Real.sqrt n * Real.sqrt n = (n : ℝ) := Real.mul_self_sqrt (le_of_lt hnR) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hlogd_one : 1 ≤ logAlphabet (dseq n) := by rw [logAlphabet] have hmul : exp 1 ≤ exp 1 * (dseq n : ℝ) := by have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1) calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ _ := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) hdR) hmul have hlogn : 0 < log (exp 1 * n) := Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hn1 (Real.exp_nonneg 1))) by_cases hsmall : (dseq n : ℝ) ≤ Real.sqrt n · have hfirst : rawPhaseScale dseq n ≤ (dseq n : ℝ) / n := by unfold rawPhaseScale exact div_le_div_of_nonneg_left (Nat.cast_nonneg _) hnR (by simpa using mul_le_mul_of_nonneg_left hlogd_one (le_of_lt hnR)) calc rawPhaseScale dseq n ≤ (dseq n : ℝ) / n := hfirst _ ≤ Real.sqrt n / n := by gcongr _ = (Real.sqrt n)⁻¹ := by field_simp nlinarith [hsqrtn] _ ≤ (Real.sqrt n)⁻¹ + 2 * littleOScale dseq n := by have ha0 : 0 ≤ littleOScale dseq n := div_nonneg (Nat.cast_nonneg _) (mul_nonneg (le_of_lt hnR) (le_of_lt hlogn)) nlinarith · have hsqrt_lt : Real.sqrt n < (dseq n : ℝ) := lt_of_not_ge hsmall have hn_le_sq : (n : ℝ) ≤ (dseq n : ℝ) ^ 2 := by nlinarith have harg : exp 1 * (n : ℝ) ≤ (exp 1 * (dseq n : ℝ)) ^ 2 := by have heone : 1 ≤ exp 1 := Real.one_le_exp (by norm_num) have hesq : exp 1 ≤ (exp 1) ^ 2 := by nlinarith [Real.exp_pos 1] calc exp 1 * (n : ℝ) ≤ exp 1 * (dseq n : ℝ) ^ 2 := mul_le_mul_of_nonneg_left hn_le_sq (Real.exp_nonneg 1) _ ≤ (exp 1) ^ 2 * (dseq n : ℝ) ^ 2 := by exact mul_le_mul_of_nonneg_right hesq (sq_nonneg _) _ = (exp 1 * (dseq n : ℝ)) ^ 2 := by ring have hlogcomp : log (exp 1 * n) ≤ 2 * logAlphabet (dseq n) := by have hmono := Real.strictMonoOn_log.monotoneOn (mul_pos (Real.exp_pos 1) hnR) (sq_pos_of_pos (mul_pos (Real.exp_pos 1) hdR)) harg rw [Real.log_pow] at hmono simpa [logAlphabet] using hmono have hhalfpos : 0 < log (exp 1 * n) / 2 := div_pos hlogn (by norm_num) have hcomp : rawPhaseScale dseq n ≤ 2 * littleOScale dseq n := by calc rawPhaseScale dseq n ≤ (dseq n : ℝ) / ((n : ℝ) * (log (exp 1 * n) / 2)) := by unfold rawPhaseScale exact div_le_div_of_nonneg_left (Nat.cast_nonneg _) (mul_pos hnR hhalfpos) (mul_le_mul_of_nonneg_left (by linarith) (le_of_lt hnR)) _ = 2 * littleOScale dseq n := by unfold littleOScale field_simp exact hcomp.trans (by have : 0 ≤ (Real.sqrt n)⁻¹ := inv_nonneg.mpr (Real.sqrt_nonneg _) linarith) have hmin : Tendsto (fun n : ℕ => min (1 : ℝ) (rawPhaseScale dseq n)) atTop (nhds 0) := by convert (show Tendsto (fun _ : ℕ => (1 : ℝ)) atTop (nhds 1) from tendsto_const_nhds).min hraw using 1 <;> norm_num change Tendsto (fun n : ℕ => min (1 : ℝ) ((dseq n : ℝ) / ((n : ℝ) * logAlphabet (dseq n)))) atTop (nhds 0) exact hmin
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.phase_scale_tendsto_iff_littleO · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:31
theorem risk_zero_iff_phase_scale

If the alphabet size satisfies its stated restriction, and the stated c condition holds, and the stated c condition holds, and the stated bounds condition holds, then a risk sequence satisfying the stated two-sided phase-scale bounds converges to zero exactly when the phase scale does.

Formal statement
risk :
ℕ → ℝ
dseq :
ℕ → ℕ
hd :
∀ n, 2 ≤ dseq n
c C :
hc :
0 < c
hC :
0 ≤ C
hbounds :
∀ n : ℕ
if
1 ≤ n
then
c * phaseScale dseq n ≤ risk n ∧ risk n ≤ C * phaseScale dseq n
Tendsto risk atTop (nhds 0) ↔ Tendsto (phaseScale dseq) atTop (nhds 0)
Proof (Lean source)
lemma risk_zero_iff_phase_scale (risk : ℕ → ℝ) (dseq : ℕ → ℕ) (hd : ∀ n, 2 ≤ dseq n) (c C : ℝ) (hc : 0 < c) (hC : 0 ≤ C) (hbounds : ∀ n : ℕ, 1 ≤ n → c * phaseScale dseq n ≤ risk n ∧ risk n ≤ C * phaseScale dseq n) : Tendsto risk atTop (nhds 0) ↔ Tendsto (phaseScale dseq) atTop (nhds 0) := by have hs_nonneg : ∀ n, 0 ≤ phaseScale dseq n := by intro n by_cases hn : n = 0 · simp [phaseScale, hn] · have hnR : (0 : ℝ) < n := by exact_mod_cast Nat.pos_of_ne_zero hn have hdR : (0 : ℝ) < dseq n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (hd n)) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) unfold phaseScale rw [le_min_iff] exact ⟨by norm_num, by positivity⟩ constructor · intro hr have hu : Tendsto (fun n => c⁻¹ * risk n) atTop (nhds 0) := by convert hr.const_mul c⁻¹ using 1 <;> norm_num apply tendsto_of_tendsto_of_tendsto_of_le_of_le' (show Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (nhds 0) from tendsto_const_nhds) hu · exact Filter.Eventually.of_forall (fun n => hs_nonneg n) · filter_upwards [eventually_ge_atTop 1] with n hn have := (hbounds n hn).1 have hcinv : 0 ≤ c⁻¹ := inv_nonneg.mpr (le_of_lt hc) calc phaseScale dseq n = c⁻¹ * (c * phaseScale dseq n) := by field_simp _ ≤ c⁻¹ * risk n := mul_le_mul_of_nonneg_left this hcinv · intro hs have hu : Tendsto (fun n => C * phaseScale dseq n) atTop (nhds 0) := by convert hs.const_mul C using 1 <;> norm_num apply tendsto_of_tendsto_of_tendsto_of_le_of_le' (show Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (nhds 0) from tendsto_const_nhds) hu · filter_upwards [eventually_ge_atTop 1] with n hn exact (mul_nonneg (le_of_lt hc) (hs_nonneg n)).trans (hbounds n hn).1 · filter_upwards [eventually_ge_atTop 1] with n hn exact (hbounds n hn).2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.risk_zero_iff_phase_scale · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:280
theorem parametric_implies_bounded_alphabet

If the alphabet size satisfies its stated restriction, and the stated c condition holds, and the stated lower condition holds, and the stated param condition holds, then a two-sided parametric risk bound forces the alphabet-size sequence to be uniformly bounded.

Formal statement
risk :
ℕ → ℝ
dseq :
ℕ → ℕ
hd :
∀ n, 2 ≤ dseq n
c C :
hc :
0 < c
hlower :
∀ n : ℕ
if
1 ≤ n
then
c * phaseScale dseq n ≤ risk n
hparam :
Proof (Lean source)
lemma parametric_implies_bounded_alphabet (risk : ℕ → ℝ) (dseq : ℕ → ℕ) (hd : ∀ n, 2 ≤ dseq n) (c C : ℝ) (hc : 0 < c) (hlower : ∀ n : ℕ, 1 ≤ n → c * phaseScale dseq n ≤ risk n) (hparam : ParametricRate risk) : BoundedAlphabetSequence dseq := by obtain ⟨a, B, ha, _haB, hp⟩ := hparam unfold BoundedAlphabetSequence rw [Asymptotics.isBigO_iff] refine ⟨max 1 (4 * (B / c) ^ 2), ?_⟩ filter_upwards [hp, eventually_ge_atTop 1, eventually_ge_atTop (ceil (B / c) + 2)] with n hpn hn hlarge have hnR : (0 : ℝ) < n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 1) hn) have hdR : (0 : ℝ) < dseq n := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) (hd n)) have hlogd : 0 < logAlphabet (dseq n) := by unfold logAlphabet apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) (hd n)) exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hBC : 0 ≤ B := le_trans (le_of_lt ha) _haB have hscale_bound : (n : ℝ) * phaseScale dseq n ≤ B / c := by have h := (hlower n hn).trans hpn.2 rw [le_div_iff₀ hc] calc (n : ℝ) * phaseScale dseq n * c = (n : ℝ) * (c * phaseScale dseq n) := by ring _ ≤ (n : ℝ) * risk n := mul_le_mul_of_nonneg_left (hlower n hn) (le_of_lt hnR) _ ≤ (n : ℝ) * (B / n) := mul_le_mul_of_nonneg_left hpn.2 (le_of_lt hnR) _ = B := by field_simp have hn_gt : B / c < (n : ℝ) := by have hceil : B / c ≤ ceil (B / c) := Nat.le_ceil _ exact lt_of_le_of_lt hceil (by exact_mod_cast (by omega : ceil (B / c) < n)) have hraw_le : rawPhaseScale dseq n ≤ 1 := by by_contra h have hs : phaseScale dseq n = 1 := by unfold phaseScale exact min_eq_left (le_of_not_ge h) rw [hs] at hscale_bound linarith have hratio : (dseq n : ℝ) / logAlphabet (dseq n) ≤ B / c := by have hs : phaseScale dseq n = rawPhaseScale dseq n := min_eq_right hraw_le rw [hs, rawPhaseScale] at hscale_bound calc (dseq n : ℝ) / logAlphabet (dseq n) = (n : ℝ) * ((dseq n : ℝ) / ((n : ℝ) * logAlphabet (dseq n))) := by field_simp _ ≤ B / c := hscale_bound have hlog_sqrt : logAlphabet (dseq n) ≤ 2 * sqrt (dseq n) := by have hsqrtpos : 0 < sqrt (dseq n) := Real.sqrt_pos.2 hdR have hbase := Real.log_le_sub_one_of_pos hsqrtpos have hroot := Real.log_sqrt (le_of_lt hdR) rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdR), Real.log_exp] at ⊢ nlinarith have hsqrt_bound : sqrt (dseq n) ≤ 2 * (B / c) := by have hsqrt_nonneg := Real.sqrt_nonneg (dseq n) have hsqrt_sq := Real.mul_self_sqrt (le_of_lt hdR) have haux : sqrt (dseq n) ≤ 2 * ((dseq n : ℝ) / logAlphabet (dseq n)) := by rw [← mul_div_assoc] rw [le_div_iff₀ hlogd] nlinarith linarith have hdBound : (dseq n : ℝ) ≤ 4 * (B / c) ^ 2 := by nlinarith [Real.sq_sqrt (le_of_lt hdR), sq_nonneg (2 * (B / c) - sqrt (dseq n))] rw [Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ (dseq n : ℝ) from Nat.cast_nonneg _), norm_one, mul_one] apply le_max_of_le_right exact hdBound
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.parametric_implies_bounded_alphabet · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:325
theorem bounded_alphabet_sequence_global_bound

a bounded-alphabet sequence admits a single finite upper bound at every sample size.

Formal statement
dseq :
ℕ → ℕ
∃ dmax : ℕ, ∀ n, dseq n ≤ dmax
Proof (Lean source)
lemma bounded_alphabet_sequence_global_bound (dseq : ℕ → ℕ) (h : BoundedAlphabetSequence dseq) : ∃ dmax : ℕ, ∀ n, dseq n ≤ dmax := by unfold BoundedAlphabetSequence at h have hb : Filter.IsBoundedUnder (fun x y : ℝ => x ≤ y) Filter.cofinite (fun n => ‖(dseq n : ℝ)‖) := by have hb' := (Asymptotics.isBigO_const_iff.mp h).2 simpa only [Nat.cofinite_eq_atTop] using hb' obtain ⟨K, hK⟩ := Filter.IsBoundedUnder.bddAbove_range_of_cofinite hb refine ⟨Nat.ceil K, ?_⟩ intro n have hn : ‖(dseq n : ℝ)‖ ≤ K := hK ⟨n, rfl⟩ rw [Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ (dseq n : ℝ) from Nat.cast_nonneg _)] at hn have hceil : K ≤ ceil K := Nat.le_ceil K exact_mod_cast hn.trans hceil
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bounded_alphabet_sequence_global_bound · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:395
theorem consistency_and_parametric_boundaries Theorem 4 in the paper ↗

If the Cai--Low moment-matching prior result is available, and the Jiao--Han--Weissman Poisson L1 lower bound is available, then observed and causal minimax risks are consistent exactly when d=o(nlog(en))d=o(nlog(en)), and attain the parametric 1/n1/n rate exactly for uniformly bounded alphabets.

Formal statement
h_cai_low_of_gate :
h_jhw_of_gate :
epsilon :
0 < epsilon
epsilon < 1 / 2
conclusion 1
dseq :
ℕ → ℕ
(∀ n, 2 ≤ dseq n)
Tendsto (fun n => minimaxRisk n (dseq n) epsilon) atTop (nhds 0)
IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n))
conclusion 2
dseq :
ℕ → ℕ
(∀ n, 2 ≤ dseq n)
ParametricRate (fun n => minimaxRisk n (dseq n) epsilon) ↔ BoundedAlphabetSequence dseq
ParametricRate (fun n => causalMinimaxRisk n (dseq n) epsilon)
conclusion 3
dseq :
ℕ → ℕ
(∀ n, 2 ≤ dseq n)
Tendsto (fun n => causalMinimaxRisk n (dseq n) epsilon) atTop (nhds 0)
IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n))
Proof (Lean source)
theorem consistency_and_parametric_boundaries (h_cai_low_of_gate : CaiLowAbsoluteMomentPriors) (h_jhw_of_gate : JhwPoissonL1Lower) : ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → (∀ (dseq : ℕ → ℕ), (∀ n, 2 ≤ dseq n) → (Tendsto (fun n => minimaxRisk n (dseq n) epsilon) atTop (nhds 0) ↔ IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n)))) ∧ (∀ (dseq : ℕ → ℕ), (∀ n, 2 ≤ dseq n) → (ParametricRate (fun n => minimaxRisk n (dseq n) epsilon) ↔ BoundedAlphabetSequence dseq) ∧ (ParametricRate (fun n => causalMinimaxRisk n (dseq n) epsilon) ↔ BoundedAlphabetSequence dseq)) ∧ (∀ (dseq : ℕ → ℕ), (∀ n, 2 ≤ dseq n) → (Tendsto (fun n => causalMinimaxRisk n (dseq n) epsilon) atTop (nhds 0) ↔ IsLittleO atTop (fun n => (dseq n : ℝ)) (fun n => (n : ℝ) * log (exp 1 * n)))) := by obtain ⟨_tuning, _htuning, hfrontier⟩ := matched_minimax_frontier h_cai_low_of_gate h_jhw_of_gate obtain ⟨_tuning2, _htuning2, _hcompare, _hfallback, hbounded⟩ := parent_reduction h_cai_low_of_gate h_jhw_of_gate intro epsilon hepsilon hepsilon' obtain ⟨c, C, hc, hcC, hb⟩ := hfrontier epsilon hepsilon hepsilon' have hC : 0 ≤ C := le_trans (le_of_lt hc) hcC have hbounded' := hbounded epsilon hepsilon hepsilon' have hobs_bounds (dseq : ℕ → ℕ) (hd : ∀ n, 2 ≤ dseq n) : ∀ n : ℕ, 1 ≤ n → c * phaseScale dseq n ≤ minimaxRisk n (dseq n) epsilon ∧ minimaxRisk n (dseq n) epsilon ≤ C * phaseScale dseq n := by intro n hn obtain ⟨hl, hm, hu, _⟩ := hb n (dseq n) hn (hd n) exact ⟨hl, hm.trans hu⟩ have hcausal_eq (dseq : ℕ → ℕ) (hd : ∀ n, 2 ≤ dseq n) : ∀ᶠ n in atTop, causalMinimaxRisk n (dseq n) epsilon = minimaxRisk n (dseq n) epsilon := by filter_upwards [eventually_ge_atTop 1] with n hn exact (hb n (dseq n) hn (hd n)).2.2.2 refine ⟨?_, ?_, ?_⟩ · intro dseq hd exact (risk_zero_iff_phase_scale _ dseq hd c C hc hC (hobs_bounds dseq hd)).trans (phase_scale_tendsto_iff_littleO dseq hd) · intro dseq hd constructor · constructor · exact fun hp => parametric_implies_bounded_alphabet _ dseq hd c C hc (fun n hn => (hobs_bounds dseq hd n hn).1) hp · intro hbd exact hbounded' dseq hd (bounded_alphabet_sequence_global_bound dseq hbd) · calc ParametricRate (fun n => causalMinimaxRisk n (dseq n) epsilon) ↔ ParametricRate (fun n => minimaxRisk n (dseq n) epsilon) := by constructor · rintro ⟨a, B, ha, haB, h⟩ refine ⟨a, B, ha, haB, ?_⟩ filter_upwards [h, hcausal_eq dseq hd] with n hn heq simpa [heq] using hn · rintro ⟨a, B, ha, haB, h⟩ refine ⟨a, B, ha, haB, ?_⟩ filter_upwards [h, hcausal_eq dseq hd] with n hn heq simpa [heq] using hn _ ↔ BoundedAlphabetSequence dseq := ⟨fun hp => parametric_implies_bounded_alphabet _ dseq hd c C hc (fun n hn => (hobs_bounds dseq hd n hn).1) hp, fun hbd => hbounded' dseq hd (bounded_alphabet_sequence_global_bound dseq hbd)⟩ · intro dseq hd rw [show Tendsto (fun n => causalMinimaxRisk n (dseq n) epsilon) atTop (nhds 0) ↔ Tendsto (fun n => minimaxRisk n (dseq n) epsilon) atTop (nhds 0) from ⟨fun h => h.congr' (hcausal_eq dseq hd), fun h => h.congr' ((hcausal_eq dseq hd).mono fun _ heq => heq.symm)⟩] exact (risk_zero_iff_phase_scale _ dseq hd c C hc hC (hobs_bounds dseq hd)).trans (phase_scale_tendsto_iff_littleO dseq hd)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.consistency_and_parametric_boundaries · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TConsistencyParametricBoundaries.lean:412
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TEqualPropensityL1Reduction 11 declarations Equal-propensity L1 identities and minimax transfer.

Equal-propensity L1 identities and minimax transfer.

the stated l1 source singleton relation holds.

Formal statement
d :
Pv Qv :
z :
Fin d × Fin d
((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) {z}
= ofReal (Pv.1 z.1) * ofReal (Qv.1 z.2)
Proof (Lean source)
lemma l1_source_singleton {d : ℕ} (Pv Qv : ProbabilitySimplex d) (z : Fin d × Fin d) : ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) {z} = ofReal (Pv.1 z.1) * ofReal (Qv.1 z.2) := by classical calc _ = ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) ({z.1} ×ˢ {z.2}) := by congr 1 ext w simp _ = (simplexPMF Pv).toMeasure {z.1} * (simplexPMF Qv).toMeasure {z.2} := Measure.prod_prod _ _ _ = _ := by simp [simplexPMF]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1_source_singleton · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:11

the stated l1 kernel singleton relation holds.

Formal statement
d :
z :
Fin d × Fin d
o :
Obs d
= (map (fun k : Fin 4 => if k = 0 then (z.1, false, false) else if k = 1 then (z.1, true, true) else if k = 2 then (z.2, false, true) else (z.2, true, false)) (uniformOfFintype (Fin 4))) o
Proof (Lean source)
lemma l1_kernel_singleton {d : ℕ} (z : Fin d × Fin d) (o : Obs d) : l1SingleKernel z {o} = (map (fun k : Fin 4 => if k = 0 then (z.1, false, false) else if k = 1 then (z.1, true, true) else if k = 2 then (z.2, false, true) else (z.2, true, false)) (uniformOfFintype (Fin 4))) o := by unfold l1SingleKernel exact PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1_kernel_singleton · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:27

the stated l1 kernel atoms relation holds.

Formal statement
d :
z :
Fin d × Fin d
x :
Fin d
conclusion 1
(l1SingleKernel z {(x, true, true)}).toReal = (if z.1 = x then 1 / 4 else 0)
conclusion 2
(l1SingleKernel z {(x, false, false)}).toReal = (if z.1 = x then 1 / 4 else 0)
conclusion 3
(l1SingleKernel z {(x, true, false)}).toReal = (if z.2 = x then 1 / 4 else 0)
conclusion 4
(l1SingleKernel z {(x, false, true)}).toReal = (if z.2 = x then 1 / 4 else 0)
Proof (Lean source)
lemma l1_kernel_atoms {d : ℕ} (z : Fin d × Fin d) (x : Fin d) : (l1SingleKernel z {(x, true, true)}).toReal = (if z.1 = x then 1 / 4 else 0) ∧ (l1SingleKernel z {(x, false, false)}).toReal = (if z.1 = x then 1 / 4 else 0) ∧ (l1SingleKernel z {(x, true, false)}).toReal = (if z.2 = x then 1 / 4 else 0) ∧ (l1SingleKernel z {(x, false, true)}).toReal = (if z.2 = x then 1 / 4 else 0) := by simp [l1_kernel_singleton, PMF.map_apply, tsum_fintype, Fin.sum_univ_four] constructor · by_cases h : z.1 = x · subst x; simp · have hn : x ≠ z.1 := Ne.symm h simp [h, hn] · by_cases h : z.2 = x · subst x; simp · have hn : x ≠ z.2 := Ne.symm h simp [h, hn]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1_kernel_atoms · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:39

the stated l1 kernel atom formula relation holds.

Formal statement
d :
z :
Fin d × Fin d
x :
Fin d
a y :
(l1SingleKernel z {(x, a, y)}).toReal
= if (if a = y then z.1 else z.2) = x then 1 / 4 else 0
Proof (Lean source)
lemma l1_kernel_atom_formula {d : ℕ} (z : Fin d × Fin d) (x : Fin d) (a y : Bool) : (l1SingleKernel z {(x, a, y)}).toReal = if (if a = y then z.1 else z.2) = x then 1 / 4 else 0 := by fin_cases a <;> fin_cases y · simpa using (l1_kernel_atoms z x).1 · simpa using (l1_kernel_atoms z x).2.2.1 · simpa using (l1_kernel_atoms z x).2.2.2 · simpa using (l1_kernel_atoms z x).2.1
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1_kernel_atom_formula · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:57
theorem l1SingleKernel_comp_pair

the stated l1 single kernel composition pair relation holds.

Formal statement
d :
Pv Qv :
l1SingleKernel ∘ₘ ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure)
= obsLaw (observedMarginal (l1Embedding Pv Qv))
Proof (Lean source)
lemma l1SingleKernel_comp_pair {d : ℕ} (Pv Qv : ProbabilitySimplex d) : l1SingleKernel ∘ₘ ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) = obsLaw (observedMarginal (l1Embedding Pv Qv)) := by classical letI : IsMarkovKernel (l1SingleKernel (d := d)) := by unfold l1SingleKernel refine ⟨fun z => ⟨?_⟩⟩ change (map _ (uniformOfFintype (Fin 4))).toMeasure univ = 1 exact measure_univ letI : IsProbabilityMeasure ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) := by infer_instance apply Measure.ext_of_singleton rintro ⟨x, a, y⟩ rw [← ENNReal.toReal_eq_toReal_iff' (measure_ne_top _ _) (measure_ne_top _ _)] unfold obsLaw rw [PMF.toMeasure_apply_singleton _ _ (measurableSet_singleton _)] change ((l1SingleKernel ∘ₘ ((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure)) {(x, a, y)}).toReal = jointMass (observedMarginal (l1Embedding Pv Qv)) x a y rw [Measure.bind_apply (measurableSet_singleton _) (Kernel.aemeasurable _)] rw [MeasureTheory.lintegral_fintype] change (∑ z : Fin d × Fin d, (l1SingleKernel z {(x, a, y)}) * (((simplexPMF Pv).toMeasure.prod (simplexPMF Qv).toMeasure) {z})).toReal = _ simp_rw [l1_source_singleton Pv Qv] have hs := l1Embedding_spec Pv Qv fin_cases a <;> fin_cases y all_goals rw [ENNReal.toReal_sum (by intro z _hz exact ENNReal.mul_ne_top (measure_ne_top _ _) (ENNReal.mul_ne_top ENNReal.ofReal_ne_top ENNReal.ofReal_ne_top))] all_goals simp_rw [ENNReal.toReal_mul, l1_kernel_atom_formula, ENNReal.toReal_ofReal (Pv.2.1 _), ENNReal.toReal_ofReal (Qv.2.1 _)] all_goals rw [Fintype.sum_prod_type] all_goals simp [Pv.2.2, Qv.2.2, hs.2.2.1 x, hs.2.2.2.1 x, hs.2.2.2.2.1 x, hs.2.2.2.2.2 x] · calc _ = (1 / 4 * Pv.1 x) * ∑ i, Qv.1 i := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _hi ring _ = _ := by rw [Qv.2.2]; ring · calc _ = (∑ i, Pv.1 i) * (1 / 4 * Qv.1 x) := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro i _hi ring _ = _ := by rw [Pv.2.2]; ring · calc _ = (∑ i, Pv.1 i) * (1 / 4 * Qv.1 x) := by rw [Finset.sum_mul] apply Finset.sum_congr rfl intro i _hi ring _ = _ := by rw [Pv.2.2]; ring · calc _ = (1 / 4 * Pv.1 x) * ∑ i, Qv.1 i := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro i _hi ring _ = _ := by rw [Qv.2.2]; ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1SingleKernel_comp_pair · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:68
theorem observedOptimalValue_mem_unitInterval

If the observed law satisfies the stated model restrictions, then the stated observed optimal value mem unit interval relation holds.

Formal statement
d :
epsilon :
P :
hP :
observedOptimalValue P hP ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma observedOptimalValue_mem_unitInterval {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : observedOptimalValue P hP ∈ Icc (0 : ℝ) 1 := by have hj (x : Fin d) (a y : Bool) : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg have hc (x : Fin d) : 0 ≤ cellMass P x := by exact sum_nonneg fun a _ => sum_nonneg fun y _ => hj x a y have hm (x : Fin d) (a : Bool) : outcomeMean P a x ∈ Icc (0 : ℝ) 1 := by have ha : 0 ≤ armMass P a x := sum_nonneg fun y _ => hj x a y have hle : jointMass P x a truearmMass P a x := by simp [armMass] exact hj x a false exact ⟨div_nonneg (hj x a true) ha, div_le_one_of_le₀ hle ha⟩ have hsum : ∑ x : Fin d, cellMass P x = 1 := by calc _ = ∑ z : Obs d, (P.pmf z).toReal := by simp [cellMass, jointMass, Fintype.sum_prod_type] _ = 1 := by simpa using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm rw [observedOptimalValue, observedOptimalValueRaw] constructor · exact sum_nonneg fun x _ => mul_nonneg (hc x) ((hm x false).1.trans (le_max_left _ _)) · calc ∑ x : Fin d, cellMass P x * max (outcomeMean P false x) (outcomeMean P true x) ≤ ∑ x : Fin d, cellMass P x * 1 := by apply Finset.sum_le_sum intro x _hx exact mul_le_mul_of_nonneg_left (max_le (hm x false).2 (hm x true).2) (hc x) _ = 1 := by simpa using hsum
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedOptimalValue_mem_unitInterval · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:139
theorem uniformlyBounded_of_fintype Lemma uniformlyBounded_of_fintype in the paper ↗

every real-valued function on a finite set is uniformly bounded.

Formal statement
α :
Type*
f :
α → ℝ
Proof (Lean source)
lemma uniformlyBounded_of_fintype {α : Type*} [Fintype α] (f : α → ℝ) : UniformlyBounded f := by classical refine ⟨∑ x, |f x|, sum_nonneg fun _ _ => abs_nonneg _, ?_⟩ intro x exact Finset.single_le_sum (fun y _hy => abs_nonneg (f y)) (Finset.mem_univ x)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.uniformlyBounded_of_fintype · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:172

the family of observed squared-error risks is bounded above.

Formal statement
n d :
epsilon :
est :
BddAbove (range (observedRisk n (d := d) (epsilon := epsilon) est))
Proof (Lean source)
lemma observedRisk_bddAbove {n d : ℕ} {epsilon : ℝ} (est : Estimator n d) : BddAbove (range (observedRisk n (d := d) (epsilon := epsilon) est)) := by classical let M : ℝ := ∑ s, |est.1 s| have hM : 0 ≤ M := sum_nonneg fun _ _ => abs_nonneg _ have hest : ∀ s, |est.1 s| ≤ M := fun s => Finset.single_le_sum (fun t _ht => abs_nonneg (est.1 t)) (Finset.mem_univ s) refine ⟨(M + 1) ^ 2, ?_⟩ rintro _ ⟨P, rfl⟩ have htheta := observedOptimalValue_mem_unitInterval P.1 P.2 have hthetaAbs : |observedOptimalValue P.1 P.2| ≤ 1 := by rw [abs_of_nonneg htheta.1] exact htheta.2 unfold observedRisk sqRisk have hi := norm_integral_le_of_norm_le_const (μ := productLaw P.1 n) (f := fun s => (est.1 s - observedOptimalValue P.1 P.2) ^ 2) (C := (M + 1) ^ 2) (Filter.Eventually.of_forall fun s => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _), sq_le_sq, abs_of_nonneg (add_nonneg hM (by norm_num))] exact (abs_sub _ _).trans (add_le_add (hest s) hthetaAbs)) exact (le_abs_self _).trans (by simpa [Real.norm_eq_abs] using hi)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.observedRisk_bddAbove · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:181
theorem l1Embedding_observed_reduction

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, then the L1 embedding is an admissible equal-propensity observed model whose optimal value is one half plus one quarter of the L1 distance.

Formal statement
n d :
epsilon :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
Pv Qv :
∃ hP : ObservedModelClass epsilon P,
conclusion 1
x :
cellMass P x = (Pv.1 x + Qv.1 x) / 2
conclusion 2
x :
0 < cellMass P x
propensity P x = 1 / 2
conclusion 3
observedOptimalValue P hP = 1 / 2 + l1Distance Pv Qv / 4
conclusion 4
l1FixedSampleKernel n d ∘ₘ fixedPairLaw n (Pv, Qv) = productLaw P n
Proof (Lean source)
lemma l1Embedding_observed_reduction {n d : ℕ} {epsilon : ℝ} (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) : ∀ Pv Qv : ProbabilitySimplex d, let P := observedMarginal (l1Embedding Pv Qv) ∃ hP : ObservedModelClass epsilon P, (∀ x, cellMass P x = (Pv.1 x + Qv.1 x) / 2) ∧ (∀ x, 0 < cellMass P x → propensity P x = 1 / 2) ∧ observedOptimalValue P hP = 1 / 2 + l1Distance Pv Qv / 4 ∧ l1FixedSampleKernel n d ∘ₘ fixedPairLaw n (Pv, Qv) = productLaw P n := by classical intro Pv Qv let P := observedMarginal (l1Embedding Pv Qv) have hs := l1Embedding_spec Pv Qv have hcell : ∀ x, cellMass P x = (Pv.1 x + Qv.1 x) / 2 := by intro x simp [P, cellMass, armMass, hs.2.2.1 x, hs.2.2.2.1 x, hs.2.2.2.2.1 x, hs.2.2.2.2.2 x] ring have hprop : ∀ x, 0 < cellMass P x → propensity P x = 1 / 2 := by intro x hx rw [propensity] have hsum : Pv.1 x + Qv.1 x ≠ 0 := by intro hs0 rw [hcell x, hs0] at hx norm_num at hx simp [P, armMass, hs.2.2.1 x, hs.2.2.2.1 x, hs.2.2.2.2.1 x, hs.2.2.2.2.2 x, hcell x] field_simp norm_num have hP : ObservedModelClass epsilon P := by refine ⟨hd, hepsilon.1, hepsilon.2, ?_⟩ intro x hx rw [hprop x hx] constructor <;> linarith refine ⟨hP, hcell, hprop, ?_, ?_⟩ · rw [observedOptimalValue, observedOptimalValueRaw] have hterm : ∀ x : Fin d, cellMass P x * max (outcomeMean P false x) (outcomeMean P true x) = max (Pv.1 x) (Qv.1 x) / 2 := by intro x have hp := Pv.2.1 x have hq := Qv.2.1 x by_cases hz : Pv.1 x + Qv.1 x = 0 · have hp0 : Pv.1 x = 0 := by nlinarith have hq0 : Qv.1 x = 0 := by nlinarith simp [P, cellMass, armMass, outcomeMean, hs.2.2.1 x, hs.2.2.2.1 x, hs.2.2.2.2.1 x, hs.2.2.2.2.2 x, hp0, hq0] · have hspos : 0 < Pv.1 x + Qv.1 x := lt_of_le_of_ne (add_nonneg hp hq) (Ne.symm hz) have hmuf : outcomeMean P false x = Qv.1 x / (Pv.1 x + Qv.1 x) := by have hz' : Qv.1 x + Pv.1 x ≠ 0 := by intro h apply hz linarith simp [P, armMass, outcomeMean, hs.2.2.2.1 x, hs.2.2.2.2.2 x] field_simp [hz, hz'] ring have hmut : outcomeMean P true x = Pv.1 x / (Pv.1 x + Qv.1 x) := by simp [P, armMass, outcomeMean, hs.2.2.1 x, hs.2.2.2.2.1 x] field_simp [hz] rw [hmuf, hmut, hcell x] by_cases hle : Pv.1 x ≤ Qv.1 x · rw [max_eq_right hle] have hratio : Pv.1 x / (Pv.1 x + Qv.1 x) ≤ Qv.1 x / (Pv.1 x + Qv.1 x) := by gcongr rw [max_eq_left hratio] field_simp [hz] · have hle' : Qv.1 x ≤ Pv.1 x := le_of_not_ge hle rw [max_eq_left hle'] have hratio : Qv.1 x / (Pv.1 x + Qv.1 x) ≤ Pv.1 x / (Pv.1 x + Qv.1 x) := by gcongr rw [max_eq_right hratio] field_simp [hz] rw [Finset.sum_congr rfl (fun x _ => hterm x)] unfold l1Distance have hpoint : ∀ x : Fin d, max (Pv.1 x) (Qv.1 x) / 2 = (Pv.1 x + Qv.1 x) / 4 + |Pv.1 x - Qv.1 x| / 4 := by intro x by_cases hle : Pv.1 x ≤ Qv.1 x · rw [max_eq_right hle, abs_of_nonpos (sub_nonpos.mpr hle)] ring · have hle' : Qv.1 x ≤ Pv.1 x := le_of_not_ge hle rw [max_eq_left hle', abs_of_nonneg (sub_nonneg.mpr hle')] ring simp_rw [hpoint] rw [Finset.sum_add_distrib, ← Finset.sum_div, ← Finset.sum_div, Finset.sum_add_distrib, Pv.2.2, Qv.2.2] ring · letI : IsMarkovKernel (l1SingleKernel (d := d)) := by unfold l1SingleKernel refine ⟨fun z => ⟨?_⟩⟩ change (map _ (uniformOfFintype (Fin 4))).toMeasure univ = 1 exact measure_univ unfold l1FixedSampleKernel fixedPairLaw productLaw rw [finProductKernel_comp_pi] congr 1 funext i exact l1SingleKernel_comp_pair Pv Qv
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1Embedding_observed_reduction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:205
theorem l1_minimax_transfer

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, then observed optimal-value minimax risk is at least one sixteenth of the paired-distribution L1 minimax risk.

Formal statement
n d :
epsilon :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
Pv0 Qv0 :
fixedL1MinimaxRisk n d / 16 ≤ minimaxRisk n d epsilon
Proof (Lean source)
lemma l1_minimax_transfer {n d : ℕ} {epsilon : ℝ} (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (Pv0 Qv0 : ProbabilitySimplex d) : fixedL1MinimaxRisk n d / 16 ≤ minimaxRisk n d epsilon := by classical letI : IsMarkovKernel (l1SingleKernel (d := d)) := by unfold l1SingleKernel refine ⟨fun z => ⟨?_⟩⟩ change (map _ (uniformOfFintype (Fin 4))).toMeasure univ = 1 exact measure_univ letI : Nonempty (Estimator n d) := ⟨⟨fun _ => 0, measurable_const⟩⟩ letI : Nonempty (ProbabilitySimplex d × ProbabilitySimplex d) := ⟨(Pv0, Qv0)⟩ letI : IsMarkovKernel (l1FixedSampleKernel n d) := by unfold l1FixedSampleKernel infer_instance unfold minimaxRisk apply Causalean.Stat.le_minimaxValue intro est let sourceEst : FixedL1Estimator n d := ⟨Causalean.Stat.kernelAffinePullback (l1FixedSampleKernel n d) (1 / 4) (1 / 2) est.1, Causalean.Stat.measurable_kernelAffinePullback _ est.2⟩ have hmin : fixedL1MinimaxRisk n d ≤ worstCaseRisk (fixedL1Risk (d := d) n) sourceEst := by unfold fixedL1MinimaxRisk exact minimaxValue_le_worstCaseRisk_of_nonneg (fun _ _ => by unfold fixedL1Risk sqRisk; positivity) sourceEst have hwc : worstCaseRisk (fixedL1Risk (d := d) n) sourceEst ≤ 16 * worstCaseRisk (observedRisk n (d := d) (epsilon := epsilon)) est := by apply worstCaseRisk_le rintro ⟨Pv, Qv⟩ obtain ⟨hP, _hcell, _hprop, hvalue, hkernel⟩ := l1Embedding_observed_reduction (n := n) hd hepsilon Pv Qv let MP : ModelLaw d epsilon := ⟨observedMarginal (l1Embedding Pv Qv), hP⟩ letI : IsProbabilityMeasure (fixedPairLaw n (Pv, Qv)) := by unfold fixedPairLaw infer_instance have htarget := le_worstCaseRisk (observedRisk_bddAbove est) MP have htransport := sqRisk_kernelAffinePullback_le_comp (fixedPairLaw n (Pv, Qv)) (l1FixedSampleKernel n d) (a := (1 / 4 : ℝ)) (b := (1 / 2 : ℝ)) (theta := l1Distance Pv Qv) (by norm_num) est.2 (uniformlyBounded_of_fintype est.1) have hpoint : fixedL1Risk n sourceEst (Pv, Qv) ≤ 16 * observedRisk (epsilon := epsilon) n est MP := by change sqRisk (fixedPairLaw n (Pv, Qv)) sourceEst.1 (l1Distance Pv Qv) ≤ 16 * sqRisk (productLaw (observedMarginal (l1Embedding Pv Qv)) n) est.1 (observedOptimalValue (observedMarginal (l1Embedding Pv Qv)) hP) dsimp [sourceEst] rw [hkernel] at htransport rw [hvalue] have htransport' : (1 / 16 : ℝ) * sqRisk (fixedPairLaw n (Pv, Qv)) (kernelAffinePullback (l1FixedSampleKernel n d) (1 / 4) (1 / 2) est.1) (l1Distance Pv Qv) ≤ sqRisk (productLaw (observedMarginal (l1Embedding Pv Qv)) n) est.1 (1 / 2 + l1Distance Pv Qv / 4) := by convert htransport using 1 <;> ring linarith exact hpoint.trans (mul_le_mul_of_nonneg_left htarget (by norm_num)) calc fixedL1MinimaxRisk n d / 16 ≤ worstCaseRisk (fixedL1Risk (d := d) n) sourceEst / 16 := by gcongr _ ≤ worstCaseRisk (observedRisk n (d := d) (epsilon := epsilon)) est := by linarith
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.l1_minimax_transfer · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:307
theorem equal_propensity_l1_reduction Proposition 3 in the paper ↗

If the product experiment has the stated independent-sampling law, and the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, then the equal-propensity embedding transfers the paired-distribution L1 minimax lower bound to observed optimal-value estimation.

Formal statement
n d :
epsilon :
P0 :
mu_n :
Measure (Fin n → Obs d)
h_iid :
IidSampling P0 mu_n
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
Pv Qv :
∃ hP : ObservedModelClass epsilon P,
conclusion 1
x :
cellMass P x = (Pv.1 x + Qv.1 x) / 2
conclusion 2
x :
0 < cellMass P x
propensity P x = 1 / 2
conclusion 3
observedOptimalValue P hP = 1 / 2 + l1Distance Pv Qv / 4
conclusion 4
l1FixedSampleKernel n d ∘ₘ fixedPairLaw n (Pv, Qv) = productLaw P n
conclusion 5
fixedL1MinimaxRisk n d / 16 ≤ minimaxRisk n d epsilon
Proof (Lean source)
theorem equal_propensity_l1_reduction {n d : ℕ} {epsilon : ℝ} (P0 : DiscreteLaw d) (mu_n : Measure (Fin n → Obs d)) (h_iid : IidSampling P0 mu_n) (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) : ∀ Pv Qv : ProbabilitySimplex d, let P := observedMarginal (l1Embedding Pv Qv) ∃ hP : ObservedModelClass epsilon P, (∀ x, cellMass P x = (Pv.1 x + Qv.1 x) / 2) ∧ (∀ x, 0 < cellMass P x → propensity P x = 1 / 2) ∧ observedOptimalValue P hP = 1 / 2 + l1Distance Pv Qv / 4 ∧ l1FixedSampleKernel n d ∘ₘ fixedPairLaw n (Pv, Qv) = productLaw P n ∧ fixedL1MinimaxRisk n d / 16 ≤ minimaxRisk n d epsilon := by intro Pv Qv obtain ⟨hP, hcell, hprop, hvalue, hkernel⟩ := l1Embedding_observed_reduction (n := n) hd hepsilon Pv Qv exact ⟨hP, hcell, hprop, hvalue, hkernel, l1_minimax_transfer hd hepsilon Pv Qv⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.equal_propensity_l1_reduction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TEqualPropensityL1Reduction.lean:378
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TIdentificationAndExtension 27 declarations Identification, global extension bounds, and equivalence of observed and causal experiments.

Identification, global extension bounds, and equivalence of observed and causal experiments.

For the specified success probability, binary value, the completion Bernoulli mass assigns probability p to success and one minus p to failure.

Definition (Lean source)
p :
y :
completionBernoulliMass p y :
if y then p else 1 - p
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.completionBernoulliMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:10
def completionFullMass

For the specified discrete law, data point or sample, the completion full-data mass equals the observed joint mass times the counterfactual Bernoulli mass when consistency holds, and zero otherwise.

Definition (Lean source)
d :
P :
z :
completionFullMass P z :
if z.2.2.1
= (if z.2.1 then z.2.2.2.2 else z.2.2.2.1) then jointMass P z.1 z.2.1 z.2.2.1 * completionBernoulliMass (outcomeMean P (!z.2.1) z.1) (if z.2.1 then z.2.2.2.1 else z.2.2.2.2) else 0
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.completionFullMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:14
theorem jointMass_nonneg

the stated joint mass nonnegativity relation holds.

Formal statement
d :
P :
x :
Fin d
a y :
0 ≤ jointMass P x a y
Proof (Lean source)
lemma jointMass_nonneg {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a y : Bool) : 0 ≤ jointMass P x a y := ENNReal.toReal_nonneg
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jointMass_nonneg · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:23
theorem cellMass_nonneg

the stated cell mass nonnegativity relation holds.

Formal statement
d :
P :
x :
Fin d
0 ≤ cellMass P x
Proof (Lean source)
lemma cellMass_nonneg {d : ℕ} (P : DiscreteLaw d) (x : Fin d) : 0 ≤ cellMass P x := by exact sum_nonneg fun a _ => sum_nonneg fun y _ => jointMass_nonneg P x a y
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellMass_nonneg · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:28
theorem outcomeMean_mem_unitInterval

the stated outcome mean mem unit interval relation holds.

Formal statement
d :
P :
a :
x :
Fin d
outcomeMean P a x ∈ Icc (0 : ℝ) 1
Proof (Lean source)
lemma outcomeMean_mem_unitInterval {d : ℕ} (P : DiscreteLaw d) (a : Bool) (x : Fin d) : outcomeMean P a x ∈ Icc (0 : ℝ) 1 := by have hnum := jointMass_nonneg P x a true have hden : 0 ≤ armMass P a x := by exact sum_nonneg fun y _ => jointMass_nonneg P x a y have hle : jointMass P x a true ≤ armMass P a x := by simp [armMass] exact jointMass_nonneg P x a false exact ⟨div_nonneg hnum hden, div_le_one_of_le₀ hle hden⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.outcomeMean_mem_unitInterval · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:34
theorem completionFullMass_nonneg_sum

the completion masses are nonnegative and their extended-real sum is one.

Formal statement
d :
P :
conclusion 1
z :
conclusion 2
∑ z : FullObs d, ofReal (completionFullMass P z) = 1
Proof (Lean source)
lemma completionFullMass_nonneg_sum {d : ℕ} (P : DiscreteLaw d) : (∀ z, 0 ≤ completionFullMass P z) ∧ ∑ z : FullObs d, ofReal (completionFullMass P z) = 1 := by classical have hnonneg : ∀ z, 0 ≤ completionFullMass P z := by rintro ⟨x, a, y, y0, y1⟩ have hm0 := outcomeMean_mem_unitInterval P (!a) x cases a <;> simp at hm0 ⊢ <;> simp [completionFullMass, completionBernoulliMass] <;> split_ifs all_goals first | exact le_rfl | apply mul_nonneg (jointMass_nonneg P x _ y) linarith [hm0.1, hm0.2] refine ⟨hnonneg, ?_⟩ rw [← ENNReal.ofReal_sum_of_nonneg (fun z _hz => hnonneg z)] have hsum : ∑ z : FullObs d, completionFullMass P z = ∑ z : Obs d, jointMass P z.1 z.2.1 z.2.2 := by simp [Fintype.sum_prod_type, completionFullMass, completionBernoulliMass] ring_nf rw [hsum] simpa [jointMass] using (PMF.integral_eq_sum P.pmf (fun _ : Obs d => (1 : ℝ))).symm
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.completionFullMass_nonneg_sum · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:46
def bernoulliCompletion

For the specified discrete law, the Bernoulli completion is the potential-outcome law obtained from the completion masses.

Definition (Lean source)
d :
P :
bernoulliCompletion P :
⟨PMF.ofFintype (fun z => ofReal (completionFullMass P z)) (completionFullMass_nonneg_sum P).2⟩
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:73
theorem vectorMass_cellVector_optimal

the total mass of a cell vector equals the observed cell mass.

Formal statement
d :
P :
x :
Fin d
vectorMass (cellVector P x) = cellMass P x
Proof (Lean source)
lemma vectorMass_cellVector_optimal {d : ℕ} (P : DiscreteLaw d) (x : Fin d) : vectorMass (cellVector P x) = cellMass P x := by simp [vectorMass, vectorArmMass, cellVector, cellMass, finTwoEquiv] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.vectorMass_cellVector_optimal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:79
theorem vectorArmMass_cellVector_optimal

the arm mass of a cell vector equals the observed arm mass.

Formal statement
d :
P :
x :
Fin d
a :
Fin 2
Proof (Lean source)
lemma vectorArmMass_cellVector_optimal {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a : Fin 2) : vectorArmMass (cellVector P x) a = armMass P (finTwoEquiv a) x := by rcases a with ⟨a, ha⟩ interval_cases a <;> simp [vectorArmMass, cellVector, armMass, finTwoEquiv] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.vectorArmMass_cellVector_optimal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:86
theorem cellVector_mem_overlapCone_optimal

If the observed law satisfies the stated model restrictions, then every observed cell vector belongs to the overlap cone.

Formal statement
d :
epsilon :
P :
hP :
x :
Fin d
cellVector P x ∈ overlapCone epsilon
Proof (Lean source)
lemma cellVector_mem_overlapCone_optimal {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) : cellVector P x ∈ overlapCone epsilon := by refine ⟨fun j => jointMass_nonneg P x (finTwoEquiv j.1) (finTwoEquiv j.2), ?_, ?_⟩ · rw [vectorMass_cellVector_optimal, vectorArmMass_cellVector_optimal] by_cases hp : 0 < cellMass P x · exact (le_div_iff₀ hp).mp (hP.overlap x hp).1 · have hp0 : cellMass P x = 0 := le_antisymm (le_of_not_gt hp) (cellMass_nonneg P x) have ha : 0 ≤ armMass P true x := by exact sum_nonneg fun y _ => jointMass_nonneg P x true y have hle : armMass P true x ≤ cellMass P x := by simp [armMass, cellMass] nlinarith [jointMass_nonneg P x false false, jointMass_nonneg P x false true] have ha0 : armMass P true x = 0 := le_antisymm (hle.trans_eq hp0) ha simpa [hp0, ha0, finTwoEquiv] · rw [vectorMass_cellVector_optimal, vectorArmMass_cellVector_optimal] by_cases hp : 0 < cellMass P x · exact (div_le_iff₀ hp).mp (hP.overlap x hp).2 · have hp0 : cellMass P x = 0 := le_antisymm (le_of_not_gt hp) (cellMass_nonneg P x) have ha : 0 ≤ armMass P true x := by exact sum_nonneg fun y _ => jointMass_nonneg P x true y have hle : armMass P true x ≤ cellMass P x := by simp [armMass, cellMass] nlinarith [jointMass_nonneg P x false false, jointMass_nonneg P x false true] have ha0 : armMass P true x = 0 := le_antisymm (hle.trans_eq hp0) ha simpa [hp0, ha0, finTwoEquiv]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.cellVector_mem_overlapCone_optimal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:95
theorem armCellValue_cellVector

If the observed law satisfies the stated model restrictions, then the arm value of a cell vector equals cell mass times the corresponding outcome mean.

Formal statement
d :
epsilon :
P :
hP :
x :
Fin d
a :
Fin 2
armCellValue epsilon a (cellVector P x) = cellMass P x * outcomeMean P (finTwoEquiv a) x
Proof (Lean source)
lemma armCellValue_cellVector {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) (a : Fin 2) : armCellValue epsilon a (cellVector P x) = cellMass P x * outcomeMean P (finTwoEquiv a) x := by have hcone := cellVector_mem_overlapCone_optimal P hP x have hmass := vectorMass_cellVector_optimal P x have harm := vectorArmMass_cellVector_optimal P x a by_cases hp : cellMass P x = 0 · have ha_nonneg : 0 ≤ armMass P (finTwoEquiv a) x := by exact sum_nonneg fun y _ => jointMass_nonneg P x (finTwoEquiv a) y have ha_le : armMass P (finTwoEquiv a) x ≤ cellMass P x := by rcases a with ⟨a, ha⟩ interval_cases a <;> simp [armMass, cellMass, finTwoEquiv] <;> nlinarith [jointMass_nonneg P x false false, jointMass_nonneg P x false true, jointMass_nonneg P x true false, jointMass_nonneg P x true true] have ha0 : armMass P (finTwoEquiv a) x = 0 := le_antisymm (ha_le.trans_eq hp) ha_nonneg simp [armCellValue, hmass, hp] · have hp_pos : 0 < cellMass P x := lt_of_le_of_ne (cellMass_nonneg P x) (Ne.symm hp) have hden : epsilon * cellMass P x ≤ armMass P (finTwoEquiv a) x := by have ht : epsilon * cellMass P x ≤ armMass P true x := by simpa [vectorMass_cellVector_optimal, vectorArmMass_cellVector_optimal, finTwoEquiv] using hcone.2.1 have hf : epsilon * cellMass P x ≤ armMass P false x := by have hsum : cellMass P x = armMass P false x + armMass P true x := by simp [cellMass, armMass] ring have hu : armMass P true x ≤ (1 - epsilon) * cellMass P x := by simpa [vectorMass_cellVector_optimal, vectorArmMass_cellVector_optimal, finTwoEquiv] using hcone.2.2 nlinarith fin_cases a · simpa [finTwoEquiv] using hf · simpa [finTwoEquiv] using ht rw [armCellValue, if_neg (by simpa [hmass] using hp), hmass, harm, max_eq_left hden] unfold outcomeMean have hzEq : cellVector P x (a, 1) = jointMass P x (finTwoEquiv a) true := by rcases a with ⟨a, ha⟩ interval_cases a <;> simp [cellVector, finTwoEquiv] rw [hzEq] ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.armCellValue_cellVector · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:124
theorem globalCellValue_cellVector

If the observed law satisfies the stated model restrictions, then the global cell value equals cell mass times the larger of the two outcome means.

Formal statement
d :
epsilon :
P :
hP :
x :
Fin d
= cellMass P x * max (outcomeMean P false x) (outcomeMean P true x)
Proof (Lean source)
lemma globalCellValue_cellVector {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) : globalCellValue epsilon (cellVector P x) = cellMass P x * max (outcomeMean P false x) (outcomeMean P true x) := by rw [globalCellValue, armCellValue_cellVector P hP x 0, armCellValue_cellVector P hP x 1] change max (cellMass P x * outcomeMean P false x) (cellMass P x * outcomeMean P true x) = _ by_cases hle : outcomeMean P false x ≤ outcomeMean P true x · rw [max_eq_right hle, max_eq_right (mul_le_mul_of_nonneg_left hle (cellMass_nonneg P x))] · have hle' := le_of_not_ge hle rw [max_eq_left hle', max_eq_left (mul_le_mul_of_nonneg_left hle' (cellMass_nonneg P x))]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.globalCellValue_cellVector · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:169
theorem bernoulliCompletion_fullMass

each full-data atom of the Bernoulli completion has its prescribed completion mass.

Formal statement
d :
P :
z :
Proof (Lean source)
@[simp] lemma bernoulliCompletion_fullMass {d : ℕ} (P : DiscreteLaw d) (z : FullObs d) : fullMass (bernoulliCompletion P) z = completionFullMass P z := by rw [fullMass, bernoulliCompletion, PMF.ofFintype_apply, ENNReal.toReal_ofReal] exact (completionFullMass_nonneg_sum P).1 z
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_fullMass · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:186
theorem bernoulliCompletion_pmf_toReal

the real-valued atom probability of the Bernoulli completion equals its completion mass.

Formal statement
d :
P :
z :
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_pmf_toReal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:193
theorem completionFullMass_ofReal_toReal

converting a completion mass to an extended nonnegative real and back leaves it unchanged.

Formal statement
d :
P :
z :
Proof (Lean source)
@[simp] lemma completionFullMass_ofReal_toReal {d : ℕ} (P : DiscreteLaw d) (z : FullObs d) : (ofReal (completionFullMass P z)).toReal = completionFullMass P z := ENNReal.toReal_ofReal ((completionFullMass_nonneg_sum P).1 z)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.completionFullMass_ofReal_toReal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:199
theorem bernoulliCompletion_consistency

the Bernoulli completion satisfies consistency.

Formal statement
d :
P :
Consistency (bernoulliCompletion P)
Proof (Lean source)
lemma bernoulliCompletion_consistency {d : ℕ} (P : DiscreteLaw d) : Consistency (bernoulliCompletion P) := by intro z hz rw [bernoulliCompletion_fullMass, completionFullMass, if_neg hz]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_consistency · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:206
theorem bernoulliCompletion_poAtom

each potential-outcome atom of the Bernoulli completion factors into the observed joint mass and the missing-outcome Bernoulli mass.

Formal statement
d :
P :
x :
Fin d
a y0 y1 :
= jointMass P x a (if a then y1 else y0) * completionBernoulliMass (outcomeMean P (!a) x) (if a then y0 else y1)
Proof (Lean source)
lemma bernoulliCompletion_poAtom {d : ℕ} (P : DiscreteLaw d) (x : Fin d) (a y0 y1 : Bool) : poAtom (bernoulliCompletion P) x a y0 y1 = jointMass P x a (if a then y1 else y0) * completionBernoulliMass (outcomeMean P (!a) x) (if a then y0 else y1) := by simp [poAtom, bernoulliCompletion_fullMass, completionFullMass]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_poAtom · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:213
theorem bernoulliCompletion_poAtom_factorization

If the observed law satisfies the stated model restrictions, then each potential-outcome atom factors into cell mass, treatment propensity, and the two Bernoulli outcome masses.

Formal statement
d :
epsilon :
P :
hP :
x :
Fin d
a y0 y1 :
Proof (Lean source)
lemma bernoulliCompletion_poAtom_factorization {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) (x : Fin d) (a y0 y1 : Bool) : poAtom (bernoulliCompletion P) x a y0 y1 = cellMass P x * completionBernoulliMass (propensity P x) a * completionBernoulliMass (outcomeMean P false x) y0 * completionBernoulliMass (outcomeMean P true x) y1 := by have hf := observedModelClass_factorization P hP x false have ht := observedModelClass_factorization P hP x true fin_cases a <;> fin_cases y0 <;> fin_cases y1 <;> simp only [bernoulliCompletion_poAtom, completionBernoulliMass, Bool.not_true, Bool.not_false, if_true, if_false, Bool.false_eq_true] at hf ht ⊢ all_goals first | rw [ht.1] | rw [ht.2] | rw [hf.1] | rw [hf.2] all_goals ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_poAtom_factorization · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:222
theorem bernoulliCompletion_exchangeability

If the observed law satisfies the stated model restrictions, then the Bernoulli completion satisfies conditional exchangeability.

Formal statement
d :
epsilon :
P :
hP :
Proof (Lean source)
lemma bernoulliCompletion_exchangeability {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : ConditionalExchangeability (bernoulliCompletion P) := by intro x r a ya fin_cases r <;> fin_cases a <;> fin_cases ya <;> simp [poArmAtom, bernoulliCompletion_poAtom_factorization P hP, completionBernoulliMass] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_exchangeability · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:241
theorem bernoulliCompletion_joint_independence

If the observed law satisfies the stated model restrictions, then treatment is conditionally independent of the pair of potential outcomes given the covariate.

Formal statement
d :
epsilon :
P :
hP :
x a y0 y1 :
poAtom (bernoulliCompletion P) x a y0 y1 * (∑ a' : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a' u0 u1)
= (∑ a' : Bool, poAtom (bernoulliCompletion P) x a' y0 y1) * (∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a u0 u1)
Proof (Lean source)
lemma bernoulliCompletion_joint_independence {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : ∀ x a y0 y1, poAtom (bernoulliCompletion P) x a y0 y1 * (∑ a' : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a' u0 u1) = (∑ a' : Bool, poAtom (bernoulliCompletion P) x a' y0 y1) * (∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a u0 u1) := by intro x a y0 y1 fin_cases a <;> fin_cases y0 <;> fin_cases y1 <;> simp [bernoulliCompletion_poAtom_factorization P hP, completionBernoulliMass] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_joint_independence · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:251
theorem bernoulliCompletion_potential_independence

If the observed law satisfies the stated model restrictions, then the two potential outcomes are conditionally independent given the covariate.

Formal statement
d :
epsilon :
P :
hP :
x y0 y1 :
(∑ a : Bool, poAtom (bernoulliCompletion P) x a y0 y1) * (∑ a : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a u0 u1)
= (∑ a : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a y0 u1) * (∑ a : Bool, ∑ u0 : Bool, poAtom (bernoulliCompletion P) x a u0 y1)
Proof (Lean source)
lemma bernoulliCompletion_potential_independence {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : ∀ x y0 y1, (∑ a : Bool, poAtom (bernoulliCompletion P) x a y0 y1) * (∑ a : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a u0 u1) = (∑ a : Bool, ∑ u1 : Bool, poAtom (bernoulliCompletion P) x a y0 u1) * (∑ a : Bool, ∑ u0 : Bool, poAtom (bernoulliCompletion P) x a u0 y1) := by intro x y0 y1 fin_cases y0 <;> fin_cases y1 <;> simp [bernoulliCompletion_poAtom_factorization P hP, completionBernoulliMass] <;> ring
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_potential_independence · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:267
theorem bernoulliCompletion_observedMarginal

the observed marginal of the Bernoulli completion recovers the original observed law.

Formal statement
d :
P :
Proof (Lean source)
lemma bernoulliCompletion_observedMarginal {d : ℕ} (P : DiscreteLaw d) : observedMarginal (bernoulliCompletion P) = P := by cases P with | mk pmf => change ⟨_⟩ = (⟨pmf⟩ : DiscreteLaw d) congr 1 apply PMF.ext rintro ⟨x, a, y⟩ rw [← ENNReal.toReal_eq_toReal_iff' (PMF.apply_ne_top _ _) (PMF.apply_ne_top _ _)] change (map _ (bernoulliCompletion ⟨pmf⟩).pmf (x, a, y)).toReal = _ rw [PMF.map_apply, ENNReal.tsum_toReal_eq (fun z => by split · exact PMF.apply_ne_top _ _ · simp), tsum_fintype] have hsum (f : FullObs d → ℝ) : ∑ z : FullObs d, f z = ∑ x : Fin d, ∑ a : Bool, ∑ y : Bool, ∑ y0 : Bool, ∑ y1 : Bool, f (x, a, y, y0, y1) := by simp [Fintype.sum_prod_type] rw [hsum] simp only [apply_ite, ENNReal.toReal_zero, bernoulliCompletion_pmf_toReal] simp [completionFullMass, completionBernoulliMass] ring_nf fin_cases a <;> fin_cases y <;> simp [jointMass]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_observedMarginal · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:284
def BernoulliCompletionConstruction

The particular completion used for observed-margin surjectivity: potential outcomes are conditionally independent Bernoulli variables, treatment is independent of their joint vector given X, and the observed outcome is selected by treatment.

Definition (Lean source)
d :
P :
Q :
BernoulliCompletionConstruction P Q :
Prop
clause 1
clause 2
Consistency Q
clause 4
x a y0 y1 :
poAtom Q x a y0 y1 * (∑ a' : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom Q x a' u0 u1)
= (∑ a' : Bool, poAtom Q x a' y0 y1) * (∑ u0 : Bool, ∑ u1 : Bool, poAtom Q x a u0 u1)
clause 5
x y0 y1 :
(∑ a : Bool, poAtom Q x a y0 y1) * (∑ a : Bool, ∑ u0 : Bool, ∑ u1 : Bool, poAtom Q x a u0 u1)
= (∑ a : Bool, ∑ u1 : Bool, poAtom Q x a y0 u1) * (∑ a : Bool, ∑ u0 : Bool, poAtom Q x a u0 y1)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.BernoulliCompletionConstruction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:311
theorem bernoulliCompletion_construction

If the observed law satisfies the stated model restrictions, then the Bernoulli completion supplies a valid completion of the observed law.

Formal statement
d :
epsilon :
P :
hP :
Proof (Lean source)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_construction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:328
theorem bernoulliCompletion_mem_class

If the observed law satisfies the stated model restrictions, then the Bernoulli completion belongs to the causal completion class.

Formal statement
d :
epsilon :
P :
hP :
Proof (Lean source)
lemma bernoulliCompletion_mem_class {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hP : ObservedModelClass epsilon P) : CausalCompletionClass epsilon (bernoulliCompletion P) := by refine ⟨hP.d_ge_two, hP.epsilon_pos, hP.epsilon_lt_half, bernoulliCompletion_consistency P, bernoulliCompletion_exchangeability P hP, ?_⟩ simpa [bernoulliCompletion_observedMarginal P] using hP.overlap
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.bernoulliCompletion_mem_class · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:339
theorem identification_and_extension_raw

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the observed law satisfies the stated model restrictions, then the Bernoulli construction extends every admissible observed law to a causal model with the identified optimal value.

Formal statement
d :
epsilon :
P :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hP :
conclusion 1
x :
cellVector P x ∈ overlapCone epsilon
conclusion 2
observedOptimalValue P hP = ∑ x, globalCellValue epsilon (cellVector P x)
conclusion 3
u :
Cell → ℝ
(∀ j, 0 ≤ u j)
0 ≤ globalCellValue epsilon u
globalCellValue epsilon u ≤ vectorMass u
conclusion 4
u v :
Cell → ℝ
(∀ j, 0 ≤ u j)
(∀ j, 0 ≤ v j)
|globalCellValue epsilon u - globalCellValue epsilon v|
≤ (1 + epsilon⁻¹) * l1CellDistance u v
Proof (Lean source)
theorem identification_and_extension_raw {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (hP : ObservedModelClass epsilon P) : (∀ x, cellVector P x ∈ overlapCone epsilon) ∧ observedOptimalValue P hP = ∑ x, globalCellValue epsilon (cellVector P x) ∧ (∀ u : Cell → ℝ, (∀ j, 0 ≤ u j) → 0 ≤ globalCellValue epsilon u ∧ globalCellValue epsilon u ≤ vectorMass u) ∧ (∀ u v : Cell → ℝ, (∀ j, 0 ≤ u j) → (∀ j, 0 ≤ v j) → |globalCellValue epsilon u - globalCellValue epsilon v| ≤ (1 + epsilon⁻¹) * l1CellDistance u v) ∧ (∃ Q : PotentialLaw d, CausalCompletionClass epsilon Q ∧ BernoulliCompletionConstruction P Q) ∧ (∀ Q : PotentialLaw d, CausalCompletionClass epsilon Q → ObservedModelClass epsilon (observedMarginal Q)) := by refine ⟨fun x => cellVector_mem_overlapCone_optimal P hP x, ?_, ?_, ?_, ?_, ?_⟩ · rw [observedOptimalValue, observedOptimalValueRaw] apply Finset.sum_congr rfl intro x _hx exact (globalCellValue_cellVector P hP x).symm · exact fun u hu => globalCellValue_bounds hepsilon.1 u hu · exact fun u v hu hv => globalCellValue_lipschitz hepsilon.1 u v hu hv · exact ⟨bernoulliCompletion P, bernoulliCompletion_mem_class P hP, bernoulliCompletion_construction P hP⟩ · intro Q hQ exact hQ.observedModel
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.identification_and_extension_raw · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:348
theorem identification_and_extension Proposition 1 in the paper ↗

If the alphabet size satisfies its stated restriction, and the overlap parameter satisfies its stated range restriction, and the observed law satisfies the stated model restrictions, then the observed optimal-value functional is identified and every admissible observed law has a causal completion with the same oracle value.

Formal statement
d :
epsilon :
P :
hd :
2 ≤ d
hepsilon :
0 < epsilon ∧ epsilon < 1 / 2
hP :
conclusion 1
x :
cellVector P x ∈ overlapCone epsilon
conclusion 2
= ∑ x, globalCellValueNonnegative epsilon ⟨cellVector P x, (cellVector_mem_overlapCone_optimal P hP x).1⟩
conclusion 4
≤ (1 + epsilon⁻¹) * l1CellDistance u.1 v.1
Proof (Lean source)
theorem identification_and_extension {d : ℕ} {epsilon : ℝ} (P : DiscreteLaw d) (hd : 2 ≤ d) (hepsilon : 0 < epsilon ∧ epsilon < 1 / 2) (hP : ObservedModelClass epsilon P) : (∀ x, cellVector P x ∈ overlapCone epsilon) ∧ observedOptimalValue P hP = ∑ x, globalCellValueNonnegative epsilon ⟨cellVector P x, (cellVector_mem_overlapCone_optimal P hP x).1⟩ ∧ (∀ u : NonnegativeCellVector, 0 ≤ globalCellValueNonnegative epsilon u ∧ globalCellValueNonnegative epsilon u ≤ vectorMass u.1) ∧ (∀ u v : NonnegativeCellVector, |globalCellValueNonnegative epsilon u - globalCellValueNonnegative epsilon v| ≤ (1 + epsilon⁻¹) * l1CellDistance u.1 v.1) ∧ (∃ Q : PotentialLaw d, CausalCompletionClass epsilon Q ∧ BernoulliCompletionConstruction P Q) ∧ (∀ Q : PotentialLaw d, CausalCompletionClass epsilon Q → ObservedModelClass epsilon (observedMarginal Q)) := by rcases identification_and_extension_raw P hd hepsilon hP with ⟨hcone, hvalue, hbounds, hlipschitz, hcompletion, hconverse⟩ refine ⟨hcone, ?_, ?_, ?_, hcompletion, hconverse⟩ · simpa [globalCellValueNonnegative] using hvalue · intro u simpa [globalCellValueNonnegative] using hbounds u.1 u.2 · intro u v simpa [globalCellValueNonnegative] using hlipschitz u.1 v.1 u.2 v.2
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.identification_and_extension · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TIdentificationAndExtension.lean:376
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TJacksonFactorialUpper 1 declarations Uniform upper risk bound for the explicit Jackson--factorial estimator.

Uniform upper risk bound for the explicit Jackson--factorial estimator.

theorem jackson_factorial_upper Theorem 1 in the paper ↗

If the product experiment has the stated independent-sampling law, then the stated jackson factorial upper relation holds.

Formal statement
h_iid :
∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)
∃ tuning : JacksonTuning,
2 < tuning.boundedAlphabetCutoff
conclusion 1
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ Cepsilon : ℝ,
0 < Cepsilon
n d :
1 ≤ n
2 ≤ d
P :
hP :
sqRisk (productLaw P n) (jacksonFactorialEstimator tuning epsilon) (observedOptimalValue P hP)
≤ Cepsilon * min 1 (d / (n * logAlphabet d))
Proof (Lean source)
theorem jackson_factorial_upper (h_iid : ∀ {d n : ℕ} (P : DiscreteLaw d), IidSampling P (productLaw P n)) : ∃ tuning : JacksonTuning, 2 < tuning.boundedAlphabetCutoff ∧ ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ Cepsilon : ℝ, 0 < Cepsilon ∧ ∀ n d : ℕ, 1 ≤ n → 2 ≤ d → ∀ P : DiscreteLaw d, ∀ hP : ObservedModelClass epsilon P, Causalean.Stat.sqRisk (productLaw P n) (jacksonFactorialEstimator tuning epsilon) (observedOptimalValue P hP) ≤ Cepsilon * min 1 (d / (n * logAlphabet d)) := by obtain ⟨tuning, htuning, hpilot⟩ := centered_factorial_pilot_control h_iid subst tuning refine ⟨canonicalJacksonTuning, canonicalJacksonTuning_cutoff, ?_⟩ intro epsilon hepsilon hepsilonHalf obtain ⟨C, hC, hcontrols⟩ := hpilot epsilon hepsilon hepsilonHalf let Cepsilon : ℝ := 20000000 * (1 + C + C ^ 2) + 2000 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) + 10 have hCe : 0 < Cepsilon := by dsimp [Cepsilon] have hsq : 0 ≤ C ^ 2 := sq_nonneg C have hie : 0 ≤ epsilon⁻¹ := inv_nonneg.mpr (le_of_lt hepsilon) have hiesq : 0 ≤ epsilon⁻¹ ^ 2 := sq_nonneg _ nlinarith refine ⟨Cepsilon, hCe, ?_⟩ intro n d hn hd P hP have hnpos : 0 < n := by omega have hnR : 0 < (n : ℝ) := by exact_mod_cast hnpos have hdR : 0 < (d : ℝ) := by positivity have hL : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) exact he.trans_le (by simpa using mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hLle : logAlphabet d ≤ d := by rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdR), Real.log_exp] have hlog := Real.log_le_sub_one_of_pos hdR linarith have htheta := observedOptimalValue_mem_unitInterval P hP have htarget : observedOptimalValue P hP = ∑ x : Fin d, globalCellValue epsilon (cellVector P x) := by rw [observedOptimalValue, observedOptimalValueRaw] apply Finset.sum_congr rfl intro x hx exact (globalCellValue_cellVector P hP x).symm by_cases hcut : d < canonicalJacksonTuning.boundedAlphabetCutoff · have hd2 : d = 2 := by norm_num [canonicalJacksonTuning] at hcut omega subst d have hest : jacksonFactorialEstimator (n := n) (d := 2) canonicalJacksonTuning epsilon = empiricalRatioEstimator := by funext sample simp [jacksonFactorialEstimator, hcut] rw [hest] by_cases hn4 : 4 ≤ n · have hrisk := empiricalRatio_sqRisk_two_le P hP hn4 have hL2 : logAlphabet 2 ≤ 2 := hLle have hratio : (2 : ℝ) / (n * logAlphabet 2) ≤ 1 := by rw [div_le_one (mul_pos hnR hL)] have hLone : 1 ≤ logAlphabet 2 := by rw [logAlphabet] calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * 2) := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) (by norm_num)) (by nlinarith [Real.exp_pos 1]) have hn4R : (4 : ℝ) ≤ n := by exact_mod_cast hn4 nlinarith norm_num only [Nat.cast_ofNat] at ⊢ rw [min_eq_right hratio] calc _ ≤ 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) / n := hrisk _ ≤ Cepsilon * (2 / (n * logAlphabet 2)) := by have hbase : 0 ≤ 1 + epsilon⁻¹ + epsilon⁻¹ ^ 2 := by positivity have hpart : 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) ≤ Cepsilon * (2 / logAlphabet 2) := by have hcoef : 1600 * (1 + epsilon⁻¹ + epsilon⁻¹ ^ 2) ≤ Cepsilon := by dsimp [Cepsilon] nlinarith [sq_nonneg C, inv_nonneg.mpr (le_of_lt hepsilon), sq_nonneg epsilon⁻¹] have htwo : 1 ≤ 2 / logAlphabet 2 := by rw [le_div_iff₀ hL] simpa using hL2 nlinarith [mul_le_mul_of_nonneg_left htwo (le_of_lt hCe)] field_simp [ne_of_gt hnR, ne_of_gt hL] at hpart ⊢ nlinarith · have hnle : n ≤ 3 := by omega have her := empiricalRatioEstimator_mem_unitInterval (n := n) (d := 2) have hrisk : Causalean.Stat.sqRisk (productLaw P n) empiricalRatioEstimator (observedOptimalValue P hP) ≤ 1 := by unfold Causalean.Stat.sqRisk calc _ ≤ ∫ _z : Fin n → Obs 2, (1 : ℝ) ∂productLaw P n := by apply MeasureTheory.integral_mono MeasureTheory.Integrable.of_finite (MeasureTheory.integrable_const 1) intro z have hz := her z hnpos have habs : |empiricalRatioEstimator z - observedOptimalValue P hP| ≤ 1 := abs_le.mpr ⟨by linarith [hz.1, htheta.2], by linarith [hz.2, htheta.1]⟩ simpa only [sq_abs, one_pow] using (pow_le_pow_left₀ (abs_nonneg _) habs 2) _ = 1 := by simp have hratioLower : (1 / 3 : ℝ) ≤ 2 / (n * logAlphabet 2) := by rw [le_div_iff₀ (mul_pos hnR hL)] have hn3 : (n : ℝ) ≤ 3 := by exact_mod_cast hnle have hprod : (n : ℝ) * logAlphabet 2 ≤ 3 * 2 := mul_le_mul hn3 hLle (le_of_lt hL) (by norm_num) nlinarith have hminLower : (1 / 3 : ℝ) ≤ min 1 (2 / (n * logAlphabet 2)) := by rw [le_min_iff] exact ⟨by norm_num, hratioLower⟩ calc _ ≤ 1 := hrisk _ ≤ Cepsilon * min 1 (2 / (n * logAlphabet 2)) := by have hCe3 : 3 ≤ Cepsilon := by dsimp [Cepsilon] nlinarith [sq_nonneg C, inv_nonneg.mpr (le_of_lt hepsilon), sq_nonneg epsilon⁻¹] nlinarith [mul_le_mul_of_nonneg_left hminLower (le_of_lt hCe)] · by_cases hscale : (n : ℝ) < d / logAlphabet d · have hest : jacksonFactorialEstimator (n := n) (d := d) canonicalJacksonTuning epsilon = fun _ => (1 / 2 : ℝ) := by funext sample simp [jacksonFactorialEstimator, hcut, hscale] rw [hest] have hrisk : Causalean.Stat.sqRisk (productLaw P n) (fun _ => (1 / 2 : ℝ)) (observedOptimalValue P hP) ≤ 1 := by unfold Causalean.Stat.sqRisk calc _ ≤ ∫ _z : Fin n → Obs d, (1 : ℝ) ∂productLaw P n := by apply MeasureTheory.integral_mono (MeasureTheory.integrable_const _) (MeasureTheory.integrable_const _) intro z nlinarith [htheta.1, htheta.2] _ = 1 := by simp have hr : 1 < d / (n * logAlphabet d) := by rw [lt_div_iff₀ hL] at hscale rw [one_lt_div (mul_pos hnR hL)] nlinarith rw [min_eq_left (le_of_lt hr)] have hCeOne : 1 ≤ Cepsilon := by dsimp [Cepsilon] nlinarith [sq_nonneg C, inv_nonneg.mpr (le_of_lt hepsilon), sq_nonneg epsilon⁻¹] exact hrisk.trans (by simpa using hCeOne) · obtain ⟨_hcount, _htable, _hcell, _hfactorial, hcellControl⟩ := hcontrols n d P hnpos hP have huncapped := sqRisk_jacksonUncapped_le_rate P epsilon (observedOptimalValue P hP) C hnpos hd hepsilon hC htheta htarget (le_of_not_gt hscale) (fun x => (hcellControl x).1) (fun x => (hcellControl x).2.1) have houter := sqRisk_jacksonFactorialEstimator_le_marked P canonicalJacksonTuning epsilon (observedOptimalValue P hP) hnpos hcut hscale have hcap := sqRisk_marked_raoBlackwell_jackson_le P canonicalJacksonTuning epsilon (observedOptimalValue P hP) hnpos htheta have htail := Causalean.Stat.Concentration.PoissonSelfNormalized.poisson_quarter_overflow_le_inv n hnpos have hr0 : 0 ≤ d / (n * logAlphabet d) := by positivity have htailRate : 8 / (n : ℝ) ≤ 8 * (d / (n * logAlphabet d)) := by have hone : 1 ≤ d / logAlphabet d := by rw [le_div_iff₀ hL] simpa using hLle field_simp [ne_of_gt hnR, ne_of_gt hL] at hone ⊢ nlinarith have hrisk : Causalean.Stat.sqRisk (productLaw P n) (jacksonFactorialEstimator canonicalJacksonTuning epsilon) (observedOptimalValue P hP) ≤ (10000000 * (1 + C + C ^ 2) + 8) * (d / (n * logAlphabet d)) := by calc _ ≤ Causalean.Stat.sqRisk (pi (fun _ : Fin n => (obsLaw P).prod uncappedFairMarkLaw)) (raoBlackwellStatistic (toNNReal (n / 4)) (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hnpos) 0) (observedOptimalValue P hP) := houter _ ≤ Causalean.Stat.sqRisk (finitePoissonSampleLaw ((obsLaw P).prod uncappedFairMarkLaw) (toNNReal (n / 4))) (jacksonUncappedStatistic canonicalJacksonTuning epsilon n hnpos) (observedOptimalValue P hP) + (poissonMeasure (toNNReal (n / 4))).real (Ioi n) := hcap _ ≤ 10000000 * (1 + C + C ^ 2) * (d / (n * logAlphabet d)) + 8 * (d / (n * logAlphabet d)) := by have htail' : (poissonMeasure (toNNReal (n / 4))).real (Ioi n) ≤ 8 / (n : ℝ) := by have hmean : toNNReal ((n : ℝ) / 4) = (n : NNReal) / 4 := by apply NNReal.eq simp [Real.toNNReal_of_nonneg (by positivity : 0 ≤ (n : ℝ) / 4)] rw [hmean] exact htail linarith _ = _ := by ring have hrle : d / (n * logAlphabet d) ≤ 1 := by rw [div_le_one (mul_pos hnR hL)] have hscalele : (d : ℝ) / logAlphabet d ≤ n := le_of_not_gt hscale rw [div_le_iff₀ hL] at hscalele exact hscalele rw [min_eq_right hrle] calc _ ≤ (10000000 * (1 + C + C ^ 2) + 8) * (d / (n * logAlphabet d)) := hrisk _ ≤ Cepsilon * (d / (n * logAlphabet d)) := by apply mul_le_mul_of_nonneg_right _ hr0 dsimp [Cepsilon] nlinarith [sq_nonneg C, inv_nonneg.mpr (le_of_lt hepsilon), sq_nonneg epsilon⁻¹]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jackson_factorial_upper · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TJacksonFactorialUpper.lean:12
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TMatchedMinimaxFrontier 2 declarations Matched minimax frontier and its causal transfer.

Matched minimax frontier and its causal transfer.

For the specified tuning rule, sample size, alphabet size, overlap level, the Jackson worst-case risk is the supremum squared-error risk of the Jackson factorial estimator over the observed model class.

Definition (Lean source)
tuning :
n d :
epsilon :
jacksonWorstCaseRisk tuning n d epsilon :
⨆ P : ModelLaw d epsilon, sqRisk (productLaw P.1 n) (jacksonFactorialEstimator tuning epsilon) (observedOptimalValue P.1 P.2)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.jacksonWorstCaseRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TMatchedMinimaxFrontier.lean:11
theorem matched_minimax_frontier Theorem 3 in the paper ↗

If the Cai--Low moment-matching prior result is available, and the Jiao--Han--Weissman Poisson L1 lower bound is available, then the observed minimax risk is bounded above and below by positive constants times the minimum of one and d/(nlog(ed))d/(nlog(ed)), with the stated causal and fallback comparisons.

Formal statement
h_cai_low_of_gate :
h_jhw_of_gate :
∃ tuning : JacksonTuning,
2 < tuning.boundedAlphabetCutoff
conclusion 1
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ cepsilon Cepsilon : ℝ,
0 < cepsilon
cepsilon ≤ Cepsilon
n d :
1 ≤ n
2 ≤ d
cepsilon * min 1 (d / (n * logAlphabet d)) ≤ minimaxRisk n d epsilon
minimaxRisk n d epsilon ≤ jacksonWorstCaseRisk tuning n d epsilon
jacksonWorstCaseRisk tuning n d epsilon ≤ Cepsilon * min 1 (d / (n * logAlphabet d))
causalMinimaxRisk n d epsilon = minimaxRisk n d epsilon
Proof (Lean source)
theorem matched_minimax_frontier (h_cai_low_of_gate : CaiLowAbsoluteMomentPriors) (h_jhw_of_gate : JhwPoissonL1Lower) : ∃ tuning : JacksonTuning, 2 < tuning.boundedAlphabetCutoff ∧ ∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ cepsilon Cepsilon : ℝ, 0 < cepsilon ∧ -- @realizes \(c_\epsilon\)(positive lower comparison constant) cepsilon ≤ Cepsilon ∧ -- @realizes \(C_\epsilon\)(positive upper constant, since cepsilon is positive) ∀ n d : ℕ, 1 ≤ n → 2 ≤ d → cepsilon * min 1 (d / (n * logAlphabet d)) ≤ minimaxRisk n d epsilon ∧ minimaxRisk n d epsilon ≤ jacksonWorstCaseRisk tuning n d epsilon ∧ jacksonWorstCaseRisk tuning n d epsilon ≤ Cepsilon * min 1 (d / (n * logAlphabet d)) ∧ causalMinimaxRisk n d epsilon = minimaxRisk n d epsilon := by obtain ⟨tuning, htuning, hupper⟩ := jackson_factorial_upper (fun _P => rfl) refine ⟨tuning, htuning, ?_⟩ intro epsilon hepsilon hepsilon' obtain ⟨C, hC, hupper⟩ := hupper epsilon hepsilon hepsilon' obtain ⟨c, hc, hlower⟩ := all_estimator_lower (fun _P => rfl) h_cai_low_of_gate h_jhw_of_gate epsilon hepsilon hepsilon' refine ⟨c, C + c, hc, by linarith, ?_⟩ intro n d hn hd have hlog_pos : 0 < logAlphabet d := by rw [logAlphabet] exact Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) nlinarith [show (2 : ℝ) ≤ d by exact_mod_cast hd]) have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hscale : 0 ≤ min 1 ((d : ℝ) / (n * logAlphabet d)) := by rw [le_min_iff] exact ⟨by norm_num, by positivity⟩ let jf : Estimator n d := ⟨jacksonFactorialEstimator tuning epsilon, by fun_prop⟩ refine ⟨hlower n d hn hd, ?_, ?_, ?_⟩ · unfold minimaxRisk jacksonWorstCaseRisk exact minimaxValue_le_worstCaseRisk_of_nonneg (risk := observedRisk n (d := d) (epsilon := epsilon)) (by intro est P; unfold observedRisk sqRisk; positivity) jf · unfold jacksonWorstCaseRisk change worstCaseRisk (observedRisk n (d := d) (epsilon := epsilon)) jf ≤ _ cases isEmpty_or_nonempty (ModelLaw d epsilon) with | inl _ => rw [worstCaseRisk_of_isEmpty_class] positivity | inr _ => apply worstCaseRisk_le intro P change sqRisk (productLaw P.1 n) (jacksonFactorialEstimator tuning epsilon) (observedOptimalValue P.1 P.2) ≤ _ calc sqRisk (productLaw P.1 n) (jacksonFactorialEstimator tuning epsilon) (observedOptimalValue P.1 P.2) ≤ C * min 1 (d / (n * logAlphabet d)) := hupper n d hn hd P.1 P.2 _ ≤ (C + c) * min 1 (d / (n * logAlphabet d)) := by nlinarith · unfold causalMinimaxRisk minimaxRisk minimaxValue congr 1 funext est rw [worstCaseRisk_eq_sSup_range, worstCaseRisk_eq_sSup_range] congr 1 ext r constructor · rintro ⟨Q, rfl⟩ refine ⟨⟨observedMarginal Q.1, Q.2.observedModel⟩, ?_⟩ unfold causalRisk observedRisk rw [causal_optimal_value_corollary Q.1 Q.2] · rintro ⟨P, rfl⟩ obtain ⟨_hcone, _hvalue, _hbound, _hlip, hcompletion, _hconverse⟩ := identification_and_extension P.1 hd ⟨hepsilon, hepsilon'⟩ P.2 obtain ⟨Q, hQ, hconstruction⟩ := hcompletion refine ⟨⟨Q, hQ⟩, ?_⟩ unfold causalRisk observedRisk rw [causal_optimal_value_corollary Q hQ] simpa [hconstruction.1]
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.matched_minimax_frontier · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TMatchedMinimaxFrontier.lean:18
CausalSmith.Stat.STAT_DiscreteOptimalValueMinimaxMatched_Research.TParentReduction 2 declarations Deterministic comparison with the predecessor rates and bounded-alphabet branch.

Deterministic comparison with the predecessor rates and bounded-alphabet branch.

def EventualParametricRisk

Eventual two-sided parametric risk bounds along a bounded alphabet sequence.

Definition (Lean source)
epsilon :
dseq :
ℕ → ℕ
EventualParametricRisk epsilon dseq :
Prop
∃ c C : ℝ,
clause 1
0 < c
clause 2
c ≤ C
clause 3
∀ᶠ n in atTop, c / n
minimaxRisk n (dseq n) epsilon ∧ minimaxRisk n (dseq n) epsilon ≤ C / n
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.EventualParametricRisk · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TParentReduction.lean:7
theorem parent_reduction Proposition 4 in the paper ↗

If the Cai--Low moment-matching prior result is available, and the Jiao--Han--Weissman Poisson L1 lower bound is available, then the parent observed and causal minimax problems inherit the matched frontier, bounded-alphabet equivalence, and fallback comparisons.

Formal statement
h_cai_low_of_gate :
h_jhw_of_gate :
∃ tuning : JacksonTuning,
2 < tuning.boundedAlphabetCutoff
conclusion 1
epsilon :
0 < epsilon
epsilon < 1 / 2
∃ c C : ℝ,
0 < c
c ≤ C
n d :
1 ≤ n
2 ≤ d
c * min 1 (sqrt d / n + d / (n * log (exp 1 * n)))
minimaxRisk n d epsilon
minimaxRisk n d epsilon ≤ C * (d / n)
conclusion 2
n d :
2 ≤ d
d < tuning.boundedAlphabetCutoff
epsilon sample :
jacksonFactorialEstimator (n := n) (d := d) tuning epsilon sample
conclusion 3
epsilon :
0 < epsilon
epsilon < 1 / 2
dseq :
ℕ → ℕ
(∀ n, 2 ≤ dseq n)
(∃ dmax : ℕ, ∀ n, dseq n ≤ dmax)
Proof (Lean source)
theorem parent_reduction (h_cai_low_of_gate : CaiLowAbsoluteMomentPriors) (h_jhw_of_gate : JhwPoissonL1Lower) : ∃ tuning : JacksonTuning, 2 < tuning.boundedAlphabetCutoff ∧ (∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∃ c C : ℝ, 0 < c ∧ c ≤ C ∧ ∀ n d : ℕ, 1 ≤ n → 2 ≤ d → c * min 1 (sqrt d / n + d / (n * log (exp 1 * n))) ≤ minimaxRisk n d epsilon ∧ minimaxRisk n d epsilon ≤ C * (d / n)) ∧ (∀ n d : ℕ, 2 ≤ d → d < tuning.boundedAlphabetCutoff → ∀ epsilon sample, jacksonFactorialEstimator (n := n) (d := d) tuning epsilon sample = empiricalRatioEstimator sample) ∧ (∀ epsilon : ℝ, 0 < epsilon → epsilon < 1 / 2 → ∀ dseq : ℕ → ℕ, (∀ n, 2 ≤ dseq n) → (∃ dmax : ℕ, ∀ n, dseq n ≤ dmax) → EventualParametricRisk epsilon dseq) := by obtain ⟨tuning, htuning, hfrontier⟩ := matched_minimax_frontier h_cai_low_of_gate h_jhw_of_gate refine ⟨tuning, htuning, ?_, ?_, ?_⟩ · intro epsilon hepsilon hepsilon' obtain ⟨c, C, hc, hcC, hbounds⟩ := hfrontier epsilon hepsilon hepsilon' refine ⟨c / 4, C, by positivity, by nlinarith, ?_⟩ intro n d hn hd have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hdR : 0 < (d : ℝ) := by positivity have hlogd : 0 < logAlphabet d := by rw [logAlphabet] apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) exact lt_of_lt_of_le he (by calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * d := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hlogn : 0 < log (exp 1 * n) := by apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hn1 : (1 : ℝ) ≤ n := by exact_mod_cast hn exact lt_of_lt_of_le he (by calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * n := mul_le_mul_of_nonneg_left hn1 (Real.exp_nonneg 1)) have hlog_sqrt : logAlphabet d ≤ 2 * sqrt d := by have hsqrtpos : 0 < sqrt d := Real.sqrt_pos.2 hdR have hlog_le := Real.log_le_sub_one_of_pos hsqrtpos have hlog_sqrt_eq := Real.log_sqrt (le_of_lt hdR) rw [logAlphabet, Real.log_mul (Real.exp_ne_zero 1) (ne_of_gt hdR), Real.log_exp] at ⊢ nlinarith have hsqrt_term : sqrt d / n ≤ 2 * (d / (n * logAlphabet d)) := by rw [div_le_iff₀ hnR] have hsqrt_nonneg : 0 ≤ sqrt d := Real.sqrt_nonneg _ have hsqrt_sq : sqrt d * sqrt d = d := Real.mul_self_sqrt (le_of_lt hdR) have hcancel : 2 * (d / (n * logAlphabet d)) * n = 2 * d / logAlphabet d := by field_simp calc sqrt d ≤ 2 * d / logAlphabet d := by rw [le_div_iff₀ hlogd] nlinarith _ = 2 * (d / (n * logAlphabet d)) * n := hcancel.symm have hparent_scale : min 1 (sqrt d / n + d / (n * log (exp 1 * n))) ≤ 4 * min 1 (d / (n * logAlphabet d)) := by by_cases ha : 1 ≤ d / (n * logAlphabet d) · rw [min_eq_left ha] exact le_trans (min_le_left _ _) (by norm_num) · have ha' : d / (n * logAlphabet d) < 1 := lt_of_not_ge ha rw [min_eq_right (le_of_lt ha')] have hlogs : logAlphabet d ≤ 2 * log (exp 1 * n) := by by_cases hnd : d ≤ n · have hmul : exp 1 * (d : ℝ) ≤ exp 1 * n := mul_le_mul_of_nonneg_left (by exact_mod_cast hnd) (Real.exp_nonneg 1) have hmono : logAlphabet d ≤ log (exp 1 * n) := by rw [logAlphabet] exact Real.strictMonoOn_log.monotoneOn (mul_pos (Real.exp_pos 1) hdR) (mul_pos (Real.exp_pos 1) hnR) hmul nlinarith [hlogn] · have hdn : (n : ℝ) < d := by exact_mod_cast (lt_of_not_ge hnd) let t : ℝ := d / n have ht : 1 < t := (one_lt_div hnR).2 hdn have hsplit : logAlphabet d = log (exp 1 * n) + log t := by dsimp [t] rw [logAlphabet, ← Real.log_mul (by positivity : exp 1 * (n : ℝ) ≠ 0) (by positivity : (d : ℝ) / n ≠ 0)] congr 1 field_simp have hlogt : log t ≤ t / 2 := by have hsqrtpos : 0 < sqrt t := Real.sqrt_pos.2 (lt_trans (by norm_num) ht) have hbase := Real.log_le_sub_one_of_pos hsqrtpos have hroot := Real.log_sqrt (le_of_lt (lt_trans (by norm_num) ht)) have hsquare := Real.sq_sqrt (le_of_lt (lt_trans (by norm_num) ht)) nlinarith [sq_nonneg (sqrt t - 2)] have ht_bound : t ≤ 2 * log (exp 1 * n) := by have hat : t / logAlphabet d < 1 := by dsimp [t] simpa [div_div] using ha' rw [div_lt_one hlogd] at hat rw [hsplit] at hat nlinarith rw [hsplit] nlinarith have hsecond : d / (n * log (exp 1 * n)) ≤ 2 * (d / (n * logAlphabet d)) := by calc d / (n * log (exp 1 * n)) ≤ d / (n * (logAlphabet d / 2)) := by apply div_le_div_of_nonneg_left (le_of_lt hdR) (mul_pos hnR (div_pos hlogd (by norm_num))) exact mul_le_mul_of_nonneg_left (by linarith) (le_of_lt hnR) _ = 2 * (d / (n * logAlphabet d)) := by field_simp have hmin := min_le_right (1 : ℝ) (sqrt d / n + d / (n * log (exp 1 * n))) nlinarith [hsqrt_term, hsecond, hmin] obtain ⟨hlower, _hmiddle, hupper, _hcausal⟩ := hbounds n d hn hd constructor · calc c / 4 * min 1 (sqrt d / n + d / (n * log (exp 1 * n))) ≤ c * min 1 (d / (n * logAlphabet d)) := by nlinarith [mul_le_mul_of_nonneg_left hparent_scale (le_of_lt hc)] _ ≤ minimaxRisk n d epsilon := hlower · calc minimaxRisk n d epsilon ≤ C * min 1 (d / (n * logAlphabet d)) := _hmiddle.trans hupper _ ≤ C * (d / n) := by have hC : 0 ≤ C := le_trans (le_of_lt hc) hcC apply mul_le_mul_of_nonneg_left _ hC refine le_trans (min_le_right _ _) ?_ have hlog_one : 1 ≤ logAlphabet d := by rw [logAlphabet] have hmul : exp 1 ≤ exp 1 * (d : ℝ) := by have hd1 : (1 : ℝ) ≤ d := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * d := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1) calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * d) := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) hdR) hmul apply div_le_div_of_nonneg_left (le_of_lt hdR) hnR simpa using mul_le_mul_of_nonneg_left hlog_one (le_of_lt hnR) · intro n d hd hdcut epsilon sample simp [jacksonFactorialEstimator, hdcut] · intro epsilon hepsilon hepsilon' dseq hdseq rintro ⟨dmax, hdmax⟩ obtain ⟨c, C, hc, hcC, hbounds⟩ := hfrontier epsilon hepsilon hepsilon' have hdmax2 : 2 ≤ dmax := le_trans (hdseq 0) (hdmax 0) have hdmaxR : (2 : ℝ) ≤ dmax := by exact_mod_cast hdmax2 have hlogmax : 0 < log (exp 1 * dmax) := Real.log_pos (by have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hdmax1 : (1 : ℝ) ≤ dmax := le_trans (by norm_num) hdmaxR exact lt_of_lt_of_le he (by calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * dmax := mul_le_mul_of_nonneg_left hdmax1 (Real.exp_nonneg 1))) have hlogmax_one : 1 ≤ log (exp 1 * dmax) := by have hmul : exp 1 ≤ exp 1 * (dmax : ℝ) := by calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * dmax := mul_le_mul_of_nonneg_left (le_trans (by norm_num) hdmaxR) (Real.exp_nonneg 1) calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * dmax) := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) (by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) hdmax2))) hmul refine ⟨c * (2 / log (exp 1 * dmax)), C * dmax, ?_, ?_, ?_⟩ · positivity · have hratio : 2 / log (exp 1 * dmax) ≤ (dmax : ℝ) := by rw [div_le_iff₀ hlogmax] calc 2 ≤ (dmax : ℝ) * 1 := by simpa using hdmaxR _ ≤ (dmax : ℝ) * log (exp 1 * dmax) := mul_le_mul_of_nonneg_left hlogmax_one (Nat.cast_nonneg dmax) calc c * (2 / log (exp 1 * dmax)) ≤ c * dmax := mul_le_mul_of_nonneg_left hratio (le_of_lt hc) _ ≤ C * dmax := mul_le_mul_of_nonneg_right hcC (Nat.cast_nonneg dmax) · filter_upwards [Filter.eventually_ge_atTop dmax] with n hnmax have hn : 1 ≤ n := le_trans (by omega : 1 ≤ dmax) hnmax have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hd := hdseq n have hdR : 0 < (dseq n : ℝ) := by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) hd) have hdn := hdmax n have hlogd : 0 < logAlphabet (dseq n) := by rw [logAlphabet] apply Real.log_pos have he : 1 < exp 1 := Real.one_lt_exp_iff.mpr (by norm_num) have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) exact lt_of_lt_of_le he (by calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * dseq n := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1)) have hlogd_one : 1 ≤ logAlphabet (dseq n) := by rw [logAlphabet] have hmul : exp 1 ≤ exp 1 * (dseq n : ℝ) := by have hd1 : (1 : ℝ) ≤ dseq n := by exact_mod_cast (le_trans (by omega : 1 ≤ 2) hd) calc exp 1 = exp 1 * 1 := by ring _ ≤ exp 1 * dseq n := mul_le_mul_of_nonneg_left hd1 (Real.exp_nonneg 1) calc 1 = log (exp 1) := by rw [Real.log_exp] _ ≤ log (exp 1 * dseq n) := Real.strictMonoOn_log.monotoneOn (Real.exp_pos 1) (mul_pos (Real.exp_pos 1) hdR) hmul have hlog_le_max : logAlphabet (dseq n) ≤ log (exp 1 * dmax) := by rw [logAlphabet] apply Real.strictMonoOn_log.monotoneOn (mul_pos (Real.exp_pos 1) hdR) (mul_pos (Real.exp_pos 1) (by exact_mod_cast (lt_of_lt_of_le (by omega : 0 < 2) hdmax2))) exact mul_le_mul_of_nonneg_left (by exact_mod_cast hdn) (Real.exp_nonneg 1) have hscale : (dseq n : ℝ) / (n * logAlphabet (dseq n)) ≤ 1 := by rw [div_le_one (mul_pos hnR hlogd)] have hcast : (dseq n : ℝ) ≤ n := by exact_mod_cast (hdn.trans hnmax) exact hcast.trans (by simpa using mul_le_mul_of_nonneg_left hlogd_one (le_of_lt hnR)) obtain ⟨hlower, hmiddle, hupper, _hcausal⟩ := hbounds n (dseq n) hn hd rw [min_eq_right hscale] at hlower hupper constructor · have hratio : 2 / log (exp 1 * dmax) ≤ (dseq n : ℝ) / logAlphabet (dseq n) := by rw [div_le_div_iff₀ hlogmax hlogd] calc 2 * logAlphabet (dseq n) ≤ 2 * log (exp 1 * dmax) := by gcongr _ ≤ (dseq n : ℝ) * log (exp 1 * dmax) := by gcongr exact_mod_cast hd calc c * (2 / log (exp 1 * dmax)) / n ≤ c * ((dseq n : ℝ) / logAlphabet (dseq n)) / n := by gcongr _ = c * ((dseq n : ℝ) / (n * logAlphabet (dseq n))) := by field_simp _ ≤ minimaxRisk n (dseq n) epsilon := hlower · calc minimaxRisk n (dseq n) epsilon ≤ C * ((dseq n : ℝ) / (n * logAlphabet (dseq n))) := hmiddle.trans hupper _ ≤ C * ((dseq n : ℝ) / n) := by have hC : 0 ≤ C := le_trans (le_of_lt hc) hcC apply mul_le_mul_of_nonneg_left _ hC apply div_le_div_of_nonneg_left (le_of_lt hdR) hnR simpa using mul_le_mul_of_nonneg_left hlogd_one (le_of_lt hnR) _ ≤ C * dmax / n := by have hC : 0 ≤ C := le_trans (le_of_lt hc) hcC rw [← mul_div_assoc] rw [div_le_div_iff₀ hnR hnR] exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (by exact_mod_cast hdn) hC) (le_of_lt hnR)
CausalSmith.Stat.DiscreteOptimalValueMinimaxMatched.parent_reduction · CausalSmith/Stat/STAT_DiscreteOptimalValueMinimaxMatched_Research/TParentReduction.lean:15